@harness-engineering/cli 1.7.0 → 1.8.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 (130) hide show
  1. package/dist/agents/personas/documentation-maintainer.yaml +3 -1
  2. package/dist/agents/personas/performance-guardian.yaml +23 -0
  3. package/dist/agents/skills/claude-code/align-documentation/SKILL.md +13 -0
  4. package/dist/agents/skills/claude-code/cleanup-dead-code/SKILL.md +25 -1
  5. package/dist/agents/skills/claude-code/cleanup-dead-code/skill.yaml +5 -2
  6. package/dist/agents/skills/claude-code/detect-doc-drift/SKILL.md +12 -0
  7. package/dist/agents/skills/claude-code/enforce-architecture/SKILL.md +48 -1
  8. package/dist/agents/skills/claude-code/enforce-architecture/skill.yaml +5 -2
  9. package/dist/agents/skills/claude-code/harness-accessibility/SKILL.md +7 -0
  10. package/dist/agents/skills/claude-code/harness-autopilot/SKILL.md +9 -1
  11. package/dist/agents/skills/claude-code/harness-brainstorming/SKILL.md +76 -4
  12. package/dist/agents/skills/claude-code/harness-brainstorming/skill.yaml +2 -0
  13. package/dist/agents/skills/claude-code/harness-code-review/SKILL.md +487 -234
  14. package/dist/agents/skills/claude-code/harness-code-review/skill.yaml +15 -2
  15. package/dist/agents/skills/claude-code/harness-codebase-cleanup/SKILL.md +226 -0
  16. package/dist/agents/skills/claude-code/harness-codebase-cleanup/skill.yaml +64 -0
  17. package/dist/agents/skills/claude-code/harness-dependency-health/SKILL.md +35 -6
  18. package/dist/agents/skills/claude-code/harness-docs-pipeline/SKILL.md +460 -0
  19. package/dist/agents/skills/claude-code/harness-docs-pipeline/skill.yaml +69 -0
  20. package/dist/agents/skills/claude-code/harness-execution/SKILL.md +73 -8
  21. package/dist/agents/skills/claude-code/harness-execution/skill.yaml +1 -0
  22. package/dist/agents/skills/claude-code/harness-hotspot-detector/SKILL.md +32 -6
  23. package/dist/agents/skills/claude-code/harness-i18n/SKILL.md +484 -0
  24. package/dist/agents/skills/claude-code/harness-i18n/skill.yaml +54 -0
  25. package/dist/agents/skills/claude-code/harness-i18n-process/SKILL.md +388 -0
  26. package/dist/agents/skills/claude-code/harness-i18n-process/skill.yaml +43 -0
  27. package/dist/agents/skills/claude-code/harness-i18n-workflow/SKILL.md +512 -0
  28. package/dist/agents/skills/claude-code/harness-i18n-workflow/skill.yaml +53 -0
  29. package/dist/agents/skills/claude-code/harness-impact-analysis/SKILL.md +35 -6
  30. package/dist/agents/skills/claude-code/harness-integrity/SKILL.md +17 -1
  31. package/dist/agents/skills/claude-code/harness-knowledge-mapper/SKILL.md +46 -5
  32. package/dist/agents/skills/claude-code/harness-perf/SKILL.md +37 -8
  33. package/dist/agents/skills/claude-code/harness-perf/skill.yaml +3 -0
  34. package/dist/agents/skills/claude-code/harness-perf-tdd/SKILL.md +17 -4
  35. package/dist/agents/skills/claude-code/harness-planning/SKILL.md +57 -3
  36. package/dist/agents/skills/claude-code/harness-planning/skill.yaml +2 -0
  37. package/dist/agents/skills/claude-code/harness-release-readiness/SKILL.md +16 -0
  38. package/dist/agents/skills/claude-code/harness-roadmap/SKILL.md +562 -0
  39. package/dist/agents/skills/claude-code/harness-roadmap/skill.yaml +43 -0
  40. package/dist/agents/skills/claude-code/harness-security-review/SKILL.md +36 -2
  41. package/dist/agents/skills/claude-code/harness-security-review/skill.yaml +8 -6
  42. package/dist/agents/skills/claude-code/harness-soundness-review/SKILL.md +1267 -0
  43. package/dist/agents/skills/claude-code/harness-soundness-review/skill.yaml +48 -0
  44. package/dist/agents/skills/claude-code/harness-test-advisor/SKILL.md +35 -6
  45. package/dist/agents/skills/claude-code/harness-verification/SKILL.md +66 -0
  46. package/dist/agents/skills/claude-code/harness-verification/skill.yaml +1 -0
  47. package/dist/agents/skills/claude-code/harness-verify/SKILL.md +11 -0
  48. package/dist/agents/skills/claude-code/initialize-harness-project/SKILL.md +15 -1
  49. package/dist/agents/skills/claude-code/validate-context-engineering/SKILL.md +12 -0
  50. package/dist/agents/skills/gemini-cli/harness-accessibility/SKILL.md +7 -0
  51. package/dist/agents/skills/gemini-cli/harness-autopilot/SKILL.md +9 -1
  52. package/dist/agents/skills/gemini-cli/harness-codebase-cleanup/SKILL.md +226 -0
  53. package/dist/agents/skills/gemini-cli/harness-codebase-cleanup/skill.yaml +64 -0
  54. package/dist/agents/skills/gemini-cli/harness-dependency-health/SKILL.md +35 -6
  55. package/dist/agents/skills/gemini-cli/harness-docs-pipeline/SKILL.md +460 -0
  56. package/dist/agents/skills/gemini-cli/harness-docs-pipeline/skill.yaml +69 -0
  57. package/dist/agents/skills/gemini-cli/harness-hotspot-detector/SKILL.md +32 -6
  58. package/dist/agents/skills/gemini-cli/harness-i18n/SKILL.md +484 -0
  59. package/dist/agents/skills/gemini-cli/harness-i18n/skill.yaml +54 -0
  60. package/dist/agents/skills/gemini-cli/harness-i18n-process/SKILL.md +388 -0
  61. package/dist/agents/skills/gemini-cli/harness-i18n-process/skill.yaml +43 -0
  62. package/dist/agents/skills/gemini-cli/harness-i18n-workflow/SKILL.md +512 -0
  63. package/dist/agents/skills/gemini-cli/harness-i18n-workflow/skill.yaml +53 -0
  64. package/dist/agents/skills/gemini-cli/harness-impact-analysis/SKILL.md +35 -6
  65. package/dist/agents/skills/gemini-cli/harness-knowledge-mapper/SKILL.md +46 -5
  66. package/dist/agents/skills/gemini-cli/harness-perf/SKILL.md +37 -8
  67. package/dist/agents/skills/gemini-cli/harness-perf/skill.yaml +3 -0
  68. package/dist/agents/skills/gemini-cli/harness-perf-tdd/SKILL.md +17 -4
  69. package/dist/agents/skills/gemini-cli/harness-release-readiness/SKILL.md +16 -0
  70. package/dist/agents/skills/gemini-cli/harness-roadmap/SKILL.md +562 -0
  71. package/dist/agents/skills/gemini-cli/harness-roadmap/skill.yaml +43 -0
  72. package/dist/agents/skills/gemini-cli/harness-security-review/skill.yaml +8 -6
  73. package/dist/agents/skills/gemini-cli/harness-soundness-review/SKILL.md +1267 -0
  74. package/dist/agents/skills/gemini-cli/harness-soundness-review/skill.yaml +48 -0
  75. package/dist/agents/skills/gemini-cli/harness-test-advisor/SKILL.md +35 -6
  76. package/dist/agents/skills/shared/i18n-knowledge/accessibility/intersection.yaml +142 -0
  77. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/encoding.yaml +67 -0
  78. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/formatting.yaml +106 -0
  79. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/layout.yaml +80 -0
  80. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/pluralization.yaml +80 -0
  81. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/string-handling.yaml +106 -0
  82. package/dist/agents/skills/shared/i18n-knowledge/frameworks/android-resources.yaml +47 -0
  83. package/dist/agents/skills/shared/i18n-knowledge/frameworks/apple-strings.yaml +47 -0
  84. package/dist/agents/skills/shared/i18n-knowledge/frameworks/backend-patterns.yaml +50 -0
  85. package/dist/agents/skills/shared/i18n-knowledge/frameworks/flutter-intl.yaml +47 -0
  86. package/dist/agents/skills/shared/i18n-knowledge/frameworks/i18next.yaml +47 -0
  87. package/dist/agents/skills/shared/i18n-knowledge/frameworks/react-intl.yaml +47 -0
  88. package/dist/agents/skills/shared/i18n-knowledge/frameworks/vue-i18n.yaml +47 -0
  89. package/dist/agents/skills/shared/i18n-knowledge/industries/ecommerce.yaml +66 -0
  90. package/dist/agents/skills/shared/i18n-knowledge/industries/fintech.yaml +66 -0
  91. package/dist/agents/skills/shared/i18n-knowledge/industries/gaming.yaml +69 -0
  92. package/dist/agents/skills/shared/i18n-knowledge/industries/healthcare.yaml +66 -0
  93. package/dist/agents/skills/shared/i18n-knowledge/industries/legal.yaml +66 -0
  94. package/dist/agents/skills/shared/i18n-knowledge/locales/ar.yaml +41 -0
  95. package/dist/agents/skills/shared/i18n-knowledge/locales/de.yaml +35 -0
  96. package/dist/agents/skills/shared/i18n-knowledge/locales/en.yaml +32 -0
  97. package/dist/agents/skills/shared/i18n-knowledge/locales/es.yaml +35 -0
  98. package/dist/agents/skills/shared/i18n-knowledge/locales/fi.yaml +35 -0
  99. package/dist/agents/skills/shared/i18n-knowledge/locales/fr.yaml +35 -0
  100. package/dist/agents/skills/shared/i18n-knowledge/locales/he.yaml +41 -0
  101. package/dist/agents/skills/shared/i18n-knowledge/locales/hi.yaml +35 -0
  102. package/dist/agents/skills/shared/i18n-knowledge/locales/it.yaml +32 -0
  103. package/dist/agents/skills/shared/i18n-knowledge/locales/ja.yaml +38 -0
  104. package/dist/agents/skills/shared/i18n-knowledge/locales/ko.yaml +38 -0
  105. package/dist/agents/skills/shared/i18n-knowledge/locales/nl.yaml +32 -0
  106. package/dist/agents/skills/shared/i18n-knowledge/locales/pl.yaml +35 -0
  107. package/dist/agents/skills/shared/i18n-knowledge/locales/pt.yaml +32 -0
  108. package/dist/agents/skills/shared/i18n-knowledge/locales/ru.yaml +35 -0
  109. package/dist/agents/skills/shared/i18n-knowledge/locales/sv.yaml +32 -0
  110. package/dist/agents/skills/shared/i18n-knowledge/locales/th.yaml +35 -0
  111. package/dist/agents/skills/shared/i18n-knowledge/locales/tr.yaml +35 -0
  112. package/dist/agents/skills/shared/i18n-knowledge/locales/zh-Hans.yaml +38 -0
  113. package/dist/agents/skills/shared/i18n-knowledge/locales/zh-Hant.yaml +35 -0
  114. package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/i18next-mcp.yaml +56 -0
  115. package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/lingo-dev.yaml +56 -0
  116. package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/lokalise.yaml +60 -0
  117. package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/tolgee.yaml +60 -0
  118. package/dist/agents/skills/shared/i18n-knowledge/testing/locale-testing.yaml +107 -0
  119. package/dist/agents/skills/shared/i18n-knowledge/testing/pseudo-localization.yaml +86 -0
  120. package/dist/bin/harness.js +64 -4
  121. package/dist/{chunk-4WUGOJQ7.js → chunk-3JWCBVUZ.js} +1 -1
  122. package/dist/{chunk-FFIX3QVG.js → chunk-LNI4T7R6.js} +131 -41
  123. package/dist/{chunk-GA6GN5J2.js → chunk-SJECMKSS.js} +2244 -34
  124. package/dist/{dist-N4D4QWFV.js → dist-BDO5GFEM.js} +1 -1
  125. package/dist/{dist-C4J67MPP.js → dist-NT3GXHQZ.js} +95 -1
  126. package/dist/index.d.ts +187 -7
  127. package/dist/index.js +7 -3
  128. package/dist/validate-cross-check-2OPGCGGU.js +7 -0
  129. package/package.json +7 -7
  130. package/dist/validate-cross-check-WGXQ7K62.js +0 -7
