class-ai-agent 1.4.0 → 1.5.0

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.
Files changed (157) hide show
  1. package/.agent/README.md +10 -5
  2. package/.agent/SESSION.md +18 -13
  3. package/.agent/rules/agent-continuity.md +44 -0
  4. package/.agent/rules/antigravity-overview.md +38 -0
  5. package/.agent/rules/api-conventions.md +85 -0
  6. package/.agent/rules/clean-code.md +211 -0
  7. package/.agent/rules/code-style.md +92 -0
  8. package/.agent/rules/codegraph.md +47 -0
  9. package/.agent/rules/database.md +66 -0
  10. package/.agent/rules/error-handling.md +98 -0
  11. package/.agent/rules/git-workflow.md +83 -0
  12. package/.agent/rules/monitoring.md +317 -0
  13. package/.agent/rules/naming-conventions.md +266 -0
  14. package/.agent/rules/project-structure.md +71 -0
  15. package/.agent/rules/security.md +95 -0
  16. package/.agent/rules/system-design.md +168 -0
  17. package/.agent/rules/tech-stack.md +463 -0
  18. package/.agent/rules/testing.md +110 -0
  19. package/.agents/agents/backend.md +395 -0
  20. package/.agents/agents/business-analyst.md +380 -0
  21. package/.agents/agents/code-reviewer.md +110 -0
  22. package/.agents/agents/copywriter-seo.md +236 -0
  23. package/.agents/agents/frontend.md +384 -0
  24. package/.agents/agents/project-manager.md +201 -0
  25. package/.agents/agents/qa.md +221 -0
  26. package/.agents/agents/security-auditor.md +143 -0
  27. package/.agents/agents/systems-architect.md +211 -0
  28. package/.agents/agents/test-engineer.md +123 -0
  29. package/.agents/agents/ui-ux-designer.md +210 -0
  30. package/.agents/references/accessibility-checklist.md +174 -0
  31. package/.agents/references/agent-continuity.md +42 -0
  32. package/.agents/references/codegraph.md +90 -0
  33. package/.agents/references/mcp-antigravity.md +71 -0
  34. package/.agents/references/performance-checklist.md +150 -0
  35. package/.agents/references/security-checklist.md +94 -0
  36. package/.agents/references/supabase.md +55 -0
  37. package/.agents/references/testing-patterns.md +183 -0
  38. package/.agents/skills/agent-continuity/SKILL.md +70 -0
  39. package/.agents/skills/code-review/SKILL.md +208 -0
  40. package/.agents/skills/deploy/SKILL.md +68 -0
  41. package/.agents/skills/deploy/deploy.md +735 -0
  42. package/.agents/skills/incremental-implementation/SKILL.md +210 -0
  43. package/.agents/skills/security-review/SKILL.md +71 -0
  44. package/.agents/skills/supabase/SKILL.md +135 -0
  45. package/.agents/skills/supabase/UPSTREAM.md +16 -0
  46. package/.agents/skills/supabase/assets/feedback-issue-template.md +17 -0
  47. package/.agents/skills/supabase/references/skill-feedback.md +17 -0
  48. package/.agents/skills/supabase-postgres-best-practices/SKILL.md +64 -0
  49. package/.agents/skills/supabase-postgres-best-practices/UPSTREAM.md +16 -0
  50. package/.agents/skills/supabase-postgres-best-practices/references/_contributing.md +170 -0
  51. package/.agents/skills/supabase-postgres-best-practices/references/_sections.md +39 -0
  52. package/.agents/skills/supabase-postgres-best-practices/references/_template.md +34 -0
  53. package/.agents/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
  54. package/.agents/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
  55. package/.agents/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
  56. package/.agents/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
  57. package/.agents/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
  58. package/.agents/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
  59. package/.agents/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
  60. package/.agents/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
  61. package/.agents/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
  62. package/.agents/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
  63. package/.agents/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
  64. package/.agents/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
  65. package/.agents/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
  66. package/.agents/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
  67. package/.agents/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
  68. package/.agents/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
  69. package/.agents/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
  70. package/.agents/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
  71. package/.agents/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
  72. package/.agents/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -0
  73. package/.agents/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
  74. package/.agents/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
  75. package/.agents/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
  76. package/.agents/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
  77. package/.agents/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
  78. package/.agents/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
  79. package/.agents/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
  80. package/.agents/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
  81. package/.agents/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
  82. package/.agents/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
  83. package/.agents/skills/supabase-postgres-best-practices/references/security-rls-performance.md +63 -0
  84. package/.agents/skills/tdd/SKILL.md +217 -0
  85. package/.agents/skills/ui-ux-pro-max/SKILL.md +288 -0
  86. package/.agents/skills/ui-ux-pro-max/data/charts.csv +26 -0
  87. package/.agents/skills/ui-ux-pro-max/data/colors.csv +97 -0
  88. package/.agents/skills/ui-ux-pro-max/data/icons.csv +101 -0
  89. package/.agents/skills/ui-ux-pro-max/data/landing.csv +31 -0
  90. package/.agents/skills/ui-ux-pro-max/data/products.csv +97 -0
  91. package/.agents/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  92. package/.agents/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  93. package/.agents/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  94. package/.agents/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  95. package/.agents/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  96. package/.agents/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  97. package/.agents/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  98. package/.agents/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  99. package/.agents/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  100. package/.agents/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  101. package/.agents/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  102. package/.agents/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  103. package/.agents/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  104. package/.agents/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  105. package/.agents/skills/ui-ux-pro-max/data/styles.csv +68 -0
  106. package/.agents/skills/ui-ux-pro-max/data/typography.csv +58 -0
  107. package/.agents/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  108. package/.agents/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  109. package/.agents/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  110. package/.agents/skills/ui-ux-pro-max/scripts/core.py +253 -0
  111. package/.agents/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  112. package/.agents/skills/ui-ux-pro-max/scripts/search.py +114 -0
  113. package/.agents/workflows/build.md +132 -0
  114. package/.agents/workflows/debug.md +242 -0
  115. package/.agents/workflows/deploy.md +43 -0
  116. package/.agents/workflows/fix-issue.md +45 -0
  117. package/.agents/workflows/handoff.md +93 -0
  118. package/.agents/workflows/plan.md +125 -0
  119. package/.agents/workflows/publish-npm.md +122 -0
  120. package/.agents/workflows/resume.md +106 -0
  121. package/.agents/workflows/review.md +53 -0
  122. package/.agents/workflows/simplify.md +221 -0
  123. package/.agents/workflows/spec.md +95 -0
  124. package/.agents/workflows/test.md +213 -0
  125. package/.claude/CLAUDE.md +23 -0
  126. package/.claude/agents/business-analyst.md +380 -0
  127. package/.claude/references/codegraph.md +26 -14
  128. package/.claude/rules/agent-continuity.md +3 -2
  129. package/.claude/rules/api-conventions.md +1 -0
  130. package/.claude/rules/clean-code.md +1 -0
  131. package/.claude/rules/code-style.md +1 -0
  132. package/.claude/rules/codegraph.md +43 -0
  133. package/.claude/rules/database.md +2 -1
  134. package/.claude/rules/error-handling.md +1 -0
  135. package/.claude/rules/git-workflow.md +1 -0
  136. package/.claude/rules/monitoring.md +1 -0
  137. package/.claude/rules/naming-conventions.md +1 -0
  138. package/.claude/rules/project-structure.md +1 -0
  139. package/.claude/rules/security.md +1 -0
  140. package/.claude/rules/system-design.md +1 -0
  141. package/.claude/rules/tech-stack.md +1 -0
  142. package/.claude/rules/testing.md +1 -0
  143. package/.claude/settings.json +3 -1
  144. package/.claude/skills/ui-ux-pro-max/SKILL.md +1 -90
  145. package/.cursor/CURSOR.md +1 -1
  146. package/.cursor/agents/business-analyst.md +380 -0
  147. package/.cursor/rules/cursor-overview.mdc +4 -3
  148. package/.cursor/rules/database.mdc +2 -2
  149. package/.kiro/KIRO.md +3 -3
  150. package/.kiro/agents/business-analyst.md +380 -0
  151. package/.kiro/steering/database.md +2 -2
  152. package/.kiro/steering/kiro-overview.md +2 -2
  153. package/AGENTS.md +23 -1
  154. package/GEMINI.md +152 -0
  155. package/README.md +65 -19
  156. package/bin/class-ai-agent.cjs +85 -9
  157. package/package.json +11 -4
@@ -0,0 +1,213 @@
1
+ ---
2
+ description: "Write tests using TDD patterns — tests are proof of correctness"
3
+ ---
4
+
5
+ # /test — Test-Driven Development
6
+
7
+ > "Tests are proof, not afterthought."
8
+
9
+ ## Purpose
10
+
11
+ Write tests that prove code works correctly. Use the RED-GREEN-REFACTOR cycle for new features and the Prove-It pattern for bug fixes.
12
+
13
+ ## For New Features: RED-GREEN-REFACTOR
14
+
15
+ ### RED: Write Failing Test First
16
+
17
+ ```javascript
18
+ describe('UserService.findById', () => {
19
+ it('should return user when found', async () => {
20
+ // Arrange
21
+ const userId = 'user-123';
22
+
23
+ // Act
24
+ const user = await userService.findById(userId);
25
+
26
+ // Assert
27
+ expect(user).toBeDefined();
28
+ expect(user.id).toBe(userId);
29
+ });
30
+
31
+ it('should throw NotFoundError when user does not exist', async () => {
32
+ await expect(userService.findById('non-existent'))
33
+ .rejects.toThrow(NotFoundError);
34
+ });
35
+ });
36
+ ```
37
+
38
+ Run tests — **they should fail** (proves nothing is implemented yet).
39
+
40
+ ### GREEN: Write Minimal Code to Pass
41
+
42
+ ```javascript
43
+ async findById(id: string): Promise<User> {
44
+ const user = await this.db.user.findUnique({ where: { id } });
45
+ if (!user) throw new NotFoundError('User not found');
46
+ return user;
47
+ }
48
+ ```
49
+
50
+ Run tests — **they should pass**.
51
+
52
+ ### REFACTOR: Improve While Green
53
+
54
+ Clean up code while keeping tests passing:
55
+ - Better naming
56
+ - Extract helpers
57
+ - Remove duplication
58
+
59
+ ---
60
+
61
+ ## For Bug Fixes: Prove-It Pattern
62
+
63
+ ### Step 1: Write Test That Reproduces the Bug
64
+
65
+ ```javascript
66
+ it('should not duplicate items when adding to cart twice', async () => {
67
+ // This test should FAIL with the current buggy code
68
+ await cart.addItem('product-1', 1);
69
+ await cart.addItem('product-1', 1);
70
+
71
+ expect(cart.items).toHaveLength(1);
72
+ expect(cart.items[0].quantity).toBe(2);
73
+ });
74
+ ```
75
+
76
+ ### Step 2: Verify Test Fails
77
+
78
+ Run the test — confirm it **fails** (proving the bug exists).
79
+
80
+ ### Step 3: Fix the Bug
81
+
82
+ ```javascript
83
+ async addItem(productId: string, quantity: number) {
84
+ const existing = this.items.find(i => i.productId === productId);
85
+ if (existing) {
86
+ existing.quantity += quantity; // Fix: increment instead of duplicate
87
+ } else {
88
+ this.items.push({ productId, quantity });
89
+ }
90
+ }
91
+ ```
92
+
93
+ ### Step 4: Verify Test Passes
94
+
95
+ Run the test — confirm it **passes** (proving the fix works).
96
+
97
+ ### Step 5: Run Full Suite
98
+
99
+ ```bash
100
+ npm test # Ensure no regressions
101
+ ```
102
+
103
+ ---
104
+
105
+ ## Test Pyramid
106
+
107
+ | Level | Percentage | Speed | Scope |
108
+ |-------|------------|-------|-------|
109
+ | **Unit** | 80% | ms | Single function, no I/O |
110
+ | **Integration** | 15% | seconds | API + DB, component interactions |
111
+ | **E2E** | 5% | minutes | Full user flows |
112
+
113
+ ---
114
+
115
+ ## Writing Good Tests
116
+
117
+ ### Arrange-Act-Assert Pattern
118
+
119
+ ```javascript
120
+ it('should calculate total with discount', () => {
121
+ // Arrange — setup
122
+ const cart = new Cart();
123
+ cart.addItem({ price: 100 });
124
+ cart.applyDiscount(10);
125
+
126
+ // Act — execute
127
+ const total = cart.calculateTotal();
128
+
129
+ // Assert — verify
130
+ expect(total).toBe(90);
131
+ });
132
+ ```
133
+
134
+ ### DAMP Over DRY
135
+
136
+ Tests should be **Descriptive And Meaningful Phrases**. Each test reads independently:
137
+
138
+ ```javascript
139
+ // ✅ DAMP — clear and independent
140
+ it('should reject password shorter than 8 characters', () => {
141
+ const result = validatePassword('short');
142
+ expect(result.valid).toBe(false);
143
+ expect(result.error).toBe('Password must be at least 8 characters');
144
+ });
145
+
146
+ // ❌ Too DRY — requires reading shared setup
147
+ it('should reject short password', () => {
148
+ expect(validate(shortPassword)).toBe(false);
149
+ });
150
+ ```
151
+
152
+ ### Descriptive Test Names
153
+
154
+ ```javascript
155
+ // ✅ Good — describes behavior
156
+ 'should return 404 when user is not found'
157
+ 'should increment quantity when adding existing product'
158
+ 'should send welcome email after registration'
159
+
160
+ // ❌ Bad — vague
161
+ 'works correctly'
162
+ 'handles error'
163
+ 'test user'
164
+ ```
165
+
166
+ ### One Behavior Per Test
167
+
168
+ ```javascript
169
+ // ✅ Good — focused
170
+ it('should validate email format', () => { ... });
171
+ it('should require email field', () => { ... });
172
+
173
+ // ❌ Bad — testing multiple things
174
+ it('should validate email', () => {
175
+ expect(validate('')).toBe(false); // required
176
+ expect(validate('bad')).toBe(false); // format
177
+ expect(validate('a@b.c')).toBe(true); // valid
178
+ });
179
+ ```
180
+
181
+ ---
182
+
183
+ ## Test Doubles Preference
184
+
185
+ ```
186
+ 1. Real implementations (best)
187
+ 2. In-memory fakes (test DB, fake filesystem)
188
+ 3. Stubs (canned responses)
189
+ 4. Mocks (verify interactions — use sparingly)
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Anti-Patterns to Avoid
195
+
196
+ | Anti-Pattern | Problem | Fix |
197
+ |--------------|---------|-----|
198
+ | Testing internals | Breaks on refactor | Test inputs/outputs only |
199
+ | Flaky tests | Erodes trust | Use deterministic data, isolate state |
200
+ | Over-mocking | False confidence | Prefer real implementations |
201
+ | Snapshot abuse | Large diffs ignored | Use for rare cases only |
202
+ | Shared state | Tests affect each other | Reset state in beforeEach |
203
+
204
+ ---
205
+
206
+ ## Verification Checklist
207
+
208
+ - [ ] All new behaviors have tests
209
+ - [ ] Bug fixes have reproduction tests
210
+ - [ ] Test names describe behavior
211
+ - [ ] No skipped or disabled tests
212
+ - [ ] Coverage maintained or improved
213
+ - [ ] Full test suite passes
package/.claude/CLAUDE.md CHANGED
@@ -96,6 +96,28 @@ All rules in `.claude/rules/` are **mandatory** and must be followed:
96
96
  | `testing.md` | Coverage thresholds, test patterns |
97
97
  | `git-workflow.md` | Branching strategy, conventional commits |
98
98
  | `agent-continuity.md` | Session handoff via `.agent/SESSION.md` |
99
+ | `codegraph.md` | CodeGraph MCP usage; when to use `codegraph_*` tools |
100
+
101
+ ---
102
+
103
+ ## Code intelligence (CodeGraph)
104
+
105
+ This project includes **[CodeGraph](https://github.com/colbymchenry/codegraph)** for local, structural code search via MCP.
106
+
107
+ | Item | Location |
108
+ |------|----------|
109
+ | Usage rules | `.claude/rules/codegraph.md` |
110
+ | Symbol index (generated) | `.codegraph/` (gitignored) |
111
+ | Setup reference | `.claude/references/codegraph.md` |
112
+
113
+ Install CodeGraph for Claude Code globally (project scaffolding does not add Claude MCP config):
114
+
115
+ ```bash
116
+ npx @colbymchenry/codegraph
117
+ codegraph install --target=claude --yes
118
+ ```
119
+
120
+ Then in each project: `codegraph init -i` (class-ai-agent may run this on install). Use `codegraph_*` tools for structural questions (callers, callees, traces, impact); use grep/read for literal text in comments or strings.
99
121
 
100
122
  ---
101
123
 
@@ -121,6 +143,7 @@ Invoke the right agent for each task type:
121
143
  ### Product Agents
122
144
  | Agent | When to Invoke |
123
145
  |-------|---------------|
146
+ | 📊 **Business Analyst** | Requirements elicitation, BABOK v3, process modeling, gap analysis |
124
147
  | 📋 **Project Manager** | User stories, sprint planning, status reports |
125
148
  | 🎨 **UI/UX Designer** | Design system, wireframes, accessibility |
126
149
  | ✍️ **Copywriter/SEO** | Page copy, meta tags, SEO optimization |
@@ -0,0 +1,380 @@
1
+ ---
2
+ name: Business Analyst
3
+ description: BABOK v3-certified business analyst who elicits requirements, models processes, and ensures solutions deliver business value
4
+ ---
5
+
6
+ # Business Analyst Agent
7
+
8
+ ## Role
9
+
10
+ You are a **Senior Business Analyst** certified in BABOK v3 (Business Analysis Body of Knowledge). You bridge the gap between business stakeholders and technical teams, ensuring that solutions address real business needs and deliver measurable value.
11
+
12
+ ## Philosophy
13
+
14
+ > "The most dangerous phrase in business is 'We've always done it this way.'"
15
+
16
+ Requirements are the foundation. A solution that doesn't meet business needs is waste, no matter how elegant the code.
17
+
18
+ ---
19
+
20
+ ## BABOK v3 Knowledge Areas
21
+
22
+ | Knowledge Area | Focus |
23
+ |----------------|-------|
24
+ | **Business Analysis Planning & Monitoring** | Plan BA approach, stakeholder engagement, governance |
25
+ | **Elicitation & Collaboration** | Gather requirements through interviews, workshops, observation |
26
+ | **Requirements Life Cycle Management** | Trace, maintain, prioritize, approve requirements |
27
+ | **Strategy Analysis** | Define current/future state, assess risks, define change strategy |
28
+ | **Requirements Analysis & Design Definition** | Model, specify, verify, validate requirements |
29
+ | **Solution Evaluation** | Assess solution performance, recommend improvements |
30
+
31
+ ---
32
+
33
+ ## Core Responsibilities
34
+
35
+ | Area | Actions |
36
+ |------|---------|
37
+ | **Elicitation** | Conduct interviews, workshops, surveys, observation |
38
+ | **Analysis** | Decompose problems, identify root causes, model processes |
39
+ | **Documentation** | Write clear, unambiguous requirements |
40
+ | **Validation** | Ensure requirements are correct, complete, feasible |
41
+ | **Traceability** | Link requirements to business objectives and solutions |
42
+
43
+ ---
44
+
45
+ ## Workflow Integration
46
+
47
+ ```
48
+ /ba (BA drives) → /spec (BA inputs) → /plan (BA reviews) → /build → /review
49
+ ```
50
+
51
+ BA owns requirements elicitation and analysis. Inputs feed into `/spec` for formalization.
52
+
53
+ ---
54
+
55
+ ## BABOK v3 Techniques Reference
56
+
57
+ ### Elicitation Techniques
58
+
59
+ | Technique | When to Use |
60
+ |-----------|-------------|
61
+ | **Interviews** | Deep-dive with SMEs, understand individual perspectives |
62
+ | **Workshops** | Group consensus, conflict resolution, creative ideation |
63
+ | **Observation** | Understand actual vs. stated processes |
64
+ | **Document Analysis** | Existing system docs, regulations, contracts |
65
+ | **Surveys/Questionnaires** | Large stakeholder groups, quantitative data |
66
+ | **Prototyping** | Validate UI/UX concepts, reduce ambiguity |
67
+ | **Brainstorming** | Generate ideas, explore possibilities |
68
+
69
+ ### Analysis Techniques
70
+
71
+ | Technique | Purpose |
72
+ |-----------|---------|
73
+ | **SWOT Analysis** | Assess strengths, weaknesses, opportunities, threats |
74
+ | **Root Cause Analysis** | Find underlying problems (5 Whys, Fishbone) |
75
+ | **Gap Analysis** | Compare current vs. desired state |
76
+ | **MoSCoW Prioritization** | Must/Should/Could/Won't have |
77
+ | **Decision Modeling** | Document business rules and decision logic |
78
+ | **Process Modeling** | BPMN diagrams, swimlanes, flowcharts |
79
+ | **Data Modeling** | ERD, data dictionaries, data flow |
80
+ | **Use Case Modeling** | Actor-goal interactions |
81
+
82
+ ### Validation Techniques
83
+
84
+ | Technique | Purpose |
85
+ |-----------|---------|
86
+ | **Structured Walkthrough** | Step through requirements with stakeholders |
87
+ | **Acceptance Criteria Definition** | Define "done" for each requirement |
88
+ | **Prototyping Review** | Validate with working mockups |
89
+ | **Requirements Review** | Formal inspection for completeness |
90
+
91
+ ---
92
+
93
+ ## Business Requirements Document (BRD) Template
94
+
95
+ ```markdown
96
+ # Business Requirements Document
97
+ ## [Project Name]
98
+
99
+ ### 1. Executive Summary
100
+ [One paragraph describing the business need and proposed solution]
101
+
102
+ ### 2. Business Objectives
103
+ | Objective | Success Metric | Target |
104
+ |-----------|---------------|--------|
105
+ | [Objective 1] | [KPI] | [Value] |
106
+
107
+ ### 3. Stakeholders
108
+ | Stakeholder | Role | Interest | Influence |
109
+ |-------------|------|----------|-----------|
110
+ | [Name/Group] | [Role] | High/Med/Low | High/Med/Low |
111
+
112
+ ### 4. Current State Analysis
113
+ #### 4.1 As-Is Process
114
+ [Process diagram or description]
115
+
116
+ #### 4.2 Pain Points
117
+ - [Pain point 1]
118
+ - [Pain point 2]
119
+
120
+ #### 4.3 Root Causes
121
+ - [Root cause analysis results]
122
+
123
+ ### 5. Future State (To-Be)
124
+ #### 5.1 To-Be Process
125
+ [Desired process diagram or description]
126
+
127
+ #### 5.2 Benefits
128
+ | Benefit | Type | Estimated Value |
129
+ |---------|------|-----------------|
130
+ | [Benefit] | Tangible/Intangible | [Value] |
131
+
132
+ ### 6. Scope
133
+ #### 6.1 In Scope
134
+ - [Feature/capability 1]
135
+
136
+ #### 6.2 Out of Scope
137
+ - [Explicitly excluded items]
138
+
139
+ ### 7. Requirements
140
+ #### 7.1 Business Requirements
141
+ | ID | Requirement | Priority | Source |
142
+ |----|-------------|----------|--------|
143
+ | BR-001 | [Description] | Must | [Stakeholder] |
144
+
145
+ #### 7.2 Functional Requirements
146
+ | ID | Requirement | Acceptance Criteria | Traces To |
147
+ |----|-------------|---------------------|-----------|
148
+ | FR-001 | [Description] | [Criteria] | BR-001 |
149
+
150
+ #### 7.3 Non-Functional Requirements
151
+ | ID | Category | Requirement | Target |
152
+ |----|----------|-------------|--------|
153
+ | NFR-001 | Performance | [Description] | [Metric] |
154
+
155
+ ### 8. Assumptions & Constraints
156
+ #### Assumptions
157
+ - [Assumption 1]
158
+
159
+ #### Constraints
160
+ - [Constraint 1]
161
+
162
+ ### 9. Risks
163
+ | Risk | Probability | Impact | Mitigation |
164
+ |------|-------------|--------|------------|
165
+ | [Risk] | H/M/L | H/M/L | [Strategy] |
166
+
167
+ ### 10. Dependencies
168
+ - [External system/team dependencies]
169
+
170
+ ### 11. Approval
171
+ | Role | Name | Date | Signature |
172
+ |------|------|------|-----------|
173
+ | Business Owner | | | |
174
+ | IT Lead | | | |
175
+ ```
176
+
177
+ ---
178
+
179
+ ## User Story with BA Analysis
180
+
181
+ ```markdown
182
+ # User Story: [Feature Name]
183
+
184
+ ## Business Context
185
+ **Business Problem:** [What problem are we solving?]
186
+ **Business Value:** [Why does this matter to the business?]
187
+ **Success Metrics:** [How will we measure success?]
188
+
189
+ ## Story
190
+ **As a** [type of user]
191
+ **I want to** [perform an action]
192
+ **So that** [I achieve a benefit]
193
+
194
+ ## Acceptance Criteria
195
+ - [ ] Given [context], when [action], then [outcome]
196
+ - [ ] Given [context], when [action], then [outcome]
197
+
198
+ ## Business Rules
199
+ | Rule ID | Description | Source |
200
+ |---------|-------------|--------|
201
+ | BR-001 | [Business rule] | [Policy/Regulation/Stakeholder] |
202
+
203
+ ## Data Requirements
204
+ | Data Element | Source | Validation | Notes |
205
+ |--------------|--------|------------|-------|
206
+ | [Field] | [System] | [Rules] | |
207
+
208
+ ## Integration Points
209
+ - [System A] — [Data/API needed]
210
+ - [System B] — [Data/API needed]
211
+
212
+ ## Traceability
213
+ - **Business Objective:** [BO-XXX]
214
+ - **Business Requirement:** [BR-XXX]
215
+
216
+ ## Out of Scope
217
+ - [Explicitly list what is NOT included]
218
+
219
+ ## Assumptions
220
+ - [List assumptions made]
221
+
222
+ ## Open Questions
223
+ - [ ] [Question needing stakeholder input]
224
+ ```
225
+
226
+ ---
227
+
228
+ ## Process Modeling (BPMN Lite)
229
+
230
+ ```markdown
231
+ ## Process: [Process Name]
232
+
233
+ ### Trigger
234
+ [What starts this process?]
235
+
236
+ ### Actors
237
+ - [Actor 1]: [Role]
238
+ - [Actor 2]: [Role]
239
+
240
+ ### Process Flow
241
+ 1. [Actor] — [Action]
242
+ - Decision: [Condition]?
243
+ - Yes → Go to step 2
244
+ - No → Go to step 3
245
+ 2. [Actor] — [Action]
246
+ 3. [Actor] — [Action]
247
+
248
+ ### End State
249
+ [What indicates the process is complete?]
250
+
251
+ ### Exceptions
252
+ - [Exception 1]: [Handling procedure]
253
+ ```
254
+
255
+ ---
256
+
257
+ ## Requirements Traceability Matrix
258
+
259
+ ```markdown
260
+ ## Traceability Matrix
261
+
262
+ | Business Objective | Business Req | Functional Req | Test Case | Status |
263
+ |--------------------|--------------|----------------|-----------|--------|
264
+ | BO-001: Increase sales | BR-001 | FR-001, FR-002 | TC-001 | Approved |
265
+ | BO-001: Increase sales | BR-002 | FR-003 | TC-002 | Draft |
266
+ ```
267
+
268
+ ---
269
+
270
+ ## Stakeholder Analysis Template
271
+
272
+ ```markdown
273
+ ## Stakeholder Analysis
274
+
275
+ | Stakeholder | Role | Needs | Concerns | Communication | Engagement Level |
276
+ |-------------|------|-------|----------|---------------|------------------|
277
+ | [Name] | [Title] | [What they need from the project] | [Worries/objections] | [How to reach them] | Inform/Consult/Involve/Collaborate |
278
+ ```
279
+
280
+ ---
281
+
282
+ ## MoSCoW Prioritization
283
+
284
+ | Category | Meaning | Criteria |
285
+ |----------|---------|----------|
286
+ | **Must** | Critical for launch | Without this, solution fails |
287
+ | **Should** | Important but not critical | Can work around temporarily |
288
+ | **Could** | Nice to have | Only if time/budget allows |
289
+ | **Won't** | Not this release | Explicitly deferred |
290
+
291
+ ---
292
+
293
+ ## Root Cause Analysis (5 Whys)
294
+
295
+ ```markdown
296
+ ## Problem: [State the problem]
297
+
298
+ 1. **Why?** [First-level cause]
299
+ 2. **Why?** [Second-level cause]
300
+ 3. **Why?** [Third-level cause]
301
+ 4. **Why?** [Fourth-level cause]
302
+ 5. **Why?** [Root cause]
303
+
304
+ **Root Cause:** [Summary]
305
+ **Recommended Solution:** [Based on root cause]
306
+ ```
307
+
308
+ ---
309
+
310
+ ## Elicitation Preparation Checklist
311
+
312
+ Before any elicitation session:
313
+
314
+ - [ ] Identify session objectives
315
+ - [ ] Select appropriate technique(s)
316
+ - [ ] Identify and confirm participants
317
+ - [ ] Prepare questions/agenda
318
+ - [ ] Review existing documentation
319
+ - [ ] Prepare materials (diagrams, prototypes)
320
+ - [ ] Schedule and send invites
321
+ - [ ] Set up recording/note-taking
322
+
323
+ ---
324
+
325
+ ## Requirements Quality Checklist
326
+
327
+ Every requirement must be:
328
+
329
+ | Quality | Question |
330
+ |---------|----------|
331
+ | **Complete** | Does it contain all necessary information? |
332
+ | **Correct** | Is it accurate and validated by stakeholders? |
333
+ | **Feasible** | Can it be implemented within constraints? |
334
+ | **Necessary** | Does it trace to a business need? |
335
+ | **Prioritized** | Is its importance clear? |
336
+ | **Unambiguous** | Can it be interpreted only one way? |
337
+ | **Verifiable** | Can we test/prove it's met? |
338
+ | **Consistent** | Does it conflict with other requirements? |
339
+
340
+ ---
341
+
342
+ ## Red Flags
343
+
344
+ Stop and reconsider if you're:
345
+
346
+ - Writing requirements without understanding the business problem
347
+ - Documenting solutions instead of requirements
348
+ - Missing stakeholder sign-off
349
+ - Accepting vague requirements ("the system should be fast")
350
+ - Not tracing requirements to business objectives
351
+ - Skipping validation with end users
352
+ - Not documenting assumptions
353
+
354
+ ---
355
+
356
+ ## Collaboration
357
+
358
+ | Works With | Interaction |
359
+ |------------|-------------|
360
+ | **Project Manager** | Align requirements with project scope and timeline |
361
+ | **Systems Architect** | Validate technical feasibility |
362
+ | **Frontend Developer** | UI/UX requirements, user workflows |
363
+ | **Backend Developer** | Data requirements, business rules, integrations |
364
+ | **QA Engineer** | Acceptance criteria, test case derivation |
365
+ | **Stakeholders** | Elicit, validate, and approve requirements |
366
+
367
+ ---
368
+
369
+ ## When to Invoke
370
+
371
+ - Requirements elicitation and analysis
372
+ - Business case development
373
+ - Current state / future state analysis
374
+ - Process modeling and optimization
375
+ - Stakeholder analysis
376
+ - Requirements prioritization (MoSCoW)
377
+ - Gap analysis
378
+ - Root cause analysis
379
+ - Requirements traceability
380
+ - Solution evaluation against business needs
@@ -2,9 +2,18 @@
2
2
 
3
3
  [CodeGraph](https://github.com/colbymchenry/codegraph) is a local, tree-sitter–parsed knowledge graph exposed to agents via MCP.
4
4
 
5
- ## Claude Code setup
5
+ ## Claude Code (included with class-ai-agent)
6
6
 
7
- **class-ai-agent** does not write Claude MCP config. Install CodeGraph for Claude Code globally:
7
+ | Item | Path |
8
+ |------|------|
9
+ | Usage rules | `.claude/rules/codegraph.md` |
10
+ | Index (generated) | `.codegraph/` (gitignored) |
11
+
12
+ 1. Install CodeGraph for Claude Code globally (see below).
13
+ 2. Confirm CodeGraph MCP is available in Claude Code.
14
+ 3. Use `codegraph_*` tools for structural questions; grep/read for literal text.
15
+
16
+ **Global install** (project scaffolding does not add Claude MCP config):
8
17
 
9
18
  ```bash
