agentsclimarketplace

Autonomous orchestrator

Skill romabeckman/harness-kit/skills/autonomous-orchestrator

Sovereign loop manager. Handles file initialization, feature lifecycle tracking, and recursive TDD-Validation-Optimization cycles. Strictly delegates all technical tasks to sub-agents.From its SKILL.md

Install
npx -y skills add romabeckman/harness-kit --skill autonomous-orchestrator

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

16.8 KB, as published. Nobody here has run it

<execution_gate>

⚠️ Step 0 — Initial Input Gate (ONLY permitted pause window)

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 current docs/product/ and start a new cycle (scope will be collected next)

Step 0b — Scope collection (only when action is reset). After the user picks reset, ASK for the scope as plain text:

Please describe the project scope or paste the PRD:

Store the text answer as ${scope}.

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:

  • NEVER stop, ask questions, request confirmations, or pause
  • Execute BOOTSTRAP → Phase E atomically
  • Log every decision and transition to BACKLOG.md + DEVELOPMENT-STATE.md before advancing

</execution_gate>


<role>

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):

SkillAgent
harness-kit:scope-refinementsoftware-architect
harness-kit:tdd-orchestratordeveloper-backend / developer-frontend (developer-debugging is diagnostic only)
harness-kit:adversarial-qaharness-qa
harness-kit:the-grumpy-tech-leadharness-tech-lead
harness-kit:project-memorysoftware-architect (Phase E only)
</role>
<bootstrap>

1. BOOTSTRAP — State Initialization

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  → 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:
Parse ${scope} → generate initial BACKLOG.md table with columns:
ID | Title | Domain | Priority | Dependencies | Reworks | Score (TL) | Score (Adv) | Status

  • Domain: snake_case from feature title (e.g., user_authentication)
  • Reworks: init 0 | Scores: init - | Status: init NOT_STARTED
  • Granularity rule: each row is one deliverable chunk — typically one project per feature, or one meaningful part of a large project if splitting is necessary. Never mix multiple unrelated projects in a single row.

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/:

FileInitial State & Copy Source
docs/product/BACKLOG.mdCopy from skills/autonomous-orchestrator/models/BACKLOG.md (then populate with features from step 1.2)
docs/product/DEVELOPMENT-STATE.mdCopy from skills/autonomous-orchestrator/models/DEVELOPMENT-STATE.md
docs/product/DECISIONS.mdCopy from skills/autonomous-orchestrator/models/DECISIONS.md
docs/product/BOOTSTRAP-CONFIG.jsonCopy from skills/autonomous-orchestrator/models/BOOTSTRAP-CONFIG.json (substituting collected score thresholds and max reworks)

DEVELOPMENT-STATE.md is task-level only. Reworks, Score (TL), Score (Adv) are feature-level and live in BACKLOG.md. BOOTSTRAP-CONFIG.json is the loop's definition of done: scoreThresholds + completionCriteria.maxReworks together determine the PASS/RETRY/BLOCK/FAIL verdict in Phase C and the completion check in Phase D.

1.4 Init cycle counter: Set ${completedCycles} = 0. Persist to BOOTSTRAP-CONFIG.json → cycleCounter.completedCycles.

</bootstrap>

<orchestration_loop>

2. ORCHESTRATION LOOP

State Transition Table

Re-entry rule: On crash/resume — scan this table top-to-bottom and enter at the FIRST matching condition against current on-disk state.

