| name | ship |
| description | Full-cycle development workflow for any non-trivial feature or fix. Runs up to 10 phases (explore+interview loop, plan, implement, verify, edge cases, e2e tests, code review, security review, final verify) using the strongest available model for planning and autonomous goal loops for quality gates. Use when asked to implement a feature, fix a bug, or ship something with full quality assurance. |
| argument-hint | <task description> |
Ship
You are orchestrating a comprehensive, quality-focused development pipeline. Work through each phase in order. Do not skip or merge phases.
Task: {{args}}
All shell snippets below assume bash. On Windows, run them through the Bash tool or Git Bash, as constructs like ${VAR:-default} and heredocs are not valid in PowerShell.
Advisor - Getting Help When Stuck
When uncertain about your approach, stuck after 2 or more failed attempts, or about to commit to a significant decision, seek a second opinion before proceeding.
Claude Code - call advisor() with no arguments. Your full conversation history is forwarded to a stronger model automatically. Use it:
- Before committing to an approach you are not sure about
- After 2 or more failed attempts at the same problem
- Before declaring a complex task complete
To use a stronger advisor model, edit ~/.claude/settings.json and set "advisorModel" to "opus". Changes take effect after restarting the session.
Codex CLI (CODEX=true or CODEX_SANDBOX is set) - the advisor() tool is unavailable. When stuck, surface the uncertainty to the user explicitly and ask for direction rather than guessing. Alternatively, switch to a stronger model in your Codex configuration before continuing.
Phase 1 + 2: Explore-then-Interview Loop
These two phases run as a single loop. The goal is to arrive at unambiguous acceptance criteria while asking the user as few questions as possible โ search first, ask only what you cannot find.
Areas that must be resolved before proceeding:
- Scope (files, modules, systems in scope and explicitly out of scope)
- Acceptance criteria (what done looks like, how to verify correctness)
- Constraints (performance, backwards compat, existing patterns, team conventions)
- Ambiguities (unclear terms, conflicting requirements, edge cases in the task description)
- Quality gates (edge cases, E2E tests, both, or neither โ default: both)
- Implementation strategy (parallel subagents shared workspace recommended / let agent decide / isolated worktrees)
User-preference areas โ exploration CANNOT resolve these. You MUST ask each one explicitly during Step B, regardless of what the codebase contains. Never mark them Resolved from exploration findings. No exceptions:
- GitHub issues: "Should I track this work with GitHub issues?" โ sets
SHIP_GH_ENABLED (true/false)
- GitHub deployment checks: "Should verify phases poll GitHub deployment status after local tests pass?" โ sets
SHIP_CHECK_GH_DEPLOYMENTS (true/false)
Loop iteration
Step A โ Explore. Spawn 3โ5 parallel subagents covering the areas most relevant to what is still unresolved:
- Data / schema layer (models, types, database schema, migrations)
- Feature area (code most directly relevant to the task)
- Tests and patterns (how similar things are tested elsewhere)
- Dependencies and integrations (what affected code connects to upstream/downstream)
- Config / infrastructure (only if task touches deployment, environment, or build)
Each subagent returns: what it found, what's relevant, and any risks or surprises. After synthesis, go through every unresolved area and mark each one as:
- Resolved โ the codebase gave a clear enough answer
- Still open โ cannot be determined without user input
Step B โ Interview. For each still-open area, identify the single most important question. Ask the user one question at a time โ the answer may resolve several open areas at once, so re-evaluate the remaining list after each answer before asking the next one. If the answer to a question surfaces new uncertainty, run a targeted explore sub-step before asking again.
Keep iterating (A โ B โ A โ B โฆ) until every area is resolved. Only then proceed.
Do not proceed until you have unambiguous acceptance criteria confirmed by the user.
Optional-dependency check. Once quality gates are confirmed, check whether edge-cases/e2e skills are installed:
ls .claude/skills/edge-cases.md .claude/skills/e2e.md 2>/dev/null
Install missing skills for opted-in gates (best-effort โ skip that gate's phase if install fails):
npx --yes skills add amajorai/skills/skills/edge-cases -y && echo "EDGE_CASES_INSTALLED" || echo "EDGE_CASES_INSTALL_FAILED"
npx --yes skills add amajorai/skills/skills/e2e -y && echo "E2E_INSTALLED" || echo "E2E_INSTALL_FAILED"
If any skills were newly installed (output contains EDGE_CASES_INSTALLED or E2E_INSTALLED), detect the running environment:
echo "CODEX=${CODEX:-false}"
echo "CODEX_SANDBOX=${CODEX_SANDBOX:-}"
- Codex mode (
CODEX=true or CODEX_SANDBOX is set): newly installed skills reload automatically โ continue below.
- Claude Code mode: tell the user: "I've installed the missing skill(s). Please run
/reload-plugins in this session so they become available, then reply here to continue." Wait for the user's confirmation before proceeding.
At the end of the loop, create tasks for every remaining phase with TaskCreate. Set addBlockedBy so each phase is blocked by the previous one. Skip tasks for opted-out phases.
Track in working memory (not shell variables): quality gate choices + skill availability, implementation strategy, SHIP_GH_ENABLED, SHIP_CHECK_GH_DEPLOYMENTS, GitHub issue numbers/URLs, and the Context Summary (current state, key constraints, implementation risks, suggested entry points).
Phase 2.5: GitHub Prerequisites Check
Skip if user opted out of GitHub issues โ set SHIP_GH_ENABLED=false and continue.
gh auth status && gh repo view --json nameWithOwner -q .nameWithOwner
If either fails: set SHIP_GH_ENABLED=false, tell the user why, and continue.
If both pass: set SHIP_GH_ENABLED=true. Then set up ship labels โ see references/github-labels.md for the exact commands and label/color table.
Phase 3: Plan
Mark the Plan task in_progress. Call EnterPlanMode (or use the strongest reasoning model if unavailable).
The plan must specify:
- Exact files to create or modify (line-level specificity where possible)
- Implementation order respecting the dependency graph
- How each acceptance criterion from the Phase 1+2 loop will be satisfied
- Test strategy: new tests to write, existing tests to update
Do not begin implementation until the user explicitly approves. Revise and re-present as many times as needed, then call ExitPlanMode.
If SHIP_GH_ENABLED=false: mark Plan completed and proceed to Phase 4.
If SHIP_GH_ENABLED=true: after plan approval, create GitHub issues immediately โ before marking Plan completed, before starting Phase 4, before doing anything else. For a single atomic unit, create one issue (no epic). For multiple units, create an epic + sub-issues and link them. See references/github-issues.md for templates, bash commands, and GraphQL mutations.
Post each URL in chat the moment it is created โ do not batch, do not wait until the Completion Report, do not start implementation first:
- Single issue: post its URL as soon as it is created.
- Epic + sub-issues: post the epic URL first (so the user can see the full plan on GitHub), then each sub-issue URL as it is created. Include a one-line summary of what each sub-issue covers.
Hard gate: Do not mark Plan completed and do not proceed to Phase 4 until every issue URL has been posted in chat. No exceptions.
Phase 4: Implement
Pre-flight: If SHIP_GH_ENABLED=true, verify that issue URLs were created and posted in Phase 3 before dispatching any agents. If they are missing for any reason, stop and create them now โ do not skip ahead.
Mark Implement in_progress. Decompose the plan into independent units and execute using the strategy chosen in the Phase 1+2 loop.
Dependency ordering: group units into waves (wave 1 = no blockers, wave 2 = depends on wave 1, etc.). Dispatch all units in the current wave in parallel, wait for all to return, then dispatch the next wave. Never instruct an agent to self-wait.
For the full parallel implementation instructions (worker prompt templates, e2e recipe discovery, status tracking), see references/batch.md.
Non-GitHub path: spawn one agent per unit with goal, context, file paths, and acceptance criteria inline. Agents implement and commit only โ no PRs.
GitHub path: each agent gets its issue URL. For prompt templates (shared workspace vs isolated worktrees), see references/batch.md. After all shared-workspace waves finish, open a single PR covering all issues.
After all waves complete, mark Implement completed.
Phase 5: Verify
Mark Verify in_progress. Spawn an Opus agent (max 5 passes) with the acceptance criteria from the Phase 1+2 loop as its goal condition:
Agent({
subagent_type: "claude",
model: "opus",
prompt: "Verify the implementation against these acceptance criteria: <criteria>. Each pass: (1) run the project build, (2) run the full test suite + lint + typecheck, (3) evaluate each criterion. All pass โ report success. Failures remain โ fix directly and run again. After 5 passes with failures still present โ report what failed and stop.",
isolation: "worktree"
})
Surface to user for direction if the agent reports failure after 5 passes.
If SHIP_CHECK_GH_DEPLOYMENTS=true: once all local criteria pass, enter a deployment-check loop (max 20 polls, ~30 s apart):
gh api "repos/{owner}/{repo}/deployments?environment=production&per_page=1" --jq '.[0].id'
gh api "repos/{owner}/{repo}/deployments/{id}/statuses?per_page=1" --jq '.[0].state'
success โ continue to next phase.
pending / in_progress / queued โ wait 30 s and poll again.
failure / error โ inspect the deployment logs, diagnose the root cause, fix the code, push, and restart the poll from the beginning (counts as one fix attempt). After 3 fix attempts without reaching success, surface to the user before continuing.
Mark Verify completed.
Phase 6: Edge Cases
Skip if opted out or edge-cases skill unavailable (declined or failed install in the Phase 1+2 loop).
Mark Edge cases in_progress. Invoke:
Skill({ skill: "edge-cases", args: "<feature area or changed files>" })
Do not proceed until all P0/P1 edge cases are covered and the full test suite passes. Mark Edge cases completed.
Phase 7: E2E Tests
Skip if opted out or e2e skill unavailable.
Mark E2E tests in_progress. Invoke the e2e skill with the feature area and the acceptance criteria from the Phase 1+2 loop as context, so it knows what flows to cover:
Skill({ skill: "e2e", args: "<feature area> โ acceptance criteria: <criteria from Phase 1+2 loop>" })
The e2e skill runs its own full pipeline (discover flows, set up Playwright or Maestro, write and run tests). Do not mark this phase completed until you have confirmed from the skill's output that all tests actually passed โ read the skill's completion report and verify the pass/fail counts.
If the skill returns without a clear pass confirmation, or if neither Playwright nor Maestro is available, fall back to Claude Computer Use โ drive the actual UI directly using your own vision: launch the app, walk through the critical user flows from the acceptance criteria, observe the results, and report pass/fail. Note in the phase summary that Computer Use was used.
If none of the above is possible, run the test suite directly:
bun run test:e2e 2>/dev/null || npx playwright test 2>/dev/null || maestro test e2e/ 2>/dev/null
All tests must be green before proceeding. Mark E2E tests completed.
Phase 8: Code Review
Mark Code review in_progress. Invoke:
Skill({ skill: "code-review", args: "high" })
Fix all CONFIRMED and PLAUSIBLE findings before proceeding. Mark Code review completed.
Phase 9: Security Review
Mark Security review in_progress. Spawn an Opus agent to run the security review:
Agent({
subagent_type: "claude",
model: "opus",
prompt: "Run a security review on the changes in this task (feature area: <area>, changed files: <files>). Audit for: input validation at system boundaries, auth/authz on new endpoints, injection vulnerabilities (SQL/XSS/command/path traversal), hardcoded secrets, trust boundary crossings. Fix all HIGH and CRITICAL findings. If a finding can't be resolved after ~5 attempts, report it and stop for user direction.",
isolation: "worktree"
})
Alternatively, invoke the built-in skill if available:
Skill({ skill: "security-review", args: "<feature area + changed files>" })
If a HIGH/CRITICAL finding can't be resolved within ~5 attempts, surface to user before continuing.
Mark Security review completed.
Phase 10: Final Verify
Mark Final verify in_progress. Spawn an Opus agent (max 5 passes) with the full acceptance criteria and a regression check against Phases 6โ9:
Agent({
subagent_type: "claude",
model: "opus",
prompt: "Final verification pass. Each pass: (1) run the project build โ must be clean, (2) confirm all original acceptance criteria still pass: <criteria>, (3) confirm no regressions from edge case hardening, E2E tests, code review, or security review, (4) confirm application is in a clean deployable state. All pass โ report success. Failures remain โ fix directly and run again. After 5 passes with failures still present โ report what failed and stop.",
isolation: "worktree"
})
Surface blocking failures to user if unmet after 5 passes.
If SHIP_CHECK_GH_DEPLOYMENTS=true: repeat the same deployment-check loop from Phase 5 โ poll until success, fix and re-push on failure/error, escalate to user after 3 fix attempts.
Mark Final verify completed.
Completion Report
Report the following (omit lines for skipped phases):
- What was implemented and which files changed
- Edge cases found and hardened (count by priority tier)
- E2E tests written (golden path + edge cases)
- Test coverage added or modified
- Security findings and their resolutions
- Any open limitations or recommended follow-up
If SHIP_GH_ENABLED=true: include epic + sub-issue URLs and PR URL(s). Then verify all sub-issues are closed โ check each by number (not by label, since the epic also carries the ship label). Close any the agent didn't close. For a single-unit task, just that one issue โ no epic. Close the epic last. See references/github-issues.md for the closing commands.
fix upsell. Check if the fix skill is available:
npx --yes skills list 2>/dev/null | grep -qE '^fix$' && echo "ALREADY_INSTALLED" || echo "NOT_INSTALLED"
- Already installed: mention at the end of the report โ "If anything breaks in production, run
/fix <symptom> to track it down."
- Not installed: add a one-liner โ "Tip:
npx skills add -g amajorai/fix.md gives you /fix for systematic debugging when bugs appear."