@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,469 +0,0 @@
1
- # Generated by harness generate-slash-commands. Do not edit.
2
- description = "Interactive architecture advisor that surfaces trade-offs and helps humans choose"
3
- prompt = """
4
- <context>
5
- Cognitive mode: advisory-guide
6
- Type: flexible
7
- State: persistent (files: .harness/architecture/)
8
- </context>
9
-
10
- <objective>
11
- Interactive architecture advisor that surfaces trade-offs and helps humans choose
12
-
13
- Phases:
14
- - discover: Ask questions about the problem space and constraints
15
- - analyze: Research the codebase and identify relevant patterns
16
- - propose: Present 2-3 architectural options with trade-offs
17
- - document: Write an Architecture Decision Record for the chosen option
18
- </objective>
19
-
20
- <execution_context>
21
- --- SKILL.md (agents/skills/claude-code/harness-architecture-advisor/SKILL.md) ---
22
- # Harness Architecture Advisor
23
-
24
- > Cognitive mode: **advisory-guide**. Ask questions, surface trade-offs, present options. Do NOT execute. The human decides; you inform the decision.
25
-
26
- ## When to Use
27
-
28
- - When designing a new feature, module, or system boundary
29
- - When choosing between architectural approaches (REST vs GraphQL, monolith vs microservice, etc.)
30
- - When refactoring raises questions about target architecture
31
- - When `on_new_feature` triggers fire and the feature touches multiple modules
32
- - When a Design-category error is escalated from harness-diagnostics
33
- - NOT for implementation (use harness-execution after the decision is made)
34
- - NOT for bug fixes (use harness-debugging or harness-diagnostics)
35
- - NOT for code review (use harness-code-review)
36
-
37
- ## Core Principle
38
-
39
- **This skill advises. It does not execute.**
40
-
41
- You will research, analyze, and present options with clear trade-offs. You will not write production code, create files, or make architectural choices. The human makes the decision. You document it.
42
-
43
- If you find yourself writing implementation code, STOP. You have left advisory mode. Return to presenting options.
44
-
45
- ## Process
46
-
47
- ### Phase 1: DISCOVER — Understand the Problem Space
48
-
49
- **Gate: This phase requires human answers. Do not proceed to Phase 2 until the human has responded.**
50
-
51
- Ask these 5 questions. Wait for answers before proceeding.
52
-
53
- 1. **What problem are you solving?** Describe the user-facing or system-facing need. Not the technical solution — the problem.
54
-
55
- 2. **What are your hard constraints?** Things that cannot change: existing database, specific language/framework, compliance requirements, team size, timeline, budget.
56
-
57
- 3. **What are your soft preferences?** Things you would like but could trade away: specific patterns, technology preferences, performance targets, consistency with other systems.
58
-
59
- 4. **What have you already considered?** Any approaches you have thought about, tried, or rejected. Include why you rejected them if applicable.
60
-
61
- 5. **What does success look like in 6 months?** How will you know this decision was correct? What would make you regret it?
62
-
63
- Record the answers verbatim. Do not paraphrase or interpret at this stage.
64
-
65
- ```
66
- Store answers in: .harness/architecture/<topic>/discovery.md
67
- ```
68
-
69
- ---
70
-
71
- ### Phase 2: ANALYZE — Research the Codebase
72
-
73
- Read the codebase to understand the current state. Do not propose solutions yet — gather facts.
74
-
75
- #### Step 1: Map Existing Patterns
76
-
77
- Search for how the codebase currently handles similar concerns:
78
-
79
- - What architectural patterns are already in use? (MVC, hexagonal, event-driven, etc.)
80
- - How are similar features structured?
81
- - What conventions exist for the relevant layer (API, data, UI, infrastructure)?
82
-
83
- #### Step 2: Identify Integration Points
84
-
85
- Find where the new feature will touch existing code:
86
-
87
- - Which modules will it interact with?
88
- - What are the current API boundaries?
89
- - Are there shared data models or services?
90
-
91
- #### Step 3: Assess Technical Debt
92
-
93
- Look for existing issues that may affect the decision:
94
-
95
- - Are there known pain points in the relevant area?
96
- - Is there existing tech debt that one option would worsen and another would improve?
97
- - Are there pending migrations or deprecations?
98
-
99
- #### Step 4: Summarize Findings
100
-
101
- ```markdown
102
- ## Codebase Analysis: <topic>
103
-
104
- ### Current Patterns
105
-
106
- - <pattern 1>: used in <locations>
107
- - <pattern 2>: used in <locations>
108
-
109
- ### Integration Points
110
-
111
- - <module A>: <how it connects>
112
- - <module B>: <how it connects>
113
-
114
- ### Technical Debt
115
-
116
- - <issue 1>: <impact on this decision>
117
- - <issue 2>: <impact on this decision>
118
-
119
- ### Relevant Files
120
-
121
- - <path>: <why it matters>
122
- ```
123
-
124
- ```
125
- Store analysis in: .harness/architecture/<topic>/analysis.md
126
- ```
127
-
128
- ---
129
-
130
- ### Phase 3: PROPOSE — Present Options with Trade-Offs
131
-
132
- **Gate: This phase requires human choice at the end. Do not proceed to Phase 4 until the human has selected an option.**
133
-
134
- Present 2-3 architectural options. Never present only one option — a single option is not a decision, it is a directive. Never present more than 3 — too many options cause decision paralysis.
135
-
136
- #### For Each Option
137
-
138
- ```markdown
139
- ### Option [A/B/C]: <Name>
140
-
141
- **Summary:** One paragraph describing the approach.
142
-
143
- **How it works:**
144
-
145
- 1. <Step 1>
146
- 2. <Step 2>
147
- 3. <Step 3>
148
-
149
- **Pros:**
150
-
151
- - <Advantage 1> — <why it matters given the constraints>
152
- - <Advantage 2> — <why it matters given the constraints>
153
-
154
- **Cons:**
155
-
156
- - <Disadvantage 1> — <severity: low/medium/high> — <mitigation if any>
157
- - <Disadvantage 2> — <severity: low/medium/high> — <mitigation if any>
158
-
159
- **Effort:** <Small / Medium / Large> — <rough description of what is involved>
160
-
161
- **Risk:** <Low / Medium / High> — <what could go wrong>
162
-
163
- **Best when:** <the scenario where this option is clearly the right choice>
164
- ```
165
-
166
- #### Comparison Matrix
167
-
168
- After presenting all options, provide a direct comparison:
169
-
170
- ```markdown
171
- | Criterion | Option A | Option B | Option C |
172
- | ---------------- | -------- | -------- | -------- |
173
- | Complexity | | | |
174
- | Performance | | | |
175
- | Maintainability | | | |
176
- | Effort to build | | | |
177
- | Effort to change | | | |
178
- | Risk | | | |
179
- | Fits constraints | | | |
180
- ```
181
-
182
- #### Recommendation
183
-
184
- State which option you would lean toward and why, but frame it as a recommendation, not a decision:
185
-
186
- ```
187
- Based on the constraints (especially <key constraint>), I would lean toward Option <X> because <reason>.
188
- However, if <condition>, Option <Y> would be stronger.
189
- ```
190
-
191
- Present the options to the human and wait for their choice.
192
-
193
- ```
194
- Store proposal in: .harness/architecture/<topic>/proposal.md
195
- ```
196
-
197
- ---
198
-
199
- ### Phase 4: DOCUMENT — Write the Architecture Decision Record
200
-
201
- After the human selects an option, write a formal ADR.
202
-
203
- #### ADR Template
204
-
205
- ```markdown
206
- # ADR-<number>: <Title>
207
-
208
- **Date:** <date>
209
- **Status:** Accepted
210
- **Deciders:** <who was involved>
211
-
212
- ## Context
213
-
214
- <What is the problem or need that prompted this decision? Include relevant
215
- background, constraints, and the current state of the system. A reader who
216
- was not part of the discussion should understand why this decision was needed.>
217
-
218
- ## Decision
219
-
220
- <What is the architectural decision? State it clearly and specifically.
221
- Include enough detail that someone could implement it without further
222
- discussion.>
223
-
224
- ## Alternatives Considered
225
-
226
- ### <Alternative 1 name>
227
-
228
- <Brief description and why it was not chosen.>
229
-
230
- ### <Alternative 2 name>
231
-
232
- <Brief description and why it was not chosen.>
233
-
234
- ## Consequences
235
-
236
- ### Positive
237
-
238
- - <Benefit 1>
239
- - <Benefit 2>
240
-
241
- ### Negative
242
-
243
- - <Trade-off 1> — <mitigation plan>
244
- - <Trade-off 2> — <mitigation plan>
245
-
246
- ### Neutral
247
-
248
- - <Side effect that is neither positive nor negative>
249
-
250
- ## Action Items
251
-
252
- - [ ] <Concrete next step 1> — owner: <who> — by: <when>
253
- - [ ] <Concrete next step 2> — owner: <who> — by: <when>
254
- - [ ] <Concrete next step 3> — owner: <who> — by: <when>
255
- ```
256
-
257
- Save the ADR:
258
-
259
- ```
260
- .harness/architecture/<topic>/ADR-<number>.md
261
- ```
262
-
263
- Also link from the project's ADR index if one exists.
264
-
265
- ## Harness Integration
266
-
267
- - Extends the human-architect model — the skill is a thinking partner, not a decision maker
268
- - Respects architectural constraints defined in harness.config.json
269
- - Outputs structured ADR that other skills can reference
270
- - Reads prior ADRs from `.harness/architecture/` for consistency
271
-
272
- ## Success Criteria
273
-
274
- - [ ] All 5 discovery questions are asked (or explicitly deferred by human)
275
- - [ ] At least 2 options are presented with concrete trade-offs
276
- - [ ] Human makes an explicit choice before documentation proceeds
277
- - [ ] ADR follows the template structure with all sections filled
278
- - [ ] ADR references specific files or components (not abstract generalities)
279
-
280
- ## Gates
281
-
282
- - **Phase 1 to Phase 2: Requires human answers.** Do not proceed to codebase analysis until the human has answered the discovery questions. Without understanding constraints, analysis is directionless.
283
- - **Phase 3 to Phase 4: Requires human choice.** Do not write the ADR until the human has selected an option. The ADR documents a decision, not a recommendation.
284
- - **Always 2-3 options.** Never present 1 option (that is a directive, not advice). Never present more than 3 (that causes paralysis).
285
- - **No implementation in this skill.** If you write production code, you have broken the advisory boundary. Stop and return to presenting options.
286
- - **Trade-offs must be honest.** Every option has downsides. If you cannot articulate the cons of an option, you do not understand it well enough to recommend it.
287
-
288
- ## Escalation
289
-
290
- - **Human cannot choose between options:** Help narrow by asking which constraint matters most. If two options are genuinely equivalent, say so — flip a coin on equivalent options rather than agonizing.
291
- - **Analysis reveals the problem is already solved:** If the codebase already has a pattern that handles this, say so. No need to architect what already exists.
292
- - **Constraints are contradictory:** If hard constraints rule out all reasonable options, escalate this back to the human. Something in the constraints must give.
293
- - **Decision has organization-wide impact:** If the decision affects teams or systems beyond the current codebase, flag this. The decision may need a broader audience.
294
-
295
- ## Examples
296
-
297
- ### Example 1: API Design for a New Resource
298
-
299
- **Phase 1 — DISCOVER:**
300
-
301
- ```
302
- 1. Problem: We need to expose order history to mobile clients and third-party integrations.
303
- 2. Hard constraints: Must work with existing PostgreSQL database. REST API already
304
- serves other resources. Team of 3 backend engineers. Ship in 6 weeks.
305
- 3. Soft preferences: Would like to use GraphQL eventually. Want pagination.
306
- Want to keep response times under 200ms.
307
- 4. Already considered: Adding REST endpoints like the other resources. Wondered
308
- about GraphQL but unsure if it is worth the investment for one resource.
309
- 5. Success in 6 months: Mobile app and 2 integrations consuming the API without
310
- complaints about performance or missing data.
311
- ```
312
-
313
- **Phase 2 — ANALYZE:**
314
-
315
- ```
316
- Current patterns: REST with Express, controller-service-repository layers.
317
- 15 existing resources follow this pattern.
318
- Integration points: Order model joins with Users and Products.
319
- Existing /users and /products endpoints.
320
- Tech debt: No pagination on existing endpoints — they return all records.
321
- This is fine for small datasets but orders could be large.
322
- ```
323
-
324
- **Phase 3 — PROPOSE:**
325
-
326
- Option A: REST endpoints following existing patterns. Add pagination.
327
-
328
- - Pros: Consistent with codebase, team knows how to build it, fast to ship.
329
- - Cons: Mobile may over-fetch (gets all fields even when it needs few), no subscription support.
330
- - Effort: Small (2-3 weeks).
331
-
332
- Option B: GraphQL for orders only, REST for everything else.
333
-
334
- - Pros: Mobile gets exactly the fields it needs, natural pagination with cursors, foundation for future migration.
335
- - Cons: Two API paradigms to maintain, team learning curve, more infrastructure (Apollo/Yoga server).
336
- - Effort: Medium (4-5 weeks).
337
-
338
- Option C: REST with sparse fieldsets (JSON:API style `?fields=id,total,date`).
339
-
340
- - Pros: Stays REST, solves over-fetching for mobile, no new infrastructure.
341
- - Cons: Custom implementation of field filtering, not a standard the team has used before, still no subscriptions.
342
- - Effort: Small-Medium (3-4 weeks).
343
-
344
- Recommendation: Option A with pagination. It ships fastest, matches the existing codebase, and the team can migrate to GraphQL later as a separate initiative when there are more consumers with diverse needs.
345
-
346
- **Phase 4 — DOCUMENT:**
347
- ADR written after human selects Option A. Action items: implement pagination middleware (reusable for other endpoints), create /orders endpoints, update API documentation.
348
-
349
- ### Example 2: Component Decomposition for a Dashboard
350
-
351
- **Phase 1 — DISCOVER:**
352
-
353
- ```
354
- 1. Problem: The dashboard page component is 1200 lines and growing. It handles
355
- data fetching, state management, filtering, sorting, and rendering for
356
- 5 different widget types.
357
- 2. Hard constraints: React with TypeScript. Must not break existing widget
358
- behavior. Cannot change the API contract — backend team is on a different
359
- release cycle.
360
- 3. Soft preferences: Want widgets to be independently testable. Want to add
361
- 2 new widget types next quarter without touching the main component.
362
- 4. Already considered: Just splitting into smaller files. Worried that without
363
- a clear boundary, it will re-tangle.
364
- 5. Success in 6 months: Adding a new widget type requires creating one new
365
- file and registering it, not modifying the dashboard component.
366
- ```
367
-
368
- **Phase 2 — ANALYZE:**
369
-
370
- ```
371
- Current patterns: Dashboard uses a single useEffect for all data fetching.
372
- State is a large object with fields for each widget type. Rendering uses
373
- a switch statement on widget type.
374
- Integration points: 3 API endpoints supply data. Shared filter context
375
- affects all widgets. URL query params drive initial state.
376
- Tech debt: Two widget types share copy-pasted filtering logic. The sort
377
- function has special cases for each widget type.
378
- ```
379
-
380
- **Phase 3 — PROPOSE:**
381
-
382
- Option A: Widget plugin architecture with a registry.
383
-
384
- - Each widget is a self-contained module (component + hook + types).
385
- - A registry maps widget type strings to widget modules.
386
- - Dashboard iterates the registry, renders each widget, passes shared context.
387
- - Pros: Adding a widget means adding one module and one registry entry. Widgets are independently testable. Clear boundaries.
388
- - Cons: Requires upfront refactoring of all 5 existing widgets. Shared filter logic needs a common abstraction.
389
- - Effort: Medium (2-3 weeks to extract, then new widgets are fast).
390
-
391
- Option B: Compound component pattern with slots.
392
-
393
- - Dashboard defines layout slots. Each widget fills a slot.
394
- - Shared state via React context. Each widget manages its own data fetching.
395
- - Pros: Simpler than a registry. Familiar React patterns. Widgets own their data.
396
- - Cons: Less structured than a registry — no formal contract. Could re-tangle if disciplines slip. Adding a widget still requires modifying the dashboard layout.
397
- - Effort: Small-Medium (1-2 weeks).
398
-
399
- Option C: Micro-frontend approach with module federation.
400
-
401
- - Each widget is a separate build artifact loaded at runtime.
402
- - Pros: Maximum independence. Widgets can use different libraries. Independent deployment.
403
- - Cons: Massive overkill for 5-7 widgets in one app. Complex build setup. Runtime overhead. Team of 3 does not need this level of isolation.
404
- - Effort: Large (4-6 weeks).
405
-
406
- Recommendation: Option A. The plugin registry provides the clear boundary you need to prevent re-tangling, and the upfront cost pays off immediately when you add the 2 new widget types next quarter. Option C is overengineered for your scale.
407
-
408
- **Phase 4 — DOCUMENT:**
409
- ADR written after human selects Option A. Action items: define widget interface contract, extract existing widgets one at a time (one PR per widget), create registry with type-safe registration, add documentation for "how to add a new widget."
410
-
411
-
412
- --- skill.yaml (agents/skills/claude-code/harness-architecture-advisor/skill.yaml) ---
413
- name: harness-architecture-advisor
414
- version: "1.0.0"
415
- description: Interactive architecture advisor that surfaces trade-offs and helps humans choose
416
- cognitive_mode: advisory-guide
417
- triggers:
418
- - manual
419
- - on_new_feature
420
- platforms:
421
- - claude-code
422
- - gemini-cli
423
- tools:
424
- - Read
425
- - Glob
426
- - Grep
427
- - Bash
428
- cli:
429
- command: harness skill run harness-architecture-advisor
430
- args:
431
- - name: path
432
- description: Project root path
433
- required: false
434
- - name: topic
435
- description: "Architecture topic (e.g., api-design, data-modeling, decomposition)"
436
- required: false
437
- mcp:
438
- tool: run_skill
439
- input:
440
- skill: harness-architecture-advisor
441
- path: string
442
- type: flexible
443
- phases:
444
- - name: discover
445
- description: Ask questions about the problem space and constraints
446
- required: true
447
- - name: analyze
448
- description: Research the codebase and identify relevant patterns
449
- required: true
450
- - name: propose
451
- description: Present 2-3 architectural options with trade-offs
452
- required: true
453
- - name: document
454
- description: Write an Architecture Decision Record for the chosen option
455
- required: true
456
- state:
457
- persistent: true
458
- files:
459
- - .harness/architecture/
460
- depends_on: []
461
-
462
- </execution_context>
463
-
464
- <process>
465
- 1. Try: invoke mcp__harness__run_skill with skill: "harness-architecture-advisor"
466
- 2. If MCP unavailable: follow the SKILL.md workflow provided above directly
467
- 3. Pass through any arguments provided by the user
468
- </process>
469
- """