with one click
subagent-driven-development
// Use when executing an engineering-approved FeatureForge implementation plan with mostly independent tasks in the current session
// Use when executing an engineering-approved FeatureForge implementation plan with mostly independent tasks in the current session
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | subagent-driven-development |
| description | Use when executing an engineering-approved FeatureForge implementation plan with mostly independent tasks in the current session |
_REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
_BRANCH_RAW=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo current)
[ -n "$_BRANCH_RAW" ] && [ "$_BRANCH_RAW" != "HEAD" ] || _BRANCH_RAW="current"
_BRANCH="$_BRANCH_RAW"
_FEATUREFORGE_INSTALL_ROOT="$HOME/.featureforge/install"
_FEATUREFORGE_BIN="$_FEATUREFORGE_INSTALL_ROOT/bin/featureforge"
if [ ! -x "$_FEATUREFORGE_BIN" ] && [ -f "$_FEATUREFORGE_INSTALL_ROOT/bin/featureforge.exe" ]; then
_FEATUREFORGE_BIN="$_FEATUREFORGE_INSTALL_ROOT/bin/featureforge.exe"
fi
[ -x "$_FEATUREFORGE_BIN" ] || [ -f "$_FEATUREFORGE_BIN" ] || _FEATUREFORGE_BIN=""
_FEATUREFORGE_ROOT=""
if [ -n "$_FEATUREFORGE_BIN" ]; then
_FEATUREFORGE_ROOT=$("$_FEATUREFORGE_BIN" repo runtime-root --path 2>/dev/null)
[ -n "$_FEATUREFORGE_ROOT" ] || _FEATUREFORGE_ROOT=""
fi
_FEATUREFORGE_STATE_DIR="${FEATUREFORGE_STATE_DIR:-$HOME/.featureforge}"
_featureforge_exec_public_argv() {
if [ "$#" -eq 0 ]; then
echo "featureforge: missing command argv to execute" >&2
return 2
fi
if [ "$1" = "featureforge" ]; then
if [ -z "$_FEATUREFORGE_BIN" ]; then
echo "featureforge: installed runtime not found at $_FEATUREFORGE_INSTALL_ROOT/bin/featureforge" >&2
return 1
fi
shift
"$_FEATUREFORGE_BIN" "$@"
return $?
fi
echo "featureforge: refusing non-featureforge public argv: $1" >&2
return 2
}
Live workflow routing uses only $_FEATUREFORGE_BIN; never use ./bin/featureforge, target/debug/featureforge, or cargo run for live routing. Query workflow/operator JSON with $_FEATUREFORGE_BIN workflow operator --plan <approved-plan-path> --json.
If the installed runtime/root cannot be resolved, stop before making workflow mutations. Use only typed operator JSON route surfaces: execute recommended_public_command_argv when present; when recommended_public_command_template appears, treat required_inputs as validation metadata and materialize templates only by rerunning $_FEATUREFORGE_BIN workflow operator --plan <approved-plan-path> --input NAME=VALUE --json. Detailed binding and route-specific stop rules live in $_FEATUREFORGE_ROOT/references/operator-route-authority.md. Treat display-only recommended_command as non-executable; if no typed executable surface exists, stop and report the route diagnostic.
Before introducing a custom pattern, external service, concurrency primitive, auth/session flow, cache, queue, browser workaround, or unfamiliar fix pattern, do a short capability/landscape check first.
Use three lenses, then decide from local repo truth:
External search results are inputs, not answers. Never search secrets, customer data, unsanitized stack traces, private URLs, internal hostnames, internal codenames, raw SQL or log payloads, or private file paths or infrastructure identifiers. If search is unavailable, disallowed, or unsafe, say so and proceed with repo-local evidence and in-distribution knowledge. If safe sanitization is not possible, skip external search.
See $_FEATUREFORGE_ROOT/references/search-before-building.md.
For every interactive user question, use this structure:
RECOMMENDATION: Choose [X] because [one-line reason]A) ... B) ... C) ...Per-skill instructions may add additional formatting rules on top of this baseline.
Execute plan by dispatching a fresh sub-agent or custom agent per task, with two-stage review after each (spec compliance first, then code quality), then task-scoped verification-before-completion before any next-task advancement. The runtime-selected topology still wins: when it chooses worktree-backed parallel execution, follow the worktree-first orchestration model and keep each task in its isolated workspace.
Task packets must preserve the approved task contract from $_FEATUREFORGE_ROOT/review/plan-task-contract.md. The packet's Goal, Context, indexed CONSTRAINT_N obligations, indexed DONE_WHEN_N obligations, covered requirements, and file scope are authoritative for implementers and reviewers; coordinator prose may add logistics but must not reinterpret or weaken them.
Core principle: Fresh isolated agent per task + spec review + code-quality review + verified task closure before any next task.
Extended examples, model-selection hints, and rationale live in $_FEATUREFORGE_ROOT/references/execution-review-qa-examples.md.
digraph when_to_use {
"Have engineering-approved implementation plan?" [shape=diamond];
"Return to using-featureforge artifact-state routing" [shape=box];
"Tasks mostly independent?" [shape=diamond];
"Stay in this session?" [shape=diamond];
"subagent-driven-development" [shape=box];
"executing-plans" [shape=box];
"Have engineering-approved implementation plan?" -> "Return to using-featureforge artifact-state routing" [label="no"];
"Have engineering-approved implementation plan?" -> "Tasks mostly independent?" [label="yes"];
"Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
"Tasks mostly independent?" -> "executing-plans" [label="no - tightly coupled or better handled in one coordinator session"];
"Stay in this session?" -> "subagent-driven-development" [label="yes"];
"Stay in this session?" -> "executing-plans" [label="no - parallel session"];
}
For each task, enforce this exact order before dispatching the next task:
Finding ID, Severity, Task, Violated Field or Obligation, Evidence, Required Fix, and Hard Fail.verification-before-completion and collect the verification result inputs needed by close-current-task.none when no workspace runtime was used)N+1 may begin only after Task N has a current positive task-closure record; dedicated-independent review loops and verification are required inputs to close-current-task and are not separate begin-time authority after closure is current.$_FEATUREFORGE_BIN workflow operator --plan <approved-plan-path> --external-review-result-ready --json, then follow the Installed Control Plane section and canonical route reference for the returned route; verification results are close-current-task inputs, not a reason to pass that flag.N+1.Reviewed-closure and late-stage handoffs are operator-owned. Keep workflow/operator JSON as the route authority; use $_FEATUREFORGE_ROOT/references/operator-route-authority.md for route-specific binding detail and $_FEATUREFORGE_ROOT/docs/featureforge/reference/2026-04-01-review-state-reference.md only for the review-state mental model.
Use $_FEATUREFORGE_BIN workflow operator --plan <approved-plan-path> --external-review-result-ready --json only after an external task-review or final-review result is in hand; do not use that hint for release-readiness, document-release, or QA routing.
Do not duplicate route tables, infer low-level dispatch-lineage commands, or manually edit runtime-owned records, derived markdown projections, or **Execution Note:** lines to recover routing state. Follow operator JSON and the canonical route reference.
When no tasks remain, query workflow/operator for the selected late-stage route, then execute only the selected typed route or selected handoff skill.
Before dispatching any implementation subagent:
featureforge:plan-eng-review.**Workflow State:** Engineering Approved**Source Spec:** <path>**Source Spec Revision:** <integer>CEO Approved, and that the latest approved spec still matches that exact source-spec path and revision.featureforge:plan-eng-review if the plan is draft or malformedfeatureforge:writing-plans if the source spec path or revision is stalemain, master, dev, or develop) unless the user explicitly approves in-place execution$_FEATUREFORGE_BIN workflow operator --plan <approved-plan-path> --json before dispatching implementation subagents.phase executing, stop normal execution and follow the Installed Control Plane section plus the canonical route reference for the current operator result. Treat phase, phase_detail, and next_action as diagnostic context.begin for the active step. If the workspace becomes dirty before the first begin, expect later checks to fail closed with reason codes such as tracked_worktree_dirty until reconciled or isolated. Retroactive execution tracking is recovery-only; use the canonical route reference for recovery binding details.$_FEATUREFORGE_BIN workflow operator --plan ... --json during preflightstatus --plan ... only for additional diagnostics when operator output alone is insufficientbegin before starting work on a plan stepcomplete after each completed stepbegin for a revision whose plan still says **Execution Mode:** none, initialize execution with --execution-mode featureforge:subagent-driven-developmentdocs/featureforge/projections/ are optional human-readable exports; do not create or maintain a separate ad hoc task tracker outside workflow/operator and status.$_FEATUREFORGE_BIN plan execution materialize-projections --plan <approved-plan-path> for state-dir-only diagnostic projection refreshes. If the user explicitly needs repo-local human-readable projection exports, add --repo-export --confirm-repo-export; approved plan and evidence files are not modified, and materialization is never required for normal progress. Add --scope execution|late-stage|all only when a non-default export scope is needed.executing) while strategy checkpoints change; remediation stays represented by checkpoint state and operator routing.initial_dispatch: required before repo-writing implementation starts. Runtime records it automatically on first dispatch/begin when missing.review_remediation: required after actionable independent-review findings and before remediation starts. Runtime records it automatically when reviewable runtime review state enters remediation and when remediation reopens execution work.cycle_break: required when churn is detected. Runtime records it automatically when the same task hits three review-dispatch/reopen cycles in one run.cycle_break strategy automatically (no human replanning loopback).$_FEATUREFORGE_BIN plan execution status --plan ...:
strategy_statestrategy_checkpoint_kindlast_strategy_checkpoint_fingerprintstrategy_reset_requiredexecution_started is yes), runtime-selected implementation and review subagent dispatch is authorized and does not require per-dispatch user-consent prompts.featureforge:executing-plans and featureforge:subagent-driven-development).The main agent owns the protected-branch gate for every repo-writing task slice, even when an implementer subagent does the coding.
The coordinator owns every git commit, git merge, and git push for this workflow, even when an implementer subagent does the coding.
Before dispatching or applying any repo-writing task slice, run the shared repo-safety preflight for that exact scope:
$_FEATUREFORGE_BIN repo-safety check --intent write --stage featureforge:subagent-driven-development --task-id <current-task-slice> --path <repo-relative-path> --write-target execution-task-slice
allowed, continue with that task slice.blocked, name the branch, the stage, and the blocking failure_class, then route to either a feature branch / featureforge:using-git-worktrees or explicit user approval for this exact task slice.$_FEATUREFORGE_BIN repo-safety approve --stage featureforge:subagent-driven-development --task-id <current-task-slice> --reason "<explicit user approval>" --path <repo-relative-path> --write-target execution-task-slice [--write-target git-commit] [--write-target git-merge] [--write-target git-push]
$_FEATUREFORGE_BIN repo-safety check --intent write --stage featureforge:subagent-driven-development --task-id <current-task-slice> --path <repo-relative-path> --write-target execution-task-slice [--write-target git-commit] [--write-target git-merge] [--write-target git-push]
allowed.git commit, git merge, or git push on the same protected-branch task slice, re-run the gate with the same task id, the same repo-relative paths, and the same approved write-target set.approve plus full-scope check before continuing.main, master, dev, or develop as safe by itself; the branch must be non-protected or explicitly approved.Handle DONE, DONE_WITH_CONCERNS, NEEDS_CONTEXT, and BLOCKED as described in $_FEATUREFORGE_ROOT/references/execution-review-qa-examples.md. If the question is already answered by the packet, answer directly from the packet. If the packet does not answer it, the task is ambiguous and execution must stop or route back to review. Never ignore an escalation or force the same model to retry without changes.
implementer-prompt.md - Dispatch implementer subagentspec-reviewer-prompt.md - Dispatch spec compliance reviewer subagentcode-quality-reviewer-prompt.md - Dispatch code quality reviewer subagentDONE_WHEN_N and CONSTRAINT_N obligations by ID and cite those IDs in findings.Those per-task review loops satisfy the "review early" rule during execution. After the final task closes, query workflow/operator and follow the returned route; do not run a memorized terminal skill sequence.
[Query $_FEATUREFORGE_BIN workflow operator --plan <approved-plan-path> --json]
[Follow the Installed Control Plane section and canonical route reference]
[Execute only the returned typed public argv, operator-materialized template argv, or workflow/operator-selected handoff lane]
[After each lane completes, requery workflow/operator until the route is terminal or explicitly blocked]
Never:
main, master, dev, or develop) without explicit user consentIf subagent asks questions:
If reviewer finds issues:
If subagent fails task:
Upstream workflow skills:
Workflow/operator-selected completion lanes:
Subagents should use:
Optional direct invocation:
Alternative workflow: