anvil-dev-framework 0.1.8 → 0.1.9
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 +48 -18
- package/VERSION +1 -1
- package/docs/command-reference.md +97 -16
- package/docs/system-architecture.md +15 -0
- package/global/api/__pycache__/ralph_api.cpython-314.pyc +0 -0
- package/global/api/openapi.yaml +357 -0
- package/global/api/ralph_api.py +528 -0
- package/global/commands/anvil-settings.md +44 -18
- package/global/commands/coderabbit-fix.md +282 -0
- package/global/commands/evidence.md +23 -6
- package/global/commands/hud.md +24 -0
- package/global/commands/orient.md +22 -21
- package/global/commands/weekly-review.md +21 -1
- package/global/config/notifications.yaml.template +50 -0
- package/global/hooks/ralph_stop.sh +33 -1
- package/global/hooks/statusline.sh +67 -2
- package/global/lib/__pycache__/coderabbit_metrics.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/command_tracker.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/context_optimizer.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/linear_provider.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/optimization_applier.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/ralph_webhooks.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/state_manager.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/token_analyzer.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/token_metrics.cpython-314.pyc +0 -0
- package/global/lib/coderabbit_metrics.py +647 -0
- package/global/lib/command_tracker.py +147 -0
- package/global/lib/log_rotation.py +287 -0
- package/global/lib/ralph_events.py +398 -0
- package/global/lib/ralph_notifier.py +366 -0
- package/global/lib/ralph_webhooks.py +470 -0
- package/global/lib/state_manager.py +121 -0
- package/global/lib/token_analyzer.py +28 -2
- package/global/lib/token_metrics.py +49 -3
- package/global/tests/__pycache__/test_command_tracker.cpython-314-pytest-9.0.2.pyc +0 -0
- package/global/tests/__pycache__/test_context_optimizer.cpython-314-pytest-9.0.2.pyc +0 -0
- package/global/tests/__pycache__/test_linear_filtering.cpython-314-pytest-9.0.2.pyc +0 -0
- package/global/tests/__pycache__/test_linear_provider.cpython-314-pytest-9.0.2.pyc +0 -0
- package/global/tests/__pycache__/test_optimization_applier.cpython-314-pytest-9.0.2.pyc +0 -0
- package/global/tests/__pycache__/test_token_analyzer.cpython-314-pytest-9.0.2.pyc +0 -0
- package/global/tests/__pycache__/test_token_analyzer_phase6.cpython-314-pytest-9.0.2.pyc +0 -0
- package/global/tests/__pycache__/test_token_metrics.cpython-314-pytest-9.0.2.pyc +0 -0
- package/global/tests/test_command_tracker.py +172 -0
- package/global/tests/test_token_metrics.py +38 -0
- package/global/tools/README.md +153 -0
- package/global/tools/__pycache__/anvil-hud.cpython-314.pyc +0 -0
- package/global/tools/__pycache__/orient_linear.cpython-314.pyc +0 -0
- package/global/tools/__pycache__/ralph-watchcpython-314.pyc +0 -0
- package/global/tools/anvil-hud.py +86 -1
- package/global/tools/anvil-memory/src/__tests__/ccs/context-monitor.test.ts +472 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/fixtures.ts +405 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/index.ts +36 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/prompt-generator.test.ts +653 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/ralph-stop.test.ts +727 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/test-utils.ts +340 -0
- package/global/tools/anvil-memory/src/__tests__/commands.test.ts +218 -0
- package/global/tools/anvil-memory/src/commands/context.ts +322 -0
- package/global/tools/anvil-memory/src/db.ts +108 -0
- package/global/tools/anvil-memory/src/index.ts +2 -8
- package/global/tools/orient_linear.py +159 -0
- package/global/tools/ralph-watch +423 -0
- package/package.json +2 -1
- package/project/.anvil-project.yaml.template +93 -0
- package/project/CLAUDE.md.template +343 -0
- package/project/agents/README.md +119 -0
- package/project/agents/cross-layer-debugger.md +217 -0
- package/project/agents/security-code-reviewer.md +162 -0
- package/project/constitution.md.template +235 -0
- package/project/coordination.md +103 -0
- package/project/docs/background-tasks.md +258 -0
- package/project/docs/skills-frontmatter.md +243 -0
- package/project/examples/README.md +106 -0
- package/project/examples/api-route-template.ts +171 -0
- package/project/examples/component-template.tsx +110 -0
- package/project/examples/hook-template.ts +152 -0
- package/project/examples/service-template.ts +207 -0
- package/project/examples/test-template.test.tsx +249 -0
- package/project/hooks/README.md +491 -0
- package/project/hooks/__pycache__/notification.cpython-314.pyc +0 -0
- package/project/hooks/__pycache__/post_tool_use.cpython-314.pyc +0 -0
- package/project/hooks/__pycache__/pre_tool_use.cpython-314.pyc +0 -0
- package/project/hooks/__pycache__/session_start.cpython-314.pyc +0 -0
- package/project/hooks/__pycache__/stop.cpython-314.pyc +0 -0
- package/project/hooks/notification.py +183 -0
- package/project/hooks/permission_request.py +438 -0
- package/project/hooks/post_tool_use.py +397 -0
- package/project/hooks/pre_compact.py +126 -0
- package/project/hooks/pre_tool_use.py +454 -0
- package/project/hooks/session_start.py +656 -0
- package/project/hooks/stop.py +356 -0
- package/project/hooks/subagent_start.py +223 -0
- package/project/hooks/subagent_stop.py +215 -0
- package/project/hooks/user_prompt_submit.py +110 -0
- package/project/hooks/utils/llm/anth.py +114 -0
- package/project/hooks/utils/llm/oai.py +114 -0
- package/project/hooks/utils/tts/elevenlabs_tts.py +63 -0
- package/project/hooks/utils/tts/mlx_audio_tts.py +86 -0
- package/project/hooks/utils/tts/openai_tts.py +92 -0
- package/project/hooks/utils/tts/pyttsx3_tts.py +75 -0
- package/project/linear.yaml.template +23 -0
- package/project/product.md.template +238 -0
- package/project/retros/README.md +126 -0
- package/project/rules/README.md +90 -0
- package/project/rules/debugging.md +139 -0
- package/project/rules/security-review.md +115 -0
- package/project/settings.yaml.template +185 -0
- package/project/specs/SPEC-ANV-72-hud-kanban.md +525 -0
- package/project/templates/api-python/CLAUDE.md +547 -0
- package/project/templates/generic/CLAUDE.md +260 -0
- package/project/templates/saas/CLAUDE.md +478 -0
- package/project/tests/README.md +140 -0
- package/project/tests/__pycache__/test_transcript_parser.cpython-314-pytest-9.0.2.pyc +0 -0
- package/project/tests/fixtures/sample-transcript.jsonl +21 -0
- package/project/tests/test-hooks.sh +259 -0
- package/project/tests/test-lib.sh +248 -0
- package/project/tests/test-statusline.sh +165 -0
- package/project/tests/test_transcript_parser.py +323 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-code-reviewer
|
|
3
|
+
description: Adversarial security review with fresh perspective
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Security Code Reviewer
|
|
7
|
+
|
|
8
|
+
> Adversarial security review with fresh perspective.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Review code changes from a security-focused perspective, independent of the implementation context. Fresh eyes catch vulnerabilities that implementers miss due to familiarity bias.
|
|
15
|
+
|
|
16
|
+
**Why sub-agent (not skill):** Security review benefits from adversarial perspective. The reviewer should NOT have the implementer's mental model — that's the point.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Trigger Conditions
|
|
21
|
+
|
|
22
|
+
Invoke this sub-agent when:
|
|
23
|
+
|
|
24
|
+
- PR is ready for security review
|
|
25
|
+
- Changes touch authentication, authorization, or data handling
|
|
26
|
+
- New API endpoints are introduced
|
|
27
|
+
- User input handling is modified
|
|
28
|
+
- Cryptographic operations are added/changed
|
|
29
|
+
- Third-party integrations are introduced
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Process
|
|
34
|
+
|
|
35
|
+
### Step 1: Gather Context (Without Implementation Bias)
|
|
36
|
+
|
|
37
|
+
Read ONLY:
|
|
38
|
+
- The diff/changed files
|
|
39
|
+
- Existing security patterns in codebase (if any)
|
|
40
|
+
- Project security requirements (if documented)
|
|
41
|
+
|
|
42
|
+
Do NOT read:
|
|
43
|
+
- Implementation notes or reasoning
|
|
44
|
+
- Chat history about why decisions were made
|
|
45
|
+
- Spec documents (you're reviewing what IS, not what was intended)
|
|
46
|
+
|
|
47
|
+
### Step 2: Static Analysis
|
|
48
|
+
|
|
49
|
+
Check for:
|
|
50
|
+
|
|
51
|
+
**Input Validation**
|
|
52
|
+
- [ ] All user inputs validated
|
|
53
|
+
- [ ] Type coercion handled safely
|
|
54
|
+
- [ ] Length limits enforced
|
|
55
|
+
- [ ] Character encoding handled
|
|
56
|
+
|
|
57
|
+
**Authentication**
|
|
58
|
+
- [ ] Auth required where expected
|
|
59
|
+
- [ ] Token validation complete
|
|
60
|
+
- [ ] Session handling secure
|
|
61
|
+
- [ ] No auth bypass possible
|
|
62
|
+
|
|
63
|
+
**Authorization**
|
|
64
|
+
- [ ] Resource ownership verified
|
|
65
|
+
- [ ] Role checks in place
|
|
66
|
+
- [ ] No privilege escalation paths
|
|
67
|
+
- [ ] RLS policies if applicable
|
|
68
|
+
|
|
69
|
+
**Data Handling**
|
|
70
|
+
- [ ] Sensitive data not logged
|
|
71
|
+
- [ ] PII handled appropriately
|
|
72
|
+
- [ ] Encryption where required
|
|
73
|
+
- [ ] No secrets in code
|
|
74
|
+
|
|
75
|
+
**Injection Prevention**
|
|
76
|
+
- [ ] SQL injection prevented (parameterized queries)
|
|
77
|
+
- [ ] XSS prevented (output encoding)
|
|
78
|
+
- [ ] Command injection prevented
|
|
79
|
+
- [ ] Path traversal prevented
|
|
80
|
+
|
|
81
|
+
**Error Handling**
|
|
82
|
+
- [ ] Errors don't leak internals
|
|
83
|
+
- [ ] Stack traces not exposed
|
|
84
|
+
- [ ] Graceful failure modes
|
|
85
|
+
|
|
86
|
+
### Step 3: Threat Modeling
|
|
87
|
+
|
|
88
|
+
For each new endpoint/feature:
|
|
89
|
+
1. Who can access this?
|
|
90
|
+
2. What's the worst they could do?
|
|
91
|
+
3. What data could be exposed?
|
|
92
|
+
4. What actions could be performed?
|
|
93
|
+
|
|
94
|
+
### Step 4: Document Findings
|
|
95
|
+
|
|
96
|
+
Categorize findings:
|
|
97
|
+
|
|
98
|
+
| Severity | Description | Action Required |
|
|
99
|
+
|----------|-------------|-----------------|
|
|
100
|
+
| 🔴 Critical | Exploitable vulnerability | Block merge |
|
|
101
|
+
| 🟠 High | Security gap, likely exploitable | Block merge |
|
|
102
|
+
| 🟡 Medium | Security weakness | Should fix before merge |
|
|
103
|
+
| 🔵 Low | Minor issue or hardening opportunity | Track for later |
|
|
104
|
+
| ℹ️ Info | Observation, not a finding | No action |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Output Format
|
|
109
|
+
|
|
110
|
+
```markdown
|
|
111
|
+
# Security Review: [PR/Change Description]
|
|
112
|
+
|
|
113
|
+
## Summary
|
|
114
|
+
[1-2 sentence overall assessment]
|
|
115
|
+
|
|
116
|
+
## Scope Reviewed
|
|
117
|
+
- Files: [list]
|
|
118
|
+
- Focus areas: [auth/input/data/etc.]
|
|
119
|
+
|
|
120
|
+
## Findings
|
|
121
|
+
|
|
122
|
+
### 🔴 Critical
|
|
123
|
+
[None or list with file:line references]
|
|
124
|
+
|
|
125
|
+
### 🟠 High
|
|
126
|
+
[None or list with file:line references]
|
|
127
|
+
|
|
128
|
+
### 🟡 Medium
|
|
129
|
+
[None or list with file:line references]
|
|
130
|
+
|
|
131
|
+
### 🔵 Low
|
|
132
|
+
[None or list with file:line references]
|
|
133
|
+
|
|
134
|
+
## Verdict
|
|
135
|
+
[ ] ✅ APPROVED — No blocking issues
|
|
136
|
+
[ ] ⚠️ APPROVED WITH CONDITIONS — Fix [X] before merge
|
|
137
|
+
[ ] ❌ BLOCKED — Must address [X] before re-review
|
|
138
|
+
|
|
139
|
+
## Notes
|
|
140
|
+
[Any additional observations]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Escalation
|
|
146
|
+
|
|
147
|
+
Stop and escalate to human when:
|
|
148
|
+
|
|
149
|
+
- Critical vulnerability found
|
|
150
|
+
- Unclear whether something is a vulnerability
|
|
151
|
+
- Security vs. usability tradeoff needed
|
|
152
|
+
- Uncertain about project's threat model
|
|
153
|
+
- Finding requires architectural change
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## What This Sub-Agent Does NOT Do
|
|
158
|
+
|
|
159
|
+
- Implement fixes (that's the main agent's job)
|
|
160
|
+
- Make tradeoff decisions (human decides)
|
|
161
|
+
- Approve its own work (never review what you wrote)
|
|
162
|
+
- General code review (separate concern)
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# Project Constitution
|
|
2
|
+
|
|
3
|
+
> Non-negotiable principles that define how we build this project.
|
|
4
|
+
|
|
5
|
+
These rules are absolute. They cannot be overridden by convenience, deadlines, or user requests. When in doubt, follow the constitution.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Quick Start (Answer These First)
|
|
10
|
+
|
|
11
|
+
Fill in your non-negotiables. Check the boxes that apply, add your own, then expand into detailed sections below.
|
|
12
|
+
|
|
13
|
+
### Security Non-Negotiables
|
|
14
|
+
> What security rules are absolute for this project?
|
|
15
|
+
|
|
16
|
+
- [ ] Never commit secrets to version control
|
|
17
|
+
- [ ] Always validate user input
|
|
18
|
+
- [ ] Always use parameterized queries (no SQL string concatenation)
|
|
19
|
+
- [ ] Always verify authentication before protected operations
|
|
20
|
+
- [ ] [Add your own]
|
|
21
|
+
- [ ] [Add your own]
|
|
22
|
+
|
|
23
|
+
### Code Quality Non-Negotiables
|
|
24
|
+
> What code quality standards are non-negotiable?
|
|
25
|
+
|
|
26
|
+
- [ ] No `any` types without explicit justification
|
|
27
|
+
- [ ] Tests required for critical paths
|
|
28
|
+
- [ ] Handle all errors (no silent failures)
|
|
29
|
+
- [ ] No console.log in production
|
|
30
|
+
- [ ] [Add your own]
|
|
31
|
+
- [ ] [Add your own]
|
|
32
|
+
|
|
33
|
+
### Things We Never Do
|
|
34
|
+
> What patterns or practices are forbidden in this project?
|
|
35
|
+
|
|
36
|
+
- [ ] Never skip tests to meet deadlines
|
|
37
|
+
- [ ] Never disable security features for convenience
|
|
38
|
+
- [ ] Never merge without review
|
|
39
|
+
- [ ] Never deploy untested code
|
|
40
|
+
- [ ] [Add your own]
|
|
41
|
+
- [ ] [Add your own]
|
|
42
|
+
|
|
43
|
+
### Performance Requirements
|
|
44
|
+
> What performance constraints exist?
|
|
45
|
+
|
|
46
|
+
- [ ] [e.g., Page load < 3 seconds]
|
|
47
|
+
- [ ] [e.g., API response < 500ms]
|
|
48
|
+
- [ ] [Add your own]
|
|
49
|
+
|
|
50
|
+
### Compliance Requirements
|
|
51
|
+
> Any regulatory or compliance requirements?
|
|
52
|
+
|
|
53
|
+
- [ ] [e.g., GDPR data handling]
|
|
54
|
+
- [ ] [e.g., SOC2 audit logging]
|
|
55
|
+
- [ ] [Add your own]
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Detailed Principles
|
|
60
|
+
|
|
61
|
+
*Expand into these sections for comprehensive coverage. The defaults below are starting points—customize for your project.*
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Security Principles
|
|
66
|
+
|
|
67
|
+
### S1: Authentication is Sacred
|
|
68
|
+
- **Never** bypass authentication checks
|
|
69
|
+
- **Never** hardcode credentials or tokens
|
|
70
|
+
- **Never** log sensitive data (passwords, tokens, PII)
|
|
71
|
+
- **Always** validate session before protected operations
|
|
72
|
+
|
|
73
|
+
### S2: Input is Hostile
|
|
74
|
+
- **Never** trust user input
|
|
75
|
+
- **Always** validate and sanitize inputs
|
|
76
|
+
- **Always** use parameterized queries
|
|
77
|
+
- **Never** construct SQL/queries from string concatenation
|
|
78
|
+
|
|
79
|
+
### S3: Secrets Stay Secret
|
|
80
|
+
- **Never** commit secrets to version control
|
|
81
|
+
- **Always** use environment variables for credentials
|
|
82
|
+
- **Never** expose API keys in client-side code
|
|
83
|
+
- **Always** use `.env.local` for local secrets
|
|
84
|
+
|
|
85
|
+
### S4: Least Privilege
|
|
86
|
+
- **Always** request minimum necessary permissions
|
|
87
|
+
- **Never** use service role keys where anon keys suffice
|
|
88
|
+
- **Always** implement RLS policies for database access
|
|
89
|
+
- **Never** disable security features for convenience
|
|
90
|
+
|
|
91
|
+
### S5: Defense in Depth
|
|
92
|
+
- **Always** validate on both client and server
|
|
93
|
+
- **Never** rely solely on client-side validation
|
|
94
|
+
- **Always** use HTTPS in production
|
|
95
|
+
- **Always** sanitize data before display (XSS prevention)
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Code Quality Principles
|
|
100
|
+
|
|
101
|
+
### Q1: Tests Are Required
|
|
102
|
+
- **Never** ship without tests for critical paths
|
|
103
|
+
- **Always** test edge cases, not just happy paths
|
|
104
|
+
- **Never** skip tests to meet deadlines
|
|
105
|
+
- **Always** fix broken tests before adding features
|
|
106
|
+
|
|
107
|
+
### Q2: Types Are Truth
|
|
108
|
+
- **Never** use `any` type without explicit justification
|
|
109
|
+
- **Always** define interfaces for data structures
|
|
110
|
+
- **Never** ignore TypeScript errors
|
|
111
|
+
- **Always** run typecheck before PR
|
|
112
|
+
|
|
113
|
+
### Q3: Code is Communication
|
|
114
|
+
- **Always** use meaningful names
|
|
115
|
+
- **Never** abbreviate unless universally understood
|
|
116
|
+
- **Always** comment non-obvious logic
|
|
117
|
+
- **Never** leave commented-out code in PRs
|
|
118
|
+
|
|
119
|
+
### Q4: Errors Are Handled
|
|
120
|
+
- **Never** swallow errors silently
|
|
121
|
+
- **Always** provide meaningful error messages
|
|
122
|
+
- **Always** log errors for debugging
|
|
123
|
+
- **Never** expose internal errors to users
|
|
124
|
+
|
|
125
|
+
### Q5: Dependencies Are Liabilities
|
|
126
|
+
- **Never** add dependencies without justification
|
|
127
|
+
- **Always** prefer standard library solutions
|
|
128
|
+
- **Always** review dependency security
|
|
129
|
+
- **Never** update major versions without testing
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Architecture Principles
|
|
134
|
+
|
|
135
|
+
### A1: Separation of Concerns
|
|
136
|
+
- **Never** mix business logic with UI components
|
|
137
|
+
- **Always** use services for data operations
|
|
138
|
+
- **Always** keep components focused and small
|
|
139
|
+
- **Never** put API logic in components
|
|
140
|
+
|
|
141
|
+
### A2: Single Source of Truth
|
|
142
|
+
- **Never** duplicate state
|
|
143
|
+
- **Always** derive computed values
|
|
144
|
+
- **Never** store what you can calculate
|
|
145
|
+
- **Always** use the database as truth for persistence
|
|
146
|
+
|
|
147
|
+
### A3: Fail Fast
|
|
148
|
+
- **Always** validate early
|
|
149
|
+
- **Never** continue with invalid state
|
|
150
|
+
- **Always** throw on unexpected conditions
|
|
151
|
+
- **Never** silently default on errors
|
|
152
|
+
|
|
153
|
+
### A4: Backward Compatibility
|
|
154
|
+
- **Never** break existing API contracts without migration
|
|
155
|
+
- **Always** version breaking changes
|
|
156
|
+
- **Always** provide migration path for data changes
|
|
157
|
+
- **Never** remove functionality without deprecation
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Process Principles
|
|
162
|
+
|
|
163
|
+
### P1: Validation Before Action
|
|
164
|
+
- **Always** run `/validate` before changes
|
|
165
|
+
- **Never** commit with failing tests
|
|
166
|
+
- **Never** push with lint errors
|
|
167
|
+
- **Always** verify clean git state
|
|
168
|
+
|
|
169
|
+
### P2: Evidence Over Claims
|
|
170
|
+
- **Always** capture quality gate output
|
|
171
|
+
- **Never** claim "it works" without proof
|
|
172
|
+
- **Always** include evidence in PRs
|
|
173
|
+
- **Never** merge without review
|
|
174
|
+
|
|
175
|
+
### P3: Context is King
|
|
176
|
+
- **Always** read before write
|
|
177
|
+
- **Never** speculate about code you haven't opened
|
|
178
|
+
- **Always** cite file paths and line numbers
|
|
179
|
+
- **Never** assume—verify
|
|
180
|
+
|
|
181
|
+
### P4: Explicit Over Implicit
|
|
182
|
+
- **Always** document decisions
|
|
183
|
+
- **Never** rely on tribal knowledge
|
|
184
|
+
- **Always** make dependencies visible
|
|
185
|
+
- **Never** hide complexity
|
|
186
|
+
|
|
187
|
+
### P5: Small Steps
|
|
188
|
+
- **Always** prefer small, focused PRs
|
|
189
|
+
- **Never** combine unrelated changes
|
|
190
|
+
- **Always** deploy incrementally
|
|
191
|
+
- **Never** refactor and add features simultaneously
|
|
192
|
+
|
|
193
|
+
### P6: Interactive Over Passive
|
|
194
|
+
- **Always** use AskUserQuestion for multiple-choice decisions
|
|
195
|
+
- **Never** present options as plain text (A/B/C) when interactive menus are available
|
|
196
|
+
- **Always** let users select rather than type their choice
|
|
197
|
+
- **Never** assume the user's preference—ask with a menu
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## What We Will NOT Do
|
|
202
|
+
|
|
203
|
+
No matter the circumstances, we will not:
|
|
204
|
+
|
|
205
|
+
1. **Disable security features** to make development easier
|
|
206
|
+
2. **Skip tests** to meet deadlines
|
|
207
|
+
3. **Ignore TypeScript errors** with `@ts-ignore`
|
|
208
|
+
4. **Commit secrets** even temporarily
|
|
209
|
+
5. **Deploy untested code** to production
|
|
210
|
+
6. **Merge to main** without review
|
|
211
|
+
7. **Delete data** without backup
|
|
212
|
+
8. **Bypass authentication** for testing
|
|
213
|
+
9. **Use production data** in development
|
|
214
|
+
10. **Ship known bugs** as features
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Enforcement
|
|
219
|
+
|
|
220
|
+
These principles are enforced through:
|
|
221
|
+
|
|
222
|
+
1. **Pre-commit hooks** — Lint, type check, test
|
|
223
|
+
2. **CI pipeline** — All checks must pass
|
|
224
|
+
3. **Code review** — Human verification
|
|
225
|
+
4. **Quality gates** — `/validate` and `/evidence`
|
|
226
|
+
|
|
227
|
+
Violations of this constitution should be:
|
|
228
|
+
1. Flagged immediately
|
|
229
|
+
2. Fixed before proceeding
|
|
230
|
+
3. Documented as learnings
|
|
231
|
+
4. Never normalized
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
*This constitution is the project's law. Update it rarely and with full consensus.*
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Session Coordination
|
|
2
|
+
|
|
3
|
+
> Lightweight coordination for parallel Claude Code instances. NOT about agent roles — about preventing conflicts when multiple terminals run simultaneously.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Active Sessions
|
|
8
|
+
|
|
9
|
+
| Session ID | Started | Working On | Status |
|
|
10
|
+
|------------|---------|------------|--------|
|
|
11
|
+
|
|
12
|
+
<!--
|
|
13
|
+
Add your session when starting work:
|
|
14
|
+
| session-001 | 14:30 | ENG-123: Button component | active |
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Current Work
|
|
20
|
+
|
|
21
|
+
Track files each session is actively modifying to prevent conflicts.
|
|
22
|
+
|
|
23
|
+
| Session ID | Files/Areas | Issue |
|
|
24
|
+
|------------|-------------|-------|
|
|
25
|
+
|
|
26
|
+
<!--
|
|
27
|
+
Add files you'll touch:
|
|
28
|
+
| session-001 | src/components/Button.tsx, src/styles/button.css | ENG-123 |
|
|
29
|
+
-->
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Interface Contracts
|
|
34
|
+
|
|
35
|
+
When creating new APIs or shared interfaces, document here so parallel sessions know.
|
|
36
|
+
|
|
37
|
+
<!--
|
|
38
|
+
Example:
|
|
39
|
+
```typescript
|
|
40
|
+
// session-001 creating (2024-01-15 14:30)
|
|
41
|
+
// POST /api/reservations
|
|
42
|
+
// Request: { itemId: string, guestEmail: string }
|
|
43
|
+
// Response: { reservationId: string, status: string }
|
|
44
|
+
```
|
|
45
|
+
-->
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Session Log
|
|
50
|
+
|
|
51
|
+
Append-only log of significant events. New entries at top.
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
[YYYY-MM-DD HH:MM] [session-id]: action - brief description
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Today
|
|
58
|
+
|
|
59
|
+
<!--
|
|
60
|
+
[2024-01-15 14:30] [session-001]: started - working on ENG-123 button component
|
|
61
|
+
[2024-01-15 15:45] [session-001]: completed - PR #42 ready for review
|
|
62
|
+
-->
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## How to Use
|
|
67
|
+
|
|
68
|
+
### Starting a Session
|
|
69
|
+
1. Generate session ID: `session-{timestamp}` or `session-{initials}-{n}`
|
|
70
|
+
2. Add row to Active Sessions table
|
|
71
|
+
3. Add your working files to Current Work table
|
|
72
|
+
|
|
73
|
+
### Claiming Work
|
|
74
|
+
1. Check Current Work table — is anyone touching these files?
|
|
75
|
+
2. If conflict: coordinate with other session or pick different work
|
|
76
|
+
3. Add your files to Current Work table
|
|
77
|
+
|
|
78
|
+
### Creating New APIs
|
|
79
|
+
1. Post contract in Interface Contracts section BEFORE implementing
|
|
80
|
+
2. Other sessions check here before creating new endpoints/interfaces
|
|
81
|
+
3. Prevents duplicate or conflicting API designs
|
|
82
|
+
|
|
83
|
+
### Completing Work
|
|
84
|
+
1. Update Active Sessions status to "done" or remove row
|
|
85
|
+
2. Remove your row from Current Work table
|
|
86
|
+
3. Add completion entry to Session Log
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Why This File Exists
|
|
91
|
+
|
|
92
|
+
This file solves **parallel instance coordination**, not agent roles.
|
|
93
|
+
|
|
94
|
+
**Problem it solves:**
|
|
95
|
+
- Terminal A modifies `auth.ts`
|
|
96
|
+
- Terminal B doesn't know, also modifies `auth.ts`
|
|
97
|
+
- Result: merge conflict, wasted work
|
|
98
|
+
|
|
99
|
+
**Problem it does NOT solve:**
|
|
100
|
+
- "Should this be a backend or frontend task?" → Use skills instead
|
|
101
|
+
- "Which agent role should handle this?" → There's only one generalist
|
|
102
|
+
|
|
103
|
+
**If you only ever run one Claude Code terminal at a time, you can ignore this file.**
|