@@ -1,11 +1,13 @@
1
1
  version: 1
2
2
  name: Documentation Maintainer
3
3
  description: Keeps documentation in sync with source code
4
- role: Detect documentation drift, validate doc coverage, align docs with code changes
4
+ role: Detect documentation drift, validate doc coverage, align docs with code changes, run full documentation health pipeline
5
5
  skills:
6
6
  - detect-doc-drift
7
7
  - align-documentation
8
8
  - harness-knowledge-mapper
9
+ - validate-context-engineering
10
+ - harness-docs-pipeline
9
11
  commands:
10
12
  - check-docs
11
13
  - validate
@@ -5,6 +5,7 @@ role: Run structural complexity checks, coupling analysis, benchmark regression
5
5
  skills:
6
6
  - harness-perf
7
7
  - harness-tdd
8
+ - harness-perf-tdd
8
9
  commands:
9
10
  - check-perf
10
11
  - perf
@@ -20,6 +21,28 @@ config:
20
21
  severity: error
21
22
  autoFix: false
22
23
  timeout: 300000
24
+ steps:
25
+ - command: validate
26
+ when: always
27
+ - command: check-deps
28
+ when: always
29
+ - command: check-perf --structural
30
+ when: always
31
+ - command: check-perf --coupling
32
+ when: always
33
+ - skill: harness-perf
34
+ phases: [BENCHMARK, REPORT, ENFORCE]
35
+ when: on_pr
36
+ - check: missing-benchmarks
37
+ when: on_pr
38
+ missing_benchmark_detection:
39
+ description: Detect new/modified source files without co-located benchmarks
40
+ logic:
41
+ - step: Identify new/modified source files in the PR diff
42
+ - step: For each file, check if a co-located .bench.ts file exists
43
+ - step: "If file is on a @perf-critical path (via get_critical_paths) and has no benchmark: flag Tier 2 warning"
44
+ - step: "If file is not critical but is new: flag Tier 3 info suggesting harness-perf-tdd"
45
+ - step: 'Output example: "New file src/core/parser.ts is on a critical path but has no benchmark. Consider using harness-perf-tdd to add one."'
23
46
  outputs:
