agcel 1.0.1
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/.agent/workflows/api-gen.md +59 -0
- package/.agent/workflows/architect.md +44 -0
- package/.agent/workflows/brainstorm.md +223 -0
- package/.agent/workflows/build.md +38 -0
- package/.agent/workflows/changelog.md +51 -0
- package/.agent/workflows/checkpoint.md +138 -0
- package/.agent/workflows/commit.md +223 -0
- package/.agent/workflows/debug.md +57 -0
- package/.agent/workflows/deploy.md +76 -0
- package/.agent/workflows/doc.md +247 -0
- package/.agent/workflows/execute-plan.md +225 -0
- package/.agent/workflows/feature.md +255 -0
- package/.agent/workflows/fix.md +323 -0
- package/.agent/workflows/help.md +63 -0
- package/.agent/workflows/index.md +148 -0
- package/.agent/workflows/load.md +112 -0
- package/.agent/workflows/mode.md +170 -0
- package/.agent/workflows/optimize.md +53 -0
- package/.agent/workflows/plan.md +337 -0
- package/.agent/workflows/pr.md +74 -0
- package/.agent/workflows/product-plan.md +36 -0
- package/.agent/workflows/production-deploy.md +39 -0
- package/.agent/workflows/refactor.md +63 -0
- package/.agent/workflows/research.md +116 -0
- package/.agent/workflows/review.md +344 -0
- package/.agent/workflows/security-scan.md +56 -0
- package/.agent/workflows/ship.md +221 -0
- package/.agent/workflows/spawn.md +177 -0
- package/.agent/workflows/status.md +59 -0
- package/.agent/workflows/tdd.md +139 -0
- package/.agent/workflows/test.md +340 -0
- package/.agent/workflows/verify.md +35 -0
- package/LICENSE +21 -0
- package/README.md +67 -0
- package/dist/commands/init.js +142 -0
- package/dist/commands/install.js +98 -0
- package/dist/commands/list.js +49 -0
- package/dist/commands/restart.js +17 -0
- package/dist/commands/start.js +41 -0
- package/dist/commands/status.js +24 -0
- package/dist/commands/stop.js +29 -0
- package/dist/commands/uninstall.js +78 -0
- package/dist/index.js +58 -0
- package/dist/server/index.js +174 -0
- package/dist/utils/index.js +63 -0
- package/package.json +54 -0
- package/skills/api-security-best-practices/SKILL.md +291 -0
- package/skills/api-security-best-practices/references/examples.md +617 -0
- package/skills/architecture/SKILL.md +59 -0
- package/skills/architecture/context-discovery.md +43 -0
- package/skills/architecture/examples.md +94 -0
- package/skills/architecture/pattern-selection.md +68 -0
- package/skills/architecture/patterns-reference.md +50 -0
- package/skills/architecture/trade-off-analysis.md +77 -0
- package/skills/aws-serverless/SKILL.md +327 -0
- package/skills/brainstorming/SKILL.md +234 -0
- package/skills/c4-context/SKILL.md +154 -0
- package/skills/ci-cd-engineer/SKILL.md +50 -0
- package/skills/code-auditing/SKILL.md +55 -0
- package/skills/copywriting/SKILL.md +248 -0
- package/skills/database-engineer/SKILL.md +47 -0
- package/skills/doc-coauthoring/SKILL.md +379 -0
- package/skills/docker-expert/SKILL.md +412 -0
- package/skills/langgraph/SKILL.md +291 -0
- package/skills/postgresql/SKILL.md +73 -0
- package/skills/pricing-strategy/SKILL.md +360 -0
- package/skills/product-manager/SKILL.md +57 -0
- package/skills/prompt-engineer/README.md +659 -0
- package/skills/prompt-engineer/SKILL.md +256 -0
- package/skills/python-patterns/SKILL.md +445 -0
- package/skills/qa-engineer/SKILL.md +42 -0
- package/skills/rag-engineer/SKILL.md +94 -0
- package/skills/react-patterns/SKILL.md +202 -0
- package/skills/secure-refactoring/SKILL.md +54 -0
- package/skills/security-documentation/SKILL.md +53 -0
- package/skills/senior-architect/SKILL.md +213 -0
- package/skills/senior-architect/references/architecture_patterns.md +103 -0
- package/skills/senior-architect/references/system_design_workflows.md +103 -0
- package/skills/senior-architect/references/tech_decision_guide.md +103 -0
- package/skills/senior-architect/scripts/architecture_diagram_generator.py +114 -0
- package/skills/senior-architect/scripts/dependency_analyzer.py +114 -0
- package/skills/senior-architect/scripts/project_architect.py +114 -0
- package/skills/seo-audit/SKILL.md +491 -0
- package/skills/sql-injection-testing/SKILL.md +452 -0
- package/skills/test-driven-development/SKILL.md +375 -0
- package/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/skills/test-fixing/SKILL.md +123 -0
- package/skills/testing-patterns/SKILL.md +263 -0
- package/skills/typescript-expert/SKILL.md +202 -0
- package/skills/typescript-expert/references/advanced-topics.md +252 -0
- package/skills/typescript-expert/references/tsconfig-strict.json +92 -0
- package/skills/typescript-expert/references/typescript-cheatsheet.md +383 -0
- package/skills/typescript-expert/references/utility-types.ts +335 -0
- package/skills/typescript-expert/scripts/ts_diagnostic.py +203 -0
- package/skills/ui-ux-designer/SKILL.md +46 -0
- package/skills/vercel-deployment/SKILL.md +83 -0
- package/skills/vulnerability-scanner/SKILL.md +280 -0
- package/skills/vulnerability-scanner/checklists.md +121 -0
- package/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/skills/writing-plans/SKILL.md +120 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
# /fix - Bug Fix Workflow
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Smart debugging and bug fixing workflow that analyzes errors, identifies root causes, implements fixes, and adds regression tests.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
/fix [error message, bug description, or issue reference]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Arguments
|
|
14
|
+
|
|
15
|
+
- `$ARGUMENTS`: Error message, stack trace, bug description, or issue number
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
Analyze and fix the following issue: **$ARGUMENTS**
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
|
|
23
|
+
### Phase 1: Error Analysis
|
|
24
|
+
|
|
25
|
+
1. **Parse Error Information**
|
|
26
|
+
- Extract error type and message
|
|
27
|
+
- Parse stack trace if available
|
|
28
|
+
- Identify the failing location
|
|
29
|
+
|
|
30
|
+
2. **Gather Context**
|
|
31
|
+
- When does this error occur?
|
|
32
|
+
- What triggers it?
|
|
33
|
+
- Is it reproducible?
|
|
34
|
+
- When did it start happening?
|
|
35
|
+
|
|
36
|
+
3. **Check for Known Patterns**
|
|
37
|
+
- Common error patterns
|
|
38
|
+
- Similar issues in codebase
|
|
39
|
+
- Recent changes that might have caused it
|
|
40
|
+
|
|
41
|
+
### Phase 2: Root Cause Investigation
|
|
42
|
+
|
|
43
|
+
1. **Trace Execution**
|
|
44
|
+
- Follow the code path to the error
|
|
45
|
+
- Identify state at each step
|
|
46
|
+
- Find where expectations diverge
|
|
47
|
+
|
|
48
|
+
2. **Form Hypotheses**
|
|
49
|
+
- List possible causes ranked by likelihood
|
|
50
|
+
- Identify minimal tests to validate each
|
|
51
|
+
|
|
52
|
+
3. **Validate Hypothesis**
|
|
53
|
+
- Test the most likely cause first
|
|
54
|
+
- Confirm root cause before fixing
|
|
55
|
+
- Don't fix symptoms only
|
|
56
|
+
|
|
57
|
+
### Phase 3: Search Related Code
|
|
58
|
+
|
|
59
|
+
1. **Find Similar Code**
|
|
60
|
+
- Search for similar patterns
|
|
61
|
+
- Check if same bug exists elsewhere
|
|
62
|
+
- Identify shared code that might be affected
|
|
63
|
+
|
|
64
|
+
2. **Review Recent Changes**
|
|
65
|
+
```bash
|
|
66
|
+
git log --oneline -20
|
|
67
|
+
git blame [file]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Phase 4: Implement Fix
|
|
71
|
+
|
|
72
|
+
1. **Develop Minimal Fix**
|
|
73
|
+
- Fix the root cause, not symptoms
|
|
74
|
+
- Keep changes minimal and focused
|
|
75
|
+
- Consider edge cases
|
|
76
|
+
|
|
77
|
+
2. **Add Defensive Code** (if appropriate)
|
|
78
|
+
- Input validation
|
|
79
|
+
- Null checks
|
|
80
|
+
- Error handling
|
|
81
|
+
|
|
82
|
+
3. **Update Related Code** (if needed)
|
|
83
|
+
- Fix same issue in similar code
|
|
84
|
+
- Update shared utilities
|
|
85
|
+
|
|
86
|
+
### Phase 5: Verification
|
|
87
|
+
|
|
88
|
+
1. **Test the Fix**
|
|
89
|
+
- Verify original error is resolved
|
|
90
|
+
- Check related functionality
|
|
91
|
+
- Run existing test suite
|
|
92
|
+
|
|
93
|
+
2. **Add Regression Test**
|
|
94
|
+
- Write test that would have caught this bug
|
|
95
|
+
- Include edge cases discovered
|
|
96
|
+
- Ensure test fails without fix
|
|
97
|
+
|
|
98
|
+
3. **Run Full Test Suite**
|
|
99
|
+
```bash
|
|
100
|
+
# Python
|
|
101
|
+
pytest -v
|
|
102
|
+
|
|
103
|
+
# TypeScript
|
|
104
|
+
pnpm test
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Phase 6: Documentation
|
|
108
|
+
|
|
109
|
+
1. **Document the Fix**
|
|
110
|
+
- What was the issue
|
|
111
|
+
- What caused it
|
|
112
|
+
- How it was fixed
|
|
113
|
+
|
|
114
|
+
2. **Update Comments** (if needed)
|
|
115
|
+
- Add clarifying comments
|
|
116
|
+
- Document non-obvious behavior
|
|
117
|
+
|
|
118
|
+
## Output
|
|
119
|
+
|
|
120
|
+
### Bug Fix Summary
|
|
121
|
+
|
|
122
|
+
```markdown
|
|
123
|
+
## Bug Fix Complete
|
|
124
|
+
|
|
125
|
+
### Issue
|
|
126
|
+
[Original error/bug description]
|
|
127
|
+
|
|
128
|
+
### Root Cause
|
|
129
|
+
[Explanation of what caused the bug]
|
|
130
|
+
|
|
131
|
+
### Location
|
|
132
|
+
`path/to/file.ts:42` - [function/method name]
|
|
133
|
+
|
|
134
|
+
### Fix Applied
|
|
135
|
+
|
|
136
|
+
**Before:**
|
|
137
|
+
```typescript
|
|
138
|
+
// Problematic code
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**After:**
|
|
142
|
+
```typescript
|
|
143
|
+
// Fixed code
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Explanation
|
|
147
|
+
[Why this fix resolves the issue]
|
|
148
|
+
|
|
149
|
+
### Regression Test Added
|
|
150
|
+
`path/to/test.ts` - `test_[scenario]`
|
|
151
|
+
|
|
152
|
+
### Verification
|
|
153
|
+
- [x] Original error no longer occurs
|
|
154
|
+
- [x] Existing tests pass
|
|
155
|
+
- [x] New regression test passes
|
|
156
|
+
- [x] No new issues introduced
|
|
157
|
+
|
|
158
|
+
### Related Areas Checked
|
|
159
|
+
- [x] `path/to/similar.ts` - No similar issue
|
|
160
|
+
|
|
161
|
+
### Commands to Verify
|
|
162
|
+
```bash
|
|
163
|
+
pytest tests/test_file.py -v
|
|
164
|
+
# or
|
|
165
|
+
pnpm test path/to/file.test.ts
|
|
166
|
+
```
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Common Fix Patterns
|
|
170
|
+
|
|
171
|
+
### Null/Undefined Access
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
// Before
|
|
175
|
+
const name = user.profile.name;
|
|
176
|
+
|
|
177
|
+
// After
|
|
178
|
+
const name = user?.profile?.name ?? 'Unknown';
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Missing Error Handling
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
# Before
|
|
185
|
+
data = json.loads(response.text)
|
|
186
|
+
|
|
187
|
+
# After
|
|
188
|
+
try:
|
|
189
|
+
data = json.loads(response.text)
|
|
190
|
+
except json.JSONDecodeError as e:
|
|
191
|
+
logger.error(f"Invalid JSON response: {e}")
|
|
192
|
+
raise InvalidResponseError("Failed to parse response")
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Race Condition
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
// Before
|
|
199
|
+
const data = await fetchData();
|
|
200
|
+
setState(data); // May be unmounted
|
|
201
|
+
|
|
202
|
+
// After
|
|
203
|
+
useEffect(() => {
|
|
204
|
+
let cancelled = false;
|
|
205
|
+
fetchData().then(data => {
|
|
206
|
+
if (!cancelled) setState(data);
|
|
207
|
+
});
|
|
208
|
+
return () => { cancelled = true; };
|
|
209
|
+
}, []);
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Off-by-One Error
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
# Before
|
|
216
|
+
for i in range(len(items) + 1): # IndexError
|
|
217
|
+
process(items[i])
|
|
218
|
+
|
|
219
|
+
# After
|
|
220
|
+
for i in range(len(items)):
|
|
221
|
+
process(items[i])
|
|
222
|
+
# or
|
|
223
|
+
for item in items:
|
|
224
|
+
process(item)
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Example
|
|
228
|
+
|
|
229
|
+
**Input**: `/fix TypeError: Cannot read property 'email' of undefined in UserService.ts:45`
|
|
230
|
+
|
|
231
|
+
**Output**:
|
|
232
|
+
1. Analysis: User object is undefined when accessed
|
|
233
|
+
2. Root cause: async fetch didn't await, user not loaded yet
|
|
234
|
+
3. Fix: Add null check and proper async handling
|
|
235
|
+
4. Regression test: Test for case when user is not loaded
|
|
236
|
+
|
|
237
|
+
## Flags
|
|
238
|
+
|
|
239
|
+
| Flag | Description | Example |
|
|
240
|
+
|------|-------------|---------|
|
|
241
|
+
| `--mode=[mode]` | Use specific behavioral mode | `--mode=deep-research` |
|
|
242
|
+
| `--persona=[type]` | Apply persona expertise | `--persona=security` |
|
|
243
|
+
| `--depth=[1-5]` | Investigation thoroughness | `--depth=4` |
|
|
244
|
+
| `--format=[fmt]` | Output format (concise/detailed) | `--format=concise` |
|
|
245
|
+
| `--skip-regression` | Skip regression test creation | `--skip-regression` |
|
|
246
|
+
| `--checkpoint` | Create checkpoint before fixing | `--checkpoint` |
|
|
247
|
+
|
|
248
|
+
### Flag Usage Examples
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
/fix --mode=deep-research "intermittent timeout error"
|
|
252
|
+
/fix --persona=security "SQL injection vulnerability"
|
|
253
|
+
/fix --depth=5 "race condition in auth flow"
|
|
254
|
+
/fix --format=concise "typo in error message"
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Persona Options
|
|
258
|
+
|
|
259
|
+
| Persona | Focus Area |
|
|
260
|
+
|---------|------------|
|
|
261
|
+
| `security` | Security vulnerabilities, OWASP |
|
|
262
|
+
| `performance` | Speed, memory, efficiency |
|
|
263
|
+
| `reliability` | Error handling, edge cases |
|
|
264
|
+
|
|
265
|
+
## MCP Integration
|
|
266
|
+
|
|
267
|
+
This command leverages MCP servers for enhanced debugging:
|
|
268
|
+
|
|
269
|
+
### Reasoning - Root Cause Analysis (Primary)
|
|
270
|
+
```
|
|
271
|
+
ALWAYS use Reasoning for debugging:
|
|
272
|
+
- Trace execution path step-by-step
|
|
273
|
+
- Form and test hypotheses systematically
|
|
274
|
+
- Track confidence in each potential cause
|
|
275
|
+
- Revise understanding as evidence emerges
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Memory - Bug Context
|
|
279
|
+
```
|
|
280
|
+
Store and recall debugging context:
|
|
281
|
+
- Remember similar bugs from previous sessions
|
|
282
|
+
- Recall fix patterns that worked before
|
|
283
|
+
- Store root cause analysis for future reference
|
|
284
|
+
- Create relations between bugs and affected components
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Browser tools - Browser Testing
|
|
288
|
+
```
|
|
289
|
+
For UI/frontend bugs:
|
|
290
|
+
- Reproduce the bug in browser environment
|
|
291
|
+
- Test fix across different browsers
|
|
292
|
+
- Verify visual regressions are resolved
|
|
293
|
+
- Automate regression test for the fix
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Web Search - Library Issues
|
|
297
|
+
```
|
|
298
|
+
When debugging library-related issues:
|
|
299
|
+
- Fetch current documentation for correct usage
|
|
300
|
+
- Check for known issues or breaking changes
|
|
301
|
+
- Find correct patterns and examples
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Filesystem - Code Search
|
|
305
|
+
```
|
|
306
|
+
For tracing bug across codebase:
|
|
307
|
+
- Use grep_search to find related code
|
|
308
|
+
- Use view_file to examine suspicious areas
|
|
309
|
+
- Track changes with file history
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
<!-- CUSTOMIZATION POINT -->
|
|
313
|
+
## Variations
|
|
314
|
+
|
|
315
|
+
Modify behavior via CLAUDE.md:
|
|
316
|
+
- Set required test coverage for fixes
|
|
317
|
+
- Define severity levels for bugs
|
|
318
|
+
- Configure error reporting format
|
|
319
|
+
- Set required review process
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
## Gap Analysis Rule
|
|
323
|
+
Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# /help - Help Command
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Display available commands and their usage.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
/help [command name]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Show help for: **$ARGUMENTS**
|
|
16
|
+
|
|
17
|
+
## Available Commands
|
|
18
|
+
|
|
19
|
+
### Development Workflow
|
|
20
|
+
| Command | Description |
|
|
21
|
+
|---------|-------------|
|
|
22
|
+
| `/feature` | Full feature development workflow |
|
|
23
|
+
| `/fix` | Debug and fix bugs |
|
|
24
|
+
| `/review` | Code review |
|
|
25
|
+
| `/test` | Generate tests |
|
|
26
|
+
| `/tdd` | Test-driven development |
|
|
27
|
+
| `/refactor` | Improve code structure |
|
|
28
|
+
|
|
29
|
+
### Git & Deployment
|
|
30
|
+
| Command | Description |
|
|
31
|
+
|---------|-------------|
|
|
32
|
+
| `/commit` | Create commit with message |
|
|
33
|
+
| `/ship` | Commit + PR workflow |
|
|
34
|
+
| `/pr` | Create pull request |
|
|
35
|
+
| `/deploy` | Deploy to environment |
|
|
36
|
+
|
|
37
|
+
### Documentation
|
|
38
|
+
| Command | Description |
|
|
39
|
+
|---------|-------------|
|
|
40
|
+
| `/doc` | Generate documentation |
|
|
41
|
+
| `/plan` | Create implementation plan |
|
|
42
|
+
|
|
43
|
+
### Security & Quality
|
|
44
|
+
| Command | Description |
|
|
45
|
+
|---------|-------------|
|
|
46
|
+
| `/security-scan` | Scan for vulnerabilities |
|
|
47
|
+
| `/api-gen` | Generate API code |
|
|
48
|
+
|
|
49
|
+
## Getting Help
|
|
50
|
+
|
|
51
|
+
For detailed help on a specific command:
|
|
52
|
+
```
|
|
53
|
+
/help [command-name]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
For general Claude Code help:
|
|
57
|
+
```
|
|
58
|
+
/help
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## Gap Analysis Rule
|
|
63
|
+
Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# /index
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Generate a comprehensive project structure index for faster navigation and context loading. Creates a `PROJECT_INDEX.md` file mapping the codebase structure.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Analyze the current project and generate a comprehensive index.
|
|
10
|
+
|
|
11
|
+
## Index Generation
|
|
12
|
+
|
|
13
|
+
### Step 1: Scan Project Structure
|
|
14
|
+
|
|
15
|
+
Scan the entire project directory structure, excluding:
|
|
16
|
+
- `node_modules/`
|
|
17
|
+
- `.git/`
|
|
18
|
+
- `__pycache__/`
|
|
19
|
+
- `dist/`, `build/`, `.next/`
|
|
20
|
+
- `venv/`, `.venv/`
|
|
21
|
+
- Coverage and cache directories
|
|
22
|
+
|
|
23
|
+
### Step 2: Identify Key Components
|
|
24
|
+
|
|
25
|
+
Categorize files by type:
|
|
26
|
+
- **Entry Points**: Main files, index files, app entry
|
|
27
|
+
- **API/Routes**: Endpoint definitions
|
|
28
|
+
- **Models/Types**: Data structures, schemas
|
|
29
|
+
- **Services**: Business logic
|
|
30
|
+
- **Utilities**: Helper functions
|
|
31
|
+
- **Tests**: Test files
|
|
32
|
+
- **Configuration**: Config files, env templates
|
|
33
|
+
- **Documentation**: README, docs
|
|
34
|
+
|
|
35
|
+
### Step 3: Map Dependencies
|
|
36
|
+
|
|
37
|
+
Identify:
|
|
38
|
+
- Package managers and dependencies (package.json, requirements.txt, etc.)
|
|
39
|
+
- Internal import relationships between key files
|
|
40
|
+
- External service integrations
|
|
41
|
+
|
|
42
|
+
### Step 4: Generate Index
|
|
43
|
+
|
|
44
|
+
Create `PROJECT_INDEX.md` with this structure:
|
|
45
|
+
|
|
46
|
+
```markdown
|
|
47
|
+
# Project Index: [Project Name]
|
|
48
|
+
|
|
49
|
+
Generated: [timestamp]
|
|
50
|
+
|
|
51
|
+
## Quick Navigation
|
|
52
|
+
|
|
53
|
+
| Category | Key Files |
|
|
54
|
+
|----------|-----------|
|
|
55
|
+
| Entry Points | [list] |
|
|
56
|
+
| API Routes | [list] |
|
|
57
|
+
| Core Services | [list] |
|
|
58
|
+
| Models | [list] |
|
|
59
|
+
|
|
60
|
+
## Directory Structure
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
[tree view]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Key Files
|
|
67
|
+
|
|
68
|
+
### Entry Points
|
|
69
|
+
- `[path]` - [description]
|
|
70
|
+
|
|
71
|
+
### API/Routes
|
|
72
|
+
- `[path]` - [description]
|
|
73
|
+
|
|
74
|
+
### Services
|
|
75
|
+
- `[path]` - [description]
|
|
76
|
+
|
|
77
|
+
### Models/Types
|
|
78
|
+
- `[path]` - [description]
|
|
79
|
+
|
|
80
|
+
## Dependencies
|
|
81
|
+
|
|
82
|
+
### External
|
|
83
|
+
- [package]: [purpose]
|
|
84
|
+
|
|
85
|
+
### Internal
|
|
86
|
+
- [module] → [depends on]
|
|
87
|
+
|
|
88
|
+
## Architecture Notes
|
|
89
|
+
[Brief description of patterns observed]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Flags
|
|
93
|
+
|
|
94
|
+
| Flag | Description |
|
|
95
|
+
|------|-------------|
|
|
96
|
+
| `--depth=[N]` | Limit directory depth (default: 5) |
|
|
97
|
+
| `--include=[pattern]` | Include additional patterns |
|
|
98
|
+
| `--exclude=[pattern]` | Exclude additional patterns |
|
|
99
|
+
| `--output=[path]` | Custom output path |
|
|
100
|
+
|
|
101
|
+
## Usage Examples
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
/index # Standard index
|
|
105
|
+
/index --depth=3 # Shallow index
|
|
106
|
+
/index --include="*.graphql" # Include GraphQL files
|
|
107
|
+
/index --output=docs/INDEX.md # Custom output location
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Arguments
|
|
111
|
+
|
|
112
|
+
$ARGUMENTS
|
|
113
|
+
|
|
114
|
+
If no arguments provided, generate standard index with default settings.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
After generating the index, inform the user:
|
|
119
|
+
1. Index file location
|
|
120
|
+
2. Number of files indexed
|
|
121
|
+
3. Key components discovered
|
|
122
|
+
4. Suggest using `/load` to load specific components into context
|
|
123
|
+
|
|
124
|
+
## MCP Integration
|
|
125
|
+
|
|
126
|
+
This command leverages MCP servers for enhanced indexing:
|
|
127
|
+
|
|
128
|
+
### Filesystem - Project Scanning (Primary)
|
|
129
|
+
```
|
|
130
|
+
ALWAYS use Filesystem for project scanning:
|
|
131
|
+
- Use list_dir for full structure view
|
|
132
|
+
- Use list_directory for targeted exploration
|
|
133
|
+
- Use grep_search to find specific patterns
|
|
134
|
+
- Use get_file_info for file metadata
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Memory - Project Knowledge
|
|
138
|
+
```
|
|
139
|
+
Store project structure in knowledge graph:
|
|
140
|
+
- Create entities for key modules
|
|
141
|
+
- Store component relationships
|
|
142
|
+
- Recall structure in future sessions
|
|
143
|
+
- Build project understanding over time
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
## Gap Analysis Rule
|
|
148
|
+
Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# /load
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Load specific project components into context for focused work. Uses the project index to efficiently load relevant files.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Load the requested component(s) into context.
|
|
10
|
+
|
|
11
|
+
## Loading Process
|
|
12
|
+
|
|
13
|
+
### Step 1: Check for Index
|
|
14
|
+
|
|
15
|
+
First, check if `PROJECT_INDEX.md` exists:
|
|
16
|
+
- If exists: Use index for efficient loading
|
|
17
|
+
- If not: Suggest running `/index` first, or do quick scan
|
|
18
|
+
|
|
19
|
+
### Step 2: Identify Component
|
|
20
|
+
|
|
21
|
+
Parse the requested component:
|
|
22
|
+
|
|
23
|
+
| Request Type | Action |
|
|
24
|
+
|--------------|--------|
|
|
25
|
+
| Category name | Load all files in category |
|
|
26
|
+
| File path | Load specific file |
|
|
27
|
+
| Pattern | Load matching files |
|
|
28
|
+
| `--all` | Load key files from all categories |
|
|
29
|
+
|
|
30
|
+
### Step 3: Load Files
|
|
31
|
+
|
|
32
|
+
Read the identified files and summarize:
|
|
33
|
+
- File purposes
|
|
34
|
+
- Key exports/functions
|
|
35
|
+
- Dependencies
|
|
36
|
+
- Current state
|
|
37
|
+
|
|
38
|
+
### Step 4: Context Summary
|
|
39
|
+
|
|
40
|
+
Provide a brief summary:
|
|
41
|
+
```markdown
|
|
42
|
+
## Loaded Context
|
|
43
|
+
|
|
44
|
+
### Files Loaded (N)
|
|
45
|
+
- `path/to/file1.ts` - [purpose]
|
|
46
|
+
- `path/to/file2.ts` - [purpose]
|
|
47
|
+
|
|
48
|
+
### Key Components
|
|
49
|
+
- [Component]: [description]
|
|
50
|
+
|
|
51
|
+
### Ready For
|
|
52
|
+
- [Suggested actions based on loaded context]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Component Categories
|
|
56
|
+
|
|
57
|
+
| Category | What It Loads |
|
|
58
|
+
|----------|---------------|
|
|
59
|
+
| `api` | API routes and endpoints |
|
|
60
|
+
| `models` | Data models and types |
|
|
61
|
+
| `services` | Business logic services |
|
|
62
|
+
| `utils` | Utility functions |
|
|
63
|
+
| `tests` | Test files |
|
|
64
|
+
| `config` | Configuration files |
|
|
65
|
+
| `auth` | Authentication related |
|
|
66
|
+
| `db` | Database related |
|
|
67
|
+
|
|
68
|
+
## Flags
|
|
69
|
+
|
|
70
|
+
| Flag | Description |
|
|
71
|
+
|------|-------------|
|
|
72
|
+
| `--all` | Load all key components |
|
|
73
|
+
| `--shallow` | Load only file summaries |
|
|
74
|
+
| `--deep` | Load full file contents |
|
|
75
|
+
| `--related` | Include related files |
|
|
76
|
+
|
|
77
|
+
## Usage Examples
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
/load api # Load all API routes
|
|
81
|
+
/load models # Load all data models
|
|
82
|
+
/load src/services/user.ts # Load specific file
|
|
83
|
+
/load auth --related # Load auth + related files
|
|
84
|
+
/load --all # Load all key components
|
|
85
|
+
/load --all --shallow # Quick overview of everything
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Arguments
|
|
89
|
+
|
|
90
|
+
$ARGUMENTS
|
|
91
|
+
|
|
92
|
+
If no arguments, show available components from index.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Best Practices
|
|
97
|
+
|
|
98
|
+
1. **Start Narrow**: Load specific components first
|
|
99
|
+
2. **Expand as Needed**: Use `--related` when you need more context
|
|
100
|
+
3. **Check Index**: Run `/index` if loading seems slow
|
|
101
|
+
4. **Use Categories**: Category names are faster than patterns
|
|
102
|
+
|
|
103
|
+
## After Loading
|
|
104
|
+
|
|
105
|
+
Suggest next actions:
|
|
106
|
+
- "Ready to work on [component]. What would you like to do?"
|
|
107
|
+
- "I see [patterns/issues]. Want me to address them?"
|
|
108
|
+
- "Related files that might be relevant: [list]"
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
## Gap Analysis Rule
|
|
112
|
+
Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.
|