@harness-engineering/cli 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/skills/claude-code/harness-autopilot/SKILL.md +31 -0
- package/dist/agents/skills/claude-code/harness-catalog-retrospective/SKILL.md +124 -0
- package/dist/agents/skills/claude-code/harness-catalog-retrospective/skill.yaml +48 -0
- package/dist/agents/skills/claude-code/harness-execution/SKILL.md +13 -0
- package/dist/agents/skills/claude-code/harness-parallel-agents/SKILL.md +3 -0
- package/dist/agents/skills/claude-code/harness-planning/SKILL.md +3 -1
- package/dist/agents/skills/codex/harness-autopilot/SKILL.md +31 -0
- package/dist/agents/skills/codex/harness-catalog-retrospective/SKILL.md +124 -0
- package/dist/agents/skills/codex/harness-catalog-retrospective/skill.yaml +48 -0
- package/dist/agents/skills/codex/harness-execution/SKILL.md +13 -0
- package/dist/agents/skills/codex/harness-parallel-agents/SKILL.md +3 -0
- package/dist/agents/skills/codex/harness-planning/SKILL.md +3 -1
- package/dist/agents/skills/cursor/harness-autopilot/SKILL.md +31 -0
- package/dist/agents/skills/cursor/harness-catalog-retrospective/SKILL.md +124 -0
- package/dist/agents/skills/cursor/harness-catalog-retrospective/skill.yaml +48 -0
- package/dist/agents/skills/cursor/harness-execution/SKILL.md +13 -0
- package/dist/agents/skills/cursor/harness-parallel-agents/SKILL.md +3 -0
- package/dist/agents/skills/cursor/harness-planning/SKILL.md +3 -1
- package/dist/agents/skills/gemini-cli/harness-autopilot/SKILL.md +31 -0
- package/dist/agents/skills/gemini-cli/harness-catalog-retrospective/SKILL.md +124 -0
- package/dist/agents/skills/gemini-cli/harness-catalog-retrospective/skill.yaml +48 -0
- package/dist/agents/skills/gemini-cli/harness-execution/SKILL.md +13 -0
- package/dist/agents/skills/gemini-cli/harness-parallel-agents/SKILL.md +3 -0
- package/dist/agents/skills/gemini-cli/harness-planning/SKILL.md +3 -1
- package/dist/{agents-md-7L4PKKOM.js → agents-md-BK2UPKUC.js} +4 -4
- package/dist/{analyzer-XRCV63KC-HLTEIKAJ.js → analyzer-XRCV63KC-6T2Z32XC.js} +2 -2
- package/dist/{architecture-RCHFDI7E.js → architecture-7PNQZOWV.js} +5 -5
- package/dist/{assess-project-YUDPNRS6.js → assess-project-2QPCNN7N.js} +1 -1
- package/dist/bin/harness-mcp.js +15 -15
- package/dist/bin/harness.js +26 -26
- package/dist/{check-phase-gate-56GS3A72.js → check-phase-gate-RZUSDB3O.js} +5 -5
- package/dist/{chunk-UACYZCW4.js → chunk-33OU3LYX.js} +351 -4
- package/dist/{chunk-Y5HPJMTM.js → chunk-6STDKKAM.js} +2 -2
- package/dist/{chunk-GLHLXTKC.js → chunk-BJDT3VGQ.js} +6 -6
- package/dist/{chunk-YXOPQEFZ.js → chunk-D5YCPIK6.js} +2 -2
- package/dist/{chunk-Y33P35U3.js → chunk-DBCC7KIW.js} +5 -5
- package/dist/{chunk-XZNCONFG.js → chunk-DVG6DDX6.js} +1 -1
- package/dist/{chunk-GSYBGOY3.js → chunk-DW6HE5DH.js} +2 -2
- package/dist/{chunk-RY2U77OY.js → chunk-E5KJOUHI.js} +7 -7
- package/dist/{chunk-RZQZXWEL.js → chunk-HU7NS7JA.js} +6 -6
- package/dist/{chunk-AU4YPEIE.js → chunk-HUC73DZC.js} +3 -3
- package/dist/{chunk-ZU6T7W3U.js → chunk-J5MFNKE7.js} +2 -2
- package/dist/{chunk-4SKWGVYD.js → chunk-J7H5I4FO.js} +2 -2
- package/dist/{chunk-Z4XWWNYX.js → chunk-K5R2I37T.js} +203 -92
- package/dist/{chunk-YWRPQZL7.js → chunk-KHL6WFRL.js} +2 -2
- package/dist/{chunk-DGVT4DBI.js → chunk-KYFXXEK3.js} +3 -3
- package/dist/{chunk-NCMJXBEO.js → chunk-MHHISNS2.js} +2 -2
- package/dist/{chunk-ABRYIEWJ.js → chunk-RRCS27GT.js} +847 -800
- package/dist/{chunk-YJYUJSWK.js → chunk-RZTLXZHJ.js} +1 -1
- package/dist/{chunk-P4NA5OQX.js → chunk-SI4O2W4H.js} +2 -2
- package/dist/{chunk-BDGTZRZ6.js → chunk-UEXQMI6K.js} +56 -44
- package/dist/{chunk-XW5XVVMI.js → chunk-V2GJE5J5.js} +3 -3
- package/dist/{chunk-VG4G3R2V.js → chunk-VC2B275U.js} +2 -2
- package/dist/{chunk-OZSKLJQW.js → chunk-XACP5P2J.js} +2 -2
- package/dist/{chunk-IGWJRAJT.js → chunk-YTJIRQON.js} +2 -2
- package/dist/{chunk-N4AI2WFH.js → chunk-ZIJABBGZ.js} +2 -2
- package/dist/{ci-workflow-TFAA5BK7.js → ci-workflow-LGN7LHHO.js} +4 -4
- package/dist/{dist-ICW4QUEW.js → dist-FBBADRYS.js} +3 -1
- package/dist/{dist-MCTEX5QH.js → dist-LE5AU7FR.js} +17 -3
- package/dist/{docs-BBMAN3CY.js → docs-3BTPSHKE.js} +5 -5
- package/dist/{engine-R2YH74AL.js → engine-GWGU4AMH.js} +4 -4
- package/dist/{entropy-5UP5N6AF.js → entropy-35XURODP.js} +5 -5
- package/dist/{feedback-6MDCCFZL.js → feedback-NDGZZ37W.js} +1 -1
- package/dist/{generate-agent-definitions-KKAN5DB5.js → generate-agent-definitions-PYZ3E7SP.js} +5 -5
- package/dist/index.js +25 -25
- package/dist/{loader-2WT2ZE2T.js → loader-QK2OJXKB.js} +4 -4
- package/dist/{mcp-5V4LPMB3.js → mcp-Z5YMV7TA.js} +15 -15
- package/dist/{performance-2N3CFXLR.js → performance-VAYOYPVK.js} +5 -5
- package/dist/{review-pipeline-XZIGBU3Q.js → review-pipeline-UETEOWSS.js} +4 -4
- package/dist/{runtime-POME3GTR.js → runtime-J7KFACTK.js} +4 -4
- package/dist/{security-QLJLMSIW.js → security-6AIUZXF5.js} +1 -1
- package/dist/{state-events-YY5KBZTC.js → state-events-XQPHGLG5.js} +4 -4
- package/dist/{validate-VZORVK43.js → validate-ON7YMVLY.js} +5 -5
- package/dist/{validate-cross-check-OYKEDCST.js → validate-cross-check-HKKQA7K5.js} +4 -4
- package/package.json +8 -8
|
@@ -108,6 +108,37 @@ On return: read `planPath` from `{sessionDir}/handoff.json`. Complexity override
|
|
|
108
108
|
|
|
109
109
|
### EXECUTE
|
|
110
110
|
|
|
111
|
+
**Pre-dispatch: plan parallelization (standard automatic parallelism).** Before dispatching tasks, decide the safe parallel structure. This is orchestration, not reimplementation — autopilot chooses HOW to dispatch; the persona agents still do the work.
|
|
112
|
+
|
|
113
|
+
1. Collect the phase's tasks with their `files` and `dependsOn` (from the plan's task headers). Call the `plan_parallelization` MCP tool:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"path": "<project-root>",
|
|
118
|
+
"tasks": [{ "id": "task-1", "files": ["..."], "dependsOn": [] }],
|
|
119
|
+
"depth": 1
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
It returns a `ParallelizationPlan`: `waves[]` (each `{ tasks, severity, firing, analysisLevel }`), `serialized[]`, `cyclic[]`, `narration`.
|
|
124
|
+
|
|
125
|
+
2. **If `cyclic` is non-empty:** STOP. Surface the cycle and route back to PLAN/APPROVE_PLAN (a dependency cycle is a plan defect). Do not dispatch.
|
|
126
|
+
|
|
127
|
+
3. **Announce (announce-and-proceed):** emit `narration` verbatim. Do NOT pause here — announcing is not a gate.
|
|
128
|
+
|
|
129
|
+
4. **Dispatch in dependency order — prerequisites first, then waves in array order:**
|
|
130
|
+
- First, run every task in `serialized` (high-severity-group / cycle-adjacent members) **serially**, one `harness-task-executor` per task, in listed order. These are cross-bucket prerequisites: they MUST complete before any wave that depends on them.
|
|
131
|
+
- Then process `waves` **in array order**. The `waves` array is already topologically sorted (earlier waves are prerequisites of later ones). Do NOT reorder waves and do NOT key dispatch off the `firing` field alone — the Phase-2 cross-bucket cap (a wave depending on a serialized/cyclic task is downgraded to `confirm` and marked "cross-bucket prerequisite gates this wave" in `narration`) is only sound if serialized/cyclic ran first and waves run in order.
|
|
132
|
+
|
|
133
|
+
5. **For each wave, honor its `firing`:**
|
|
134
|
+
- `auto-dispatch` (multi-task): emit that wave's line from `narration`, then dispatch the wave via the **harness-parallel-agents** skill with **worktree-per-unit isolation** per `docs/guides/agent-worktree-patterns.md` ("Worktree-per-Milestone" / "Parallel Agent Work": one worktree per task, sequential commits, squash-merge at integrate). **Announce and proceed — do NOT stop for confirmation.**
|
|
135
|
+
- `confirm`: surface the wave and its `narration` line, then take exactly ONE plain-text confirmation — "Dispatch wave [{tasks}] in parallel? (yes / serial)". `yes` → dispatch via harness-parallel-agents (worktree-per-unit). `serial` or decline → run the wave's tasks serially (`harness-task-executor` each). Record the choice in `decisions[]`.
|
|
136
|
+
- `serialize`, or any single-task wave: run serially via `harness-task-executor`, exactly as today.
|
|
137
|
+
|
|
138
|
+
6. **Serial fallback is preserved** when a phase has fewer than `minWaveSize` (default 3) independent tasks, when a `confirm` is declined, or when no graph is available and the human does not confirm — honoring the standing "when in doubt, run serially" default.
|
|
139
|
+
|
|
140
|
+
Each dispatched unit (parallel wave or serial task) then follows the existing per-task contract below (state.json per task, checkpoints, retry budget).
|
|
141
|
+
|
|
111
142
|
Dispatch harness-task-executor:
|
|
112
143
|
|
|
113
144
|
```
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Harness Catalog Retrospective
|
|
2
|
+
|
|
3
|
+
> Monthly retrospective over skill-adoption telemetry. Reads `.harness/metrics/adoption.jsonl`, ranks the most-invoked, most-failing, and abandoned-mid-workflow skills, flags ever-invoked skills that have gone quiet, and reports how much of the catalog emits any telemetry at all. Produces a dated Markdown report and surfaces the highlights that warrant follow-up. Compounding-via-learning at the catalog grain.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- On a regular cadence (monthly is the intended grain) to review how the skill catalog is actually being used.
|
|
8
|
+
- After a milestone, to see which skills carried the work and which never fired.
|
|
9
|
+
- When deciding what to prune, fix, or promote in the catalog — the report feeds catalog-rationalization work.
|
|
10
|
+
- NOT as a real-time dashboard — for point-in-time lookups use `harness adoption skills` / `harness adoption recent`.
|
|
11
|
+
- NOT when `.harness/metrics/adoption.jsonl` is absent or empty (the report will be honest but empty; there is nothing to retrospect on yet).
|
|
12
|
+
|
|
13
|
+
## Process
|
|
14
|
+
|
|
15
|
+
### Iron Law
|
|
16
|
+
|
|
17
|
+
**Separate real signal from telemetry gaps before you recommend anything.** The single most common misread of this data is treating "no telemetry" as "abandoned." Adoption records are emitted only from instrumented entry points, so a skill with zero records is usually uninstrumented, not unused. The report's coverage line and the stale-skills section exist to keep that distinction visible — never collapse it.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
### Phase 1: SCAN — Derive the Report
|
|
22
|
+
|
|
23
|
+
1. Run the retrospective command from the project root:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
harness adoption retrospective # writes docs/retrospectives/<date>.md
|
|
27
|
+
harness adoption retrospective --no-write # print to stdout without writing a file
|
|
28
|
+
harness adoption retrospective --json # structured output for further processing
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Optional flags: `--inactive-days <n>` (stale threshold, default 90), `--top <n>` (rows per section, default 10), `--out <path>` (override the output file).
|
|
32
|
+
|
|
33
|
+
2. The command reads `.harness/metrics/adoption.jsonl` via `readAdoptionRecords`, derives the report via `getCatalogRetrospectiveReport`, and renders it via `renderRetrospectiveMarkdown` (all in `@harness-engineering/core`). Coverage context is computed against the skills discovered under `agents/skills/claude-code/`; when that directory is absent (a consumer project), the coverage line is omitted rather than reporting a false zero.
|
|
34
|
+
|
|
35
|
+
3. If there are no records, say so plainly and stop: "No adoption telemetry found at `.harness/metrics/adoption.jsonl`. Nothing to retrospect on yet."
|
|
36
|
+
|
|
37
|
+
### Phase 2: INTERPRET — Signal vs. Noise
|
|
38
|
+
|
|
39
|
+
Read the report with these discriminations:
|
|
40
|
+
|
|
41
|
+
- **Coverage line first.** "N/total catalog skills have emitted telemetry" frames everything below it. A low ratio means the rankings describe the _instrumented_ slice, not the whole catalog. State the ratio explicitly in your summary.
|
|
42
|
+
- **Failing skills are not automatically broken.** Some commands fail _by design_ (a gate like `ci.check` returning non-zero on a real violation is the gate working). Before flagging a high failure rate as a problem, note whether the skill is a checker/gate whose failures are expected. Call out only failures that look like defects (crashes, unexpected non-zero on clean input).
|
|
43
|
+
- **Abandoned mid-workflow** uses the broadened definition: an explicit `abandoned` outcome, or a non-completed run that had already reached ≥1 phase. Small counts here are meaningful — a workflow skill people start and bail out of mid-way is a UX signal even at n=1.
|
|
44
|
+
- **Stale skills** are drawn only from _ever-invoked_ skills quiet ≥ the threshold. When the record window is shorter than the threshold, the section says so and reports nothing — do not present that emptiness as "everything is healthy."
|
|
45
|
+
|
|
46
|
+
### Phase 3: REPORT — Surface and Recommend
|
|
47
|
+
|
|
48
|
+
1. Confirm where the report was written (`docs/retrospectives/<date>.md`) or present the rendered Markdown.
|
|
49
|
+
2. Summarize the 3–5 findings that actually warrant action, each tied to a section and a number. Prefer specifics ("`cli/review-ci` failed 23/23 — likely a real defect, worth a look") over restating the tables.
|
|
50
|
+
3. When the coverage ratio is the dominant finding (e.g. most of the catalog is uninstrumented), name that as the top follow-up: instrumentation, not pruning, is the lever.
|
|
51
|
+
4. Do not delete, prune, or edit skills from this skill — it reports. Hand any pruning decision to the human or to catalog-rationalization work.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Harness Integration
|
|
56
|
+
|
|
57
|
+
- **`harness adoption retrospective`** — the CLI entry point (a subcommand of the existing `adoption` command group). Writes `docs/retrospectives/<date>.md` by default.
|
|
58
|
+
- **`getCatalogRetrospectiveReport` / `renderRetrospectiveMarkdown` / `isAbandonedMidWorkflow`** — the pure aggregation + render functions in `@harness-engineering/core` (`packages/core/src/adoption/retrospective.ts`). Callers can supply a fixed `now` and `catalogSkills` for deterministic output.
|
|
59
|
+
- **`readAdoptionRecords`** — reads and parses `.harness/metrics/adoption.jsonl` (read-only; the file is appended by the adoption-tracker hook, never by this skill).
|
|
60
|
+
- **`harness adoption skills` / `recent` / `skill <name>`** — the point-in-time siblings; this skill is the periodic, persisted counterpart.
|
|
61
|
+
|
|
62
|
+
## Success Criteria
|
|
63
|
+
|
|
64
|
+
1. The retrospective is derived from `.harness/metrics/adoption.jsonl` without mutating it.
|
|
65
|
+
2. The report ranks top-invoked, top-failing, and abandoned-mid-workflow skills, and flags ever-invoked stale skills.
|
|
66
|
+
3. The report states telemetry coverage (how much of the catalog emits any signal) when the catalog is discoverable.
|
|
67
|
+
4. The stale-skills section notes when the record window is shorter than the inactivity threshold instead of silently reporting zero.
|
|
68
|
+
5. The summary separates real signal (defect-shaped failures, mid-workflow abandonment) from telemetry gaps (uninstrumented skills) and from expected gate failures.
|
|
69
|
+
6. A dated report is written to `docs/retrospectives/<date>.md` (unless `--no-write`/`--json` is requested).
|
|
70
|
+
7. The skill recommends but never prunes, edits, or deletes catalog skills.
|
|
71
|
+
|
|
72
|
+
## Rationalizations to Reject
|
|
73
|
+
|
|
74
|
+
| Rationalization | Reality |
|
|
75
|
+
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
76
|
+
| "756 skills have no telemetry, so 756 skills are abandoned — recommend deleting them." | Zero telemetry almost always means _uninstrumented_, not unused. The coverage line exists to prevent exactly this misread; the fix is instrumentation, not pruning. |
|
|
77
|
+
| "`ci.check` fails 97% of the time — it's broken." | A gate returning non-zero on a real violation is the gate working. Check whether the skill is a checker before flagging its failures as defects. |
|
|
78
|
+
| "The stale section is empty, so the catalog is healthy." | If the record window is shorter than the threshold, the signal simply cannot fire yet. Empty ≠ healthy; report the window caveat. |
|
|
79
|
+
| "n=1 abandonment is noise, ignore it." | A workflow skill users start and bail out of mid-way is a UX signal even at low n. Surface it; let the human weigh it. |
|
|
80
|
+
| "I'll prune the low-usage skills while I'm here." | This skill reports; it does not prune. Pruning is a human/catalog-rationalization decision. |
|
|
81
|
+
|
|
82
|
+
## Examples
|
|
83
|
+
|
|
84
|
+
### Example: Monthly retrospective on the dogfood repo
|
|
85
|
+
|
|
86
|
+
**Context:** ~67 days of telemetry (3.2k records) across 50 invoked skills, run at month end.
|
|
87
|
+
|
|
88
|
+
**Phase 1 — SCAN:**
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
harness adoption retrospective
|
|
92
|
+
# → Catalog retrospective written to docs/retrospectives/2026-07-06.md
|
|
93
|
+
# 3246 records · 50 skills · window 67d
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Phase 2 — INTERPRET:** The report's overview leads with `Telemetry coverage: 5/761 catalog skills have emitted telemetry (756 never invoked)`. Top-invoked is dominated by `cli/*` commands; `cli/ci.check` shows a 97% failure rate; the abandoned-mid-workflow section lists four workflow skills at n=1; the stale section is empty with the note that the 67-day window is shorter than the 90-day threshold.
|
|
97
|
+
|
|
98
|
+
**Phase 3 — REPORT:**
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
Retrospective written to docs/retrospectives/2026-07-06.md. Findings that warrant action:
|
|
102
|
+
|
|
103
|
+
1. Coverage is the headline: only 5/761 catalog skills emit any telemetry. The rankings
|
|
104
|
+
describe the instrumented slice, not the catalog. Top follow-up is instrumentation, not pruning.
|
|
105
|
+
2. `cli/ci.check` failed 97% (721/741) — but it is a gate; non-zero on a real violation is
|
|
106
|
+
expected. Not flagged as a defect.
|
|
107
|
+
3. `cli/review-ci` failed 23/23 (100%) — defect-shaped, worth a look. Routed to debugging.
|
|
108
|
+
4. Four workflow skills were abandoned mid-run (n=1 each) — low volume, a UX signal to watch.
|
|
109
|
+
5. Stale skills: none — the 67-day window can't satisfy the 90-day threshold yet.
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
No skills were pruned or edited — the pruning decision is left to the human.
|
|
113
|
+
|
|
114
|
+
## Gates
|
|
115
|
+
|
|
116
|
+
- **No mutation of `adoption.jsonl`.** The telemetry file is read-only input.
|
|
117
|
+
- **No catalog edits.** This skill never adds, edits, or deletes skills — it only reports on them.
|
|
118
|
+
- **Coverage must be stated when discoverable.** If the catalog can be scanned, the summary must include the telemetry-coverage ratio so rankings are read in context.
|
|
119
|
+
|
|
120
|
+
## Escalation
|
|
121
|
+
|
|
122
|
+
- **When there are no records:** State that telemetry is absent/empty and stop. Suggest confirming the adoption-tracker hook is installed if telemetry is unexpectedly missing.
|
|
123
|
+
- **When coverage is very low:** Name instrumentation as the top follow-up and note that the rankings describe only the instrumented slice.
|
|
124
|
+
- **When a failing skill looks like a real defect:** Flag it specifically (skill, failure count/rate, why it looks defect-shaped) and route it to debugging or an issue, rather than burying it in the table.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: harness-catalog-retrospective
|
|
2
|
+
version: '1.0.0'
|
|
3
|
+
description: Monthly retrospective over skill-adoption telemetry — ranks most-invoked, failing, and abandoned-mid-workflow skills, flags stale ones, and reports catalog telemetry coverage
|
|
4
|
+
stability: static
|
|
5
|
+
cognitive_mode: analytical-reporter
|
|
6
|
+
triggers:
|
|
7
|
+
- manual
|
|
8
|
+
- on_milestone
|
|
9
|
+
platforms:
|
|
10
|
+
- claude-code
|
|
11
|
+
- gemini-cli
|
|
12
|
+
- cursor
|
|
13
|
+
- codex
|
|
14
|
+
tools:
|
|
15
|
+
- Bash
|
|
16
|
+
- Read
|
|
17
|
+
- Glob
|
|
18
|
+
- Grep
|
|
19
|
+
cli:
|
|
20
|
+
command: harness skill run harness-catalog-retrospective
|
|
21
|
+
args:
|
|
22
|
+
- name: path
|
|
23
|
+
description: Project root path
|
|
24
|
+
required: false
|
|
25
|
+
- name: inactive-days
|
|
26
|
+
description: 'Inactivity threshold in days for the stale-skills section (default: 90)'
|
|
27
|
+
required: false
|
|
28
|
+
mcp:
|
|
29
|
+
tool: run_skill
|
|
30
|
+
input:
|
|
31
|
+
skill: harness-catalog-retrospective
|
|
32
|
+
path: string
|
|
33
|
+
type: rigid
|
|
34
|
+
tier: 2
|
|
35
|
+
phases:
|
|
36
|
+
- name: scan
|
|
37
|
+
description: Read adoption telemetry and derive the retrospective report
|
|
38
|
+
required: true
|
|
39
|
+
- name: interpret
|
|
40
|
+
description: Read the rankings and coverage, separating real signal from telemetry gaps
|
|
41
|
+
required: true
|
|
42
|
+
- name: report
|
|
43
|
+
description: Write the dated report and surface highlights plus recommendations
|
|
44
|
+
required: true
|
|
45
|
+
state:
|
|
46
|
+
persistent: false
|
|
47
|
+
files: []
|
|
48
|
+
depends_on: []
|
|
@@ -131,6 +131,19 @@ RMH005 (`harness validate`).
|
|
|
131
131
|
|
|
132
132
|
- If no roadmap row matches this plan (e.g. ad-hoc execution), skip the claim.
|
|
133
133
|
|
|
134
|
+
#### Step 0.5: Plan parallelization (standard automatic parallelism)
|
|
135
|
+
|
|
136
|
+
Before the per-task loop, decide the safe parallel structure so independent tasks dispatch concurrently by default (no human typing "in parallel").
|
|
137
|
+
|
|
138
|
+
1. Collect this run's tasks with their `files` and `dependsOn` (from the plan's task headers) and call the `plan_parallelization` MCP tool (`{ path, tasks, depth: 1 }`). It returns `ParallelizationPlan` (`waves[]`, `serialized[]`, `cyclic[]`, `narration`).
|
|
139
|
+
2. If `cyclic` is non-empty, STOP and escalate (dependency cycle = plan defect). Do not execute.
|
|
140
|
+
3. Emit `narration` (announce-and-proceed — do not pause).
|
|
141
|
+
4. Run `serialized` tasks first (serially, in order — cross-bucket prerequisites), then process `waves` **in array order** (topologically sorted; do not reorder, do not key off `firing` alone).
|
|
142
|
+
5. Per wave: `auto-dispatch` (multi-task) → dispatch the wave via **harness-parallel-agents** with worktree-per-unit isolation (`docs/guides/agent-worktree-patterns.md`), announce and proceed; `confirm` → one plain-text confirmation, then parallel or serial per the answer; `serialize` / single-task → run through the per-task loop below serially.
|
|
143
|
+
6. **Serial fallback preserved:** when independent tasks < `minWaveSize` (default 3), a `confirm` is declined, or no graph is available and the human does not confirm, run every task through the per-task loop below serially — the standing "when in doubt, run serially" default.
|
|
144
|
+
|
|
145
|
+
Tasks dispatched into a parallel wave are executed by harness-parallel-agents' focused agents; tasks that fall to serial run through the loop below unchanged.
|
|
146
|
+
|
|
134
147
|
For each task, starting from current position:
|
|
135
148
|
|
|
136
149
|
1. **Read task instructions completely** before writing any code.
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
> Dispatch independent tasks to concurrent agents, integrate results, and verify no conflicts. Only for truly independent problems.
|
|
4
4
|
|
|
5
|
+
**Invoked automatically by `harness-autopilot` (and standalone `harness-execution`), not only manually.** When a plan's phase has an auto-dispatch wave, the execution loop calls this skill to run that wave. In that mode the caller supplies worktree-per-unit isolation per `docs/guides/agent-worktree-patterns.md` (one worktree per task, sequential commits, squash-merge on integrate) and has already verified independence via `plan_parallelization`; this skill still owns the focused agent briefs (Step 2), concurrent dispatch (Step 3), and integration/verification (Steps 4–5). Manual invocation (a human asking to "work in parallel") continues to work unchanged.
|
|
6
|
+
|
|
5
7
|
## When to Use
|
|
6
8
|
|
|
7
9
|
- When 3 or more tasks are truly independent (no shared state, no shared files, different subsystems)
|
|
8
10
|
- When tasks involve investigation or implementation in separate parts of the codebase
|
|
9
11
|
- When parallel execution would meaningfully reduce wall-clock time
|
|
10
12
|
- When a plan has tasks explicitly marked as parallelizable
|
|
13
|
+
- When `harness-autopilot`/`harness-execution` reaches an `auto-dispatch` (or confirmed) wave from `plan_parallelization` — this skill is the wave's dispatcher
|
|
11
14
|
- NOT when failures across tasks might be related (investigate serially to find the common cause)
|
|
12
15
|
- NOT when tasks need full system understanding to complete correctly
|
|
13
16
|
- NOT when agents would modify the same files or shared state
|
|
@@ -256,7 +256,7 @@ Report progress: `**[Phase 2/4]** DECOMPOSE — mapping file structure and creat
|
|
|
256
256
|
### Phase 3: SEQUENCE — Order Tasks and Identify Dependencies
|
|
257
257
|
|
|
258
258
|
1. **Order by dependency.** Types before implementations. Implementations before integrations. Integration tasks (tagged `category: "integration"`) after all implementation tasks. Tests alongside implementations (same task, TDD style).
|
|
259
|
-
2. **Identify parallel opportunities.** Tasks touching different subsystems with no shared state can
|
|
259
|
+
2. **Identify parallel opportunities and record dependency edges.** Tasks touching different subsystems with no shared state can run in parallel. Record each task's real dependencies as `dependsOn` (the task IDs it must follow) in the task header `**Depends on:**` line, and keep the task's `**Files:**` list accurate — together these are exactly the edges `plan_parallelization` consumes (explicit `dependsOn` unioned with file-overlap edges) to build the wave DAG at execution time. A task with no dependencies records `**Depends on:** none`.
|
|
260
260
|
3. **Number tasks sequentially.** Use `Task 1`, `Task 2`, etc. Dependencies reference task numbers.
|
|
261
261
|
4. **Estimate total time.** Sum 2-5 minutes per task. If total exceeds available time, identify a milestone boundary for pausing.
|
|
262
262
|
|
|
@@ -327,6 +327,8 @@ One sentence.
|
|
|
327
327
|
|
|
328
328
|
**Depends on:** none | **Files:** path/to/file.ts, path/to/file.test.ts
|
|
329
329
|
|
|
330
|
+
<!-- `Depends on` lists the task IDs this task must follow (its `dependsOn` edges); `Files` is the independence-checking input. Both feed `plan_parallelization` during execution. -->
|
|
331
|
+
|
|
330
332
|
1. Create test file with exact test code
|
|
331
333
|
2. Run test — observe failure
|
|
332
334
|
3. Create implementation with exact code
|
|
@@ -108,6 +108,37 @@ On return: read `planPath` from `{sessionDir}/handoff.json`. Complexity override
|
|
|
108
108
|
|
|
109
109
|
### EXECUTE
|
|
110
110
|
|
|
111
|
+
**Pre-dispatch: plan parallelization (standard automatic parallelism).** Before dispatching tasks, decide the safe parallel structure. This is orchestration, not reimplementation — autopilot chooses HOW to dispatch; the persona agents still do the work.
|
|
112
|
+
|
|
113
|
+
1. Collect the phase's tasks with their `files` and `dependsOn` (from the plan's task headers). Call the `plan_parallelization` MCP tool:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"path": "<project-root>",
|
|
118
|
+
"tasks": [{ "id": "task-1", "files": ["..."], "dependsOn": [] }],
|
|
119
|
+
"depth": 1
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
It returns a `ParallelizationPlan`: `waves[]` (each `{ tasks, severity, firing, analysisLevel }`), `serialized[]`, `cyclic[]`, `narration`.
|
|
124
|
+
|
|
125
|
+
2. **If `cyclic` is non-empty:** STOP. Surface the cycle and route back to PLAN/APPROVE_PLAN (a dependency cycle is a plan defect). Do not dispatch.
|
|
126
|
+
|
|
127
|
+
3. **Announce (announce-and-proceed):** emit `narration` verbatim. Do NOT pause here — announcing is not a gate.
|
|
128
|
+
|
|
129
|
+
4. **Dispatch in dependency order — prerequisites first, then waves in array order:**
|
|
130
|
+
- First, run every task in `serialized` (high-severity-group / cycle-adjacent members) **serially**, one `harness-task-executor` per task, in listed order. These are cross-bucket prerequisites: they MUST complete before any wave that depends on them.
|
|
131
|
+
- Then process `waves` **in array order**. The `waves` array is already topologically sorted (earlier waves are prerequisites of later ones). Do NOT reorder waves and do NOT key dispatch off the `firing` field alone — the Phase-2 cross-bucket cap (a wave depending on a serialized/cyclic task is downgraded to `confirm` and marked "cross-bucket prerequisite gates this wave" in `narration`) is only sound if serialized/cyclic ran first and waves run in order.
|
|
132
|
+
|
|
133
|
+
5. **For each wave, honor its `firing`:**
|
|
134
|
+
- `auto-dispatch` (multi-task): emit that wave's line from `narration`, then dispatch the wave via the **harness-parallel-agents** skill with **worktree-per-unit isolation** per `docs/guides/agent-worktree-patterns.md` ("Worktree-per-Milestone" / "Parallel Agent Work": one worktree per task, sequential commits, squash-merge at integrate). **Announce and proceed — do NOT stop for confirmation.**
|
|
135
|
+
- `confirm`: surface the wave and its `narration` line, then take exactly ONE plain-text confirmation — "Dispatch wave [{tasks}] in parallel? (yes / serial)". `yes` → dispatch via harness-parallel-agents (worktree-per-unit). `serial` or decline → run the wave's tasks serially (`harness-task-executor` each). Record the choice in `decisions[]`.
|
|
136
|
+
- `serialize`, or any single-task wave: run serially via `harness-task-executor`, exactly as today.
|
|
137
|
+
|
|
138
|
+
6. **Serial fallback is preserved** when a phase has fewer than `minWaveSize` (default 3) independent tasks, when a `confirm` is declined, or when no graph is available and the human does not confirm — honoring the standing "when in doubt, run serially" default.
|
|
139
|
+
|
|
140
|
+
Each dispatched unit (parallel wave or serial task) then follows the existing per-task contract below (state.json per task, checkpoints, retry budget).
|
|
141
|
+
|
|
111
142
|
Dispatch harness-task-executor:
|
|
112
143
|
|
|
113
144
|
```
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Harness Catalog Retrospective
|
|
2
|
+
|
|
3
|
+
> Monthly retrospective over skill-adoption telemetry. Reads `.harness/metrics/adoption.jsonl`, ranks the most-invoked, most-failing, and abandoned-mid-workflow skills, flags ever-invoked skills that have gone quiet, and reports how much of the catalog emits any telemetry at all. Produces a dated Markdown report and surfaces the highlights that warrant follow-up. Compounding-via-learning at the catalog grain.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- On a regular cadence (monthly is the intended grain) to review how the skill catalog is actually being used.
|
|
8
|
+
- After a milestone, to see which skills carried the work and which never fired.
|
|
9
|
+
- When deciding what to prune, fix, or promote in the catalog — the report feeds catalog-rationalization work.
|
|
10
|
+
- NOT as a real-time dashboard — for point-in-time lookups use `harness adoption skills` / `harness adoption recent`.
|
|
11
|
+
- NOT when `.harness/metrics/adoption.jsonl` is absent or empty (the report will be honest but empty; there is nothing to retrospect on yet).
|
|
12
|
+
|
|
13
|
+
## Process
|
|
14
|
+
|
|
15
|
+
### Iron Law
|
|
16
|
+
|
|
17
|
+
**Separate real signal from telemetry gaps before you recommend anything.** The single most common misread of this data is treating "no telemetry" as "abandoned." Adoption records are emitted only from instrumented entry points, so a skill with zero records is usually uninstrumented, not unused. The report's coverage line and the stale-skills section exist to keep that distinction visible — never collapse it.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
### Phase 1: SCAN — Derive the Report
|
|
22
|
+
|
|
23
|
+
1. Run the retrospective command from the project root:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
harness adoption retrospective # writes docs/retrospectives/<date>.md
|
|
27
|
+
harness adoption retrospective --no-write # print to stdout without writing a file
|
|
28
|
+
harness adoption retrospective --json # structured output for further processing
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Optional flags: `--inactive-days <n>` (stale threshold, default 90), `--top <n>` (rows per section, default 10), `--out <path>` (override the output file).
|
|
32
|
+
|
|
33
|
+
2. The command reads `.harness/metrics/adoption.jsonl` via `readAdoptionRecords`, derives the report via `getCatalogRetrospectiveReport`, and renders it via `renderRetrospectiveMarkdown` (all in `@harness-engineering/core`). Coverage context is computed against the skills discovered under `agents/skills/claude-code/`; when that directory is absent (a consumer project), the coverage line is omitted rather than reporting a false zero.
|
|
34
|
+
|
|
35
|
+
3. If there are no records, say so plainly and stop: "No adoption telemetry found at `.harness/metrics/adoption.jsonl`. Nothing to retrospect on yet."
|
|
36
|
+
|
|
37
|
+
### Phase 2: INTERPRET — Signal vs. Noise
|
|
38
|
+
|
|
39
|
+
Read the report with these discriminations:
|
|
40
|
+
|
|
41
|
+
- **Coverage line first.** "N/total catalog skills have emitted telemetry" frames everything below it. A low ratio means the rankings describe the _instrumented_ slice, not the whole catalog. State the ratio explicitly in your summary.
|
|
42
|
+
- **Failing skills are not automatically broken.** Some commands fail _by design_ (a gate like `ci.check` returning non-zero on a real violation is the gate working). Before flagging a high failure rate as a problem, note whether the skill is a checker/gate whose failures are expected. Call out only failures that look like defects (crashes, unexpected non-zero on clean input).
|
|
43
|
+
- **Abandoned mid-workflow** uses the broadened definition: an explicit `abandoned` outcome, or a non-completed run that had already reached ≥1 phase. Small counts here are meaningful — a workflow skill people start and bail out of mid-way is a UX signal even at n=1.
|
|
44
|
+
- **Stale skills** are drawn only from _ever-invoked_ skills quiet ≥ the threshold. When the record window is shorter than the threshold, the section says so and reports nothing — do not present that emptiness as "everything is healthy."
|
|
45
|
+
|
|
46
|
+
### Phase 3: REPORT — Surface and Recommend
|
|
47
|
+
|
|
48
|
+
1. Confirm where the report was written (`docs/retrospectives/<date>.md`) or present the rendered Markdown.
|
|
49
|
+
2. Summarize the 3–5 findings that actually warrant action, each tied to a section and a number. Prefer specifics ("`cli/review-ci` failed 23/23 — likely a real defect, worth a look") over restating the tables.
|
|
50
|
+
3. When the coverage ratio is the dominant finding (e.g. most of the catalog is uninstrumented), name that as the top follow-up: instrumentation, not pruning, is the lever.
|
|
51
|
+
4. Do not delete, prune, or edit skills from this skill — it reports. Hand any pruning decision to the human or to catalog-rationalization work.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Harness Integration
|
|
56
|
+
|
|
57
|
+
- **`harness adoption retrospective`** — the CLI entry point (a subcommand of the existing `adoption` command group). Writes `docs/retrospectives/<date>.md` by default.
|
|
58
|
+
- **`getCatalogRetrospectiveReport` / `renderRetrospectiveMarkdown` / `isAbandonedMidWorkflow`** — the pure aggregation + render functions in `@harness-engineering/core` (`packages/core/src/adoption/retrospective.ts`). Callers can supply a fixed `now` and `catalogSkills` for deterministic output.
|
|
59
|
+
- **`readAdoptionRecords`** — reads and parses `.harness/metrics/adoption.jsonl` (read-only; the file is appended by the adoption-tracker hook, never by this skill).
|
|
60
|
+
- **`harness adoption skills` / `recent` / `skill <name>`** — the point-in-time siblings; this skill is the periodic, persisted counterpart.
|
|
61
|
+
|
|
62
|
+
## Success Criteria
|
|
63
|
+
|
|
64
|
+
1. The retrospective is derived from `.harness/metrics/adoption.jsonl` without mutating it.
|
|
65
|
+
2. The report ranks top-invoked, top-failing, and abandoned-mid-workflow skills, and flags ever-invoked stale skills.
|
|
66
|
+
3. The report states telemetry coverage (how much of the catalog emits any signal) when the catalog is discoverable.
|
|
67
|
+
4. The stale-skills section notes when the record window is shorter than the inactivity threshold instead of silently reporting zero.
|
|
68
|
+
5. The summary separates real signal (defect-shaped failures, mid-workflow abandonment) from telemetry gaps (uninstrumented skills) and from expected gate failures.
|
|
69
|
+
6. A dated report is written to `docs/retrospectives/<date>.md` (unless `--no-write`/`--json` is requested).
|
|
70
|
+
7. The skill recommends but never prunes, edits, or deletes catalog skills.
|
|
71
|
+
|
|
72
|
+
## Rationalizations to Reject
|
|
73
|
+
|
|
74
|
+
| Rationalization | Reality |
|
|
75
|
+
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
76
|
+
| "756 skills have no telemetry, so 756 skills are abandoned — recommend deleting them." | Zero telemetry almost always means _uninstrumented_, not unused. The coverage line exists to prevent exactly this misread; the fix is instrumentation, not pruning. |
|
|
77
|
+
| "`ci.check` fails 97% of the time — it's broken." | A gate returning non-zero on a real violation is the gate working. Check whether the skill is a checker before flagging its failures as defects. |
|
|
78
|
+
| "The stale section is empty, so the catalog is healthy." | If the record window is shorter than the threshold, the signal simply cannot fire yet. Empty ≠ healthy; report the window caveat. |
|
|
79
|
+
| "n=1 abandonment is noise, ignore it." | A workflow skill users start and bail out of mid-way is a UX signal even at low n. Surface it; let the human weigh it. |
|
|
80
|
+
| "I'll prune the low-usage skills while I'm here." | This skill reports; it does not prune. Pruning is a human/catalog-rationalization decision. |
|
|
81
|
+
|
|
82
|
+
## Examples
|
|
83
|
+
|
|
84
|
+
### Example: Monthly retrospective on the dogfood repo
|
|
85
|
+
|
|
86
|
+
**Context:** ~67 days of telemetry (3.2k records) across 50 invoked skills, run at month end.
|
|
87
|
+
|
|
88
|
+
**Phase 1 — SCAN:**
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
harness adoption retrospective
|
|
92
|
+
# → Catalog retrospective written to docs/retrospectives/2026-07-06.md
|
|
93
|
+
# 3246 records · 50 skills · window 67d
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Phase 2 — INTERPRET:** The report's overview leads with `Telemetry coverage: 5/761 catalog skills have emitted telemetry (756 never invoked)`. Top-invoked is dominated by `cli/*` commands; `cli/ci.check` shows a 97% failure rate; the abandoned-mid-workflow section lists four workflow skills at n=1; the stale section is empty with the note that the 67-day window is shorter than the 90-day threshold.
|
|
97
|
+
|
|
98
|
+
**Phase 3 — REPORT:**
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
Retrospective written to docs/retrospectives/2026-07-06.md. Findings that warrant action:
|
|
102
|
+
|
|
103
|
+
1. Coverage is the headline: only 5/761 catalog skills emit any telemetry. The rankings
|
|
104
|
+
describe the instrumented slice, not the catalog. Top follow-up is instrumentation, not pruning.
|
|
105
|
+
2. `cli/ci.check` failed 97% (721/741) — but it is a gate; non-zero on a real violation is
|
|
106
|
+
expected. Not flagged as a defect.
|
|
107
|
+
3. `cli/review-ci` failed 23/23 (100%) — defect-shaped, worth a look. Routed to debugging.
|
|
108
|
+
4. Four workflow skills were abandoned mid-run (n=1 each) — low volume, a UX signal to watch.
|
|
109
|
+
5. Stale skills: none — the 67-day window can't satisfy the 90-day threshold yet.
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
No skills were pruned or edited — the pruning decision is left to the human.
|
|
113
|
+
|
|
114
|
+
## Gates
|
|
115
|
+
|
|
116
|
+
- **No mutation of `adoption.jsonl`.** The telemetry file is read-only input.
|
|
117
|
+
- **No catalog edits.** This skill never adds, edits, or deletes skills — it only reports on them.
|
|
118
|
+
- **Coverage must be stated when discoverable.** If the catalog can be scanned, the summary must include the telemetry-coverage ratio so rankings are read in context.
|
|
119
|
+
|
|
120
|
+
## Escalation
|
|
121
|
+
|
|
122
|
+
- **When there are no records:** State that telemetry is absent/empty and stop. Suggest confirming the adoption-tracker hook is installed if telemetry is unexpectedly missing.
|
|
123
|
+
- **When coverage is very low:** Name instrumentation as the top follow-up and note that the rankings describe only the instrumented slice.
|
|
124
|
+
- **When a failing skill looks like a real defect:** Flag it specifically (skill, failure count/rate, why it looks defect-shaped) and route it to debugging or an issue, rather than burying it in the table.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: harness-catalog-retrospective
|
|
2
|
+
version: '1.0.0'
|
|
3
|
+
description: Monthly retrospective over skill-adoption telemetry — ranks most-invoked, failing, and abandoned-mid-workflow skills, flags stale ones, and reports catalog telemetry coverage
|
|
4
|
+
stability: static
|
|
5
|
+
cognitive_mode: analytical-reporter
|
|
6
|
+
triggers:
|
|
7
|
+
- manual
|
|
8
|
+
- on_milestone
|
|
9
|
+
platforms:
|
|
10
|
+
- claude-code
|
|
11
|
+
- gemini-cli
|
|
12
|
+
- cursor
|
|
13
|
+
- codex
|
|
14
|
+
tools:
|
|
15
|
+
- Bash
|
|
16
|
+
- Read
|
|
17
|
+
- Glob
|
|
18
|
+
- Grep
|
|
19
|
+
cli:
|
|
20
|
+
command: harness skill run harness-catalog-retrospective
|
|
21
|
+
args:
|
|
22
|
+
- name: path
|
|
23
|
+
description: Project root path
|
|
24
|
+
required: false
|
|
25
|
+
- name: inactive-days
|
|
26
|
+
description: 'Inactivity threshold in days for the stale-skills section (default: 90)'
|
|
27
|
+
required: false
|
|
28
|
+
mcp:
|
|
29
|
+
tool: run_skill
|
|
30
|
+
input:
|
|
31
|
+
skill: harness-catalog-retrospective
|
|
32
|
+
path: string
|
|
33
|
+
type: rigid
|
|
34
|
+
tier: 2
|
|
35
|
+
phases:
|
|
36
|
+
- name: scan
|
|
37
|
+
description: Read adoption telemetry and derive the retrospective report
|
|
38
|
+
required: true
|
|
39
|
+
- name: interpret
|
|
40
|
+
description: Read the rankings and coverage, separating real signal from telemetry gaps
|
|
41
|
+
required: true
|
|
42
|
+
- name: report
|
|
43
|
+
description: Write the dated report and surface highlights plus recommendations
|
|
44
|
+
required: true
|
|
45
|
+
state:
|
|
46
|
+
persistent: false
|
|
47
|
+
files: []
|
|
48
|
+
depends_on: []
|
|
@@ -131,6 +131,19 @@ RMH005 (`harness validate`).
|
|
|
131
131
|
|
|
132
132
|
- If no roadmap row matches this plan (e.g. ad-hoc execution), skip the claim.
|
|
133
133
|
|
|
134
|
+
#### Step 0.5: Plan parallelization (standard automatic parallelism)
|
|
135
|
+
|
|
136
|
+
Before the per-task loop, decide the safe parallel structure so independent tasks dispatch concurrently by default (no human typing "in parallel").
|
|
137
|
+
|
|
138
|
+
1. Collect this run's tasks with their `files` and `dependsOn` (from the plan's task headers) and call the `plan_parallelization` MCP tool (`{ path, tasks, depth: 1 }`). It returns `ParallelizationPlan` (`waves[]`, `serialized[]`, `cyclic[]`, `narration`).
|
|
139
|
+
2. If `cyclic` is non-empty, STOP and escalate (dependency cycle = plan defect). Do not execute.
|
|
140
|
+
3. Emit `narration` (announce-and-proceed — do not pause).
|
|
141
|
+
4. Run `serialized` tasks first (serially, in order — cross-bucket prerequisites), then process `waves` **in array order** (topologically sorted; do not reorder, do not key off `firing` alone).
|
|
142
|
+
5. Per wave: `auto-dispatch` (multi-task) → dispatch the wave via **harness-parallel-agents** with worktree-per-unit isolation (`docs/guides/agent-worktree-patterns.md`), announce and proceed; `confirm` → one plain-text confirmation, then parallel or serial per the answer; `serialize` / single-task → run through the per-task loop below serially.
|
|
143
|
+
6. **Serial fallback preserved:** when independent tasks < `minWaveSize` (default 3), a `confirm` is declined, or no graph is available and the human does not confirm, run every task through the per-task loop below serially — the standing "when in doubt, run serially" default.
|
|
144
|
+
|
|
145
|
+
Tasks dispatched into a parallel wave are executed by harness-parallel-agents' focused agents; tasks that fall to serial run through the loop below unchanged.
|
|
146
|
+
|
|
134
147
|
For each task, starting from current position:
|
|
135
148
|
|
|
136
149
|
1. **Read task instructions completely** before writing any code.
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
> Dispatch independent tasks to concurrent agents, integrate results, and verify no conflicts. Only for truly independent problems.
|
|
4
4
|
|
|
5
|
+
**Invoked automatically by `harness-autopilot` (and standalone `harness-execution`), not only manually.** When a plan's phase has an auto-dispatch wave, the execution loop calls this skill to run that wave. In that mode the caller supplies worktree-per-unit isolation per `docs/guides/agent-worktree-patterns.md` (one worktree per task, sequential commits, squash-merge on integrate) and has already verified independence via `plan_parallelization`; this skill still owns the focused agent briefs (Step 2), concurrent dispatch (Step 3), and integration/verification (Steps 4–5). Manual invocation (a human asking to "work in parallel") continues to work unchanged.
|
|
6
|
+
|
|
5
7
|
## When to Use
|
|
6
8
|
|
|
7
9
|
- When 3 or more tasks are truly independent (no shared state, no shared files, different subsystems)
|
|
8
10
|
- When tasks involve investigation or implementation in separate parts of the codebase
|
|
9
11
|
- When parallel execution would meaningfully reduce wall-clock time
|
|
10
12
|
- When a plan has tasks explicitly marked as parallelizable
|
|
13
|
+
- When `harness-autopilot`/`harness-execution` reaches an `auto-dispatch` (or confirmed) wave from `plan_parallelization` — this skill is the wave's dispatcher
|
|
11
14
|
- NOT when failures across tasks might be related (investigate serially to find the common cause)
|
|
12
15
|
- NOT when tasks need full system understanding to complete correctly
|
|
13
16
|
- NOT when agents would modify the same files or shared state
|
|
@@ -256,7 +256,7 @@ Report progress: `**[Phase 2/4]** DECOMPOSE — mapping file structure and creat
|
|
|
256
256
|
### Phase 3: SEQUENCE — Order Tasks and Identify Dependencies
|
|
257
257
|
|
|
258
258
|
1. **Order by dependency.** Types before implementations. Implementations before integrations. Integration tasks (tagged `category: "integration"`) after all implementation tasks. Tests alongside implementations (same task, TDD style).
|
|
259
|
-
2. **Identify parallel opportunities.** Tasks touching different subsystems with no shared state can
|
|
259
|
+
2. **Identify parallel opportunities and record dependency edges.** Tasks touching different subsystems with no shared state can run in parallel. Record each task's real dependencies as `dependsOn` (the task IDs it must follow) in the task header `**Depends on:**` line, and keep the task's `**Files:**` list accurate — together these are exactly the edges `plan_parallelization` consumes (explicit `dependsOn` unioned with file-overlap edges) to build the wave DAG at execution time. A task with no dependencies records `**Depends on:** none`.
|
|
260
260
|
3. **Number tasks sequentially.** Use `Task 1`, `Task 2`, etc. Dependencies reference task numbers.
|
|
261
261
|
4. **Estimate total time.** Sum 2-5 minutes per task. If total exceeds available time, identify a milestone boundary for pausing.
|
|
262
262
|
|
|
@@ -327,6 +327,8 @@ One sentence.
|
|
|
327
327
|
|
|
328
328
|
**Depends on:** none | **Files:** path/to/file.ts, path/to/file.test.ts
|
|
329
329
|
|
|
330
|
+
<!-- `Depends on` lists the task IDs this task must follow (its `dependsOn` edges); `Files` is the independence-checking input. Both feed `plan_parallelization` during execution. -->
|
|
331
|
+
|
|
330
332
|
1. Create test file with exact test code
|
|
331
333
|
2. Run test — observe failure
|
|
332
334
|
3. Create implementation with exact code
|
|
@@ -108,6 +108,37 @@ On return: read `planPath` from `{sessionDir}/handoff.json`. Complexity override
|
|
|
108
108
|
|
|
109
109
|
### EXECUTE
|
|
110
110
|
|
|
111
|
+
**Pre-dispatch: plan parallelization (standard automatic parallelism).** Before dispatching tasks, decide the safe parallel structure. This is orchestration, not reimplementation — autopilot chooses HOW to dispatch; the persona agents still do the work.
|
|
112
|
+
|
|
113
|
+
1. Collect the phase's tasks with their `files` and `dependsOn` (from the plan's task headers). Call the `plan_parallelization` MCP tool:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"path": "<project-root>",
|
|
118
|
+
"tasks": [{ "id": "task-1", "files": ["..."], "dependsOn": [] }],
|
|
119
|
+
"depth": 1
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
It returns a `ParallelizationPlan`: `waves[]` (each `{ tasks, severity, firing, analysisLevel }`), `serialized[]`, `cyclic[]`, `narration`.
|
|
124
|
+
|
|
125
|
+
2. **If `cyclic` is non-empty:** STOP. Surface the cycle and route back to PLAN/APPROVE_PLAN (a dependency cycle is a plan defect). Do not dispatch.
|
|
126
|
+
|
|
127
|
+
3. **Announce (announce-and-proceed):** emit `narration` verbatim. Do NOT pause here — announcing is not a gate.
|
|
128
|
+
|
|
129
|
+
4. **Dispatch in dependency order — prerequisites first, then waves in array order:**
|
|
130
|
+
- First, run every task in `serialized` (high-severity-group / cycle-adjacent members) **serially**, one `harness-task-executor` per task, in listed order. These are cross-bucket prerequisites: they MUST complete before any wave that depends on them.
|
|
131
|
+
- Then process `waves` **in array order**. The `waves` array is already topologically sorted (earlier waves are prerequisites of later ones). Do NOT reorder waves and do NOT key dispatch off the `firing` field alone — the Phase-2 cross-bucket cap (a wave depending on a serialized/cyclic task is downgraded to `confirm` and marked "cross-bucket prerequisite gates this wave" in `narration`) is only sound if serialized/cyclic ran first and waves run in order.
|
|
132
|
+
|
|
133
|
+
5. **For each wave, honor its `firing`:**
|
|
134
|
+
- `auto-dispatch` (multi-task): emit that wave's line from `narration`, then dispatch the wave via the **harness-parallel-agents** skill with **worktree-per-unit isolation** per `docs/guides/agent-worktree-patterns.md` ("Worktree-per-Milestone" / "Parallel Agent Work": one worktree per task, sequential commits, squash-merge at integrate). **Announce and proceed — do NOT stop for confirmation.**
|
|
135
|
+
- `confirm`: surface the wave and its `narration` line, then take exactly ONE plain-text confirmation — "Dispatch wave [{tasks}] in parallel? (yes / serial)". `yes` → dispatch via harness-parallel-agents (worktree-per-unit). `serial` or decline → run the wave's tasks serially (`harness-task-executor` each). Record the choice in `decisions[]`.
|
|
136
|
+
- `serialize`, or any single-task wave: run serially via `harness-task-executor`, exactly as today.
|
|
137
|
+
|
|
138
|
+
6. **Serial fallback is preserved** when a phase has fewer than `minWaveSize` (default 3) independent tasks, when a `confirm` is declined, or when no graph is available and the human does not confirm — honoring the standing "when in doubt, run serially" default.
|
|
139
|
+
|
|
140
|
+
Each dispatched unit (parallel wave or serial task) then follows the existing per-task contract below (state.json per task, checkpoints, retry budget).
|
|
141
|
+
|
|
111
142
|
Dispatch harness-task-executor:
|
|
112
143
|
|
|
113
144
|
```
|