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,247 @@
|
|
|
1
|
+
# Linear-GitHub Integration Guide
|
|
2
|
+
|
|
3
|
+
> How Linear automatically syncs with GitHub PRs and commits.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Linear's GitHub integration automatically links issues to Pull Requests and commits. When you include a Linear issue key (e.g., `ANV-123`) in your PR title, body, commit message, or branch name, Linear detects it and updates the issue status automatically.
|
|
8
|
+
|
|
9
|
+
**Key benefit**: You don't need to manually update Linear issues when PRs are merged — it happens automatically.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## How It Works
|
|
14
|
+
|
|
15
|
+
### Pattern Detection
|
|
16
|
+
|
|
17
|
+
Linear watches for issue keys in:
|
|
18
|
+
|
|
19
|
+
| Location | Example | Detected |
|
|
20
|
+
|----------|---------|----------|
|
|
21
|
+
| PR Title | `feat(api): add auth endpoint (ANV-123)` | ANV-123 |
|
|
22
|
+
| PR Body | `Closes ANV-123` or `Fixes ANV-123` | ANV-123 |
|
|
23
|
+
| Commit Message | `feat: implement feature ANV-123` | ANV-123 |
|
|
24
|
+
| Branch Name | `feature/ANV-123-auth-endpoint` | ANV-123 |
|
|
25
|
+
|
|
26
|
+
### Automatic State Transitions
|
|
27
|
+
|
|
28
|
+
| GitHub Event | Linear Action |
|
|
29
|
+
|--------------|---------------|
|
|
30
|
+
| PR opened | Issue → In Progress |
|
|
31
|
+
| PR merged | Issue → Done |
|
|
32
|
+
| Commit pushed | Links commit to issue |
|
|
33
|
+
|
|
34
|
+
These automations are configurable per-team in Linear settings.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Setup
|
|
39
|
+
|
|
40
|
+
### Prerequisites
|
|
41
|
+
|
|
42
|
+
- Linear workspace with a team
|
|
43
|
+
- GitHub repository
|
|
44
|
+
- Admin access to both
|
|
45
|
+
|
|
46
|
+
### Step 1: Install Linear GitHub App
|
|
47
|
+
|
|
48
|
+
1. Go to **Linear Settings** → **Integrations** → **GitHub**
|
|
49
|
+
2. Click **Install GitHub App**
|
|
50
|
+
3. Authorize Linear to access your organization
|
|
51
|
+
4. Select repositories to connect
|
|
52
|
+
|
|
53
|
+
### Step 2: Configure Workflow Automations
|
|
54
|
+
|
|
55
|
+
1. In Linear, go to **Settings** → **Team Settings** → **Workflow**
|
|
56
|
+
2. Under **GitHub**, configure:
|
|
57
|
+
- **On PR opened**: Set to "In Progress" (or custom state)
|
|
58
|
+
- **On PR merged**: Set to "Done" (or custom state)
|
|
59
|
+
3. Save changes
|
|
60
|
+
|
|
61
|
+
### Step 3: Verify Connection
|
|
62
|
+
|
|
63
|
+
1. Create a test PR with a Linear issue key in the title
|
|
64
|
+
2. Check Linear — the issue should show the linked PR
|
|
65
|
+
3. Merge the PR — the issue should move to Done
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Usage Patterns
|
|
70
|
+
|
|
71
|
+
### Recommended PR Title Format
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
<type>(<scope>): <description> (<issue-key>)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Examples:
|
|
78
|
+
```text
|
|
79
|
+
feat(auth): add OAuth login (ANV-123)
|
|
80
|
+
fix(api): handle null response (ANV-456)
|
|
81
|
+
chore(deps): update dependencies (ANV-789)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Recommended Commit Message Format
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
<type>(<scope>): <description> (<issue-key>)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The issue key can be anywhere in the message:
|
|
91
|
+
```text
|
|
92
|
+
ANV-123: implement feature
|
|
93
|
+
feat: implement feature (ANV-123)
|
|
94
|
+
feat(ANV-123): implement feature
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Recommended Branch Naming
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
feature/<issue-key>-<short-description>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Examples:
|
|
104
|
+
```text
|
|
105
|
+
feature/ANV-123-oauth-login
|
|
106
|
+
fix/ANV-456-null-response
|
|
107
|
+
chore/ANV-789-update-deps
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Anvil Workflow Integration
|
|
113
|
+
|
|
114
|
+
### What This Means for Agents
|
|
115
|
+
|
|
116
|
+
1. **Don't manually update Linear after PR merge** — it's automatic
|
|
117
|
+
2. **Include issue key in PR title** — ensures linking works
|
|
118
|
+
3. **Use state guard in linear.py** — prevents redundant updates
|
|
119
|
+
|
|
120
|
+
### State Guard
|
|
121
|
+
|
|
122
|
+
The Linear CLI includes a state guard that skips updates when the issue is already in the target state:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# This will skip if ANV-123 is already Done
|
|
126
|
+
python3 scripts/linear.py update-issue --id ANV-123 --state <done-uuid>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Output when skipped:
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"skipped": true,
|
|
133
|
+
"reason": "ANV-123 already in state 'Done' - skipping update"
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Force update even if already in state (use sparingly):
|
|
138
|
+
```bash
|
|
139
|
+
python3 scripts/linear.py update-issue --id ANV-123 --state <done-uuid> --force
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Workflow Commands
|
|
143
|
+
|
|
144
|
+
These commands acknowledge the auto-close behavior:
|
|
145
|
+
|
|
146
|
+
| Command | Behavior |
|
|
147
|
+
|---------|----------|
|
|
148
|
+
| `/evidence` | Notes that Linear updates on PR merge |
|
|
149
|
+
| `/tasks` | Documents that issues auto-update |
|
|
150
|
+
| `/handoff` | Notes issue state may have changed |
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Troubleshooting
|
|
155
|
+
|
|
156
|
+
### Issue Not Linking to PR
|
|
157
|
+
|
|
158
|
+
**Symptoms**: PR merged but Linear issue didn't update
|
|
159
|
+
|
|
160
|
+
**Causes & Solutions**:
|
|
161
|
+
|
|
162
|
+
1. **Issue key not detected**
|
|
163
|
+
- Ensure key format matches: `ANV-123` (team key + number)
|
|
164
|
+
- Check it's in PR title, body, commits, or branch name
|
|
165
|
+
- Keys are case-sensitive: `ANV-123` ✓, `anv-123` ✗
|
|
166
|
+
|
|
167
|
+
2. **GitHub app not installed**
|
|
168
|
+
- Go to Linear Settings → Integrations → GitHub
|
|
169
|
+
- Verify app is installed and has repo access
|
|
170
|
+
|
|
171
|
+
3. **Workflow automation disabled**
|
|
172
|
+
- Go to Linear Team Settings → Workflow
|
|
173
|
+
- Ensure "On PR merged" is set to a state
|
|
174
|
+
|
|
175
|
+
### Sync Delay
|
|
176
|
+
|
|
177
|
+
**Symptoms**: PR merged but Linear took >1 minute to update
|
|
178
|
+
|
|
179
|
+
**Causes**:
|
|
180
|
+
- GitHub webhook delivery delay (usually <30 seconds)
|
|
181
|
+
- Linear processing queue
|
|
182
|
+
|
|
183
|
+
**Solution**: Wait a few minutes. If still not updated after 5 minutes, check:
|
|
184
|
+
- GitHub webhook delivery in repo settings
|
|
185
|
+
- Linear integration status
|
|
186
|
+
|
|
187
|
+
### Wrong State After Merge
|
|
188
|
+
|
|
189
|
+
**Symptoms**: Issue moved to unexpected state
|
|
190
|
+
|
|
191
|
+
**Causes**:
|
|
192
|
+
- Team workflow automation set to wrong state
|
|
193
|
+
- Multiple PRs linked to same issue (waits for all to merge)
|
|
194
|
+
|
|
195
|
+
**Solution**:
|
|
196
|
+
- Check Team Settings → Workflow → "On PR merged" setting
|
|
197
|
+
- If multiple PRs, ensure all are merged
|
|
198
|
+
|
|
199
|
+
### State Guard Not Working
|
|
200
|
+
|
|
201
|
+
**Symptoms**: `update-issue` still makes API call when should skip
|
|
202
|
+
|
|
203
|
+
**Causes**:
|
|
204
|
+
- Using different state ID than current
|
|
205
|
+
- Not passing `--state` argument
|
|
206
|
+
|
|
207
|
+
**Solution**:
|
|
208
|
+
- Verify state IDs match: `get-issue --id ANV-123` shows current state ID
|
|
209
|
+
- Ensure you're updating state (guard only checks state changes)
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## FAQ
|
|
214
|
+
|
|
215
|
+
### Q: Does this work with GitHub Issues too?
|
|
216
|
+
|
|
217
|
+
No. Linear's GitHub integration is for linking Linear issues to GitHub PRs/commits. It doesn't sync with GitHub Issues.
|
|
218
|
+
|
|
219
|
+
### Q: Can I disable the auto-close behavior?
|
|
220
|
+
|
|
221
|
+
Yes. In Linear Team Settings → Workflow, set "On PR merged" to "No change" to disable automatic state transitions.
|
|
222
|
+
|
|
223
|
+
### Q: What if my PR relates to multiple issues?
|
|
224
|
+
|
|
225
|
+
Include all issue keys in the PR. Linear will link and update all of them:
|
|
226
|
+
```text
|
|
227
|
+
feat: implement auth flow (ANV-123, ANV-124)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Q: Does the branch name need to match exactly?
|
|
231
|
+
|
|
232
|
+
No. Linear uses pattern matching. As long as the issue key appears in the branch name, it will be detected:
|
|
233
|
+
- `feature/ANV-123-auth` ✓
|
|
234
|
+
- `ANV-123/auth-feature` ✓
|
|
235
|
+
- `auth-ANV-123` ✓
|
|
236
|
+
|
|
237
|
+
### Q: What about commits that don't become PRs?
|
|
238
|
+
|
|
239
|
+
Direct commits to main with issue keys will still link to the issue, but won't trigger state changes (those require PR events).
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## References
|
|
244
|
+
|
|
245
|
+
- [Linear GitHub Integration Docs](https://linear.app/docs/github-integration)
|
|
246
|
+
- [Linear Workflow Configuration](https://linear.app/changelog/2019-07-11-github-workflow-configuration)
|
|
247
|
+
- [Linking PRs to Issues (GitHub)](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue)
|