24
47
  agents-md: true
25
48
  ci-workflow: true
@@ -40,6 +40,19 @@ When a knowledge graph exists at `.harness/graph/`, use graph queries for faster
40
40
 
41
41
  Replaces manual doc-to-code correlation. Fall back to file-based commands if no graph is available.
42
42
 
43
+ ### Pipeline Context (when orchestrated)
44
+
45
+ When invoked by `harness-docs-pipeline`, check for a `pipeline` field in `.harness/handoff.json`:
46
+
47
+ - If `pipeline` field exists: read `DocPipelineContext` from it
48
+ - Read `pipeline.driftFindings` to know which fixes to apply (pre-classified by safety)
49
+ - If `pipeline.fixBatch` is set, apply only those specific fixes rather than running full detection
50
+ - Write applied fixes as `DocFix[]` back to `pipeline.fixesApplied`
51
+ - This enables the convergence loop to track fix verification status
52
+ - If `pipeline` field does not exist: behave exactly as today (standalone mode)
53
+
54
+ No changes to the skill's interface or output format — the pipeline field is purely additive.
55
+
43
56
  ### Phase 2: Map — Connect Code Changes to Documentation
44
57
 
45
58
  For each changed file, identify all documentation that references it:
@@ -43,7 +43,9 @@ Graph reachability reduces false positives compared to static analysis alone, si
43
43
 
