/amplihack:default-workflowfrom amplihack
Multi-phase development workflow for features, bugs, and refactoring spanning requirements, design, implementation, testing, and PR creation. Used as a sub-recipe by dev-orchestrator or standalone via recipe runner.
Ships in amplihack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Normal execution path: This workflow is invoked as a sub-recipe by the
dev-orchestrator skill via smart-orchestrator. You do NOT normally need
to activate this skill directly.
User request → dev-orchestrator → smart-orchestrator recipe
→ default-workflow recipe (this skill's recipe)
Direct invocation is supported as a compatibility path when the dev-orchestrator is unavailable or when explicitly requested. In that case, use the recipe runner (see Execution Instructions below).
flowchart TD
subgraph P1["Phase 1: Requirements Clarification"]
S0[Step 0: Workflow Preparation] --> S1[Step 1: Prepare Workspace]
S1 --> S2[Step 2: Clarify Requirements]
S2 --> S2b[Step 2b: Analyze Codebase]
S2b --> S2c{Ambiguity?}
S2c -->|yes| S2d[Step 2c: Resolve Ambiguity]
S2c -->|no| S3
S2d --> S3[Step 3: Select Tracking Issue]
S3 --> S3b[Step 3b: Extract Issue Number]
end
subgraph P2["Phase 2: Design"]
S4[Step 4: Setup Worktree/Branch] --> S5[Step 5: Architecture Design]
S5 --> S5b{API needed?}
S5b -->|yes| S5c[Step 5b: API Design]
S5b -->|no| S5d
S5c --> S5d{Database needed?}
S5d -->|yes| S5e[Step 5c: Database Design]
S5d -->|no| S5f
S5e --> S5f[Step 5d: Security Review]
S5f --> S5g[Step 5e: Design Consolidation]
end
subgraph P3["Phase 3: Implementation"]
S6[Step 6: Documentation] --> S6b[Step 6b: Doc Review]
S6b --> S6c[Step 6c: Doc Refinement]
S6c --> S7[Step 7: Write Tests - TDD]
S7 --> S8[Step 8: Implement]
S8 --> S8b[Step 8b: Integration]
S8b --> S9[Step 9: Refactor]
S9 --> S9b[Step 9b: Optimize]
end
subgraph P4["Phase 4: Testing & Review"]
S10[Step 10: Pre-commit Review] --> S10b[Step 10b: Security Review]
S10b --> S10c[Step 10c: Philosophy Check]
S10c --> S11[Step 11: Incorporate Feedback]
S11 --> S11b[Step 11b: Implement Feedback]
S11b --> S12[Step 12: Run Pre-commit Hooks]
S12 --> S13[Step 13: Local Testing]
end
subgraph P5["Phase 5: Version & PR"]
S14[Step 14: Bump Version - MANDATORY] --> S15[Step 15: Commit & Push]
S15 --> S16[Step 16: Create Draft PR]
S16 --> S16b[Step 16b: Outside-In Fix Loop]
end
subgraph P6["Phase 6: PR Review - MANDATORY"]
S17a[Step 17a: Testing-Evidence Gate] --> S17b[Step 17b: Reviewer Agent]
S17b --> S17c[Step 17c: Security Review]
S17c --> S17d[Step 17d: Philosophy Guardian]
S17d --> S17e{Blocking issues?}
S17e -->|yes| S17f[Step 17e: Address Blocking]
S17e -->|no| S17g
S17f --> S17g[Step 17f: Verification Gate]
S17g --> S18a[Step 18a: Analyze Feedback]
S18a --> S18b[Step 18b: Implement Feedback]
S18b --> S18c[Step 18c: Push Changes]
S18c --> S18d[Step 18d: Respond to Comments]
S18d --> S18e[Step 18e: Verification Gate]
end
subgraph P7["Phase 7: Merge"]
S19a[Step 19a: Philosophy Check] --> S19b[Step 19b: Patterns Check]
S19b --> S19c[Step 19c: Zero-BS Verification]
S19c --> S19d[Step 19d: Verification Gate]
S19d --> S20[Step 20: Final Cleanup]
S20 --> S20c[Step 20c: Quality Audit]
S20c --> S20b[Step 20b: Push Cleanup]
S20b --> S21[Step 21: PR Ready]
S21 --> S22[Step 22: Ensure Mergeable]
S22 --> S22b[Step 22b: Final Status]
end
P1 --> P2 --> P3 --> P4 --> P5 --> P6 --> P7
default-workflow builds the change and opens its pull request by running the
shared goal loop. Its steps are workflow-prep, workflow-worktree,
build-goal-setup, build-loop, two steps that restore the caller's context,
and build-report. Each turn an agent reads
the live state and the task text and chooses one action: open-pr,
mark-ready, review, wait or prepare-worktree, or it edits and commits in
the worktree itself. The run ends when the pull request is open and marked
ready, merged, closed, or handed to a named owner for a decision. A build never
merges; no_merge and finalization_handoff are accepted and ignored. The
phase recipes below remain for one release for runs that loaded the earlier
version. See docs/reference/build-goal-loop.md.
This skill provides the standard development workflow for all non-trivial code changes
in amplihack. It is normally executed as a sub-recipe by the dev-orchestrator via
smart-orchestrator, but can also be invoked directly via the recipe runner.
The workflow defines the canonical execution process: from requirements clarification through design, implementation, testing, review, and merge. It ensures consistent quality by orchestrating specialized agents at each step and enforcing philosophy compliance throughout.
SKILL.md, relative to this skill's folderamplifier-bundle/recipes/default-workflow.yamlThe skill and recipe are the authoritative representation. Legacy
DEFAULT_WORKFLOW.md files are deprecated compatibility references only.
The repository mirror at docs/claude/skills/default-workflow/SKILL.md is
byte-identical to this file. Resolve this skill's own resources relative to
its folder. Paths starting with docs/ or amplifier-bundle/recipes/ describe
repository documentation or executable recipes rather than this skill's
resources. Find an installed recipe with amplihack recipe show <name>.
If you reached this skill via dev-orchestrator / smart-orchestrator, the recipe
runner is already managing execution. Do not re-invoke the recipe runner. The
orchestrator handles the full lifecycle including goal-seeking reflection loops.
If this skill is activated directly (not via dev-orchestrator), you MUST use the recipe runner — do NOT read a legacy markdown workflow file and follow steps manually:
The default workflow exposes one direct executable recipe interface:
amplihack recipe run default-workflow \
-c task_description="TASK_DESCRIPTION_HERE" \
-c repo_path="."
Or with verbose output:
cd /path/to/repo && amplihack recipe run default-workflow \
-c task_description="TASK_DESCRIPTION_HERE" \
-c repo_path="." \
--verbose
Do NOT read legacy DEFAULT_WORKFLOW.md files and follow steps manually. The recipe runner
enforces step ordering, recursion guards, checkpoints, and quality gates that manual
execution cannot replicate.
For most tasks, invoke Skill(skill="dev-orchestrator") or use /dev <task> rather
than activating this skill directly. The dev-orchestrator adds goal-seeking reflection,
workstream decomposition, and adaptive error recovery on top of this workflow.
The default workflow exposes one direct executable recipe interface:
amplihack recipe run default-workflow \
-c task_description="Add password reset support" \
-c repo_path=.
| Context key | Required | Description |
|---|---|---|
task_description | Yes | Plain-language task to execute through the workflow. |
repo_path | Yes | Repository root for workspace setup, checks, commits, and PR work. |
The normal orchestrated interface remains:
amplihack recipe run smart-orchestrator \
-c task_description="Add password reset support" \
-c repo_path=.
Agent runtimes that support skills should enter through
Skill(skill="dev-orchestrator") for DEV, INVESTIGATE, and HYBRID tasks. Direct
Skill(skill="default-workflow") activation is for explicit standalone use or
orchestrator-unavailable compatibility.
Step 13 is a mandatory outside-in local validation gate. It is agentic and toolchain-aware: the acting agent detects affected languages, manifests, lockfiles, package managers, entry points, changed files, and documented project commands before selecting validation commands.
The step must not require one global validation mechanism across all projects.
Rust/Cargo, Node/npm, Python/uv, Go, .NET, and other detected toolchains each use
their own local consumer-facing validation pattern. Python uvx is only a
Python/uv-specific option when that project shape warrants it.
For the full evidence contract and examples, see
docs/reference/default-workflow-step-13-validation.md.
Generated preferences and session context name the canonical skill/recipe, not a legacy markdown path:
## Workflow Configuration
**Selected**: `default-workflow` skill/recipe
**Consensus Depth**: balanced
Use the `consensus-workflow` skill/recipe for: ambiguous requirements,
architectural changes, critical/security code, public APIs.
Do not render DEFAULT_WORKFLOW.md paths as selected workflow configuration.
Those paths are compatibility references only.
This skill auto-activates for:
Note: The dev-orchestrator skill has higher priority and broader triggers.
In most cases, it will activate first and invoke this workflow as a sub-recipe.
Steps that commonly fail during workflow execution. Agents executing this workflow MUST apply the documented resilience patterns when encountering these steps.
Failure: git fetch --all fails with exit 128 when the remote requires credentials
that are not configured — most commonly Azure DevOps remotes where only the GitHub
credential helper (gh auth git-credential) is wired up.
Resilience: Fetch failure is caught and downgraded to a WARNING. The step continues
with local branch state. ADO remotes (dev.azure.com, visualstudio.com) receive
specific remediation guidance (az login, GCM install, PAT setup). The remote URL is
never echoed to avoid leaking embedded credentials. See
docs/recipes/issue-655-656-skill-invocation-and-fetch-resilience.md for details.
Default: Step 3 reuses an explicit issue_number or an open issue referenced in the task, and otherwise uses local tracking. It creates no GitHub issue unless the run passes -c create_issue=true (also 1 or yes); text in the task description does not opt in. A decomposed run forwards the value to its parallel workstreams.
Opted in: Step 3 reuses an open issue with exactly the same title in the same repository, whoever opened it. If it cannot check (search and the recent-issue listing both fail), it uses local tracking rather than risk a duplicate.
Failure: secondary rate limit on gh issue create.
Resilience: Wait at least 60 s plus jitter (or retry-after when printed), look up the title again before each retry, and fall back to local tracking after AMPLIHACK_ISSUE_BACKOFF_MAX_TOTAL_SECS (300 s). An auth failure is not retried.
Failure: gh label create fails (permission denied, API timeout).
Resilience: Label attachment is best-effort. If gh issue create --label fails on the label, retry once without --label.
See docs/reference/workflow-tracking-issue-selection.md.
Failure: Worktree setup aborts when a repository does not have origin/main,
even though its remote default branch is master or develop.
Resilience: Remote base detection runs before worktree creation. Prefer
Git-verified origin/HEAD, then fall back to origin/master, then
origin/develop. origin/HEAD may target origin/main, origin/master,
origin/develop, or another remote default branch as long as Git verifies it as
a remote-tracking ref under refs/remotes/origin/. If no supported remote base
source exists, fail loudly: name each base source that was tried and what it
returned, and stop the step with an actionable message. Do not bootstrap from
local HEAD, do not silently skip push/upstream setup, and do not accept an
unverified ref to keep going. This step has no agentic recovery hand-off today:
workflow-worktree is not among the steps listed in
docs/reference/step-failure-recovery.md, so the loud error is where it ends.
Giving it one is a recipe change, not a documentation change.
Failure: git push origin <branch> fails on fresh branch creation due to network issues.
Resilience: Push failure at step 4 emits a visible WARNING and defers to step 15/16. Push is retried with bounded retry (3 attempts, 2s backoff) at commit-and-push time. Step 16 also retries push before PR creation.
Failure: Agent output file not written or corrupted, causing downstream steps to fail with empty input. Resilience: If an agent step produces empty output, the recipe runner should surface the error visibly. Checkpoints after design (step 5e) and after implementation (step 8b) preserve partial work so the workflow can resume from the nearest safe point.
Failure: git rev-list --count @{u}..HEAD fails when upstream is not set (first push scenario).
Resilience: Detect missing upstream explicitly. If @{u} fails, push unconditionally instead of silently skipping. Retry push with backoff on transient network errors.
Failure (#978): A temporary workstream branch tracks an unrelated/stale upstream; a blind git pull --rebase replays already-integrated historical commits and produces add/add conflicts.
Resilience: Step 15 is ancestry-aware. After fetching, it compares HEAD to @{u}:
merge-base / ahead / behind evidence, and hand that failure to recovery instead of ending the run. step-15-commit-push carries continue_on_error: true, so its non-zero exit falls through to step-15-push-recovery, which runs the push-failure-recovery sub-recipe and gives an agent the merge-or-rebase decision (docs/reference/recipe-push-failure-recovery.md). That recovery works from its own snapshot of the worktree and the remote, not from step-15's reason: the runner keeps no output from a step that exited non-zero, so the loud message survives only in the step log. Step 15 never auto-rebases divergent history onto a possibly-unrelated upstream, and recovery must not rewrite pushed history to make the push succeed.Failure: gh pr create fails with "No commits between main and branch" or duplicate PR.
Resilience: Idempotency guard checks for existing PRs by branch name before creating. If PR already exists, reuse it. If no commits ahead, surface the error visibly rather than creating an empty PR.
Failure: Shell &&-chain breaks when philosophy_check, patterns_check, or quality_audit_results template variables contain shell metacharacters or exceed ARG_MAX.
Resilience: Large template variables are captured via heredoc and truncated to 1KB before use in shell commands. Step 21 avoids echoing raw template content in bash; agent steps handle large text natively.
Several steps are bookkeeping / evidence-collection gates (e.g.
implementation-terminal-evidence in workflow-tdd, step-17a-testing-evidence-gate
in workflow-pr-review, and the workflow_runtime_artifacts.sh artifact preflight).
These gates exist to record evidence — they do not themselves verify the code.
A bookkeeping gate that cannot run, or that finds no applicable work, MUST NEVER abort
the recipe and discard fully-implemented, tested, and committed work.
The recipe enforces three explicit outcomes at every such gate:
exit 0).WARNING ... continuing in degraded mode to stderr and exits 0
(no-discard) so the branch/PR is preserved. Degradation is always visible —
never a silent skip.VERDICT: FAILED, HOLLOW_SUCCESS,
zero-BS) stays fatal and aborts loudly. Bookkeeping degradation must never mask a
real code failure.Every bundled-helper resolution site uses the canonical resolution ladder
(AMPLIHACK_HOME → REPO_PATH → $(pwd) → ~/.copilot → ~/.amplihack) so
a helper installed at the amplihack root is always found, even when cwd/repo_path
is a downstream product repo whose amplifier-bundle/tools/ is gitignored. The single
fail-visible terminal action is kept last per site. The FATAL allowlist
(step-08c-enforce-verdict, step-19c-zero-bs-verification, git-identity resolution)
is preserved; only bookkeeping/evidence gates are converted to visible-degrade.
See docs/reference/workflow-implementation-evidence.md for the full gate inventory.
The workflow creates automatic checkpoints at these points to prevent work loss:
| Checkpoint | After Step | Preserves |
|---|---|---|
checkpoint-after-design | 5e (Design Consolidation) | Architecture decisions, API design, DB schema |
checkpoint-after-implementation | 8b (Integration) | Tests, implementation code, integration work |
checkpoint-after-review-feedback | 11b (Implement Feedback) | Review-addressed changes |
If a step fails after a checkpoint, the worktree branch retains all committed work. Agents can resume from the latest checkpoint by re-running the workflow with the existing worktree.
SKILL.md, relative to this skill's folderamplifier-bundle/recipes/default-workflow.yaml.claude/commands/amplihack/dev.md.claude/skills/dev-orchestrator/.claude/skills/investigation-workflow/Stop a background job you started by the PID you recorded with $!, or by a process group you created for the job with set -m or setsid, using kill -- -PGID. Never use pkill -f, pgrep -f with kill or xargs kill, or killall <name>: a pattern matches every process whose command line contains the same words, including the recipe runner and other agents. Time-box test runs with the test runner's own options (for example nextest slow-timeout with terminate-after, or vitest --testTimeout) instead of killing the run afterwards.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub rysweet/amplihack-rs --plugin amplihack30 skills in this plugin
/agentic-workflow-firstStart new work as a deterministic workflow of agentic steps, prompts, and tools instead of code. Use when designing a feature, deciding how to build something, choosing code vs recipe, or asking "how should I structure this"./amplihack-expertComprehensive knowledge of amplihack framework architecture, patterns, and usage/code-atlasBuilds comprehensive, living code-atlases as multi-layer architecture documents derived from
code-first truth. Defaults to both Graphviz DOT and Mermaid. User can override to single format.
Language-agnostic (Go, TypeScript, Python, .NET, Rust, Java). Files issues with
'code-atlas-bughunt' label. Treats atlas-building as a multi-agent bug-hunting journey:
graph-form reasoning exposes structural bugs, route/DTO mismatches, orphaned env vars,
dead code paths, and stale documentation that linear review misses. Three-pass bug hunt
with per-journey PASS/FAIL/NEEDS_ATTENTION verdicts.
Use when: creating architecture documentation, investigating unfamiliar codebases,
hunting structural bugs, setting up CI/CD diagram refresh, or publishing to GitHub Pages/mkdocs.
/code-philosophyMulti-pass code philosophy audit skill. Performs three distinct passes
over target code to verify adherence to the project's PHILOSOPHY.md
principles. Produces a structured report with findings and delegates
fixes to dev-orchestrator. This is an advisory audit-only skill — it
does not modify code directly.
/crusty-old-engineerCurmudgeonly engineering advisor that provides grounded skepticism, evidence-linked judgment,
and constructive progress on architectural decisions, legacy refactors, tooling choices, and
broad "how should I start?" questions. Sounds like a senior systems engineer who has reviewed
too many designs to be impressed, but still cares about correctness.
Use when: architectural decisions, legacy replacements, new tooling evaluation, broad planning questions.
/dev-orchestratorDefault task orchestrator for all development and investigation work.
Classifies tasks, decomposes into parallel workstreams if appropriate,
and routes execution through the recipe runner.
Other plugins' skills for the same job