Execute a task end-to-end with deterministic gates, preflight classification, depth control, and required independent reviews. Use for requests like "execute task", "run task", "implement task", "finish task T-00X", or "do task N". Do NOT use for standalone specialist review requests without implementation workflow.
Installation
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Execute a task end-to-end with deterministic gates, preflight classification, depth control, and required independent reviews. Use for requests like "execute task", "run task", "implement task", "finish task T-00X", or "do task N". Do NOT use for standalone specialist review requests without implementation workflow.
allowed-tools
["Read","Grep","Glob","Bash(*)","Edit","Write"]
metadata
{"author":"garda-agent-orchestrator","version":"1.0.0","runtime_requirement":"Node.js 24 baseline for public CLI and gate commands"}
Orchestration
This file is the canonical execution workflow.
Rule files provide policy context, but lifecycle steps and gate order are defined here.
Canonical gate surface is node garda-agent-orchestrator/bin/garda.js gate <name>.
Default task navigator is node garda-agent-orchestrator/bin/garda.js next-step "<task-id>" --repo-root "."; run it before the first gate, after every suggested command, and after any gate failure. The numbered workflow below defines policy and allowed gates, but next-step owns the executable next command.
Required Inputs
User request.
Current task queue: TASK.md.
Active source-of-truth entrypoint selected for this workspace.
Relevant rule files from garda-agent-orchestrator/live/docs/agent-rules/.
Activate reviewer-context compaction only when enabled=true and effective depth is in enabled_depths.
Shared gate output filters from garda-agent-orchestrator/live/config/output-filters.json stay active regardless of reviewer-context token-economy state.
Default: keep enabled=true with enabled_depths=[1,2]; at these depths reviewer context is compacted and token-economy savings are reported in the implementation summary.
Recommendation when reviewer-context token economy is enabled: use enabled=true with depth=1 only for small, well-localized tasks; prefer depth=2 or depth=3 when correctness depends on broader context.
Short-form depth=1 guidance is available at garda-agent-orchestrator/live/skills/orchestration-depth1/SKILL.md. If your client supports targeted skill loading, prefer that short form over the full orchestration skill when effective depth stays at 1 and no escalation trigger fires.
depth=2: load depth=1 context plus required checklists and only relevant rule sections.
default depth=3 policy: use full reviewer context.
if a deployment explicitly includes 3 in enabled_depths, keep the full reviewer context and allow only non-scope-reducing compaction (for example stripped examples/code blocks or compact reviewer output).
Depth-aware reviewer rule-pack contract when active:
code reviewer:
depth=1: 00-core.md, 80-task-workflow.md, plus rule ids/snippets directly triggered by changed scope.
JSON artifact must record selected rule pack, omitted sections, deferred_by_depth reason when applicable, scoped-diff fallback evidence, and nested rule_context.* metadata for the generated markdown snapshot.
sibling markdown snapshot (rule_context.artifact_path) is the preferred prompt payload for reviewer rule text when token economy mode is active.
Compact reviewer output contract when active:
if compact_reviewer_output=true, require compact reviewer artifacts but keep mandatory sections and exact verdict tokens.
on failed command/test evidence, cap pasted tail output to fail_tail_lines.
review/completion gates audit compactness best-effort and emit warnings when reviewer artifacts exceed compact budgets.
Task Resume Protocol
When resuming a task already in IN_PROGRESS or IN_REVIEW, treat resume as full orchestration execution.
Mandatory resume sequence:
Re-read AGENTS.md routing, 00-core.md, and this orchestration skill before any edits.
Re-open current task row in TASK.md and latest artifacts in runtime/reviews/ plus timeline runtime/task-events/<task-id>.jsonl.
Run node garda-agent-orchestrator/bin/garda.js next-step "<task-id>" --repo-root "." and follow only its single recommended command.
Continue from current stage, but do not skip compile/review/completion gates.
Final report contract remains mandatory on resume: review integrity attestation -> implementation summary -> commit command -> explicit commit question.
Task Start Contract
The canonical user command is: Execute task <task-id> from TASK.md strictly through the orchestrator. Use `next-step` as the navigator; when independent review is required, launch a sub-agent using your internal tools.
Active profile selection comes from garda-agent-orchestrator/live/config/profiles.json and the TASK.mdProfile column; do not present depth=<1|2|3> as normal user task-start guidance.
At fresh main-agent task start, show one English start marker from the repo-owned list (Garda captures my mind or Garda rewrites my code) once in the first relevant reply; this UX marker is not gate evidence.
Do not use start-marker presence or exact text as hard evidence for task-mode, compile, review, completion, or task-audit gates.
Reviewer agents, sub-agents, sidecars, and resumed cycles that already passed the start-banner step must not repeat it.
If the workspace already contains modified files before task-mode entry and the run is not isolated through staged or explicit scope, stop and treat the start as invalid.
Canonical Workflow
Select highest-priority TODO task in TASK.md; successful enter-task-mode reconciles it to IN_PROGRESS.
If no TODO exists, create a task from current user request; successful enter-task-mode then reconciles it to IN_PROGRESS.
Resolve requested depth and record requested/effective depth in non-status TASK.md notes.
Run the default navigator and repeat it after every command:
Do not start with compile-gate, infer default config flags, or choose a gate from this static list unless next-step prints it as the single recommended command.
Enter task mode explicitly before preflight when next-step requests it:
enter-task-mode writes task-scoped event TASK_MODE_ENTERED automatically and persists runtime/reviews/<task-id>-task-mode.json.
Enter task mode with explicit runtime identity via --provider "<provider>"; add --routed-to "<provider-bridge-or-entrypoint>" only when route telemetry must be pinned, and do not rely on canonical SourceOfTruth fallback.
Record baseline downstream rules explicitly before preflight when next-step requests it:
When next-step prints bind-rule-pack-to-preflight, run that command instead; it is allowed only for unchanged current-cycle rule files and hashes where evidence needs a new preflight binding.
load-rule-pack must include every downstream rule file actually opened after preflight, including risk-specific rule packs required by the selected reviews.
This step is order-dependent: do not parallelize it with classify-change or compile-gate for the same task cycle.
Execute implementation path:
FULL_PATH runtime => tests first, then implementation.
non-runtime or FAST_PATH runtime => objective validations, then implementation.
Run compile gate (mandatory) before review phase only when next-step reports NextGate: compile-gate:
Resolve fail_tail_lines from garda-agent-orchestrator/live/config/token-economy.json; when missing/invalid, fallback to 50.
Gate output filter profiles are loaded from garda-agent-orchestrator/live/config/output-filters.json; invalid config must warn and fall back to passthrough output.
Compile gate auto-emits IMPLEMENTATION_STARTED before execution and then writes COMPILE_GATE_PASSED or COMPILE_GATE_FAILED.
Compile gate is strict about preflight scope freshness and fails on scope drift; rerun next-step and follow its refresh sequence when scope changes.
A newer PREFLIGHT_CLASSIFIED also invalidates older post-preflight rule-pack evidence; rerun downstream gates sequentially instead of overlapping the same task cycle.
If preflight was created from planned --changed-file inputs in a clean workspace before implementation, that refresh is expected once the real diff exists.
On failure, do not move to review phase; fix and rerun until pass.
After COMPILE_GATE_PASSED, let the successful review-gate flow reconcile the task to IN_REVIEW; do not hand-edit that transition.
Before each required independent review, run build-review-context for that review type only when next-step names it.
This step is mandatory even when token economy is inactive because it auto-emits REVIEW_PHASE_STARTED, SKILL_SELECTED, and SKILL_REFERENCE_LOADED.
Run only required independent reviews from preflight:
mandatory on every provider: clean-context delegated reviewer sub-agents with isolated review context.
same-agent fallback does not satisfy the mandatory review workflow.
if the current runtime session cannot launch delegated reviewers, stop and treat the task as blocked until delegated review support exists.
if runtime identity is missing, contradictory, still relies on canonical SourceOfTruth fallback, or does not attest launchable reviewer subagents, rerun enter-task-mode with explicit runtime identity before handshake-diagnostics or build-review-context.
baseline: code, db, security, refactor
optional when enabled in garda-agent-orchestrator/live/config/review-capabilities.json: api, test, performance, infra, dependency
when token economy mode is active, generate review-context artifact and attach both the JSON metadata artifact and its rule_context.artifact_path markdown snapshot to the reviewer prompt.
when scoped_diffs=true and required reviewer is db, security, or refactor, run scoped diff helper and attach scoped artifact path plus scoped metadata fallback flag to reviewer prompt.
Log event per reviewer invocation: REVIEW_REQUESTED.
Run required-reviews-check and treat result as release gate when next-step requests it.
required-reviews-check writes task-scoped event REVIEW_GATE_PASSED or REVIEW_GATE_FAILED automatically.
required-reviews-check fails if explicit task-mode entry evidence is missing (missing TASK_MODE_ENTERED / missing runtime/reviews/<task-id>-task-mode.json).
required-reviews-check fails if post-preflight rule-pack evidence is missing (missing RULE_PACK_LOADED / missing runtime/reviews/<task-id>-rule-pack.json).
required-reviews-check fails if compile evidence is missing in runtime/task-events/<task-id>.jsonl (missing COMPILE_GATE_PASSED).
required-reviews-check fails if workspace changed after compile evidence; rerun compile gate after post-compile edits.
If explicit --*-review-verdict flags are omitted, the gate defaults expected required verdicts from preflight.required_reviews for the current cycle.
This defaulting is only a contract convenience; the gate still validates current-cycle artifacts, receipts, review-context bindings, and exact pass tokens, and must not auto-scan runtime/reviews for a convenient PASS.
Resolve every review finding before DONE and repeat required reviews + gate check until the final PASS artifacts are clean.
blocking findings must be fixed before rerun.
non-blocking findings may be deferred only in Deferred Findings with Justification: after the active Findings by Severity and Residual Risks sections are cleared to none.
On failed gate and return to coding, log event: REWORK_STARTED.
Run doc impact gate before completion when next-step requests it:
Completion gate writes task-scoped event COMPLETION_GATE_PASSED or COMPLETION_GATE_FAILED automatically.
Completion gate fails if task-mode entry evidence is missing.
Completion gate fails if post-preflight rule-pack evidence is missing.
Completion gate fails if a PASS review artifact still contains active findings or residual risks, or if any deferred entry omits Justification:.
Completion gate validates full-suite-validation cycle binding when enabled.
Update required docs and changelog when behavior changed.
Internal orchestration artifacts (TASK.md, garda-agent-orchestrator/runtime/**, garda-agent-orchestrator/live/docs/changes/CHANGELOG.md) may remain gitignored in deployed workspaces; update them on disk but do not git add -f them unless the user explicitly asks to version orchestrator internals.
Record artifacts, evidence, and any non-status task notes in TASK.md.
After COMPLETION_GATE_PASSED, run node garda-agent-orchestrator/bin/garda.js gate task-audit-summary --task-id "<task-id>" --as-json; this materializes runtime/reviews/<task-id>-final-closeout.json and runtime/reviews/<task-id>-final-closeout.md. Use the canonical final-closeout artifact instead of reconstructing the report structure manually.
Terminal status contract:
DONE only when compile gate, required review gate, doc impact gate, and completion gate passed; successful completion finalization reconciles TASK.md to DONE.
BLOCKED when any mandatory gate failed or cannot run; keep the blocked reason explicit, stop the pipeline, and do not hand-edit the active TASK.md status cell to BLOCKED as a gate substitute.
SPLIT_REQUIRED when a scope-budget guard, review-cycle auto-split guard, or strict decomposition split-required decision latched the parent before child tasks were linked; do not run parent lifecycle gates while latched.
DECOMPOSED when a scope-budget, review-cycle, or strict-decomposition guard intentionally split the parent into child tasks; do not run parent lifecycle gates after decomposition.
Strict decomposition children must stay strict: next-step only routes a split-required strict parent when the linked child rows match the decision artifact, are parent-derived, exist in TASK.md, and use profile strict.
do not paste the full final-closeout markdown or duplicate its complete section order in chat; link or name the canonical artifact when useful, then report only the status, key changes, validations, and commit readiness;
at depth=1 and depth=2, include an output-compaction line; at depth=3 it is optional;
use chars as the primary unit, keep approximate percentage when baseline is known, keep spaced breakdown formatting, and include token estimate only as a secondary note when available;
keep spaces between numeric values and labels and around +; do not emit compressed fragments like 824code review context or +25DB review context;
localized summaries may translate the wording, but must preserve the numeric structure; example: Suppressed output: ~3528 chars (~67%) (code review context ~3296 chars + DB review context ~100 chars + compile gate output ~132 chars). Token estimate: ~882.
commit suggestion as exact command form, defaulting to conventional style: git commit -m "<type>(<scope>): <summary>"
if final_closeout.commit_command_suggestion is populated, use it verbatim by default; otherwise fall back to the conventional template above.
explicit follow-up question: Do you want me to commit now? (yes/no)
Close spawned reviewer/specialist agents when platform supports agent lifecycle controls.
Never commit unless user explicitly requests commit.
Reviewer Agent Execution (Platform-Agnostic)
Apply this section on every platform.
Mandatory reviews must launch each required reviewer as a fresh-context delegated sub-agent with isolated context on every provider.
Do not use provider-default reviewer agents that bypass this contract.
Provider delegation capability and platform launch mapping:
Codex (delegation-capable): use sub-agents with isolated review context.
Cursor (delegation-capable): use delegated reviewer sub-agents with isolated context.
Claude Code (delegation-capable): use Agent tool/sub-agents with fork_context=false.
Gemini (delegation-capable): use delegated reviewer sub-agents with isolated context.
Qwen (delegation-capable): use delegated reviewer sub-agents with isolated context.
GitHub Copilot CLI (delegation-capable): use task tool with agent_type="general-purpose"; run one reviewer per isolated task execution.
Windsurf (delegation-capable): use delegated reviewer sub-agents with isolated context.
Junie (delegation-capable): use delegated reviewer sub-agents with isolated context.
Antigravity (delegation-capable): use delegated reviewer sub-agents with isolated context.
Providers or bridges without delegated reviewer support are not eligible to satisfy the mandatory review workflow until delegated launch support exists.
Reviewer routing metadata contract:
Each reviewer invocation must capture reviewer_execution_mode (delegated_subagent) and reviewer_identity (agent:<reviewer-id>).
build-review-context emits reviewer_routing metadata in the review-context artifact; the orchestrator must populate reviewer_routing.actual_execution_mode and reviewer_routing.reviewer_session_id after reviewer launch.
Fresh-context requirement: do not reuse an existing reviewer session for a new mandatory review.
Reusing a prior review artifact or receipt is valid only through explicit current-cycle reuse evidence; reusing the same reviewer session for a new mandatory review is not valid fresh-context launch evidence.
After the review receipt is persisted by record-review-result or record-review-receipt, close or release the reviewer sub-agent session.
build-review-context must fail closed when the pinned runtime identity is unresolved or does not attest launchable reviewer subagents for the current runtime session.
Historical same_agent_fallback artifacts are compatibility-only diagnostics and must not satisfy a fresh mandatory review cycle.
Gate diagnostics (required-reviews-check, completion-gate) must report whether each review has valid delegated fresh-context execution evidence.
For each required review where preflight required_reviews.<type>=true:
Launch reviewer using the platform mapping above with mandatory delegation on capable providers.
Prompt must include:
task id and task goal;
changed files list from preflight artifact;
diff summary (or exact staged diff if available);
mandatory skill path for this review type;
explicit rule-context package paths selected for this reviewer/depth (do not include non-selected rule files while token economy mode is active);
review-context artifact path (garda-agent-orchestrator/runtime/reviews/<task-id>-<review-type>-review-context.json) and nested markdown snapshot from rule_context.artifact_path; this artifact is mandatory lifecycle evidence even when token economy mode is inactive;
token economy flags when active (depth, compact_reviewer_output, strip_examples, strip_code_blocks);
for db / security / refactor required reviews when scoped diffs are enabled: scoped artifact produced by node garda-agent-orchestrator/bin/garda.js gate build-scoped-diff, with scoped metadata artifact and full-diff fallback when helper reports empty scope;
required output contract:
verdict token (... PASSED or ... FAILED);
findings list with file evidence;
reviewer_execution_mode used for this review (delegated_subagent);
when verdict is pass, keep active Findings by Severity and Residual Risks empty (none); move any accepted non-blocking follow-up to Deferred Findings and include Justification: in each deferred entry;
Feed reviewer output into record-review-result using exactly one source: --review-output-path or --review-output-stdin.
--review-output-stdin is only a transport convenience. The gate must still persist raw reviewer input to garda-agent-orchestrator/runtime/reviews/<task-id>-<review-type>-review-output.md before verdict extraction and receipt materialization.
Do not introduce a lighter validation branch for stdin. Verdict, routing, receipt, and telemetry checks must be identical to file-based ingest.
After receipt persistence succeeds, close or release the reviewer sub-agent session; do not keep a reviewer session alive for another mandatory review.
Parse verdict token from the persisted reviewer output artifact.
If verdict is failed, or a PASS artifact still leaves active findings/residual risks without justified deferral, fix or explicitly defer the finding and rerun the same reviewer until the final artifact is clean.
Explicit verdict flags are optional when the expected required review set already comes from preflight.required_reviews; omitted review types default to their required pass tokens for this task cycle.
Historical same_agent_fallback artifacts may be read for diagnostics only; they do not satisfy a fresh mandatory review cycle.
HARD STOP: if the provider cannot launch delegated reviewer sub-agents, the mandatory review workflow is blocked until delegated launch support exists.
max scope for override: <=1 changed file and <=8 changed lines,
reason is mandatory and persisted into override artifact.
Hard Stops
Do not assign FAST_PATH / FULL_PATH manually.
Do not skip explicit task-mode entry via enter-task-mode before preflight and implementation.
Do not skip explicit rule-pack evidence via load-rule-pack; reading only the top-level router is insufficient.
Do not skip preflight classification with explicit --output-path.
Do not move to implementation without plan.
Do not move to IN_REVIEW without passing compile gate (COMPILE_GATE_PASSED).
Do not bypass required reviews without deterministic gate override contract.
Do not set or hand-edit active TASK.md lifecycle status cells (IN_PROGRESS, IN_REVIEW, SPLIT_REQUIRED, DONE, BLOCKED) as a substitute for gates; task-mode, review-gate, split-required latch, and completion finalization own normal status sync, and explicit operator task-reset owns reset/discard.
Do not set DONE without passing compile gate, required-reviews-check, doc-impact-gate, and completion-gate.
Do not continue after compile/review when scope changed; rerun preflight and full mandatory gates.
Do not use git add -f to stage ignored orchestration control-plane files just because gates or changelog rules mention them.
Do not change final report order: review integrity attestation -> implementation summary -> git commit -m suggestion -> Do you want me to commit now? (yes/no).
Final report review integrity attestation must state whether independent review completed, whether fake/fallback/same-agent/legacy/missing/unverifiable review artifacts were observed, whether completion is review-attested, and why completion is or is not allowed.
Do not leave reviewer/specialist agents open after review completion (when platform supports agent lifecycle controls).
Mandatory Outputs
Gate-owned TASK.md status reconciliation plus any required non-status notes or artifact references. Do not manually synchronize the active lifecycle status in the final report.
Skill may use audited override only if gate script allows it for tiny low-risk scope.
Troubleshooting
Preflight not found or invalid:
Re-run classify-change with explicit output path.
Required review verdict missing:
Re-run missing reviewer and then required-reviews-check.
Completion gate failed:
Resolve listed timeline/artifact/integrity violations, then rerun completion-gate.
Compile gate failed:
Fix compile errors and rerun compile-gate until COMPILE_GATE_PASSED.
Compile gate failed with preflight scope drift:
Re-run node garda-agent-orchestrator/bin/garda.js next-step "<task-id>" --repo-root "." and follow its refresh sequence.
If the original preflight used planned --changed-file inputs in a clean workspace before coding, changed line totals may differ once the real diff exists; this is expected.
Doc impact gate failed:
Fix doc-impact decision/rationale/changelog flags and rerun doc-impact-gate.
Override rejected:
Scope is too large or specialized reviews are required; remove override and run full review path.
Git noise in dirty workspace:
Stage task-specific project files and run preflight with --use-staged.
Ignored orchestration control-plane files should stay unstaged unless the user explicitly asks to version them.