44
44
  - Exports that are not imported anywhere AND not referenced in any config file
45
45
  - Files that are not imported anywhere AND have no side effects (no top-level execution)
46
- - Commented-out code blocks (dead by definition)
46
+ - Dead exports (non-public, zero importers) -- remove `export` keyword or delete entirely if zero internal callers
47
+ - Commented-out code blocks -- delete commented block (dead by definition, code is in git history)
48
+ - Orphaned npm dependencies -- remove from package.json (probably safe; needs install+test verification)
47
49
  - Unused local variables and imports within a file (linter can catch these)
48
50
 
49
51
  **Needs human review before removal:**
@@ -70,6 +72,28 @@ For each item categorized as safe:
70
72
 
71
73
  5. **Commit the cleanup.** Group related removals into logical commits (e.g., "remove unused shipping utilities" not "delete dead code").
72
74
 
75
+ **New fix types:**
76
+
77
+ - **Dead exports (non-public):** Use `apply_fixes` with `fixTypes: ['dead-exports']`. The tool removes the `export` keyword. If the function/class has zero internal callers too, delete the entire declaration.
78
+ - **Commented-out code:** Use `apply_fixes` with `fixTypes: ['commented-code']`. The tool deletes commented-out code blocks. This is cosmetic and only needs lint verification.
79
+ - **Orphaned dependencies:** Use `apply_fixes` with `fixTypes: ['orphaned-deps']`. The tool removes the dep from package.json. **Must run `pnpm install && pnpm test` after** to verify nothing breaks.
80
+
81
+ ### Phase 3.5: Convergence Loop (Standalone)
82
+
83
+ When running standalone (not through the orchestrator), apply a single-concern convergence loop:
84
+
85
+ 1. **Re-run detection.** After applying all safe fixes, run `harness cleanup --type dead-code` again.
86
+ 2. **Check if issue count decreased.** Compare the new count to the previous count.
87
+ 3. **If decreased: loop.** New dead code may have been exposed by the fixes (e.g., removing a dead export made a file fully unused). Go back to Phase 2 (Categorize) with the new report.
88
+ 4. **If unchanged: stop.** No more cascading fixes are possible. Proceed to Phase 4 (Report).
89
+ 5. **Maximum iterations: 5.** To prevent infinite loops, stop after 5 convergence cycles regardless.
90
+
91
+ **Why convergence matters:** Removing dead code can create more dead code. For example:
92
+
93
+ - Removing a dead export may make all remaining exports in a file dead, making the file itself dead.
94
+ - Removing a dead file removes its imports, which may make other files' exports dead.
95
+ - Removing an orphaned dep may cause lint warnings that reveal unused imports.
96
+
73
97
  ### Phase 4: Report Remaining Items
