oh-my-customcode 0.9.2 → 0.9.4
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 +25 -30
- package/dist/cli/index.js +1315 -568
- package/dist/index.js +234 -17
- package/package.json +1 -1
- package/templates/.claude/agents/arch-documenter.md +7 -71
- package/templates/.claude/agents/arch-speckit-agent.md +21 -108
- package/templates/.claude/agents/be-express-expert.md +8 -58
- package/templates/.claude/agents/be-nestjs-expert.md +6 -38
- package/templates/.claude/agents/be-springboot-expert.md +11 -56
- package/templates/.claude/agents/db-postgres-expert.md +10 -80
- package/templates/.claude/agents/db-redis-expert.md +10 -75
- package/templates/.claude/agents/db-supabase-expert.md +12 -48
- package/templates/.claude/agents/de-airflow-expert.md +8 -45
- package/templates/.claude/agents/de-dbt-expert.md +8 -46
- package/templates/.claude/agents/de-kafka-expert.md +10 -10
- package/templates/.claude/agents/de-pipeline-expert.md +9 -69
- package/templates/.claude/agents/de-snowflake-expert.md +9 -62
- package/templates/.claude/agents/de-spark-expert.md +10 -54
- package/templates/.claude/agents/fe-svelte-agent.md +5 -41
- package/templates/.claude/agents/fe-vercel-agent.md +9 -41
- package/templates/.claude/agents/fe-vuejs-agent.md +7 -42
- package/templates/.claude/agents/lang-java21-expert.md +11 -37
- package/templates/.claude/agents/mgr-claude-code-bible.md +22 -207
- package/templates/.claude/agents/mgr-creator.md +7 -88
- package/templates/.claude/agents/mgr-gitnerd.md +8 -76
- package/templates/.claude/agents/mgr-sauron.md +27 -20
- package/templates/.claude/agents/mgr-supplier.md +11 -96
- package/templates/.claude/agents/mgr-sync-checker.md +9 -70
- package/templates/.claude/agents/mgr-updater.md +9 -79
- package/templates/.claude/agents/qa-engineer.md +8 -72
- package/templates/.claude/agents/qa-planner.md +2 -3
- package/templates/.claude/agents/qa-writer.md +6 -76
- package/templates/.claude/agents/sys-memory-keeper.md +13 -87
- package/templates/.claude/agents/sys-naggy.md +9 -62
- package/templates/.claude/agents/tool-bun-expert.md +7 -52
- package/templates/.claude/agents/tool-npm-expert.md +6 -64
- package/templates/.claude/agents/tool-optimizer.md +7 -60
- package/templates/.claude/rules/MAY-optimization.md +16 -80
- package/templates/.claude/rules/MUST-agent-design.md +29 -134
- package/templates/.claude/rules/MUST-agent-identification.md +9 -88
- package/templates/.claude/rules/MUST-continuous-improvement.md +10 -117
- package/templates/.claude/rules/MUST-intent-transparency.md +14 -171
- package/templates/.claude/rules/MUST-language-policy.md +11 -46
- package/templates/.claude/rules/MUST-orchestrator-coordination.md +82 -425
- package/templates/.claude/rules/MUST-parallel-execution.md +33 -405
- package/templates/.claude/rules/MUST-permissions.md +14 -68
- package/templates/.claude/rules/MUST-safety.md +11 -57
- package/templates/.claude/rules/MUST-sync-verification.md +49 -205
- package/templates/.claude/rules/MUST-tool-identification.md +21 -134
- package/templates/.claude/rules/SHOULD-agent-teams.md +22 -166
- package/templates/.claude/rules/SHOULD-ecomode.md +15 -123
- package/templates/.claude/rules/SHOULD-error-handling.md +19 -88
- package/templates/.claude/rules/SHOULD-hud-statusline.md +9 -89
- package/templates/.claude/rules/SHOULD-interaction.md +18 -87
- package/templates/.claude/rules/SHOULD-memory-integration.md +25 -118
- package/templates/.claude/skills/dev-lead-routing/SKILL.md +70 -243
- package/templates/.claude/skills/springboot-best-practices/SKILL.md +180 -319
- package/templates/.codex/agents/arch-documenter.md +7 -71
- package/templates/.codex/agents/arch-speckit-agent.md +21 -108
- package/templates/.codex/agents/be-express-expert.md +8 -58
- package/templates/.codex/agents/be-nestjs-expert.md +6 -38
- package/templates/.codex/agents/be-springboot-expert.md +11 -56
- package/templates/.codex/agents/db-postgres-expert.md +10 -80
- package/templates/.codex/agents/db-redis-expert.md +10 -75
- package/templates/.codex/agents/db-supabase-expert.md +12 -48
- package/templates/.codex/agents/de-airflow-expert.md +8 -45
- package/templates/.codex/agents/de-dbt-expert.md +8 -46
- package/templates/.codex/agents/de-kafka-expert.md +10 -10
- package/templates/.codex/agents/de-pipeline-expert.md +9 -69
- package/templates/.codex/agents/de-snowflake-expert.md +9 -62
- package/templates/.codex/agents/de-spark-expert.md +10 -54
- package/templates/.codex/agents/fe-svelte-agent.md +5 -41
- package/templates/.codex/agents/fe-vercel-agent.md +9 -41
- package/templates/.codex/agents/fe-vuejs-agent.md +7 -42
- package/templates/.codex/agents/infra-aws-expert.md +1 -1
- package/templates/.codex/agents/infra-docker-expert.md +1 -1
- package/templates/.codex/agents/lang-java21-expert.md +11 -37
- package/templates/.codex/agents/mgr-claude-code-bible.md +25 -210
- package/templates/.codex/agents/mgr-creator.md +7 -88
- package/templates/.codex/agents/mgr-gitnerd.md +8 -76
- package/templates/.codex/agents/mgr-sauron.md +30 -23
- package/templates/.codex/agents/mgr-supplier.md +11 -96
- package/templates/.codex/agents/mgr-sync-checker.md +12 -73
- package/templates/.codex/agents/mgr-updater.md +9 -79
- package/templates/.codex/agents/qa-engineer.md +8 -72
- package/templates/.codex/agents/qa-planner.md +2 -3
- package/templates/.codex/agents/qa-writer.md +6 -76
- package/templates/.codex/agents/sys-memory-keeper.md +13 -87
- package/templates/.codex/agents/sys-naggy.md +9 -62
- package/templates/.codex/agents/tool-bun-expert.md +7 -52
- package/templates/.codex/agents/tool-npm-expert.md +6 -64
- package/templates/.codex/agents/tool-optimizer.md +7 -60
- package/templates/.codex/rules/MAY-optimization.md +16 -80
- package/templates/.codex/rules/MUST-agent-design.md +29 -134
- package/templates/.codex/rules/MUST-agent-identification.md +9 -88
- package/templates/.codex/rules/MUST-continuous-improvement.md +10 -117
- package/templates/.codex/rules/MUST-intent-transparency.md +14 -171
- package/templates/.codex/rules/MUST-language-policy.md +11 -46
- package/templates/.codex/rules/MUST-orchestrator-coordination.md +82 -425
- package/templates/.codex/rules/MUST-parallel-execution.md +33 -405
- package/templates/.codex/rules/MUST-permissions.md +14 -68
- package/templates/.codex/rules/MUST-safety.md +11 -57
- package/templates/.codex/rules/MUST-sync-verification.md +58 -214
- package/templates/.codex/rules/MUST-tool-identification.md +22 -135
- package/templates/.codex/rules/SHOULD-agent-teams.md +22 -166
- package/templates/.codex/rules/SHOULD-ecomode.md +15 -123
- package/templates/.codex/rules/SHOULD-error-handling.md +19 -88
- package/templates/.codex/rules/SHOULD-hud-statusline.md +9 -89
- package/templates/.codex/rules/SHOULD-interaction.md +18 -87
- package/templates/.codex/rules/SHOULD-memory-integration.md +25 -118
- package/templates/.codex/skills/dev-lead-routing/SKILL.md +70 -243
- package/templates/.codex/skills/springboot-best-practices/SKILL.md +180 -319
|
@@ -1,145 +1,37 @@
|
|
|
1
1
|
# [SHOULD] Ecomode Rules
|
|
2
2
|
|
|
3
|
-
> **Priority**: SHOULD
|
|
4
|
-
> **ID**: R013
|
|
3
|
+
> **Priority**: SHOULD | **ID**: R013
|
|
5
4
|
|
|
6
|
-
##
|
|
5
|
+
## Activation
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## Activation Conditions
|
|
11
|
-
|
|
12
|
-
Ecomode is automatically activated when:
|
|
13
|
-
|
|
14
|
-
```yaml
|
|
15
|
-
conditions:
|
|
16
|
-
- 4+ parallel tasks spawned
|
|
17
|
-
- Batch operations requested
|
|
18
|
-
- Near compaction threshold (80%+ context usage)
|
|
19
|
-
- Explicit user request: "ecomode on"
|
|
20
|
-
```
|
|
7
|
+
Auto-activates when: 4+ parallel tasks, batch operations, 80%+ context usage, or explicit "ecomode on".
|
|
21
8
|
|
|
22
9
|
## Behaviors
|
|
23
10
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
When ecomode is active, parallel agents return:
|
|
27
|
-
|
|
28
|
-
```yaml
|
|
29
|
-
format:
|
|
30
|
-
- status: success | failed | partial
|
|
31
|
-
- summary: 1-2 sentences max
|
|
32
|
-
- key_data: essential results only
|
|
33
|
-
|
|
34
|
-
skip:
|
|
35
|
-
- Intermediate steps
|
|
36
|
-
- Verbose explanations
|
|
37
|
-
- Repeated context
|
|
38
|
-
- Full file contents (use paths instead)
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### 2. Aggregation Format
|
|
42
|
-
|
|
43
|
-
Secretary aggregates results in compact format:
|
|
11
|
+
**Compact Output**: Agents return `status + summary (1-2 sentences) + key_data only`. Skip intermediate steps, verbose explanations, repeated context, full file contents.
|
|
44
12
|
|
|
13
|
+
**Aggregation Format**:
|
|
45
14
|
```
|
|
46
15
|
[Batch Complete] {n}/{total}
|
|
47
|
-
├── {agent}:
|
|
48
|
-
├── {agent}: {icon} {summary}
|
|
49
|
-
└── {agent}: {icon} {summary}
|
|
16
|
+
├── {agent}: ✓/✗/⚠ {summary}
|
|
50
17
|
```
|
|
51
18
|
|
|
52
|
-
|
|
53
|
-
- ✓ success
|
|
54
|
-
- ✗ failed
|
|
55
|
-
- ⚠ partial/warning
|
|
56
|
-
|
|
57
|
-
### 3. Result Compression
|
|
58
|
-
|
|
59
|
-
```yaml
|
|
60
|
-
compress:
|
|
61
|
-
- File lists → count only unless < 5 files
|
|
62
|
-
- Error traces → first and last 3 lines
|
|
63
|
-
- Code snippets → path:line reference only
|
|
64
|
-
- Long outputs → truncate with "[truncated]"
|
|
65
|
-
```
|
|
19
|
+
**Compression**: File lists -> count only (unless < 5), error traces -> first/last 3 lines, code -> path:line ref only.
|
|
66
20
|
|
|
67
|
-
##
|
|
21
|
+
## Config
|
|
68
22
|
|
|
69
23
|
```yaml
|
|
70
24
|
ecomode:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
max_result_length: 200 # characters per result
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Examples
|
|
78
|
-
|
|
79
|
-
### Normal Mode Output
|
|
80
|
-
|
|
25
|
+
threshold: 4
|
|
26
|
+
result_format: summary
|
|
27
|
+
max_result_length: 200
|
|
81
28
|
```
|
|
82
|
-
┌─ Agent: lang-golang-expert (sw-engineer)
|
|
83
|
-
├─ Skill: go-best-practices
|
|
84
|
-
└─ Task: Reviewing src/main.go
|
|
85
29
|
|
|
86
|
-
|
|
87
|
-
[lang-golang-expert → Read] src/main.go
|
|
30
|
+
## Example
|
|
88
31
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
Checking naming conventions...
|
|
93
|
-
Function 'GetUser' follows Go naming conventions.
|
|
94
|
-
Function 'processData' follows Go naming conventions.
|
|
95
|
-
Function 'handle_error' VIOLATION: uses snake_case instead of camelCase.
|
|
96
|
-
|
|
97
|
-
[...]
|
|
98
|
-
|
|
99
|
-
Review Complete:
|
|
100
|
-
- 1 naming violation found
|
|
101
|
-
- 2 potential improvements suggested
|
|
102
|
-
- Overall code quality: Good
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### Ecomode Output
|
|
106
|
-
|
|
107
|
-
```
|
|
108
|
-
[lang-golang-expert] ✓ src/main.go reviewed: 1 naming issue (handle_error → handleError)
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## Implementation Notes
|
|
112
|
-
|
|
113
|
-
### For Orchestrator (Secretary)
|
|
114
|
-
|
|
115
|
-
```yaml
|
|
116
|
-
responsibilities:
|
|
117
|
-
- Detect ecomode activation conditions
|
|
118
|
-
- Instruct spawned agents to use compact format
|
|
119
|
-
- Aggregate results in batch format
|
|
120
|
-
- Track token savings
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### For Worker Agents
|
|
124
|
-
|
|
125
|
-
```yaml
|
|
126
|
-
when_ecomode_active:
|
|
127
|
-
- Return status + summary only
|
|
128
|
-
- Skip intermediate progress updates
|
|
129
|
-
- Use references instead of full content
|
|
130
|
-
- Compress error messages
|
|
131
|
-
```
|
|
32
|
+
Normal: Full agent header + step-by-step analysis + detailed results.
|
|
33
|
+
Ecomode: `[lang-golang-expert] ✓ src/main.go reviewed: 1 naming issue (handle_error -> handleError)`
|
|
132
34
|
|
|
133
35
|
## Override
|
|
134
36
|
|
|
135
|
-
|
|
136
|
-
- "ecomode off"
|
|
137
|
-
- "verbose mode"
|
|
138
|
-
- "show full details"
|
|
139
|
-
|
|
140
|
-
## Benefits
|
|
141
|
-
|
|
142
|
-
1. **Token Efficiency**: 60-80% reduction in batch operations
|
|
143
|
-
2. **Faster Response**: Less output processing
|
|
144
|
-
3. **Better Overview**: Aggregated results at a glance
|
|
145
|
-
4. **Context Preservation**: More room for actual work
|
|
37
|
+
Disable with: "ecomode off", "verbose mode", or "show full details".
|
|
@@ -1,102 +1,33 @@
|
|
|
1
1
|
# [SHOULD] Error Handling Rules
|
|
2
2
|
|
|
3
|
-
> **Priority**: SHOULD
|
|
4
|
-
> **Goal**: Safe failure, fast recovery
|
|
3
|
+
> **Priority**: SHOULD | **ID**: R004
|
|
5
4
|
|
|
6
5
|
## Error Classification
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- Non-recommended pattern found
|
|
14
|
-
- Potential performance issue
|
|
15
|
-
- Better alternative exists
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### Level 2: Error
|
|
19
|
-
```
|
|
20
|
-
Symptom: Current task fails, others possible
|
|
21
|
-
Response: Stop task, report cause, suggest alternative
|
|
22
|
-
Example:
|
|
23
|
-
- File not found
|
|
24
|
-
- Insufficient permission
|
|
25
|
-
- Format error
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### Level 3: Critical
|
|
29
|
-
```
|
|
30
|
-
Symptom: Cannot proceed at all
|
|
31
|
-
Response: Stop all, preserve state, report immediately
|
|
32
|
-
Example:
|
|
33
|
-
- System resource exhausted
|
|
34
|
-
- Missing required dependency
|
|
35
|
-
- Security violation detected
|
|
36
|
-
```
|
|
7
|
+
| Level | Symptom | Response |
|
|
8
|
+
|-------|---------|----------|
|
|
9
|
+
| Warning | Task completes but needs attention | Output warning, continue |
|
|
10
|
+
| Error | Current task fails, others possible | Stop task, report cause, suggest alternative |
|
|
11
|
+
| Critical | Cannot proceed at all | Stop all, preserve state, report immediately |
|
|
37
12
|
|
|
38
13
|
## Error Report Format
|
|
39
14
|
|
|
40
15
|
```
|
|
41
|
-
[Error] {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Cause: {specific cause}
|
|
45
|
-
Impact: {effect of this error}
|
|
46
|
-
|
|
47
|
-
Attempted:
|
|
48
|
-
1. {attempt 1} → Failed
|
|
49
|
-
2. {attempt 2} → Failed
|
|
50
|
-
|
|
51
|
-
Recommended:
|
|
52
|
-
- {action 1}
|
|
53
|
-
- {action 2}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Recovery Strategy
|
|
57
|
-
|
|
58
|
-
### Retryable Errors
|
|
59
|
-
```
|
|
60
|
-
1. Retry up to 3 times
|
|
61
|
-
2. Wait between retries (1s, 2s, 4s)
|
|
62
|
-
3. Report to user after 3 failures
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Non-recoverable Errors
|
|
66
|
-
```
|
|
67
|
-
1. Save current state
|
|
68
|
-
2. Rollback changes (if possible)
|
|
69
|
-
3. Detailed error report
|
|
70
|
-
4. Wait for user instruction
|
|
16
|
+
[Error] {type} — Location: {file:line} — Cause: {cause} — Impact: {effect}
|
|
17
|
+
Attempted: 1. {try1} -> Failed 2. {try2} -> Failed
|
|
18
|
+
Recommended: {action1}, {action2}
|
|
71
19
|
```
|
|
72
20
|
|
|
73
|
-
##
|
|
21
|
+
## Recovery
|
|
74
22
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
□ Dependencies met
|
|
80
|
-
□ Sufficient resources
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### After Action
|
|
84
|
-
```
|
|
85
|
-
□ Expected result matches actual
|
|
86
|
-
□ File integrity verified
|
|
87
|
-
□ No side effects
|
|
88
|
-
```
|
|
23
|
+
| Type | Strategy |
|
|
24
|
+
|------|----------|
|
|
25
|
+
| Retryable | Retry up to 3x with backoff (1s, 2s, 4s), then report |
|
|
26
|
+
| Non-recoverable | Save state, rollback if possible, detailed report, wait for user |
|
|
89
27
|
|
|
90
|
-
##
|
|
28
|
+
## Validation
|
|
91
29
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
code: FILE_NOT_FOUND
|
|
97
|
-
message: "Config file not found"
|
|
98
|
-
context:
|
|
99
|
-
file: "/path/to/config.yaml"
|
|
100
|
-
action: "read"
|
|
101
|
-
resolution: "Using default config"
|
|
102
|
-
```
|
|
30
|
+
| When | Checks |
|
|
31
|
+
|------|--------|
|
|
32
|
+
| Before action | Target exists, permissions available, dependencies met |
|
|
33
|
+
| After action | Expected = actual, file integrity, no side effects |
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
# [SHOULD] HUD Statusline Rules
|
|
2
2
|
|
|
3
|
-
> **Priority**: SHOULD
|
|
4
|
-
> **ID**: R012
|
|
5
|
-
|
|
6
|
-
## Purpose
|
|
7
|
-
|
|
8
|
-
Display real-time status information during agent operations for improved visibility and progress tracking.
|
|
3
|
+
> **Priority**: SHOULD | **ID**: R012
|
|
9
4
|
|
|
10
5
|
## Format
|
|
11
6
|
|
|
@@ -13,100 +8,25 @@ Display real-time status information during agent operations for improved visibi
|
|
|
13
8
|
─── [Agent] {name} | [Progress] {n}/{total} | [Parallel] {count} ───
|
|
14
9
|
```
|
|
15
10
|
|
|
16
|
-
## Update Triggers
|
|
17
|
-
|
|
18
|
-
| Trigger | Description |
|
|
19
|
-
|---------|-------------|
|
|
20
|
-
| Agent activation | When an agent starts handling a task |
|
|
21
|
-
| Task start | When a specific task begins execution |
|
|
22
|
-
| Task complete | When a task finishes (success or failure) |
|
|
23
|
-
| Parallel spawn | When parallel instances are created |
|
|
24
|
-
| Parallel complete | When parallel instances finish |
|
|
25
|
-
|
|
26
|
-
## Components
|
|
27
|
-
|
|
28
|
-
| Component | Description | Example |
|
|
29
|
-
|-----------|-------------|---------|
|
|
30
|
-
| Agent | Active agent name | `lang-golang-expert` |
|
|
31
|
-
| Model | Model used (for parallel) | `sonnet` |
|
|
32
|
-
| Progress | Task progress (current/total) | `2/5` |
|
|
33
|
-
| Parallel | Parallel instance count | `3` |
|
|
34
|
-
|
|
35
|
-
## Display Rules
|
|
36
|
-
|
|
37
|
-
### Single Agent
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
─── [Agent] mgr-creator | [Progress] 1/3 ───
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### With Parallel Execution (Model Display REQUIRED)
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
─── [Agent] secretary | [Progress] 0/4 | [Parallel] 4 ───
|
|
47
|
-
|
|
48
|
-
Instances:
|
|
49
|
-
[1] Task(general-purpose):sonnet → README update
|
|
50
|
-
[2] Task(lang-golang-expert):haiku → Code review
|
|
51
|
-
[3] Task(Explore):opus → Architecture analysis
|
|
52
|
-
[4] Task(general-purpose):haiku → Validation
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Completion
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
─── [Agent] mgr-supplier | [Progress] 5/5 | [Done] ───
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Implementation
|
|
62
|
-
|
|
63
|
-
Status updates via stderr to avoid output pollution:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
echo "─── [Agent] $AGENT | [Progress] $PROGRESS ───" >&2
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Integration with Other Rules
|
|
70
|
-
|
|
71
|
-
| Rule | Integration |
|
|
72
|
-
|------|-------------|
|
|
73
|
-
| R007 (Agent ID) | HUD complements agent identification |
|
|
74
|
-
| R008 (Tool ID) | HUD shows overall progress, tool ID shows specific operations |
|
|
75
|
-
| R009 (Parallel) | HUD displays parallel instance count |
|
|
76
|
-
|
|
77
11
|
## When to Display
|
|
78
12
|
|
|
79
|
-
|
|
80
|
-
|-----------|-------------|
|
|
81
|
-
| Single file operation | No (too brief) |
|
|
82
|
-
| Multi-step task | Yes |
|
|
83
|
-
| Parallel execution | Yes |
|
|
84
|
-
| Long-running operations | Yes |
|
|
13
|
+
Multi-step tasks, parallel execution, long-running operations. Skip for single brief operations.
|
|
85
14
|
|
|
86
|
-
## Hook
|
|
15
|
+
## Hook Implementation
|
|
87
16
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
The hook automatically displays subagent details when the Task tool is used:
|
|
17
|
+
Implemented in `.claude/hooks/hooks.json` (PreToolUse → Task matcher):
|
|
91
18
|
|
|
92
19
|
```
|
|
93
20
|
─── [Spawn] {subagent_type}:{model} | {description} ───
|
|
94
21
|
─── [Resume] {subagent_type}:{model} | {description} ───
|
|
95
22
|
```
|
|
96
23
|
|
|
97
|
-
|
|
24
|
+
## Display with Parallel
|
|
98
25
|
|
|
99
26
|
```
|
|
100
|
-
─── [
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
─── [Resume] mgr-gitnerd:sonnet | Continue push ───
|
|
27
|
+
─── [Agent] secretary | [Parallel] 4 ───
|
|
28
|
+
[1] Task(mgr-creator):sonnet → Create agent
|
|
29
|
+
[2] Task(lang-golang-expert):haiku → Code review
|
|
104
30
|
```
|
|
105
31
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
| Field | Source | Purpose |
|
|
109
|
-
|-------|--------|---------|
|
|
110
|
-
| `subagent_type` | Task tool parameter | Which agent is running |
|
|
111
|
-
| `model` | Task tool parameter | Which model (opus/sonnet/haiku) |
|
|
112
|
-
| `description` | Task tool parameter | What the agent is doing (max 40 chars) |
|
|
32
|
+
Integrates with R007 (Agent ID), R008 (Tool ID), R009 (Parallel).
|
|
@@ -1,103 +1,34 @@
|
|
|
1
1
|
# [SHOULD] Interaction Rules
|
|
2
2
|
|
|
3
|
-
> **Priority**: SHOULD
|
|
4
|
-
> **Exception**: Emergency or explicit user request
|
|
3
|
+
> **Priority**: SHOULD | **ID**: R003
|
|
5
4
|
|
|
6
5
|
## Response Principles
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
✗ Over-explanation
|
|
14
|
-
✗ Repetitive confirmation
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
### 2. Clarity
|
|
18
|
-
```
|
|
19
|
-
✓ Specific expressions
|
|
20
|
-
✓ Unambiguous instructions
|
|
21
|
-
✓ Executable code format
|
|
22
|
-
✗ Abstract descriptions only
|
|
23
|
-
✗ Overuse of "maybe", "probably"
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### 3. Transparency
|
|
27
|
-
```
|
|
28
|
-
✓ State actions performed
|
|
29
|
-
✓ Report changes
|
|
30
|
-
✓ Acknowledge uncertainty
|
|
31
|
-
✗ Hide actions
|
|
32
|
-
✗ Present guesses as facts
|
|
33
|
-
```
|
|
7
|
+
| Principle | Do | Don't |
|
|
8
|
+
|-----------|-----|-------|
|
|
9
|
+
| Brevity | Key info first, answer only what's asked | Over-explanation, repetitive confirmation |
|
|
10
|
+
| Clarity | Specific expressions, executable code | Abstract descriptions, "maybe"/"probably" |
|
|
11
|
+
| Transparency | State actions, report changes, acknowledge uncertainty | Hide actions, present guesses as facts |
|
|
34
12
|
|
|
35
|
-
## Status
|
|
13
|
+
## Status Format
|
|
36
14
|
|
|
37
|
-
### Start
|
|
38
15
|
```
|
|
39
16
|
[Start] {task name}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### In Progress
|
|
43
|
-
```
|
|
44
17
|
[Progress] {current step} ({n}/{total})
|
|
18
|
+
[Done] {task name} — Result: {summary}
|
|
19
|
+
[Failed] {task name} — Cause: {reason} — Alternative: {solutions}
|
|
45
20
|
```
|
|
46
21
|
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
[Done] {task name}
|
|
50
|
-
Result: {summary}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Failed
|
|
54
|
-
```
|
|
55
|
-
[Failed] {task name}
|
|
56
|
-
Cause: {reason}
|
|
57
|
-
Alternative: {possible solutions}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Handling Requests
|
|
61
|
-
|
|
62
|
-
### Clear Request
|
|
63
|
-
→ Execute immediately
|
|
64
|
-
|
|
65
|
-
### Ambiguous Request
|
|
66
|
-
```
|
|
67
|
-
[Confirm]
|
|
68
|
-
Understood "{request}" as {interpretation}.
|
|
69
|
-
|
|
70
|
-
Proceed?
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Risky Request
|
|
74
|
-
```
|
|
75
|
-
[Warning]
|
|
76
|
-
This action has {risk factor}.
|
|
22
|
+
## Request Handling
|
|
77
23
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
24
|
+
| Type | Action |
|
|
25
|
+
|------|--------|
|
|
26
|
+
| Clear | Execute immediately |
|
|
27
|
+
| Ambiguous | `[Confirm] Understood "{request}" as {interpretation}. Proceed?` |
|
|
28
|
+
| Risky | `[Warning] This action has {risk}. Continue? Yes: {action} / No: Cancel` |
|
|
82
29
|
|
|
83
30
|
## Multiple Tasks
|
|
84
31
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
2
|
|
88
|
-
|
|
89
|
-
### Report
|
|
90
|
-
```
|
|
91
|
-
[Task 1/3] Done - {result}
|
|
92
|
-
[Task 2/3] In progress...
|
|
93
|
-
[Task 3/3] Pending
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Long-running Tasks
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
[In Progress] {task name}
|
|
100
|
-
Elapsed: {time}
|
|
101
|
-
Current: {step}
|
|
102
|
-
Remaining: {work left}
|
|
103
|
-
```
|
|
32
|
+
- Dependent: Sequential
|
|
33
|
+
- Independent: Parallel allowed
|
|
34
|
+
- Report: `[Task 1/3] Done` / `[Task 2/3] In progress...` / `[Task 3/3] Pending`
|
|
@@ -1,132 +1,39 @@
|
|
|
1
1
|
# [SHOULD] Memory Integration Rules
|
|
2
2
|
|
|
3
|
-
> **Priority**: SHOULD
|
|
4
|
-
> **ID**: R011
|
|
3
|
+
> **Priority**: SHOULD | **ID**: R011
|
|
5
4
|
|
|
6
|
-
##
|
|
5
|
+
## Architecture
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
**Primary**: Native auto memory (`memory` field in agent frontmatter). No external dependencies.
|
|
8
|
+
**Supplementary**: claude-mem MCP (optional, for cross-session search and temporal queries).
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
Primary: Native Auto Memory (memory field in agent frontmatter)
|
|
14
|
-
- Agent-specific persistent knowledge
|
|
15
|
-
- Automatic system prompt injection (MEMORY.md)
|
|
16
|
-
- No external dependencies
|
|
17
|
-
|
|
18
|
-
Supplementary: claude-mem MCP (optional)
|
|
19
|
-
- Session-level temporal observations
|
|
20
|
-
- Cross-agent semantic search
|
|
21
|
-
- Only if installed and configured
|
|
22
|
-
|
|
23
|
-
RULE: If native auto memory can handle the task,
|
|
24
|
-
DO NOT use claude-mem.
|
|
25
|
-
```
|
|
10
|
+
Rule: If native auto memory can handle it, do NOT use claude-mem.
|
|
26
11
|
|
|
27
12
|
## Native Auto Memory
|
|
28
13
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
```yaml
|
|
33
|
-
memory: project # or user, local
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
2. System automatically:
|
|
37
|
-
- Creates memory directory for the agent
|
|
38
|
-
- Loads first 200 lines of MEMORY.md into system prompt
|
|
39
|
-
- Enables Read/Write/Edit tools for memory directory
|
|
40
|
-
- Agent learns and records patterns across conversations
|
|
41
|
-
|
|
42
|
-
### Memory Scopes
|
|
43
|
-
|
|
44
|
-
| Scope | Location | Use Case | Git Tracked |
|
|
45
|
-
|-------|----------|----------|-------------|
|
|
46
|
-
| `user` | `~/.claude/agent-memory/<name>/` | Cross-project patterns | No |
|
|
47
|
-
| `project` | `.claude/agent-memory/<name>/` | Project-specific patterns | Yes |
|
|
48
|
-
| `local` | `.claude/agent-memory-local/<name>/` | Local-only knowledge | No |
|
|
49
|
-
|
|
50
|
-
### Current Agent Memory Map
|
|
51
|
-
|
|
52
|
-
| Scope | Agents | Count |
|
|
53
|
-
|-------|--------|-------|
|
|
54
|
-
| `project` | lang-*, be-*, fe-*, arch-*, tool-*, qa-*, mgr-creator, mgr-updater, mgr-gitnerd, mgr-sauron, mgr-claude-code-bible, sys-memory-keeper | 28 |
|
|
55
|
-
| `user` | infra-docker-expert, infra-aws-expert, db-supabase-expert | 3 |
|
|
56
|
-
| `local` | mgr-supplier, mgr-sync-checker, sys-naggy | 3 |
|
|
57
|
-
|
|
58
|
-
### Memory Best Practices
|
|
59
|
-
|
|
60
|
-
```yaml
|
|
61
|
-
do:
|
|
62
|
-
- Let agents consult memory before starting work
|
|
63
|
-
- Update memory after discovering patterns or conventions
|
|
64
|
-
- Keep MEMORY.md under 200 lines (auto-curate if exceeded)
|
|
65
|
-
- Use separate topic files for detailed notes
|
|
14
|
+
Agent frontmatter `memory: project|user|local` enables persistent memory:
|
|
15
|
+
- System creates memory directory, loads first 200 lines of MEMORY.md into prompt
|
|
16
|
+
- Read/Write/Edit tools auto-enabled for memory directory
|
|
66
17
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
18
|
+
| Scope | Location | Git Tracked |
|
|
19
|
+
|-------|----------|-------------|
|
|
20
|
+
| `user` | `~/.claude/agent-memory/<name>/` | No |
|
|
21
|
+
| `project` | `.claude/agent-memory/<name>/` | Yes |
|
|
22
|
+
| `local` | `.claude/agent-memory-local/<name>/` | No |
|
|
72
23
|
|
|
73
|
-
##
|
|
24
|
+
## When to Use claude-mem
|
|
74
25
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
### When to Use claude-mem
|
|
79
|
-
|
|
80
|
-
| Scenario | Use Native Memory | Use claude-mem |
|
|
81
|
-
|----------|------------------|---------------|
|
|
26
|
+
| Scenario | Native | claude-mem |
|
|
27
|
+
|----------|--------|------------|
|
|
82
28
|
| Agent learns project patterns | Yes | |
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
| Cross-agent knowledge sharing | | Yes |
|
|
87
|
-
| Basic context persistence | Yes | |
|
|
88
|
-
|
|
89
|
-
### claude-mem Integration (if installed)
|
|
90
|
-
|
|
91
|
-
```yaml
|
|
92
|
-
provider: claude-mem
|
|
93
|
-
collection: claude_memories
|
|
94
|
-
project_tag: my-project
|
|
95
|
-
status: optional
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## Context Compaction
|
|
99
|
-
|
|
100
|
-
### Compaction Controls
|
|
101
|
-
|
|
102
|
-
```yaml
|
|
103
|
-
# Targeted compaction - preserve specific context
|
|
104
|
-
/compact focus on {topic}
|
|
105
|
-
|
|
106
|
-
# Examples
|
|
107
|
-
/compact focus on agent routing decisions
|
|
108
|
-
/compact focus on authentication implementation
|
|
109
|
-
/compact focus on test failures and fixes
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Best Practices
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
do:
|
|
116
|
-
- Use /compact focus when nearing context limits
|
|
117
|
-
- Focus on the most relevant topic for current work
|
|
118
|
-
- Let auto-compaction handle routine cleanup
|
|
119
|
-
|
|
120
|
-
dont:
|
|
121
|
-
- Manually compact when not near limits
|
|
122
|
-
- Lose important decision context by unfocused compaction
|
|
123
|
-
```
|
|
29
|
+
| Search across sessions | | Yes |
|
|
30
|
+
| Temporal queries | | Yes |
|
|
31
|
+
| Cross-agent sharing | | Yes |
|
|
124
32
|
|
|
125
|
-
##
|
|
33
|
+
## Best Practices
|
|
126
34
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
```
|
|
35
|
+
- Consult memory before starting work
|
|
36
|
+
- Update after discovering patterns
|
|
37
|
+
- Keep MEMORY.md under 200 lines
|
|
38
|
+
- Do not store sensitive data or duplicate CLAUDE.md content
|
|
39
|
+
- Memory write failures should not block main task
|