AgentKit
DocsKitsCLI ReferenceDesktop App
BetaYou are reading docs for the beta channel (2.13.0-beta.20). Features may change before the next stable release.Switch to stable →

Skills

Expand edge cases with ak:scenario

Decompose a feature across twelve dimensions and produce bounded, deduplicated scenario evidence for planning and tests.

Use ak:scenario to turn a feature description or code path into concrete edge cases, failure paths, and test targets. Run one pass for a fast review, a fixed iteration count for a hard ceiling, or saturation mode to continue until two consecutive iterations add no new scenarios.

Choose ak:scenario for pre-implementation coverage

Use ak:scenario when

  • A complex or stateful feature needs edge cases before implementation.
  • You are planning regression tests, reviewing an API contract, or preparing a release risk audit.
  • Timing, scale, authorization, data integrity, integrations, or partial failure could change expected behavior.
  • You want each scenario classified and linked to an expected outcome.

Choose another workflow when

  • The change is trivial, cosmetic, or has no meaningful logic branch.
  • The target is mature and already has current evidence for the same risks.
  • You need to execute tests rather than generate targets. Use ak:test.
  • You need a five-perspective verdict on a proposed design. Use ak:predict.
  • You need implementation. Feed approved scenarios into ak:plan or ak:cook.

Prepare the target and bound

Before you start:

  • Complete Onboarding, and confirm Engineer Kit is installed for the current runtime and scope.
  • Provide a feature description or narrow file path and the behavior it should preserve.
  • Name actors, state, data, integrations, constraints, and known failure modes.
  • Choose one-shot, --iterations N, or --saturation deliberately.
  • Prefer --iterations N when you require a hard count ceiling. Saturation mode has a novelty stop but no separate numeric maximum in the shipped contract.
  • Exclude secrets and unrelated files from the evidence scope.
RuntimeInvocationAvailability boundary
Claude Code/ak:scenario ...Runs as an installed Engineer Skill and can read authorized project evidence.
Cursor/ak:scenario ...Uses the user-verified slash spelling for Engineer Skills; broader runtime parity is not established.
Codex$ak:scenario ...Uses native Codex Skill discovery; file access and approval behavior follow the live host.

Run a bounded exploration

/ak:scenario "Account recovery with expiring email links, active sessions, and organization SSO" --iterations 25 --domain security --focus failures --format test-scenarios

Use one-shot mode by omitting both --iterations and --saturation:

/ak:scenario src/api/account-recovery.ts

For Codex, use $ak:scenario src/api/account-recovery.ts.

Choose the exploration controls

Input or optionDefaultEffect
Feature description or file pathRequiredDefines the behavior and evidence scope
--iterations NRuns exactly N scenario iterations, then summarizes
--saturationOffStops after two consecutive iterations produce no New classification
--domain <type>AutoPrioritizes software, product, business, security, or marketing context
--focus <dim>AutoPrioritizes edge-cases, failures, security, or scale
--format <type>tableSelects table, use-cases, test-scenarios, or threat-scenarios

Do not combine a claim of exhaustive coverage with either mode. A fixed count is a budget, and saturation is a novelty heuristic—not proof that all behavior has been discovered.

Understand the twelve dimensions

The Skill first filters for relevance rather than filling every category mechanically:

DimensionQuestions it surfaces
User typesRoles, guests, new users, banned users, automation, and abuse
Input extremesEmpty, null, maximum, Unicode, malformed, and injection inputs
TimingConcurrency, races, timeouts, slow paths, and retry storms
ScaleZero, one, large sets, pagination, and cursor boundaries
State transitionsFirst use, interruption, resume, crash, and partial completion
EnvironmentDevice, CPU, JavaScript, assistive technology, proxy, locale, and timezone
Error cascadesDependency outage, full disk, memory pressure, partition, and partial write
AuthorizationExpiry, role mismatch, sharing, CORS, CSRF, and privilege escalation
Data integrityDuplicates, orphans, encoding, and migration concurrency
IntegrationReplay, version mismatch, outage, and contract drift
ComplianceDeletion, audit, retention, and PII exposure
Business logicBoundary prices, stacking, refunds, delivery state, and usage limits