74
98
 
75
99
  ### Graph Refresh
@@ -1,6 +1,6 @@
1
1
  name: cleanup-dead-code
2
- version: "1.0.0"
3
- description: Detect unused exports and dead code
2
+ version: "1.1.0"
3
+ description: Detect and auto-fix dead code including dead exports, commented-out code, and orphaned dependencies
4
4
  cognitive_mode: diagnostic-investigator
5
5
  triggers:
6
6
  - manual
@@ -18,6 +18,9 @@ cli:
18
18
  - name: path
19
19
  description: Project root path
20
20
  required: false
21
+ - name: fix
22
+ description: Enable auto-fix with convergence loop
23
+ required: false
21
24
  mcp:
22
25
  tool: run_skill
23
26
  input:
@@ -30,6 +30,18 @@ When a knowledge graph exists at `.harness/graph/`, use graph queries for faster
30
30
 
31
31
  When a graph is available, drift is simply stale edges: doc-to-code edges where the code side has been modified more recently than the doc side. This replaces regex pattern matching and catches semantic drift that text search misses. Fall back to file-based commands if no graph is available.
32
32
 
33
+ ### Pipeline Context (when orchestrated)
34
+
35
+ When invoked by `harness-docs-pipeline`, check for a `pipeline` field in `.harness/handoff.json`:
36
+
37
+ - If `pipeline` field exists: read `DocPipelineContext` from it
38
+ - Use `pipeline.exclusions` to skip findings that were already addressed in a previous phase
39
+ - Write `DriftFinding[]` results back to `pipeline.driftFindings` in handoff.json
40
+ - This enables the orchestrator to track findings across phases and avoid double-counting
41
+ - If `pipeline` field does not exist: behave exactly as today (standalone mode)
42
+
43
+ No changes to the skill's interface or output format — the pipeline field is purely additive.
44
+
33
45
  ### Phase 2: Identify — Classify Drift Types
34
46
 
35
47
  Categorize each finding into one of these drift types:
@@ -75,6 +75,53 @@ For each violation, determine:
75
75
  - WHAT would happen if the violation were allowed to persist
76
76
  - HOW it affects testability, maintainability, and changeability
77
77
 
78
+ ### Phase 3.5: Apply Safe Architecture Fixes
79
+
80
+ Some architecture violations can be auto-fixed. Apply these before surfacing remaining violations.
81
+
82
+ **Import ordering violations:**
83
+
84
+ 1. Identify files where imports are not ordered according to the project's layer convention.
85
+ 2. Reorder imports: external packages first, then by layer (lowest to highest), then relative imports.
86
+ 3. Verify with lint + typecheck. This is a safe, mechanical fix.
87
+
88
+ **Forbidden import replacement (with configured alternative):**
89
+
90
+ 1. Check `harness.config.json` for `forbiddenImports` entries that include an `alternative` field.
91
+ 2. For each violation where an alternative exists, replace the import path with the alternative.
92
+ 3. Verify with typecheck + test. This is "probably safe" -- present as a diff for approval in interactive mode, apply silently in CI mode.
93
+
94
+ **Design token substitution (unambiguous mapping):**
95
+
96
+ 1. When a hardcoded value has exactly one matching design token, replace the literal with the token reference.
97
+ 2. Verify with typecheck + test.
98
+ 3. If the mapping is ambiguous (multiple candidate tokens), surface to user.
99
+
100
+ **Never auto-fix these (always surface to user):**
101
+
102
+ - Upward dependencies
103
+ - Skip-layer dependencies
104
+ - Circular dependencies
105
+ - Forbidden imports without a configured alternative
106
+
107
+ ### Phase 3.6: Convergence Loop (Standalone)
108
+
109
+ When running standalone (not through the orchestrator), apply a single-concern convergence loop:
110
+
111
+ 1. **Re-run detection.** After applying all safe/probably-safe fixes, run `harness check-deps` again.
112
+ 2. **Check if violation count decreased.** Compare the new count to the previous count.
113
+ 3. **If decreased: loop.** Fixing one violation can resolve others (e.g., replacing a forbidden import may eliminate a transitive skip-layer violation). Go back to Phase 2 with the new results.
114
+ 4. **If unchanged: stop.** Proceed to Phase 4 (Guide Resolution) for remaining violations.
115
+ 5. **Maximum iterations: 5.** To prevent infinite loops.
116
+
117
+ **Verification gate:** After each fix batch, run:
118
+
119
+ ```
120
+ pnpm lint && pnpm tsc --noEmit && pnpm test
121
+ ```
122
+
123
+ If any command fails, revert the batch and reclassify those findings as unsafe.
124
+
78
125
  ### Phase 4: Guide Resolution
