Harness Diagnostics -- Agent Harness Self-Diagnostic Skill
12-principle based harness maturity diagnostics and improvement suggestion tool.
Read-only: Performs diagnostics + suggestions only; does not directly modify files.
Input
$ARGUMENTS
Mode Selection
| Mode |
Trigger Keywords |
Purpose |
| Setup |
"environment setup", "setup", "initialize" |
Initial check + recommendations for agent collaboration environment |
| Audit |
"harness diagnostics", "check", "audit", default |
12-principle scoring + improvement roadmap |
| Maintenance |
"drift check", "cleanup", "maintenance" |
Stale code/doc detection + cleanup suggestions |
Default to Audit mode if no keywords match.
12-Principle Scoring System
Each principle scores 0-8, total 100 (12 x 8 = 96, remaining 4 points as overall bonus).
| # |
Principle |
Check Target |
| 1 |
Agent Entry Point |
CLAUDE.md/AGENTS.md existence + clear agent entry point |
| 2 |
Map, Not Manual |
Is documentation a "map" vs "manual"? (pointers, hierarchy) |
| 3 |
Invariant Enforcement |
Do tools auto-block mistakes? (all hooks registered in settings.json, linters, CI) |
| 4 |
Convention Over Configuration |
Explicit rule files exist (rules/, .eslintrc, prettier, etc.) |
| 5 |
Progressive Disclosure |
Information layering (CLAUDE.md -> rules/ -> docs/ -> code) |
| 6 |
Layered Architecture |
Unidirectional dependencies, layer separation |
| 7 |
Garbage Collection |
Mechanism for cleaning stale files/docs/dependencies |
| 8 |
Observability |
Self-verifiable (tests, build, typecheck) |
| 9 |
Knowledge in Repo |
Knowledge lives in repo (ADR, docs/, inline explanations) |
| 10 |
Reproducibility |
Same input -> same output (lock files, env config) |
| 11 |
Modularity |
Predictable change impact (module boundaries, interfaces) |
| 12 |
Self-Documentation |
Code explains intent (naming, structure) |
Maturity Levels
| Level |
Score |
Description |
| L1 None |
0-19 |
No harness. Agent reasons from scratch every time |
| L2 Basic |
20-39 |
Basic setup exists. Some automation |
| L3 Structured |
40-59 |
Structured rules and tools. Mostly automated |
| L4 Optimized |
60-79 |
Optimized harness. High agent autonomy |
| L5 Autonomous |
80-100 |
Autonomous operation. Self-diagnosis/repair capable |
Execution Procedure
Setup Mode
- Explore project root (Explore sub-agent)
- Check existence of these items:
CLAUDE.md or .claude/CLAUDE.md
rules/ or .claude/rules/
docs/ directory
- Package manager lock files
- Linter/formatter configuration
- Test framework configuration
- CI/CD configuration
- Recommend creation for missing items (do not create directly)
- Recommendation priority: P0 (immediate) -> P1 (recommended) -> P2 (improvement)
Audit Mode
- Run checks for each of the 12 principles:
- File/directory existence (Glob)
- Configuration file content analysis (Read)
- Pattern search (Grep)
- Hook checks cover all hooks registered in settings.json — however,
notchi-hook.sh is optional (notification-only), so its absence is not penalized
- Score each principle (0-8)
- Calculate overall bonus (0-4):
- Synergy between principles (e.g., hooks + rules + docs all present: +2)
- Consistency (naming conventions, structural uniformity: +2)
- Output report
Maintenance Mode
- Detect stale items:
- docs/ files unmodified for 30+ days
- Dependencies in package.json not imported anywhere
- Collect TODO/FIXME comments
- Empty directories
- Unused configuration files
- Detect drift:
- CLAUDE.md content vs actual project structure mismatch
- rules/ rules vs code reality mismatch
- Output cleanup suggestion list (do not modify directly)
Output Format
# Harness Diagnostics Report
## Project: {project name}
## Mode: {Setup | Audit | Maintenance}
## Date: {YYYY-MM-DD}
---
## Per-Principle Scores
| # | Principle | Score | Rationale |
|---|-----------|-------|-----------|
| 1 | Agent Entry Point | X/8 | ... |
| 2 | Map, Not Manual | X/8 | ... |
| ... | ... | ... | ... |
| 12 | Self-Documentation | X/8 | ... |
**Overall Bonus**: X/4
**Total Score**: XX/100
## Maturity Level: LX {level name}
---
## Top 3 Improvement Suggestions
### 1. {suggestion title} (P{0-2})
- **Current**: {current state}
- **Improvement**: {specific action}
- **Impact**: {expected score increase}
### 2. ...
### 3. ...
---
## Detailed Analysis
{per-principle detailed description -- as collapsible sections}
Constraints
- Read-only: No file creation/modification/deletion
- Diagnostic tools: Glob, Grep, Read, Bash (read-only commands only)
- Output provided as markdown report only
- Instead of direct modification, suggest in "doing X will improve score by Y" format
- Leverage sub-agents to protect main context
1---2name: harness-diagnostics-23description: Self-diagnostics and improvement suggestions based on 12-principle agent harness. No automatic invocation — run manually via /harness-diagnostics (choose setup/audit/maintenance mode by argument). NOT for: code implementation, bug fixes, writing tests.4---56# Harness Diagnostics -- Agent Harness Self-Diagnostic Skill7812-principle based harness maturity diagnostics and improvement suggestion tool.9**Read-only**: Performs diagnostics + suggestions only; does not directly modify files.1011## Input1213$ARGUMENTS1415## Mode Selection1617| Mode | Trigger Keywords | Purpose |18|------|-----------------|---------|19| **Setup** | "environment setup", "setup", "initialize" | Initial check + recommendations for agent collaboration environment |20| **Audit** | "harness diagnostics", "check", "audit", default | 12-principle scoring + improvement roadmap |21| **Maintenance** | "drift check", "cleanup", "maintenance" | Stale code/doc detection + cleanup suggestions |2223Default to **Audit** mode if no keywords match.2425---2627## 12-Principle Scoring System2829Each principle scores 0-8, total 100 (12 x 8 = 96, remaining 4 points as overall bonus).3031| # | Principle | Check Target |32|---|-----------|-------------|33| 1 | **Agent Entry Point** | CLAUDE.md/AGENTS.md existence + clear agent entry point |34| 2 | **Map, Not Manual** | Is documentation a "map" vs "manual"? (pointers, hierarchy) |35| 3 | **Invariant Enforcement** | Do tools auto-block mistakes? (all hooks registered in settings.json, linters, CI) |36| 4 | **Convention Over Configuration** | Explicit rule files exist (rules/, .eslintrc, prettier, etc.) |37| 5 | **Progressive Disclosure** | Information layering (CLAUDE.md -> rules/ -> docs/ -> code) |38| 6 | **Layered Architecture** | Unidirectional dependencies, layer separation |39| 7 | **Garbage Collection** | Mechanism for cleaning stale files/docs/dependencies |40| 8 | **Observability** | Self-verifiable (tests, build, typecheck) |41| 9 | **Knowledge in Repo** | Knowledge lives in repo (ADR, docs/, inline explanations) |42| 10 | **Reproducibility** | Same input -> same output (lock files, env config) |43| 11 | **Modularity** | Predictable change impact (module boundaries, interfaces) |44| 12 | **Self-Documentation** | Code explains intent (naming, structure) |4546### Maturity Levels4748| Level | Score | Description |49|-------|-------|-------------|50| **L1 None** | 0-19 | No harness. Agent reasons from scratch every time |51| **L2 Basic** | 20-39 | Basic setup exists. Some automation |52| **L3 Structured** | 40-59 | Structured rules and tools. Mostly automated |53| **L4 Optimized** | 60-79 | Optimized harness. High agent autonomy |54| **L5 Autonomous** | 80-100 | Autonomous operation. Self-diagnosis/repair capable |5556---5758## Execution Procedure5960### Setup Mode61621. Explore project root (Explore sub-agent)632. Check existence of these items:64 - `CLAUDE.md` or `.claude/CLAUDE.md`65 - `rules/` or `.claude/rules/`66 - `docs/` directory67 - Package manager lock files68 - Linter/formatter configuration69 - Test framework configuration70 - CI/CD configuration713. **Recommend creation** for missing items (do not create directly)724. Recommendation priority: P0 (immediate) -> P1 (recommended) -> P2 (improvement)7374### Audit Mode75761. Run checks for each of the 12 principles:77 - File/directory existence (Glob)78 - Configuration file content analysis (Read)79 - Pattern search (Grep)80 - Hook checks cover all hooks registered in settings.json — however, `notchi-hook.sh` is optional (notification-only), so its absence is not penalized812. Score each principle (0-8)823. Calculate overall bonus (0-4):83 - Synergy between principles (e.g., hooks + rules + docs all present: +2)84 - Consistency (naming conventions, structural uniformity: +2)854. Output report8687### Maintenance Mode88891. Detect stale items:90 - docs/ files unmodified for 30+ days91 - Dependencies in package.json not imported anywhere92 - Collect TODO/FIXME comments93 - Empty directories94 - Unused configuration files952. Detect drift:96 - CLAUDE.md content vs actual project structure mismatch97 - rules/ rules vs code reality mismatch983. Output cleanup suggestion list (do not modify directly)99100---101102## Output Format103104```markdown105# Harness Diagnostics Report106107## Project: {project name}108## Mode: {Setup | Audit | Maintenance}109## Date: {YYYY-MM-DD}110111---112113## Per-Principle Scores114115| # | Principle | Score | Rationale |116|---|-----------|-------|-----------|117| 1 | Agent Entry Point | X/8 | ... |118| 2 | Map, Not Manual | X/8 | ... |119| ... | ... | ... | ... |120| 12 | Self-Documentation | X/8 | ... |121122**Overall Bonus**: X/4123**Total Score**: XX/100124125## Maturity Level: LX {level name}126127---128129## Top 3 Improvement Suggestions130131### 1. {suggestion title} (P{0-2})132- **Current**: {current state}133- **Improvement**: {specific action}134- **Impact**: {expected score increase}135136### 2. ...137138### 3. ...139140---141142## Detailed Analysis143{per-principle detailed description -- as collapsible sections}144```145146---147148## Constraints149150- **Read-only**: No file creation/modification/deletion151- Diagnostic tools: Glob, Grep, Read, Bash (read-only commands only)152- Output provided as markdown report only153- Instead of direct modification, suggest in "doing X will improve score by Y" format154- Leverage sub-agents to protect main context