@harness-engineering/cli 1.7.0 → 1.8.1
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/personas/documentation-maintainer.yaml +3 -1
- package/dist/agents/personas/performance-guardian.yaml +23 -0
- package/dist/agents/skills/claude-code/align-documentation/SKILL.md +13 -0
- package/dist/agents/skills/claude-code/cleanup-dead-code/SKILL.md +25 -1
- package/dist/agents/skills/claude-code/cleanup-dead-code/skill.yaml +5 -2
- package/dist/agents/skills/claude-code/detect-doc-drift/SKILL.md +12 -0
- package/dist/agents/skills/claude-code/enforce-architecture/SKILL.md +48 -1
- package/dist/agents/skills/claude-code/enforce-architecture/skill.yaml +5 -2
- package/dist/agents/skills/claude-code/harness-accessibility/SKILL.md +7 -0
- package/dist/agents/skills/claude-code/harness-autopilot/SKILL.md +11 -3
- package/dist/agents/skills/claude-code/harness-brainstorming/SKILL.md +81 -11
- package/dist/agents/skills/claude-code/harness-brainstorming/skill.yaml +2 -0
- package/dist/agents/skills/claude-code/harness-code-review/SKILL.md +487 -234
- package/dist/agents/skills/claude-code/harness-code-review/skill.yaml +15 -2
- package/dist/agents/skills/claude-code/harness-codebase-cleanup/SKILL.md +226 -0
- package/dist/agents/skills/claude-code/harness-codebase-cleanup/skill.yaml +64 -0
- package/dist/agents/skills/claude-code/harness-dependency-health/SKILL.md +35 -6
- package/dist/agents/skills/claude-code/harness-docs-pipeline/SKILL.md +460 -0
- package/dist/agents/skills/claude-code/harness-docs-pipeline/skill.yaml +69 -0
- package/dist/agents/skills/claude-code/harness-execution/SKILL.md +73 -8
- package/dist/agents/skills/claude-code/harness-execution/skill.yaml +1 -0
- package/dist/agents/skills/claude-code/harness-hotspot-detector/SKILL.md +32 -6
- package/dist/agents/skills/claude-code/harness-i18n/SKILL.md +484 -0
- package/dist/agents/skills/claude-code/harness-i18n/skill.yaml +54 -0
- package/dist/agents/skills/claude-code/harness-i18n-process/SKILL.md +388 -0
- package/dist/agents/skills/claude-code/harness-i18n-process/skill.yaml +43 -0
- package/dist/agents/skills/claude-code/harness-i18n-workflow/SKILL.md +512 -0
- package/dist/agents/skills/claude-code/harness-i18n-workflow/skill.yaml +53 -0
- package/dist/agents/skills/claude-code/harness-impact-analysis/SKILL.md +35 -6
- package/dist/agents/skills/claude-code/harness-integrity/SKILL.md +17 -1
- package/dist/agents/skills/claude-code/harness-knowledge-mapper/SKILL.md +46 -5
- package/dist/agents/skills/claude-code/harness-perf/SKILL.md +37 -8
- package/dist/agents/skills/claude-code/harness-perf/skill.yaml +3 -0
- package/dist/agents/skills/claude-code/harness-perf-tdd/SKILL.md +17 -4
- package/dist/agents/skills/claude-code/harness-planning/SKILL.md +59 -5
- package/dist/agents/skills/claude-code/harness-planning/skill.yaml +2 -0
- package/dist/agents/skills/claude-code/harness-release-readiness/SKILL.md +16 -0
- package/dist/agents/skills/claude-code/harness-roadmap/SKILL.md +561 -0
- package/dist/agents/skills/claude-code/harness-roadmap/skill.yaml +43 -0
- package/dist/agents/skills/claude-code/harness-security-review/SKILL.md +36 -2
- package/dist/agents/skills/claude-code/harness-security-review/skill.yaml +8 -6
- package/dist/agents/skills/claude-code/harness-soundness-review/SKILL.md +1267 -0
- package/dist/agents/skills/claude-code/harness-soundness-review/skill.yaml +48 -0
- package/dist/agents/skills/claude-code/harness-test-advisor/SKILL.md +35 -6
- package/dist/agents/skills/claude-code/harness-verification/SKILL.md +66 -0
- package/dist/agents/skills/claude-code/harness-verification/skill.yaml +1 -0
- package/dist/agents/skills/claude-code/harness-verify/SKILL.md +11 -0
- package/dist/agents/skills/claude-code/initialize-harness-project/SKILL.md +15 -1
- package/dist/agents/skills/claude-code/validate-context-engineering/SKILL.md +12 -0
- package/dist/agents/skills/gemini-cli/add-harness-component/SKILL.md +192 -0
- package/dist/agents/skills/gemini-cli/add-harness-component/skill.yaml +32 -0
- package/dist/agents/skills/gemini-cli/align-documentation/SKILL.md +213 -0
- package/dist/agents/skills/gemini-cli/align-documentation/skill.yaml +31 -0
- package/dist/agents/skills/gemini-cli/check-mechanical-constraints/SKILL.md +191 -0
- package/dist/agents/skills/gemini-cli/check-mechanical-constraints/skill.yaml +32 -0
- package/dist/agents/skills/gemini-cli/cleanup-dead-code/SKILL.md +245 -0
- package/dist/agents/skills/gemini-cli/cleanup-dead-code/skill.yaml +33 -0
- package/dist/agents/skills/gemini-cli/detect-doc-drift/SKILL.md +179 -0
- package/dist/agents/skills/gemini-cli/detect-doc-drift/skill.yaml +30 -0
- package/dist/agents/skills/gemini-cli/enforce-architecture/SKILL.md +240 -0
- package/dist/agents/skills/gemini-cli/enforce-architecture/skill.yaml +34 -0
- package/dist/agents/skills/gemini-cli/harness-accessibility/SKILL.md +7 -0
- package/dist/agents/skills/gemini-cli/harness-architecture-advisor/SKILL.md +397 -0
- package/dist/agents/skills/gemini-cli/harness-architecture-advisor/skill.yaml +48 -0
- package/dist/agents/skills/gemini-cli/harness-autopilot/SKILL.md +11 -3
- package/dist/agents/skills/gemini-cli/harness-brainstorming/SKILL.md +317 -0
- package/dist/agents/skills/gemini-cli/harness-brainstorming/skill.yaml +49 -0
- package/dist/agents/skills/gemini-cli/harness-code-review/SKILL.md +681 -0
- package/dist/agents/skills/gemini-cli/harness-code-review/skill.yaml +45 -0
- package/dist/agents/skills/gemini-cli/harness-codebase-cleanup/SKILL.md +226 -0
- package/dist/agents/skills/gemini-cli/harness-codebase-cleanup/skill.yaml +64 -0
- package/dist/agents/skills/gemini-cli/harness-debugging/SKILL.md +366 -0
- package/dist/agents/skills/gemini-cli/harness-debugging/skill.yaml +47 -0
- package/dist/agents/skills/gemini-cli/harness-dependency-health/SKILL.md +35 -6
- package/dist/agents/skills/gemini-cli/harness-diagnostics/SKILL.md +318 -0
- package/dist/agents/skills/gemini-cli/harness-diagnostics/skill.yaml +50 -0
- package/dist/agents/skills/gemini-cli/harness-docs-pipeline/SKILL.md +460 -0
- package/dist/agents/skills/gemini-cli/harness-docs-pipeline/skill.yaml +69 -0
- package/dist/agents/skills/gemini-cli/harness-execution/SKILL.md +382 -0
- package/dist/agents/skills/gemini-cli/harness-execution/skill.yaml +51 -0
- package/dist/agents/skills/gemini-cli/harness-git-workflow/SKILL.md +268 -0
- package/dist/agents/skills/gemini-cli/harness-git-workflow/skill.yaml +31 -0
- package/dist/agents/skills/gemini-cli/harness-hotspot-detector/SKILL.md +32 -6
- package/dist/agents/skills/gemini-cli/harness-i18n/SKILL.md +484 -0
- package/dist/agents/skills/gemini-cli/harness-i18n/skill.yaml +54 -0
- package/dist/agents/skills/gemini-cli/harness-i18n-process/SKILL.md +388 -0
- package/dist/agents/skills/gemini-cli/harness-i18n-process/skill.yaml +43 -0
- package/dist/agents/skills/gemini-cli/harness-i18n-workflow/SKILL.md +512 -0
- package/dist/agents/skills/gemini-cli/harness-i18n-workflow/skill.yaml +53 -0
- package/dist/agents/skills/gemini-cli/harness-impact-analysis/SKILL.md +35 -6
- package/dist/agents/skills/gemini-cli/harness-integrity/SKILL.md +167 -0
- package/dist/agents/skills/gemini-cli/harness-integrity/skill.yaml +47 -0
- package/dist/agents/skills/gemini-cli/harness-knowledge-mapper/SKILL.md +46 -5
- package/dist/agents/skills/gemini-cli/harness-onboarding/SKILL.md +288 -0
- package/dist/agents/skills/gemini-cli/harness-onboarding/skill.yaml +30 -0
- package/dist/agents/skills/gemini-cli/harness-parallel-agents/SKILL.md +171 -0
- package/dist/agents/skills/gemini-cli/harness-parallel-agents/skill.yaml +33 -0
- package/dist/agents/skills/gemini-cli/harness-perf/SKILL.md +37 -8
- package/dist/agents/skills/gemini-cli/harness-perf/skill.yaml +3 -0
- package/dist/agents/skills/gemini-cli/harness-perf-tdd/SKILL.md +17 -4
- package/dist/agents/skills/gemini-cli/harness-planning/SKILL.md +389 -0
- package/dist/agents/skills/gemini-cli/harness-planning/skill.yaml +49 -0
- package/dist/agents/skills/gemini-cli/harness-pre-commit-review/SKILL.md +262 -0
- package/dist/agents/skills/gemini-cli/harness-pre-commit-review/skill.yaml +33 -0
- package/dist/agents/skills/gemini-cli/harness-refactoring/SKILL.md +169 -0
- package/dist/agents/skills/gemini-cli/harness-refactoring/skill.yaml +33 -0
- package/dist/agents/skills/gemini-cli/harness-release-readiness/SKILL.md +16 -0
- package/dist/agents/skills/gemini-cli/harness-roadmap/SKILL.md +561 -0
- package/dist/agents/skills/gemini-cli/harness-roadmap/skill.yaml +43 -0
- package/dist/agents/skills/gemini-cli/harness-security-review/skill.yaml +8 -6
- package/dist/agents/skills/gemini-cli/harness-skill-authoring/SKILL.md +292 -0
- package/dist/agents/skills/gemini-cli/harness-skill-authoring/skill.yaml +32 -0
- package/dist/agents/skills/gemini-cli/harness-soundness-review/SKILL.md +1267 -0
- package/dist/agents/skills/gemini-cli/harness-soundness-review/skill.yaml +48 -0
- package/dist/agents/skills/gemini-cli/harness-state-management/SKILL.md +309 -0
- package/dist/agents/skills/gemini-cli/harness-state-management/skill.yaml +32 -0
- package/dist/agents/skills/gemini-cli/harness-tdd/SKILL.md +177 -0
- package/dist/agents/skills/gemini-cli/harness-tdd/skill.yaml +48 -0
- package/dist/agents/skills/gemini-cli/harness-test-advisor/SKILL.md +35 -6
- package/dist/agents/skills/gemini-cli/harness-verification/SKILL.md +328 -0
- package/dist/agents/skills/gemini-cli/harness-verification/skill.yaml +42 -0
- package/dist/agents/skills/gemini-cli/harness-verify/SKILL.md +159 -0
- package/dist/agents/skills/gemini-cli/harness-verify/skill.yaml +40 -0
- package/dist/agents/skills/gemini-cli/initialize-harness-project/SKILL.md +224 -0
- package/dist/agents/skills/gemini-cli/initialize-harness-project/skill.yaml +31 -0
- package/dist/agents/skills/gemini-cli/validate-context-engineering/SKILL.md +150 -0
- package/dist/agents/skills/gemini-cli/validate-context-engineering/skill.yaml +31 -0
- package/dist/agents/skills/shared/i18n-knowledge/accessibility/intersection.yaml +142 -0
- package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/encoding.yaml +67 -0
- package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/formatting.yaml +106 -0
- package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/layout.yaml +80 -0
- package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/pluralization.yaml +80 -0
- package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/string-handling.yaml +106 -0
- package/dist/agents/skills/shared/i18n-knowledge/frameworks/android-resources.yaml +47 -0
- package/dist/agents/skills/shared/i18n-knowledge/frameworks/apple-strings.yaml +47 -0
- package/dist/agents/skills/shared/i18n-knowledge/frameworks/backend-patterns.yaml +50 -0
- package/dist/agents/skills/shared/i18n-knowledge/frameworks/flutter-intl.yaml +47 -0
- package/dist/agents/skills/shared/i18n-knowledge/frameworks/i18next.yaml +47 -0
- package/dist/agents/skills/shared/i18n-knowledge/frameworks/react-intl.yaml +47 -0
- package/dist/agents/skills/shared/i18n-knowledge/frameworks/vue-i18n.yaml +47 -0
- package/dist/agents/skills/shared/i18n-knowledge/industries/ecommerce.yaml +66 -0
- package/dist/agents/skills/shared/i18n-knowledge/industries/fintech.yaml +66 -0
- package/dist/agents/skills/shared/i18n-knowledge/industries/gaming.yaml +69 -0
- package/dist/agents/skills/shared/i18n-knowledge/industries/healthcare.yaml +66 -0
- package/dist/agents/skills/shared/i18n-knowledge/industries/legal.yaml +66 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/ar.yaml +41 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/de.yaml +35 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/en.yaml +32 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/es.yaml +35 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/fi.yaml +35 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/fr.yaml +35 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/he.yaml +41 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/hi.yaml +35 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/it.yaml +32 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/ja.yaml +38 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/ko.yaml +38 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/nl.yaml +32 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/pl.yaml +35 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/pt.yaml +32 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/ru.yaml +35 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/sv.yaml +32 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/th.yaml +35 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/tr.yaml +35 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/zh-Hans.yaml +38 -0
- package/dist/agents/skills/shared/i18n-knowledge/locales/zh-Hant.yaml +35 -0
- package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/i18next-mcp.yaml +56 -0
- package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/lingo-dev.yaml +56 -0
- package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/lokalise.yaml +60 -0
- package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/tolgee.yaml +60 -0
- package/dist/agents/skills/shared/i18n-knowledge/testing/locale-testing.yaml +107 -0
- package/dist/agents/skills/shared/i18n-knowledge/testing/pseudo-localization.yaml +86 -0
- package/dist/bin/harness.js +64 -4
- package/dist/{chunk-GA6GN5J2.js → chunk-E2RTDBMG.js} +2263 -41
- package/dist/{chunk-FFIX3QVG.js → chunk-KJANDVVC.js} +141 -49
- package/dist/{chunk-4WUGOJQ7.js → chunk-RT2LYQHF.js} +1 -1
- package/dist/{dist-C4J67MPP.js → dist-CCM3L3UE.js} +95 -1
- package/dist/{dist-N4D4QWFV.js → dist-K6KTTN3I.js} +4 -4
- package/dist/index.d.ts +187 -7
- package/dist/index.js +7 -3
- package/dist/validate-cross-check-ZGKFQY57.js +7 -0
- package/package.json +9 -9
- package/dist/agents/skills/node_modules/.bin/glob +0 -17
- package/dist/agents/skills/node_modules/.bin/vitest +0 -17
- package/dist/agents/skills/node_modules/.bin/yaml +0 -17
- package/dist/templates/advanced/docs/specs/.gitkeep +0 -0
- package/dist/templates/intermediate/docs/specs/.gitkeep +0 -0
- package/dist/validate-cross-check-WGXQ7K62.js +0 -7
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Harness Parallel Agents
|
|
2
|
+
|
|
3
|
+
> Dispatch independent tasks to concurrent agents, integrate results, and verify no conflicts. Only for truly independent problems.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- When 3 or more tasks are truly independent (no shared state, no shared files, different subsystems)
|
|
8
|
+
- When tasks involve investigation or implementation in separate parts of the codebase
|
|
9
|
+
- When parallel execution would meaningfully reduce wall-clock time
|
|
10
|
+
- When a plan has tasks explicitly marked as parallelizable
|
|
11
|
+
- NOT when failures across tasks might be related (investigate serially to find the common cause)
|
|
12
|
+
- NOT when tasks need full system understanding to complete correctly
|
|
13
|
+
- NOT when agents would modify the same files or shared state
|
|
14
|
+
- NOT when there are fewer than 3 independent tasks (overhead of coordination outweighs parallelism)
|
|
15
|
+
- NOT when the tasks are sequential by nature (each depends on the previous)
|
|
16
|
+
|
|
17
|
+
## Process
|
|
18
|
+
|
|
19
|
+
### Step 1: Identify Independent Problem Domains
|
|
20
|
+
|
|
21
|
+
Before dispatching anything in parallel, rigorously verify independence:
|
|
22
|
+
|
|
23
|
+
1. **List the candidate tasks.** Pull from the plan, or identify from the current work.
|
|
24
|
+
|
|
25
|
+
2. **Check file overlap.** For each pair of tasks, compare the files they will read and write. Any overlap in WRITE targets means they are NOT independent. Overlap in READ targets is acceptable only if neither task writes to those files.
|
|
26
|
+
|
|
27
|
+
3. **Check state overlap.** Do any tasks share database tables, configuration files, environment variables, or in-memory state? If yes, they are NOT independent.
|
|
28
|
+
|
|
29
|
+
4. **Check import graph overlap.** If Task A modifies module X and Task B imports module X, they are NOT independent — Task B's tests may be affected by Task A's changes.
|
|
30
|
+
|
|
31
|
+
5. **When in doubt, run serially.** The cost of a false parallel dispatch (merge conflicts, subtle bugs, wasted work) far exceeds the cost of running serially.
|
|
32
|
+
|
|
33
|
+
### Graph-Enhanced Context (when available)
|
|
34
|
+
|
|
35
|
+
When a knowledge graph exists at `.harness/graph/`, use graph queries for faster, more accurate independence verification:
|
|
36
|
+
|
|
37
|
+
- `query_graph` — get the dependency subgraph per candidate task and check for node overlap between tasks
|
|
38
|
+
- `get_impact` — verify tasks do not write to overlapping files or share transitive dependencies
|
|
39
|
+
|
|
40
|
+
Automated graph-based independence verification replaces manual import grep and catches transitive overlaps that file-level checks miss. Fall back to file-based commands if no graph is available.
|
|
41
|
+
|
|
42
|
+
### Step 2: Create Focused Agent Tasks
|
|
43
|
+
|
|
44
|
+
For each independent task, write a focused agent brief:
|
|
45
|
+
|
|
46
|
+
1. **Scope.** Exactly what files and directories this agent may touch. Be explicit about boundaries — the agent should not explore outside its scope.
|
|
47
|
+
|
|
48
|
+
2. **Goal.** One sentence: what is the observable outcome when this agent is done?
|
|
49
|
+
|
|
50
|
+
3. **Constraints.** What the agent must NOT do:
|
|
51
|
+
- Do not modify files outside your scope
|
|
52
|
+
- Do not install new dependencies without approval
|
|
53
|
+
- Do not change shared configuration
|
|
54
|
+
- Run `harness validate` before your final commit
|
|
55
|
+
|
|
56
|
+
4. **Expected output.** What the agent should produce:
|
|
57
|
+
- Commit(s) on the current branch
|
|
58
|
+
- Test results (all pass)
|
|
59
|
+
- Summary of what was done and any surprises
|
|
60
|
+
|
|
61
|
+
5. **Context.** Give each agent the minimum context it needs. Include relevant file paths, type definitions it will use, and API contracts it must respect. Do not dump the entire codebase context — focused agents work better with focused context.
|
|
62
|
+
|
|
63
|
+
### Step 3: Dispatch Concurrently
|
|
64
|
+
|
|
65
|
+
1. **Launch agents in parallel.** Use subagent dispatch (TaskCreate or platform-specific parallel execution).
|
|
66
|
+
|
|
67
|
+
2. **Do not intervene while agents are running** unless one reports a blocker. Let them complete independently.
|
|
68
|
+
|
|
69
|
+
3. **Collect results.** Wait for all agents to finish. Gather their outputs: commits, test results, and summaries.
|
|
70
|
+
|
|
71
|
+
### Step 4: Integrate Results
|
|
72
|
+
|
|
73
|
+
1. **Check for conflicts.** Even with verified independence, unexpected conflicts can occur:
|
|
74
|
+
- Git merge conflicts in any file
|
|
75
|
+
- Two agents added the same import or export
|
|
76
|
+
- Test names collide
|
|
77
|
+
- Shared configuration was modified despite constraints
|
|
78
|
+
|
|
79
|
+
2. **If conflicts exist, resolve them manually.** Do not ask an agent to fix conflicts it does not have full context for. You have the full picture; the agents did not.
|
|
80
|
+
|
|
81
|
+
3. **Run the FULL test suite.** Not just each agent's tests — the complete project test suite. Parallel changes can cause integration failures that individual test runs miss.
|
|
82
|
+
|
|
83
|
+
4. **Run `harness validate`.** Verify project-wide health after integration.
|
|
84
|
+
|
|
85
|
+
5. **If integration fails,** identify which agent's changes caused the failure. Revert that agent's commits, fix the issue serially, and re-integrate.
|
|
86
|
+
|
|
87
|
+
### Step 5: Verify and Commit
|
|
88
|
+
|
|
89
|
+
1. **Verify all observable truths** from the plan are satisfied after integration.
|
|
90
|
+
|
|
91
|
+
2. **If all tests pass and harness validates,** the parallel execution is complete.
|
|
92
|
+
|
|
93
|
+
3. **Write a summary** of what was parallelized, what each agent produced, and any integration issues that were resolved.
|
|
94
|
+
|
|
95
|
+
## Harness Integration
|
|
96
|
+
|
|
97
|
+
- **`harness validate`** — Each agent runs this before its final commit. Run again after integration.
|
|
98
|
+
- **`harness check-deps`** — Run after integration to verify no cross-boundary violations were introduced by the combined changes.
|
|
99
|
+
- **Agent dispatch** — Use platform-specific parallel execution (e.g., Claude Code subagents via TaskCreate, or separate terminal sessions).
|
|
100
|
+
- **Test runner** — Full suite must run after integration, not just individual agent tests.
|
|
101
|
+
|
|
102
|
+
## Success Criteria
|
|
103
|
+
|
|
104
|
+
- Independence was verified before dispatch (file overlap, state overlap, import graph)
|
|
105
|
+
- Each agent had a focused brief with explicit scope, goal, constraints, and expected output
|
|
106
|
+
- All agents completed successfully (or blockers were reported)
|
|
107
|
+
- Integration produced no merge conflicts (or conflicts were resolved)
|
|
108
|
+
- Full test suite passes after integration
|
|
109
|
+
- `harness validate` passes after integration
|
|
110
|
+
- No agent modified files outside its declared scope
|
|
111
|
+
|
|
112
|
+
## Examples
|
|
113
|
+
|
|
114
|
+
### Example: Parallel Implementation of Three Independent Services
|
|
115
|
+
|
|
116
|
+
**Context:** Plan has Tasks 4, 5, and 6 which implement UserService, ProductService, and NotificationService. Each service is in its own directory, has its own types, and has no cross-service dependencies.
|
|
117
|
+
|
|
118
|
+
**Step 1: Verify independence**
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
Task 4 (UserService): writes src/services/user/*, reads src/types/user.ts
|
|
122
|
+
Task 5 (ProductService): writes src/services/product/*, reads src/types/product.ts
|
|
123
|
+
Task 6 (NotificationService): writes src/services/notification/*, reads src/types/notification.ts
|
|
124
|
+
|
|
125
|
+
File overlap: NONE (different directories, different type files)
|
|
126
|
+
State overlap: NONE (different DB tables, no shared config)
|
|
127
|
+
Import graph: NONE (no cross-service imports)
|
|
128
|
+
Verdict: INDEPENDENT — safe to parallelize
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Step 2: Create agent briefs**
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
Agent A — UserService:
|
|
135
|
+
Scope: src/services/user/, src/services/user.test.ts
|
|
136
|
+
Goal: UserService with CRUD operations, all tests passing
|
|
137
|
+
Constraints: Do not modify files outside src/services/user/. Run harness validate.
|
|
138
|
+
Context: User type definition in src/types/user.ts, DB helper in src/utils/db.ts
|
|
139
|
+
|
|
140
|
+
Agent B — ProductService:
|
|
141
|
+
Scope: src/services/product/, src/services/product.test.ts
|
|
142
|
+
Goal: ProductService with CRUD operations, all tests passing
|
|
143
|
+
Constraints: Do not modify files outside src/services/product/. Run harness validate.
|
|
144
|
+
Context: Product type definition in src/types/product.ts, DB helper in src/utils/db.ts
|
|
145
|
+
|
|
146
|
+
Agent C — NotificationService:
|
|
147
|
+
Scope: src/services/notification/, src/services/notification.test.ts
|
|
148
|
+
Goal: NotificationService with create and list, all tests passing
|
|
149
|
+
Constraints: Do not modify files outside src/services/notification/. Run harness validate.
|
|
150
|
+
Context: Notification type in src/types/notification.ts, email utility in src/utils/email.ts
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Step 3-4: Dispatch, integrate**
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
All 3 agents complete. No merge conflicts.
|
|
157
|
+
Run full test suite: 34 tests, all pass.
|
|
158
|
+
Run harness validate: passes.
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Example: When NOT to Parallelize
|
|
162
|
+
|
|
163
|
+
**Situation:** Tasks 7 and 8 both modify `src/api/routes/index.ts` to add new route handlers.
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
Task 7: writes src/api/routes/users.ts, MODIFIES src/api/routes/index.ts
|
|
167
|
+
Task 8: writes src/api/routes/products.ts, MODIFIES src/api/routes/index.ts
|
|
168
|
+
|
|
169
|
+
File overlap: BOTH WRITE to src/api/routes/index.ts
|
|
170
|
+
Verdict: NOT INDEPENDENT — run serially
|
|
171
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: harness-parallel-agents
|
|
2
|
+
version: "1.0.0"
|
|
3
|
+
description: Coordinate multiple agents working in parallel on a harness project
|
|
4
|
+
cognitive_mode: constructive-architect
|
|
5
|
+
triggers:
|
|
6
|
+
- manual
|
|
7
|
+
- on_new_feature
|
|
8
|
+
platforms:
|
|
9
|
+
- claude-code
|
|
10
|
+
- gemini-cli
|
|
11
|
+
tools:
|
|
12
|
+
- Bash
|
|
13
|
+
- Read
|
|
14
|
+
- Write
|
|
15
|
+
- Edit
|
|
16
|
+
- Glob
|
|
17
|
+
- Grep
|
|
18
|
+
cli:
|
|
19
|
+
command: harness skill run harness-parallel-agents
|
|
20
|
+
args:
|
|
21
|
+
- name: path
|
|
22
|
+
description: Project root path
|
|
23
|
+
required: false
|
|
24
|
+
mcp:
|
|
25
|
+
tool: run_skill
|
|
26
|
+
input:
|
|
27
|
+
skill: harness-parallel-agents
|
|
28
|
+
path: string
|
|
29
|
+
type: flexible
|
|
30
|
+
state:
|
|
31
|
+
persistent: false
|
|
32
|
+
files: []
|
|
33
|
+
depends_on: []
|
|
@@ -45,34 +45,62 @@ Tier 1 violations are non-negotiable blockers. If a Tier 1 violation is detected
|
|
|
45
45
|
|
|
46
46
|
---
|
|
47
47
|
|
|
48
|
+
### Graph Availability
|
|
49
|
+
|
|
50
|
+
Hotspot scoring and coupling analysis benefit from the knowledge graph but work without it.
|
|
51
|
+
|
|
52
|
+
**Staleness sensitivity:** Medium -- auto-refresh if >10 commits stale. Hotspot scoring uses churn data which does not change rapidly.
|
|
53
|
+
|
|
54
|
+
| Feature | With Graph | Without Graph |
|
|
55
|
+
| ------------------------------------ | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
56
|
+
| Hotspot scoring (churn x complexity) | `GraphComplexityAdapter` computes from graph nodes | `git log --format="%H" -- <file>` for per-file commit count; complexity from `check-perf --structural` output; multiply manually |
|
|
57
|
+
| Coupling ratio | `GraphCouplingAdapter` computes from graph edges | Parse import statements, count fan-out/fan-in per file |
|
|
58
|
+
| Critical path resolution | Graph inference (high fan-in) + `@perf-critical` annotations | `@perf-critical` annotations only; grep for decorator/comment |
|
|
59
|
+
| Transitive dep depth | Graph BFS depth | Import chain follow, 2 levels deep |
|
|
60
|
+
|
|
61
|
+
**Notice when running without graph:** "Running without graph (run `harness scan` to enable hotspot scoring and coupling analysis)"
|
|
62
|
+
|
|
63
|
+
**Impact on tiers:** Without graph, Tier 1 hotspot detection is degraded. Hotspot scoring falls back to churn-only (no complexity multiplication). This limitation is documented in the performance report output.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
48
67
|
### Phase 2: BENCHMARK — Runtime Performance
|
|
49
68
|
|
|
50
69
|
This phase runs only when `.bench.ts` files exist in the project. If none are found, skip to Phase 3.
|
|
51
70
|
|
|
52
|
-
1. **Check
|
|
71
|
+
1. **Check baseline lock-in.** Before running benchmarks, verify baselines are kept in sync:
|
|
72
|
+
- List all `.bench.ts` files changed in this PR: `git diff --name-only | grep '.bench.ts'`
|
|
73
|
+
- If any `.bench.ts` files are new or modified:
|
|
74
|
+
- Check if `.harness/perf/baselines.json` is also modified in this PR
|
|
75
|
+
- If NOT modified: flag as Tier 2 warning: "Benchmark files changed but baselines not updated. Run `harness perf baselines update` and commit the result."
|
|
76
|
+
- If modified: verify the updated baselines include entries for all changed benchmarks
|
|
77
|
+
- If no `.bench.ts` files changed: skip this check
|
|
78
|
+
- This check also runs standalone via `--check-baselines` flag
|
|
79
|
+
|
|
80
|
+
2. **Check for benchmark files.** Scan the project for `*.bench.ts` files. If none exist, skip this phase entirely.
|
|
53
81
|
|
|
54
|
-
|
|
82
|
+
3. **Verify clean working tree.** Run `git status --porcelain`. If there are uncommitted changes, STOP. Benchmarks on dirty trees produce unreliable results.
|
|
55
83
|
|
|
56
|
-
|
|
84
|
+
4. **Run benchmarks.** Execute `harness perf bench` to run all benchmark suites.
|
|
57
85
|
|
|
58
|
-
|
|
86
|
+
5. **Load baselines.** Read `.harness/perf/baselines.json` for previous benchmark results. If no baselines exist, treat this as a baseline-capture run.
|
|
59
87
|
|
|
60
|
-
|
|
88
|
+
6. **Compare results against baselines** using the `RegressionDetector`:
|
|
61
89
|
- Calculate percentage change for each benchmark
|
|
62
90
|
- Apply noise margin (default: 3%) before flagging regressions
|
|
63
91
|
- Distinguish between critical-path and non-critical-path benchmarks
|
|
64
92
|
|
|
65
|
-
|
|
93
|
+
7. **Resolve critical paths** via `CriticalPathResolver`:
|
|
66
94
|
- Check `@perf-critical` annotations in source files
|
|
67
95
|
- Check graph fan-in data (functions called by many consumers)
|
|
68
96
|
- Functions in the critical path set have stricter thresholds
|
|
69
97
|
|
|
70
|
-
|
|
98
|
+
8. **Flag regressions by tier:**
|
|
71
99
|
- **Tier 1:** >5% regression on a critical path benchmark
|
|
72
100
|
- **Tier 2:** >10% regression on a non-critical-path benchmark
|
|
73
101
|
- **Tier 3:** >5% regression on a non-critical-path benchmark (within noise margin consideration)
|
|
74
102
|
|
|
75
|
-
|
|
103
|
+
9. **If this is a baseline-capture run,** report results without regression comparison. Recommend running `harness perf baselines update` to persist.
|
|
76
104
|
|
|
77
105
|
---
|
|
78
106
|
|
|
@@ -138,6 +166,7 @@ This phase runs only when `.bench.ts` files exist in the project. If none are fo
|
|
|
138
166
|
- **`harness perf bench`** — Run benchmarks only. Requires clean working tree.
|
|
139
167
|
- **`harness perf baselines show`** — View current benchmark baselines.
|
|
140
168
|
- **`harness perf baselines update`** — Persist current benchmark results as new baselines.
|
|
169
|
+
- **`harness perf --check-baselines`** -- Verify baseline file is updated when benchmarks change. Runs the baseline lock-in check standalone.
|
|
141
170
|
- **`harness perf critical-paths`** — View the current critical path set and how it was determined.
|
|
142
171
|
- **`harness validate`** — Run after enforcement to verify overall project health.
|
|
143
172
|
- **`harness graph scan`** — Refresh knowledge graph for accurate hotspot scoring.
|
|
@@ -60,10 +60,23 @@ If you find yourself writing production code before both the test and the benchm
|
|
|
60
60
|
|
|
61
61
|
2. **Run the test** — observe pass. If it fails, fix the implementation until it passes.
|
|
62
62
|
|
|
63
|
-
3. **Run the benchmark**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
63
|
+
3. **Run the benchmark** -- capture initial results and apply thresholds:
|
|
64
|
+
|
|
65
|
+
**When the spec defines a performance requirement** (e.g., "< 50ms"):
|
|
66
|
+
- Use the spec requirement as the benchmark assertion threshold
|
|
67
|
+
- Verify it passes; if not, see step 4
|
|
68
|
+
|
|
69
|
+
**When the spec is vague or silent on performance:**
|
|
70
|
+
- Fall back to harness-perf tier thresholds:
|
|
71
|
+
- Critical path functions (annotated `@perf-critical` or high fan-in): must not regress >5% from baseline (Tier 1)
|
|
72
|
+
- Non-critical functions: must not regress >10% from baseline (Tier 2)
|
|
73
|
+
- Structural complexity: must stay under Tier 2 thresholds (cyclomatic <=15, nesting <=4, function length <=50 lines, params <=5)
|
|
74
|
+
- These thresholds give developers concrete targets even when the spec does not specify performance requirements
|
|
75
|
+
|
|
76
|
+
**When no baseline exists (new code):**
|
|
77
|
+
- This run captures the initial baseline
|
|
78
|
+
- No regression comparison on first run
|
|
79
|
+
- VALIDATE phase (Phase 4) ensures the captured baseline is committed via `harness perf baselines update`
|
|
67
80
|
|
|
68
81
|
4. **If the performance assertion fails,** you have two options:
|
|
69
82
|
- The implementation approach is fundamentally wrong (e.g., O(n^2) when O(n) is needed) — revise the algorithm
|