79
126
 
80
127
  For each violation, provide a specific fix:
@@ -82,7 +129,7 @@ For each violation, provide a specific fix:
82
129
  - **Upward dependency:** Introduce an interface or abstraction in the lower layer. The higher layer implements it; the lower layer depends only on the abstraction. Alternatively, use dependency injection.
83
130
  - **Skip-layer dependency:** Route the call through the intermediate layer. Add a method to the Service layer that delegates to the Repository, then have the UI call the Service.
84
131
  - **Circular dependency:** Break the cycle by extracting shared types into a common module that both can depend on, or restructure so the dependency flows in one direction only.
85
- - **Forbidden import:** Replace the forbidden import with the approved alternative. If no alternative exists, the feature may need to live in a different layer.
132
+ - **Forbidden import:** Check `harness.config.json` for an `alternative` field. If present, this should have been auto-fixed in Phase 3.5. If not present, replace the forbidden import with the approved alternative or restructure the code.
86
133
  - **Design constraint violation:** Replace hardcoded values with token references from `design-system/tokens.json`. For anti-pattern violations, consult `design-system/DESIGN.md` for the project's aesthetic intent and approved alternatives. For contrast failures, use `harness-accessibility` to find compliant color pairs.
87
134
 
88
135
  ## Common Violation Patterns
@@ -1,6 +1,6 @@
1
1
  name: enforce-architecture
2
- version: "1.0.0"
3
- description: Validate architectural layer boundaries and detect circular dependencies
2
+ version: "1.1.0"
3
+ description: Validate architectural layer boundaries, detect violations, and auto-fix import ordering and forbidden import replacement
4
4
  cognitive_mode: meticulous-verifier
5
5
  triggers:
6
6
  - manual
@@ -19,6 +19,9 @@ cli:
19
19
  - name: path
20
20
  description: Project root path
21
21
  required: false
22
+ - name: fix
23
+ description: Enable auto-fix with convergence loop
24
+ required: false
22
25
  mcp:
23
26
  tool: run_skill
24
27
  input:
@@ -25,6 +25,12 @@
25
25
  - `standard` -- warnings are visible, errors block (default behavior)
26
26
  - `permissive` -- all findings are informational (nothing blocks, but everything is reported)
27
27
 
28
+ 2.5. **Check for i18n skill overlap.** Read `harness.config.json` for `i18n.enabled`:
29
+
30
+ - If `i18n.enabled: true`, **defer** `lang` and `dir` attribute checks to `harness-i18n`. Do not scan for missing `lang` on `<html>` or missing `dir` on user-content containers -- those checks are covered by the i18n skill's scan phase with more context (locale-aware, RTL-aware).
31
+ - If `i18n.enabled` is false or absent, scan for `lang`/`dir` as normal (these remain part of the accessibility audit).
32
+ - This deduplication prevents the same finding from appearing in both the accessibility report and the i18n report.
33
+
28
34
  3. **Scan component files.** Search all files matching `.tsx`, `.jsx`, `.vue`, `.svelte`, `.html` for the following violations:
29
35
 
30
36
  **Images and media:**
@@ -176,6 +182,7 @@ This phase is optional. It applies fixes only for **mechanical issues** -- viola
176
182
  - **`DesignIngestor`** (`packages/graph/src/ingest/DesignIngestor.ts`) -- Provides token data used for contrast checking. The ingestor parses `tokens.json` so the accessibility scanner can compare code colors against declared tokens.
177
183
  - **`harness-impact-analysis`** -- When tokens change (palette update, new colors), impact analysis traces affected components. The accessibility skill uses this to determine which components need re-scanning.
