@harness-engineering/cli 1.2.0 → 1.3.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 (52) hide show
  1. package/dist/bin/harness.js +1 -1
  2. package/dist/{chunk-IXT3KLVN.js → chunk-APYEWOCR.js} +355 -19
  3. package/dist/index.js +1 -1
  4. package/package.json +6 -4
  5. package/dist/agents/commands/claude-code/harness/add-component.md +0 -34
  6. package/dist/agents/commands/claude-code/harness/align-documentation.md +0 -33
  7. package/dist/agents/commands/claude-code/harness/architecture-advisor.md +0 -41
  8. package/dist/agents/commands/claude-code/harness/brainstorming.md +0 -42
  9. package/dist/agents/commands/claude-code/harness/check-mechanical-constraints.md +0 -32
  10. package/dist/agents/commands/claude-code/harness/cleanup-dead-code.md +0 -33
  11. package/dist/agents/commands/claude-code/harness/code-review.md +0 -33
  12. package/dist/agents/commands/claude-code/harness/debugging.md +0 -43
  13. package/dist/agents/commands/claude-code/harness/detect-doc-drift.md +0 -32
  14. package/dist/agents/commands/claude-code/harness/diagnostics.md +0 -43
  15. package/dist/agents/commands/claude-code/harness/enforce-architecture.md +0 -32
  16. package/dist/agents/commands/claude-code/harness/execution.md +0 -43
  17. package/dist/agents/commands/claude-code/harness/git-workflow.md +0 -32
  18. package/dist/agents/commands/claude-code/harness/initialize-project.md +0 -33
  19. package/dist/agents/commands/claude-code/harness/onboarding.md +0 -32
  20. package/dist/agents/commands/claude-code/harness/parallel-agents.md +0 -35
  21. package/dist/agents/commands/claude-code/harness/planning.md +0 -41
  22. package/dist/agents/commands/claude-code/harness/pre-commit-review.md +0 -38
  23. package/dist/agents/commands/claude-code/harness/refactoring.md +0 -35
  24. package/dist/agents/commands/claude-code/harness/skill-authoring.md +0 -35
  25. package/dist/agents/commands/claude-code/harness/state-management.md +0 -35
  26. package/dist/agents/commands/claude-code/harness/tdd.md +0 -42
  27. package/dist/agents/commands/claude-code/harness/validate-context-engineering.md +0 -32
  28. package/dist/agents/commands/claude-code/harness/verification.md +0 -38
  29. package/dist/agents/commands/gemini-cli/harness/add-component.toml +0 -240
  30. package/dist/agents/commands/gemini-cli/harness/align-documentation.toml +0 -238
  31. package/dist/agents/commands/gemini-cli/harness/architecture-advisor.toml +0 -469
  32. package/dist/agents/commands/gemini-cli/harness/brainstorming.toml +0 -326
  33. package/dist/agents/commands/gemini-cli/harness/check-mechanical-constraints.toml +0 -249
  34. package/dist/agents/commands/gemini-cli/harness/cleanup-dead-code.toml +0 -258
  35. package/dist/agents/commands/gemini-cli/harness/code-review.toml +0 -461
  36. package/dist/agents/commands/gemini-cli/harness/debugging.toml +0 -436
  37. package/dist/agents/commands/gemini-cli/harness/detect-doc-drift.toml +0 -215
  38. package/dist/agents/commands/gemini-cli/harness/diagnostics.toml +0 -401
  39. package/dist/agents/commands/gemini-cli/harness/enforce-architecture.toml +0 -222
  40. package/dist/agents/commands/gemini-cli/harness/execution.toml +0 -381
  41. package/dist/agents/commands/gemini-cli/harness/git-workflow.toml +0 -325
  42. package/dist/agents/commands/gemini-cli/harness/initialize-project.toml +0 -257
  43. package/dist/agents/commands/gemini-cli/harness/onboarding.toml +0 -316
  44. package/dist/agents/commands/gemini-cli/harness/parallel-agents.toml +0 -221
  45. package/dist/agents/commands/gemini-cli/harness/planning.toml +0 -405
  46. package/dist/agents/commands/gemini-cli/harness/pre-commit-review.toml +0 -294
  47. package/dist/agents/commands/gemini-cli/harness/refactoring.toml +0 -209
  48. package/dist/agents/commands/gemini-cli/harness/skill-authoring.toml +0 -350
  49. package/dist/agents/commands/gemini-cli/harness/state-management.toml +0 -354
  50. package/dist/agents/commands/gemini-cli/harness/tdd.toml +0 -247
  51. package/dist/agents/commands/gemini-cli/harness/validate-context-engineering.toml +0 -186
  52. package/dist/agents/commands/gemini-cli/harness/verification.toml +0 -334
