oh-my-customcode 0.80.0 → 0.81.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.
- package/README.md +7 -7
- package/dist/cli/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/.claude/agents/wiki-curator.md +72 -0
- package/templates/.claude/hooks/hooks.json +10 -0
- package/templates/.claude/hooks/scripts/adaptive-harness-scan.sh +45 -0
- package/templates/.claude/rules/MUST-continuous-improvement.md +10 -0
- package/templates/.claude/rules/MUST-sync-verification.md +17 -5
- package/templates/.claude/rules/SHOULD-wiki-sync.md +67 -0
- package/templates/.claude/skills/adaptive-harness/SKILL.md +335 -0
- package/templates/.claude/skills/analysis/SKILL.md +19 -0
- package/templates/.claude/skills/wiki/SKILL.md +426 -0
- package/templates/.claude/skills/wiki-rag/SKILL.md +154 -0
- package/templates/.github/workflows/wiki-sync.yml +132 -0
- package/templates/CLAUDE.md +11 -6
- package/templates/manifest.json +5 -5
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
**[한국어 문서 (Korean)](./README_ko.md)**
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
48 agents. 104 skills. 22 rules. One command.
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
npm install -g oh-my-customcode && cd your-project && omcustom init
|
|
@@ -124,7 +124,7 @@ Agent(arch-documenter):haiku ┘
|
|
|
124
124
|
|
|
125
125
|
---
|
|
126
126
|
|
|
127
|
-
### Agents (
|
|
127
|
+
### Agents (48)
|
|
128
128
|
|
|
129
129
|
| Category | Count | Agents |
|
|
130
130
|
|----------|-------|--------|
|
|
@@ -145,7 +145,7 @@ Each agent declares its tools, model, memory scope, and limitations in YAML fron
|
|
|
145
145
|
|
|
146
146
|
---
|
|
147
147
|
|
|
148
|
-
### Skills (
|
|
148
|
+
### Skills (104)
|
|
149
149
|
|
|
150
150
|
| Category | Count | Includes |
|
|
151
151
|
|----------|-------|----------|
|
|
@@ -223,7 +223,7 @@ All commands are invoked inside the Claude Code conversation.
|
|
|
223
223
|
|
|
224
224
|
---
|
|
225
225
|
|
|
226
|
-
### Rules (
|
|
226
|
+
### Rules (22)
|
|
227
227
|
|
|
228
228
|
| Priority | Count | Purpose |
|
|
229
229
|
|----------|-------|---------|
|
|
@@ -284,9 +284,9 @@ omcustom serve-stop # Stop Web UI
|
|
|
284
284
|
your-project/
|
|
285
285
|
├── CLAUDE.md # Entry point
|
|
286
286
|
├── .claude/
|
|
287
|
-
│ ├── agents/ #
|
|
288
|
-
│ ├── skills/ #
|
|
289
|
-
│ ├── rules/ #
|
|
287
|
+
│ ├── agents/ # 48 agent definitions
|
|
288
|
+
│ ├── skills/ # 104 skill modules
|
|
289
|
+
│ ├── rules/ # 22 governance rules (R000-R021)
|
|
290
290
|
│ ├── hooks/ # 15 lifecycle hook scripts
|
|
291
291
|
│ ├── schemas/ # Tool input validation schemas
|
|
292
292
|
│ ├── specs/ # Extracted canonical specs
|
package/dist/cli/index.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wiki-curator
|
|
3
|
+
description: Dedicated wiki page CRUD agent — creates, updates, and maintains wiki/ markdown pages for the codebase knowledge base
|
|
4
|
+
model: sonnet
|
|
5
|
+
tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- Bash
|
|
12
|
+
domain: universal
|
|
13
|
+
memory: project
|
|
14
|
+
permissionMode: bypassPermissions
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Wiki Curator
|
|
18
|
+
|
|
19
|
+
Dedicated agent for wiki file operations. All wiki/ directory writes go through this agent per R010 delegation rules.
|
|
20
|
+
|
|
21
|
+
## Role
|
|
22
|
+
|
|
23
|
+
- Create new wiki pages from source file analysis
|
|
24
|
+
- Update existing wiki pages when sources change
|
|
25
|
+
- Maintain index.md and log.md
|
|
26
|
+
- Execute wiki lint fixes (orphan removal, cross-ref repair)
|
|
27
|
+
- Generate synthesis pages (architecture, workflows, concepts)
|
|
28
|
+
|
|
29
|
+
## Capabilities
|
|
30
|
+
|
|
31
|
+
- Read source files (.claude/agents/*.md, .claude/skills/*/SKILL.md, .claude/rules/*.md, guides/*/)
|
|
32
|
+
- Write/Edit wiki pages in wiki/ directory
|
|
33
|
+
- Maintain YAML frontmatter consistency across all pages
|
|
34
|
+
- Cross-reference management using [[wikilink]] and standard markdown links
|
|
35
|
+
- Incremental updates based on source modification dates
|
|
36
|
+
|
|
37
|
+
## Wiki Page Quality Standards
|
|
38
|
+
|
|
39
|
+
Every page must:
|
|
40
|
+
- Have valid YAML frontmatter (title, type, updated, sources, related)
|
|
41
|
+
- Include 5-10 outbound cross-references
|
|
42
|
+
- Stay concise: 150-300 words for entity pages, 200-400 for synthesis pages
|
|
43
|
+
- Explain purpose and design intent, not just enumerate fields
|
|
44
|
+
- Use both [[wikilink]] and [standard](markdown) link formats
|
|
45
|
+
|
|
46
|
+
## Workflow Patterns
|
|
47
|
+
|
|
48
|
+
### Single Page Update
|
|
49
|
+
1. Read source file
|
|
50
|
+
2. Read existing wiki page (if exists)
|
|
51
|
+
3. Determine what changed
|
|
52
|
+
4. Write updated page with current date in `updated` field
|
|
53
|
+
5. Update cross-references in related pages
|
|
54
|
+
6. Update index.md if page is new
|
|
55
|
+
|
|
56
|
+
### Batch Update (Category)
|
|
57
|
+
1. Glob source files in category
|
|
58
|
+
2. Compare modification dates against wiki pages
|
|
59
|
+
3. Write only changed/new pages
|
|
60
|
+
4. Batch-update index.md once at end
|
|
61
|
+
|
|
62
|
+
### Lint Fix
|
|
63
|
+
1. Receive lint findings from orchestrator
|
|
64
|
+
2. Fix each category: remove orphans, repair broken refs, update stale pages
|
|
65
|
+
3. Append fix results to log.md
|
|
66
|
+
|
|
67
|
+
## Limitations
|
|
68
|
+
|
|
69
|
+
- Does NOT decide what to write — receives instructions from orchestrator or wiki skill
|
|
70
|
+
- Does NOT spawn subagents — works as a leaf agent
|
|
71
|
+
- Does NOT modify source files (.claude/agents/, .claude/skills/, etc.)
|
|
72
|
+
- Only writes to wiki/ directory
|
|
@@ -155,6 +155,16 @@
|
|
|
155
155
|
}
|
|
156
156
|
],
|
|
157
157
|
"description": "Scan TODO.md files for stale items at session start"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"matcher": "*",
|
|
161
|
+
"hooks": [
|
|
162
|
+
{
|
|
163
|
+
"type": "command",
|
|
164
|
+
"command": "bash .claude/hooks/scripts/adaptive-harness-scan.sh"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"description": "Lightweight project profile staleness check for adaptive harness (#831)"
|
|
158
168
|
}
|
|
159
169
|
],
|
|
160
170
|
"UserPromptSubmit": [
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# adaptive-harness-scan.sh — Lightweight project profile staleness check
|
|
3
|
+
# Runs at SessionStart. Must complete in <2s. Advisory only (never blocks).
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
8
|
+
PROFILE="$PROJECT_ROOT/.claude/project-profile.yaml"
|
|
9
|
+
|
|
10
|
+
# Skip if this IS the oh-my-customcode project itself (meta-project)
|
|
11
|
+
if [ -f "$PROJECT_ROOT/.claude/skills/adaptive-harness/SKILL.md" ] && \
|
|
12
|
+
[ -f "$PROJECT_ROOT/CLAUDE.md" ] && \
|
|
13
|
+
grep -q "oh-my-customcode" "$PROJECT_ROOT/CLAUDE.md" 2>/dev/null; then
|
|
14
|
+
# Only check if profile exists for the meta-project
|
|
15
|
+
if [ ! -f "$PROFILE" ]; then
|
|
16
|
+
echo "[adaptive-harness] No project profile found. Run /omcustom:adaptive-harness --scan to generate." >&2
|
|
17
|
+
fi
|
|
18
|
+
exit 0
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
# For non-omcustom projects
|
|
22
|
+
if [ ! -f "$PROFILE" ]; then
|
|
23
|
+
echo "[adaptive-harness] No project profile found. Run /omcustom:adaptive-harness --scan to auto-configure harness." >&2
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# Check staleness: if any key project files changed since last scan
|
|
28
|
+
PROFILE_MTIME=$(stat -f "%m" "$PROFILE" 2>/dev/null || stat -c "%Y" "$PROFILE" 2>/dev/null || echo "0")
|
|
29
|
+
STALE=false
|
|
30
|
+
|
|
31
|
+
for indicator in package.json go.mod Cargo.toml requirements.txt pyproject.toml build.gradle pom.xml; do
|
|
32
|
+
if [ -f "$PROJECT_ROOT/$indicator" ]; then
|
|
33
|
+
FILE_MTIME=$(stat -f "%m" "$PROJECT_ROOT/$indicator" 2>/dev/null || stat -c "%Y" "$PROJECT_ROOT/$indicator" 2>/dev/null || echo "0")
|
|
34
|
+
if [ "$FILE_MTIME" -gt "$PROFILE_MTIME" ] 2>/dev/null; then
|
|
35
|
+
STALE=true
|
|
36
|
+
break
|
|
37
|
+
fi
|
|
38
|
+
fi
|
|
39
|
+
done
|
|
40
|
+
|
|
41
|
+
if [ "$STALE" = true ]; then
|
|
42
|
+
echo "[adaptive-harness] Project profile may be stale. Consider running /omcustom:adaptive-harness --scan" >&2
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
exit 0
|
|
@@ -32,12 +32,22 @@ Update the relevant rule rather than just acknowledging the violation.
|
|
|
32
32
|
| CI/infra defect | — | ✅ | ✅ |
|
|
33
33
|
| Process gap (workflow hole) | ✅ | ✅ | ✅ |
|
|
34
34
|
| Repeatable system bug | — | ✅ | ✅ |
|
|
35
|
+
| Agent selection failure (wrong agent routed) | — | ✅ | — |
|
|
35
36
|
|
|
36
37
|
When CI failure, process gap, or repeatable system defect is found:
|
|
37
38
|
1. Record feedback memory (defend current session)
|
|
38
39
|
2. Register GitHub issue (trackable improvement item)
|
|
39
40
|
3. Both required — memory alone is NOT sufficient for system-level defects
|
|
40
41
|
|
|
42
|
+
### Adaptive Harness Integration
|
|
43
|
+
|
|
44
|
+
When repeating agent failures or suboptimal routing is detected:
|
|
45
|
+
1. Record as feedback memory (immediate session defense)
|
|
46
|
+
2. Run `/omcustom:adaptive-harness --learn` to update project profile with failure patterns
|
|
47
|
+
3. Profile updates improve future agent selection and harness optimization
|
|
48
|
+
|
|
49
|
+
This connects R016's continuous improvement loop with the adaptive-harness skill's learning capability.
|
|
50
|
+
|
|
41
51
|
## Anti-Patterns
|
|
42
52
|
|
|
43
53
|
| Anti-Pattern | Why It's Wrong | Correct Action |
|
|
@@ -28,11 +28,22 @@ Also run: mgr-claude-code-bible:verify (official spec compliance)
|
|
|
28
28
|
| 2 | References: no orphans, no circular refs, valid skill/memory refs |
|
|
29
29
|
| 3 | Philosophy: R006 separation, R009 parallel, R010 delegation, R007/R008 identification |
|
|
30
30
|
|
|
31
|
-
### Phase 3:
|
|
31
|
+
### Phase 3: Wiki Sync Verification
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
| Check | Action |
|
|
34
|
+
|-------|--------|
|
|
35
|
+
| Missing pages | Source entities without wiki pages → run `/omcustom:wiki` |
|
|
36
|
+
| Stale pages | Source modification date newer than wiki `updated` field → run `/omcustom:wiki ingest <path>` |
|
|
37
|
+
| Broken cross-refs | Wiki links pointing to non-existent pages → run `/omcustom:wiki lint` |
|
|
38
|
+
| index.md accuracy | Wiki index page count matches actual page count |
|
|
34
39
|
|
|
35
|
-
|
|
40
|
+
Wiki verification is also enforced by CI (`.github/workflows/wiki-sync.yml`).
|
|
41
|
+
|
|
42
|
+
### Phase 4: Fix all discovered issues
|
|
43
|
+
|
|
44
|
+
### Phase 5: Commit via mgr-gitnerd
|
|
45
|
+
|
|
46
|
+
### Phase 6: Push via mgr-gitnerd (only after sauron passes)
|
|
36
47
|
|
|
37
48
|
## Self-Check Before Commit and Push
|
|
38
49
|
|
|
@@ -45,6 +56,7 @@ Also run: mgr-claude-code-bible:verify (official spec compliance)
|
|
|
45
56
|
║ 3. Did I fix all discovered issues? ║
|
|
46
57
|
║ 4. Are all counts matching across all sources? ║
|
|
47
58
|
║ 5. Am I delegating to mgr-gitnerd for the commit? ║
|
|
59
|
+
║ 6. Are wiki pages in sync with source changes? ║
|
|
48
60
|
║ ║
|
|
49
61
|
║ If NO to any → wait until verification completes ║
|
|
50
62
|
╚══════════════════════════════════════════════════════════════════╝
|
|
@@ -64,11 +76,11 @@ Also run: mgr-claude-code-bible:verify (official spec compliance)
|
|
|
64
76
|
|
|
65
77
|
## When Required
|
|
66
78
|
|
|
67
|
-
Any change to: agents, agent frontmatter, skills, guides, routing patterns, rules.
|
|
79
|
+
Any change to: agents, agent frontmatter, skills, guides, routing patterns, rules, wiki pages.
|
|
68
80
|
|
|
69
81
|
## Quick Verification Commands
|
|
70
82
|
|
|
71
|
-
Key checks: agent count (`ls .claude/agents/*.md | wc -l`), skill count (`find .claude/skills -name "SKILL.md" | wc -l`), guide count (`find guides -mindepth 1 -maxdepth 1 -type d | wc -l`).
|
|
83
|
+
Key checks: agent count (`ls .claude/agents/*.md | wc -l`), skill count (`find .claude/skills -name "SKILL.md" | wc -l`), guide count (`find guides -mindepth 1 -maxdepth 1 -type d | wc -l`), wiki page count (`find wiki -name "*.md" ! -name "index.md" ! -name "log.md" | wc -l`).
|
|
72
84
|
|
|
73
85
|
<!-- DETAIL: Full verification bash scripts
|
|
74
86
|
```bash
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# [SHOULD] Wiki Sync Rules
|
|
2
|
+
|
|
3
|
+
> **Priority**: SHOULD | **ID**: R022
|
|
4
|
+
|
|
5
|
+
## Core Rule
|
|
6
|
+
|
|
7
|
+
When agents, skills, rules, or guides are created or modified, corresponding wiki pages SHOULD be updated to keep the knowledge base current. The wiki is the project's compiled knowledge — stale wikis degrade team and LLM onboarding speed.
|
|
8
|
+
|
|
9
|
+
## When to Sync
|
|
10
|
+
|
|
11
|
+
| Change Type | Wiki Action |
|
|
12
|
+
|-------------|-------------|
|
|
13
|
+
| New agent created | Create wiki/agents/{name}.md |
|
|
14
|
+
| Agent modified | Update wiki/agents/{name}.md |
|
|
15
|
+
| New skill created | Create wiki/skills/{name}.md |
|
|
16
|
+
| Skill modified | Update wiki/skills/{name}.md |
|
|
17
|
+
| Rule created/modified | Update wiki/rules/r{nnn}.md |
|
|
18
|
+
| Guide created/modified | Update wiki/guides/{name}.md |
|
|
19
|
+
| Architecture change | Update wiki/architecture/ pages |
|
|
20
|
+
| Multiple changes | Run `/omcustom:wiki` for full update |
|
|
21
|
+
|
|
22
|
+
## How to Sync
|
|
23
|
+
|
|
24
|
+
| Method | When |
|
|
25
|
+
|--------|------|
|
|
26
|
+
| `/omcustom:wiki ingest <path>` | Single file/directory changed |
|
|
27
|
+
| `/omcustom:wiki` | Multiple files changed or periodic refresh |
|
|
28
|
+
| `/omcustom:wiki lint` | After major structural changes |
|
|
29
|
+
| Automatic (CI) | `.github/workflows/wiki-sync.yml` checks on PR |
|
|
30
|
+
|
|
31
|
+
## Delegation
|
|
32
|
+
|
|
33
|
+
All wiki writes MUST go through the `wiki-curator` agent (R010). The orchestrator reads wiki pages freely but never writes them directly.
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
Orchestrator
|
|
37
|
+
├── Detects source change
|
|
38
|
+
├── Delegates to wiki-curator
|
|
39
|
+
│ ├── Reads source file
|
|
40
|
+
│ ├── Creates/updates wiki page
|
|
41
|
+
│ ├── Updates cross-references
|
|
42
|
+
│ └── Updates index.md
|
|
43
|
+
└── Verifies via wiki lint
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Integration
|
|
47
|
+
|
|
48
|
+
| Rule | Interaction |
|
|
49
|
+
|------|-------------|
|
|
50
|
+
| R010 | Wiki writes delegated to wiki-curator agent |
|
|
51
|
+
| R017 | Wiki sync added to sauron verification Phase 3 |
|
|
52
|
+
| R020 | Wiki-dependent tasks verify wiki is current before [Done] |
|
|
53
|
+
| R006 | Wiki pages follow same separation of concerns as source |
|
|
54
|
+
| R021 | SHOULD priority — advisory enforcement, CI check |
|
|
55
|
+
|
|
56
|
+
## CI Enforcement
|
|
57
|
+
|
|
58
|
+
`.github/workflows/wiki-sync.yml` checks for missing wiki pages on every PR. Missing pages cause CI failure with guidance to run `/omcustom:wiki`.
|
|
59
|
+
|
|
60
|
+
## Self-Check
|
|
61
|
+
|
|
62
|
+
Before completing a session that modified agents/skills/rules/guides:
|
|
63
|
+
1. Were wiki pages updated for all changes?
|
|
64
|
+
2. Was index.md refreshed?
|
|
65
|
+
3. Did wiki lint pass?
|
|
66
|
+
|
|
67
|
+
If any NO → run `/omcustom:wiki ingest` for affected paths.
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: adaptive-harness
|
|
3
|
+
description: Auto-detect project context and optimize harness — deactivate unused agents/skills, suggest missing experts, generate project profile
|
|
4
|
+
scope: harness
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
user-invocable: true
|
|
7
|
+
argument-hint: "[--optimize|--scan|--learn|--export|--import|--dry-run] [target-dir]"
|
|
8
|
+
effort: high
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Adaptive Harness Self-Customization Skill
|
|
12
|
+
|
|
13
|
+
Automatically detects project context and optimizes the oh-my-customcode harness (agents, skills, rules) to fit the project. Generates a persistent project profile that drives agent activation decisions and records learned patterns over time.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
/omcustom:adaptive-harness # Full scan + optimize
|
|
19
|
+
/omcustom:adaptive-harness --scan # Scan only (generate/update project profile)
|
|
20
|
+
/omcustom:adaptive-harness --optimize # Deactivate unused, suggest missing
|
|
21
|
+
/omcustom:adaptive-harness --learn # Analyze failure patterns, update profile
|
|
22
|
+
/omcustom:adaptive-harness --export # Export profile as portable bundle
|
|
23
|
+
/omcustom:adaptive-harness --import <path> # Import profile from another project
|
|
24
|
+
/omcustom:adaptive-harness --dry-run # Show what would change without modifying
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Default (no flag): runs `--scan` then `--optimize` in sequence.
|
|
28
|
+
|
|
29
|
+
## Project Profile Format
|
|
30
|
+
|
|
31
|
+
The skill generates and maintains `.claude/project-profile.yaml`. Manual edits to this file are preserved across runs — the skill merges new detections with existing content rather than overwriting.
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
# Auto-generated by adaptive-harness. Manual edits will be preserved.
|
|
35
|
+
project:
|
|
36
|
+
name: detected-project-name
|
|
37
|
+
scanned_at: "2026-04-12T10:00:00Z"
|
|
38
|
+
|
|
39
|
+
tech_stack:
|
|
40
|
+
languages: [python, typescript]
|
|
41
|
+
frameworks: [fastapi, next.js]
|
|
42
|
+
databases: [postgres, redis]
|
|
43
|
+
infra: [docker, aws]
|
|
44
|
+
|
|
45
|
+
detection_evidence:
|
|
46
|
+
- indicator: "requirements.txt found"
|
|
47
|
+
confidence: high
|
|
48
|
+
suggests: [lang-python-expert, be-fastapi-expert]
|
|
49
|
+
- indicator: "package.json with next dependency"
|
|
50
|
+
confidence: high
|
|
51
|
+
suggests: [lang-typescript-expert, fe-vercel-agent]
|
|
52
|
+
|
|
53
|
+
active_agents:
|
|
54
|
+
- lang-python-expert
|
|
55
|
+
- be-fastapi-expert
|
|
56
|
+
- lang-typescript-expert
|
|
57
|
+
- fe-vercel-agent
|
|
58
|
+
- db-postgres-expert
|
|
59
|
+
- db-redis-expert
|
|
60
|
+
- infra-docker-expert
|
|
61
|
+
- infra-aws-expert
|
|
62
|
+
# manager agents always active
|
|
63
|
+
- mgr-creator
|
|
64
|
+
- mgr-gitnerd
|
|
65
|
+
- mgr-sauron
|
|
66
|
+
- mgr-supplier
|
|
67
|
+
- mgr-updater
|
|
68
|
+
- mgr-claude-code-bible
|
|
69
|
+
|
|
70
|
+
inactive_agents:
|
|
71
|
+
- lang-golang-expert # no Go files detected
|
|
72
|
+
- lang-rust-expert # no Rust files detected
|
|
73
|
+
|
|
74
|
+
usage_stats:
|
|
75
|
+
most_used_agents: [] # populated by --learn
|
|
76
|
+
failure_patterns: [] # populated by --learn
|
|
77
|
+
|
|
78
|
+
overrides:
|
|
79
|
+
rules: {} # e.g., R009: { max_parallel: 5 }
|
|
80
|
+
|
|
81
|
+
last_optimized: "2026-04-12T10:00:00Z"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Workflow: --scan
|
|
85
|
+
|
|
86
|
+
Scans the TARGET project (the project using oh-my-customcode, not the harness itself) and generates or updates the project profile. Uses Read, Glob, and Grep only — no side effects.
|
|
87
|
+
|
|
88
|
+
### Step 1: Detect Tech Stack
|
|
89
|
+
|
|
90
|
+
Check for language manifest files and framework indicators:
|
|
91
|
+
|
|
92
|
+
| Indicator Files | Tech | Suggests Agents |
|
|
93
|
+
|----------------|------|-----------------|
|
|
94
|
+
| `go.mod`, `*.go` | Go | lang-golang-expert, be-go-backend-expert |
|
|
95
|
+
| `Cargo.toml`, `*.rs` | Rust | lang-rust-expert |
|
|
96
|
+
| `requirements.txt`, `pyproject.toml`, `*.py` | Python | lang-python-expert |
|
|
97
|
+
| `fastapi` in deps/imports | FastAPI | be-fastapi-expert |
|
|
98
|
+
| `django` in deps/imports | Django | be-django-expert |
|
|
99
|
+
| `package.json`, `tsconfig.json`, `*.ts`, `*.tsx` | TypeScript | lang-typescript-expert |
|
|
100
|
+
| `next` in package.json deps | Next.js | fe-vercel-agent |
|
|
101
|
+
| `vue` in package.json deps | Vue.js | fe-vuejs-agent |
|
|
102
|
+
| `svelte.config.*`, `*.svelte` | Svelte | fe-svelte-agent |
|
|
103
|
+
| `pubspec.yaml`, `*.dart` | Flutter | fe-flutter-agent |
|
|
104
|
+
| `*.kt`, `build.gradle.kts` | Kotlin | lang-kotlin-expert |
|
|
105
|
+
| `*.java`, `pom.xml` | Java | lang-java21-expert |
|
|
106
|
+
| `spring-boot` in deps | Spring Boot | be-springboot-expert |
|
|
107
|
+
| `express` in package.json deps | Express | be-express-expert |
|
|
108
|
+
| `@nestjs` in package.json deps | NestJS | be-nestjs-expert |
|
|
109
|
+
| `Dockerfile`, `docker-compose.*` | Docker | infra-docker-expert |
|
|
110
|
+
| `cdk.json`, `template.yaml`, `.aws/` | AWS | infra-aws-expert |
|
|
111
|
+
| `terraform/`, `*.tf` | Terraform | infra-aws-expert |
|
|
112
|
+
| `.github/workflows/` | CI/CD | mgr-gitnerd |
|
|
113
|
+
| `*.sql`, `alembic/`, `pg` in deps | PostgreSQL | db-postgres-expert |
|
|
114
|
+
| `redis` in deps/config | Redis | db-redis-expert |
|
|
115
|
+
| `supabase` in deps/config | Supabase | db-supabase-expert |
|
|
116
|
+
| `prisma/`, `drizzle/` | ORM | db-postgres-expert |
|
|
117
|
+
| `dags/*.py`, `airflow` in deps | Airflow | de-airflow-expert |
|
|
118
|
+
| `dbt_project.yml` | dbt | de-dbt-expert |
|
|
119
|
+
| `kafka` in deps/config | Kafka | de-kafka-expert |
|
|
120
|
+
| `spark` in deps/config | Spark | de-spark-expert |
|
|
121
|
+
| `snowflake` in deps/config | Snowflake | de-snowflake-expert |
|
|
122
|
+
|
|
123
|
+
### Step 2: Build Detection Evidence
|
|
124
|
+
|
|
125
|
+
For each indicator found, record:
|
|
126
|
+
- `indicator`: human-readable description of what was found
|
|
127
|
+
- `confidence`: `high` (direct manifest file) | `medium` (dependency reference) | `low` (indirect signal)
|
|
128
|
+
- `suggests`: list of agent names this indicator implies
|
|
129
|
+
|
|
130
|
+
### Step 3: Write Project Profile
|
|
131
|
+
|
|
132
|
+
Delegate write to a subagent (R010). Merge with existing profile if present — preserve `overrides`, `usage_stats`, and any manual entries.
|
|
133
|
+
|
|
134
|
+
Output format:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
[adaptive-harness --scan] Target: /path/to/project
|
|
138
|
+
|
|
139
|
+
Tech Stack Detected:
|
|
140
|
+
- Python (requirements.txt + pyproject.toml found) [confidence: high]
|
|
141
|
+
- FastAPI ("fastapi" in requirements.txt) [confidence: high]
|
|
142
|
+
- TypeScript (tsconfig.json found) [confidence: high]
|
|
143
|
+
- Next.js ("next" in package.json deps) [confidence: high]
|
|
144
|
+
- Docker (Dockerfile found) [confidence: high]
|
|
145
|
+
- PostgreSQL ("psycopg2" in requirements.txt) [confidence: medium]
|
|
146
|
+
- Redis ("redis" in requirements.txt) [confidence: medium]
|
|
147
|
+
- AWS (cdk.json found) [confidence: high]
|
|
148
|
+
|
|
149
|
+
Active agents identified: 8
|
|
150
|
+
Profile written: .claude/project-profile.yaml
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Workflow: --optimize
|
|
154
|
+
|
|
155
|
+
Reads the project profile and adjusts which agent files are active.
|
|
156
|
+
|
|
157
|
+
### Step 1: Load Profile
|
|
158
|
+
|
|
159
|
+
Read `.claude/project-profile.yaml`. If the profile does not exist, run `--scan` first.
|
|
160
|
+
|
|
161
|
+
### Step 2: Identify Inactive Agents
|
|
162
|
+
|
|
163
|
+
Compare all agent files in `.claude/agents/*.md` against `active_agents` list from the profile. Agents not in the active list (and not in the always-active set below) are candidates for deactivation.
|
|
164
|
+
|
|
165
|
+
### Always-Active Agents (never deactivate)
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
mgr-creator, mgr-gitnerd, mgr-sauron, mgr-supplier, mgr-updater, mgr-claude-code-bible
|
|
169
|
+
sys-memory-keeper, sys-naggy
|
|
170
|
+
arch-documenter, arch-speckit-agent
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Step 3: Move Inactive Agents
|
|
174
|
+
|
|
175
|
+
Delegate to subagent (R010):
|
|
176
|
+
- Create `.claude/agents/.inactive/` directory if it does not exist
|
|
177
|
+
- Move inactive agent `.md` files to `.claude/agents/.inactive/`
|
|
178
|
+
- Update `inactive_agents` list in project profile
|
|
179
|
+
|
|
180
|
+
### Step 4: Detect Gaps
|
|
181
|
+
|
|
182
|
+
Check `active_agents` list against files actually present in `.claude/agents/`. If an active agent file is missing, flag it as a gap and suggest `mgr-creator` to fill it.
|
|
183
|
+
|
|
184
|
+
### Step 5: Log Adaptations
|
|
185
|
+
|
|
186
|
+
Append a record to `.claude/outputs/harness-adaptations/YYYY-MM-DD.md`:
|
|
187
|
+
|
|
188
|
+
```markdown
|
|
189
|
+
## Optimization Run — 2026-04-12T10:00:00Z
|
|
190
|
+
|
|
191
|
+
Deactivated (moved to .inactive/):
|
|
192
|
+
- lang-golang-expert
|
|
193
|
+
- lang-rust-expert
|
|
194
|
+
- de-airflow-expert
|
|
195
|
+
|
|
196
|
+
Gaps detected (agents needed but missing):
|
|
197
|
+
- (none)
|
|
198
|
+
|
|
199
|
+
Profile: .claude/project-profile.yaml
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Restore
|
|
203
|
+
|
|
204
|
+
Run `--optimize --restore` to move all files from `.claude/agents/.inactive/` back to `.claude/agents/`. This reverses the last optimization.
|
|
205
|
+
|
|
206
|
+
Output format:
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
[adaptive-harness --optimize]
|
|
210
|
+
|
|
211
|
+
Always-active agents: 10 (protected)
|
|
212
|
+
Active per profile: 8
|
|
213
|
+
Candidates for deactivation: 29
|
|
214
|
+
|
|
215
|
+
Deactivated:
|
|
216
|
+
- lang-golang-expert → .claude/agents/.inactive/
|
|
217
|
+
- lang-rust-expert → .claude/agents/.inactive/
|
|
218
|
+
- de-airflow-expert → .claude/agents/.inactive/
|
|
219
|
+
... (26 more)
|
|
220
|
+
|
|
221
|
+
Gaps detected: 0
|
|
222
|
+
|
|
223
|
+
Log: .claude/outputs/harness-adaptations/2026-04-12.md
|
|
224
|
+
Summary: 29 deactivated, 18 active, 0 gaps
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**--dry-run** mode outputs `[would deactivate]` / `[would restore]` without moving any files.
|
|
228
|
+
|
|
229
|
+
## Workflow: --learn
|
|
230
|
+
|
|
231
|
+
Analyzes session history and eval-core data to populate `usage_stats` and `failure_patterns` in the project profile.
|
|
232
|
+
|
|
233
|
+
### Step 1: Collect Data Sources
|
|
234
|
+
|
|
235
|
+
- `.claude/outputs/` — session artifacts and eval results
|
|
236
|
+
- `.claude/agent-memory/` — agent memory files with usage patterns
|
|
237
|
+
- Any harness eval output from `/omcustom:harness-eval`
|
|
238
|
+
|
|
239
|
+
### Step 2: Extract Patterns
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
Most-used agents: Count agent invocations across outputs
|
|
243
|
+
Failure patterns: Identify agents that frequently retried or errored
|
|
244
|
+
Unused agents: Active agents with zero invocations in recent N sessions
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Step 3: Update Profile
|
|
248
|
+
|
|
249
|
+
Merge findings into `usage_stats` and `failure_patterns` sections of the project profile. Preserve existing entries; append new ones.
|
|
250
|
+
|
|
251
|
+
### Step 4: Generate Suggestions
|
|
252
|
+
|
|
253
|
+
Based on failure patterns, suggest:
|
|
254
|
+
- Rule overrides (e.g., increase `max_parallel` if timeout patterns detected)
|
|
255
|
+
- Agent replacements (e.g., suggest escalation to `opus` model for frequently failing tasks)
|
|
256
|
+
- Additional skills that may reduce failure rate
|
|
257
|
+
|
|
258
|
+
Output format:
|
|
259
|
+
|
|
260
|
+
```
|
|
261
|
+
[adaptive-harness --learn]
|
|
262
|
+
|
|
263
|
+
Sessions analyzed: 12
|
|
264
|
+
Agent invocations found: 847
|
|
265
|
+
|
|
266
|
+
Most-used agents (top 5):
|
|
267
|
+
1. lang-python-expert (312 invocations)
|
|
268
|
+
2. be-fastapi-expert (189 invocations)
|
|
269
|
+
3. mgr-gitnerd (97 invocations)
|
|
270
|
+
4. db-postgres-expert (84 invocations)
|
|
271
|
+
5. lang-typescript-expert (71 invocations)
|
|
272
|
+
|
|
273
|
+
Failure patterns:
|
|
274
|
+
- db-postgres-expert: 3 retries in session 2026-04-10 (timeout pattern)
|
|
275
|
+
|
|
276
|
+
Suggestions:
|
|
277
|
+
- db-postgres-expert: consider effort: high for complex query generation
|
|
278
|
+
- de-kafka-expert: 0 invocations — candidate for deactivation
|
|
279
|
+
|
|
280
|
+
Profile updated: .claude/project-profile.yaml
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Workflow: --export / --import
|
|
284
|
+
|
|
285
|
+
### Export
|
|
286
|
+
|
|
287
|
+
Bundles the project profile and active agent list for sharing with another project or team member.
|
|
288
|
+
|
|
289
|
+
Output: `.claude/outputs/harness-bundle-YYYY-MM-DD.json`
|
|
290
|
+
|
|
291
|
+
```json
|
|
292
|
+
{
|
|
293
|
+
"version": "1.0.0",
|
|
294
|
+
"exported_at": "2026-04-12T10:00:00Z",
|
|
295
|
+
"source_project": "detected-project-name",
|
|
296
|
+
"profile": { ... },
|
|
297
|
+
"active_agent_names": [ ... ]
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Import
|
|
302
|
+
|
|
303
|
+
```
|
|
304
|
+
/omcustom:adaptive-harness --import .claude/outputs/harness-bundle-2026-04-12.json
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Reads the bundle and applies the `active_agents` list to the current project by running `--optimize` with the imported profile. Does not overwrite `usage_stats` or `failure_patterns` from the current project.
|
|
308
|
+
|
|
309
|
+
## Execution Rules
|
|
310
|
+
|
|
311
|
+
- `--scan` uses Read, Glob, Grep only — no writes, safe to run anytime
|
|
312
|
+
- All file writes (profile, logs, agent moves) are delegated to subagents (R010)
|
|
313
|
+
- `--dry-run` suppresses all writes; outputs `[would ...]` for every action
|
|
314
|
+
- Profile changes are always logged to `.claude/outputs/harness-adaptations/` for auditability
|
|
315
|
+
- When profile already exists, the skill merges new detections rather than overwriting
|
|
316
|
+
- Parallel Glob/Grep calls are used during `--scan` for performance (R009)
|
|
317
|
+
|
|
318
|
+
## Integration
|
|
319
|
+
|
|
320
|
+
| Component | Interaction |
|
|
321
|
+
|-----------|-------------|
|
|
322
|
+
| `/omcustom:analysis` | Calls adaptive-harness `--scan` after initial tech stack detection to persist the profile |
|
|
323
|
+
| `SessionStart` hook | Lightweight profile existence check only — no full scan at startup |
|
|
324
|
+
| `mgr-creator` | Invoked when gaps are detected during `--optimize` to create missing agent files |
|
|
325
|
+
| `R016` (Continuous Improvement) | Failure patterns from `--learn` may trigger rule updates |
|
|
326
|
+
| `eval-core` | Primary data source for `--learn` invocation and usage pattern extraction |
|
|
327
|
+
| `mgr-sauron` | Run after `--optimize` to verify structural integrity (R017) |
|
|
328
|
+
|
|
329
|
+
## Notes
|
|
330
|
+
|
|
331
|
+
- Always run `--dry-run` first on a new project to preview deactivation scope
|
|
332
|
+
- `--optimize --restore` is the safe exit if deactivation causes unexpected routing failures
|
|
333
|
+
- The `.inactive/` directory is git-tracked so deactivation decisions are visible in history
|
|
334
|
+
- Manager and system agents are unconditionally protected from deactivation
|
|
335
|
+
- Target directory defaults to the project root where Claude Code is running, not the omcustom harness directory
|