178
184
  - **`harness-design-system`** -- Dependency. When contrast failures originate from token definitions (not component code), escalate to harness-design-system to fix at the source.
185
+ - **`harness-i18n` deduplication** -- When `i18n.enabled: true` in config, `lang` and `dir` attribute checks are deferred to the i18n skill. This prevents duplicate findings across the accessibility and i18n reports. When i18n is not enabled, these checks remain part of the accessibility scan.
179
186
 
180
187
  ## Success Criteria
181
188
 
@@ -97,7 +97,14 @@ INIT → ASSESS → PLAN → APPROVE_PLAN → EXECUTE → VERIFY → REVIEW →
97
97
 
98
98
  5. **Load context.** Read `.harness/learnings.md` and `.harness/failures.md` (global, at `.harness/` root) if they exist. Note any relevant learnings or known dead ends for the current phase.
99
99
 
100
- 6. **Transition to ASSESS.**
100
+ 6. **Load roadmap context.** If `docs/roadmap.md` exists, read it to understand:
101
+ - Current project priorities (which features are `in-progress`)
102
+ - Blockers that may affect the upcoming phases
103
+ - Overall project status and milestone progress
104
+
105
+ This provides the autopilot with project-level context beyond the individual spec being executed. If the roadmap does not exist, skip this step — the autopilot operates normally without it.
106
+
107
+ 7. **Transition to ASSESS.**
101
108
 
102
109
  ---
103
110
 
@@ -374,6 +381,7 @@ INIT → ASSESS → PLAN → APPROVE_PLAN → EXECUTE → VERIFY → REVIEW →
374
381
  - **State file** — `.harness/sessions/<slug>/autopilot-state.json` tracks the orchestration state machine. `.harness/sessions/<slug>/state.json` tracks task-level execution state (managed by harness-execution). The slug is derived from the spec path during INIT.
375
382
  - **Handoff** — `.harness/sessions/<slug>/handoff.json` is written by each delegated skill and read by the next. Autopilot writes a final handoff on DONE.
376
383
  - **Learnings** — `.harness/learnings.md` (global) is appended by both delegated skills and autopilot itself.
384
+ - **Roadmap context** — During INIT, reads `docs/roadmap.md` (if present) for project-level priorities, blockers, and milestone status. Provides broader context for phase execution decisions.
377
385
 
378
386
  ## Success Criteria
379
387
 
@@ -38,6 +38,21 @@ If you find yourself writing production code, tests, or scaffolding before the h
38
38
 
39
39
  1. **Ask ONE question at a time.** Do not dump a list of 10 questions on the human. Ask the most important question first. Wait for the answer. Let the answer inform the next question.
40
40
 
41
+ When asking a clarifying question, use `emit_interaction` with `type: 'question'`:
42
+
43
+ ```json
44
+ emit_interaction({
45
+ path: "<project-root>",
46
+ type: "question",
47
+ question: {
48
+ text: "For auth, should we use:",
49
+ options: ["A) existing JWT middleware", "B) OAuth2 via provider X", "C) external service"]
50
+ }
51
+ })
52
+ ```
53
+
54
+ This records the question in state and returns a formatted prompt to present.
55
+
41
56
  2. **Prefer multiple choice.** Instead of "How should we handle auth?", ask "For auth, should we: (A) use existing JWT middleware, (B) add OAuth2 via provider X, or (C) delegate to an external service?" Give 2-4 concrete options with brief tradeoff notes.
42
57
 
43
58
  3. **When the human answers, acknowledge and build on it.** Do not re-ask clarified points. Track decisions as they accumulate.
@@ -67,6 +82,13 @@ These keywords flow into the `handoff.json` `contextKeywords` field when the spe
67
82
  - **Estimated complexity:** Low / Medium / High, with a brief justification
68
83
  - **Risk:** What could go wrong, what assumptions might be wrong
69
84
 
85
+ When presenting approach tradeoffs, use conventional markdown patterns:
86
+
87
+ ```
88
+ **[IMPORTANT]** Approach 1 trades simplicity for extensibility
89
+ **[SUGGESTION]** Consider Approach 2 if real-time requirements emerge later
90
+ ```
91
+
70
92
  2. **Be honest about tradeoffs.** Do not soft-sell a preferred approach. If approach A is simpler but less extensible, say so plainly.
71
93
 
72
94
  3. **State your recommendation** and why, but defer to the human's decision.
@@ -84,13 +106,62 @@ These keywords flow into the `handoff.json` `contextKeywords` field when the spe
84
106
  - Success criteria (observable, testable outcomes)
