harnessed 4.9.1 → 4.10.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/README.md +40 -4
- package/bin/harnessed-inject-state.mjs +103 -2
- package/dist/cli.mjs +1668 -1400
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/workflows/auto/SKILL.md +26 -12
- package/workflows/auto/SKILL.zh-Hans.md +25 -10
- package/workflows/discuss/auto/SKILL.md +15 -12
- package/workflows/discuss/auto/SKILL.zh-Hans.md +12 -8
- package/workflows/discuss/phase/SKILL.md +15 -12
- package/workflows/discuss/phase/SKILL.zh-Hans.md +12 -8
- package/workflows/discuss/strategic/SKILL.md +15 -12
- package/workflows/discuss/strategic/SKILL.zh-Hans.md +12 -8
- package/workflows/discuss/subtask/SKILL.md +15 -12
- package/workflows/discuss/subtask/SKILL.zh-Hans.md +12 -8
- package/workflows/plan/architecture/SKILL.md +14 -12
- package/workflows/plan/architecture/SKILL.zh-Hans.md +11 -8
- package/workflows/plan/auto/SKILL.md +26 -12
- package/workflows/plan/auto/SKILL.zh-Hans.md +25 -10
- package/workflows/plan/phase/SKILL.md +14 -12
- package/workflows/plan/phase/SKILL.zh-Hans.md +11 -8
- package/workflows/research/SKILL.md +14 -12
- package/workflows/research/SKILL.zh-Hans.md +11 -8
- package/workflows/retro/SKILL.md +14 -12
- package/workflows/retro/SKILL.zh-Hans.md +11 -8
- package/workflows/role-prompts.yaml +34 -0
- package/workflows/role-prompts.zh-Hans.yaml +33 -0
- package/workflows/ship/auto/SKILL.md +29 -0
- package/workflows/ship/auto/SKILL.zh-Hans.md +28 -0
- package/workflows/ship/preflight/SKILL.md +17 -0
- package/workflows/ship/preflight/SKILL.zh-Hans.md +16 -0
- package/workflows/task/auto/SKILL.md +26 -12
- package/workflows/task/auto/SKILL.zh-Hans.md +25 -10
- package/workflows/task/clarify/SKILL.md +15 -12
- package/workflows/task/clarify/SKILL.zh-Hans.md +12 -8
- package/workflows/task/code/SKILL.md +14 -12
- package/workflows/task/code/SKILL.zh-Hans.md +11 -8
- package/workflows/task/deliver/SKILL.md +14 -12
- package/workflows/task/deliver/SKILL.zh-Hans.md +11 -8
- package/workflows/task/test/SKILL.md +14 -12
- package/workflows/task/test/SKILL.zh-Hans.md +11 -8
- package/workflows/verify/auto/SKILL.md +26 -12
- package/workflows/verify/auto/SKILL.zh-Hans.md +25 -10
- package/workflows/verify/code-review/SKILL.md +14 -12
- package/workflows/verify/code-review/SKILL.zh-Hans.md +11 -8
- package/workflows/verify/design/SKILL.md +14 -12
- package/workflows/verify/design/SKILL.zh-Hans.md +11 -8
- package/workflows/verify/multispec/SKILL.md +14 -12
- package/workflows/verify/multispec/SKILL.zh-Hans.md +11 -8
- package/workflows/verify/paranoid/SKILL.md +14 -12
- package/workflows/verify/paranoid/SKILL.zh-Hans.md +11 -8
- package/workflows/verify/progress/SKILL.md +14 -12
- package/workflows/verify/progress/SKILL.zh-Hans.md +11 -8
- package/workflows/verify/qa/SKILL.md +14 -12
- package/workflows/verify/qa/SKILL.zh-Hans.md +11 -8
- package/workflows/verify/security/SKILL.md +14 -12
- package/workflows/verify/security/SKILL.zh-Hans.md +11 -8
- package/workflows/verify/simplify/SKILL.md +14 -12
- package/workflows/verify/simplify/SKILL.zh-Hans.md +11 -8
package/README.md
CHANGED
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
> Not affiliated with, endorsed by, or sponsored by Harness Inc. (see [NOTICE](./NOTICE))
|
|
14
14
|
|
|
15
|
-
> **How it compares** to [comet](https://github.com/rpamis/comet) and [Trellis](https://github.com/mindfold-ai/Trellis) — an honest, snapshot-dated comparison (including where harnessed lags): [`docs/comparison.md`](./docs/comparison.md).
|
|
16
|
-
|
|
17
15
|
---
|
|
18
16
|
|
|
19
17
|
## ✨ TL;DR
|
|
@@ -39,6 +37,24 @@ flowchart LR
|
|
|
39
37
|
|
|
40
38
|
---
|
|
41
39
|
|
|
40
|
+
## 🧱 What is the three-layer stack?
|
|
41
|
+
|
|
42
|
+
A recognized software-engineering loop, not a harness invention: three nested feedback loops — **BDD → SDD → TDD** — each answering a different question. The **three layers are the loops** (the stable theory); harnessed **composes** the open-source ecosystem into each loop — and the components **overlap**, which is exactly what a composition orchestrator arbitrates.
|
|
43
|
+
|
|
44
|
+
| Layer | Loop | Question it answers | Composed from (overlapping) |
|
|
45
|
+
|---|---|---|---|
|
|
46
|
+
| **① Behavior** | BDD | *What* to build + how we know it's done | gstack `/office-hours` governance · GSD discuss · superpowers brainstorming → acceptance criteria |
|
|
47
|
+
| **② Spec** | SDD | *How* it's structured | GSD plan-phase → requirements / design / tasks · contracts (Spec Kit / ECC patterns) |
|
|
48
|
+
| **③ Implementation** | TDD | Does it actually *work* | superpowers TDD red-green · subagent execution · GSD verify-work · ralph-loop completion |
|
|
49
|
+
|
|
50
|
+
The loops are **nested lenses, not phases** — the classic Cucumber BDD-outer + TDD-inner double-loop, extended with a GenAI-era SDD spec ring into a triple-loop. harnessed runs the default outer→inner traversal as its 5-stage cadence, plus the **back-edges it ships today**: Verify kicks failing work back to Task, a subagent that hits a gray area round-trips to clarification before continuing, and every shipped cycle feeds learnings back into the next Discuss. (Finer-grained structured back-edges — e.g. a contract contradiction routing straight to Spec, an ambiguous requirement to Behavior — are on the roadmap, not shipped. harnessed is the linear-cadence realization of the triple-loop; the full routed graph is its evolution path.)
|
|
51
|
+
|
|
52
|
+
**The components overlap — that's the point.** **GSD** threads through all three loops as the orchestration backbone, **gstack** spans Behavior + Review, **superpowers** spans Behavior (brainstorm) + Implementation (TDD). harnessed wires them — and arbitrates the overlap — into one engine. Two **cross-cutting disciplines** run through every layer: **karpathy principles** (*how* to code — simplicity-first, surgical diffs) + **mattpocock moves** (on-demand tactical tools like `/diagnose`, `/zoom-out`).
|
|
53
|
+
|
|
54
|
+
Mapped to the runtime loop above: **Discuss = Behavior (BDD) · Plan = Spec (SDD) · Build = Implementation (TDD)**, then **Verify + Ship** close it with evidence gates.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
42
58
|
> Wait — can harnessed really go toe-to-toe with upstream giants like superpowers / gstack / GSD?
|
|
43
59
|
> Of course — we **stand on the shoulders of giants**. See further, Newton said. 🧐
|
|
44
60
|
> ... *(whispers)* Though on closer look, more like the parrot perched on said shoulder.
|
|
@@ -48,7 +64,7 @@ flowchart LR
|
|
|
48
64
|
|
|
49
65
|
## 🎯 Key Differentiators
|
|
50
66
|
|
|
51
|
-
- **Three-layer stack machine-executed** — `gstack
|
|
67
|
+
- **Three-layer stack machine-executed** — the **BDD→SDD→TDD nested triple-loop** ([what's that?](#-what-is-the-three-layer-stack)), composed from `gstack` + `GSD` + `superpowers` (overlapping, GSD as the backbone) with `karpathy 4 principles` + `mattpocock 23 moves` as cross-cutting disciplines
|
|
52
68
|
- **No vendoring of upstream** — manifests describe install/check; on upstream upgrade users just re-install to get the latest version
|
|
53
69
|
- **Composition Skill** — in-house workflow skills act as the conductor's baton, orchestrating multiple upstreams in concert. **1 super-master `/auto` + 5 stage masters + 19 sub-workflows + 2 standalones = 27 namespace-layered workflows**, full 5-stage machine-execution (`/auto` one-shot across stages / `/discuss /plan /task /verify /ship` single stage / 19 three-layer-stack subs / `/research /retro` 2 standalones)
|
|
54
70
|
- **L0 Discipline Substrate** — global cross-stage behavior baseline (karpathy principles + output-style + language + operational + priority + protocols), applied universally
|
|
@@ -57,6 +73,25 @@ flowchart LR
|
|
|
57
73
|
|
|
58
74
|
---
|
|
59
75
|
|
|
76
|
+
## 🆚 vs Native Claude Code / Codex
|
|
77
|
+
|
|
78
|
+
Native agents give you primitives; harnessed wires them into a methodology. Where a native cell says a primitive "exists," you still design, wire, and maintain it yourself per project — harnessed ships it pre-composed and engine-driven.
|
|
79
|
+
|
|
80
|
+
| Dimension | Native Claude Code | Native Codex | harnessed |
|
|
81
|
+
|---|---|---|---|
|
|
82
|
+
| **Workflow / methodology** | Primitives only — you design the flow each time | Fewer primitives — freestyle per prompt | Codified **Discuss→Ship** 5-stage three-layer-stack engine — BDD + SDD + TDD loops + 2 cross-cutting (Review + Ship) |
|
|
83
|
+
| **Instruction injection** | `CLAUDE.md` + skills + hooks exist, but static & wired by hand | `AGENTS.md` only — no skills/hooks | Per-turn breadcrumb hook + task-scoped routing + learnings injected each cycle |
|
|
84
|
+
| **State / progress** | Chat context — lost on `/clear` / compaction | Chat context — no persistence layer | On-disk `.planning/` + `current-workflow.json` ledger + checkpoint evidence |
|
|
85
|
+
| **Cross-session recovery** | Re-explain the context by hand | Re-explain the context by hand | `harnessed status --recover`: you-are-here + next step |
|
|
86
|
+
| **Verification / "done"** | Agent self-reports "done" | Agent self-reports "done" | Independent review subagents + **fail-CLOSED evidence guard** (missing artifact = not done) |
|
|
87
|
+
| **Subagent orchestration** | Subagents + Agent Teams available, but orchestrated by hand | No subagent/team primitive | `gates → prompt → spawn → checkpoint`; Agent Teams auto-enabled per task |
|
|
88
|
+
| **Learning loop** | None | None | `LEARNINGS.md` auto-captured + injected into the next cycle |
|
|
89
|
+
| **Platform reach** | Claude Code only | Codex only | **Cross-harness** — Claude Code primary, Codex via platform layer |
|
|
90
|
+
|
|
91
|
+
> Native agents win on zero-setup, zero-overhead for trivial one-off edits. harnessed earns its keep the moment work spans multiple steps, sessions, or subagents — where freestyle drift and lost-in-chat state start costing you.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
60
95
|
## 📦 Quick Install
|
|
61
96
|
|
|
62
97
|
```bash
|
|
@@ -439,7 +474,8 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
|
|
|
439
474
|
| `harnessed prompt <sub>` | Output a spawn-ready prompt (role + checklist + disciplines + completion/clarification protocols) for a sub-workflow. |
|
|
440
475
|
| `harnessed checkpoint <action> <sub>` | Record sub-workflow start/complete/fail to `~/.claude/harnessed/checkpoints/`. |
|
|
441
476
|
| `harnessed` (no args) | Zero-arg you-are-here: active-workflow dashboard + `NEXT: auto\|manual\|done` + run hint; `--json` machine-readable; no active workflow → onboarding hint (comet `/comet` analog, read-only). |
|
|
442
|
-
| `harnessed next` | Deterministic next-step contract
|
|
477
|
+
| `harnessed next` | Deterministic next-step contract. Within a workflow: `NEXT: auto\|manual\|done`. When the workflow's subs are all resolved it falls through to the next **cross-unit** (next phase/task derived from `.planning/` disk state) with an exit-code contract (`0` advance · `2` done · `10` blocked). |
|
|
478
|
+
| `harnessed advance` | Forward continuation — print the next work unit (next phase/task) across the milestone and the command to run it. Print-only (the main session runs the next `/auto`); refuses to step past an incomplete earlier phase (`--force` overrides); `--json` drives a `while harnessed advance --json; do :; done` loop. |
|
|
443
479
|
| `harnessed reject <sub>` | Mark a sub as user-rejected (terminal, distinct from `failed`). |
|
|
444
480
|
| `harnessed compact [--tokens <n>]` | Summarize+evict resolved ledger entries (G6-safe: `fail_count>0` never evicted); auto-triggers on `checkpoint complete --tokens`. |
|
|
445
481
|
| `harnessed workflows` | List in-flight workflows (one per repo). |
|
|
@@ -67,7 +67,91 @@ function readWorkflow(root, keys) {
|
|
|
67
67
|
return null
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
// Phase 39 (D6) — plain-JS replicas of planningScan/deriveNext/describeUnit for the
|
|
71
|
+
// hot path. MUST stay byte-equivalent to src/checkpoint/{planningScan,deriveNext,
|
|
72
|
+
// forwardStep}.ts — the parity test compares this file's stdout to buildInjection.
|
|
73
|
+
// includeTasks:false (the per-turn phase-level floor) → tasks are never scanned, so
|
|
74
|
+
// the derived next is always phase-level here.
|
|
75
|
+
const PHASE_DIR = /^(\d+(?:\.\d+)?)-(.*)$/
|
|
76
|
+
|
|
77
|
+
function scanPhases(repoRoot) {
|
|
78
|
+
try {
|
|
79
|
+
const phasesDir = join(repoRoot, '.planning', 'phases')
|
|
80
|
+
if (!existsSync(phasesDir)) return []
|
|
81
|
+
const out = []
|
|
82
|
+
for (const dir of readdirSync(phasesDir)) {
|
|
83
|
+
const m = PHASE_DIR.exec(dir)
|
|
84
|
+
const num = m?.[1]
|
|
85
|
+
if (!num) continue
|
|
86
|
+
const dirPath = join(phasesDir, dir)
|
|
87
|
+
let entries
|
|
88
|
+
try {
|
|
89
|
+
entries = readdirSync(dirPath)
|
|
90
|
+
} catch {
|
|
91
|
+
continue
|
|
92
|
+
}
|
|
93
|
+
let plans = 0
|
|
94
|
+
let summaries = 0
|
|
95
|
+
const prefix = `${num}-`
|
|
96
|
+
for (const f of entries) {
|
|
97
|
+
if (!f.startsWith(prefix)) continue
|
|
98
|
+
if (f.endsWith('-PLAN.md')) plans++
|
|
99
|
+
else if (f.endsWith('-SUMMARY.md')) summaries++
|
|
100
|
+
}
|
|
101
|
+
const complete = plans > 0 && summaries >= plans
|
|
102
|
+
out.push({
|
|
103
|
+
phase: num,
|
|
104
|
+
name: m?.[2] ?? '',
|
|
105
|
+
plans,
|
|
106
|
+
summaries,
|
|
107
|
+
complete,
|
|
108
|
+
order: Number.parseFloat(num),
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
out.sort((a, b) => a.order - b.order)
|
|
112
|
+
return out
|
|
113
|
+
} catch {
|
|
114
|
+
return []
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function describeUnit(unit) {
|
|
119
|
+
switch (unit.kind) {
|
|
120
|
+
case 'phase':
|
|
121
|
+
return `phase ${unit.phase} '${unit.name}'`
|
|
122
|
+
case 'task':
|
|
123
|
+
return `task '${unit.task}' in phase ${unit.phase}`
|
|
124
|
+
case 'sub':
|
|
125
|
+
return `sub '${unit.sub}'`
|
|
126
|
+
default:
|
|
127
|
+
return null
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Mirror deriveNext for the per-turn path (ledger already resolved when called).
|
|
132
|
+
* includeTasks:false → no task branch; first-incomplete phase is the floor. */
|
|
133
|
+
function deriveNextUnit(wf, phases) {
|
|
134
|
+
const ledger = wf.sub_progress ?? []
|
|
135
|
+
const pendingSub = ledger.find((e) => e.status === 'pending')?.sub ?? null
|
|
136
|
+
if (pendingSub !== null) return { kind: 'sub', sub: pendingSub }
|
|
137
|
+
const failed = ledger.find((e) => e.status === 'failed' && (e.fail_count ?? 0) > 0)
|
|
138
|
+
if (failed) return { kind: 'blocked', unit: failed.sub, reason: '' }
|
|
139
|
+
const firstIncomplete = phases.find((p) => !p.complete)
|
|
140
|
+
if (firstIncomplete)
|
|
141
|
+
return { kind: 'phase', phase: firstIncomplete.phase, name: firstIncomplete.name }
|
|
142
|
+
return { kind: 'done' }
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** Impure forward pointer (parity with injectState.ts:forwardPointer). null unless
|
|
146
|
+
* the next is a concrete phase|task. */
|
|
147
|
+
function forwardPointer(repoRoot, wf) {
|
|
148
|
+
const phases = scanPhases(repoRoot)
|
|
149
|
+
const unit = deriveNextUnit(wf, phases)
|
|
150
|
+
if (unit.kind !== 'phase' && unit.kind !== 'task') return null
|
|
151
|
+
return { unit, remainingPhases: phases.filter((p) => !p.complete).length }
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function workflowStateBlock(wf, forward) {
|
|
71
155
|
const ledger = wf.sub_progress ?? []
|
|
72
156
|
const next = ledger.find((e) => e.status === 'pending')?.sub ?? null
|
|
73
157
|
const lines = [
|
|
@@ -76,6 +160,19 @@ function workflowStateBlock(wf) {
|
|
|
76
160
|
`status: ${wf.status}`,
|
|
77
161
|
next ? `next: ${next}` : 'next: (none — all subs resolved)',
|
|
78
162
|
]
|
|
163
|
+
// issue #2 (T2) — anti-freestyle enforcement (parity with injectState.ts).
|
|
164
|
+
if (next) {
|
|
165
|
+
lines.push(
|
|
166
|
+
`ENGINE: mid state-machine — drive sub '${next}' via \`harnessed prompt ${next}\` → spawn → \`harnessed checkpoint complete/fail\`. Do NOT freestyle the orchestration or skip the ledger; run \`harnessed status --recover\` if unsure where you are.`,
|
|
167
|
+
)
|
|
168
|
+
}
|
|
169
|
+
// Phase 39 (D6) — per-turn current→next pointer (parity with injectState.ts).
|
|
170
|
+
if (!next && forward && (forward.unit.kind === 'phase' || forward.unit.kind === 'task')) {
|
|
171
|
+
const n = forward.remainingPhases
|
|
172
|
+
lines.push(
|
|
173
|
+
`NEXT-UNIT: current workflow complete → next is ${describeUnit(forward.unit)} (run /auto or \`harnessed advance\`); ${n} phase${n === 1 ? '' : 's'} remain`,
|
|
174
|
+
)
|
|
175
|
+
}
|
|
79
176
|
for (const e of ledger) {
|
|
80
177
|
if ((e.fail_count ?? 0) >= 3)
|
|
81
178
|
lines.push(
|
|
@@ -176,7 +273,11 @@ try {
|
|
|
176
273
|
if (!wf) process.exit(0)
|
|
177
274
|
|
|
178
275
|
const budget = Number(process.env.HARNESSED_INJECT_BUDGET) || DEFAULT_INJECT_BUDGET
|
|
179
|
-
|
|
276
|
+
// Phase 39 (D6) — derive the forward pointer only when the subs are all resolved
|
|
277
|
+
// (parity with buildInjection). `key` is the repo root holding .planning/.
|
|
278
|
+
const pending = (wf.sub_progress ?? []).find((e) => e.status === 'pending')?.sub ?? null
|
|
279
|
+
const forward = pending === null ? forwardPointer(key, wf) : null
|
|
280
|
+
const ws = workflowStateBlock(wf, forward)
|
|
180
281
|
|
|
181
282
|
let learningsMd = ''
|
|
182
283
|
try {
|