@harness-engineering/cli 1.26.0 → 1.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/skills/README.md +1 -0
- package/dist/agents/skills/claude-code/harness-brainstorming/SKILL.md +33 -5
- package/dist/agents/skills/claude-code/harness-execution/SKILL.md +6 -0
- package/dist/agents/skills/claude-code/harness-planning/SKILL.md +25 -1
- package/dist/agents/skills/claude-code/initialize-harness-project/SKILL.md +22 -6
- package/dist/agents/skills/claude-code/initialize-harness-project/skill.yaml +2 -1
- package/dist/agents/skills/claude-code/initialize-test-suite-project/SKILL.md +415 -0
- package/dist/agents/skills/claude-code/initialize-test-suite-project/skill.yaml +35 -0
- package/dist/agents/skills/codex/harness-brainstorming/SKILL.md +33 -5
- package/dist/agents/skills/codex/harness-execution/SKILL.md +6 -0
- package/dist/agents/skills/codex/harness-planning/SKILL.md +25 -1
- package/dist/agents/skills/codex/initialize-harness-project/SKILL.md +22 -6
- package/dist/agents/skills/codex/initialize-harness-project/skill.yaml +2 -1
- package/dist/agents/skills/codex/initialize-test-suite-project/SKILL.md +415 -0
- package/dist/agents/skills/codex/initialize-test-suite-project/skill.yaml +35 -0
- package/dist/agents/skills/cursor/harness-brainstorming/SKILL.md +33 -5
- package/dist/agents/skills/cursor/harness-execution/SKILL.md +6 -0
- package/dist/agents/skills/cursor/harness-planning/SKILL.md +25 -1
- package/dist/agents/skills/cursor/initialize-harness-project/SKILL.md +22 -6
- package/dist/agents/skills/cursor/initialize-harness-project/skill.yaml +2 -1
- package/dist/agents/skills/cursor/initialize-test-suite-project/SKILL.md +415 -0
- package/dist/agents/skills/cursor/initialize-test-suite-project/skill.yaml +35 -0
- package/dist/agents/skills/gemini-cli/harness-brainstorming/SKILL.md +33 -5
- package/dist/agents/skills/gemini-cli/harness-execution/SKILL.md +6 -0
- package/dist/agents/skills/gemini-cli/harness-planning/SKILL.md +25 -1
- package/dist/agents/skills/gemini-cli/initialize-harness-project/SKILL.md +22 -6
- package/dist/agents/skills/gemini-cli/initialize-harness-project/skill.yaml +2 -1
- package/dist/agents/skills/gemini-cli/initialize-test-suite-project/SKILL.md +415 -0
- package/dist/agents/skills/gemini-cli/initialize-test-suite-project/skill.yaml +35 -0
- package/dist/agents/skills/tests/initialize-test-suite-project.test.ts +152 -0
- package/dist/{agents-md-OPOZA5L7.js → agents-md-VI3HLR7E.js} +3 -3
- package/dist/{architecture-PMVMO6SF.js → architecture-ZDDKEVID.js} +4 -4
- package/dist/{assess-project-ZW7EKNIT.js → assess-project-Y6W7YDUA.js} +1 -1
- package/dist/bin/harness-mcp.js +16 -15
- package/dist/bin/harness.js +27 -27
- package/dist/{check-phase-gate-NTLAU3LO.js → check-phase-gate-CXR3VM22.js} +4 -4
- package/dist/{chunk-CAS3TS4Y.js → chunk-2BPPS6YQ.js} +793 -94
- package/dist/{chunk-VV2PJT4K.js → chunk-2FPUPRCY.js} +777 -598
- package/dist/{chunk-IFHAUFJX.js → chunk-3AMQYWGT.js} +2 -2
- package/dist/{chunk-FI3D6D7U.js → chunk-56A6OXVA.js} +9 -9
- package/dist/{chunk-QYSWNPXZ.js → chunk-7GY6WNEI.js} +1 -1
- package/dist/{chunk-ZBQ3ZY75.js → chunk-AMRC4FU2.js} +44 -41
- package/dist/{chunk-JZ6GORAK.js → chunk-B66LRB5M.js} +1 -1
- package/dist/{chunk-KFE2X7LG.js → chunk-BK4DJIIY.js} +4 -4
- package/dist/{chunk-G6SYTGOH.js → chunk-DBIX3X4H.js} +2 -2
- package/dist/{chunk-KXIAHHHP.js → chunk-FUND5WJR.js} +2 -2
- package/dist/{chunk-JWSVLC4I.js → chunk-JV4Y2U5F.js} +1 -1
- package/dist/{chunk-RNAGPTKF.js → chunk-K56DTX7G.js} +6 -6
- package/dist/{chunk-EXTWTJRF.js → chunk-N6B6RKQQ.js} +1 -1
- package/dist/{chunk-JBJ4AVE4.js → chunk-NY7DTZ6K.js} +3 -3
- package/dist/{chunk-Z2JORLRT.js → chunk-OLW7BJ5N.js} +1 -1
- package/dist/{chunk-HAOBHL3W.js → chunk-ORNEK65Y.js} +1 -1
- package/dist/{chunk-7JNZXJKY.js → chunk-PNNFCVW4.js} +5 -5
- package/dist/{chunk-NIOB6FTG.js → chunk-Q3ZLVMQM.js} +1 -1
- package/dist/{chunk-NVGQO4VM.js → chunk-RAVD7QLY.js} +8 -8
- package/dist/{chunk-J3O64D2A.js → chunk-TSVYBDDE.js} +1 -1
- package/dist/{chunk-KSFUJT5B.js → chunk-TY2ESLVL.js} +1 -1
- package/dist/{chunk-4KSKV5MK.js → chunk-VKS3F46M.js} +1 -1
- package/dist/{chunk-UBRD5FH4.js → chunk-WZ7UHPT3.js} +9 -9
- package/dist/{chunk-77EZGPSR.js → chunk-YC4EYIER.js} +8 -2
- package/dist/{chunk-6SCA4NEZ.js → chunk-ZN6ROTYP.js} +1 -1
- package/dist/{ci-workflow-H52EMCL6.js → ci-workflow-EW37KVPS.js} +3 -3
- package/dist/{create-skill-6QWJHQYS.js → create-skill-4T5CBSJ2.js} +2 -2
- package/dist/{dist-TG63OKA5.js → dist-CJDGASPP.js} +2 -2
- package/dist/{dist-PGQ32ZI7.js → dist-NCNAXUFD.js} +1 -1
- package/dist/{docs-GP4VUSIB.js → docs-4XI2FQW2.js} +4 -4
- package/dist/{engine-KQG5RVXX.js → engine-4L4CDTHU.js} +3 -3
- package/dist/{entropy-RXESIYKC.js → entropy-PBYSIQYS.js} +3 -3
- package/dist/{feedback-HS7ZYXOU.js → feedback-OTIFW5MK.js} +1 -1
- package/dist/{generate-agent-definitions-I4B7CVOB.js → generate-agent-definitions-CZGUXIIN.js} +4 -4
- package/dist/{graph-loader-TIVI6NQ7.js → graph-loader-RDXSEBD7.js} +1 -1
- package/dist/index.js +27 -27
- package/dist/{loader-CWAH6B4H.js → loader-UZOXCWFC.js} +3 -3
- package/dist/{mcp-KHK5KYER.js → mcp-GWVVV6LH.js} +16 -15
- package/dist/{performance-WDW5WS3J.js → performance-5UQPP3XX.js} +4 -4
- package/dist/{review-pipeline-QOZGWCTY.js → review-pipeline-65V4EO6O.js} +3 -3
- package/dist/{runtime-SFEFRPLX.js → runtime-PXX7HNB3.js} +3 -3
- package/dist/{scan-IJ7EYTF7.js → scan-WM7XDUF7.js} +1 -1
- package/dist/{security-2K7UUK6T.js → security-CAYDRZIZ.js} +1 -1
- package/dist/{validate-HXM6DXRZ.js → validate-CWGXR7QM.js} +4 -4
- package/dist/{validate-cross-check-ULQLEOME.js → validate-cross-check-BKCNLZYG.js} +3 -3
- package/package.json +4 -4
- package/dist/agents/commands/claude-code/harness/harness.md +0 -36
- package/dist/agents/commands/codex/AGENTS.md +0 -39
- package/dist/agents/commands/codex/harness/add-harness-component/SKILL.md +0 -204
- package/dist/agents/commands/codex/harness/add-harness-component/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/cleanup-dead-code/SKILL.md +0 -257
- package/dist/agents/commands/codex/harness/cleanup-dead-code/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/detect-doc-drift/SKILL.md +0 -191
- package/dist/agents/commands/codex/harness/detect-doc-drift/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/enforce-architecture/SKILL.md +0 -289
- package/dist/agents/commands/codex/harness/enforce-architecture/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-architecture-advisor/SKILL.md +0 -442
- package/dist/agents/commands/codex/harness/harness-architecture-advisor/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-autopilot/SKILL.md +0 -929
- package/dist/agents/commands/codex/harness/harness-autopilot/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-brainstorming/SKILL.md +0 -418
- package/dist/agents/commands/codex/harness/harness-brainstorming/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-code-review/SKILL.md +0 -850
- package/dist/agents/commands/codex/harness/harness-code-review/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-codebase-cleanup/SKILL.md +0 -236
- package/dist/agents/commands/codex/harness/harness-codebase-cleanup/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-debugging/SKILL.md +0 -378
- package/dist/agents/commands/codex/harness/harness-debugging/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-dependency-health/SKILL.md +0 -190
- package/dist/agents/commands/codex/harness/harness-dependency-health/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-docs-pipeline/SKILL.md +0 -472
- package/dist/agents/commands/codex/harness/harness-docs-pipeline/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-execution/SKILL.md +0 -522
- package/dist/agents/commands/codex/harness/harness-execution/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-hotspot-detector/SKILL.md +0 -172
- package/dist/agents/commands/codex/harness/harness-hotspot-detector/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-impact-analysis/SKILL.md +0 -195
- package/dist/agents/commands/codex/harness/harness-impact-analysis/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-integrity/SKILL.md +0 -178
- package/dist/agents/commands/codex/harness/harness-integrity/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-onboarding/SKILL.md +0 -299
- package/dist/agents/commands/codex/harness/harness-onboarding/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-perf/SKILL.md +0 -272
- package/dist/agents/commands/codex/harness/harness-perf/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-planning/SKILL.md +0 -592
- package/dist/agents/commands/codex/harness/harness-planning/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-refactoring/SKILL.md +0 -181
- package/dist/agents/commands/codex/harness/harness-refactoring/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-release-readiness/SKILL.md +0 -701
- package/dist/agents/commands/codex/harness/harness-release-readiness/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-roadmap/SKILL.md +0 -607
- package/dist/agents/commands/codex/harness/harness-roadmap/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-security-scan/SKILL.md +0 -147
- package/dist/agents/commands/codex/harness/harness-security-scan/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-skill-authoring/SKILL.md +0 -314
- package/dist/agents/commands/codex/harness/harness-skill-authoring/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-soundness-review/SKILL.md +0 -1280
- package/dist/agents/commands/codex/harness/harness-soundness-review/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-supply-chain-audit/SKILL.md +0 -255
- package/dist/agents/commands/codex/harness/harness-supply-chain-audit/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-tdd/SKILL.md +0 -189
- package/dist/agents/commands/codex/harness/harness-tdd/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-test-advisor/SKILL.md +0 -171
- package/dist/agents/commands/codex/harness/harness-test-advisor/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-verification/SKILL.md +0 -433
- package/dist/agents/commands/codex/harness/harness-verification/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-verify/SKILL.md +0 -170
- package/dist/agents/commands/codex/harness/harness-verify/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/initialize-harness-project/SKILL.md +0 -244
- package/dist/agents/commands/codex/harness/initialize-harness-project/agents/openai.yaml +0 -3
- package/dist/agents/commands/cursor/harness/add-harness-component.mdc +0 -200
- package/dist/agents/commands/cursor/harness/cleanup-dead-code.mdc +0 -253
- package/dist/agents/commands/cursor/harness/detect-doc-drift.mdc +0 -187
- package/dist/agents/commands/cursor/harness/enforce-architecture.mdc +0 -304
- package/dist/agents/commands/cursor/harness/harness-architecture-advisor.mdc +0 -457
- package/dist/agents/commands/cursor/harness/harness-autopilot.mdc +0 -924
- package/dist/agents/commands/cursor/harness/harness-brainstorming.mdc +0 -414
- package/dist/agents/commands/cursor/harness/harness-code-review.mdc +0 -865
- package/dist/agents/commands/cursor/harness/harness-codebase-cleanup.mdc +0 -232
- package/dist/agents/commands/cursor/harness/harness-debugging.mdc +0 -374
- package/dist/agents/commands/cursor/harness/harness-dependency-health.mdc +0 -187
- package/dist/agents/commands/cursor/harness/harness-docs-pipeline.mdc +0 -468
- package/dist/agents/commands/cursor/harness/harness-execution.mdc +0 -518
- package/dist/agents/commands/cursor/harness/harness-hotspot-detector.mdc +0 -169
- package/dist/agents/commands/cursor/harness/harness-impact-analysis.mdc +0 -192
- package/dist/agents/commands/cursor/harness/harness-integrity.mdc +0 -175
- package/dist/agents/commands/cursor/harness/harness-onboarding.mdc +0 -296
- package/dist/agents/commands/cursor/harness/harness-perf.mdc +0 -268
- package/dist/agents/commands/cursor/harness/harness-planning.mdc +0 -587
- package/dist/agents/commands/cursor/harness/harness-refactoring.mdc +0 -177
- package/dist/agents/commands/cursor/harness/harness-release-readiness.mdc +0 -697
- package/dist/agents/commands/cursor/harness/harness-roadmap.mdc +0 -603
- package/dist/agents/commands/cursor/harness/harness-security-scan.mdc +0 -162
- package/dist/agents/commands/cursor/harness/harness-skill-authoring.mdc +0 -300
- package/dist/agents/commands/cursor/harness/harness-soundness-review.mdc +0 -1275
- package/dist/agents/commands/cursor/harness/harness-supply-chain-audit.mdc +0 -252
- package/dist/agents/commands/cursor/harness/harness-tdd.mdc +0 -185
- package/dist/agents/commands/cursor/harness/harness-test-advisor.mdc +0 -168
- package/dist/agents/commands/cursor/harness/harness-verification.mdc +0 -429
- package/dist/agents/commands/cursor/harness/harness-verify.mdc +0 -167
- package/dist/agents/commands/cursor/harness/initialize-harness-project.mdc +0 -240
- package/dist/agents/commands/gemini-cli/harness/harness.toml +0 -277
- package/dist/{chunk-RRHUCDRD.js → chunk-ZP5E7YET.js} +3 -3
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
<!-- Generated by harness generate-slash-commands. Do not edit. -->
|
|
2
|
-
|
|
3
|
-
# Harness Onboarding
|
|
4
|
-
|
|
5
|
-
> Navigate an existing harness-managed project and generate a structured orientation for new team members. Map the codebase, understand constraints, identify the adoption level, and produce a summary that gets someone productive fast.
|
|
6
|
-
|
|
7
|
-
## When to Use
|
|
8
|
-
|
|
9
|
-
- A new developer (human or agent) is joining a harness-managed project for the first time
|
|
10
|
-
- Resuming work on a project after extended time away and needing to re-orient
|
|
11
|
-
- When `on_project_init` triggers fire in an existing project (agent starting a new session)
|
|
12
|
-
- When someone asks "how does this project work?" or "where do I start?"
|
|
13
|
-
- NOT when initializing a new project (use initialize-harness-project)
|
|
14
|
-
- NOT when the project has no harness configuration (onboard to harness first with initialize-harness-project)
|
|
15
|
-
- NOT when deep-diving into a specific module (use standard code exploration — onboarding gives the big picture)
|
|
16
|
-
|
|
17
|
-
## Process
|
|
18
|
-
|
|
19
|
-
### Phase 1: READ — Load Project Configuration
|
|
20
|
-
|
|
21
|
-
1. **Read `AGENTS.md`.** This is the primary source of truth for agent behavior in the project. Note:
|
|
22
|
-
- Project description and purpose
|
|
23
|
-
- Architecture overview
|
|
24
|
-
- Conventions and coding standards
|
|
25
|
-
- Constraints and forbidden patterns
|
|
26
|
-
- Any special instructions or warnings
|
|
27
|
-
|
|
28
|
-
2. **Read `harness.config.json`.** Extract:
|
|
29
|
-
- Project name and stack
|
|
30
|
-
- Adoption level (basic, intermediate, advanced)
|
|
31
|
-
- Layer definitions and their directory mappings
|
|
32
|
-
- Dependency constraints between layers
|
|
33
|
-
- Registered skills and their triggers
|
|
34
|
-
- Persona configuration (if present)
|
|
35
|
-
|
|
36
|
-
3. **Read `.harness/learnings.md`** if it exists. This contains hard-won insights from previous sessions — decisions made, gotchas discovered, patterns that worked or failed. Summarize the most recent and most important entries.
|
|
37
|
-
|
|
38
|
-
4. **Read `.harness/state.json`** if it exists. This reveals what was happening in the last session — current phase, active task, any blockers that were recorded.
|
|
39
|
-
|
|
40
|
-
### Phase 2: MAP — Understand the Codebase Structure
|
|
41
|
-
|
|
42
|
-
1. **Map the technology stack.** Identify from package files, configuration, and code:
|
|
43
|
-
- Language(s) and version(s)
|
|
44
|
-
- Framework(s) and major libraries
|
|
45
|
-
- Test framework and test runner command
|
|
46
|
-
- Build tool and build command
|
|
47
|
-
- Package manager
|
|
48
|
-
- Database or data stores (if applicable)
|
|
49
|
-
|
|
50
|
-
2. **Map the architecture.** Walk the directory structure and identify:
|
|
51
|
-
- Top-level organization pattern (monorepo, single package, workspace)
|
|
52
|
-
- Source code location and entry points
|
|
53
|
-
- Layer boundaries (from `harness.config.json` and actual directory structure)
|
|
54
|
-
- Shared utilities or common modules
|
|
55
|
-
- Configuration files and their purposes
|
|
56
|
-
|
|
57
|
-
3. **Map the conventions.** Look for patterns in existing code:
|
|
58
|
-
- File naming conventions (kebab-case, camelCase, PascalCase)
|
|
59
|
-
- Test file location and naming (co-located, separate directory, `.test.ts` vs `.spec.ts`)
|
|
60
|
-
- Import style (relative, aliases, barrel files)
|
|
61
|
-
- Error handling patterns
|
|
62
|
-
- Logging patterns
|
|
63
|
-
- Code formatting (detect from config files: `.prettierrc`, `.eslintrc`, `biome.json`)
|
|
64
|
-
|
|
65
|
-
4. **Map the constraints.** Identify what is restricted:
|
|
66
|
-
- Forbidden imports (from `harness.config.json` dependency constraints)
|
|
67
|
-
- Layer boundary rules (which layers can import from which)
|
|
68
|
-
- Linting rules that encode architectural decisions
|
|
69
|
-
- Any constraints documented in `AGENTS.md` that are not yet automated
|
|
70
|
-
|
|
71
|
-
5. **Map the design system** (when present). Look for:
|
|
72
|
-
- `design-system/tokens.json` — W3C DTCG design tokens (colors, typography, spacing)
|
|
73
|
-
- `design-system/DESIGN.md` — Aesthetic intent, anti-patterns, platform notes
|
|
74
|
-
- `harness.config.json` `design` block — strictness level, enabled platforms, token path
|
|
75
|
-
- Active design skills — check if `harness-design-system`, `harness-accessibility`, `harness-design`, `harness-design-web`, `harness-design-mobile` are available
|
|
76
|
-
- Design constraint violations — run a quick `harness-accessibility` scan to surface any existing issues
|
|
77
|
-
- Token coverage — how many components reference tokens vs. hardcoded values
|
|
78
|
-
|
|
79
|
-
If no design system exists, note this as a potential improvement area.
|
|
80
|
-
|
|
81
|
-
6. **Map the concerns.** Identify areas that need attention:
|
|
82
|
-
- Are there TODOs or FIXMEs in the code?
|
|
83
|
-
- Does `harness validate` pass cleanly, or are there warnings?
|
|
84
|
-
- Are there known blockers in `.harness/state.json`?
|
|
85
|
-
- Is documentation up to date with the code?
|
|
86
|
-
- Are there tests? What is the approximate coverage?
|
|
87
|
-
|
|
88
|
-
### Graph-Enhanced Context (when available)
|
|
89
|
-
|
|
90
|
-
When a knowledge graph exists at `.harness/graph/`, use graph queries for faster, more accurate codebase mapping:
|
|
91
|
-
|
|
92
|
-
- `query_graph` — map architecture automatically from module and layer nodes, replacing manual directory walking
|
|
93
|
-
- `search_similar` — find entry points and key files by querying for high-connectivity nodes
|
|
94
|
-
- `get_relationships` — show layer dependencies and module structure as a traversable graph
|
|
95
|
-
|
|
96
|
-
Graph queries produce a complete architecture map in seconds, including transitive relationships that directory inspection misses. Fall back to file-based commands if no graph is available.
|
|
97
|
-
|
|
98
|
-
### Phase 3: ORIENT — Identify Adoption Level and Maturity
|
|
99
|
-
|
|
100
|
-
1. **Confirm the adoption level** matches what `harness.config.json` declares:
|
|
101
|
-
- Basic: `AGENTS.md` and `harness.config.json` exist but no layers or constraints
|
|
102
|
-
- Intermediate: Layers defined, dependency constraints enforced, at least one custom skill
|
|
103
|
-
- Advanced: Personas, state management, learnings, CI integration
|
|
104
|
-
|
|
105
|
-
2. **Assess harness health.** Run `harness validate` and note any issues. A project that declares intermediate but fails validation is not truly intermediate.
|
|
106
|
-
|
|
107
|
-
3. **Identify available skills.** List the skills configured for the project. Note which are custom (project-specific) vs. standard (harness-provided). Each skill represents a workflow the team has formalized.
|
|
108
|
-
|
|
109
|
-
### Phase 4: SUMMARIZE — Generate Orientation Output
|
|
110
|
-
|
|
111
|
-
1. **Produce a structured orientation summary.** This is the deliverable. Format:
|
|
112
|
-
|
|
113
|
-
```markdown
|
|
114
|
-
# Project Orientation: <project-name>
|
|
115
|
-
|
|
116
|
-
## Overview
|
|
117
|
-
|
|
118
|
-
<1-2 sentence project description from AGENTS.md>
|
|
119
|
-
|
|
120
|
-
## Stack
|
|
121
|
-
|
|
122
|
-
- Language: <language> <version>
|
|
123
|
-
- Framework: <framework>
|
|
124
|
-
- Tests: <test framework> (`<test command>`)
|
|
125
|
-
- Build: <build tool> (`<build command>`)
|
|
126
|
-
- Package manager: <pm>
|
|
127
|
-
|
|
128
|
-
## Architecture
|
|
129
|
-
|
|
130
|
-
<Brief description of top-level organization>
|
|
131
|
-
|
|
132
|
-
### Layers
|
|
133
|
-
|
|
134
|
-
| Layer | Directories | Can Import From |
|
|
135
|
-
| ------- | ----------- | ----------------- |
|
|
136
|
-
| <layer> | <dirs> | <allowed imports> |
|
|
137
|
-
|
|
138
|
-
### Key Components
|
|
139
|
-
|
|
140
|
-
- <component>: <purpose> (<location>)
|
|
141
|
-
|
|
142
|
-
## Constraints
|
|
143
|
-
|
|
144
|
-
- <constraint 1>
|
|
145
|
-
- <constraint 2>
|
|
146
|
-
|
|
147
|
-
## Conventions
|
|
148
|
-
|
|
149
|
-
- <convention 1>
|
|
150
|
-
- <convention 2>
|
|
151
|
-
|
|
152
|
-
## Design System
|
|
153
|
-
|
|
154
|
-
- **Tokens:** [present/absent] ([token count] tokens in [group count] groups)
|
|
155
|
-
- **Aesthetic Intent:** [present/absent] (style: [style], strictness: [level])
|
|
156
|
-
- **Platforms:** [web, mobile, or none configured]
|
|
157
|
-
- **Accessibility:** [baseline scan result — e.g., "3 warnings, 0 errors"]
|
|
158
|
-
- **Design Skills:** [list of available design skills]
|
|
159
|
-
|
|
160
|
-
## Harness Status
|
|
161
|
-
|
|
162
|
-
- Adoption level: <level>
|
|
163
|
-
- Validation: <pass/fail with summary>
|
|
164
|
-
- Available skills: <list>
|
|
165
|
-
- State: <current phase/task if applicable>
|
|
166
|
-
|
|
167
|
-
## Recent Learnings
|
|
168
|
-
|
|
169
|
-
- <most relevant learnings from .harness/learnings.md>
|
|
170
|
-
|
|
171
|
-
## Getting Started
|
|
172
|
-
|
|
173
|
-
1. <first thing to do>
|
|
174
|
-
2. <second thing to do>
|
|
175
|
-
3. <third thing to do>
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
2. **Tailor "Getting Started" to the audience.** For a new developer: how to set up the dev environment and run tests. For an agent resuming work: what the current task is and what to do next. For a reviewer: where to look and what constraints to check.
|
|
179
|
-
|
|
180
|
-
3. **Present the summary to the human.** Do not write it to a file unless asked. The orientation is a conversation artifact, not a project artifact.
|
|
181
|
-
|
|
182
|
-
## Harness Integration
|
|
183
|
-
|
|
184
|
-
- **`harness validate`** — Run during onboarding to assess project health and identify any configuration issues.
|
|
185
|
-
- **`harness skill list`** — List available skills to understand what workflows the team has formalized.
|
|
186
|
-
- **`harness check-deps`** — Run to verify dependency constraints are passing, which confirms layer boundaries are respected.
|
|
187
|
-
- **`harness state show`** — View current state to understand where the last session left off.
|
|
188
|
-
- **`AGENTS.md`** — Primary source of project context and agent instructions.
|
|
189
|
-
- **`harness.config.json`** — Source of structural configuration (layers, constraints, skills).
|
|
190
|
-
- **`.harness/learnings.md`** — Historical context and institutional knowledge.
|
|
191
|
-
|
|
192
|
-
## Success Criteria
|
|
193
|
-
|
|
194
|
-
- All four configuration sources were read (`AGENTS.md`, `harness.config.json`, `.harness/learnings.md`, `.harness/state.json`)
|
|
195
|
-
- Technology stack is accurately identified (language, framework, test runner, build tool)
|
|
196
|
-
- Architecture is mapped with correct layer boundaries and dependency directions
|
|
197
|
-
- Conventions are identified from actual code patterns, not assumed
|
|
198
|
-
- Constraints are enumerated from both `harness.config.json` and `AGENTS.md`
|
|
199
|
-
- Adoption level is confirmed (not just declared — validated)
|
|
200
|
-
- A structured orientation summary is produced with all sections filled
|
|
201
|
-
- The "Getting Started" section is actionable and tailored to the audience
|
|
202
|
-
- `harness validate` was run and results are reported
|
|
203
|
-
|
|
204
|
-
## Examples
|
|
205
|
-
|
|
206
|
-
### Example: Onboarding to an Intermediate TypeScript Project
|
|
207
|
-
|
|
208
|
-
**READ:**
|
|
209
|
-
|
|
210
|
-
```
|
|
211
|
-
Read AGENTS.md:
|
|
212
|
-
- Project: Widget API — REST service for widget lifecycle management
|
|
213
|
-
- Stack: TypeScript, Express, Vitest, PostgreSQL
|
|
214
|
-
- Conventions: zod validation, repository pattern, kebab-case files
|
|
215
|
-
|
|
216
|
-
Read harness.config.json:
|
|
217
|
-
- Level: intermediate
|
|
218
|
-
- Layers: presentation (src/routes/), business (src/services/), data (src/repositories/)
|
|
219
|
-
- Constraints: presentation → business OK, business → data OK, data → presentation FORBIDDEN
|
|
220
|
-
|
|
221
|
-
Read .harness/learnings.md:
|
|
222
|
-
- "Date comparison needs UTC normalization — use Date.now()"
|
|
223
|
-
- "The notifications table has a unique constraint on (userId, type) — upsert, don't insert"
|
|
224
|
-
|
|
225
|
-
Read .harness/state.json:
|
|
226
|
-
- Position: Phase execute, Task 4 of 6
|
|
227
|
-
- Blocker: none
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
**MAP:**
|
|
231
|
-
|
|
232
|
-
```
|
|
233
|
-
Stack: TypeScript 5.3, Express 4, Vitest 1.2, pg (node-postgres)
|
|
234
|
-
Architecture: Single package, 3 layers, entry point src/index.ts
|
|
235
|
-
Conventions: kebab-case files, co-located tests (.test.ts), barrel exports
|
|
236
|
-
Constraints: 3 layers with strict downward-only imports
|
|
237
|
-
Concerns: harness validate passes, 47 tests all passing
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
**ORIENT:**
|
|
241
|
-
|
|
242
|
-
```
|
|
243
|
-
Adoption level: intermediate (confirmed — layers defined, constraints enforced)
|
|
244
|
-
Skills: harness-tdd, harness-execution, harness-code-review
|
|
245
|
-
State: Mid-execution on a 6-task notification feature plan
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
**SUMMARIZE:**
|
|
249
|
-
|
|
250
|
-
```
|
|
251
|
-
Produce orientation with all sections. Getting Started for this context:
|
|
252
|
-
1. Read the plan at docs/plans/2026-03-14-notifications-plan.md
|
|
253
|
-
2. Resume execution at Task 4 (state shows Tasks 1-3 complete)
|
|
254
|
-
3. Note the UTC normalization gotcha from learnings before working with dates
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
### Example: Onboarding to a Basic Project
|
|
258
|
-
|
|
259
|
-
**READ:**
|
|
260
|
-
|
|
261
|
-
```
|
|
262
|
-
Read AGENTS.md — exists, minimal content
|
|
263
|
-
Read harness.config.json — level: basic, no layers defined
|
|
264
|
-
No .harness/learnings.md
|
|
265
|
-
No .harness/state.json
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
**MAP and SUMMARIZE:**
|
|
269
|
-
|
|
270
|
-
```
|
|
271
|
-
Adoption level: basic (confirmed — no layers or constraints)
|
|
272
|
-
Getting Started:
|
|
273
|
-
1. Run npm install && npm test to verify the project builds and tests pass
|
|
274
|
-
2. Read AGENTS.md for project context and conventions
|
|
275
|
-
3. Consider migrating to intermediate level to add layer boundaries
|
|
276
|
-
(use initialize-harness-project to upgrade)
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
## Rationalizations to Reject
|
|
280
|
-
|
|
281
|
-
| Rationalization | Reality |
|
|
282
|
-
| --- | --- |
|
|
283
|
-
| "I can skip reading .harness/learnings.md since it is just historical notes" | Learnings contain hard-won insights from previous sessions -- decisions made, gotchas discovered, patterns that worked or failed. Skipping them means repeating mistakes already diagnosed. |
|
|
284
|
-
| "The harness.config.json says intermediate, so I can report that without validation" | Declared adoption level must be confirmed, not assumed. A project that declares intermediate but fails harness validate is not truly intermediate. |
|
|
285
|
-
| "I will map the architecture by reading the directory names since that is faster than checking conventions in actual code" | Conventions must be identified from actual code patterns, not assumed from directory structure. File naming, import style, and error handling can only be verified by reading real source files. |
|
|
286
|
-
|
|
287
|
-
## Adoption Maturity
|
|
288
|
-
|
|
289
|
-
A mental model for where a team sits on the harness adoption curve. Not prescriptive — just orientation.
|
|
290
|
-
|
|
291
|
-
| Level | Name | Description |
|
|
292
|
-
| ----- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
293
|
-
| 1 | **Manual** | Write `CLAUDE.md` by hand, run commands manually. Harness is a reference, not a tool. |
|
|
294
|
-
| 2 | **Repeatable** | Skills installed, agent follows conventions consistently. Workflows are codified but enforcement is human-driven. |
|
|
295
|
-
| 3 | **Automated** | Mechanical gates in CI. `harness validate` runs on PRs. Failures auto-log to `.harness/failures.md`. The system catches mistakes before humans do. |
|
|
296
|
-
| 4 | **Self-improving** | Learnings accumulate in `.harness/learnings.md`. Agents reference past failures before planning. Institutional knowledge compounds across sessions and team members. |
|
|
297
|
-
|
|
298
|
-
Most teams start at Level 1 and move up as they see the value. There is no pressure to reach Level 4 — each level delivers real benefits on its own.
|
|
299
|
-
|
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
<!-- Generated by harness generate-slash-commands. Do not edit. -->
|
|
2
|
-
|
|
3
|
-
# Harness Perf
|
|
4
|
-
|
|
5
|
-
> Performance enforcement and benchmark management. Tier-based gates block commits and merges based on complexity, coupling, and runtime regression severity.
|
|
6
|
-
|
|
7
|
-
## When to Use
|
|
8
|
-
|
|
9
|
-
- After code changes to verify performance hasn't degraded
|
|
10
|
-
- On PRs to enforce performance budgets
|
|
11
|
-
- For periodic performance audits
|
|
12
|
-
- NOT for initial development (use harness-tdd for that)
|
|
13
|
-
- NOT for brainstorming performance improvements (use harness-brainstorming)
|
|
14
|
-
|
|
15
|
-
## Process
|
|
16
|
-
|
|
17
|
-
### Iron Law
|
|
18
|
-
|
|
19
|
-
**No merge with Tier 1 performance violations. No commit with cyclomatic complexity exceeding the error threshold.**
|
|
20
|
-
|
|
21
|
-
Tier 1 violations are non-negotiable blockers. If a Tier 1 violation is detected, execution halts and the violation must be resolved before any further progress. Do not attempt workarounds.
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
### Phase 1: ANALYZE — Structural and Coupling Checks
|
|
26
|
-
|
|
27
|
-
1. **Run structural checks.** Execute `harness check-perf --structural` to compute complexity metrics for all changed files:
|
|
28
|
-
- Cyclomatic complexity per function
|
|
29
|
-
- Nesting depth per function
|
|
30
|
-
- File length (lines of code)
|
|
31
|
-
- Parameter count per function
|
|
32
|
-
|
|
33
|
-
2. **Run coupling checks.** Execute `harness check-perf --coupling` to compute coupling metrics:
|
|
34
|
-
- Fan-in and fan-out per module
|
|
35
|
-
- Afferent and efferent coupling
|
|
36
|
-
- Transitive dependency depth
|
|
37
|
-
- Circular dependency detection
|
|
38
|
-
|
|
39
|
-
3. **Classify violations by tier:**
|
|
40
|
-
- **Tier 1 (error, block commit):** Cyclomatic complexity > 15, circular dependencies, hotspot in top 5%
|
|
41
|
-
- **Tier 2 (warning, block merge):** Complexity > 10, nesting > 4, fan-out > 10, size budget exceeded
|
|
42
|
-
- **Tier 3 (info, no gate):** File length > 300, fan-in > 20, transitive depth > 30
|
|
43
|
-
|
|
44
|
-
4. **If Tier 1 violations found,** report them immediately and STOP. Do not proceed to benchmarks. The violations must be fixed first.
|
|
45
|
-
|
|
46
|
-
5. **If no violations found,** proceed to Phase 2.
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
### Graph Availability
|
|
51
|
-
|
|
52
|
-
Hotspot scoring and coupling analysis benefit from the knowledge graph but work without it.
|
|
53
|
-
|
|
54
|
-
**Staleness sensitivity:** Medium -- auto-refresh if >10 commits stale. Hotspot scoring uses churn data which does not change rapidly.
|
|
55
|
-
|
|
56
|
-
| Feature | With Graph | Without Graph |
|
|
57
|
-
| ------------------------------------ | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
58
|
-
| Hotspot scoring (churn x complexity) | `GraphComplexityAdapter` computes from graph nodes | `git log --format="%H" -- <file>` for per-file commit count; complexity from `check-perf --structural` output; multiply manually |
|
|
59
|
-
| Coupling ratio | `GraphCouplingAdapter` computes from graph edges | Parse import statements, count fan-out/fan-in per file |
|
|
60
|
-
| Critical path resolution | Graph inference (high fan-in) + `@perf-critical` annotations | `@perf-critical` annotations only; grep for decorator/comment |
|
|
61
|
-
| Transitive dep depth | Graph BFS depth | Import chain follow, 2 levels deep |
|
|
62
|
-
|
|
63
|
-
**Notice when running without graph:** "Running without graph (run `harness scan` to enable hotspot scoring and coupling analysis)"
|
|
64
|
-
|
|
65
|
-
**Impact on tiers:** Without graph, Tier 1 hotspot detection is degraded. Hotspot scoring falls back to churn-only (no complexity multiplication). This limitation is documented in the performance report output.
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
### Phase 2: BENCHMARK — Runtime Performance
|
|
70
|
-
|
|
71
|
-
This phase runs only when `.bench.ts` files exist in the project. If none are found, skip to Phase 3.
|
|
72
|
-
|
|
73
|
-
1. **Check baseline lock-in.** Before running benchmarks, verify baselines are kept in sync:
|
|
74
|
-
- List all `.bench.ts` files changed in this PR: `git diff --name-only | grep '.bench.ts'`
|
|
75
|
-
- If any `.bench.ts` files are new or modified:
|
|
76
|
-
- Check if `.harness/perf/baselines.json` is also modified in this PR
|
|
77
|
-
- If NOT modified: flag as Tier 2 warning: "Benchmark files changed but baselines not updated. Run `harness perf baselines update` and commit the result."
|
|
78
|
-
- If modified: verify the updated baselines include entries for all changed benchmarks
|
|
79
|
-
- If no `.bench.ts` files changed: skip this check
|
|
80
|
-
- This check also runs standalone via `--check-baselines` flag
|
|
81
|
-
|
|
82
|
-
2. **Check for benchmark files.** Scan the project for `*.bench.ts` files. If none exist, skip this phase entirely.
|
|
83
|
-
|
|
84
|
-
3. **Verify clean working tree.** Run `git status --porcelain`. If there are uncommitted changes, STOP. Benchmarks on dirty trees produce unreliable results.
|
|
85
|
-
|
|
86
|
-
4. **Run benchmarks.** Execute `harness perf bench` to run all benchmark suites.
|
|
87
|
-
|
|
88
|
-
5. **Load baselines.** Read `.harness/perf/baselines.json` for previous benchmark results. If no baselines exist, treat this as a baseline-capture run.
|
|
89
|
-
|
|
90
|
-
6. **Compare results against baselines** using the `RegressionDetector`:
|
|
91
|
-
- Calculate percentage change for each benchmark
|
|
92
|
-
- Apply noise margin (default: 3%) before flagging regressions
|
|
93
|
-
- Distinguish between critical-path and non-critical-path benchmarks
|
|
94
|
-
|
|
95
|
-
7. **Resolve critical paths** via `CriticalPathResolver`:
|
|
96
|
-
- Check `@perf-critical` annotations in source files
|
|
97
|
-
- Check graph fan-in data (functions called by many consumers)
|
|
98
|
-
- Functions in the critical path set have stricter thresholds
|
|
99
|
-
|
|
100
|
-
8. **Flag regressions by tier:**
|
|
101
|
-
- **Tier 1:** >5% regression on a critical path benchmark
|
|
102
|
-
- **Tier 2:** >10% regression on a non-critical-path benchmark
|
|
103
|
-
- **Tier 3:** >5% regression on a non-critical-path benchmark (within noise margin consideration)
|
|
104
|
-
|
|
105
|
-
9. **If this is a baseline-capture run,** report results without regression comparison. Recommend running `harness perf baselines update` to persist.
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
### Phase 3: REPORT — Generate Performance Report
|
|
110
|
-
|
|
111
|
-
1. **Format violations by tier.** Present Tier 1 violations first (most severe), then Tier 2, then Tier 3. Each violation entry includes:
|
|
112
|
-
- File path and function name
|
|
113
|
-
- Metric name and current value
|
|
114
|
-
- Threshold that was exceeded
|
|
115
|
-
- Tier classification and gate impact
|
|
116
|
-
|
|
117
|
-
2. **Show hotspot scores** for top functions if knowledge graph data is available:
|
|
118
|
-
- Query the graph for functions with high churn + high fan-in
|
|
119
|
-
- Rank by composite hotspot score
|
|
120
|
-
- Flag any hotspots that also have performance violations
|
|
121
|
-
|
|
122
|
-
3. **Show benchmark regression summary** if benchmarks ran:
|
|
123
|
-
- Table of benchmark name, baseline, current, delta percentage, tier
|
|
124
|
-
- Highlight critical-path benchmarks with a marker
|
|
125
|
-
- Show noise margin and whether the regression exceeds it
|
|
126
|
-
|
|
127
|
-
4. **Recommend specific actions** for each Tier 1 and Tier 2 violation:
|
|
128
|
-
- For high complexity: suggest extract-method or strategy pattern refactoring
|
|
129
|
-
- For high coupling: suggest interface extraction or dependency inversion
|
|
130
|
-
- For benchmark regressions: suggest profiling the specific code path
|
|
131
|
-
- For size budget violations: suggest module decomposition
|
|
132
|
-
|
|
133
|
-
5. **Output the report** in structured markdown format suitable for PR comments or CI output.
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
### Phase 4: ENFORCE — Apply Gate Decisions
|
|
138
|
-
|
|
139
|
-
1. **Tier 1 violations present** — FAIL. Block commit and merge. List all Tier 1 violations with their locations and values. The developer must fix these before proceeding.
|
|
140
|
-
|
|
141
|
-
2. **Tier 2 violations present, no Tier 1** — WARN. Allow commit but block merge until addressed. List all Tier 2 violations. These must be resolved before the PR can be merged.
|
|
142
|
-
|
|
143
|
-
3. **Only Tier 3 or no violations** — PASS. Proceed normally. Log Tier 3 violations as informational notes.
|
|
144
|
-
|
|
145
|
-
4. **Record gate decision** in `.harness/state.json` under a `perfGate` key:
|
|
146
|
-
|
|
147
|
-
```json
|
|
148
|
-
{
|
|
149
|
-
"perfGate": {
|
|
150
|
-
"result": "pass|warn|fail",
|
|
151
|
-
"tier1Count": 0,
|
|
152
|
-
"tier2Count": 0,
|
|
153
|
-
"tier3Count": 0,
|
|
154
|
-
"timestamp": "ISO-8601"
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
5. **Exit with appropriate code:** 0 for pass, 1 for fail, 0 for warn (with warning output).
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
## Harness Integration
|
|
164
|
-
|
|
165
|
-
- **`harness check-perf`** — Primary command for all performance checks. Runs structural and coupling analysis.
|
|
166
|
-
- **`harness check-perf --structural`** — Run only structural complexity checks.
|
|
167
|
-
- **`harness check-perf --coupling`** — Run only coupling analysis.
|
|
168
|
-
- **`harness perf bench`** — Run benchmarks only. Requires clean working tree.
|
|
169
|
-
- **`harness perf baselines show`** — View current benchmark baselines.
|
|
170
|
-
- **`harness perf baselines update`** — Persist current benchmark results as new baselines.
|
|
171
|
-
- **`harness perf --check-baselines`** -- Verify baseline file is updated when benchmarks change. Runs the baseline lock-in check standalone.
|
|
172
|
-
- **`harness perf critical-paths`** — View the current critical path set and how it was determined.
|
|
173
|
-
- **`harness validate`** — Run after enforcement to verify overall project health.
|
|
174
|
-
- **`harness graph scan`** — Refresh knowledge graph for accurate hotspot scoring.
|
|
175
|
-
|
|
176
|
-
## Tier Classification
|
|
177
|
-
|
|
178
|
-
| Tier | Severity | Gate | Examples |
|
|
179
|
-
| ---- | -------- | ------------ | --------------------------------------------------------------------------------------------------- |
|
|
180
|
-
| 1 | error | Block commit | Cyclomatic complexity > 15, >5% regression on critical path, hotspot in top 5%, circular dependency |
|
|
181
|
-
| 2 | warning | Block merge | Complexity > 10, nesting > 4, >10% regression elsewhere, fan-out > 10, size budget exceeded |
|
|
182
|
-
| 3 | info | None | File length > 300 lines, fan-in > 20, transitive depth > 30, >5% non-critical regression |
|
|
183
|
-
|
|
184
|
-
## Success Criteria
|
|
185
|
-
|
|
186
|
-
- All Tier 1 violations are resolved before proceeding
|
|
187
|
-
- Performance report follows structured format with tier classification
|
|
188
|
-
- Benchmark regressions are compared against noise margin before flagging
|
|
189
|
-
- Gate decision is recorded in state
|
|
190
|
-
- `harness validate` passes after enforcement
|
|
191
|
-
|
|
192
|
-
## Examples
|
|
193
|
-
|
|
194
|
-
### Example: PR with High Complexity Function
|
|
195
|
-
|
|
196
|
-
```
|
|
197
|
-
Phase 1: ANALYZE
|
|
198
|
-
harness check-perf --structural
|
|
199
|
-
Result: processOrderBatch() in src/orders/processor.ts has cyclomatic complexity 18 (Tier 1, threshold: 15)
|
|
200
|
-
|
|
201
|
-
Phase 2: BENCHMARK — skipped (Tier 1 violation found)
|
|
202
|
-
|
|
203
|
-
Phase 3: REPORT
|
|
204
|
-
TIER 1 VIOLATIONS (1):
|
|
205
|
-
- src/orders/processor.ts:processOrderBatch — complexity 18 > 15
|
|
206
|
-
Recommendation: Extract validation and transformation into separate functions
|
|
207
|
-
|
|
208
|
-
Phase 4: ENFORCE
|
|
209
|
-
Result: FAIL — 1 Tier 1 violation. Commit blocked.
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### Example: Benchmark Regression on Critical Path
|
|
213
|
-
|
|
214
|
-
```
|
|
215
|
-
Phase 1: ANALYZE — no structural violations
|
|
216
|
-
|
|
217
|
-
Phase 2: BENCHMARK
|
|
218
|
-
harness perf bench
|
|
219
|
-
Baseline: parseDocument 4.2ms, current: 4.8ms (+14.3%)
|
|
220
|
-
parseDocument is @perf-critical — Tier 1 threshold applies (>5%)
|
|
221
|
-
|
|
222
|
-
Phase 3: REPORT
|
|
223
|
-
TIER 1 VIOLATIONS (1):
|
|
224
|
-
- parseDocument: 14.3% regression on critical path (threshold: 5%)
|
|
225
|
-
Recommendation: Profile parseDocument to identify the regression source
|
|
226
|
-
|
|
227
|
-
Phase 4: ENFORCE
|
|
228
|
-
Result: FAIL — 1 Tier 1 violation. Merge blocked.
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### Example: Clean PR with Minor Warnings
|
|
232
|
-
|
|
233
|
-
```
|
|
234
|
-
Phase 1: ANALYZE
|
|
235
|
-
harness check-perf --structural --coupling
|
|
236
|
-
Result: src/utils/formatter.ts has 320 lines (Tier 3, threshold: 300)
|
|
237
|
-
|
|
238
|
-
Phase 2: BENCHMARK
|
|
239
|
-
harness perf bench — all within noise margin
|
|
240
|
-
|
|
241
|
-
Phase 3: REPORT
|
|
242
|
-
TIER 3 INFO (1):
|
|
243
|
-
- src/utils/formatter.ts: 320 lines > 300 line threshold
|
|
244
|
-
No Tier 1 or Tier 2 violations.
|
|
245
|
-
|
|
246
|
-
Phase 4: ENFORCE
|
|
247
|
-
Result: PASS — no blocking violations.
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
## Rationalizations to Reject
|
|
251
|
-
|
|
252
|
-
| Rationalization | Reality |
|
|
253
|
-
| --- | --- |
|
|
254
|
-
| "The cyclomatic complexity is 16 but the function is straightforward, so I can override the Tier 1 threshold" | Tier 1 violations are non-negotiable blockers. No merge with Tier 1 performance violations. If a threshold needs adjustment, reconfigure with documented justification. |
|
|
255
|
-
| "The benchmark regression is only 6% and it is probably just noise" | The noise margin (default 3%) is applied before flagging. A 6% regression on a perf-critical path exceeds the Tier 1 threshold even after noise consideration. |
|
|
256
|
-
| "The working tree has a small uncommitted change but it should not affect benchmark results" | No running benchmarks with a dirty working tree. Uncommitted changes invalidate benchmark results. |
|
|
257
|
-
| "I will update the baselines to match the new performance numbers rather than fixing the regression" | Baselines must come from fresh runs against committed code. Silently moving the goalposts defeats the purpose of performance gates. |
|
|
258
|
-
|
|
259
|
-
## Gates
|
|
260
|
-
|
|
261
|
-
- **No ignoring Tier 1 violations.** They must be fixed or the threshold must be reconfigured (with documented justification).
|
|
262
|
-
- **No running benchmarks with dirty working tree.** Uncommitted changes invalidate benchmark results.
|
|
263
|
-
- **No updating baselines without running benchmarks.** Baselines must come from fresh runs against committed code.
|
|
264
|
-
- **No suppressing violations without documentation.** If a threshold is relaxed, the rationale must be documented in the project configuration.
|
|
265
|
-
|
|
266
|
-
## Escalation
|
|
267
|
-
|
|
268
|
-
- **When Tier 1 violations cannot be fixed within the current task:** Propose refactoring the function into smaller units, or raising the threshold with a documented justification. Do not silently skip the violation.
|
|
269
|
-
- **When benchmark results are noisy or inconsistent:** Increase warmup iterations, pin the runtime environment, or run benchmarks in isolation. Report the noise level so the developer can make an informed decision.
|
|
270
|
-
- **When critical path detection seems wrong:** Check `@perf-critical` annotations in source files and verify graph fan-in thresholds. The critical path set can be overridden in `.harness/perf/critical-paths.json`.
|
|
271
|
-
- **When a violation is a false positive:** Document it with a `// perf-ignore: <reason>` comment and add the exception to `.harness/perf/exceptions.json`.
|
|
272
|
-
|