85
107
  - Implementation order (high-level phases, not detailed tasks — that is harness-planning's job)
86
108
 
87
- 2. **After all sections are reviewed, write the spec to `docs/`.** Use the project's existing spec naming convention. If none exists, use `docs/specs/YYYY-MM-DD-<feature-name>.md`.
109
+ 2. **Run soundness review.** After all sections are reviewed and the spec is drafted, invoke `harness-soundness-review --mode spec` against the draft. Do not proceed to write the spec to `docs/` until the soundness review converges with no remaining issues.
88
110
 
89
- When the project has `docs/specs/`, write proposals to `docs/changes/<feature>/proposal.md` instead. This keeps change proposals separate from established specs. Fall back to the existing behavior (`docs/specs/`) when no `docs/specs/` directory exists yet.
111
+ 3. **Write the spec to `docs/`.** Use the project's existing spec naming convention. If none exists, use `docs/specs/YYYY-MM-DD-<feature-name>.md`.
90
112
 
91
- 3. **Run `harness validate`** to verify the spec file is properly placed and the project remains healthy.
113
+ When the project has `docs/specs/`, write proposals to `docs/changes/<feature>/proposal.md` instead. This keeps change proposals separate from established specs. Fall back to the existing behavior (`docs/specs/`) when no `docs/specs/` directory exists yet.
92
114
 
93
- 4. **Ask for final sign-off.** Present the complete spec file path and a one-paragraph summary. The human must explicitly approve before this skill is complete.
115
+ 4. **Run `harness validate`** to verify the spec file is properly placed and the project remains healthy.
116
+
117
+ 5. **Request sign-off via `emit_interaction`:**
118
+
119
+ ```json
120
+ emit_interaction({
121
+ path: "<project-root>",
122
+ type: "confirmation",
123
+ confirmation: {
124
+ text: "Approve spec at <file-path>?",
125
+ context: "<one-paragraph summary of the design>"
126
+ }
127
+ })
128
+ ```
129
+
130
+ The human must explicitly approve before this skill is complete.
131
+
132
+ 6. **Write handoff and suggest transition.** After the human approves the spec:
133
+
134
+ Write `.harness/handoff.json`:
135
+
136
+ ```json
137
+ {
138
+ "fromSkill": "harness-brainstorming",
139
+ "phase": "VALIDATE",
140
+ "summary": "<1-sentence spec summary>",
141
+ "artifacts": ["<spec file path>"],
142
+ "decisions": [{ "what": "<decision>", "why": "<rationale>" }],
143
+ "contextKeywords": ["<domain keywords from Phase 2>"]
144
+ }
145
+ ```
146
+
147
+ Call `emit_interaction`:
148
+
149
+ ```json
150
+ {
151
+ "type": "transition",
152
+ "transition": {
153
+ "completedPhase": "brainstorming",
154
+ "suggestedNext": "planning",
155
+ "reason": "Spec approved and written to docs/",
156
+ "artifacts": ["<spec file path>"],
157
+ "requiresConfirmation": true,
158
+ "summary": "<Spec title> -- <key design choices>. <N> success criteria, <N> implementation phases."
159
+ }
160
+ }
161
+ ```
162
+
163
+ If the user confirms: invoke harness-planning with the spec path.
164
+ If the user declines: stop. The handoff is written for future invocation.
94
165
 
95
166
  ---
96
167
 
@@ -147,6 +218,7 @@ Converge on a recommendation that addresses all concerns before presenting the d
147
218
  - **`harness check-docs`** — Run to verify the spec does not conflict with existing documentation.
148
219
  - **Spec location** — Specs go to `docs/` (or `docs/specs/` if the project uses that convention). Follow existing naming patterns.
149
220
  - **Handoff to harness-planning** — Once the spec is approved, invoke harness-planning to create the implementation plan from the spec.
221
+ - **`emit_interaction`** -- Call at the end of Phase 4 to suggest transitioning to harness-planning. Uses confirmed transition (waits for user approval).
150
222
 
151
223
  #### Requirement Phrasing
152
224
 
@@ -15,6 +15,7 @@ tools:
15
15
  - Edit
16
16
  - Glob
17
17
  - Grep
18
+ - emit_interaction
18
19
  cli:
19
20
  command: harness skill run harness-brainstorming
20
21
  args:
@@ -45,3 +46,4 @@ state:
45
46
  files: []
46
47
  depends_on:
47
48
  - harness-planning
49
+ - harness-soundness-review