Autopilot
Run the full development cycle on a Jira issue without intermediate confirmations: pick up, plan, implement, test, verify, archive, commit, push, and check CI.
When to use
- The user wants an entire issue handled end-to-end without micromanaging each phase.
- The user explicitly invokes
/autopilot or asks for "autonomous" / "hands-off" work.
- The task is well-scoped enough that reasonable defaults at each decision point are acceptable.
Examples:
- "autopilot" — takes the topmost backlog issue and runs the full cycle.
- "autopilot PROJ-123" — runs the full cycle on a specific issue.
Steps
Phase 1: Pick Up Issue
If no issue-key is provided, fetch the topmost issue from the board:
- Detect project key by running
af jira projects --json
- If single project: use it
- If multiple projects: ask the user to choose
- Fetch the topmost backlog issue using:
af jira search "project = <PROJECT> AND status = 'Selected for Development' ORDER BY Rank ASC" --limit 1 --json
- Display the issue summary and proceed immediately
- If no backlog issues found: inform the user the Selected for Development column is empty and STOP
Fetch the issue details using af jira get <issue-key>.
Assign the issue to yourself using af jira assign <issue-key> --to "$ATLASSIAN_EMAIL". af authenticates as the account in ATLASSIAN_EMAIL (legacy: JIRA_EMAIL), so that is "yourself" — do not derive an assignee from the issue's reporter field.
Transition the issue to "In Progress" using af jira transition <issue-key> --to "In Progress". If this fails, run af jira transitions <issue-key> to find the correct status name.
Derive a change-id from the issue key and summary (kebab-case, verb-led). Store <issue-key>, <issue-summary>, and <change-id> for use in all remaining phases.
Phase 2: Fast-Forward Artifacts
Invoke the openspec-ff-change skill (Skill tool) with the <change-id>.
Enrich the proposal artifact with Jira context:
- Jira issue link:
**Jira**: [ISSUE-KEY](jira-url)
- Why section derived from Jira issue description
- What Changes derived from issue details
This creates the change directory and generates ALL artifacts (proposal, specs, design, tasks) in one pass.
On failure: If artifact creation fails critically (e.g., cannot create directory, CLI errors), report the error and STOP.
Phase 3: Implement
Invoke the openspec-apply-change skill (Skill tool) with the <change-id>.
This implements all tasks from the generated tasks.md. Let the skill run through all tasks without interruption.
Auto-mode behavior: When the apply skill would normally pause for clarification, make reasonable decisions and continue. Prefer the simplest correct approach. If implementation reveals a true design issue that cannot be resolved with reasonable defaults, STOP and explain the issue.
Phase 4: Test
Run E2E tests:
af e2e
If tests fail, enter a fix-and-retry loop:
Escape valve: If E2E tests still fail after 3 full-suite attempts, STOP and report which tests are failing, what fixes were attempted, and the current state.
Phase 5: Verify
Invoke the openspec-verify-change skill (Skill tool) with the <change-id>.
Handle verification results autonomously:
- CRITICAL issues: Attempt to fix them (complete tasks, implement missing requirements). After fixing, re-run verification once. If critical issues persist, STOP and report.
- WARNING issues: Note them but continue.
- SUGGESTION issues: Ignore in auto mode.
Phase 6: Complete
Archive the OpenSpec change:
Invoke the openspec-archive-change skill (Skill tool) with the <change-id>.
In auto mode, when the archive skill encounters prompts:
- Incomplete artifacts/tasks warnings: proceed
- Delta spec sync prompt: choose "Sync now" (the recommended option)
Commit with trailers:
git add -A
git commit -m "<issue-summary>" \
--trailer "Issue=<issue-key>" \
--trailer "OpenSpec-Id=<change-id>"
Transition Jira to Done — always supply a resolution, or the issue closes with an empty Resolution field:
af jira transition <issue-key> --to "Done" --resolution "Fixed" --comment "<change-id> archived and pushed"
Status and resolution names are workflow-specific. In auto mode, if this fails, run af jira transitions <issue-key> — it lists the available transitions and the fields each one's screen requires — then retry with the correct --to / --resolution names (add --field name=value for any other required screen field).
Push to remote:
git push
Phase 7: CI Verification
Read the Jenkins job path from the project's CLAUDE.md (e.g., Jenkins job: folder/pipeline-name). If not configured, skip this phase and warn the user. Job paths use / to separate folder/pipeline/branch segments, so the path to poll is the branch build the push just triggered: <job-path>/<branch> — not the bare <job-path>, which is the multibranch parent. (af jenkins branches <job-path> lists the per-branch build statuses.)
Wait ~30 seconds for Jenkins to pick up the push, then poll build status:
af jenkins build <job-path>/<branch> latest --json
Repeat every 30 seconds until the build is no longer in progress (check the building field or result field in JSON output).
If build succeeds: continue to final summary.
If build fails:
- Run
af jenkins stages <job-path>/<branch> latest to identify the failing stage
- Run
af jenkins stage-log <job-path>/<branch> "<failing-stage>" latest to read the error output (arg order is <name> <stage> [number|latest])
- Fix the code based on the failure
- Commit the fix using the same
git add -A && git commit -m "<issue-summary>" --trailer ... pattern from Phase 6 step 12, push, and poll again
Escape valve: If the build still fails after 3 CI attempts, STOP and report the failing stage, error output, and what fixes were attempted.
Final Summary
Display a completion summary:
## Work Complete
**Issue:** [ISSUE-KEY] <issue-summary>
**Change:** <change-id>
**Status:** Done
### Phases Completed
1. Issue picked up and transitioned to In Progress
2. All OpenSpec artifacts generated
3. All tasks implemented
4. E2E tests passing
5. Verification passed
6. Change archived, committed, pushed
7. CI build passed
All done.
Auto Mode Behavior
This skill runs without user interaction after the initial issue selection:
- NO intermediate confirmations — proceed through phases automatically
- Make reasonable decisions — when ambiguity arises, choose the simplest correct approach
- Fix forward — if tests or CI fails, fix the code and retry (up to escape valve limits)
- Visual regression baselines — update them automatically when the change intentionally affects the UI
Escape Valves
The skill STOPS and reports (rather than loop or proceed with broken state) when:
- Phase 1: No issues in backlog, or Jira transitions fail
- Phase 2: OpenSpec CLI errors or artifact creation fails
- Phase 3: Unresolvable design issues during implementation
- Phase 4: E2E tests fail after 3 full-suite retry attempts
- Phase 5: Critical verification issues persist after one fix-and-reverify cycle
- Phase 6: Commit or push fails (e.g., merge conflicts)
- Phase 7: Jenkins build fails after 3 CI attempts
When stopped, always report: which phase failed, what was attempted, and the current state so the user can resume manually.
Project Defaults
If the project instructions specify a default Jira project key (e.g., Jira project: PROJ), use it as the default for --project, list, types, and JQL queries. Explicit user input always overrides the default.
Reference
- See
openspec/AGENTS.md for OpenSpec conventions
- See the
jira skill, or run bare af jira (not af jira --help, which is only a stub) for the full CLI reference
- See
/opsx:ff, /opsx:apply, /opsx:verify, /opsx:archive for individual phase details
- See the
jenkins skill for job paths, polling, and stage logs; run bare af jenkins for the full CLI reference
1---2name: autopilot3description: Autonomously pick up a Jira issue and complete it end-to-end — plan, implement, test, verify, archive, commit, push, and confirm CI passes. Use when the user says "autopilot", "pick up the next ticket and finish it", "autonomous mode", or otherwise wants the full development cycle run without intermediate confirmations. Only pauses at the very start to confirm the issue selection.4---56# Autopilot78Run the full development cycle on a Jira issue without intermediate confirmations: pick up, plan, implement, test, verify, archive, commit, push, and check CI.910## When to use1112- The user wants an entire issue handled end-to-end without micromanaging each phase.13- The user explicitly invokes `/autopilot` or asks for "autonomous" / "hands-off" work.14- The task is well-scoped enough that reasonable defaults at each decision point are acceptable.1516Examples:17- "autopilot" — takes the topmost backlog issue and runs the full cycle.18- "autopilot PROJ-123" — runs the full cycle on a specific issue.1920## Steps2122## Phase 1: Pick Up Issue23240. **If no issue-key is provided**, fetch the topmost issue from the board:25 1. Detect project key by running `af jira projects --json`26 - If single project: use it27 - If multiple projects: ask the user to choose28 2. Fetch the topmost backlog issue using:29 ```bash30 af jira search "project = <PROJECT> AND status = 'Selected for Development' ORDER BY Rank ASC" --limit 1 --json31 ```32 3. Display the issue summary and proceed immediately33 4. If no backlog issues found: inform the user the Selected for Development column is empty and **STOP**34351. Fetch the issue details using `af jira get <issue-key>`.36372. Assign the issue to yourself using `af jira assign <issue-key> --to "$ATLASSIAN_EMAIL"`. `af` authenticates as the account in `ATLASSIAN_EMAIL` (legacy: `JIRA_EMAIL`), so that is "yourself" — do not derive an assignee from the issue's reporter field.38393. Transition the issue to "In Progress" using `af jira transition <issue-key> --to "In Progress"`. If this fails, run `af jira transitions <issue-key>` to find the correct status name.40414. Derive a `change-id` from the issue key and summary (kebab-case, verb-led). Store `<issue-key>`, `<issue-summary>`, and `<change-id>` for use in all remaining phases.4243## Phase 2: Fast-Forward Artifacts44455. Invoke the `openspec-ff-change` skill (Skill tool) with the `<change-id>`.4647 Enrich the proposal artifact with Jira context:48 - Jira issue link: `**Jira**: [ISSUE-KEY](jira-url)`49 - Why section derived from Jira issue description50 - What Changes derived from issue details5152 This creates the change directory and generates ALL artifacts (proposal, specs, design, tasks) in one pass.5354 **On failure**: If artifact creation fails critically (e.g., cannot create directory, CLI errors), report the error and **STOP**.5556## Phase 3: Implement57586. Invoke the `openspec-apply-change` skill (Skill tool) with the `<change-id>`.5960 This implements all tasks from the generated tasks.md. Let the skill run through all tasks without interruption.6162 **Auto-mode behavior**: When the apply skill would normally pause for clarification, make reasonable decisions and continue. Prefer the simplest correct approach. If implementation reveals a true design issue that cannot be resolved with reasonable defaults, **STOP** and explain the issue.6364## Phase 4: Test65667. Run E2E tests:67 ```bash68 af e2e69 ```70718. **If tests fail**, enter a fix-and-retry loop:72 - Read the reporter output for error messages, DOM snapshots, and file paths73 - For deeper debugging, read `./test-results/*/error-context.md` for full page state74 - Fix the code or test75 - If the failure is a visual regression from an intentional change, update baselines:76 ```bash77 af e2e npm run e2e -- --update-snapshots78 ```79 - To iterate faster on the specific failing test, pass the full test command — bare args to `af e2e` are the *entire* container command, so `--grep` must be forwarded through the runner:80 ```bash81 af e2e npm run e2e -- --grep "booking"82 ```83 - Once the targeted test passes, run the full suite (plain `af e2e`, no `--grep`) to confirm nothing else broke8485 **Escape valve**: If E2E tests still fail after **3 full-suite attempts**, **STOP** and report which tests are failing, what fixes were attempted, and the current state.8687## Phase 5: Verify88899. Invoke the `openspec-verify-change` skill (Skill tool) with the `<change-id>`.909110. Handle verification results autonomously:92 - **CRITICAL issues**: Attempt to fix them (complete tasks, implement missing requirements). After fixing, re-run verification once. If critical issues persist, **STOP** and report.93 - **WARNING issues**: Note them but continue.94 - **SUGGESTION issues**: Ignore in auto mode.9596## Phase 6: Complete979811. **Archive the OpenSpec change:**99 Invoke the `openspec-archive-change` skill (Skill tool) with the `<change-id>`.100101 In auto mode, when the archive skill encounters prompts:102 - Incomplete artifacts/tasks warnings: proceed103 - Delta spec sync prompt: choose "Sync now" (the recommended option)10410512. **Commit with trailers:**106 ```bash107 git add -A108 git commit -m "<issue-summary>" \109 --trailer "Issue=<issue-key>" \110 --trailer "OpenSpec-Id=<change-id>"111 ```11211313. **Transition Jira to Done** — always supply a resolution, or the issue closes with an empty Resolution field:114 ```bash115 af jira transition <issue-key> --to "Done" --resolution "Fixed" --comment "<change-id> archived and pushed"116 ```117 Status and resolution names are workflow-specific. In auto mode, if this fails, run `af jira transitions <issue-key>` — it lists the available transitions and the fields each one's screen requires — then retry with the correct `--to` / `--resolution` names (add `--field name=value` for any other required screen field).11811914. **Push to remote:**120 ```bash121 git push122 ```123124## Phase 7: CI Verification12512615. Read the Jenkins job path from the project's CLAUDE.md (e.g., `Jenkins job: folder/pipeline-name`). If not configured, skip this phase and warn the user. Job paths use `/` to separate folder/pipeline/branch segments, so the path to poll is the **branch** build the push just triggered: `<job-path>/<branch>` — not the bare `<job-path>`, which is the multibranch parent. (`af jenkins branches <job-path>` lists the per-branch build statuses.)12712816. Wait ~30 seconds for Jenkins to pick up the push, then poll build status:129 ```bash130 af jenkins build <job-path>/<branch> latest --json131 ```132 Repeat every 30 seconds until the build is no longer in progress (check the `building` field or `result` field in JSON output).13313417. **If build succeeds**: continue to final summary.13513618. **If build fails**:137 - Run `af jenkins stages <job-path>/<branch> latest` to identify the failing stage138 - Run `af jenkins stage-log <job-path>/<branch> "<failing-stage>" latest` to read the error output (arg order is `<name> <stage> [number|latest]`)139 - Fix the code based on the failure140 - Commit the fix using the same `git add -A && git commit -m "<issue-summary>" --trailer ...` pattern from Phase 6 step 12, push, and poll again141142 **Escape valve**: If the build still fails after **3 CI attempts**, **STOP** and report the failing stage, error output, and what fixes were attempted.143144## Final Summary145146Display a completion summary:147148```149## Work Complete150151**Issue:** [ISSUE-KEY] <issue-summary>152**Change:** <change-id>153**Status:** Done154155### Phases Completed1561. Issue picked up and transitioned to In Progress1572. All OpenSpec artifacts generated1583. All tasks implemented1594. E2E tests passing1605. Verification passed1616. Change archived, committed, pushed1627. CI build passed163164All done.165```166167## Auto Mode Behavior168169This skill runs without user interaction after the initial issue selection:170171- **NO intermediate confirmations** — proceed through phases automatically172- **Make reasonable decisions** — when ambiguity arises, choose the simplest correct approach173- **Fix forward** — if tests or CI fails, fix the code and retry (up to escape valve limits)174- **Visual regression baselines** — update them automatically when the change intentionally affects the UI175176## Escape Valves177178The skill **STOPS and reports** (rather than loop or proceed with broken state) when:1791801. **Phase 1**: No issues in backlog, or Jira transitions fail1812. **Phase 2**: OpenSpec CLI errors or artifact creation fails1823. **Phase 3**: Unresolvable design issues during implementation1834. **Phase 4**: E2E tests fail after 3 full-suite retry attempts1845. **Phase 5**: Critical verification issues persist after one fix-and-reverify cycle1856. **Phase 6**: Commit or push fails (e.g., merge conflicts)1867. **Phase 7**: Jenkins build fails after 3 CI attempts187188When stopped, always report: which phase failed, what was attempted, and the current state so the user can resume manually.189190## Project Defaults191192If the project instructions specify a default Jira project key (e.g., `Jira project: PROJ`), use it as the default for `--project`, `list`, `types`, and JQL queries. Explicit user input always overrides the default.193194## Reference195196- See `openspec/AGENTS.md` for OpenSpec conventions197- See the `jira` skill, or run bare `af jira` (not `af jira --help`, which is only a stub) for the full CLI reference198- See `/opsx:ff`, `/opsx:apply`, `/opsx:verify`, `/opsx:archive` for individual phase details199- See the `jenkins` skill for job paths, polling, and stage logs; run bare `af jenkins` for the full CLI reference