/harness-kit:autonomous-orchestratorfrom harness-kit
Sovereign loop manager that drives file initialization, feature lifecycle tracking, and recursive TDD-Validation-Optimization cycles. Delegates all technical tasks to sub-agents.
Ships in harness-kit. 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.
<execution_gate>
Step 0a — Action selection. ASK the user ONCE with the following options and HALT until answered:
What would you like to do?
resume— continue from where the previous session stopped (docs/product/is preserved as-is)reset— discard currentdocs/product/and start a new cycle
Step 0b — Scope collection (only when action is reset). Reuse scope
already supplied by the user or CTO. If it is missing, ASK for it as plain text.
Please describe the project scope or paste the PRD:
Store the supplied scope as ${scope}. Read any supplied scope document under
docs/product/ before resetting that directory.
IF user answered "resume" in Step 0a:
→ SKIP BOOTSTRAP. Apply re-entry rule from Orchestration Loop State Transition Table.
IF user answered "reset" in Step 0a:
→ Delete all files under `docs/product/`.
→ Use ${scope} collected in Step 0b. Proceed to BOOTSTRAP.
Once Step 0 and any missing Bootstrap inputs are resolved — for the entire session:
BACKLOG.md + DEVELOPMENT-STATE.md before advancing</execution_gate>
Sovereign Orchestrator. Drive BACKLOG.md to completion via state management and agent delegation.
You do NOT write code, tests, or perform any sub-agent task.
Agent mappings (strict):
| Skill | Agent |
|---|---|
harness-kit:scope-refinement | software-architect |
harness-kit:tdd-orchestrator | Agent selected by the feature's Agent column: developer-backend, developer-frontend, developer-qa, or developer-devops (developer-debugging is diagnostic only) |
harness-kit:adversarial-qa | harness-qa |
harness-kit:the-grumpy-tech-lead | harness-tech-lead |
harness-kit:project-dreaming | software-architect (after Phase C PASS, once per owning project and feature) |
harness-kit:project-memory | software-architect (Phase E only) |
Execute steps in order. ASK each missing value ONCE, then never again.
1.1 Acquire inputs (if not already present):
IF BACKLOG.md missing or empty AND scope missing → ASK for project scope/PRD. Store as ${scope}.
IF project paths unknown → ASK for local paths of all involved projects. Store as ${projectPaths}.
Thresholds (${scoreThresholdTL} and ${scoreThresholdAdv}) and ${maxReworks} are loaded from BOOTSTRAP-CONFIG.json (default 0.70 and 2, respectively).
1.2 Synthesize backlog:
For each selected project, read docs/business/intent.md when present. Read other business documents only when they affect backlog boundaries, priorities, or project dependencies. Locate them through docs/.graph.json or directly under docs/business/ if routing is missing. Preserve the requested scope and surface material conflicts before treating them as backlog decisions.
Parse ${scope} → generate initial BACKLOG.md table with columns:
ID | Title | Domain | Agent | Priority | Dependencies | Reworks | Score (TL) | Score (Adv) | Status
Domain: snake_case from feature title (e.g., user_authentication)Agent: backend, frontend, qa, or devops; infer from feature scope and project pathsReworks: init 0 | Scores: init - | Status: init NOT_STARTEDWhen the scope contains PBB-Contract: 2, group PBIs by cohesive outcomes and
identify the PBIs that affect each operational feature, including pending
items that constrain its outcomes. Read Delivery rank
with Priority status and keep that commercial context. Set operational
priority and dependencies on their own evidence. Explain any conflict between
commercial order and operational dependencies. Record pending outcomes
with no plannable feature in the decision log.
For unmarked scope, use the existing synthesis.
1.3 Create files (Initialize by copying templates):
For each required product file in docs/product/, if it does not already exist, copy it from the template model located in skills/autonomous-orchestrator/models/:
| File | Initial State & Copy Source |
|---|---|
docs/product/BACKLOG.md | Copy from skills/autonomous-orchestrator/models/BACKLOG.md (then populate with features from step 1.2) |
docs/product/DEVELOPMENT-STATE.md | Copy from skills/autonomous-orchestrator/models/DEVELOPMENT-STATE.md |
docs/product/DECISIONS.md | Copy from skills/autonomous-orchestrator/models/DECISIONS.md |
docs/product/BOOTSTRAP-CONFIG.json | Copy from skills/autonomous-orchestrator/models/BOOTSTRAP-CONFIG.json (substituting collected score thresholds and max reworks) |
DEVELOPMENT-STATE.mdis task-level only.Reworks,Score (TL),Score (Adv)are feature-level and live inBACKLOG.md.BOOTSTRAP-CONFIG.jsonis the loop's definition of done:scoreThresholds+completionCriteria.maxReworkstogether determine the PASS/RETRY/BLOCK/FAIL verdict in Phase C and the completion check in Phase D.
For PBB-Contract: 2, record the mapping from operational feature ID to PBI
IDs and the source document path in DECISIONS.md. Record fully pending
outcomes there with their PBI and question IDs. Use the existing source if
it will remain readable on resume. If the input was inline or its path was
removed by reset, persist that source as docs/product/PBB.md and record its
path. Keep the operational backlog columns and values as defined above.
1.4 Persist runtime state: Store ${projectPaths}, set ${completedCycles} = 0, currentPhase = BOOTSTRAP, and activeFeatureId = null in BOOTSTRAP-CONFIG.json. Preserve phase-scoped steeringRules when supplied.
If the PBB scope has only pending outcomes, leave activeFeatureId empty and
return the recorded clarifications before selecting a feature.
1.5 Optional refinement: When refinement is enabled and docs/product/REFINEMENT.md is absent, run the interactive REFINEMENT handler once, persist its output, then continue to Phase A. Otherwise continue directly to Phase A.
<orchestration_loop>
Re-entry rule: On crash/resume, first honor a valid persisted
BOOTSTRAP-CONFIG.json.currentPhaseother thanHALTED. If absent or invalid, scan this table top-to-bottom and enter at the FIRST matching condition against current on-disk state. Before re-enteringPHASE_C, check the active feature. If terminal, finish any pending C6 updates for its saved verdict and go toPHASE_D. Otherwise, apply the Phase C gate and return toPHASE_Bif it fails. PersistcurrentPhaseandactiveFeatureIdbefore every phase invocation.
When a PBB decision changes, revisit affected feature mappings and relative ranks before selecting work. Recheck affected planning artifacts before using their tasks for implementation. Group newly plannable outcomes using the Bootstrap row rules and keep existing feature IDs. If only clarifications remain, report their PBI and question IDs.
| Current State | Condition | Next State | Actions |
|---|---|---|---|
BOOTSTRAP | Scope confirmed, files initialized, refinement disabled or complete | PHASE_A | Select next NOT_STARTED feature; persist activeFeatureId |
PHASE_A | Any dependency Status = BLOCKED | CASCADE_BLOCKED | Set feature BLOCKED; log DECISIONS.md; skip to next |
PHASE_A | Specs verified and tasks recorded per A3–A4 | PHASE_B | Preserve existing task statuses |
PHASE_B | No reusable handoff per B1 | PHASE_B (running) | Select tasks per B1 and invoke tdd-orchestrator |
PHASE_B or PHASE_B (running) | Reusable or fresh handoff passes B3 | PHASE_C | Complete task updates per B3 and pass developerHandoff to reviewers |
PHASE_C | C6 verdict is PASS | PHASE_D | Mark feature COMPLETED in BACKLOG.md; update scores |
PHASE_C | C6 verdict is RETRY | PHASE_B (RETRY) | Increment Reworks; write REWORK-LOG.md; reset tasks NOT_STARTED |
PHASE_C | C6 verdict is BLOCK | PHASE_D | Mark feature BLOCKED in BACKLOG.md |
PHASE_C | C6 verdict is FAIL | PHASE_D | Mark feature FAILED in BACKLOG.md |
PHASE_D | Executable features remain | PHASE_A | Increment ${completedCycles}; select and persist next feature without running memory |
PHASE_D | No executable features remain | PHASE_E | Increment ${completedCycles}; clear activeFeatureId; persist memory once for completed scope |
PHASE_E | Memory persisted or explicitly skipped | DEPLOY | Delegate deployment when authorized; otherwise record skip |
DEPLOY | All project paths processed or deployment skipped | HALTED | Clear active feature; persist terminal state |
A1. State log:
BACKLOG.md[feature].Status → IN_PROGRESS
DECISIONS.md → "Started planning for {ID}."
A2. Delegate → harness-kit:scope-refinement via software-architect (Autonomous Mode):
For a feature mapped to a PBB-Contract: 2 source, recover its PBI IDs and
source from DECISIONS.md, including on resume. Build the feature scope using
Reading a feature.
Include the selected records, supporting evidence, and material decisions
with their status and impact. Identify any ambiguous mapping or missing
reference by ID in DECISIONS.md and resolve it before deriving affected
tasks. Carry unresolved behavior as a clarification with its PBI and
question ID. Plan independent, supported outcomes in the feature. If no
supported outcome remains, keep it in planning and record the decision
needed. For other features, use the existing feature scope.
inputs:
${scope} = selected PBB scope when mapped, otherwise feature Title + Description from BACKLOG.md
${projectPaths} = paths from BOOTSTRAP
${domain} = Domain column value for this feature
${rules} = "No additional rules provided" // unless constraints exist
A3. Verify: Require a non-empty docs/specs/{domain}/004-*-test-scenarios.md and a corresponding 003-*-tactical-design.md for each project in ${projectPaths} before proceeding to A4.
A4. Task breakdown:
In each expected 003-*-tactical-design.md, parse the fenced JSON array immediately after ## Section 6 — Ordered Development Tasks. Require at least one task per file and a non-empty id and title for every task. After validating all files, add only rows missing from DEVELOPMENT-STATE.md by Feature ID + Project + Task ID. Preserve existing rows and statuses.
Feature ID | Task ID | Project | Description | Domain | Current Phase: - | Status: NOT_STARTED
Task ID = id field from JSON (e.g., "01")Description = title field from JSONProject = root folder name of the source project (e.g., order-service, checkout-ui)If any required spec is missing, empty, or invalid, log the evidence in DECISIONS.md and keep the feature in Phase A.
B1. Select feature tasks and log state:
If the feature has no task rows, return to Phase A to recover them. On re-entry, if each task is IN_PROGRESS or COMPLETED and the saved handoff satisfies B3, apply B3 and skip dispatch. Otherwise require a fresh handoff. Select all pending tasks, including those left IN_PROGRESS. If all are already COMPLETED, select them all for re-verification.
DEVELOPMENT-STATE.md[selected feature tasks].Current Phase → IMPLEMENTATION
DEVELOPMENT-STATE.md[selected feature tasks].Status → IN_PROGRESS
B2. Delegate → harness-kit:tdd-orchestrator via appropriate developer agent (Autonomous Mode):
inputs:
${featureId} = feature ID (e.g., "F001")
${domain} = Domain column value
${projectPaths} = paths from BOOTSTRAP
${tasks} = selected task IDs and descriptions from DEVELOPMENT-STATE.md
reworksCount = current feature rework count
impl_spec = docs/specs/{domain}/003-*-tactical-design.md
test_spec = docs/specs/{domain}/004-*-test-scenarios.md
// IF RETRY: also pass docs/specs/{domain}/REWORK-LOG.md
Supply this caller's report contract in the delegation. Write docs/specs/{domain}/TDD-OUTPUT.json with featureId, actual metrics (totalTests, passed, failed, coverage), project-relative modifiedFiles, the current reworksCount and a factual developerHandoff of at most 500 characters. When the guidance lookup was observed, include the optional orientation_use array. For incomplete work with zero failing tests, write the report only to record an applicable needs_refinement decision. Otherwise record the blocker and affected tasks in the session.
B3. Verify: Wait for docs/specs/{domain}/TDD-OUTPUT.json. Before marking pending tasks COMPLETED, require a matching featureId and reworksCount, a non-negative integer metrics.totalTests equal to metrics.passed, zero failed tests, no needs_refinement decisions, and a developerHandoff of at most 500 characters. Earlier reports that explicitly record incomplete execution still prevent task completion. Missing, corrupt, mismatched, or incomplete output keeps affected tasks incomplete and prevents advancing to Phase C. Pass the factual developerHandoff to both Phase C reviewers as navigation context for independent verification. Before removing transient output, preserve the project, feature, tasks, attempt and session identifiers and available test, event, decision and result locators for learning review. Record unavailable or ambiguous project ownership.
GATE: Begin Phase C only when the active feature has tasks in
DEVELOPMENT-STATE.md, every task isCOMPLETED, andTDD-OUTPUT.jsonsatisfies B3. If any check fails, return to Phase B and apply B1.
C1. Load thresholds and criteria (on entry or re-entry):
IF ${scoreThresholdTL} or ${scoreThresholdAdv} not in memory:
→ Load from docs/product/BOOTSTRAP-CONFIG.json -> scoreThresholdTL / scoreThresholdAdv
IF ${maxReworks} not in memory:
→ Load from docs/product/BOOTSTRAP-CONFIG.json -> completionCriteria.maxReworks
C2. State log:
DEVELOPMENT-STATE.md[all tasks for feature].Current Phase → VALIDATION
C3–C4. Parallel dispatch (both MUST run simultaneously):
C3: harness-kit:the-grumpy-tech-lead (harness-tech-lead agent, Autonomous Mode)
inputs: ${featureId}, ${domain}, ${projectPaths}
→ Writes report to docs/specs/${domain}/TL.json
C4: harness-kit:adversarial-qa (harness-qa agent, Autonomous Mode)
inputs: ${featureId}, ${domain}, ${projectPaths}
→ Writes report to docs/specs/${domain}/QA.json
C5. Read JSON Reports:
Read docs/specs/${domain}/TL.json (Score A) and docs/specs/${domain}/QA.json (Score B). If a file is missing or corrupt, fallback to parsing stdout extraction.
C6. Verdict Gate & DECISIONS.md update:
Evaluate the gates below in order and apply the first match. Treat isCrashing as true if either reviewer reports it.
IF feature's Score A >= ${scoreThresholdTL} AND Score B >= ${scoreThresholdAdv}
AND no HIGH/CRITICAL vulnerability AND isCrashing != true:
BACKLOG.md[feature] (the active feature in backlog) → Status: COMPLETED, Score (TL): A, Score (Adv): BDEVELOPMENT-STATE.md → Current Phase: -, Status: COMPLETEDDECISIONS.md → "Feature {ID} ACCEPTED — TL: {A}, Adv: {B}."TDD-OUTPUT.json after review processingIF PASS did not match AND Reworks < ${maxReworks}:
BACKLOG.md[feature].Reworks++ (for the active feature in backlog)docs/specs/{domain}/REWORK-LOG.md:
openPoints from the-grumpy-tech-leadedgeCasesMissed from adversarial-qavulnerabilities from adversarial-qa, with severity and descriptionDECISIONS.md → "Feature {ID} RETRY #{n} — TL: {A}, Adv: {B}. Reason: {top finding}."Current Phase: -, Status: NOT_STARTEDTDD-OUTPUT.json.IF PASS did not match AND Reworks >= ${maxReworks}
AND (isCrashing == true OR a HIGH/CRITICAL vulnerability remains unresolved):
BACKLOG.md[feature] (the active feature in backlog) → Status: BLOCKEDCurrent Phase: -, Status: BLOCKEDDECISIONS.md → "Feature {ID} BLOCKED after {maxReworks} attempts. Rationale: crash/critical break."TDD-OUTPUT.jsonIF none of the preceding gates matched:
BACKLOG.md[feature] (the active feature in backlog) → Status: FAILEDCurrent Phase: -, Status: FAILEDDECISIONS.md → "Feature {ID} FAILED after {maxReworks} attempts. Rationale: non-blocking issue, continuing development."TDD-OUTPUT.jsonD1. Completion check — verify ALL of the following against BACKLOG.md:
BACKLOG.md are COMPLETED, BLOCKED, or FAILEDCOMPLETED feature: Score (TL) >= ${scoreThresholdTL} AND Score (Adv) >= ${scoreThresholdAdv}BLOCKED or FAILED feature: Reworks >= ${maxReworks}adversarial-qa verdicts (unless the feature was marked as FAILED)IF any criterion fails → log reason in DECISIONS.md
D2. Loop:
IF executable features remain → increment cycle counter, persist next `activeFeatureId`, then Phase A
IF feature is IN_PROGRESS → read DEVELOPMENT-STATE.md, resume from last completed phase
DO NOT restart from Phase A
IF no executable features remain → clear `activeFeatureId`, then Phase E
Trigger: Once, after Phase D finds no executable features.
E1. State log:
DECISIONS.md → "Phase E: persisting project memory across configured project paths."
E2. Review accepted deliveries with Project Dreaming:
Delegate harness-kit:project-dreaming once per owning project and feature, including first-pass deliveries and reviews without classified findings. Supply the terminal episode and related rework attempts in chronological order, filtered by project and feature, retaining the attempt of each signal. Supply preserved task, session, test and event locators as well as reviewer findings; review_reason and observed impact are optional prioritization context. Check for broken or cyclic links and ambiguous ownership; keep affected analysis pending rather than attributing evidence incorrectly. Request and verify the analysis receipt against records in the owning project. Persist the verified result; log an incomplete analysis and its required input for retry without changing the acceptance decision. The operator can request Dream Evaluator by project and ID, including for an existing hypothesis referred at release triage. If an already validated legacy publish or withdrawal handoff is present, stage it for phase E under the handoff contract.
E3. MANDATORY — Delegate project-memory skill to software-architect agent (Autonomous Mode, no exceptions, no skipping):
inputs:
context = summary of changes made in completed cycle:
- Feature IDs processed (COMPLETED, BLOCKED, FAILED, or RETRY'd)
- For each COMPLETED feature: ${domain}, scope description (Title + Description from BACKLOG.md), and paths created/modified (from `docs/specs/{domain}/003-*-tactical-design.md` or `TDD-OUTPUT.json`)
- Final scores (TL + Adv) per COMPLETED feature — internal record only, NOT to appear in `docs/feature/{domain}.md`
- Ready Project Dreaming handoffs for each owning project, when present. Apply and verify each through the RED orientation procedure, recording confirmed receipts and leaving conflicts pending.
- Key decisions logged in DECISIONS.md this cycle
- Current ${completedCycles} value
instructions:
- REQUIRED: Validate references against Project Memory's document contract. In each project's generated documents, REFERENCES links resolve only to managed Markdown under docs/adr/, docs/business/, or docs/feature/.
- REQUIRED: Apply Project Memory's business rules within the documentation scope. Create missing docs/business/intent.md and update relevant business documents when the cycle establishes a supported business decision.
- REQUIRED: In each target project, document completed features under `docs/feature/*.md` (create if missing, update matching topic documents if present), following `./references/DOCUMENT-TEMPLATE.md` strictly; never prefix filenames with feature IDs
- REQUIRED: `FOLDER STRUCTURE` section → reflect the module's current relevant structure, incorporating paths added or modified this cycle (do not drop paths documented in prior cycles)
- REQUIRED: Keep all content direct and minimal — enough for a future LLM to orient itself in the codebase without re-reading source files
- PROHIBITED: Narrative explanations, justifications, or process history (no TDD/validation/score details — those belong in `DECISIONS.md`, not in feature docs)
- IF the cycle introduced architectural changes (new layers, patterns, integrations, test strategy changes) → update the corresponding `docs/adr/*.md` file, following `./references/ARCHITECTURE-RULES.md` (for `ARCHITECTURE.md`), `./references/TESTS-RULES.md` (for `TESTS.md`), or `./references/DOCUMENT-TEMPLATE.md` (for any other existing ADR)
- PROHIBITED: Creating a new ADR file during this step unless explicitly requested/decided by a human
- REQUIRED: Update each target project's `docs/.digest.md` and `docs/.graph.json` after topic documentation
- PROHIBITED: Reading or modifying `docs/harness-history/`
E4. Transition:
→ DEPLOY. Delegate to `developer-devops` only when deployment is authorized by current repository/user rules. If Git staging, commit, or push is forbidden or deployment is skipped, record the skip and → HALTED without running those commands.
</orchestration_loop>
<json_extraction_protocol>
When parsing sub-agent output for metrics:
1. Search raw string for Markdown fences containing JSON.
2. IF none found: extract substring from first '{' to last '}'.
3. Parse as JSON.
4. IF parse fails: log error in DECISIONS.md → force RETRY cycle.
</json_extraction_protocol>
| Rule | Constraint |
|---|---|
| No developer emulation | Never touch Python, JS, or write tests |
| No questions | Execute A → B → C without user confirmation |
| Persistence first | Write every status change to disk BEFORE executing sub-agent command |
See EXAMPLES.md for complete templates: BACKLOG.md, DEVELOPMENT-STATE.md and DECISIONS.md
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub romabeckman/harness-kit --plugin harness-kit14 skills in this plugin
/adversarial-qaAutonomous Adversarial QA agent. Reads machine-readable specs and code to execute edge-case and security testing, returning a JSON verdict./dream-evaluatorIndependently evaluate a named Project Dreaming hypothesis against a separate task and submit verified guidance to Project Memory. Invoke explicitly with the owning project and hypothesis ID./harness-evaluatorHarness performance evaluator. Scores recorded execution traces, compares skill chain versions within comparable task contexts, and reports Pareto frontiers and evidence for improvement.Other plugins' skills for the same job