dev-harness-cli 1.0.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.
Files changed (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +299 -0
  3. package/adapters/amazon-q/README.md +23 -0
  4. package/adapters/antigravity/README.md +22 -0
  5. package/adapters/claude-code/README.md +30 -0
  6. package/adapters/cline/README.md +23 -0
  7. package/adapters/codex/README.md +31 -0
  8. package/adapters/copilot/README.md +23 -0
  9. package/adapters/cursor/README.md +29 -0
  10. package/adapters/gemini/README.md +23 -0
  11. package/adapters/generic/README.md +40 -0
  12. package/adapters/hermes/README.md +31 -0
  13. package/adapters/hermes/SKILL.md +89 -0
  14. package/adapters/hermes/scripts/init.mjs +27 -0
  15. package/adapters/hermes/scripts/phase.mjs +27 -0
  16. package/adapters/hermes/scripts/validate.mjs +27 -0
  17. package/adapters/kilo-code/README.md +23 -0
  18. package/adapters/openclaw/README.md +22 -0
  19. package/adapters/pi/README.md +22 -0
  20. package/adapters/roo/README.md +23 -0
  21. package/adapters/windsurf/README.md +23 -0
  22. package/cli/commands/checkpoint.mjs +94 -0
  23. package/cli/commands/config.mjs +268 -0
  24. package/cli/commands/contract.mjs +155 -0
  25. package/cli/commands/detect-tool.mjs +112 -0
  26. package/cli/commands/init.mjs +351 -0
  27. package/cli/commands/learn.mjs +47 -0
  28. package/cli/commands/pause.mjs +34 -0
  29. package/cli/commands/phase.mjs +182 -0
  30. package/cli/commands/resume.mjs +33 -0
  31. package/cli/commands/rollback.mjs +261 -0
  32. package/cli/commands/set-mode.mjs +75 -0
  33. package/cli/commands/status.mjs +168 -0
  34. package/cli/commands/validate.mjs +118 -0
  35. package/cli/commands/worktree.mjs +298 -0
  36. package/cli/harness-dev.mjs +88 -0
  37. package/cli/lib/args.mjs +111 -0
  38. package/cli/lib/command-helpers.mjs +50 -0
  39. package/cli/lib/config-registry.mjs +329 -0
  40. package/cli/lib/constants.mjs +30 -0
  41. package/cli/lib/contract.mjs +306 -0
  42. package/cli/lib/detect-stack.mjs +235 -0
  43. package/cli/lib/errors.mjs +71 -0
  44. package/cli/lib/file-io.mjs +90 -0
  45. package/cli/lib/gates.mjs +492 -0
  46. package/cli/lib/git.mjs +144 -0
  47. package/cli/lib/help.mjs +246 -0
  48. package/cli/lib/modes.mjs +92 -0
  49. package/cli/lib/output.mjs +49 -0
  50. package/cli/lib/paths.mjs +75 -0
  51. package/cli/lib/phases.mjs +58 -0
  52. package/cli/lib/platform.mjs +78 -0
  53. package/cli/lib/progress.mjs +357 -0
  54. package/cli/lib/ralph-inner.mjs +314 -0
  55. package/cli/lib/ralph-outer.mjs +249 -0
  56. package/cli/lib/ralph-output.mjs +178 -0
  57. package/cli/lib/scaffold.mjs +431 -0
  58. package/cli/lib/schemas/stacks.json +477 -0
  59. package/cli/lib/state.mjs +333 -0
  60. package/cli/lib/templates.mjs +264 -0
  61. package/cli/lib/tool-registry.mjs +218 -0
  62. package/cli/lib/validate-schema.mjs +131 -0
  63. package/cli/lib/vars.mjs +114 -0
  64. package/package.json +50 -0
  65. package/schema/harness-config.schema.json +127 -0
  66. package/templates/AGENTS.md +63 -0
  67. package/templates/ci/github-actions.yml +78 -0
  68. package/templates/ci/gitlab-ci.yml +59 -0
  69. package/templates/docs/agents/evaluator.md +14 -0
  70. package/templates/docs/agents/generator.md +13 -0
  71. package/templates/docs/agents/planner.md +13 -0
  72. package/templates/docs/agents/simplifier.md +13 -0
  73. package/templates/docs/phases/build.md +41 -0
  74. package/templates/docs/phases/define.md +51 -0
  75. package/templates/docs/phases/plan.md +36 -0
  76. package/templates/docs/phases/review.md +42 -0
  77. package/templates/docs/phases/ship.md +43 -0
  78. package/templates/docs/phases/simplify.md +40 -0
  79. package/templates/docs/phases/verify.md +38 -0
  80. package/templates/evaluator-rubric.md +28 -0
  81. package/templates/init.ps1 +97 -0
  82. package/templates/init.sh +102 -0
  83. package/templates/sprint-contract.md +31 -0
@@ -0,0 +1,63 @@
1
+ # {{stackLabel}} — Harness
2
+
3
+ ## Quick Start
4
+
5
+ ```bash
6
+ harness-dev status # Where are we?
7
+ harness-dev phase <name> # Invoke a phase
8
+ harness-dev validate # Check gate criteria
9
+ ```
10
+
11
+ ## Project
12
+
13
+ - **Stack:** {{stack}}
14
+ - **Mode:** copilot / autopilot
15
+ - **Phase:** not started
16
+
17
+ ## Phase Pipeline
18
+
19
+ INIT → DEFINE → PLAN → BUILD → VERIFY → [SIMPLIFY] → REVIEW → SHIP
20
+
21
+ See `docs/phases/` for phase-specific instructions.
22
+
23
+ ## Agent Roles
24
+
25
+ | Role | File | Tone |
26
+ |------|------|------|
27
+ | Planner | `docs/agents/planner.md` | Analytical, precise. Define clear boundaries |
28
+ | Generator | `docs/agents/generator.md` | Focused, practical. Build what's specified |
29
+ | Evaluator | `docs/agents/evaluator.md` | Skeptical, thorough. Accept only compelling evidence |
30
+ | Simplifier | `docs/agents/simplifier.md` | Relentless about clarity. Delete more than you add |
31
+
32
+ ## Key Files
33
+
34
+ | File | Purpose |
35
+ |------|---------|
36
+ | `harness-config.json` | Config + state |
37
+ | `feature_list.json` | Feature list with passes |
38
+ | `progress.md` | Session state + lessons |
39
+ | `sprint-contract.md` | Pre-build agreement |
40
+ | `init.sh` | Install → verify → start |
41
+ | `evaluator-rubric.md` | Quality scorecard (6 dimensions, 0-2) |
42
+ |
43
+ ## Rules (non-negotiable)
44
+
45
+ 1. No agent evaluates its own work — Evaluator always judges
46
+ 2. Read `progress.md` + this file before each operation
47
+ 3. Commit frequently — each iteration is a checkpoint
48
+ 4. If unsure → read the role guide in `docs/agents/`
49
+ 5. Never skip gates — run `harness-dev validate` after each phase
50
+ 6. Fresh context per retry — pass `--git-ops` to `harness-dev phase <name>` to auto-reset the working tree on retry (off by default; agent-agnostic)
51
+ 7. **No files in project root** unless they are harness-managed files (listed in Key Files above) or standard project files (README.md, LICENSE, CHANGELOG.md, CONTRIBUTING.md, .gitignore, and the stack config file like package.json/pyproject.toml/Cargo.toml). All source code, tests, scripts, and docs go in subdirectories.
52
+ 8. **Structure from the start** — create folders for your work on day one and stick to them. Suggested layout: `src/` (source), `tests/` (tests), `docs/` (documentation), `scripts/` (automation). Do not dump files at root "temporarily" — there is no temporary.
53
+ 9. **No orphaned files** — every file you create must have a clear purpose and be referenced by imports, configs, docs, or the build system. If you create a file, wire it in immediately. Delete files you stop using.
54
+
55
+ ## Development Commands
56
+
57
+ | Task | Command |
58
+ |------|---------|
59
+ | Install deps | `{{installCmd}}` |
60
+ | Build | `{{buildCmd}}` |
61
+ | Test | `{{testCmd}}` |
62
+ | Lint | `{{lintCmd}}` |
63
+ | Type check | `{{typeCheckCmd}}` |
@@ -0,0 +1,78 @@
1
+ # CI/CD pipeline for {{stackLabel}} projects scaffolded by Dev Harness
2
+ # Trigger: push + PR to main
3
+ # Stack: {{stack}} — toolchain setup is conditional on the rendered stack value.
4
+ name: harness
5
+
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ pull_request:
10
+ branches: [main]
11
+
12
+ jobs:
13
+ lint:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-node@v4
18
+ if: {{stack}} == 'node'
19
+ with: { node-version: lts/* }
20
+ - uses: actions/setup-python@v5
21
+ if: {{stack}} == 'python'
22
+ with: { python-version: '3.x' }
23
+ - uses: actions/setup-go@v5
24
+ if: {{stack}} == 'go'
25
+ with: { go-version: 'stable' }
26
+ - uses: dtolnay/rust-toolchain@stable
27
+ if: {{stack}} == 'rust'
28
+ - run: {{installCmd}}
29
+ - run: {{lintCmd}}
30
+
31
+ test:
32
+ needs: lint
33
+ runs-on: ubuntu-latest
34
+ strategy:
35
+ matrix:
36
+ node-version: [18, 20, 22]
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - uses: actions/setup-node@v4
40
+ if: {{stack}} == 'node'
41
+ with: { node-version: ${{ matrix.node-version }} }
42
+ - uses: actions/setup-python@v5
43
+ if: {{stack}} == 'python'
44
+ with: { python-version: '3.x' }
45
+ - uses: actions/setup-go@v5
46
+ if: {{stack}} == 'go'
47
+ with: { go-version: 'stable' }
48
+ - uses: dtolnay/rust-toolchain@stable
49
+ if: {{stack}} == 'rust'
50
+ - run: {{installCmd}}
51
+ - run: {{testCmd}}
52
+
53
+ coverage:
54
+ needs: test
55
+ runs-on: ubuntu-latest
56
+ steps:
57
+ - uses: actions/checkout@v4
58
+ - uses: actions/setup-node@v4
59
+ if: {{stack}} == 'node'
60
+ with: { node-version: lts/* }
61
+ - uses: actions/setup-python@v5
62
+ if: {{stack}} == 'python'
63
+ with: { python-version: '3.x' }
64
+ - uses: actions/setup-go@v5
65
+ if: {{stack}} == 'go'
66
+ with: { go-version: 'stable' }
67
+ - uses: dtolnay/rust-toolchain@stable
68
+ if: {{stack}} == 'rust'
69
+ - run: {{installCmd}}
70
+ - run: {{testCmd}}
71
+
72
+ gate:
73
+ needs: coverage
74
+ runs-on: ubuntu-latest
75
+ steps:
76
+ - uses: actions/checkout@v4
77
+ - run: npm install -g @dev-harness/cli
78
+ - run: harness-dev validate --json
@@ -0,0 +1,59 @@
1
+ # CI/CD pipeline for {{stackLabel}} projects scaffolded by Dev Harness
2
+ # Stack: {{stack}} — CI image selected via workflow rules.
3
+ stages:
4
+ - lint
5
+ - test
6
+ - coverage
7
+ - gate
8
+
9
+ # Select the container image based on the rendered stack value.
10
+ # {{stack}} is substituted at scaffold time, so exactly one rule matches.
11
+ workflow:
12
+ rules:
13
+ - if: {{stack}} == 'python'
14
+ variables:
15
+ CI_IMAGE: python:3.12
16
+ - if: {{stack}} == 'go'
17
+ variables:
18
+ CI_IMAGE: golang:latest
19
+ - if: {{stack}} == 'rust'
20
+ variables:
21
+ CI_IMAGE: rust:latest
22
+ - if: {{stack}} == 'java'
23
+ variables:
24
+ CI_IMAGE: maven:latest
25
+ - if: {{stack}} == 'dotnet'
26
+ variables:
27
+ CI_IMAGE: mcr.microsoft.com/dotnet/sdk:latest
28
+ - when: always
29
+ variables:
30
+ CI_IMAGE: node:lts
31
+
32
+ lint:
33
+ stage: lint
34
+ image: $CI_IMAGE
35
+ script:
36
+ - {{installCmd}}
37
+ - {{lintCmd}}
38
+
39
+ test:
40
+ stage: test
41
+ image: $CI_IMAGE
42
+ script:
43
+ - {{installCmd}}
44
+ - {{testCmd}}
45
+
46
+ coverage:
47
+ stage: coverage
48
+ image: $CI_IMAGE
49
+ script:
50
+ - {{installCmd}}
51
+ - {{testCmd}}
52
+
53
+ gate:
54
+ stage: gate
55
+ image: node:lts
56
+ script:
57
+ - npm install -g @dev-harness/cli
58
+ - harness-dev validate --json
59
+ needs: [coverage]
@@ -0,0 +1,14 @@
1
+ # Evaluator Role
2
+
3
+ Tone: Skeptical and thorough. Accept only compelling evidence.
4
+
5
+ You verify. You gate. You are the final authority.
6
+
7
+ - Do NOT trust "seems right" — require proof
8
+ - Run the verification commands yourself
9
+ - If criteria are ambiguous, reject with specific reason
10
+ - "Pass" means all checks pass; "Fail" means at least one check is insufficient
11
+ - In DEFINE: review sprint-contract.md for clarity and testability
12
+ - In REVIEW: check all phase gates, branch alignment, changelog
13
+ - Use `evaluator-rubric.md` to score quality across 6 dimensions
14
+ - Gate failures escalate to human after max retries
@@ -0,0 +1,13 @@
1
+ # Generator Role
2
+
3
+ Tone: Focused and practical. Build what's specified.
4
+
5
+ You implement. You produce artifacts. You self-check.
6
+
7
+ - Build exactly what the Planner specified
8
+ - Do not add scope or "future-proof"
9
+ - Run lint + tests before handoff
10
+ - In BUILD: implement ONE task at a time, then validate
11
+ - In VERIFY: run the full test suite
12
+ - In SIMPLIFY: adopt the Simplifier persona (see simplifier.md)
13
+ - When done: call `harness-dev validate`
@@ -0,0 +1,13 @@
1
+ # Planner Role
2
+
3
+ Tone: Analytical and precise. Define clear boundaries.
4
+
5
+ You design the approach. You write criteria. You set scope.
6
+
7
+ - Propose what to build in sprint-contract.md
8
+ - Define unambiguous acceptance criteria
9
+ - Set exclusions explicitly ("We will NOT build X")
10
+ - Hand off to Generator when criteria are clear
11
+ - In DEFINE: interview the user, write PRD in specs/*.md
12
+ - In PLAN: decompose features into tasks in feature_list.json
13
+ - Review gate criteria with Evaluator before proceeding
@@ -0,0 +1,13 @@
1
+ # Simplifier (Generator Persona for SIMPLIFY Phase)
2
+
3
+ Tone: Relentless about clarity. Delete more than you add.
4
+
5
+ You refactor. You clean. You never change behavior.
6
+
7
+ - Flatten nesting — max 4 levels
8
+ - Remove dead code and commented-out blocks
9
+ - Extract repeated logic into shared functions
10
+ - Break long functions (~40 line threshold)
11
+ - Rename unclear variables
12
+ - ⚠ All tests must still pass after your changes
13
+ - Run `harness-dev validate` after each feature to confirm gate
@@ -0,0 +1,41 @@
1
+ # BUILD Phase
2
+
3
+ **Loop mode:** Feature-iterate
4
+ **Unit of work:** One incomplete feature from `feature_list.json`
5
+ **Primary agent:** Generator
6
+
7
+ ## Purpose
8
+
9
+ Implement features one at a time. Each iteration: pick the next incomplete
10
+ feature → work → validate that task → pass = next feature / fail = retry with
11
+ fresh context. Only when all features pass does the phase gate run.
12
+
13
+ ## Entry
14
+
15
+ - PLAN gate passed
16
+ - `sprint-contract.md` status is `Agreed`
17
+ - `feature_list.json` non-empty
18
+
19
+ ## Work
20
+
21
+ 1. Read `progress.md`, `AGENTS.md`, `sprint-contract.md`.
22
+ 2. Pick next feature where `passes === false`.
23
+ 3. Implement the feature's tasks.
24
+ 4. Run `harness-dev validate --feature <name> --task <id>` per task.
25
+ 5. On pass: mark feature `passes: true`, commit, append lesson to `progress.md`.
26
+ 6. On fail (≤ `maxRetries`): retry with fresh context (git reset if `--git-ops`).
27
+ 7. On fail (> `maxRetries`): escalate to human.
28
+
29
+ ## Exit Gate
30
+
31
+ Run `harness-dev validate` — checks:
32
+
33
+ - `config-exists`
34
+ - `git-repo`
35
+ - `feature-branch` (not on main/master)
36
+ - `git-clean`
37
+ - All features in `feature_list.json` have `passes: true`
38
+
39
+ ## Handoff
40
+
41
+ On gate pass: `harness-dev phase verify` (Generator → Evaluator).
@@ -0,0 +1,51 @@
1
+ # DEFINE Phase
2
+
3
+ **Loop mode:** Deliverable-retry
4
+ **Deliverable:** Product Requirements Document (`specs/*.md`)
5
+ **Primary agent:** Planner
6
+
7
+ ## Purpose
8
+
9
+ Interview the user, capture intent, and write a bounded PRD. The output is a
10
+ short, unambiguous specification that the PLAN phase can decompose into a
11
+ feature list.
12
+
13
+ ## Entry
14
+
15
+ - `harness-config.json` exists (created by `harness-dev init`)
16
+ - `AGENTS.md` present in project root
17
+
18
+ ## Work
19
+
20
+ 1. Read `progress.md` and `AGENTS.md` for context.
21
+ 2. Interview the user to surface objectives, constraints, and exclusions.
22
+ 3. **If stack is custom/unknown**, fill `stackMeta` in `harness-config.json`:
23
+ - `testCmd` — command to run tests (e.g. `mix test`)
24
+ - `lintCmd` — command to lint (e.g. `mix credo`)
25
+ - `buildCmd` — command to build (e.g. `mix compile`)
26
+ - `installCmd` — command to install deps (e.g. `mix deps.get`)
27
+ - `coverageCmd` — command for coverage (e.g. `mix test --cover`)
28
+ - `configFile` — project config file (e.g. `mix.exs`)
29
+ - `extensions` — source file extensions (e.g. `[".ex", ".exs"]`)
30
+ - These override the built-in stack metadata and make gate validation work.
31
+ 4. **Define project folder structure** — agree on directory layout with user:
32
+ - `src/` for source code
33
+ - `tests/` for test files
34
+ - `docs/` for documentation
35
+ - `scripts/` for automation scripts
36
+ - No source files in project root (only harness + standard project files)
37
+ - Document the agreed structure in `specs/prd.md`
38
+ 5. Write `specs/prd.md` — scope, success criteria, non-goals.
39
+ 6. Keep the PRD bounded: no vague verbs ("improve", "enhance").
40
+
41
+ ## Exit Gate
42
+
43
+ Run `harness-dev validate` — checks:
44
+
45
+ - `config-exists`
46
+ - `git-repo`
47
+ - `specs/prd.md` present
48
+
49
+ ## Handoff
50
+
51
+ On gate pass: `harness-dev phase plan` (Planner → continues as Planner for decomposition).
@@ -0,0 +1,36 @@
1
+ # PLAN Phase
2
+
3
+ **Loop mode:** Deliverable-retry
4
+ **Deliverable:** `feature_list.json` with decomposed tasks
5
+ **Primary agent:** Planner
6
+
7
+ ## Purpose
8
+
9
+ Decompose the PRD into a feature list. Each feature has one or more tasks with
10
+ verifiable acceptance criteria. The Sprint Contract is negotiated here.
11
+
12
+ ## Entry
13
+
14
+ - DEFINE gate passed
15
+ - `specs/prd.md` present
16
+
17
+ ## Work
18
+
19
+ 1. Read `specs/prd.md`.
20
+ 2. Decompose into features → tasks in `feature_list.json`.
21
+ 3. Planner proposes `sprint-contract.md` (scope, criteria, exclusions).
22
+ 4. Evaluator reviews; iterate until `**Status:** Agreed`.
23
+ 5. Use `harness-dev contract propose` / `contract review --decision <agreed|needs-revision>`.
24
+
25
+ ## Exit Gate
26
+
27
+ Run `harness-dev validate` — checks:
28
+
29
+ - `config-exists`
30
+ - `git-repo`
31
+ - `feature_list.json` present and non-empty
32
+ - `contract-agreed` (sprint contract status is `Agreed`)
33
+
34
+ ## Handoff
35
+
36
+ On gate pass: `harness-dev phase build` (Planner → Generator).
@@ -0,0 +1,42 @@
1
+ # REVIEW Phase
2
+
3
+ **Loop mode:** Deliverable-retry
4
+ **Deliverable:** Review report (`review-report.md`)
5
+ **Primary agents:** Multi-agent committee (Planner, Generator, Evaluator, Simplifier)
6
+
7
+ ## Purpose
8
+
9
+ Whole-project review by the committee. Each persona reviews from its angle and
10
+ records findings. The Evaluator aggregates into `review-report.md` with an
11
+ overall verdict: Accept / Revise / Block.
12
+
13
+ ## Entry
14
+
15
+ - SIMPLIFY gate passed (or SIMPLIFY disabled)
16
+
17
+ ## Work
18
+
19
+ 1. Each persona reviews the full diff since last review:
20
+ - Planner: scope adherence vs `sprint-contract.md`
21
+ - Generator: implementation correctness
22
+ - Evaluator: rubric scores, gate evidence
23
+ - Simplifier: residual complexity / dead code
24
+ 2. Evaluator aggregates findings into `review-report.md`.
25
+ 3. Verdict `Revise` → return to BUILD with specific feedback.
26
+ 4. Verdict `Accept` → proceed to SHIP.
27
+
28
+ ## Exit Gate
29
+
30
+ Run `harness-dev validate` — checks:
31
+
32
+ - `config-exists`
33
+ - `git-repo`
34
+ - `git-clean`
35
+ - `review-report.md` present with verdict `Accept`
36
+ - `readme-exists` — README.md present with meaningful content
37
+ - `architecture-doc` — ARCHITECTURE.md filled in (if file exists)
38
+ - `decisions-logged` — DECISIONS.md has at least one recorded decision
39
+
40
+ ## Handoff
41
+
42
+ On gate pass: `harness-dev phase ship` (committee → release).
@@ -0,0 +1,43 @@
1
+ # SHIP Phase
2
+
3
+ **Loop mode:** Deliverable-retry
4
+ **Deliverable:** Release artifact (tag, changelog entry, PR)
5
+ **Primary agent:** Generator (release mechanics), Evaluator (final sign-off)
6
+
7
+ ## Purpose
8
+
9
+ Produce the release. Cut a tag, update `CHANGELOG.md`, open or merge the PR.
10
+ The release must be reproducible from a clean checkout.
11
+
12
+ ## Entry
13
+
14
+ - REVIEW gate passed with verdict `Accept`
15
+
16
+ ## Work
17
+
18
+ 1. Update `CHANGELOG.md` with version, date, summary.
19
+ 2. Bump version in `package.json` / equivalent manifest.
20
+ 3. Run full `harness-dev validate` — all gates must pass.
21
+ 4. Tag the release: `git tag -a v<x.y.z> -m "Release x.y.z"`.
22
+ 5. Open or merge the PR per project workflow.
23
+
24
+ ## Exit Gate
25
+
26
+ Run `harness-dev validate` — checks:
27
+
28
+ - `config-exists`
29
+ - `git-repo`
30
+ - `git-clean`
31
+ - Release tag exists
32
+ - `CHANGELOG.md` updated
33
+ - `readme-exists` — README.md present with meaningful content
34
+ - `license-exists` — LICENSE file present
35
+ - `changelog-content` — CHANGELOG.md has actual version entries
36
+ - `contributing-exists` — CONTRIBUTING.md present (recommended)
37
+ - `no-empty-dirs` — no empty directories in shipped project
38
+
39
+ ## Handoff
40
+
41
+ On gate pass: pipeline complete. `harness-dev status` reports
42
+ `Pipeline complete after "ship"`. Increment `pipelineIteration` and loop back
43
+ to DEFINE for the next sprint, or stop if the project is done.
@@ -0,0 +1,40 @@
1
+ # SIMPLIFY Phase
2
+
3
+ **Loop mode:** Feature-iterate
4
+ **Unit of work:** One feature simplified
5
+ **Primary agent:** Simplifier
6
+
7
+ ## Purpose
8
+
9
+ Relentless clarity. Delete more than you add. Each feature gets a simplification
10
+ pass: remove dead code, collapse duplication, tighten names. Simplifications
11
+ must not break the feature's acceptance criteria.
12
+
13
+ ## Entry
14
+
15
+ - VERIFY gate passed
16
+ - `simplify` enabled in `harness-config.json` (`phases.enabled` includes `simplify`)
17
+
18
+ ## Work
19
+
20
+ 1. Read `progress.md` and `AGENTS.md`.
21
+ 2. For each feature: review the implementation, propose deletions/renames.
22
+ 3. Apply simplifications.
23
+ 4. Re-run `harness-dev validate --feature <name>` — criteria must still pass.
24
+ 5. On pass: commit, append lesson.
25
+ 6. On fail (≤ `maxRetries`): revert and retry.
26
+ 7. On fail (> `maxRetries`): escalate.
27
+
28
+ ## Exit Gate
29
+
30
+ Run `harness-dev validate` — checks:
31
+
32
+ - `config-exists`
33
+ - `git-repo`
34
+ - `git-clean`
35
+ - `no-empty-dirs` — no empty directories (cleanup dead structure)
36
+ - All features still pass their criteria
37
+
38
+ ## Handoff
39
+
40
+ On gate pass: `harness-dev phase review` (Simplifier → multi-agent committee).
@@ -0,0 +1,38 @@
1
+ # VERIFY Phase
2
+
3
+ **Loop mode:** Feature-iterate
4
+ **Unit of work:** One feature re-checked by an independent agent
5
+ **Primary agent:** Evaluator
6
+
7
+ ## Purpose
8
+
9
+ No agent evaluates its own work. The Evaluator independently re-runs each
10
+ feature's acceptance criteria from the sprint contract and scores it against
11
+ `evaluator-rubric.md`. Failures go back to BUILD with feedback.
12
+
13
+ ## Entry
14
+
15
+ - BUILD gate passed
16
+ - All features marked `passes: true` by Generator
17
+
18
+ ## Work
19
+
20
+ 1. Read `sprint-contract.md` criteria and `evaluator-rubric.md`.
21
+ 2. For each feature: re-run its verification command independently.
22
+ 3. Score each rubric dimension (0–2): Correctness, Coverage, Code Quality,
23
+ Security, Performance, Handoff Readiness.
24
+ 4. On pass: keep `passes: true`, record score in `progress.md`.
25
+ 5. On fail: mark `passes: false`, write feedback, return to BUILD.
26
+
27
+ ## Exit Gate
28
+
29
+ Run `harness-dev validate` — checks:
30
+
31
+ - `config-exists`
32
+ - `git-repo`
33
+ - `git-clean`
34
+ - All features re-confirmed `passes: true` by Evaluator
35
+
36
+ ## Handoff
37
+
38
+ On gate pass: `harness-dev phase simplify` (Evaluator → Simplifier).
@@ -0,0 +1,28 @@
1
+ # Evaluator Rubric
2
+
3
+ Score each dimension 0-2:
4
+
5
+ | Score | Meaning |
6
+ |-------|---------|
7
+ | 0 | Unacceptable (blocker — must fix) |
8
+ | 1 | Acceptable with minor issues |
9
+ | 2 | Excellent (no issues) |
10
+
11
+ ## Scorecard
12
+
13
+ | Dimension | Score | Evidence | Notes |
14
+ |-----------|-------|----------|-------|
15
+ | **Correctness** | 0-2 | [test results] | Does it work? |
16
+ | **Test Coverage** | 0-2 | [coverage report] | ≥80%? |
17
+ | **Code Quality** | 0-2 | [lint output] | Clean? Idiomatic? |
18
+ | **Security** | 0-2 | [scan results] | Vulnerabilities? |
19
+ | **Performance** | 0-2 | [benchmarks] | Regressions? |
20
+ | **Handoff Readiness** | 0-2 | [docs updated] | Next agent can continue? |
21
+
22
+ ## Thresholds
23
+
24
+ | Total Score | Outcome |
25
+ |-------------|---------|
26
+ | 10-12 | Accept (pass gate) |
27
+ | 5-9 | Revise (fix issues, re-check) |
28
+ | 0-4 | Block (escalate to human) |
@@ -0,0 +1,97 @@
1
+ <#
2
+ .SYNOPSIS
3
+ Dev Harness — cross-platform init script (PowerShell).
4
+ .DESCRIPTION
5
+ Installs dependencies, verifies the setup, and starts the dev server
6
+ for the detected project stack.
7
+ .NOTES
8
+ Generated by Dev Harness v{{harnessVersion}} for {{stack}}.
9
+ #>
10
+
11
+ $ErrorActionPreference = "Stop"
12
+ $HarnessVersion = "{{harnessVersion}}"
13
+ $Stack = "{{stack}}"
14
+ $StackLabel = "{{stackLabel}}"
15
+
16
+ Write-Host "=== $StackLabel — Dev Harness ===" -ForegroundColor Cyan
17
+ Write-Host ""
18
+
19
+ # ── Install ──────────────────────────────────────────────────────────────────
20
+ Write-Host "Installing dependencies..." -ForegroundColor Yellow
21
+
22
+ switch ($Stack) {
23
+ "python" {
24
+ python -m pip install -e ".[dev]" 2>$null
25
+ if ($LASTEXITCODE -ne 0) { pip install -e ".[dev]" }
26
+ }
27
+ "node" {
28
+ npm install
29
+ }
30
+ "go" {
31
+ go mod download
32
+ }
33
+ "rust" {
34
+ cargo build
35
+ }
36
+ "java" {
37
+ mvn install -DskipTests
38
+ }
39
+ "kotlin" {
40
+ ./gradlew build
41
+ }
42
+ "dotnet" {
43
+ dotnet restore
44
+ }
45
+ "c" {
46
+ # C toolchain — requires gcc/cmake (install via system package manager)
47
+ cmake --version 2>$null
48
+ if ($LASTEXITCODE -ne 0) { Write-Host "cmake not found — install CMake + a C compiler" -ForegroundColor Yellow }
49
+ }
50
+ "cpp" {
51
+ # C++ toolchain — requires g++/cmake
52
+ cmake --version 2>$null
53
+ if ($LASTEXITCODE -ne 0) { Write-Host "cmake not found — install CMake + a C++ compiler" -ForegroundColor Yellow }
54
+ }
55
+ "matlab" {
56
+ # MATLAB — no install step; verify matlab is on PATH at verify stage
57
+ }
58
+ "vhdl" {
59
+ # VHDL — GHDL is the common open-source simulator
60
+ ghdl --version 2>$null
61
+ if ($LASTEXITCODE -ne 0) { Write-Host "ghdl not found — install GHDL for VHDL simulation" -ForegroundColor Yellow }
62
+ }
63
+ "verilog" {
64
+ # Verilog/SystemVerilog — Icarus Verilog is the common open-source simulator
65
+ iverilog -V 2>$null
66
+ if ($LASTEXITCODE -ne 0) { Write-Host "iverilog not found — install Icarus Verilog" -ForegroundColor Yellow }
67
+ }
68
+ Default {
69
+ Write-Host "No install command configured for $Stack" -ForegroundColor Yellow
70
+ }
71
+ }
72
+
73
+ Write-Host " ✓ Dependencies installed" -ForegroundColor Green
74
+
75
+ # ── Verify ───────────────────────────────────────────────────────────────────
76
+ Write-Host "`nVerifying setup..." -ForegroundColor Yellow
77
+
78
+ switch ($Stack) {
79
+ "python" { python -m pytest --version }
80
+ "node" { npm test }
81
+ "go" { go test ./... }
82
+ "rust" { cargo test }
83
+ "java" { mvn test }
84
+ "kotlin" { ./gradlew test }
85
+ "dotnet" { dotnet build }
86
+ "c" { cmake --version }
87
+ "cpp" { cmake --version }
88
+ "matlab" { matlab -batch "disp('matlab ok')" }
89
+ "vhdl" { ghdl --version }
90
+ "verilog"{ iverilog -V }
91
+ Default { Write-Host "No verify command configured for $Stack" -ForegroundColor Yellow }
92
+ }
93
+
94
+ Write-Host " ✓ Setup verified" -ForegroundColor Green
95
+
96
+ # ── Start ────────────────────────────────────────────────────────────────────
97
+ Write-Host "`nSetup complete. Run: harness-dev phase define" -ForegroundColor Cyan