@codemieai/code 0.0.30 → 0.0.32
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/dist/agents/codemie-code/agent.d.ts +6 -0
- package/dist/agents/codemie-code/agent.d.ts.map +1 -1
- package/dist/agents/codemie-code/agent.js +239 -3
- package/dist/agents/codemie-code/agent.js.map +1 -1
- package/dist/agents/codemie-code/config.d.ts.map +1 -1
- package/dist/agents/codemie-code/config.js +3 -1
- package/dist/agents/codemie-code/config.js.map +1 -1
- package/dist/agents/codemie-code/types.d.ts +13 -0
- package/dist/agents/codemie-code/types.d.ts.map +1 -1
- package/dist/agents/codemie-code/types.js.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts +9 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +11 -0
- package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
- package/dist/agents/core/types.d.ts +74 -0
- package/dist/agents/core/types.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +18 -0
- package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
- package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/code-review-agent-template.md.template +466 -0
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/solution-architect-agent.md.template +487 -0
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/unit-tester-agent.md.template +805 -0
- package/dist/agents/plugins/claude/plugin/commands/codemie-commit.md +31 -0
- package/dist/agents/plugins/claude/plugin/commands/codemie-init.md +1 -1
- package/dist/agents/plugins/claude/plugin/commands/codemie-pr.md +25 -0
- package/dist/agents/plugins/claude/plugin/commands/codemie-subagents.md +616 -0
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js +8 -0
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -1
- package/dist/agents/plugins/gemini/gemini.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/gemini.plugin.js +14 -0
- package/dist/agents/plugins/gemini/gemini.plugin.js.map +1 -1
- package/dist/cli/commands/hook.d.ts.map +1 -1
- package/dist/cli/commands/hook.js +15 -1
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/env/types.d.ts +2 -0
- package/dist/env/types.d.ts.map +1 -1
- package/dist/env/types.js.map +1 -1
- package/dist/hooks/decision.d.ts +53 -0
- package/dist/hooks/decision.d.ts.map +1 -0
- package/dist/hooks/decision.js +201 -0
- package/dist/hooks/decision.js.map +1 -0
- package/dist/hooks/executor.d.ts +154 -0
- package/dist/hooks/executor.d.ts.map +1 -0
- package/dist/hooks/executor.js +415 -0
- package/dist/hooks/executor.js.map +1 -0
- package/dist/hooks/matcher.d.ts +41 -0
- package/dist/hooks/matcher.d.ts.map +1 -0
- package/dist/hooks/matcher.js +93 -0
- package/dist/hooks/matcher.js.map +1 -0
- package/dist/hooks/prompt-executor.d.ts +57 -0
- package/dist/hooks/prompt-executor.d.ts.map +1 -0
- package/dist/hooks/prompt-executor.js +141 -0
- package/dist/hooks/prompt-executor.js.map +1 -0
- package/dist/hooks/types.d.ts +153 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks/types.js +9 -0
- package/dist/hooks/types.js.map +1 -0
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.d.ts +3 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.js +14 -2
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-types.d.ts +8 -0
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-types.d.ts.map +1 -1
- package/dist/utils/config.d.ts +5 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +73 -0
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/mcp-config.d.ts +25 -0
- package/dist/utils/mcp-config.d.ts.map +1 -0
- package/dist/utils/mcp-config.js +197 -0
- package/dist/utils/mcp-config.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Bash(git add:*), Bash(git commit:*), Bash(git checkout:*)
|
|
3
|
+
description: Create a git commit (not on main branch)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
- Current branch: !`git branch --show-current`
|
|
9
|
+
- Current git status: !`git status`
|
|
10
|
+
- Current git diff (staged and unstaged changes): !`git diff HEAD`
|
|
11
|
+
- Recent commits: !`git log --oneline -5`
|
|
12
|
+
|
|
13
|
+
## Your task
|
|
14
|
+
|
|
15
|
+
Based on the above changes, create a single git commit.
|
|
16
|
+
|
|
17
|
+
**IMPORTANT**: If the current branch is `main` or `master`:
|
|
18
|
+
1. Analyze the changes to determine the type (feat, fix, refactor, etc.)
|
|
19
|
+
2. Suggest a branch name in format `<type>/<short-description>` (e.g., `feat/add-auth-header-support`, `fix/proxy-timeout-issue`)
|
|
20
|
+
3. Ask user to confirm the branch name or provide an alternative
|
|
21
|
+
4. After confirmation, create the branch with `git checkout -b <branch-name>` and proceed with the commit
|
|
22
|
+
|
|
23
|
+
If on a feature branch:
|
|
24
|
+
1. Stage all relevant changes
|
|
25
|
+
2. Create a commit message following commitlint rules:
|
|
26
|
+
- Format: `<type>(<scope>): <subject>` or `<type>: <subject>`
|
|
27
|
+
- Types: feat, fix, docs, style, refactor, perf, test, chore, ci, revert
|
|
28
|
+
- Scopes (optional): cli, agents, providers, config, proxy, workflows, ci, analytics, utils, deps, tests
|
|
29
|
+
- Subject: max 100 characters, lowercase start, no period at end
|
|
30
|
+
|
|
31
|
+
You have the capability to call multiple tools in a single response. Stage and create the commit using a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Codemie Init - Generate Project Documentation
|
|
2
2
|
|
|
3
3
|
**Command Name**: `codemie-init`
|
|
4
|
-
**Description**: Initialize
|
|
4
|
+
**Description**: Initialize Codeie documentation for any project - analyze structure and generate AI-optimized guides
|
|
5
5
|
**Category**: Documentation Generation
|
|
6
6
|
**Complexity**: High
|
|
7
7
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Bash(git push:*), Bash(gh pr create:*)
|
|
3
|
+
description: Push changes and create PR using GitHub template
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
- Current branch: !`git branch --show-current`
|
|
9
|
+
- Recent commits on this branch: !`git log origin/main..HEAD --oneline`
|
|
10
|
+
- PR template: !`cat .github/PULL_REQUEST_TEMPLATE.md`
|
|
11
|
+
|
|
12
|
+
## Your task
|
|
13
|
+
|
|
14
|
+
Based on the above changes:
|
|
15
|
+
|
|
16
|
+
1. Push the current branch to origin (use the same branch name)
|
|
17
|
+
2. Create a pull request using `gh pr create` following the PR template format from `.github/PULL_REQUEST_TEMPLATE.md`
|
|
18
|
+
|
|
19
|
+
When creating the PR:
|
|
20
|
+
- Generate a clear, concise title based on the changes
|
|
21
|
+
- Use `--body` with content that follows the PR template structure
|
|
22
|
+
- Fill in the Summary section with a brief overview based on the recent commits
|
|
23
|
+
- Include the Checklist section with "Self-reviewed" marked as checked
|
|
24
|
+
|
|
25
|
+
3. You have the capability to call multiple tools in a single response. You MUST do all of the above in a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls.
|
|
@@ -0,0 +1,616 @@
|
|
|
1
|
+
# Codemie Subagents - Generate Project-Specific Subagent Files
|
|
2
|
+
|
|
3
|
+
**Command Name**: `codemie-subagents`
|
|
4
|
+
**Description**: Generate project-specific subagent files from templates - analyze codebase and create AI-optimized subagent definitions
|
|
5
|
+
**Category**: Subagent Generation
|
|
6
|
+
**Complexity**: Medium-High
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Purpose
|
|
11
|
+
|
|
12
|
+
This command analyzes any software project and generates project-specific subagent files from templates, including:
|
|
13
|
+
- Unit Tester Agent - specialized for project's testing patterns
|
|
14
|
+
- Solution Architect Agent - tailored to project's architecture
|
|
15
|
+
- Code Review Agent - customized for project's code standards
|
|
16
|
+
|
|
17
|
+
Generated agents are placed in `.claude/agents/` directory for immediate use by Claude Code.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
Before running this command:
|
|
24
|
+
- [ ] Project is cloned and accessible
|
|
25
|
+
- [ ] You have read access to the codebase
|
|
26
|
+
- [ ] Codemie templates are available at `.codemie/claude-templates/templates/agents/`
|
|
27
|
+
|
|
28
|
+
**Note**: The templates directory should be located in `.codemie/claude-templates/` within the project.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 🚨 CRITICAL SIZE LIMITS
|
|
33
|
+
|
|
34
|
+
**MANDATORY**: Each generated subagent must be **300-500 lines maximum**.
|
|
35
|
+
|
|
36
|
+
### Enforcement Strategy
|
|
37
|
+
|
|
38
|
+
**During Generation**:
|
|
39
|
+
- ✅ Use brief, focused examples (10-20 lines max)
|
|
40
|
+
- ✅ Focus on contracts: function signatures, patterns, conventions
|
|
41
|
+
- ✅ Use tables for pattern references instead of long explanations
|
|
42
|
+
- ✅ ONE representative example per pattern category
|
|
43
|
+
- ✅ Reference file:line for detailed examples instead of copying entire code
|
|
44
|
+
- ❌ NO extensive code blocks (keep under 20 lines)
|
|
45
|
+
- ❌ NO multiple variations of same pattern
|
|
46
|
+
- ❌ NO verbose tutorials or walkthroughs
|
|
47
|
+
- ❌ NO redundant explanations
|
|
48
|
+
|
|
49
|
+
**Validation**:
|
|
50
|
+
After generating each subagent, count lines:
|
|
51
|
+
```bash
|
|
52
|
+
wc -l .claude/agents/[agent-name].md
|
|
53
|
+
```
|
|
54
|
+
If > 500 lines: **STOP and condense before continuing**.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Execution Steps
|
|
59
|
+
|
|
60
|
+
### Phase 1: Template Discovery & Project Analysis
|
|
61
|
+
|
|
62
|
+
#### Step 1.1: Discover Available Templates
|
|
63
|
+
|
|
64
|
+
**Task**: Find all subagent templates available for generation
|
|
65
|
+
|
|
66
|
+
**Actions**:
|
|
67
|
+
```bash
|
|
68
|
+
# List all template files in subagents directory
|
|
69
|
+
ls .codemie/claude-templates/templates/subagents/
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Expected Templates**:
|
|
73
|
+
- `code-review-agent-template.md.template` - Code review specialized agent
|
|
74
|
+
- `solution-architect-agent.md.template` - Architecture planning agent
|
|
75
|
+
- `unit-tester-agent.md.template` - Testing specialized agent
|
|
76
|
+
|
|
77
|
+
**Output**: Array of template file names and paths
|
|
78
|
+
|
|
79
|
+
**Confidence Check**: Can you find at least 1 template file?
|
|
80
|
+
- ✅ YES → Continue to Step 1.2
|
|
81
|
+
- ❌ NO → Report error (templates directory missing)
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
#### Step 1.2: Analyze Project Structure
|
|
86
|
+
|
|
87
|
+
**Task**: Understand project organization, tech stack, and patterns
|
|
88
|
+
|
|
89
|
+
**Actions**:
|
|
90
|
+
```bash
|
|
91
|
+
# Identify project type and structure
|
|
92
|
+
- Check for package.json, requirements.txt, pom.xml, Cargo.toml, go.mod, etc.
|
|
93
|
+
- Identify language(s) and frameworks
|
|
94
|
+
- Map directory structure
|
|
95
|
+
- Find configuration files (tsconfig.json, .eslintrc, pytest.ini, etc.)
|
|
96
|
+
- Locate test directories and files
|
|
97
|
+
- Find architecture patterns (MVC, layered, microservices, etc.)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Critical Information to Extract**:
|
|
101
|
+
- **Programming Language(s)**: TypeScript, Python, Java, Go, Rust, etc.
|
|
102
|
+
- **Framework(s)**: Express, FastAPI, Spring Boot, Gin, etc.
|
|
103
|
+
- **Build Tools**: npm, pip, maven, cargo, etc.
|
|
104
|
+
- **Testing Framework**: Vitest, Jest, pytest, JUnit, Go test, etc.
|
|
105
|
+
- **Linting Tools**: ESLint, Pylint, Checkstyle, golangci-lint, etc.
|
|
106
|
+
- **Project Structure**: Monorepo/multi-package vs single package
|
|
107
|
+
- **Key Directories**: src/, tests/, lib/, internal/, etc.
|
|
108
|
+
|
|
109
|
+
**Output**: Project analysis document with all extracted information
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
#### Step 1.3: Read Existing Documentation
|
|
114
|
+
|
|
115
|
+
**Task**: Check for existing documentation to understand conventions
|
|
116
|
+
|
|
117
|
+
**Actions**:
|
|
118
|
+
```bash
|
|
119
|
+
# Read existing docs (if they exist)
|
|
120
|
+
- README.md - project overview, setup, conventions
|
|
121
|
+
- CONTRIBUTING.md - contribution guidelines, code standards
|
|
122
|
+
- CLAUDE.md - existing AI instructions (if present)
|
|
123
|
+
- .codemie/guides/ - existing guides
|
|
124
|
+
- docs/ directory - additional documentation
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Extract**:
|
|
128
|
+
- Code style conventions
|
|
129
|
+
- Testing requirements
|
|
130
|
+
- Review standards
|
|
131
|
+
- Architecture decisions
|
|
132
|
+
- Common patterns and anti-patterns
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### Phase 2: Template Loading & Validation
|
|
137
|
+
|
|
138
|
+
#### Step 2.1: Create Todo List for Templates
|
|
139
|
+
|
|
140
|
+
**Task**: Create todo tasks for each discovered template
|
|
141
|
+
|
|
142
|
+
**Actions**:
|
|
143
|
+
```typescript
|
|
144
|
+
// For each template file found in Step 1.1:
|
|
145
|
+
// - Create todo item: "Generate [agent-name] from template"
|
|
146
|
+
// Example todos:
|
|
147
|
+
// - [ ] Generate unit-tester agent from template
|
|
148
|
+
// - [ ] Generate solution-architect agent from template
|
|
149
|
+
// - [ ] Generate code-review agent from template
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Output**: Todo list with one task per template
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
#### Step 2.2: Load Each Template
|
|
157
|
+
|
|
158
|
+
**Task**: Read and parse each template file
|
|
159
|
+
|
|
160
|
+
**For Each Template**:
|
|
161
|
+
|
|
162
|
+
**Step 2.2.1: Read Template Content**
|
|
163
|
+
```bash
|
|
164
|
+
# Read template file
|
|
165
|
+
cat .codemie/claude-templates/templates/subagents/[template-file]
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Step 2.2.2: Identify Placeholders**
|
|
169
|
+
|
|
170
|
+
Common placeholders to find:
|
|
171
|
+
- `[PROJECT_NAME]` - Project name
|
|
172
|
+
- `[LANGUAGE]` - Programming language
|
|
173
|
+
- `[FRAMEWORK]` - Main framework
|
|
174
|
+
- `[TEST_FRAMEWORK]` - Testing framework
|
|
175
|
+
- `[BUILD_TOOL]` - Build tool (npm, cargo, maven, etc.)
|
|
176
|
+
- `[LINTER]` - Linting tool
|
|
177
|
+
- `[PROJECT_STRUCTURE]` - Directory structure overview
|
|
178
|
+
- `[ARCHITECTURE_PATTERN]` - Main architecture pattern
|
|
179
|
+
- `[code_example]` - Code snippet placeholders
|
|
180
|
+
- `[file.ext:lines]` - File reference placeholders
|
|
181
|
+
- `FILL IN` sections - Areas needing project-specific content
|
|
182
|
+
|
|
183
|
+
**Output**: List of placeholders per template and sections to fill
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
### Phase 3: Subagent Generation (Iterative)
|
|
188
|
+
|
|
189
|
+
**For Each Template** (mark as in_progress, then completed):
|
|
190
|
+
|
|
191
|
+
#### Step 3.1: Gather Template-Specific Information
|
|
192
|
+
|
|
193
|
+
**For Unit Tester Agent**:
|
|
194
|
+
- Testing framework and version
|
|
195
|
+
- Test file locations and naming patterns (e.g., `*.test.ts`, `*_test.go`, `test_*.py`)
|
|
196
|
+
- Mock/fixture patterns used in project
|
|
197
|
+
- Coverage requirements (if documented)
|
|
198
|
+
- Test commands (npm test, pytest, go test, etc.)
|
|
199
|
+
- Example test files (2-3 representative examples)
|
|
200
|
+
- Common testing utilities and helpers
|
|
201
|
+
|
|
202
|
+
**Actions**:
|
|
203
|
+
```bash
|
|
204
|
+
# Find test files and patterns
|
|
205
|
+
find . -name "*.test.ts" -o -name "*_test.go" -o -name "test_*.py"
|
|
206
|
+
# Find test configuration
|
|
207
|
+
grep -r "test" package.json tsconfig.json pytest.ini go.mod
|
|
208
|
+
# Read example test files
|
|
209
|
+
cat [test-file-path] # 2-3 representative examples
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**For Solution Architect Agent**:
|
|
213
|
+
- Project architecture pattern (layered, hexagonal, microservices, etc.)
|
|
214
|
+
- Key directories and their purposes
|
|
215
|
+
- Layer/module dependencies and communication patterns
|
|
216
|
+
- Technology stack summary
|
|
217
|
+
- Integration points (databases, APIs, external services)
|
|
218
|
+
- Configuration management approach
|
|
219
|
+
|
|
220
|
+
**Actions**:
|
|
221
|
+
```bash
|
|
222
|
+
# Map directory structure
|
|
223
|
+
tree -L 2 -d
|
|
224
|
+
# Find architectural patterns
|
|
225
|
+
grep -r "interface\|abstract\|Repository\|Service\|Controller" src/
|
|
226
|
+
# Find integration points
|
|
227
|
+
grep -r "database\|api\|http\|grpc" config/ src/
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**For Code Review Agent**:
|
|
231
|
+
- Code style configuration (.eslintrc, .pylintrc, etc.)
|
|
232
|
+
- Linting rules and enforcement level
|
|
233
|
+
- Formatter configuration (prettier, black, gofmt, etc.)
|
|
234
|
+
- Code review checklist (if in CONTRIBUTING.md)
|
|
235
|
+
- Common code smells documented in project
|
|
236
|
+
- Type safety requirements (TypeScript strict mode, mypy, etc.)
|
|
237
|
+
|
|
238
|
+
**Actions**:
|
|
239
|
+
```bash
|
|
240
|
+
# Find linting configuration
|
|
241
|
+
cat .eslintrc* .pylintrc* .golangci.yml
|
|
242
|
+
# Find formatter configuration
|
|
243
|
+
cat .prettierrc* pyproject.toml .rustfmt.toml
|
|
244
|
+
# Read contribution guidelines
|
|
245
|
+
cat CONTRIBUTING.md | grep -A 10 "review\|style\|lint"
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**🚨 SIZE LIMIT ENFORCEMENT**:
|
|
249
|
+
**Target: 300-500 lines for final agent**
|
|
250
|
+
|
|
251
|
+
Gather information selectively:
|
|
252
|
+
- Focus on **essential patterns only**
|
|
253
|
+
- Collect **1-2 representative examples** per category
|
|
254
|
+
- Prefer **file:line references** over full code listings
|
|
255
|
+
- Use **tables** to summarize multiple patterns compactly
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
#### Step 3.2: Fill Template Placeholders
|
|
260
|
+
|
|
261
|
+
**Step 3.2.1: Replace Generic Placeholders**
|
|
262
|
+
|
|
263
|
+
Replace all standard placeholders with actual values from project analysis:
|
|
264
|
+
- `[PROJECT_NAME]` → Actual project name (from package.json, README, etc.)
|
|
265
|
+
- `[LANGUAGE]` → Detected language(s)
|
|
266
|
+
- `[FRAMEWORK]` → Detected framework(s)
|
|
267
|
+
- `[TEST_FRAMEWORK]` → Detected test framework
|
|
268
|
+
- `[BUILD_TOOL]` → npm, cargo, maven, etc.
|
|
269
|
+
- `[LINTER]` → ESLint, Pylint, etc.
|
|
270
|
+
- `[PROJECT_STRUCTURE]` → Brief directory structure (5-10 lines)
|
|
271
|
+
- `[ARCHITECTURE_PATTERN]` → Identified pattern
|
|
272
|
+
|
|
273
|
+
**Step 3.2.2: Fill Code Examples (KEEP BRIEF)**
|
|
274
|
+
|
|
275
|
+
For each `[code_example]` placeholder:
|
|
276
|
+
- Use **actual code from codebase** (never generic examples)
|
|
277
|
+
- Keep examples **10-20 lines maximum**
|
|
278
|
+
- Add source reference: `// Source: file.ts:23-42`
|
|
279
|
+
- Focus on **pattern demonstration**, not complete implementations
|
|
280
|
+
|
|
281
|
+
**Example**:
|
|
282
|
+
```typescript
|
|
283
|
+
// GOOD: Brief, focused example (15 lines)
|
|
284
|
+
describe('UserService', () => {
|
|
285
|
+
it('should create user with valid data', async () => {
|
|
286
|
+
const mockRepo = { save: vi.fn().mockResolvedValue(user) };
|
|
287
|
+
const service = new UserService(mockRepo);
|
|
288
|
+
|
|
289
|
+
const result = await service.createUser(validData);
|
|
290
|
+
|
|
291
|
+
expect(result).toEqual(user);
|
|
292
|
+
expect(mockRepo.save).toHaveBeenCalledWith(validData);
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
// Source: tests/services/user.test.ts:45-56
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
**Step 3.2.3: Fill "FILL IN" Sections**
|
|
299
|
+
|
|
300
|
+
For sections marked "FILL IN":
|
|
301
|
+
- Add **project-specific content only**
|
|
302
|
+
- Use **tables** for multiple patterns:
|
|
303
|
+
```markdown
|
|
304
|
+
| Pattern | File Location | Key Characteristics |
|
|
305
|
+
|---------|--------------|---------------------|
|
|
306
|
+
| [Pattern1] | file.ts:line | Brief description |
|
|
307
|
+
```
|
|
308
|
+
- Keep explanations **concise** (1-2 sentences max per item)
|
|
309
|
+
- Use **bullet lists** for quick reference
|
|
310
|
+
|
|
311
|
+
**Step 3.2.4: Replace File References**
|
|
312
|
+
|
|
313
|
+
For each `[file.ext:lines]` placeholder:
|
|
314
|
+
- Find **actual relevant files** from codebase analysis
|
|
315
|
+
- Use **real file paths** with line numbers
|
|
316
|
+
- Example: `src/services/user.ts:23-45` instead of `[service.ts:lines]`
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
#### Step 3.3: Create Output Directory
|
|
321
|
+
|
|
322
|
+
**Task**: Ensure output directory exists
|
|
323
|
+
|
|
324
|
+
**Actions**:
|
|
325
|
+
```bash
|
|
326
|
+
# Create directory if it doesn't exist
|
|
327
|
+
mkdir -p .claude/agents
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
**Note**: Only create this directory once, not per agent.
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
#### Step 3.4: Write Generated Subagent File
|
|
335
|
+
|
|
336
|
+
**Task**: Write completed subagent to file
|
|
337
|
+
|
|
338
|
+
**Actions**:
|
|
339
|
+
|
|
340
|
+
**Step 3.4.1: Determine Output Filename**
|
|
341
|
+
|
|
342
|
+
Template filename → Output filename:
|
|
343
|
+
- `code-review-agent-template.md.template` → `code-review-agent.md`
|
|
344
|
+
- `solution-architect-agent.md.template` → `solution-architect-agent.md`
|
|
345
|
+
- `unit-tester-agent.md.template` → `unit-tester-agent.md`
|
|
346
|
+
|
|
347
|
+
**Step 3.4.2: Write File**
|
|
348
|
+
```bash
|
|
349
|
+
# Write completed agent file
|
|
350
|
+
# Save to .claude/agents/[agent-name].md
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
**🚨 MANDATORY SIZE VALIDATION**:
|
|
354
|
+
```bash
|
|
355
|
+
# Count lines immediately after writing
|
|
356
|
+
LINE_COUNT=$(wc -l < .claude/agents/[agent-name].md)
|
|
357
|
+
|
|
358
|
+
# Check if within limit
|
|
359
|
+
if [ $LINE_COUNT -lt 300 ]; then
|
|
360
|
+
echo "⚠️ WARNING: Agent is only $LINE_COUNT lines (minimum: 300)"
|
|
361
|
+
echo "Consider adding more detail or examples"
|
|
362
|
+
elif [ $LINE_COUNT -gt 500 ]; then
|
|
363
|
+
echo "⚠️ ERROR: Agent is $LINE_COUNT lines (maximum: 500)"
|
|
364
|
+
echo "MUST condense before continuing!"
|
|
365
|
+
# STOP and condense the agent
|
|
366
|
+
fi
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
**Validation Checklist**:
|
|
370
|
+
- [ ] **Agent is 300-500 lines** (MANDATORY)
|
|
371
|
+
- [ ] All placeholders replaced with actual values
|
|
372
|
+
- [ ] Code examples are from actual codebase (not generic)
|
|
373
|
+
- [ ] Code examples are brief (10-20 lines max)
|
|
374
|
+
- [ ] File paths are accurate with line numbers
|
|
375
|
+
- [ ] Commands are correct for the project
|
|
376
|
+
- [ ] No "FILL IN" or "[PLACEHOLDER]" remains
|
|
377
|
+
- [ ] Used tables for pattern summaries
|
|
378
|
+
- [ ] ONE representative example per pattern category
|
|
379
|
+
|
|
380
|
+
**If > 500 Lines** (MUST FIX):
|
|
381
|
+
1. Remove redundant code examples (keep only most representative)
|
|
382
|
+
2. Convert multiple examples to a single comprehensive example
|
|
383
|
+
3. Replace code blocks with file:line references
|
|
384
|
+
4. Use tables instead of long prose descriptions
|
|
385
|
+
5. Remove verbose explanations (keep only essential info)
|
|
386
|
+
6. Consolidate similar patterns into single entries
|
|
387
|
+
7. Re-validate line count
|
|
388
|
+
|
|
389
|
+
**If < 300 Lines** (CONSIDER):
|
|
390
|
+
1. Add more pattern examples if relevant
|
|
391
|
+
2. Expand key sections with project-specific details
|
|
392
|
+
3. Add troubleshooting section if missing
|
|
393
|
+
4. Ensure all template sections are filled
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
#### Step 3.5: Mark Todo Complete
|
|
398
|
+
|
|
399
|
+
**Actions**:
|
|
400
|
+
- Mark current agent generation todo as "completed"
|
|
401
|
+
- Move to next template
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
### Phase 4: Validation & Finalization
|
|
406
|
+
|
|
407
|
+
#### Step 4.1: Verify Generated Agents
|
|
408
|
+
|
|
409
|
+
**For Each Generated Agent**:
|
|
410
|
+
|
|
411
|
+
**4.1.1: Check File Existence**
|
|
412
|
+
```bash
|
|
413
|
+
# Verify all agents were created
|
|
414
|
+
ls -lh .claude/agents/
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
**4.1.2: Validate Content Quality**
|
|
418
|
+
- [ ] No placeholder text remains (`[...]`, `FILL IN`)
|
|
419
|
+
- [ ] Code examples are real (not pseudo-code)
|
|
420
|
+
- [ ] File references are accurate (actual files exist)
|
|
421
|
+
- [ ] Commands are correct for project environment
|
|
422
|
+
- [ ] Line count is within 300-500 range
|
|
423
|
+
|
|
424
|
+
**4.1.3: Test Sample Commands (Optional)**
|
|
425
|
+
```bash
|
|
426
|
+
# Try running documented commands to ensure they work
|
|
427
|
+
# Example: npm test (from unit-tester agent)
|
|
428
|
+
# Example: npm run lint (from code-review agent)
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
#### Step 4.2: Generate Summary Report
|
|
434
|
+
|
|
435
|
+
**Task**: Create summary of what was generated
|
|
436
|
+
|
|
437
|
+
**Report Structure**:
|
|
438
|
+
```markdown
|
|
439
|
+
# Subagent Generation Complete
|
|
440
|
+
|
|
441
|
+
## Generated Agents ([N] agents)
|
|
442
|
+
|
|
443
|
+
- ✅ .claude/agents/unit-tester-agent.md ([X] lines)
|
|
444
|
+
- ✅ .claude/agents/solution-architect-agent.md ([Y] lines)
|
|
445
|
+
- ✅ .claude/agents/code-review-agent.md ([Z] lines)
|
|
446
|
+
|
|
447
|
+
## Project Analysis Summary
|
|
448
|
+
|
|
449
|
+
**Technology Stack**:
|
|
450
|
+
- Language: [Language]
|
|
451
|
+
- Framework: [Framework]
|
|
452
|
+
- Testing: [Test Framework]
|
|
453
|
+
- Build Tool: [Build Tool]
|
|
454
|
+
- Linter: [Linter]
|
|
455
|
+
|
|
456
|
+
**Architecture Pattern**: [Pattern]
|
|
457
|
+
|
|
458
|
+
**Key Directories**:
|
|
459
|
+
- [dir1/] - [purpose]
|
|
460
|
+
- [dir2/] - [purpose]
|
|
461
|
+
- [dir3/] - [purpose]
|
|
462
|
+
|
|
463
|
+
## Subagent Capabilities
|
|
464
|
+
|
|
465
|
+
**Unit Tester Agent**:
|
|
466
|
+
- Specialized for [Test Framework]
|
|
467
|
+
- Knows project test patterns in [test-dir/]
|
|
468
|
+
- Configured for [specific testing approach]
|
|
469
|
+
|
|
470
|
+
**Solution Architect Agent**:
|
|
471
|
+
- Understands [Architecture Pattern]
|
|
472
|
+
- Knows layer structure and dependencies
|
|
473
|
+
- Tailored for [Project Type] architecture
|
|
474
|
+
|
|
475
|
+
**Code Review Agent**:
|
|
476
|
+
- Enforces [Linter] rules
|
|
477
|
+
- Knows project code standards
|
|
478
|
+
- Checks [specific quality requirements]
|
|
479
|
+
|
|
480
|
+
## Next Steps
|
|
481
|
+
|
|
482
|
+
1. Review generated agents for accuracy
|
|
483
|
+
2. Customize any project-specific sections if needed
|
|
484
|
+
3. Use agents via Claude Code for specialized tasks:
|
|
485
|
+
- "Write tests for [component]" → Uses unit-tester agent
|
|
486
|
+
- "Design architecture for [feature]" → Uses solution-architect agent
|
|
487
|
+
- "Review code in [file]" → Uses code-review agent
|
|
488
|
+
|
|
489
|
+
## How to Use
|
|
490
|
+
|
|
491
|
+
These agents are automatically available to Claude Code in this project.
|
|
492
|
+
Claude Code will select the appropriate agent based on your task.
|
|
493
|
+
|
|
494
|
+
You can also explicitly request an agent:
|
|
495
|
+
- "Use the unit-tester agent to write tests for authentication"
|
|
496
|
+
- "Use the solution-architect agent to plan the new feature"
|
|
497
|
+
- "Use the code-review agent to check this PR"
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
502
|
+
## Decision Gates Throughout Process
|
|
503
|
+
|
|
504
|
+
### Gate 1: After Template Discovery (Step 1.1)
|
|
505
|
+
**Question**: Did I find at least 1 template file?
|
|
506
|
+
- ✅ YES → Continue to project analysis
|
|
507
|
+
- ❌ NO → Report error (check template directory path)
|
|
508
|
+
|
|
509
|
+
### Gate 2: After Project Analysis (Step 1.3)
|
|
510
|
+
**Question**: Do I have enough information about the project?
|
|
511
|
+
- ✅ 80%+ confidence → Continue to generation
|
|
512
|
+
- ❌ < 80% confidence → Ask user for clarification
|
|
513
|
+
|
|
514
|
+
### Gate 3: After Each Agent Generation (Step 3.4)
|
|
515
|
+
**Question**: Is the agent within size limits (300-500 lines)?
|
|
516
|
+
- ✅ YES → Mark complete, move to next
|
|
517
|
+
- ❌ NO → Condense (if > 500) or expand (if < 300)
|
|
518
|
+
|
|
519
|
+
### Gate 4: After All Agents Generated (Step 4.1)
|
|
520
|
+
**Question**: Are all agents complete and valid?
|
|
521
|
+
- ✅ YES → Generate summary report and finish
|
|
522
|
+
- ❌ NO → Fix issues and re-validate
|
|
523
|
+
|
|
524
|
+
---
|
|
525
|
+
|
|
526
|
+
## Troubleshooting
|
|
527
|
+
|
|
528
|
+
### Issue: Template Directory Not Found
|
|
529
|
+
|
|
530
|
+
**Symptoms**: Cannot find `.codemie/claude-templates/templates/subagents/`
|
|
531
|
+
**Action**:
|
|
532
|
+
1. Check if templates are in alternate location
|
|
533
|
+
2. Ask user for correct template path
|
|
534
|
+
3. Verify project has been set up with codemie-init first
|
|
535
|
+
|
|
536
|
+
### Issue: Cannot Determine Project Language/Framework
|
|
537
|
+
|
|
538
|
+
**Symptoms**: Unclear tech stack from project files
|
|
539
|
+
**Action**:
|
|
540
|
+
1. Ask user: "What language and framework does your project use?"
|
|
541
|
+
2. Look for alternate configuration files
|
|
542
|
+
3. Check README.md for explicit mention
|
|
543
|
+
|
|
544
|
+
### Issue: No Test Files Found
|
|
545
|
+
|
|
546
|
+
**Symptoms**: Cannot find tests for unit-tester agent
|
|
547
|
+
**Action**:
|
|
548
|
+
1. Check alternate test directory names (test/, __tests__/, spec/)
|
|
549
|
+
2. Check alternate file patterns (*.spec.ts, *.test.js)
|
|
550
|
+
3. Ask user where tests are located
|
|
551
|
+
4. If no tests exist, note in agent that tests should be created
|
|
552
|
+
|
|
553
|
+
### Issue: Generated Agent Too Large (> 500 Lines)
|
|
554
|
+
|
|
555
|
+
**Symptoms**: Line count exceeds limit
|
|
556
|
+
**Action**:
|
|
557
|
+
1. Remove redundant code examples (keep most representative)
|
|
558
|
+
2. Replace code blocks with file:line references
|
|
559
|
+
3. Use tables instead of prose for pattern lists
|
|
560
|
+
4. Consolidate similar patterns
|
|
561
|
+
5. Remove verbose explanations
|
|
562
|
+
|
|
563
|
+
### Issue: Generated Agent Too Small (< 300 Lines)
|
|
564
|
+
|
|
565
|
+
**Symptoms**: Line count below minimum
|
|
566
|
+
**Action**:
|
|
567
|
+
1. Check if all template sections were filled
|
|
568
|
+
2. Add more representative examples if relevant
|
|
569
|
+
3. Expand troubleshooting or pattern sections
|
|
570
|
+
4. Add project-specific details from analysis
|
|
571
|
+
|
|
572
|
+
---
|
|
573
|
+
|
|
574
|
+
## Success Criteria
|
|
575
|
+
|
|
576
|
+
Subagent generation is complete when:
|
|
577
|
+
- ✅ All template files processed
|
|
578
|
+
- ✅ All agents generated in `.claude/agents/`
|
|
579
|
+
- ✅ All agents are 300-500 lines
|
|
580
|
+
- ✅ All code examples are from actual codebase
|
|
581
|
+
- ✅ All file references are accurate
|
|
582
|
+
- ✅ All commands are correct
|
|
583
|
+
- ✅ No placeholders or "FILL IN" text remains
|
|
584
|
+
- ✅ Agents are project-specific (not generic)
|
|
585
|
+
- ✅ Summary report generated
|
|
586
|
+
|
|
587
|
+
---
|
|
588
|
+
|
|
589
|
+
## Example Invocation
|
|
590
|
+
|
|
591
|
+
**User**: "Generate subagents for my TypeScript project"
|
|
592
|
+
|
|
593
|
+
**Claude Code**:
|
|
594
|
+
1. Discovers 3 templates (unit-tester, solution-architect, code-review)
|
|
595
|
+
2. Analyzes project (finds TypeScript, Vitest, ESLint, layered architecture)
|
|
596
|
+
3. Creates todo list with 3 agent generation tasks
|
|
597
|
+
4. Generates unit-tester agent (uses actual test examples from tests/)
|
|
598
|
+
5. Generates solution-architect agent (uses actual architecture from src/)
|
|
599
|
+
6. Generates code-review agent (uses actual ESLint config)
|
|
600
|
+
7. Validates all agents (sizes OK, no placeholders)
|
|
601
|
+
8. Presents summary report with capabilities
|
|
602
|
+
|
|
603
|
+
**Result**: project-specific subagent files ready to use in `.claude/agents/`.
|
|
604
|
+
IMPORTANT: put agents into ".claude/agents" folder.
|
|
605
|
+
|
|
606
|
+
---
|
|
607
|
+
|
|
608
|
+
## Notes
|
|
609
|
+
|
|
610
|
+
- **Time Estimate**: 5-15 minutes depending on project size
|
|
611
|
+
- **Token Usage**: Medium - reading templates and codebase samples
|
|
612
|
+
- **User Interaction**: 0-1 confirmation points (only if unclear project structure)
|
|
613
|
+
- **Customization**: Output should be 90% ready, 10% may need refinement
|
|
614
|
+
- **Updates**: Re-run command when project patterns change significantly
|
|
615
|
+
|
|
616
|
+
---
|
package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude.conversations-processor.d.ts","sourceRoot":"","sources":["../../../../../../src/agents/plugins/claude/session/processors/claude.conversations-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AACvH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAKpF,qBAAa,sBAAuB,YAAW,gBAAgB;IAC7D,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,QAAQ,KAAK;IAEtB,OAAO,CAAC,YAAY,CAAsB;IAE1C;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAY3B,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAIxC,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAa5F;;;;OAIG;YACW,eAAe;YAuGf,iBAAiB;YA0LjB,aAAa;IA0O3B,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,eAAe;IAqBvB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,UAAU;IA0BlB,OAAO,CAAC,mBAAmB;IAuC3B,OAAO,CAAC,kBAAkB;IA4B1B,OAAO,CAAC,kBAAkB;IAsB1B,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,oBAAoB;YA0Bd,sBAAsB;YAqCtB,cAAc;
|
|
1
|
+
{"version":3,"file":"claude.conversations-processor.d.ts","sourceRoot":"","sources":["../../../../../../src/agents/plugins/claude/session/processors/claude.conversations-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AACvH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAKpF,qBAAa,sBAAuB,YAAW,gBAAgB;IAC7D,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,QAAQ,KAAK;IAEtB,OAAO,CAAC,YAAY,CAAsB;IAE1C;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAY3B,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAIxC,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAa5F;;;;OAIG;YACW,eAAe;YAuGf,iBAAiB;YA0LjB,aAAa;IA0O3B,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,eAAe;IAqBvB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,UAAU;IA0BlB,OAAO,CAAC,mBAAmB;IAuC3B,OAAO,CAAC,kBAAkB;IA4B1B,OAAO,CAAC,kBAAkB;IAsB1B,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,oBAAoB;YA0Bd,sBAAsB;YAqCtB,cAAc;IA0J5B,OAAO,CAAC,kBAAkB;IAsB1B,OAAO,CAAC,iBAAiB;CAuB1B"}
|