@harness-engineering/cli 2.1.0 → 2.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/initialize-harness-project/SKILL.md +168 -13
- package/dist/agents/skills/codex/initialize-harness-project/SKILL.md +168 -13
- package/dist/agents/skills/cursor/initialize-harness-project/SKILL.md +168 -13
- package/dist/agents/skills/gemini-cli/initialize-harness-project/SKILL.md +168 -13
- package/dist/{agents-md-XCAWON2D.js → agents-md-L4X4MOWT.js} +2 -2
- package/dist/{architecture-KERHEEQZ.js → architecture-WJRIYQ45.js} +3 -3
- package/dist/{assess-project-NPYA3UVI.js → assess-project-PHC2HO3V.js} +1 -1
- package/dist/bin/harness-mcp.js +13 -13
- package/dist/bin/harness.js +22 -22
- package/dist/{check-phase-gate-GE5ALEEU.js → check-phase-gate-646KY67H.js} +3 -3
- package/dist/{chunk-IIX5OJES.js → chunk-224XKVLP.js} +1 -1
- package/dist/{chunk-UWIOBHZL.js → chunk-2QPHCR22.js} +5 -5
- package/dist/{chunk-URLDPALI.js → chunk-2ZURBWEV.js} +3 -3
- package/dist/{chunk-EFA4OEEN.js → chunk-36X7TRUI.js} +2 -2
- package/dist/{chunk-HBQ3BK2E.js → chunk-4HKVZO7R.js} +1 -1
- package/dist/{chunk-OXFFN3FD.js → chunk-CPYL6LJR.js} +1 -1
- package/dist/{chunk-WW6AUOA3.js → chunk-E7W3YOXL.js} +2 -2
- package/dist/{chunk-FQAJAM54.js → chunk-GOOTYTTV.js} +71 -29
- package/dist/{chunk-D5FE4L2O.js → chunk-JPWICLXQ.js} +1 -1
- package/dist/{chunk-MAFI6UWT.js → chunk-K4WRQTEF.js} +137 -39
- package/dist/{chunk-M4C3ZIGL.js → chunk-KV7A5OZT.js} +3 -3
- package/dist/{chunk-T7MNLCUD.js → chunk-L2IDE7WS.js} +122 -76
- package/dist/{chunk-4FVHBBPY.js → chunk-LO7ZLV7S.js} +1 -1
- package/dist/{chunk-GCYGGQFM.js → chunk-OJMO4JBQ.js} +61 -6
- package/dist/{chunk-PCX4GPNT.js → chunk-QTUPHTTK.js} +1 -1
- package/dist/{chunk-AEFZJ543.js → chunk-TNZYQTEE.js} +1 -1
- package/dist/{chunk-DRD7LLFC.js → chunk-VJQLUS5I.js} +1 -1
- package/dist/{chunk-LY2TY6NE.js → chunk-VKDBM3RX.js} +3 -3
- package/dist/{chunk-FBQYKH7R.js → chunk-W4AFGFFB.js} +2 -2
- package/dist/{chunk-YBGVZQQE.js → chunk-YLOAQZLA.js} +2 -2
- package/dist/{chunk-GHPWBWUW.js → chunk-YLTRFZAT.js} +6 -6
- package/dist/{chunk-RCHXBL2M.js → chunk-YWD6WXXM.js} +6 -6
- package/dist/{ci-workflow-A2E2RTOP.js → ci-workflow-TOS5X527.js} +2 -2
- package/dist/{dist-K22DQUYY.js → dist-6RT2AVYU.js} +1 -1
- package/dist/{docs-GXJOFVCF.js → docs-HOJMQYDZ.js} +3 -3
- package/dist/{engine-JBUIA2XO.js → engine-D6UYH6DB.js} +2 -2
- package/dist/{entropy-Y7LUT4BZ.js → entropy-LZ4IDGZR.js} +2 -2
- package/dist/{feedback-BHOBVKI3.js → feedback-WV7EQVK7.js} +1 -1
- package/dist/{generate-agent-definitions-VL3ZVR32.js → generate-agent-definitions-GFNXJCBY.js} +3 -3
- package/dist/index.d.ts +17 -8
- package/dist/index.js +22 -22
- package/dist/{loader-WCKVMDYR.js → loader-Z23JTXIZ.js} +2 -2
- package/dist/{mcp-FA2CKHFY.js → mcp-JDJGELGD.js} +13 -13
- package/dist/{performance-NISUL5AA.js → performance-7ATLHTQU.js} +3 -3
- package/dist/{review-pipeline-CHE5LJ5D.js → review-pipeline-COBGGXHJ.js} +2 -2
- package/dist/{runtime-3SKKEVPF.js → runtime-KCBNQUXK.js} +2 -2
- package/dist/{security-MF54MY3P.js → security-MAPRIFQT.js} +1 -1
- package/dist/{validate-SIWFNTXI.js → validate-74XTQR7Q.js} +3 -3
- package/dist/{validate-cross-check-GBX7B7CQ.js → validate-cross-check-MI5MZ7MB.js} +2 -2
- package/package.json +4 -4
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
# Initialize Harness Project
|
|
2
2
|
|
|
3
|
-
> Scaffold a new harness-compliant project
|
|
3
|
+
> Scaffold a new harness-compliant project, migrate an existing project to the next adoption level, or bootstrap an existing project that just got the harness marketplace plugin installed (no `harness setup`). Assess current state, scaffold or migrate, configure, validate, instrument (baselines / telemetry / Tier-0 integrations), and finalize.
|
|
4
4
|
|
|
5
5
|
## When to Use
|
|
6
6
|
|
|
7
7
|
- Starting a brand new project that should be harness-managed from day one
|
|
8
8
|
- Migrating an existing project to harness for the first time
|
|
9
9
|
- Upgrading an existing harness project from one adoption level to the next (basic to intermediate, intermediate to advanced)
|
|
10
|
+
- **Bootstrapping a project for plugin-only users:** the marketplace plugin is installed but `harness setup` was never run, so `harness.config.json`, baselines, telemetry identity, and Tier-0 MCP integrations are missing
|
|
11
|
+
- Refreshing instrumentation on an existing harness project (re-baselining after large changes, migrating legacy layouts, picking up new Tier-0 integrations)
|
|
10
12
|
- When `on_project_init` triggers fire
|
|
11
|
-
- NOT when the project is already at the desired adoption level (use harness-onboarding to orient instead)
|
|
13
|
+
- NOT when the project is already at the desired adoption level AND fully instrumented (use harness-onboarding to orient instead)
|
|
12
14
|
- NOT when adding a single component to an existing harness project (use add-harness-component)
|
|
13
15
|
- NOT when the project has no clear owner or maintainer — harness setup requires someone to own the constraints
|
|
14
16
|
|
|
17
|
+
## Plugin-only callout
|
|
18
|
+
|
|
19
|
+
If the user installed only the `harness-claude` (or sibling `harness-cursor`/`harness-gemini`/`harness-codex`) marketplace plugin, no `harness` shell binary is in their PATH. Prefix every CLI invocation in this skill with `npx @harness-engineering/cli`:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# instead of: harness validate
|
|
23
|
+
npx @harness-engineering/cli validate
|
|
24
|
+
# instead of: harness check-arch --update-baseline
|
|
25
|
+
npx @harness-engineering/cli check-arch --update-baseline
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Detect plugin-only state by checking whether `harness` resolves on PATH (`command -v harness`). If not, use the `npx` form. First call is slow; subsequent calls within ~24h hit the npx cache.
|
|
29
|
+
|
|
15
30
|
## Process
|
|
16
31
|
|
|
17
32
|
### Phase 1: ASSESS — Determine Current State
|
|
@@ -140,17 +155,71 @@
|
|
|
140
155
|
|
|
141
156
|
3. **Run `harness check-deps`** (intermediate and above) to verify dependency constraints match the actual codebase. If there are violations, decide with the human: update the constraints or fix the code.
|
|
142
157
|
|
|
143
|
-
###
|
|
158
|
+
### Phase 5: INSTRUMENT — Capture Baselines and Wire Integrations
|
|
144
159
|
|
|
145
|
-
|
|
160
|
+
This phase closes the parity gap that the marketplace plugin install does not cover: knowledge graph, architecture/perf baselines, telemetry identity, legacy-layout migrations, and Tier-0 MCP integrations. For npm + `harness setup` users most of this was already wired during setup; the steps are still safe to re-run idempotently.
|
|
146
161
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
```
|
|
162
|
+
1. **Build the initial knowledge graph.** Required for graph-based MCP tools (`get_impact`, `find_context_for`, `compute_blast_radius`, `detect_anomalies`):
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
harness scan
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Populates `.harness/graph/` with dependency and relationship data. Skip only if the project explicitly disables graph use in `harness.config.json`.
|
|
169
|
+
|
|
170
|
+
2. **Capture the architecture baseline.** Records the current layer-violation, circular-dep, and complexity counts so future runs of `harness check-arch` can detect regressions:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
harness check-arch --update-baseline
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Writes `.harness/arch/baselines.json`. Re-run after large refactors. CI (`refresh-baselines` job in `.github/workflows/ci.yml` on this repo) auto-refreshes on `main` for harness-developing projects; downstream projects do this manually here.
|
|
177
|
+
|
|
178
|
+
3. **Capture the performance baseline** (intermediate and above, or any project that wants regression detection on coupling and size budgets):
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
harness check-perf
|
|
182
|
+
```
|
|
150
183
|
|
|
151
|
-
|
|
184
|
+
First invocation captures the baseline; subsequent runs compare against it. Updates can be applied via the `update_perf_baselines` MCP tool when the human confirms a regression is intentional.
|
|
152
185
|
|
|
153
|
-
4. **
|
|
186
|
+
4. **Configure telemetry identity** (optional but recommended for teams). Anonymous telemetry is default-enabled by the standard hook profile; identity tagging adds project/team/alias to events for filtering. Ask the human:
|
|
187
|
+
- "Tag telemetry events with project + team identity? (recommended for shared installs, optional for personal use)"
|
|
188
|
+
- If yes, run:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
harness telemetry identify --project <project-name> --team <team-name>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Writes `.harness/telemetry.json`.
|
|
195
|
+
|
|
196
|
+
- If they want to disable telemetry entirely, write `{ "telemetry": { "enabled": false }, "adoption": { "enabled": false } }` to `harness.config.json`. Or recommend the `DO_NOT_TRACK=1` env var.
|
|
197
|
+
|
|
198
|
+
5. **Surface legacy layout warnings.** If the project predates the current harness layout (`docs/plans/`, `.harness/architecture/`, etc.), the migrate command surfaces and optionally fixes them:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
harness migrate --dry-run
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
If migrations are needed, ask the human before running `harness migrate` (without `--dry-run`). Skip silently when the dry-run reports nothing.
|
|
205
|
+
|
|
206
|
+
6. **Wire Tier-0 MCP integrations.** Tier-0 is zero-config (no API keys): `context7` (live library docs), `sequential-thinking` (structured reasoning), `playwright` (browser automation). On npm + `harness setup` they're auto-wired during step 4 of setup; on plugin-only installs they are NOT, since the plugin can't mutate the user's project `.mcp.json`.
|
|
207
|
+
|
|
208
|
+
List current state, then offer to wire:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
harness integrations list
|
|
212
|
+
# then for each missing Tier-0 integration:
|
|
213
|
+
harness integrations add context7
|
|
214
|
+
harness integrations add sequential-thinking
|
|
215
|
+
harness integrations add playwright
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
For Tier-1 integrations (Linear, Slack, Perplexity, etc.), surface availability with `harness integrations list` and let the human decide — they require API keys and are out of scope for an automated bootstrap.
|
|
219
|
+
|
|
220
|
+
### Phase 6: FINALIZE — Roadmap and Commit
|
|
221
|
+
|
|
222
|
+
1. **Set up project roadmap.** Ask: "Set up a project roadmap now? `docs/roadmap.md` tracks features, milestones, and status across your specs and plans." Use `emit_interaction`:
|
|
154
223
|
|
|
155
224
|
```json
|
|
156
225
|
emit_interaction({
|
|
@@ -183,7 +252,7 @@ This creates the `.harness/graph/` directory and populates it with the project's
|
|
|
183
252
|
- **If `design.enabled === true` in `harness.config.json`** (set by Phase 3 step 5b), call `manage_roadmap` with `action: add`, `feature: "Set up design system"`, `status: "planned"`, `milestone: "Current Work"`, `summary: "Run harness-design-system to define palette, typography, and generate W3C DTCG tokens. Deferred from project init — fires on first design-touching feature via on_new_feature."`. Skip silently if `manage_roadmap show` reports a duplicate `(feature, milestone)` pair. This closes the loop between deferred design intent and visible planning work.
|
|
184
253
|
- **No:** Skip silently. The user can still run `/harness:roadmap --create` later — that informational fallback remains valid.
|
|
185
254
|
|
|
186
|
-
|
|
255
|
+
2. **Commit the initialization.** All generated, configured, and instrumentation files in a single commit. Include `harness.config.json`, `AGENTS.md`, `.harness/arch/baselines.json`, `.harness/telemetry.json` (if created), updates to project `.mcp.json` (if Tier-0 integrations were wired), and any roadmap files.
|
|
187
256
|
|
|
188
257
|
## Harness Integration
|
|
189
258
|
|
|
@@ -192,11 +261,17 @@ This creates the `.harness/graph/` directory and populates it with the project's
|
|
|
192
261
|
- **`harness persona generate`** — Generate persona definitions based on project stack and team structure.
|
|
193
262
|
- **`harness validate`** — Verify the full project configuration is valid and complete.
|
|
194
263
|
- **`harness check-deps`** — Verify dependency constraints match the actual codebase (intermediate and above).
|
|
264
|
+
- **`harness scan`** — Phase 5 step 1. Builds the initial knowledge graph at `.harness/graph/`.
|
|
265
|
+
- **`harness check-arch --update-baseline`** — Phase 5 step 2. Captures the architecture baseline at `.harness/arch/baselines.json` so future runs can detect regressions.
|
|
266
|
+
- **`harness check-perf`** — Phase 5 step 3. Runs structural complexity, coupling, and size budget checks; first invocation captures the baseline.
|
|
267
|
+
- **`harness telemetry identify --project <name> --team <name>`** — Phase 5 step 4. Tags telemetry events with identity for filtering. Writes `.harness/telemetry.json`.
|
|
268
|
+
- **`harness migrate --dry-run` / `harness migrate`** — Phase 5 step 5. Surfaces and optionally fixes legacy layouts (`docs/plans/`, `.harness/architecture/`).
|
|
269
|
+
- **`harness integrations list` / `harness integrations add <name>`** — Phase 5 step 6. Lists Tier-0 (zero-config) and Tier-1 (API-key) MCP integrations and adds them to project `.mcp.json`.
|
|
195
270
|
- **`harness-i18n-workflow configure` + `harness-i18n-workflow scaffold`** — Invoked during Phase 3 if the project will support multiple languages. Sets up i18n configuration and translation file structure.
|
|
196
271
|
- **`harness-design-system` (deferred via `on_new_feature`)** — Phase 3 step 5b records `design.enabled` + `design.platforms` in `harness.config.json` but does NOT run the full design-system skill. Token generation defers to the first design-touching feature, where `harness-design-system` fires via `on_new_feature` and reads `design.enabled` to decide whether to proceed.
|
|
197
272
|
- **`initialize-test-suite-project`** — Sub-skill. Invoked during Phase 3 step 6 when Phase 1 step 5 classified the project as a test suite. Owns archetype selection, shared-library vs in-repo decision, layer variants, tag taxonomy, reporter stack, custom report, and "prove the guards fire" verification.
|
|
198
|
-
- **`harness-roadmap` skill** — Phase
|
|
199
|
-
- **`manage_roadmap` MCP tool** — Phase
|
|
273
|
+
- **`harness-roadmap` skill** — Phase 6 step 1 invokes this skill (or `/harness:roadmap --create`) when the user opts in to creating `docs/roadmap.md`. The `manage_roadmap` MCP tool does not create roadmaps; it manages entries in an existing one.
|
|
274
|
+
- **`manage_roadmap` MCP tool** — Phase 6 step 1, when `design.enabled === true`, calls `manage_roadmap` with `action: add` to insert a `planned` "Set up design system" item under milestone `Current Work` with a summary describing the deferred work.
|
|
200
275
|
|
|
201
276
|
## Success Criteria
|
|
202
277
|
|
|
@@ -210,9 +285,11 @@ This creates the `.harness/graph/` directory and populates it with the project's
|
|
|
210
285
|
- All generated files are committed in a single atomic commit
|
|
211
286
|
- i18n configuration is set if the human chose to enable it during init
|
|
212
287
|
- For non-test-suite projects, the design-system question was asked and `harness.config.json` reflects the answer: `design.enabled: true` (with `design.platforms` populated) for yes, `design.enabled: false` for no, or absent for not-sure.
|
|
288
|
+
- **Phase 5 (INSTRUMENT) outputs:** `.harness/graph/` is populated; `.harness/arch/baselines.json` exists; `harness check-perf` ran without errors (intermediate and above); `.harness/telemetry.json` exists if the human opted into identity tagging; legacy layout warnings were surfaced via `harness migrate --dry-run` and either resolved or explicitly deferred; Tier-0 MCP integrations (context7, sequential-thinking, playwright) are present in the project's `.mcp.json` (or the human declined and that decision is recorded).
|
|
213
289
|
- The roadmap question was asked. If the user answered yes, `docs/roadmap.md` exists and was created via `harness-roadmap` (or the documented `/harness:roadmap --create` fallback).
|
|
214
290
|
- When `design.enabled === true` AND the user answered yes to the roadmap question, `docs/roadmap.md` contains a `planned` entry titled "Set up design system" under milestone `Current Work` with a summary describing the deferred work. The entry is absent in all other answer combinations.
|
|
215
291
|
- For test suites: `initialize-test-suite-project` ran to completion and its Success Criteria are also met
|
|
292
|
+
- For plugin-only invocations: every CLI invocation in this skill ran successfully via `npx @harness-engineering/cli <cmd>` without requiring a global install. If any invocation failed because the npx download failed, the human was prompted to retry or `npm install -g @harness-engineering/cli` instead.
|
|
216
293
|
|
|
217
294
|
## Rationalizations to Reject
|
|
218
295
|
|
|
@@ -222,7 +299,9 @@ This creates the `.harness/graph/` directory and populates it with the project's
|
|
|
222
299
|
| "We should start at the advanced level since we want full coverage" | The skill recommends basic for new projects. Each level builds on the previous. Jumping to advanced creates misconfigured rules. |
|
|
223
300
|
| "I will skip the i18n question to keep setup fast" | Phase 3 requires asking about i18n and recording the decision. Skipping creates ambiguity about whether the omission was intentional. |
|
|
224
301
|
| "I will skip the design-system question to keep setup fast" | Phase 3 step 5b requires asking about design and recording the answer in `design.enabled`. Skipping creates ambiguity about whether the omission was intentional and bypasses the linkage between init and the deferred `harness-design-system` invocation on `on_new_feature`. |
|
|
225
|
-
| "Validation passed, so the project is ready" | Phase
|
|
302
|
+
| "Validation passed, so the project is ready" | Phase 5 captures baselines, configures telemetry identity, surfaces legacy warnings, and wires Tier-0 integrations. Validation alone is not sufficient. |
|
|
303
|
+
| "Plugin install means setup is done" | The marketplace plugin ships skills, slash commands, subagents, hooks, and MCP — but it cannot mutate the user's project state. `harness.config.json`, baselines, telemetry identity, and Tier-0 integrations require running this skill once per project. |
|
|
304
|
+
| "Skip Phase 5 if we already ran `harness setup`" | Phase 5 is idempotent. It safely no-ops where setup already wired things and fills gaps where it didn't (common case: setup ran once, then a new Tier-0 integration was added or a layout was migrated). Re-running is the right behavior. |
|
|
226
305
|
| "This is a test suite, we'll configure layers in this skill" | Phase 3 step 6 dispatches to `initialize-test-suite-project` for archetype selection, layer variants, and the rest. Do not inline test-suite-specific configuration here — the sub-skill owns it and carries the gotchas. |
|
|
227
306
|
|
|
228
307
|
## Examples
|
|
@@ -374,6 +453,82 @@ git add -A
|
|
|
374
453
|
git commit -m "feat: migrate harness project to intermediate level with layers"
|
|
375
454
|
```
|
|
376
455
|
|
|
456
|
+
### Example: Plugin-only Bootstrap (Existing Project, No Prior Harness Setup)
|
|
457
|
+
|
|
458
|
+
The user installed `harness-claude` from the marketplace. They have an existing TypeScript repo with no `.harness/` directory. Goal: get them to a working harness install without asking them to `npm install -g`.
|
|
459
|
+
|
|
460
|
+
**ASSESS:**
|
|
461
|
+
|
|
462
|
+
```
|
|
463
|
+
Check for .harness/ — not found.
|
|
464
|
+
Check `command -v harness` — not on PATH. Plugin-only install confirmed.
|
|
465
|
+
All CLI invocations below will be prefixed with `npx @harness-engineering/cli`.
|
|
466
|
+
|
|
467
|
+
Detect framework: package.json has "express" — auto-detection will pick this up.
|
|
468
|
+
Recommend: basic level (no prior harness adoption signal).
|
|
469
|
+
Human confirms: "Basic is fine."
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
**SCAFFOLD:**
|
|
473
|
+
|
|
474
|
+
```bash
|
|
475
|
+
npx @harness-engineering/cli init # auto-detects framework
|
|
476
|
+
# Creates: harness.config.json, .harness/, AGENTS.md (template)
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
**CONFIGURE:**
|
|
480
|
+
|
|
481
|
+
```
|
|
482
|
+
Customize AGENTS.md with project-specific content.
|
|
483
|
+
Phase 3 step 5 (i18n): "No, English only." → i18n.enabled = false.
|
|
484
|
+
Phase 3 step 5b (design): "No, this is a backend service." → design.enabled = false.
|
|
485
|
+
Phase 3 step 6 (test-suite dispatch): not a test suite, skipped.
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
**VALIDATE:**
|
|
489
|
+
|
|
490
|
+
```bash
|
|
491
|
+
npx @harness-engineering/cli validate # Pass
|
|
492
|
+
npx @harness-engineering/cli check-deps # Pass (basic level, no constraints yet)
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
**INSTRUMENT (Phase 5 — the work that `harness setup` would have done):**
|
|
496
|
+
|
|
497
|
+
```bash
|
|
498
|
+
# 1. Knowledge graph
|
|
499
|
+
npx @harness-engineering/cli scan
|
|
500
|
+
# 2. Architecture baseline
|
|
501
|
+
npx @harness-engineering/cli check-arch --update-baseline
|
|
502
|
+
# 3. Performance baseline (basic level: structural only)
|
|
503
|
+
npx @harness-engineering/cli check-perf --structural
|
|
504
|
+
# 4. Telemetry identity — ask the human
|
|
505
|
+
# Human: "Yes, project=acme-api, team=platform"
|
|
506
|
+
npx @harness-engineering/cli telemetry identify --project acme-api --team platform
|
|
507
|
+
# 5. Legacy layouts — dry-run reports nothing for a fresh repo
|
|
508
|
+
npx @harness-engineering/cli migrate --dry-run
|
|
509
|
+
# 6. Tier-0 MCP integrations
|
|
510
|
+
npx @harness-engineering/cli integrations list
|
|
511
|
+
npx @harness-engineering/cli integrations add context7
|
|
512
|
+
npx @harness-engineering/cli integrations add sequential-thinking
|
|
513
|
+
npx @harness-engineering/cli integrations add playwright
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
**FINALIZE:**
|
|
517
|
+
|
|
518
|
+
```
|
|
519
|
+
Phase 6 step 1 (roadmap): "Yes, create docs/roadmap.md."
|
|
520
|
+
Invoke harness-roadmap or run `npx @harness-engineering/cli` equivalent — docs/roadmap.md created.
|
|
521
|
+
|
|
522
|
+
Phase 6 step 2 (commit):
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
```bash
|
|
526
|
+
git add harness.config.json AGENTS.md .harness/ .mcp.json docs/roadmap.md
|
|
527
|
+
git commit -m "feat: bootstrap harness on existing project (plugin install)"
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
**Final state:** plugin user now has the same starting state as if they'd run `npm install -g @harness-engineering/cli && harness setup`. Subsequent slash commands, subagents, hooks, and MCP tools all have the project state they need.
|
|
531
|
+
|
|
377
532
|
### Example: Adoption Level Progression
|
|
378
533
|
|
|
379
534
|
**Basic (start here):**
|
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
# Initialize Harness Project
|
|
2
2
|
|
|
3
|
-
> Scaffold a new harness-compliant project
|
|
3
|
+
> Scaffold a new harness-compliant project, migrate an existing project to the next adoption level, or bootstrap an existing project that just got the harness marketplace plugin installed (no `harness setup`). Assess current state, scaffold or migrate, configure, validate, instrument (baselines / telemetry / Tier-0 integrations), and finalize.
|
|
4
4
|
|
|
5
5
|
## When to Use
|
|
6
6
|
|
|
7
7
|
- Starting a brand new project that should be harness-managed from day one
|
|
8
8
|
- Migrating an existing project to harness for the first time
|
|
9
9
|
- Upgrading an existing harness project from one adoption level to the next (basic to intermediate, intermediate to advanced)
|
|
10
|
+
- **Bootstrapping a project for plugin-only users:** the marketplace plugin is installed but `harness setup` was never run, so `harness.config.json`, baselines, telemetry identity, and Tier-0 MCP integrations are missing
|
|
11
|
+
- Refreshing instrumentation on an existing harness project (re-baselining after large changes, migrating legacy layouts, picking up new Tier-0 integrations)
|
|
10
12
|
- When `on_project_init` triggers fire
|
|
11
|
-
- NOT when the project is already at the desired adoption level (use harness-onboarding to orient instead)
|
|
13
|
+
- NOT when the project is already at the desired adoption level AND fully instrumented (use harness-onboarding to orient instead)
|
|
12
14
|
- NOT when adding a single component to an existing harness project (use add-harness-component)
|
|
13
15
|
- NOT when the project has no clear owner or maintainer — harness setup requires someone to own the constraints
|
|
14
16
|
|
|
17
|
+
## Plugin-only callout
|
|
18
|
+
|
|
19
|
+
If the user installed only the `harness-claude` (or sibling `harness-cursor`/`harness-gemini`/`harness-codex`) marketplace plugin, no `harness` shell binary is in their PATH. Prefix every CLI invocation in this skill with `npx @harness-engineering/cli`:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# instead of: harness validate
|
|
23
|
+
npx @harness-engineering/cli validate
|
|
24
|
+
# instead of: harness check-arch --update-baseline
|
|
25
|
+
npx @harness-engineering/cli check-arch --update-baseline
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Detect plugin-only state by checking whether `harness` resolves on PATH (`command -v harness`). If not, use the `npx` form. First call is slow; subsequent calls within ~24h hit the npx cache.
|
|
29
|
+
|
|
15
30
|
## Process
|
|
16
31
|
|
|
17
32
|
### Phase 1: ASSESS — Determine Current State
|
|
@@ -140,17 +155,71 @@
|
|
|
140
155
|
|
|
141
156
|
3. **Run `harness check-deps`** (intermediate and above) to verify dependency constraints match the actual codebase. If there are violations, decide with the human: update the constraints or fix the code.
|
|
142
157
|
|
|
143
|
-
###
|
|
158
|
+
### Phase 5: INSTRUMENT — Capture Baselines and Wire Integrations
|
|
144
159
|
|
|
145
|
-
|
|
160
|
+
This phase closes the parity gap that the marketplace plugin install does not cover: knowledge graph, architecture/perf baselines, telemetry identity, legacy-layout migrations, and Tier-0 MCP integrations. For npm + `harness setup` users most of this was already wired during setup; the steps are still safe to re-run idempotently.
|
|
146
161
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
```
|
|
162
|
+
1. **Build the initial knowledge graph.** Required for graph-based MCP tools (`get_impact`, `find_context_for`, `compute_blast_radius`, `detect_anomalies`):
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
harness scan
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Populates `.harness/graph/` with dependency and relationship data. Skip only if the project explicitly disables graph use in `harness.config.json`.
|
|
169
|
+
|
|
170
|
+
2. **Capture the architecture baseline.** Records the current layer-violation, circular-dep, and complexity counts so future runs of `harness check-arch` can detect regressions:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
harness check-arch --update-baseline
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Writes `.harness/arch/baselines.json`. Re-run after large refactors. CI (`refresh-baselines` job in `.github/workflows/ci.yml` on this repo) auto-refreshes on `main` for harness-developing projects; downstream projects do this manually here.
|
|
177
|
+
|
|
178
|
+
3. **Capture the performance baseline** (intermediate and above, or any project that wants regression detection on coupling and size budgets):
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
harness check-perf
|
|
182
|
+
```
|
|
150
183
|
|
|
151
|
-
|
|
184
|
+
First invocation captures the baseline; subsequent runs compare against it. Updates can be applied via the `update_perf_baselines` MCP tool when the human confirms a regression is intentional.
|
|
152
185
|
|
|
153
|
-
4. **
|
|
186
|
+
4. **Configure telemetry identity** (optional but recommended for teams). Anonymous telemetry is default-enabled by the standard hook profile; identity tagging adds project/team/alias to events for filtering. Ask the human:
|
|
187
|
+
- "Tag telemetry events with project + team identity? (recommended for shared installs, optional for personal use)"
|
|
188
|
+
- If yes, run:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
harness telemetry identify --project <project-name> --team <team-name>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Writes `.harness/telemetry.json`.
|
|
195
|
+
|
|
196
|
+
- If they want to disable telemetry entirely, write `{ "telemetry": { "enabled": false }, "adoption": { "enabled": false } }` to `harness.config.json`. Or recommend the `DO_NOT_TRACK=1` env var.
|
|
197
|
+
|
|
198
|
+
5. **Surface legacy layout warnings.** If the project predates the current harness layout (`docs/plans/`, `.harness/architecture/`, etc.), the migrate command surfaces and optionally fixes them:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
harness migrate --dry-run
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
If migrations are needed, ask the human before running `harness migrate` (without `--dry-run`). Skip silently when the dry-run reports nothing.
|
|
205
|
+
|
|
206
|
+
6. **Wire Tier-0 MCP integrations.** Tier-0 is zero-config (no API keys): `context7` (live library docs), `sequential-thinking` (structured reasoning), `playwright` (browser automation). On npm + `harness setup` they're auto-wired during step 4 of setup; on plugin-only installs they are NOT, since the plugin can't mutate the user's project `.mcp.json`.
|
|
207
|
+
|
|
208
|
+
List current state, then offer to wire:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
harness integrations list
|
|
212
|
+
# then for each missing Tier-0 integration:
|
|
213
|
+
harness integrations add context7
|
|
214
|
+
harness integrations add sequential-thinking
|
|
215
|
+
harness integrations add playwright
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
For Tier-1 integrations (Linear, Slack, Perplexity, etc.), surface availability with `harness integrations list` and let the human decide — they require API keys and are out of scope for an automated bootstrap.
|
|
219
|
+
|
|
220
|
+
### Phase 6: FINALIZE — Roadmap and Commit
|
|
221
|
+
|
|
222
|
+
1. **Set up project roadmap.** Ask: "Set up a project roadmap now? `docs/roadmap.md` tracks features, milestones, and status across your specs and plans." Use `emit_interaction`:
|
|
154
223
|
|
|
155
224
|
```json
|
|
156
225
|
emit_interaction({
|
|
@@ -183,7 +252,7 @@ This creates the `.harness/graph/` directory and populates it with the project's
|
|
|
183
252
|
- **If `design.enabled === true` in `harness.config.json`** (set by Phase 3 step 5b), call `manage_roadmap` with `action: add`, `feature: "Set up design system"`, `status: "planned"`, `milestone: "Current Work"`, `summary: "Run harness-design-system to define palette, typography, and generate W3C DTCG tokens. Deferred from project init — fires on first design-touching feature via on_new_feature."`. Skip silently if `manage_roadmap show` reports a duplicate `(feature, milestone)` pair. This closes the loop between deferred design intent and visible planning work.
|
|
184
253
|
- **No:** Skip silently. The user can still run `/harness:roadmap --create` later — that informational fallback remains valid.
|
|
185
254
|
|
|
186
|
-
|
|
255
|
+
2. **Commit the initialization.** All generated, configured, and instrumentation files in a single commit. Include `harness.config.json`, `AGENTS.md`, `.harness/arch/baselines.json`, `.harness/telemetry.json` (if created), updates to project `.mcp.json` (if Tier-0 integrations were wired), and any roadmap files.
|
|
187
256
|
|
|
188
257
|
## Harness Integration
|
|
189
258
|
|
|
@@ -192,11 +261,17 @@ This creates the `.harness/graph/` directory and populates it with the project's
|
|
|
192
261
|
- **`harness persona generate`** — Generate persona definitions based on project stack and team structure.
|
|
193
262
|
- **`harness validate`** — Verify the full project configuration is valid and complete.
|
|
194
263
|
- **`harness check-deps`** — Verify dependency constraints match the actual codebase (intermediate and above).
|
|
264
|
+
- **`harness scan`** — Phase 5 step 1. Builds the initial knowledge graph at `.harness/graph/`.
|
|
265
|
+
- **`harness check-arch --update-baseline`** — Phase 5 step 2. Captures the architecture baseline at `.harness/arch/baselines.json` so future runs can detect regressions.
|
|
266
|
+
- **`harness check-perf`** — Phase 5 step 3. Runs structural complexity, coupling, and size budget checks; first invocation captures the baseline.
|
|
267
|
+
- **`harness telemetry identify --project <name> --team <name>`** — Phase 5 step 4. Tags telemetry events with identity for filtering. Writes `.harness/telemetry.json`.
|
|
268
|
+
- **`harness migrate --dry-run` / `harness migrate`** — Phase 5 step 5. Surfaces and optionally fixes legacy layouts (`docs/plans/`, `.harness/architecture/`).
|
|
269
|
+
- **`harness integrations list` / `harness integrations add <name>`** — Phase 5 step 6. Lists Tier-0 (zero-config) and Tier-1 (API-key) MCP integrations and adds them to project `.mcp.json`.
|
|
195
270
|
- **`harness-i18n-workflow configure` + `harness-i18n-workflow scaffold`** — Invoked during Phase 3 if the project will support multiple languages. Sets up i18n configuration and translation file structure.
|
|
196
271
|
- **`harness-design-system` (deferred via `on_new_feature`)** — Phase 3 step 5b records `design.enabled` + `design.platforms` in `harness.config.json` but does NOT run the full design-system skill. Token generation defers to the first design-touching feature, where `harness-design-system` fires via `on_new_feature` and reads `design.enabled` to decide whether to proceed.
|
|
197
272
|
- **`initialize-test-suite-project`** — Sub-skill. Invoked during Phase 3 step 6 when Phase 1 step 5 classified the project as a test suite. Owns archetype selection, shared-library vs in-repo decision, layer variants, tag taxonomy, reporter stack, custom report, and "prove the guards fire" verification.
|
|
198
|
-
- **`harness-roadmap` skill** — Phase
|
|
199
|
-
- **`manage_roadmap` MCP tool** — Phase
|
|
273
|
+
- **`harness-roadmap` skill** — Phase 6 step 1 invokes this skill (or `/harness:roadmap --create`) when the user opts in to creating `docs/roadmap.md`. The `manage_roadmap` MCP tool does not create roadmaps; it manages entries in an existing one.
|
|
274
|
+
- **`manage_roadmap` MCP tool** — Phase 6 step 1, when `design.enabled === true`, calls `manage_roadmap` with `action: add` to insert a `planned` "Set up design system" item under milestone `Current Work` with a summary describing the deferred work.
|
|
200
275
|
|
|
201
276
|
## Success Criteria
|
|
202
277
|
|
|
@@ -210,9 +285,11 @@ This creates the `.harness/graph/` directory and populates it with the project's
|
|
|
210
285
|
- All generated files are committed in a single atomic commit
|
|
211
286
|
- i18n configuration is set if the human chose to enable it during init
|
|
212
287
|
- For non-test-suite projects, the design-system question was asked and `harness.config.json` reflects the answer: `design.enabled: true` (with `design.platforms` populated) for yes, `design.enabled: false` for no, or absent for not-sure.
|
|
288
|
+
- **Phase 5 (INSTRUMENT) outputs:** `.harness/graph/` is populated; `.harness/arch/baselines.json` exists; `harness check-perf` ran without errors (intermediate and above); `.harness/telemetry.json` exists if the human opted into identity tagging; legacy layout warnings were surfaced via `harness migrate --dry-run` and either resolved or explicitly deferred; Tier-0 MCP integrations (context7, sequential-thinking, playwright) are present in the project's `.mcp.json` (or the human declined and that decision is recorded).
|
|
213
289
|
- The roadmap question was asked. If the user answered yes, `docs/roadmap.md` exists and was created via `harness-roadmap` (or the documented `/harness:roadmap --create` fallback).
|
|
214
290
|
- When `design.enabled === true` AND the user answered yes to the roadmap question, `docs/roadmap.md` contains a `planned` entry titled "Set up design system" under milestone `Current Work` with a summary describing the deferred work. The entry is absent in all other answer combinations.
|
|
215
291
|
- For test suites: `initialize-test-suite-project` ran to completion and its Success Criteria are also met
|
|
292
|
+
- For plugin-only invocations: every CLI invocation in this skill ran successfully via `npx @harness-engineering/cli <cmd>` without requiring a global install. If any invocation failed because the npx download failed, the human was prompted to retry or `npm install -g @harness-engineering/cli` instead.
|
|
216
293
|
|
|
217
294
|
## Rationalizations to Reject
|
|
218
295
|
|
|
@@ -222,7 +299,9 @@ This creates the `.harness/graph/` directory and populates it with the project's
|
|
|
222
299
|
| "We should start at the advanced level since we want full coverage" | The skill recommends basic for new projects. Each level builds on the previous. Jumping to advanced creates misconfigured rules. |
|
|
223
300
|
| "I will skip the i18n question to keep setup fast" | Phase 3 requires asking about i18n and recording the decision. Skipping creates ambiguity about whether the omission was intentional. |
|
|
224
301
|
| "I will skip the design-system question to keep setup fast" | Phase 3 step 5b requires asking about design and recording the answer in `design.enabled`. Skipping creates ambiguity about whether the omission was intentional and bypasses the linkage between init and the deferred `harness-design-system` invocation on `on_new_feature`. |
|
|
225
|
-
| "Validation passed, so the project is ready" | Phase
|
|
302
|
+
| "Validation passed, so the project is ready" | Phase 5 captures baselines, configures telemetry identity, surfaces legacy warnings, and wires Tier-0 integrations. Validation alone is not sufficient. |
|
|
303
|
+
| "Plugin install means setup is done" | The marketplace plugin ships skills, slash commands, subagents, hooks, and MCP — but it cannot mutate the user's project state. `harness.config.json`, baselines, telemetry identity, and Tier-0 integrations require running this skill once per project. |
|
|
304
|
+
| "Skip Phase 5 if we already ran `harness setup`" | Phase 5 is idempotent. It safely no-ops where setup already wired things and fills gaps where it didn't (common case: setup ran once, then a new Tier-0 integration was added or a layout was migrated). Re-running is the right behavior. |
|
|
226
305
|
| "This is a test suite, we'll configure layers in this skill" | Phase 3 step 6 dispatches to `initialize-test-suite-project` for archetype selection, layer variants, and the rest. Do not inline test-suite-specific configuration here — the sub-skill owns it and carries the gotchas. |
|
|
227
306
|
|
|
228
307
|
## Examples
|
|
@@ -374,6 +453,82 @@ git add -A
|
|
|
374
453
|
git commit -m "feat: migrate harness project to intermediate level with layers"
|
|
375
454
|
```
|
|
376
455
|
|
|
456
|
+
### Example: Plugin-only Bootstrap (Existing Project, No Prior Harness Setup)
|
|
457
|
+
|
|
458
|
+
The user installed `harness-claude` from the marketplace. They have an existing TypeScript repo with no `.harness/` directory. Goal: get them to a working harness install without asking them to `npm install -g`.
|
|
459
|
+
|
|
460
|
+
**ASSESS:**
|
|
461
|
+
|
|
462
|
+
```
|
|
463
|
+
Check for .harness/ — not found.
|
|
464
|
+
Check `command -v harness` — not on PATH. Plugin-only install confirmed.
|
|
465
|
+
All CLI invocations below will be prefixed with `npx @harness-engineering/cli`.
|
|
466
|
+
|
|
467
|
+
Detect framework: package.json has "express" — auto-detection will pick this up.
|
|
468
|
+
Recommend: basic level (no prior harness adoption signal).
|
|
469
|
+
Human confirms: "Basic is fine."
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
**SCAFFOLD:**
|
|
473
|
+
|
|
474
|
+
```bash
|
|
475
|
+
npx @harness-engineering/cli init # auto-detects framework
|
|
476
|
+
# Creates: harness.config.json, .harness/, AGENTS.md (template)
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
**CONFIGURE:**
|
|
480
|
+
|
|
481
|
+
```
|
|
482
|
+
Customize AGENTS.md with project-specific content.
|
|
483
|
+
Phase 3 step 5 (i18n): "No, English only." → i18n.enabled = false.
|
|
484
|
+
Phase 3 step 5b (design): "No, this is a backend service." → design.enabled = false.
|
|
485
|
+
Phase 3 step 6 (test-suite dispatch): not a test suite, skipped.
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
**VALIDATE:**
|
|
489
|
+
|
|
490
|
+
```bash
|
|
491
|
+
npx @harness-engineering/cli validate # Pass
|
|
492
|
+
npx @harness-engineering/cli check-deps # Pass (basic level, no constraints yet)
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
**INSTRUMENT (Phase 5 — the work that `harness setup` would have done):**
|
|
496
|
+
|
|
497
|
+
```bash
|
|
498
|
+
# 1. Knowledge graph
|
|
499
|
+
npx @harness-engineering/cli scan
|
|
500
|
+
# 2. Architecture baseline
|
|
501
|
+
npx @harness-engineering/cli check-arch --update-baseline
|
|
502
|
+
# 3. Performance baseline (basic level: structural only)
|
|
503
|
+
npx @harness-engineering/cli check-perf --structural
|
|
504
|
+
# 4. Telemetry identity — ask the human
|
|
505
|
+
# Human: "Yes, project=acme-api, team=platform"
|
|
506
|
+
npx @harness-engineering/cli telemetry identify --project acme-api --team platform
|
|
507
|
+
# 5. Legacy layouts — dry-run reports nothing for a fresh repo
|
|
508
|
+
npx @harness-engineering/cli migrate --dry-run
|
|
509
|
+
# 6. Tier-0 MCP integrations
|
|
510
|
+
npx @harness-engineering/cli integrations list
|
|
511
|
+
npx @harness-engineering/cli integrations add context7
|
|
512
|
+
npx @harness-engineering/cli integrations add sequential-thinking
|
|
513
|
+
npx @harness-engineering/cli integrations add playwright
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
**FINALIZE:**
|
|
517
|
+
|
|
518
|
+
```
|
|
519
|
+
Phase 6 step 1 (roadmap): "Yes, create docs/roadmap.md."
|
|
520
|
+
Invoke harness-roadmap or run `npx @harness-engineering/cli` equivalent — docs/roadmap.md created.
|
|
521
|
+
|
|
522
|
+
Phase 6 step 2 (commit):
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
```bash
|
|
526
|
+
git add harness.config.json AGENTS.md .harness/ .mcp.json docs/roadmap.md
|
|
527
|
+
git commit -m "feat: bootstrap harness on existing project (plugin install)"
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
**Final state:** plugin user now has the same starting state as if they'd run `npm install -g @harness-engineering/cli && harness setup`. Subsequent slash commands, subagents, hooks, and MCP tools all have the project state they need.
|
|
531
|
+
|
|
377
532
|
### Example: Adoption Level Progression
|
|
378
533
|
|
|
379
534
|
**Basic (start here):**
|