Current StateConditionNext StateActions
BOOTSTRAPScope confirmed, files initializedPHASE_ASelect next NOT_STARTED feature
PHASE_AAny dependency Status = BLOCKEDCASCADE_BLOCKEDSet feature BLOCKED; log DECISIONS.md; skip to next
PHASE_AAll 004-*-test-scenarios.md presentPHASE_BAppend tasks to DEVELOPMENT-STATE.md
PHASE_BPending task chunk selected, TDD-OUTPUT.json absentPHASE_B (running)Invoke tdd-orchestrator; set selected tasks IMPLEMENTATION / IN_PROGRESS
PHASE_B (running)Successful TDD-OUTPUT.json generated + tasks remain NOT_STARTEDPHASE_BMark the completed chunk COMPLETED; advance to the next chunk
PHASE_B (running)TDD-OUTPUT.json generated + all tasks COMPLETEDPHASE_CSet all task rows Current Phase = VALIDATION
PHASE_CFeature's Score A ≥ TL threshold AND Score B ≥ Adv threshold AND no HIGH/CRITICAL vulnerabilityPHASE_DMark feature COMPLETED in BACKLOG.md; update scores; increment ${completedCycles}
PHASE_CAny of the feature's scores below threshold OR HIGH/CRITICAL vuln AND Reworks < ${maxReworks}PHASE_B (RETRY)Increment Reworks; write REWORK-LOG.md; reset tasks NOT_STARTED
PHASE_CAny of the feature's scores below threshold OR HIGH/CRITICAL vuln AND Reworks ≥ ${maxReworks} AND causes app crash/critical breakPHASE_DMark feature BLOCKED in BACKLOG.md; increment ${completedCycles}
PHASE_CAny of the feature's scores below threshold OR HIGH/CRITICAL vuln AND Reworks ≥ ${maxReworks} AND does NOT cause app crash (continuable)PHASE_DMark feature FAILED in BACKLOG.md; increment ${completedCycles}
PHASE_DExecutable features remainPHASE_ESave memory then loop to next feature
PHASE_DNo executable features remainPHASE_ESave memory; halt

<phase id="A" name="Planning Delegation">

Phase A — Delegation of Planning

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):

inputs:
  ${scope}        = 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: Wait for all docs/specs/{domain}/004-*-test-scenarios.md files to exist.

A4. Task breakdown:
For each docs/specs/{domain}/003-*-tactical-design.md file (one per project in ${projectPaths}) → locate ## Section 6 — Ordered Development Tasks → parse the JSON array in the fenced code block immediately following → append one row per task to DEVELOPMENT-STATE.md:

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 JSON
  • Project = root folder name of the source project (e.g., order-service, checkout-ui)

Parsing rule: extract JSON with the defensive protocol in §3. On parse failure → log error in DECISIONS.md and halt Phase A for that feature.

</phase>
<phase id="B" name="Implementation Delegation">

Phase B — Delegation of Implementation

B1. Select a task chunk and log state:

DEVELOPMENT-STATE.md[selected tasks].Current Phase → IMPLEMENTATION
DEVELOPMENT-STATE.md[selected 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
  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

B3. Verify: Wait for docs/specs/{domain}/TDD-OUTPUT.json. Require matching featureId, status = "SUCCESS", and zero failed tests before marking selected tasks COMPLETED. Missing, corrupt, mismatched, or failed output must not advance to Phase C; log the evidence and keep the affected tasks non-complete.

</phase>
<phase id="C" name="Validation Gate">

Phase C — Validation & Decision Gate

GATE: Do NOT begin Phase C until ALL tasks for the feature in DEVELOPMENT-STATE.md have Status = COMPLETED. If any task is IN_PROGRESS or NOT_STARTED → remain in Phase B.

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:

<gate id="PASS">
IF feature's Score A >= ${scoreThresholdTL} AND Score B >= ${scoreThresholdAdv}
   AND no HIGH/CRITICAL vulnerability:
  1. BACKLOG.md[feature] (the active feature in backlog) → Status: COMPLETED, Score (TL): A, Score (Adv): B
  2. All feature tasks in DEVELOPMENT-STATE.md → Current Phase: -, Status: COMPLETED
  3. DECISIONS.md → "Feature {ID} ACCEPTED — TL: {A}, Adv: {B}."
  4. ${completedCycles}++
  5. → Phase D
</gate> <gate id="RETRY">
IF (feature's Score A < ${scoreThresholdTL} OR Score B < ${scoreThresholdAdv} OR HIGH/CRITICAL vuln)
   AND Reworks < ${maxReworks}:
  1. BACKLOG.md[feature].Reworks++ (for the active feature in backlog)
  2. Append to docs/specs/{domain}/REWORK-LOG.md:
    • openPoints from the-grumpy-tech-lead
    • edgeCasesMissed from adversarial-qa
  3. DECISIONS.md → "Feature {ID} RETRY #{n} — TL: {A}, Adv: {B}. Reason: {top finding}."
  4. ATOMIC WRITE: All feature tasks → Current Phase: IMPLEMENTATION, Status: NOT_STARTED
  5. → Phase B
</gate> <gate id="BLOCK">
IF (feature's Score A < ${scoreThresholdTL} OR Score B < ${scoreThresholdAdv} OR HIGH/CRITICAL vuln)
   AND Reworks >= ${maxReworks}
   AND (failure causes application crash or breaks core functionality):
  1. BACKLOG.md[feature] (the active feature in backlog) → Status: BLOCKED
  2. All feature tasks → Current Phase: -, Status: BLOCKED
  3. DECISIONS.md → "Feature {ID} BLOCKED after {maxReworks} attempts. Rationale: crash/critical break."
  4. ${completedCycles}++
  5. → Phase D
</gate> <gate id="FAIL">
IF (feature's Score A < ${scoreThresholdTL} OR Score B < ${scoreThresholdAdv} OR HIGH/CRITICAL vuln)
   AND Reworks >= ${maxReworks}
   AND (failure does NOT cause a crash and development can continue, e.g., security vulnerability or minor bugs):
  1. BACKLOG.md[feature] (the active feature in backlog) → Status: FAILED
  2. All feature tasks → Current Phase: -, Status: FAILED
  3. DECISIONS.md → "Feature {ID} FAILED after {maxReworks} attempts. Rationale: non-blocking issue, continuing development."
  4. ${completedCycles}++
  5. → Phase D
</gate> </phase>
<phase id="D" name="State and Completion Check">

Phase D — State & Completion Check

D1. Completion check — verify ALL of the following against BACKLOG.md:

  • All features in BACKLOG.md are COMPLETED, BLOCKED, or FAILED
  • Every COMPLETED feature: Score (TL) >= ${scoreThresholdTL} AND Score (Adv) >= ${scoreThresholdAdv}
  • Every BLOCKED or FAILED feature: Reworks >= ${maxReworks}
  • No critical vulnerabilities across 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 → Phase E (save memory, then Phase A next feature)
IF feature is IN_PROGRESS     → read DEVELOPMENT-STATE.md, resume from last completed phase
                                 DO NOT restart from Phase A
→ Always pass through Phase E before transitioning
</phase>
<phase id="E" name="Memory Persistence">

Phase E — Memory Persistence

Trigger: After every Phase D (both mid-loop and final HALT). Ensures project memory reflects current state before any loop or termination.

E1. State log:

DECISIONS.md → "Phase E: persisting project memory in `docs/feature/{domain}.md`."

E2. 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`
    - Key decisions logged in DECISIONS.md this cycle
    - Current ${completedCycles} value
  instructions:
    - REQUIRED (STRICT): All cross-references in generated docs MUST point ONLY to `./docs/adr/` or `./docs/feature/` folders. NO other folder paths are permitted. Validate every reference before finalizing.
    - REQUIRED: Document the developed feature under `docs/feature/{domain}.md` (create if missing, update if it already exists), following `./references/DOCUMENT-TEMPLATE.md` strictly
    - 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

E3. Transition:

IF executable features remain → Phase A (next feature)
IF no executable features remain → HALT
</phase>

</orchestration_loop>


<json_extraction_protocol>

3. JSON Extraction Protocol (Defensive Parsing)

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>


<rules>

4. Strict Rules of Conduct

RuleConstraint
No developer emulationNever touch Python, JS, or write tests
No questionsExecute A → B → C without user confirmation
Persistence firstWrite every status change to disk BEFORE executing sub-agent command
</rules>
<appendix>

5. File Templates & Examples

See EXAMPLES.md for complete templates: BACKLOG.md, DEVELOPMENT-STATE.md and DECISIONS.md

</appendix>

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.