Irrelevant dimensions should be listed with both a reason and the assumption behind the skip, not silently counted as covered. If that assumption could stop being true during the feature's life, treat its failure as a scenario instead of skipping the dimension.

Observe the scenario loop

  1. The Skill reads the target. It identifies actors, components, preconditions, state, and expected behavior.
  2. The Skill filters dimensions. Relevant dimensions become the exploration plan; skipped dimensions remain visible with their assumptions. A breakable skip assumption becomes a failure scenario.
  3. The Skill proposes one situation per iteration. A trigger, flow, and expected outcome make the scenario testable.
  4. The Skill classifies novelty. New and useful Variant scenarios stay; Duplicate, out-of-scope, and low-value cases are discarded with reasons.
  5. The Skill expands kept cases. Boundaries, interruptions, ordering, and stale or missing data expose derived edge cases.
  6. The Skill rotates exploration. After three same-dimension iterations, it moves through dimensions, combinations, negation, amplification, personas, and temporal shifts.
  7. The Skill checkpoints progress. Every five iterations it summarizes kept and discarded cases, dimensions, severity, and gaps.
  8. The Skill stops and synthesizes. The selected count or novelty condition ends the run, followed by a grouped report and coverage matrix.

Keep the analysis within its authority

Scenarios are hypotheses, not verified defects

A Critical or High row identifies a consequence worth testing. It does not prove exploitability, production behavior, or compliance impact. Require implementation evidence, tests, and specialist review before release action.

The workflow reads authorized evidence and may write scenario-results.tsv in iterative mode. It should not change product code, create test files, contact external systems, or execute attack payloads as part of scenario generation.

Keep sensitive source and customer data out of the prompt and report. If a scenario implies a destructive test, credential use, production traffic, or an external cost, record it as a gated follow-up rather than running it.

Verify the scenario evidence

A complete report should contain:

  • Target, assumptions, evidence scope, and selected mode.
  • Dimensions analyzed and dimensions skipped with reasons and assumptions.
  • Scenarios with trigger, flow, expected behavior, severity, and dimension.
  • In iterative mode, scenario-results.tsv with novelty classification and discard reasons.
  • Progress checkpoints for longer runs.
  • A coverage matrix and explicit gaps.
  • The halt reason: one-shot, fixed count, or two no-new iterations.
  • Follow-on test, plan, prediction, or security-review recommendations.

The bundled composite score weights generated scenarios, edge cases, dimensions, actors, and severity. Treat it as an internal prioritization heuristic, not a coverage percentage or release threshold.

Troubleshoot or continue

SymptomSafe next step
Scenarios are genericAdd actors, state transitions, integrations, constraints, and expected behavior.
Too many duplicates appearNarrow the target, inspect prior classifications, and switch dimension or trigger.
One dimension dominatesApply the source-defined rotation and report remaining gaps.
Saturation runs longer than expectedStop manually or restart with --iterations N for a hard ceiling.
A Critical row lacks evidenceKeep it as a hypothesis and route it to focused testing or security review.
The report claims exhaustive coverageReplace the claim with analyzed dimensions, iteration count, novelty result, and known gaps.
The runtime cannot find the SkillConfirm installation and follow Runtime cannot find a Skill or Agent.

Pass testable rows to ak:test, Critical and High risks to ak:plan, or the most consequential proposal to ak:predict.

Know the current limits

  • Scenario generation does not prove runtime behavior or complete coverage.
  • Novelty classification and severity include model judgment and can be wrong.
  • --saturation has a two-iteration novelty stop but no source-defined maximum iteration count; use --iterations N for a strict resource ceiling.
  • Composite score is heuristic and must not be presented as test coverage.
  • Runtime access controls what files and context the Skill can inspect.