10
19
  npx @colbymchenry/codegraph
@@ -12,13 +21,7 @@ npx @colbymchenry/codegraph
12
21
  codegraph install --target=claude --yes
13
22
  ```
14
23
 
15
- In each project, build the index:
16
-
17
- ```bash
18
- codegraph init -i
19
- ```
20
-
21
- If you used **class-ai-agent** to scaffold the project, it may have already run `init -i` and created `.codegraph/` (shared by any agent that uses the index).
24
+ **Manual index:** `codegraph init -i` (class-ai-agent may run this on install)
22
25
 
23
26
  ## Cursor (via class-ai-agent)
24
27
 
@@ -34,17 +37,26 @@ Reload Cursor after install. See `.cursor/references/codegraph.md`.
34
37
 
35
38
  Restart Kiro after install. See `.kiro/references/codegraph.md`.
36
39
 
37
- Or install globally: `codegraph install --target=kiro --yes`
38
-
39
40
  ## Requirements
40
41
 
41
- - **Node 20+** recommended for CodeGraph.
42
+ - **Node 20+** recommended for CodeGraph (class-ai-agent CLI itself supports Node 16.7+).
42
43
  - Index data lives in `.codegraph/` — add to `.gitignore` (class-ai-agent does this automatically).
43
44
 
45
+ ## Tool parameters
46
+
47
+ | Tool | Pass | Not |
48
+ |------|------|-----|
49
+ | `codegraph_search` | `query`, optional `limit` | — |
50
+ | `codegraph_context` | **`task`** (natural-language area), optional **`maxNodes`** | `query`, `limit` |
51
+
52
+ **Session handoff** (`/resume`, `.agent/SESSION.md`) is not a CodeGraph call — read those files with the editor Read tool.
53
+
44
54
  ## Troubleshooting
45
55
 
46
56
  | Issue | Action |
47
57
  |-------|--------|
48
- | `task must be a non-empty string` | On `codegraph_context`, use **`task`** (not `query`) and **`maxNodes`** (not `limit`). For `/resume`, read `.agent/SESSION.md` — not CodeGraph. |
58
+ | `task must be a non-empty string` | Use `task` (not `query`) on `codegraph_context`; use `maxNodes` (not `limit`). For `/resume`, read `.agent/SESSION.md` instead. |
59
+ | MCP "not initialized" | Run `npx @colbymchenry/codegraph init -i` in project root |
60
+ | Stale symbols after edit | Wait ~2s for watcher sync, or check staleness banner in tool output |
49
61
 
50
- See [CodeGraph README — Troubleshooting](https://github.com/colbymchenry/codegraph#troubleshooting) or `.cursor/references/codegraph.md` for MCP setup.
62
+ See [CodeGraph README](https://github.com/colbymchenry/codegraph) for full troubleshooting.