Repository Context Checker
Purpose
Prevent developers from starting planning work in code repositories by detecting context mismatches and providing guidance on where work should happen.
Repository Type Detection
Brain Repository Indicators
A repository is a brain repo if it exhibits these characteristics:
Directory Structure:
- Has
specs/ or specs-in-progress/ directory
- Has
roadmap/ or product-roadmap/ directory
- Has
patterns/ or architecture/ directory
- Has
docs/ with coordination or strategy documents
- Filename patterns:
*.adr.md, *.spec.md, decision-*.md
Plugin Configuration (from .claude/settings.json):
- 20+ plugins enabled
- Contains planning agents:
v-architect, v-tech-lead, v-commerce-pm, v-platform-pm
- Contains
v-9d or v-discovery workflows
- Contains multiple domain plugins (3+)
- Repository name contains:
-brain suffix (e.g., prism-brain, beam-brain)
README/CLAUDE.md Indicators:
- Describes coordination, planning, or cross-functional work
- Mentions "spec", "architecture", "strategy", "roadmap"
- Links to other repositories
Code Repository Indicators
A repository is a code repo if it exhibits these characteristics:
Directory Structure:
- Has
src/, lib/, main/, components/, app/ directory
- Has production code:
.ts, .tsx, .java, .py, .go files
- Has deployment configs:
Dockerfile, k8s/, .github/workflows/
- Has
tsconfig.json, package.json, pom.xml, setup.py
- Filename patterns: service name (e.g.,
BeamService, VioletDashboard)
Plugin Configuration (from .claude/settings.json):
- 8-15 plugins enabled
- NO planning agents:
v-architect, v-tech-lead, v-*-pm should not be present
- NO product workflows:
v-9d, v-discovery, v-gates
- ONE stack plugin:
v-java-spring, v-typescript-react, etc.
- ONE domain plugin: The service implements
- Repository name pattern:
{Name}Service or {Name}Dashboard
README/CLAUDE.md Indicators:
- Describes implementation, testing, deployment
- Links to brain repo or product spec repo
- Has sections like "Setup", "Development", "Testing", "Deployment"
Task Type Detection
Planning Task Keywords
The following words and phrases indicate planning work (belongs in brain repo):
Decision-making indicators:
- "should we", "do we want", "trade-off", "pros and cons"
- "architecture", "design", "redesign"
- "strategic", "vision", "roadmap"
- "why are we", "why did we", "rationale for"
Specification indicators:
- "spec", "specification", "requirement"
- "ADR", "architecture decision record"
- "user story", "acceptance criteria"
- "what should", "what will"
Product management indicators:
- "feature request", "feature proposal"
- "customer request", "user feedback"
- "product manager input", "PM approval"
- "cross-product", "impact analysis"
Approval/Review indicators:
- "architect approval", "tech lead review"
- "design review", "architecture review"
- "should be approved by"
Implementation Task Keywords
The following words and phrases indicate implementation work (can be in code repo):
Code change indicators:
- "implement", "add", "remove", "modify", "change"
- "bug fix", "fix the bug", "fix issue #"
- "refactor", "optimize", "clean up"
- "test", "add test", "test coverage"
Reference indicators:
- "from spec", "per ADR", "from requirements"
- "known root cause", "root cause: "
- "existing code", "existing function"
Scope indicators:
- "this function", "this service", "this component"
- "limited scope", "scoped change"
- "no architectural impact"
Mixed Task Indicators
Some tasks require both brain and code repos:
Investigation → Implementation pattern:
- "why is X slow?" (brain: analysis) → "implement the optimization" (code: impl)
- "why is the API failing?" (brain: root cause) → "fix the bug" (code: impl)
- "can we do X?" (brain: feasibility) → "implement it" (code: impl)
Decision → Implementation pattern:
- "should we refactor Y?" (brain: decision) → "here's the refactored code" (code: impl)
- "architecture for X?" (brain: design) → "implement following the design" (code: impl)
Warning Triggers
Severity: HIGH (Strong Warning)
Warn when:
- In code repo + multiple planning keywords + no spec reference
- In code repo + asking "should we" or "why should we"
- In code repo + "redesign", "rewrite", "new feature" without existing spec
- In code repo + asking for architect or PM input
- Planning agents (v-architect, v-tech-lead) activated in code repo
Severity: MEDIUM (Informational)
Inform when:
- In code repo + asking design questions with some spec reference
- In code repo + refactoring with architectural impact
- In brain repo + implementation-focused questions (can proceed but FYI)
Severity: LOW (Suggestion)
Suggest when:
- Task could benefit from other repo context
- Related specs or decisions exist in brain repo
Decision Logic
IF in_code_repo:
IF task_type = "planning":
IF has_spec_reference:
severity = MEDIUM
ELSE:
severity = HIGH
ELSE IF task_type = "implementation":
severity = NONE
ELSE IF task_type = "mixed":
severity = MEDIUM (planning phase)
ELSE IF in_brain_repo:
IF task_type = "implementation":
severity = LOW (suggestion to move to code repo)
ELSE:
severity = NONE
ELSE:
severity = UNKNOWN (ambiguous repo type)
Action Recommendations
Brain Repo → Code Repo Flow
When planning is complete, recommend:
- Create specs in brain repo
- Get architect/tech-lead approval in brain repo
- Switch to code repo with approved spec
- Reference spec or ADR in code repo work
Code Repo → Brain Repo Flow
When planning is needed, recommend:
- Switch to brain repo
- Create specs/ADRs there
- Get approvals there
- Return to code repo when ready to implement
Related Documentation
/v-plugins-context command: Runs this detection and provides guidance
violet-ai-plugins/CLAUDE.md: "Brain Repos vs Code Repos" section
examples/README.md: Decision tree for choosing repository type
v-plugins/knowledge/plugin-management.md: Plugin selection rules
1---2name: repository-context-checker3description: Verify developers are working in the right repository type (brain vs code)4---5
6# Repository Context Checker
7
8## Purpose
9
10Prevent developers from starting planning work in code repositories by detecting context mismatches and providing guidance on where work should happen.
11
12## Repository Type Detection
13
14### Brain Repository Indicators
15
16A repository is a **brain repo** if it exhibits these characteristics:
17
18**Directory Structure**:
19- Has `specs/` or `specs-in-progress/` directory
20- Has `roadmap/` or `product-roadmap/` directory
21- Has `patterns/` or `architecture/` directory
22- Has `docs/` with coordination or strategy documents
23- Filename patterns: `*.adr.md`, `*.spec.md`, `decision-*.md`
24
25**Plugin Configuration** (from `.claude/settings.json`):
26- 20+ plugins enabled
27- Contains planning agents: `v-architect`, `v-tech-lead`, `v-commerce-pm`, `v-platform-pm`
28- Contains `v-9d` or `v-discovery` workflows
29- Contains multiple domain plugins (3+)
30- Repository name contains: `-brain` suffix (e.g., `prism-brain`, `beam-brain`)
31
32**README/CLAUDE.md Indicators**:
33- Describes coordination, planning, or cross-functional work
34- Mentions "spec", "architecture", "strategy", "roadmap"
35- Links to other repositories
36
37### Code Repository Indicators
38
39A repository is a **code repo** if it exhibits these characteristics:
40
41**Directory Structure**:
42- Has `src/`, `lib/`, `main/`, `components/`, `app/` directory
43- Has production code: `.ts`, `.tsx`, `.java`, `.py`, `.go` files
44- Has deployment configs: `Dockerfile`, `k8s/`, `.github/workflows/`
45- Has `tsconfig.json`, `package.json`, `pom.xml`, `setup.py`
46- Filename patterns: service name (e.g., `BeamService`, `VioletDashboard`)
47
48**Plugin Configuration** (from `.claude/settings.json`):
49- 8-15 plugins enabled
50- NO planning agents: `v-architect`, `v-tech-lead`, `v-*-pm` should not be present
51- NO product workflows: `v-9d`, `v-discovery`, `v-gates`
52- ONE stack plugin: `v-java-spring`, `v-typescript-react`, etc.
53- ONE domain plugin: The service implements
54- Repository name pattern: `{Name}Service` or `{Name}Dashboard`
55
56**README/CLAUDE.md Indicators**:
57- Describes implementation, testing, deployment
58- Links to brain repo or product spec repo
59- Has sections like "Setup", "Development", "Testing", "Deployment"
60
61## Task Type Detection
62
63### Planning Task Keywords
64
65The following words and phrases indicate **planning work** (belongs in brain repo):
66
67**Decision-making indicators**:
68- "should we", "do we want", "trade-off", "pros and cons"
69- "architecture", "design", "redesign"
70- "strategic", "vision", "roadmap"
71- "why are we", "why did we", "rationale for"
72
73**Specification indicators**:
74- "spec", "specification", "requirement"
75- "ADR", "architecture decision record"
76- "user story", "acceptance criteria"
77- "what should", "what will"
78
79**Product management indicators**:
80- "feature request", "feature proposal"
81- "customer request", "user feedback"
82- "product manager input", "PM approval"
83- "cross-product", "impact analysis"
84
85**Approval/Review indicators**:
86- "architect approval", "tech lead review"
87- "design review", "architecture review"
88- "should be approved by"
89
90### Implementation Task Keywords
91
92The following words and phrases indicate **implementation work** (can be in code repo):
93
94**Code change indicators**:
95- "implement", "add", "remove", "modify", "change"
96- "bug fix", "fix the bug", "fix issue #"
97- "refactor", "optimize", "clean up"
98- "test", "add test", "test coverage"
99
100**Reference indicators**:
101- "from spec", "per ADR", "from requirements"
102- "known root cause", "root cause: "
103- "existing code", "existing function"
104
105**Scope indicators**:
106- "this function", "this service", "this component"
107- "limited scope", "scoped change"
108- "no architectural impact"
109
110### Mixed Task Indicators
111
112Some tasks require **both brain and code repos**:
113
114**Investigation → Implementation pattern**:
115- "why is X slow?" (brain: analysis) → "implement the optimization" (code: impl)
116- "why is the API failing?" (brain: root cause) → "fix the bug" (code: impl)
117- "can we do X?" (brain: feasibility) → "implement it" (code: impl)
118
119**Decision → Implementation pattern**:
120- "should we refactor Y?" (brain: decision) → "here's the refactored code" (code: impl)
121- "architecture for X?" (brain: design) → "implement following the design" (code: impl)
122
123## Warning Triggers
124
125### Severity: HIGH (Strong Warning)
126
127Warn when:
128- In code repo + multiple planning keywords + no spec reference
129- In code repo + asking "should we" or "why should we"
130- In code repo + "redesign", "rewrite", "new feature" without existing spec
131- In code repo + asking for architect or PM input
132- Planning agents (v-architect, v-tech-lead) activated in code repo
133
134### Severity: MEDIUM (Informational)
135
136Inform when:
137- In code repo + asking design questions with some spec reference
138- In code repo + refactoring with architectural impact
139- In brain repo + implementation-focused questions (can proceed but FYI)
140
141### Severity: LOW (Suggestion)
142
143Suggest when:
144- Task could benefit from other repo context
145- Related specs or decisions exist in brain repo
146
147## Decision Logic
148
149```
150IF in_code_repo:
151 IF task_type = "planning":
152 IF has_spec_reference:
153 severity = MEDIUM
154 ELSE:
155 severity = HIGH
156 ELSE IF task_type = "implementation":
157 severity = NONE
158 ELSE IF task_type = "mixed":
159 severity = MEDIUM (planning phase)
160ELSE IF in_brain_repo:
161 IF task_type = "implementation":
162 severity = LOW (suggestion to move to code repo)
163 ELSE:
164 severity = NONE
165ELSE:
166 severity = UNKNOWN (ambiguous repo type)
167```
168
169## Action Recommendations
170
171### Brain Repo → Code Repo Flow
172
173When planning is complete, recommend:
1741. Create specs in brain repo
1752. Get architect/tech-lead approval in brain repo
1763. Switch to code repo with approved spec
1774. Reference spec or ADR in code repo work
178
179### Code Repo → Brain Repo Flow
180
181When planning is needed, recommend:
1821. Switch to brain repo
1832. Create specs/ADRs there
1843. Get approvals there
1854. Return to code repo when ready to implement
186
187## Related Documentation
188
189- `/v-plugins-context` command: Runs this detection and provides guidance
190- `violet-ai-plugins/CLAUDE.md`: "Brain Repos vs Code Repos" section
191- `examples/README.md`: Decision tree for choosing repository type
192- `v-plugins/knowledge/plugin-management.md`: Plugin selection rules