@@ -1,325 +0,0 @@
1
- # Generated by harness generate-slash-commands. Do not edit.
2
- description = "Git workflow best practices integrated with harness validation"
3
- prompt = """
4
- <context>
5
- Cognitive mode: meticulous-verifier
6
- Type: flexible
7
- </context>
8
-
9
- <objective>
10
- Git workflow best practices integrated with harness validation
11
- </objective>
12
-
13
- <execution_context>
14
- --- SKILL.md (agents/skills/claude-code/harness-git-workflow/SKILL.md) ---
15
- # Harness Git Workflow
16
-
17
- > Worktree setup, dependency installation, baseline verification, and branch finishing. Clean isolation for every workstream.
18
-
19
- ## When to Use
20
-
21
- - When starting work that should be isolated from the main branch (new feature, experiment, multi-task plan)
22
- - When finishing a branch and deciding how to land it (merge, PR, keep, discard)
23
- - When `on_pr` or `on_commit` triggers fire and worktree management is needed
24
- - When the human asks to "set up a branch" or "start a new workstream"
25
- - NOT for simple single-file changes that do not need branch isolation
26
- - NOT when work is already in progress on the correct branch
27
-
28
- ## Process
29
-
30
- ### Part A: Worktree Creation
31
-
32
- #### Step 1: Choose Worktree Location
33
-
34
- 1. **Check for `.worktrees/` directory** in the project root. If it exists, use it — this is the preferred location.
35
-
36
- 2. **Check CLAUDE.md or AGENTS.md** for worktree preferences. Some projects specify a custom worktree directory or naming convention. Follow those instructions.
37
-
38
- 3. **If neither exists, ask the user:** "Where should I create the worktree? Options: (A) `.worktrees/<branch-name>` in the project root, (B) a sibling directory alongside the project, (C) a custom path."
39
-
40
- 4. **If placing worktrees in the project directory,** verify that the worktree directory is gitignored. Check `.gitignore` for `.worktrees/` or the chosen directory name. If not gitignored, add it before creating the worktree.
41
-
42
- #### Step 2: Check for Existing Worktrees
43
-
44
- 1. **Run `git worktree list`** to see active worktrees.
45
-
46
- 2. **If a worktree already exists for the target branch,** do not create a duplicate. Ask: "A worktree for branch `<name>` already exists at `<path>`. Should I use it, or create a new branch?"
47
-
48
- 3. **If the target directory already exists** (but is not a worktree), do not overwrite. Ask the user how to proceed.
49
-
50
- #### Step 3: Create Branch and Worktree
51
-
52
- 1. **Create the branch** from the current HEAD (or from the specified base):
53
-
54
- ```
55
- git branch <branch-name> <base>
56
- ```
57
-
58
- 2. **Create the worktree:**
59
-
60
- ```
61
- git worktree add <path> <branch-name>
62
- ```
63
-
64
- 3. **Verify the worktree was created.** Check that the directory exists and contains a `.git` file (not a `.git` directory — worktrees use a file pointing to the main repo).
65
-
66
- #### Step 4: Auto-Detect and Run Setup
67
-
68
- Inspect the worktree for project files and run the appropriate setup:
69
-
70
- | File Found | Action |
71
- | ---------------------------------- | ------------------------------------------------------------------------ |
72
- | `package.json` | `npm install` (or `yarn install` / `pnpm install` if lockfile indicates) |
73
- | `Cargo.toml` | `cargo build` |
74
- | `go.mod` | `go mod download` |
75
- | `requirements.txt` | `pip install -r requirements.txt` |
76
- | `pyproject.toml` | `pip install -e .` or `poetry install` |
77
- | `Gemfile` | `bundle install` |
78
- | `Makefile` (with `install` target) | `make install` |
79
-
80
- If multiple project files exist (monorepo), install at the root level. Do not guess which subpackages to install — follow the project's documented setup or ask.
81
-
82
- #### Step 5: Verify Clean Baseline
83
-
84
- Before any work begins, verify the worktree is in a clean, working state:
85
-
86
- 1. **Run the test suite.** All tests must pass on the fresh branch before any changes.
87
-
88
- 2. **Run `harness validate`.** Project health must be green before starting work.
89
-
90
- 3. **If tests fail or validation fails on the fresh branch,** stop. The base branch has issues. Report: "Baseline verification failed on fresh branch: [failure details]. The base branch needs to be fixed first."
91
-
92
- 4. **Record the baseline.** Note the test count and validation result. This is the comparison point for the branch finishing phase.
93
-
94
- ---
95
-
96
- ### Part B: Branch Finishing
97
-
98
- When work on the branch is complete, follow this protocol to land the changes.
99
-
100
- #### Step 1: Pre-Finish Verification
101
-
102
- 1. **Run the full test suite.** All tests must pass.
103
-
104
- 2. **Run `harness validate`.** Project health must be green.
105
-
106
- 3. **Check for uncommitted changes.** Run `git status`. All changes must be committed. If there are uncommitted changes, commit or stash them before finishing.
107
-
108
- 4. **Check the branch is up to date.** If the base branch has advanced since the worktree was created:
109
- ```
110
- git fetch origin
111
- git log HEAD..origin/main --oneline
112
- ```
113
- If there are new commits on the base, rebase or merge before finishing:
114
- ```
115
- git rebase origin/main
116
- ```
117
- Re-run tests after rebasing.
118
-
119
- #### Step 2: Choose Finishing Strategy
120
-
121
- Present 4 options to the user:
122
-
123
- 1. **Merge locally.** Merge the branch into the base branch on the local machine.
124
- - Best for: small changes, solo work, when CI is not required
125
- - Command: `git checkout main && git merge <branch>`
126
-
127
- 2. **Push and create PR.** Push the branch to the remote and open a pull request.
128
- - Best for: team work, changes that need review, when CI must pass
129
- - Command: `git push -u origin <branch>` then create PR via `gh pr create`
130
-
131
- 3. **Keep as-is.** Leave the branch and worktree in place for continued work later.
132
- - Best for: work-in-progress, experiments, paused projects
133
-
134
- 4. **Discard.** Delete the branch and worktree. All changes are lost.
135
- - Best for: failed experiments, abandoned approaches
136
- - Safety: Confirm with the user before discarding. List the commits that will be lost.
137
-
138
- #### Step 3: Execute Chosen Strategy
139
-
140
- **If merge locally:**
141
-
142
- ```bash
143
- cd <main-repo-path>
144
- git merge <branch-name>
145
- # Run tests on main after merge
146
- # Run harness validate after merge
147
- git worktree remove <worktree-path>
148
- git branch -d <branch-name>
149
- ```
150
-
151
- **If push and create PR:**
152
-
153
- ```bash
154
- cd <worktree-path>
155
- git push -u origin <branch-name>
156
- gh pr create --title "<title>" --body "<description>"
157
- # Report the PR URL to the user
158
- # Leave worktree in place until PR is merged
159
- ```
160
-
161
- **If keep as-is:**
162
-
163
- ```
164
- No action needed. Report the worktree path and branch name for future reference.
165
- ```
166
-
167
- **If discard:**
168
-
169
- ```bash
170
- # Confirm with user first — list commits that will be lost
171
- git worktree remove <worktree-path>
172
- git branch -D <branch-name>
173
- ```
174
-
175
- #### Step 4: Clean Up
176
-
177
- 1. **Remove the worktree** (unless keeping as-is or waiting for PR merge):
178
-
179
- ```
180
- git worktree remove <worktree-path>
181
- ```
182
-
183
- 2. **Prune stale worktree references:**
184
-
185
- ```
186
- git worktree prune
187
- ```
188
-
189
- 3. **Verify cleanup.** Run `git worktree list` and confirm the removed worktree is no longer listed.
190
-
191
- ## Harness Integration
192
-
193
- - **`harness validate`** — Run during baseline verification (Step 5 of Part A) and pre-finish verification (Step 1 of Part B). Ensures project health is green at both boundaries.
194
- - **Test runner** — Run fresh in the worktree, not in the main repo. Tests must pass both at baseline (before work) and at finish (after work).
195
- - **`.gitignore`** — Verify worktree directory is gitignored if it lives inside the project tree.
196
-
197
- ## Success Criteria
198
-
199
- - Worktree was created in the correct location (`.worktrees/` preferred, or per project convention)
200
- - Dependencies were auto-detected and installed
201
- - Baseline verification passed (tests green, harness validates) before any work began
202
- - Branch finishing strategy was chosen by the user (not assumed)
203
- - Chosen strategy was executed correctly (merge, PR, keep, or discard)
204
- - Worktree was cleaned up after finishing (unless keeping for continued work)
205
- - No stale worktree references remain after cleanup
206
-
207
- ## Examples
208
-
209
- ### Example: Setting Up a Worktree for a New Feature
210
-
211
- ```bash
212
- # Check for preferred location
213
- ls .worktrees/ # exists — use it
214
-
215
- # Check gitignore
216
- grep '.worktrees' .gitignore # found — good, already gitignored
217
-
218
- # Check existing worktrees
219
- git worktree list
220
- # /Users/dev/project abc1234 [main]
221
- # No existing worktree for this feature
222
-
223
- # Create branch and worktree
224
- git branch feat/notifications main
225
- git worktree add .worktrees/notifications feat/notifications
226
-
227
- # Auto-detect setup (found package.json)
228
- cd .worktrees/notifications && npm install
229
-
230
- # Verify baseline
231
- npm test # 142 tests, all pass
232
- harness validate # passes
233
-
234
- # Ready to work. Report:
235
- # "Worktree created at .worktrees/notifications on branch feat/notifications.
236
- # 142 tests passing. harness validate green. Ready to start."
237
- ```
238
-
239
- ### Example: Finishing a Branch with PR
240
-
241
- ```bash
242
- # Pre-finish verification
243
- cd .worktrees/notifications
244
- npm test # 158 tests, all pass (16 new)
245
- harness validate # passes
246
- git status # clean — all committed
247
-
248
- # Check if base has advanced
249
- git fetch origin
250
- git log HEAD..origin/main --oneline
251
- # 3 new commits on main — rebase
252
-
253
- git rebase origin/main
254
- npm test # still passes after rebase
255
-
256
- # User chooses: Push and create PR
257
- git push -u origin feat/notifications
258
- gh pr create --title "feat(notifications): email and in-app notifications" \
259
- --body "Implements notification service with create, list, and expiry.
260
- 16 new tests. All passing."
261
-
262
- # Report: "PR created: https://github.com/org/repo/pull/42
263
- # Worktree at .worktrees/notifications kept until PR merges."
264
- ```
265
-
266
- ### Example: Discarding a Failed Experiment
267
-
268
- ```bash
269
- # User says: "That approach didn't work, let's scrap it."
270
-
271
- # Show what will be lost
272
- git log main..HEAD --oneline
273
- # a1b2c3d try websocket approach
274
- # d4e5f6g add socket.io dependency
275
- # "These 2 commits will be lost. Discard? (yes/no)"
276
- # Human: "yes"
277
-
278
- git worktree remove .worktrees/ws-experiment
279
- git branch -D feat/ws-experiment
280
- git worktree prune
281
- git worktree list # ws-experiment no longer listed
282
- ```
283
-
284
-
285
- --- skill.yaml (agents/skills/claude-code/harness-git-workflow/skill.yaml) ---
286
- name: harness-git-workflow
287
- version: "1.0.0"
288
- description: Git workflow best practices integrated with harness validation
289
- cognitive_mode: meticulous-verifier
290
- triggers:
291
- - manual
292
- - on_pr
293
- - on_commit
294
- platforms:
295
- - claude-code
296
- - gemini-cli
297
- tools:
298
- - Bash
299
- - Read
300
- - Glob
301
- cli:
302
- command: harness skill run harness-git-workflow
303
- args:
304
- - name: path
305
- description: Project root path
306
- required: false
307
- mcp:
308
- tool: run_skill
309
- input:
310
- skill: harness-git-workflow
311
- path: string
312
- type: flexible
313
- state:
314
- persistent: false
315
- files: []
316
- depends_on: []
317
-
318
- </execution_context>
319
-
320
- <process>
321
- 1. Try: invoke mcp__harness__run_skill with skill: "harness-git-workflow"
322
- 2. If MCP unavailable: follow the SKILL.md workflow provided above directly
323
- 3. Pass through any arguments provided by the user
324
- </process>
325
- """
@@ -1,257 +0,0 @@
1
- # Generated by harness generate-slash-commands. Do not edit.
2
- description = "Scaffold a new harness-compliant project"
3
- prompt = """
4
- <context>
5
- Cognitive mode: constructive-architect
6
- Type: flexible
7
- </context>
8
-
9
- <objective>
10
- Scaffold a new harness-compliant project
11
- </objective>
12
-
13
- <execution_context>
14
- --- SKILL.md (agents/skills/claude-code/initialize-harness-project/SKILL.md) ---
15
- # Initialize Harness Project
16
-
17
- > Scaffold a new harness-compliant project or migrate an existing project to the next adoption level. Assess current state, configure personas, generate AGENTS.md, and validate the result.
18
-
19
- ## When to Use
20
-
21
- - Starting a brand new project that should be harness-managed from day one
22
- - Migrating an existing project to harness for the first time
23
- - Upgrading an existing harness project from one adoption level to the next (basic to intermediate, intermediate to advanced)
24
- - When `on_project_init` triggers fire
25
- - NOT when the project is already at the desired adoption level (use harness-onboarding to orient instead)
26
- - NOT when adding a single component to an existing harness project (use add-harness-component)
27
- - NOT when the project has no clear owner or maintainer — harness setup requires someone to own the constraints
28
-
29
- ## Process
30
-
31
- ### Phase 1: ASSESS — Determine Current State
32
-
33
- 1. **Check for existing harness configuration.** Look for `.harness/` directory, `AGENTS.md`, `harness.yaml`, and any skill definitions. Their presence determines whether this is a new project or a migration.
34
-
35
- 2. **For new projects:** Gather project context — language, framework, test runner, build tool. Ask the human if any of these are undecided. Do not assume defaults.
36
-
37
- 3. **For existing projects:** Run `harness validate` to see what is already configured and what is missing. Read `AGENTS.md` if it exists. Identify the current adoption level:
38
- - **Basic:** Has `AGENTS.md` and `harness.yaml` with project metadata. No layers, no skills, no dependency constraints.
39
- - **Intermediate:** Has layers defined, dependency constraints between layers, at least one custom skill. `harness check-deps` runs and passes.
40
- - **Advanced:** Has full persona configuration, custom skills for the team's workflows, state management, learnings capture, and CI integration for `harness validate`.
41
-
42
- 4. **Recommend the target adoption level.** For new projects, start with basic unless the team has harness experience. For existing projects, recommend one level up from current. Present the recommendation and wait for confirmation.
43
-
44
- ### Phase 2: SCAFFOLD — Generate Project Structure
45
-
46
- 1. **Run `harness init` with the appropriate flags:**
47
- - New basic project: `harness init --level basic --framework <framework>`
48
- - New intermediate project: `harness init --level intermediate --framework <framework>`
49
- - Migration to intermediate: `harness init --level intermediate --migrate`
50
- - Migration to advanced: `harness init --level advanced --migrate`
51
-
52
- 2. **Review generated files.** `harness init` creates:
53
- - `harness.yaml` — Project configuration (name, stack, adoption level)
54
- - `.harness/` directory — State and learnings storage
55
- - `AGENTS.md` — Agent instructions (template, needs customization)
56
- - Layer definitions (intermediate and above)
57
- - Dependency constraints (intermediate and above)
58
-
59
- 3. **Do not blindly accept generated content.** Read the generated `AGENTS.md` and `harness.yaml`. Flag anything that looks wrong or incomplete. The scaffolded output is a starting point, not a finished product.
60
-
61
- ### Phase 3: CONFIGURE — Customize for the Project
62
-
63
- 1. **Configure personas.** Run `harness persona generate` to create persona definitions based on the project's stack and team structure. Personas define how agents should behave in this project — coding style, communication preferences, constraint strictness.
64
-
65
- 2. **Customize AGENTS.md.** The generated template needs project-specific content:
66
- - Project description and purpose
67
- - Architecture overview (components, layers, data flow)
68
- - Key conventions the team follows
69
- - Known constraints and forbidden patterns
70
- - Links to relevant documentation
71
-
72
- 3. **For intermediate and above:** Define layer boundaries. Which modules belong to which layers? What are the allowed import directions? Document these in `harness.yaml` and ensure they match the actual codebase structure.
73
-
74
- 4. **For advanced:** Configure state management (`.harness/state.json` schema), learnings capture (`.harness/learnings.md` conventions), and CI integration hooks.
75
-
76
- ### Phase 4: VALIDATE — Confirm Everything Works
77
-
78
- 1. **Run `harness validate`** to verify the full configuration. This checks:
79
- - `harness.yaml` schema validity
80
- - `AGENTS.md` presence and required sections
81
- - Layer definitions (if intermediate+)
82
- - Dependency constraints (if intermediate+)
83
- - Persona configuration (if configured)
84
-
85
- 2. **Fix any validation errors before finishing.** Do not leave the project in a half-configured state.
86
-
87
- 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.
88
-
89
- 4. **Commit the initialization.** All generated and configured files in a single commit.
90
-
91
- ## Harness Integration
92
-
93
- - **`harness init --level <level> --framework <framework>`** — Scaffold a new project at the specified adoption level.
94
- - **`harness init --level <level> --migrate`** — Migrate an existing project to the next adoption level, preserving existing configuration.
95
- - **`harness persona generate`** — Generate persona definitions based on project stack and team structure.
96
- - **`harness validate`** — Verify the full project configuration is valid and complete.
97
- - **`harness check-deps`** — Verify dependency constraints match the actual codebase (intermediate and above).
98
-
99
- ## Success Criteria
100
-
101
- - `harness.yaml` exists and passes schema validation
102
- - `AGENTS.md` exists with project-specific content (not just the template)
103
- - `.harness/` directory exists with appropriate state files
104
- - `harness validate` passes with zero errors
105
- - `harness check-deps` passes (intermediate and above)
106
- - Personas are configured if the project uses them
107
- - The adoption level matches what was agreed upon with the human
108
- - All generated files are committed in a single atomic commit
109
-
110
- ## Examples
111
-
112
- ### Example: New TypeScript Project (Basic Level)
113
-
114
- **ASSESS:**
115
-
116
- ```
117
- Human: "I'm starting a new TypeScript API project using Express and Vitest."
118
- Check for .harness/ — not found. This is a new project.
119
- Recommend: basic level (new project, start simple).
120
- Human confirms: "Basic is fine for now."
121
- ```
122
-
123
- **SCAFFOLD:**
124
-
125
- ```bash
126
- harness init --level basic --framework express
127
- # Creates: harness.yaml, .harness/, AGENTS.md (template)
128
- ```
129
-
130
- **CONFIGURE:**
131
-
132
- ```
133
- Edit AGENTS.md:
134
- - Add project description: "REST API for widget management"
135
- - Add stack: TypeScript, Express, Vitest, PostgreSQL
136
- - Add conventions: "Use zod for validation, repository pattern for data access"
137
- - Add constraints: "No direct SQL queries outside repository layer"
138
- ```
139
-
140
- **VALIDATE:**
141
-
142
- ```bash
143
- harness validate # Pass — basic level checks satisfied
144
- git add harness.yaml .harness/ AGENTS.md
145
- git commit -m "feat: initialize harness project at basic level"
146
- ```
147
-
148
- ### Example: Migrating Existing Project from Basic to Intermediate
149
-
150
- **ASSESS:**
151
-
152
- ```
153
- Read harness.yaml — level: basic
154
- Read AGENTS.md — exists, has project-specific content
155
- Run: harness validate — passes at basic level
156
- Recommend: intermediate (add layers and dependency constraints)
157
- Human confirms: "Yes, we're ready for layers."
158
- ```
159
-
160
- **SCAFFOLD:**
161
-
162
- ```bash
163
- harness init --level intermediate --migrate
164
- # Preserves existing harness.yaml and AGENTS.md
165
- # Adds: layer definitions template, dependency constraints template
166
- ```
167
-
168
- **CONFIGURE:**
169
-
170
- ```
171
- Define layers in harness.yaml:
172
- - presentation: src/routes/, src/middleware/
173
- - business: src/services/, src/models/
174
- - data: src/repositories/, src/db/
175
-
176
- Define constraints:
177
- - presentation → business (allowed)
178
- - business → data (allowed)
179
- - data → presentation (forbidden)
180
- - presentation → data (forbidden — must go through business)
181
-
182
- Update AGENTS.md with layer documentation.
183
- ```
184
-
185
- **VALIDATE:**
186
-
187
- ```bash
188
- harness validate # Pass — intermediate level checks satisfied
189
- harness check-deps # Pass — no constraint violations in existing code
190
- git add -A
191
- git commit -m "feat: migrate harness project to intermediate level with layers"
192
- ```
193
-
194
- ### Example: Adoption Level Progression
195
-
196
- **Basic (start here):**
197
-
198
- - `AGENTS.md` with project context
199
- - `harness.yaml` with metadata
200
- - `harness validate` runs in development
201
-
202
- **Intermediate (add structure):**
203
-
204
- - Layer definitions and boundaries
205
- - Dependency constraints enforced by `harness check-deps`
206
- - At least one custom skill for team workflows
207
-
208
- **Advanced (full integration):**
209
-
210
- - Persona configuration for consistent agent behavior
211
- - State management across sessions
212
- - `.harness/learnings.md` capturing institutional knowledge
213
- - `harness validate` runs in CI pipeline
214
- - Custom skills for all common team workflows
215
-
216
-
217
- --- skill.yaml (agents/skills/claude-code/initialize-harness-project/skill.yaml) ---
218
- name: initialize-harness-project
219
- version: "1.0.0"
220
- description: Scaffold a new harness-compliant project
221
- cognitive_mode: constructive-architect
222
- triggers:
223
- - manual
224
- - on_project_init
225
- platforms:
226
- - claude-code
227
- - gemini-cli
228
- tools:
229
- - Bash
230
- - Read
231
- - Write
232
- - Glob
233
- cli:
234
- command: harness skill run initialize-harness-project
235
- args:
236
- - name: path
237
- description: Project root path
238
- required: false
239
- mcp:
240
- tool: run_skill
241
- input:
242
- skill: initialize-harness-project
243
- path: string
244
- type: flexible
245
- state:
246
- persistent: false
247
- files: []
248
- depends_on: []
249
-
250
- </execution_context>
251
-
252
- <process>
253
- 1. Try: invoke mcp__harness__run_skill with skill: "initialize-harness-project"
254
- 2. If MCP unavailable: follow the SKILL.md workflow provided above directly
255
- 3. Pass through any arguments provided by the user
256
- </process>
257
- """