anvil-dev-framework 0.1.6
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 +719 -0
- package/VERSION +1 -0
- package/docs/ANVIL-REPO-IMPLEMENTATION-PLAN.md +441 -0
- package/docs/FIRST-SKILL-TUTORIAL.md +408 -0
- package/docs/INSTALLATION-RETRO-NOTES.md +458 -0
- package/docs/INSTALLATION.md +984 -0
- package/docs/anvil-hud.md +469 -0
- package/docs/anvil-init.md +255 -0
- package/docs/anvil-state.md +210 -0
- package/docs/boris-cherny-ralph-wiggum-insights.md +608 -0
- package/docs/command-reference.md +2022 -0
- package/docs/hooks-tts.md +368 -0
- package/docs/implementation-guide.md +810 -0
- package/docs/linear-github-integration.md +247 -0
- package/docs/local-issues.md +677 -0
- package/docs/patterns/README.md +419 -0
- package/docs/planning-responsibilities.md +139 -0
- package/docs/session-workflow.md +573 -0
- package/docs/simplification-plan-template.md +297 -0
- package/docs/simplification-principles.md +129 -0
- package/docs/specifications/CCS-RALPH-INTEGRATION-DESIGN.md +633 -0
- package/docs/specifications/CCS-RESEARCH-REPORT.md +169 -0
- package/docs/specifications/PLAN-ANV-verification-ralph-wiggum.md +403 -0
- package/docs/specifications/PLAN-parallel-tracks-anvil-memory-ccs.md +494 -0
- package/docs/specifications/SPEC-ANV-VRW/component-01-verify.md +208 -0
- package/docs/specifications/SPEC-ANV-VRW/component-02-stop-gate.md +226 -0
- package/docs/specifications/SPEC-ANV-VRW/component-03-posttooluse.md +209 -0
- package/docs/specifications/SPEC-ANV-VRW/component-04-ralph-wiggum.md +604 -0
- package/docs/specifications/SPEC-ANV-VRW/component-05-atomic-actions.md +311 -0
- package/docs/specifications/SPEC-ANV-VRW/component-06-verify-subagent.md +264 -0
- package/docs/specifications/SPEC-ANV-VRW/component-07-claude-md.md +363 -0
- package/docs/specifications/SPEC-ANV-VRW/index.md +182 -0
- package/docs/specifications/SPEC-ANV-anvil-memory.md +573 -0
- package/docs/specifications/SPEC-ANV-context-checkpoints.md +781 -0
- package/docs/specifications/SPEC-ANV-verification-ralph-wiggum.md +789 -0
- package/docs/sync.md +122 -0
- package/global/CLAUDE.md +140 -0
- package/global/agents/verify-app.md +164 -0
- package/global/commands/anvil-settings.md +527 -0
- package/global/commands/anvil-sync.md +121 -0
- package/global/commands/change.md +197 -0
- package/global/commands/clarify.md +252 -0
- package/global/commands/cleanup.md +292 -0
- package/global/commands/commit-push-pr.md +207 -0
- package/global/commands/decay-review.md +127 -0
- package/global/commands/discover.md +158 -0
- package/global/commands/doc-coverage.md +122 -0
- package/global/commands/evidence.md +307 -0
- package/global/commands/explore.md +121 -0
- package/global/commands/force-exit.md +135 -0
- package/global/commands/handoff.md +191 -0
- package/global/commands/healthcheck.md +302 -0
- package/global/commands/hud.md +84 -0
- package/global/commands/insights.md +319 -0
- package/global/commands/linear-setup.md +184 -0
- package/global/commands/lint-fix.md +198 -0
- package/global/commands/orient.md +510 -0
- package/global/commands/plan.md +228 -0
- package/global/commands/ralph.md +346 -0
- package/global/commands/ready.md +182 -0
- package/global/commands/release.md +305 -0
- package/global/commands/retro.md +96 -0
- package/global/commands/shard.md +166 -0
- package/global/commands/spec.md +227 -0
- package/global/commands/sprint.md +184 -0
- package/global/commands/tasks.md +228 -0
- package/global/commands/test-and-commit.md +151 -0
- package/global/commands/validate.md +132 -0
- package/global/commands/verify.md +251 -0
- package/global/commands/weekly-review.md +156 -0
- package/global/hooks/__pycache__/ralph_context_monitor.cpython-314.pyc +0 -0
- package/global/hooks/__pycache__/statusline_agent_sync.cpython-314.pyc +0 -0
- package/global/hooks/anvil_memory_observe.ts +322 -0
- package/global/hooks/anvil_memory_session.ts +166 -0
- package/global/hooks/anvil_memory_stop.ts +187 -0
- package/global/hooks/parse_transcript.py +116 -0
- package/global/hooks/post_merge_cleanup.sh +132 -0
- package/global/hooks/post_tool_format.sh +215 -0
- package/global/hooks/ralph_context_monitor.py +240 -0
- package/global/hooks/ralph_stop.sh +502 -0
- package/global/hooks/statusline.sh +1110 -0
- package/global/hooks/statusline_agent_sync.py +224 -0
- package/global/hooks/stop_gate.sh +250 -0
- package/global/lib/.claude/anvil-state.json +21 -0
- package/global/lib/__pycache__/agent_registry.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/claim_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/coderabbit_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/config_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/coordination_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/doc_coverage_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/gate_logger.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/github_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/hygiene_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/issue_models.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/issue_provider.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/linear_data_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/linear_provider.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/local_provider.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/quality_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/ralph_state.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/state_manager.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/transcript_parser.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/verification_runner.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/verify_iteration.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/verify_subagent.cpython-314.pyc +0 -0
- package/global/lib/agent_registry.py +995 -0
- package/global/lib/anvil-state.sh +435 -0
- package/global/lib/claim_service.py +515 -0
- package/global/lib/coderabbit_service.py +314 -0
- package/global/lib/config_service.py +423 -0
- package/global/lib/coordination_service.py +331 -0
- package/global/lib/doc_coverage_service.py +1305 -0
- package/global/lib/gate_logger.py +316 -0
- package/global/lib/github_service.py +310 -0
- package/global/lib/handoff_generator.py +775 -0
- package/global/lib/hygiene_service.py +712 -0
- package/global/lib/issue_models.py +257 -0
- package/global/lib/issue_provider.py +339 -0
- package/global/lib/linear_data_service.py +210 -0
- package/global/lib/linear_provider.py +987 -0
- package/global/lib/linear_provider.py.backup +671 -0
- package/global/lib/local_provider.py +486 -0
- package/global/lib/orient_fast.py +457 -0
- package/global/lib/quality_service.py +470 -0
- package/global/lib/ralph_prompt_generator.py +563 -0
- package/global/lib/ralph_state.py +1202 -0
- package/global/lib/state_manager.py +417 -0
- package/global/lib/transcript_parser.py +597 -0
- package/global/lib/verification_runner.py +557 -0
- package/global/lib/verify_iteration.py +490 -0
- package/global/lib/verify_subagent.py +250 -0
- package/global/skills/README.md +155 -0
- package/global/skills/quality-gates/SKILL.md +252 -0
- package/global/skills/skill-template/SKILL.md +109 -0
- package/global/skills/testing-strategies/SKILL.md +337 -0
- package/global/templates/CHANGE-template.md +105 -0
- package/global/templates/HANDOFF-template.md +63 -0
- package/global/templates/PLAN-template.md +111 -0
- package/global/templates/SPEC-template.md +93 -0
- package/global/templates/ralph/PROMPT.md.template +89 -0
- package/global/templates/ralph/fix_plan.md.template +31 -0
- package/global/templates/ralph/progress.txt.template +23 -0
- package/global/tests/__pycache__/test_doc_coverage.cpython-314.pyc +0 -0
- package/global/tests/test_doc_coverage.py +520 -0
- package/global/tests/test_issue_models.py +299 -0
- package/global/tests/test_local_provider.py +323 -0
- package/global/tools/README.md +178 -0
- package/global/tools/__pycache__/anvil-hud.cpython-314.pyc +0 -0
- package/global/tools/anvil-hud.py +3622 -0
- package/global/tools/anvil-hud.py.bak +3318 -0
- package/global/tools/anvil-issue.py +432 -0
- package/global/tools/anvil-memory/CLAUDE.md +49 -0
- package/global/tools/anvil-memory/README.md +42 -0
- package/global/tools/anvil-memory/bun.lock +25 -0
- package/global/tools/anvil-memory/bunfig.toml +9 -0
- package/global/tools/anvil-memory/package.json +23 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/context-monitor.test.ts +535 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/edge-cases.test.ts +645 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/fixtures.ts +363 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/index.ts +8 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/integration.test.ts +417 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/prompt-generator.test.ts +571 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/ralph-stop.test.ts +440 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/test-utils.ts +252 -0
- package/global/tools/anvil-memory/src/__tests__/commands.test.ts +657 -0
- package/global/tools/anvil-memory/src/__tests__/db.test.ts +641 -0
- package/global/tools/anvil-memory/src/__tests__/hooks.test.ts +272 -0
- package/global/tools/anvil-memory/src/__tests__/performance.test.ts +427 -0
- package/global/tools/anvil-memory/src/__tests__/test-utils.ts +113 -0
- package/global/tools/anvil-memory/src/commands/checkpoint.ts +197 -0
- package/global/tools/anvil-memory/src/commands/get.ts +115 -0
- package/global/tools/anvil-memory/src/commands/init.ts +94 -0
- package/global/tools/anvil-memory/src/commands/observe.ts +163 -0
- package/global/tools/anvil-memory/src/commands/search.ts +112 -0
- package/global/tools/anvil-memory/src/db.ts +638 -0
- package/global/tools/anvil-memory/src/index.ts +205 -0
- package/global/tools/anvil-memory/src/types.ts +122 -0
- package/global/tools/anvil-memory/tsconfig.json +29 -0
- package/global/tools/ralph-loop.sh +359 -0
- package/package.json +45 -0
- package/scripts/anvil +822 -0
- package/scripts/extract_patterns.py +222 -0
- package/scripts/init-project.sh +541 -0
- package/scripts/install.sh +229 -0
- package/scripts/postinstall.js +41 -0
- package/scripts/rollback.sh +188 -0
- package/scripts/sync.sh +623 -0
- package/scripts/test-statusline.sh +248 -0
- package/scripts/update_claude_md.py +224 -0
- package/scripts/verify.sh +255 -0
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
# /anvil-settings - Framework Configuration
|
|
2
|
+
|
|
3
|
+
> Manage Anvil framework settings for the current project.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- Configure auto-trigger behavior (auto-retro, auto-healthcheck)
|
|
7
|
+
- Configure statusline display (full, minimal, or off)
|
|
8
|
+
- Configure code review integration
|
|
9
|
+
- View current framework settings
|
|
10
|
+
- Reset settings to defaults
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# View all settings
|
|
16
|
+
/anvil-settings
|
|
17
|
+
|
|
18
|
+
# Toggle a boolean setting
|
|
19
|
+
/anvil-settings <setting> <on|off>
|
|
20
|
+
|
|
21
|
+
# Set statusline variant
|
|
22
|
+
/anvil-settings statusline <full|minimal|off>
|
|
23
|
+
|
|
24
|
+
# Configure code review
|
|
25
|
+
/anvil-settings codeReview <on|off>
|
|
26
|
+
/anvil-settings codeReview.enforcement <soft|hard>
|
|
27
|
+
|
|
28
|
+
# Reset to defaults
|
|
29
|
+
/anvil-settings reset
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Available Settings
|
|
33
|
+
|
|
34
|
+
| Setting | Default | Description |
|
|
35
|
+
|---------|---------|-------------|
|
|
36
|
+
| `autoRetro` | `off` | Prompt for `/retro` at session end |
|
|
37
|
+
| `autoHealthcheck` | `off` | Run `/healthcheck` at session end |
|
|
38
|
+
| `statusline` | `full` | Statusline display variant (`full`, `minimal`, `off`) |
|
|
39
|
+
| `codeReview` | `off` | Enable code review integration |
|
|
40
|
+
| `codeReview.tool` | `coderabbit` | Code review tool to use |
|
|
41
|
+
| `codeReview.enforcement` | `soft` | Enforcement level (`soft` = prompt, `hard` = block) |
|
|
42
|
+
| `hud` | `on` | Enable HUD features (agent registry, dashboard) |
|
|
43
|
+
| `hud.mode` | `sidebar` | HUD mode (`sidebar` for TUI, `statusline-only` for minimal) |
|
|
44
|
+
| `hud.showAgentCount` | `on` | Show agent count in statusline |
|
|
45
|
+
| `hud.refreshRate` | `2000` | Dashboard refresh rate in milliseconds |
|
|
46
|
+
| `hud.staleTimeout` | `30` | Minutes before stale agent cleanup |
|
|
47
|
+
|
|
48
|
+
### Statusline Variants
|
|
49
|
+
|
|
50
|
+
| Variant | Description |
|
|
51
|
+
|---------|-------------|
|
|
52
|
+
| `full` | Complete context: model, context%, dir, branch, issue, phase, cost |
|
|
53
|
+
| `minimal` | Compact display: model, issue, phase only |
|
|
54
|
+
| `off` | Disable statusline entirely |
|
|
55
|
+
|
|
56
|
+
### Code Review Enforcement Levels
|
|
57
|
+
|
|
58
|
+
| Level | Behavior |
|
|
59
|
+
|-------|----------|
|
|
60
|
+
| `soft` | Prompts user during `/evidence` but allows continuation |
|
|
61
|
+
| `hard` | Blocks PR creation until code review is completed |
|
|
62
|
+
|
|
63
|
+
### Code Review Tools
|
|
64
|
+
|
|
65
|
+
The `codeReview.tool` setting determines which tool to use:
|
|
66
|
+
- `coderabbit` — AI-powered code review via CodeRabbit
|
|
67
|
+
- Custom tools can be configured via `codeReview.command`
|
|
68
|
+
|
|
69
|
+
### HUD Modes
|
|
70
|
+
|
|
71
|
+
| Mode | Description |
|
|
72
|
+
|------|-------------|
|
|
73
|
+
| `sidebar` | Full TUI dashboard via `anvil-hud` command |
|
|
74
|
+
| `statusline-only` | Just show agent count in statusline, no TUI |
|
|
75
|
+
|
|
76
|
+
## Execution Steps
|
|
77
|
+
|
|
78
|
+
### Display Mode (no arguments)
|
|
79
|
+
|
|
80
|
+
When user runs `/anvil-settings` with no arguments:
|
|
81
|
+
|
|
82
|
+
1. **Read Config File**
|
|
83
|
+
```bash
|
|
84
|
+
# Config location
|
|
85
|
+
cat .claude/anvil.config.json
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
2. **Display Settings Table**
|
|
89
|
+
```markdown
|
|
90
|
+
## Anvil Settings
|
|
91
|
+
|
|
92
|
+
| Setting | Value | Description |
|
|
93
|
+
|---------|-------|-------------|
|
|
94
|
+
| autoRetro | off | Prompt for /retro at session end |
|
|
95
|
+
| autoHealthcheck | off | Run /healthcheck at session end |
|
|
96
|
+
| statusline | full | Statusline display variant |
|
|
97
|
+
| codeReview | off | Code review integration |
|
|
98
|
+
| codeReview.enforcement | soft | Enforcement level |
|
|
99
|
+
|
|
100
|
+
**Config file**: `.claude/anvil.config.json`
|
|
101
|
+
|
|
102
|
+
Usage:
|
|
103
|
+
- `/anvil-settings autoRetro on` - Enable auto-retro prompts
|
|
104
|
+
- `/anvil-settings statusline minimal` - Use compact statusline
|
|
105
|
+
- `/anvil-settings codeReview on` - Enable code review
|
|
106
|
+
- `/anvil-settings reset` - Reset all settings to defaults
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
3. **Handle Missing Config**
|
|
110
|
+
If config file doesn't exist, create with defaults:
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"version": "1.2",
|
|
114
|
+
"autoRetro": false,
|
|
115
|
+
"autoHealthcheck": false,
|
|
116
|
+
"statusline": {
|
|
117
|
+
"enabled": true,
|
|
118
|
+
"variant": "full"
|
|
119
|
+
},
|
|
120
|
+
"codeReview": {
|
|
121
|
+
"enabled": false,
|
|
122
|
+
"tool": "coderabbit",
|
|
123
|
+
"command": "coderabbit --prompt-only",
|
|
124
|
+
"enforcement": "soft"
|
|
125
|
+
},
|
|
126
|
+
"hud": {
|
|
127
|
+
"enabled": true,
|
|
128
|
+
"mode": "sidebar",
|
|
129
|
+
"showAgentCount": true,
|
|
130
|
+
"refreshRate": 2000,
|
|
131
|
+
"staleTimeout": 30
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Toggle Mode (`/anvil-settings <setting> <value>`)
|
|
137
|
+
|
|
138
|
+
1. **Validate Setting Name**
|
|
139
|
+
Valid settings: `autoRetro`, `autoHealthcheck`, `statusline`, `codeReview`, `codeReview.enforcement`
|
|
140
|
+
|
|
141
|
+
If invalid:
|
|
142
|
+
```markdown
|
|
143
|
+
**Error**: Unknown setting `<name>`
|
|
144
|
+
|
|
145
|
+
Valid settings:
|
|
146
|
+
- `autoRetro` - Prompt for /retro at session end
|
|
147
|
+
- `autoHealthcheck` - Run /healthcheck at session end
|
|
148
|
+
- `statusline` - Statusline variant (full/minimal/off)
|
|
149
|
+
- `codeReview` - Code review integration (on/off)
|
|
150
|
+
- `codeReview.enforcement` - Enforcement level (soft/hard)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
2. **Validate Value**
|
|
154
|
+
|
|
155
|
+
For boolean settings (`autoRetro`, `autoHealthcheck`):
|
|
156
|
+
- Valid values: `on`, `off`, `true`, `false`, `1`, `0`
|
|
157
|
+
- Normalize: `on`, `true`, `1` → `true`; `off`, `false`, `0` → `false`
|
|
158
|
+
|
|
159
|
+
For `statusline`:
|
|
160
|
+
- Valid values: `full`, `minimal`, `off`
|
|
161
|
+
- `off` sets `statusline.enabled: false`
|
|
162
|
+
- `full`/`minimal` sets `statusline.enabled: true` and `statusline.variant`
|
|
163
|
+
|
|
164
|
+
For `codeReview`:
|
|
165
|
+
- Valid values: `on`, `off`
|
|
166
|
+
- `on` sets `codeReview.enabled: true`
|
|
167
|
+
- `off` sets `codeReview.enabled: false`
|
|
168
|
+
|
|
169
|
+
For `codeReview.enforcement`:
|
|
170
|
+
- Valid values: `soft`, `hard`
|
|
171
|
+
- `soft` = prompts but allows continuation
|
|
172
|
+
- `hard` = blocks until code review completed
|
|
173
|
+
|
|
174
|
+
3. **Update Config**
|
|
175
|
+
Read existing config, update setting, write back.
|
|
176
|
+
|
|
177
|
+
4. **Confirm Change**
|
|
178
|
+
```markdown
|
|
179
|
+
✅ Updated `autoRetro` → **on**
|
|
180
|
+
|
|
181
|
+
Current settings:
|
|
182
|
+
| Setting | Value |
|
|
183
|
+
|---------|-------|
|
|
184
|
+
| autoRetro | on |
|
|
185
|
+
| autoHealthcheck | off |
|
|
186
|
+
| statusline | full |
|
|
187
|
+
| codeReview | off |
|
|
188
|
+
| codeReview.enforcement | soft |
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Reset Mode (`/anvil-settings reset`)
|
|
192
|
+
|
|
193
|
+
1. **Confirm Reset**
|
|
194
|
+
```markdown
|
|
195
|
+
Resetting all settings to defaults...
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
2. **Write Default Config**
|
|
199
|
+
```json
|
|
200
|
+
{
|
|
201
|
+
"version": "1.2",
|
|
202
|
+
"autoRetro": false,
|
|
203
|
+
"autoHealthcheck": false,
|
|
204
|
+
"statusline": {
|
|
205
|
+
"enabled": true,
|
|
206
|
+
"variant": "full"
|
|
207
|
+
},
|
|
208
|
+
"codeReview": {
|
|
209
|
+
"enabled": false,
|
|
210
|
+
"tool": "coderabbit",
|
|
211
|
+
"command": "coderabbit --prompt-only",
|
|
212
|
+
"enforcement": "soft"
|
|
213
|
+
},
|
|
214
|
+
"hud": {
|
|
215
|
+
"enabled": true,
|
|
216
|
+
"mode": "sidebar",
|
|
217
|
+
"showAgentCount": true,
|
|
218
|
+
"refreshRate": 2000,
|
|
219
|
+
"staleTimeout": 30
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
3. **Confirm**
|
|
225
|
+
```markdown
|
|
226
|
+
✅ Settings reset to defaults
|
|
227
|
+
|
|
228
|
+
| Setting | Value |
|
|
229
|
+
|---------|-------|
|
|
230
|
+
| autoRetro | off |
|
|
231
|
+
| autoHealthcheck | off |
|
|
232
|
+
| statusline | full |
|
|
233
|
+
| codeReview | off |
|
|
234
|
+
| codeReview.enforcement | soft |
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Config File Schema
|
|
238
|
+
|
|
239
|
+
**Location**: `.claude/anvil.config.json`
|
|
240
|
+
|
|
241
|
+
```json
|
|
242
|
+
{
|
|
243
|
+
"version": "1.2",
|
|
244
|
+
"autoRetro": false,
|
|
245
|
+
"autoHealthcheck": false,
|
|
246
|
+
"statusline": {
|
|
247
|
+
"enabled": true,
|
|
248
|
+
"variant": "full"
|
|
249
|
+
},
|
|
250
|
+
"codeReview": {
|
|
251
|
+
"enabled": false,
|
|
252
|
+
"tool": "coderabbit",
|
|
253
|
+
"command": "coderabbit --prompt-only",
|
|
254
|
+
"enforcement": "soft"
|
|
255
|
+
},
|
|
256
|
+
"hud": {
|
|
257
|
+
"enabled": true,
|
|
258
|
+
"mode": "sidebar",
|
|
259
|
+
"showAgentCount": true,
|
|
260
|
+
"refreshRate": 2000,
|
|
261
|
+
"staleTimeout": 30
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Schema Details
|
|
267
|
+
|
|
268
|
+
| Field | Type | Default | Description |
|
|
269
|
+
|-------|------|---------|-------------|
|
|
270
|
+
| `version` | string | `"1.2"` | Config schema version |
|
|
271
|
+
| `autoRetro` | boolean | `false` | Enable auto-retro prompt at session end |
|
|
272
|
+
| `autoHealthcheck` | boolean | `false` | Enable auto-healthcheck at session end |
|
|
273
|
+
| `statusline.enabled` | boolean | `true` | Enable/disable statusline display |
|
|
274
|
+
| `statusline.variant` | string | `"full"` | Display variant: `full`, `minimal` |
|
|
275
|
+
| `codeReview.enabled` | boolean | `false` | Enable code review integration |
|
|
276
|
+
| `codeReview.tool` | string | `"coderabbit"` | Code review tool name |
|
|
277
|
+
| `codeReview.command` | string | `"coderabbit --prompt-only"` | Command to run for code review |
|
|
278
|
+
| `codeReview.enforcement` | string | `"soft"` | Enforcement level: `soft`, `hard` |
|
|
279
|
+
| `hud.enabled` | boolean | `true` | Enable/disable HUD features |
|
|
280
|
+
| `hud.mode` | string | `"sidebar"` | HUD mode: `sidebar`, `statusline-only` |
|
|
281
|
+
| `hud.showAgentCount` | boolean | `true` | Show agent count in statusline |
|
|
282
|
+
| `hud.refreshRate` | number | `2000` | Dashboard refresh rate in ms |
|
|
283
|
+
| `hud.staleTimeout` | number | `30` | Minutes before stale agent cleanup |
|
|
284
|
+
|
|
285
|
+
## Integration with Hooks
|
|
286
|
+
|
|
287
|
+
### Stop Hook
|
|
288
|
+
When settings are enabled, the stop hook (`hooks/stop.py`) reads this config and:
|
|
289
|
+
|
|
290
|
+
- **autoRetro: true** → Outputs reminder to run `/retro`
|
|
291
|
+
- **autoHealthcheck: true** → Outputs reminder to run `/healthcheck`
|
|
292
|
+
|
|
293
|
+
### Statusline Hook
|
|
294
|
+
The statusline hook (`hooks/statusline.sh`) reads this config to determine display:
|
|
295
|
+
|
|
296
|
+
- **statusline.enabled: false** → Statusline is completely disabled
|
|
297
|
+
- **statusline.variant: "full"** → Shows model, context%, dir, branch, issue, phase, cost
|
|
298
|
+
- **statusline.variant: "minimal"** → Shows only model, issue, phase
|
|
299
|
+
|
|
300
|
+
### HUD Integration
|
|
301
|
+
The HUD system uses this config across multiple hooks:
|
|
302
|
+
|
|
303
|
+
- **Session Start** (`hooks/session_start.py --register-agent`)
|
|
304
|
+
- If `hud.enabled: true`, registers agent in `~/.anvil/agents.json`
|
|
305
|
+
|
|
306
|
+
- **Post Tool Use** (`hooks/post_tool_use.py --update-agent`)
|
|
307
|
+
- If `hud.enabled: true`, updates agent context/cost in registry
|
|
308
|
+
|
|
309
|
+
- **Stop** (`hooks/stop.py --cleanup-agent`)
|
|
310
|
+
- If `hud.enabled: true`, deregisters agent from registry
|
|
311
|
+
|
|
312
|
+
- **Statusline** (`hooks/statusline.sh`)
|
|
313
|
+
- If `hud.showAgentCount: true`, shows "👥 N agents" when multiple active
|
|
314
|
+
|
|
315
|
+
- **anvil-hud** TUI dashboard
|
|
316
|
+
- Uses `hud.refreshRate` for polling interval
|
|
317
|
+
- Uses `hud.staleTimeout` for automatic cleanup
|
|
318
|
+
|
|
319
|
+
## Integration with /evidence
|
|
320
|
+
|
|
321
|
+
When `codeReview.enabled: true`, the `/evidence` command includes Step 5: Code Review:
|
|
322
|
+
|
|
323
|
+
- **enforcement: "soft"** → Prompts user to confirm code review status, allows skip
|
|
324
|
+
- **enforcement: "hard"** → Blocks PR creation until code review is completed
|
|
325
|
+
|
|
326
|
+
The `/evidence` command reads `codeReview.command` to determine which tool to run or suggest.
|
|
327
|
+
|
|
328
|
+
## Examples
|
|
329
|
+
|
|
330
|
+
### View Settings
|
|
331
|
+
```
|
|
332
|
+
User: /anvil-settings
|
|
333
|
+
|
|
334
|
+
Claude: ## Anvil Settings
|
|
335
|
+
|
|
336
|
+
| Setting | Value | Description |
|
|
337
|
+
|---------|-------|-------------|
|
|
338
|
+
| autoRetro | off | Prompt for /retro at session end |
|
|
339
|
+
| autoHealthcheck | off | Run /healthcheck at session end |
|
|
340
|
+
| statusline | full | Statusline display variant |
|
|
341
|
+
| codeReview | off | Code review integration |
|
|
342
|
+
| codeReview.enforcement | soft | Enforcement level |
|
|
343
|
+
|
|
344
|
+
**Config file**: `.claude/anvil.config.json`
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### Enable Auto-Retro
|
|
348
|
+
```
|
|
349
|
+
User: /anvil-settings autoRetro on
|
|
350
|
+
|
|
351
|
+
Claude: ✅ Updated `autoRetro` → **on**
|
|
352
|
+
|
|
353
|
+
Current settings:
|
|
354
|
+
| Setting | Value |
|
|
355
|
+
|---------|-------|
|
|
356
|
+
| autoRetro | on |
|
|
357
|
+
| autoHealthcheck | off |
|
|
358
|
+
| statusline | full |
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### Set Statusline to Minimal
|
|
362
|
+
```
|
|
363
|
+
User: /anvil-settings statusline minimal
|
|
364
|
+
|
|
365
|
+
Claude: ✅ Updated `statusline` → **minimal**
|
|
366
|
+
|
|
367
|
+
Current settings:
|
|
368
|
+
| Setting | Value |
|
|
369
|
+
|---------|-------|
|
|
370
|
+
| autoRetro | off |
|
|
371
|
+
| autoHealthcheck | off |
|
|
372
|
+
| statusline | minimal |
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
### Disable Statusline
|
|
376
|
+
```
|
|
377
|
+
User: /anvil-settings statusline off
|
|
378
|
+
|
|
379
|
+
Claude: ✅ Updated `statusline` → **off**
|
|
380
|
+
|
|
381
|
+
Current settings:
|
|
382
|
+
| Setting | Value |
|
|
383
|
+
|---------|-------|
|
|
384
|
+
| autoRetro | off |
|
|
385
|
+
| autoHealthcheck | off |
|
|
386
|
+
| statusline | off |
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### Reset Settings
|
|
390
|
+
```
|
|
391
|
+
User: /anvil-settings reset
|
|
392
|
+
|
|
393
|
+
Claude: ✅ Settings reset to defaults
|
|
394
|
+
|
|
395
|
+
| Setting | Value |
|
|
396
|
+
|---------|-------|
|
|
397
|
+
| autoRetro | off |
|
|
398
|
+
| autoHealthcheck | off |
|
|
399
|
+
| statusline | full |
|
|
400
|
+
| codeReview | off |
|
|
401
|
+
| codeReview.enforcement | soft |
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
### Enable Code Review
|
|
405
|
+
```
|
|
406
|
+
User: /anvil-settings codeReview on
|
|
407
|
+
|
|
408
|
+
Claude: ✅ Updated `codeReview` → **on**
|
|
409
|
+
|
|
410
|
+
Current settings:
|
|
411
|
+
| Setting | Value |
|
|
412
|
+
|---------|-------|
|
|
413
|
+
| autoRetro | off |
|
|
414
|
+
| autoHealthcheck | off |
|
|
415
|
+
| statusline | full |
|
|
416
|
+
| codeReview | on |
|
|
417
|
+
| codeReview.enforcement | soft |
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
### Set Code Review Enforcement to Hard
|
|
421
|
+
```
|
|
422
|
+
User: /anvil-settings codeReview.enforcement hard
|
|
423
|
+
|
|
424
|
+
Claude: ✅ Updated `codeReview.enforcement` → **hard**
|
|
425
|
+
|
|
426
|
+
Current settings:
|
|
427
|
+
| Setting | Value |
|
|
428
|
+
|---------|-------|
|
|
429
|
+
| autoRetro | off |
|
|
430
|
+
| autoHealthcheck | off |
|
|
431
|
+
| statusline | full |
|
|
432
|
+
| codeReview | on |
|
|
433
|
+
| codeReview.enforcement | hard |
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
### Enable HUD
|
|
437
|
+
```
|
|
438
|
+
User: /anvil-settings hud on
|
|
439
|
+
|
|
440
|
+
Claude: ✅ Updated `hud` → **on**
|
|
441
|
+
|
|
442
|
+
Current settings:
|
|
443
|
+
| Setting | Value |
|
|
444
|
+
|---------|-------|
|
|
445
|
+
| autoRetro | off |
|
|
446
|
+
| autoHealthcheck | off |
|
|
447
|
+
| statusline | full |
|
|
448
|
+
| codeReview | off |
|
|
449
|
+
| hud | on |
|
|
450
|
+
| hud.showAgentCount | on |
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### Disable Agent Count in Statusline
|
|
454
|
+
```
|
|
455
|
+
User: /anvil-settings hud.showAgentCount off
|
|
456
|
+
|
|
457
|
+
Claude: ✅ Updated `hud.showAgentCount` → **off**
|
|
458
|
+
|
|
459
|
+
The statusline will no longer show "👥 N agents" when multiple agents are active.
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### Set HUD Mode to Statusline-Only
|
|
463
|
+
```
|
|
464
|
+
User: /anvil-settings hud.mode statusline-only
|
|
465
|
+
|
|
466
|
+
Claude: ✅ Updated `hud.mode` → **statusline-only**
|
|
467
|
+
|
|
468
|
+
HUD will only show agent count in statusline. Run `anvil-hud` for full dashboard.
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
### Invalid Setting
|
|
472
|
+
```
|
|
473
|
+
User: /anvil-settings verbose on
|
|
474
|
+
|
|
475
|
+
Claude: **Error**: Unknown setting `verbose`
|
|
476
|
+
|
|
477
|
+
Valid settings:
|
|
478
|
+
- `autoRetro` - Prompt for /retro at session end
|
|
479
|
+
- `autoHealthcheck` - Run /healthcheck at session end
|
|
480
|
+
- `statusline` - Statusline variant (full/minimal/off)
|
|
481
|
+
- `codeReview` - Code review integration (on/off)
|
|
482
|
+
- `codeReview.enforcement` - Enforcement level (soft/hard)
|
|
483
|
+
- `hud` - HUD features (on/off)
|
|
484
|
+
- `hud.mode` - HUD mode (sidebar/statusline-only)
|
|
485
|
+
- `hud.showAgentCount` - Show agent count in statusline (on/off)
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### Invalid Statusline Variant
|
|
489
|
+
```
|
|
490
|
+
User: /anvil-settings statusline compact
|
|
491
|
+
|
|
492
|
+
Claude: **Error**: Invalid statusline variant `compact`
|
|
493
|
+
|
|
494
|
+
Valid variants:
|
|
495
|
+
- `full` - Complete context display
|
|
496
|
+
- `minimal` - Compact display (model, issue, phase only)
|
|
497
|
+
- `off` - Disable statusline
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
### Invalid Code Review Enforcement
|
|
501
|
+
```
|
|
502
|
+
User: /anvil-settings codeReview.enforcement strict
|
|
503
|
+
|
|
504
|
+
Claude: **Error**: Invalid enforcement level `strict`
|
|
505
|
+
|
|
506
|
+
Valid enforcement levels:
|
|
507
|
+
- `soft` - Prompts but allows continuation
|
|
508
|
+
- `hard` - Blocks until code review completed
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
## Error Handling
|
|
512
|
+
|
|
513
|
+
| Error | Response |
|
|
514
|
+
|-------|----------|
|
|
515
|
+
| Invalid setting name | Show valid options |
|
|
516
|
+
| Invalid value for boolean setting | Show valid values (on/off) |
|
|
517
|
+
| Invalid statusline variant | Show valid variants (full/minimal/off) |
|
|
518
|
+
| Invalid enforcement level | Show valid levels (soft/hard) |
|
|
519
|
+
| Corrupted config | Reset to defaults, warn user |
|
|
520
|
+
| Permission denied | Show error, suggest fix |
|
|
521
|
+
|
|
522
|
+
## Related Commands
|
|
523
|
+
|
|
524
|
+
- `/healthcheck` - Manual framework diagnostics
|
|
525
|
+
- `/retro` - Manual retrospective
|
|
526
|
+
- `/validate` - Environment validation
|
|
527
|
+
- `/evidence` - Quality gate checks (uses codeReview settings)
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Sync Anvil framework updates to this project or global config
|
|
3
|
+
arguments:
|
|
4
|
+
- name: target
|
|
5
|
+
description: "Where to sync: 'project' (default), 'global', or 'both'"
|
|
6
|
+
default: "project"
|
|
7
|
+
- name: force
|
|
8
|
+
description: "Overwrite protected files (CLAUDE.md, product.md, etc.)"
|
|
9
|
+
default: "false"
|
|
10
|
+
- name: dry-run
|
|
11
|
+
description: "Preview changes without applying"
|
|
12
|
+
default: "false"
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Anvil Sync
|
|
16
|
+
|
|
17
|
+
Sync the latest Anvil framework updates to this project and/or global config.
|
|
18
|
+
|
|
19
|
+
## What Gets Synced
|
|
20
|
+
|
|
21
|
+
### Always Updated (framework functionality)
|
|
22
|
+
- `hooks/` - All hook scripts (session_start, stop, notification, etc.)
|
|
23
|
+
- `examples/` - Reference implementation templates
|
|
24
|
+
- `agents/` - Sub-agent definitions
|
|
25
|
+
- `retros/templates/` - Retrospective templates
|
|
26
|
+
- `commands/` - Slash commands from global config
|
|
27
|
+
|
|
28
|
+
### Protected Files (not overwritten without --force)
|
|
29
|
+
- `CLAUDE.md` - Project-specific AI instructions
|
|
30
|
+
- `product.md` - Product definition
|
|
31
|
+
- `constitution.md` - Project principles
|
|
32
|
+
- `settings.local.json` - Local permissions and hook config
|
|
33
|
+
|
|
34
|
+
## Execution
|
|
35
|
+
|
|
36
|
+
<thinking>
|
|
37
|
+
1. Determine Anvil source directory
|
|
38
|
+
2. Determine sync target(s)
|
|
39
|
+
3. Run sync with appropriate flags
|
|
40
|
+
4. Report what was updated
|
|
41
|
+
</thinking>
|
|
42
|
+
|
|
43
|
+
### Step 1: Locate Anvil Framework
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Check common locations
|
|
47
|
+
ANVIL_DIR=""
|
|
48
|
+
if [ -d "$HOME/Projects/anvil-dev-framework" ]; then
|
|
49
|
+
ANVIL_DIR="$HOME/Projects/anvil-dev-framework"
|
|
50
|
+
elif [ -n "$ANVIL_HOME" ]; then
|
|
51
|
+
ANVIL_DIR="$ANVIL_HOME"
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
if [ -z "$ANVIL_DIR" ]; then
|
|
55
|
+
echo "ERROR: Could not find anvil-dev-framework"
|
|
56
|
+
echo "Set ANVIL_HOME or ensure it's in ~/Projects/"
|
|
57
|
+
exit 1
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
echo "Anvil source: $ANVIL_DIR"
|
|
61
|
+
echo "Current version: $(cat $ANVIL_DIR/VERSION)"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Step 2: Build Sync Command
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
SYNC_CMD="$ANVIL_DIR/scripts/sync.sh"
|
|
68
|
+
|
|
69
|
+
# Add target flag
|
|
70
|
+
TARGET="${target:-project}"
|
|
71
|
+
case "$TARGET" in
|
|
72
|
+
project)
|
|
73
|
+
SYNC_CMD="$SYNC_CMD --project ."
|
|
74
|
+
;;
|
|
75
|
+
global)
|
|
76
|
+
SYNC_CMD="$SYNC_CMD --global"
|
|
77
|
+
;;
|
|
78
|
+
both)
|
|
79
|
+
SYNC_CMD="$SYNC_CMD --global --project ."
|
|
80
|
+
;;
|
|
81
|
+
esac
|
|
82
|
+
|
|
83
|
+
# Add optional flags
|
|
84
|
+
if [ "${force}" = "true" ]; then
|
|
85
|
+
SYNC_CMD="$SYNC_CMD --force"
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
if [ "${dry-run}" = "true" ]; then
|
|
89
|
+
SYNC_CMD="$SYNC_CMD --dry-run"
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
echo "Running: $SYNC_CMD"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Step 3: Execute Sync
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
$SYNC_CMD
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Step 4: Summary
|
|
102
|
+
|
|
103
|
+
After sync completes, report:
|
|
104
|
+
- Number of files updated
|
|
105
|
+
- Any protected files that were skipped
|
|
106
|
+
- New version marker
|
|
107
|
+
|
|
108
|
+
## Post-Sync Checklist
|
|
109
|
+
|
|
110
|
+
- [ ] Review any updated hooks for breaking changes
|
|
111
|
+
- [ ] Check if new commands are available (`/help`)
|
|
112
|
+
- [ ] Verify settings.local.json hook paths are correct
|
|
113
|
+
- [ ] Run `/orient` to confirm everything works
|
|
114
|
+
|
|
115
|
+
## Troubleshooting
|
|
116
|
+
|
|
117
|
+
If sync fails:
|
|
118
|
+
1. Ensure anvil-dev-framework repo is up to date: `cd $ANVIL_DIR && git pull`
|
|
119
|
+
2. Check file permissions in .claude/
|
|
120
|
+
3. Run with `--dry-run` first to preview changes
|
|
121
|
+
4. Use `--force` only if you want to reset customized files
|