@codemieai/code 0.0.33 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -7
- package/bin/codemie-claude-acp.js +21 -0
- package/bin/codemie-opencode.js +11 -0
- package/bin/codemie.js +13 -0
- package/dist/agents/codemie-code/agent.d.ts +38 -4
- package/dist/agents/codemie-code/agent.d.ts.map +1 -1
- package/dist/agents/codemie-code/agent.js +333 -178
- package/dist/agents/codemie-code/agent.js.map +1 -1
- package/dist/agents/codemie-code/index.d.ts +2 -1
- package/dist/agents/codemie-code/index.d.ts.map +1 -1
- package/dist/agents/codemie-code/index.js +36 -7
- package/dist/agents/codemie-code/index.js.map +1 -1
- package/dist/agents/codemie-code/prompts.d.ts +12 -5
- package/dist/agents/codemie-code/prompts.d.ts.map +1 -1
- package/dist/agents/codemie-code/prompts.js +53 -6
- package/dist/agents/codemie-code/prompts.js.map +1 -1
- package/dist/agents/codemie-code/toolMetadata.d.ts.map +1 -1
- package/dist/agents/codemie-code/toolMetadata.js +9 -8
- package/dist/agents/codemie-code/toolMetadata.js.map +1 -1
- package/dist/agents/codemie-code/tools/assistant-invocation.d.ts +47 -0
- package/dist/agents/codemie-code/tools/assistant-invocation.d.ts.map +1 -0
- package/dist/agents/codemie-code/tools/assistant-invocation.js +129 -0
- package/dist/agents/codemie-code/tools/assistant-invocation.js.map +1 -0
- package/dist/agents/codemie-code/tools/index.d.ts +70 -4
- package/dist/agents/codemie-code/tools/index.d.ts.map +1 -1
- package/dist/agents/codemie-code/tools/index.js +57 -44
- package/dist/agents/codemie-code/tools/index.js.map +1 -1
- package/dist/agents/codemie-code/tools/planning.d.ts +6 -5
- package/dist/agents/codemie-code/tools/planning.d.ts.map +1 -1
- package/dist/agents/codemie-code/tools/planning.js +12 -10
- package/dist/agents/codemie-code/tools/planning.js.map +1 -1
- package/dist/agents/codemie-code/types.d.ts +27 -3
- package/dist/agents/codemie-code/types.d.ts.map +1 -1
- package/dist/agents/codemie-code/types.js +24 -0
- package/dist/agents/codemie-code/types.js.map +1 -1
- package/dist/agents/codemie-code/ui/autocomplete.d.ts +98 -0
- package/dist/agents/codemie-code/ui/autocomplete.d.ts.map +1 -0
- package/dist/agents/codemie-code/ui/autocomplete.js +145 -0
- package/dist/agents/codemie-code/ui/autocomplete.js.map +1 -0
- package/dist/agents/codemie-code/ui/keyHandlers.d.ts +112 -0
- package/dist/agents/codemie-code/ui/keyHandlers.d.ts.map +1 -0
- package/dist/agents/codemie-code/ui/keyHandlers.js +415 -0
- package/dist/agents/codemie-code/ui/keyHandlers.js.map +1 -0
- package/dist/agents/codemie-code/ui/mentions.d.ts +86 -0
- package/dist/agents/codemie-code/ui/mentions.d.ts.map +1 -0
- package/dist/agents/codemie-code/ui/mentions.js +122 -0
- package/dist/agents/codemie-code/ui/mentions.js.map +1 -0
- package/dist/agents/codemie-code/ui/terminalCodes.d.ts +38 -0
- package/dist/agents/codemie-code/ui/terminalCodes.d.ts.map +1 -0
- package/dist/agents/codemie-code/ui/terminalCodes.js +42 -0
- package/dist/agents/codemie-code/ui/terminalCodes.js.map +1 -0
- package/dist/agents/codemie-code/ui/todoPanel.d.ts.map +1 -1
- package/dist/agents/codemie-code/ui/todoPanel.js +3 -4
- package/dist/agents/codemie-code/ui/todoPanel.js.map +1 -1
- package/dist/agents/codemie-code/ui.d.ts +8 -7
- package/dist/agents/codemie-code/ui.d.ts.map +1 -1
- package/dist/agents/codemie-code/ui.js +87 -145
- package/dist/agents/codemie-code/ui.js.map +1 -1
- package/dist/agents/core/AgentCLI.d.ts +5 -0
- package/dist/agents/core/AgentCLI.d.ts.map +1 -1
- package/dist/agents/core/AgentCLI.js +25 -1
- package/dist/agents/core/AgentCLI.js.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +90 -27
- package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
- package/dist/agents/core/extension/BaseExtensionInstaller.d.ts +7 -1
- package/dist/agents/core/extension/BaseExtensionInstaller.d.ts.map +1 -1
- package/dist/agents/core/extension/BaseExtensionInstaller.js +58 -15
- package/dist/agents/core/extension/BaseExtensionInstaller.js.map +1 -1
- package/dist/agents/core/session/BaseSessionAdapter.d.ts +25 -0
- package/dist/agents/core/session/BaseSessionAdapter.d.ts.map +1 -1
- package/dist/agents/core/session/discovery-types.d.ts +53 -0
- package/dist/agents/core/session/discovery-types.d.ts.map +1 -0
- package/dist/agents/core/session/discovery-types.js +8 -0
- package/dist/agents/core/session/discovery-types.js.map +1 -0
- package/dist/agents/core/types.d.ts +62 -0
- package/dist/agents/core/types.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude-acp.plugin.d.ts +27 -0
- package/dist/agents/plugins/claude/claude-acp.plugin.d.ts.map +1 -0
- package/dist/agents/plugins/claude/claude-acp.plugin.js +63 -0
- package/dist/agents/plugins/claude/claude-acp.plugin.js.map +1 -0
- package/dist/agents/plugins/claude/claude-message-types.d.ts +1 -0
- package/dist/agents/plugins/claude/claude-message-types.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts +44 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +263 -12
- package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
- package/dist/agents/plugins/claude/claude.session.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.session.js +14 -7
- package/dist/agents/plugins/claude/claude.session.js.map +1 -1
- package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/agents/plugins/claude/plugin/README.md +40 -2
- package/dist/agents/plugins/claude/plugin/claude-templates/README.md +5 -5
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/CLAUDE.md.template +177 -436
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/code-review-agent-template.md.template +49 -82
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/refactor-cleaner-agent.md.template +337 -0
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/solution-architect-agent.md.template +129 -419
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/unit-tester-agent.md.template +146 -693
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/api/api-patterns.md.template +110 -138
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/architecture.md.template +197 -0
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/data/database-patterns.md.template +171 -91
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/development/development-practices.md.template +219 -131
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/security/security-practices.md.template +223 -98
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/standards/code-quality.md.template +131 -95
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/testing/testing-patterns.md.template +247 -75
- package/dist/agents/plugins/claude/plugin/commands/README.md +133 -0
- package/dist/agents/plugins/claude/plugin/commands/codemie-init.md +336 -544
- package/dist/agents/plugins/claude/plugin/commands/codemie-subagents.md +233 -504
- package/dist/agents/plugins/claude/plugin/commands/memory-add.md +311 -30
- package/dist/agents/plugins/claude/plugin/commands/memory-refresh.md +218 -39
- 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 +43 -8
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js +68 -40
- package/dist/agents/plugins/claude/session/processors/claude.metrics-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 +0 -3
- package/dist/agents/plugins/gemini/gemini.plugin.js.map +1 -1
- package/dist/agents/plugins/opencode/index.d.ts +8 -0
- package/dist/agents/plugins/opencode/index.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/index.js +12 -0
- package/dist/agents/plugins/opencode/index.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode-message-types.d.ts +207 -0
- package/dist/agents/plugins/opencode/opencode-message-types.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode-message-types.js +59 -0
- package/dist/agents/plugins/opencode/opencode-message-types.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.d.ts +65 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.js +184 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.paths.d.ts +62 -0
- package/dist/agents/plugins/opencode/opencode.paths.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.paths.js +148 -0
- package/dist/agents/plugins/opencode/opencode.paths.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.plugin.d.ts +35 -0
- package/dist/agents/plugins/opencode/opencode.plugin.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.plugin.js +338 -0
- package/dist/agents/plugins/opencode/opencode.plugin.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.session.d.ts +77 -0
- package/dist/agents/plugins/opencode/opencode.session.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.session.js +424 -0
- package/dist/agents/plugins/opencode/opencode.session.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts +25 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.js +96 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.js.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts +30 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js +116 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts +102 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js +584 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js.map +1 -0
- package/dist/agents/registry.d.ts +1 -1
- package/dist/agents/registry.d.ts.map +1 -1
- package/dist/agents/registry.js +5 -1
- package/dist/agents/registry.js.map +1 -1
- package/dist/cli/commands/assistants/chat.d.ts +11 -0
- package/dist/cli/commands/assistants/chat.d.ts.map +1 -0
- package/dist/cli/commands/assistants/chat.js +201 -0
- package/dist/cli/commands/assistants/chat.js.map +1 -0
- package/dist/cli/commands/assistants/constants.d.ts +81 -0
- package/dist/cli/commands/assistants/constants.d.ts.map +1 -0
- package/dist/cli/commands/assistants/constants.js +75 -0
- package/dist/cli/commands/assistants/constants.js.map +1 -0
- package/dist/cli/commands/assistants/generators/claude-agent-generator.d.ts +26 -0
- package/dist/cli/commands/assistants/generators/claude-agent-generator.d.ts.map +1 -0
- package/dist/cli/commands/assistants/generators/claude-agent-generator.js +115 -0
- package/dist/cli/commands/assistants/generators/claude-agent-generator.js.map +1 -0
- package/dist/cli/commands/assistants/index.d.ts +11 -0
- package/dist/cli/commands/assistants/index.d.ts.map +1 -0
- package/dist/cli/commands/assistants/index.js +28 -0
- package/dist/cli/commands/assistants/index.js.map +1 -0
- package/dist/cli/commands/assistants/list.d.ts +11 -0
- package/dist/cli/commands/assistants/list.d.ts.map +1 -0
- package/dist/cli/commands/assistants/list.js +323 -0
- package/dist/cli/commands/assistants/list.js.map +1 -0
- package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts +5 -0
- package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts.map +1 -1
- package/dist/cli/commands/doctor/checks/AgentsCheck.js +29 -0
- package/dist/cli/commands/doctor/checks/AgentsCheck.js.map +1 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +104 -13
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/opencode-metrics.d.ts +13 -0
- package/dist/cli/commands/opencode-metrics.d.ts.map +1 -0
- package/dist/cli/commands/opencode-metrics.js +200 -0
- package/dist/cli/commands/opencode-metrics.js.map +1 -0
- package/dist/cli/commands/self-update.d.ts +3 -0
- package/dist/cli/commands/self-update.d.ts.map +1 -0
- package/dist/cli/commands/self-update.js +55 -0
- package/dist/cli/commands/self-update.js.map +1 -0
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +113 -0
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/skill.d.ts +6 -0
- package/dist/cli/commands/skill.d.ts.map +1 -0
- package/dist/cli/commands/skill.js +196 -0
- package/dist/cli/commands/skill.js.map +1 -0
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +34 -6
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +12 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/env/types.d.ts +13 -0
- package/dist/env/types.d.ts.map +1 -1
- package/dist/env/types.js +1 -1
- package/dist/env/types.js.map +1 -1
- package/dist/migrations/003-remove-hooks-node.migration.d.ts +22 -0
- package/dist/migrations/003-remove-hooks-node.migration.d.ts.map +1 -0
- package/dist/migrations/003-remove-hooks-node.migration.js +103 -0
- package/dist/migrations/003-remove-hooks-node.migration.js.map +1 -0
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +1 -1
- package/dist/migrations/index.js.map +1 -1
- package/dist/providers/plugins/sso/sso.http-client.js +2 -2
- package/dist/providers/plugins/sso/sso.http-client.js.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.js +14 -10
- package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
- package/dist/skills/core/SkillDiscovery.d.ts +83 -0
- package/dist/skills/core/SkillDiscovery.d.ts.map +1 -0
- package/dist/skills/core/SkillDiscovery.js +237 -0
- package/dist/skills/core/SkillDiscovery.js.map +1 -0
- package/dist/skills/core/SkillManager.d.ts +86 -0
- package/dist/skills/core/SkillManager.d.ts.map +1 -0
- package/dist/skills/core/SkillManager.js +155 -0
- package/dist/skills/core/SkillManager.js.map +1 -0
- package/dist/skills/core/types.d.ts +120 -0
- package/dist/skills/core/types.d.ts.map +1 -0
- package/dist/skills/core/types.js +20 -0
- package/dist/skills/core/types.js.map +1 -0
- package/dist/skills/index.d.ts +12 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +12 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/utils/content-loader.d.ts +25 -0
- package/dist/skills/utils/content-loader.d.ts.map +1 -0
- package/dist/skills/utils/content-loader.js +161 -0
- package/dist/skills/utils/content-loader.js.map +1 -0
- package/dist/skills/utils/frontmatter.d.ts +60 -0
- package/dist/skills/utils/frontmatter.d.ts.map +1 -0
- package/dist/skills/utils/frontmatter.js +114 -0
- package/dist/skills/utils/frontmatter.js.map +1 -0
- package/dist/skills/utils/pattern-matcher.d.ts +60 -0
- package/dist/skills/utils/pattern-matcher.d.ts.map +1 -0
- package/dist/skills/utils/pattern-matcher.js +97 -0
- package/dist/skills/utils/pattern-matcher.js.map +1 -0
- package/dist/utils/auth.d.ts +22 -0
- package/dist/utils/auth.d.ts.map +1 -0
- package/dist/utils/auth.js +50 -0
- package/dist/utils/auth.js.map +1 -0
- package/dist/utils/cli-updater.d.ts +70 -0
- package/dist/utils/cli-updater.d.ts.map +1 -0
- package/dist/utils/cli-updater.js +339 -0
- package/dist/utils/cli-updater.js.map +1 -0
- package/dist/utils/config.d.ts +6 -1
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +13 -0
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/installation-detector.d.ts +22 -0
- package/dist/utils/installation-detector.d.ts.map +1 -0
- package/dist/utils/installation-detector.js +49 -0
- package/dist/utils/installation-detector.js.map +1 -0
- package/dist/utils/native-installer.d.ts +49 -0
- package/dist/utils/native-installer.d.ts.map +1 -0
- package/dist/utils/native-installer.js +225 -0
- package/dist/utils/native-installer.js.map +1 -0
- package/dist/utils/processes.js +1 -1
- package/dist/utils/profile.d.ts +2 -0
- package/dist/utils/profile.d.ts.map +1 -1
- package/dist/utils/profile.js +5 -0
- package/dist/utils/profile.js.map +1 -1
- package/dist/utils/sdk-client.d.ts +15 -0
- package/dist/utils/sdk-client.d.ts.map +1 -0
- package/dist/utils/sdk-client.js +92 -0
- package/dist/utils/sdk-client.js.map +1 -0
- package/dist/utils/version-utils.d.ts +50 -0
- package/dist/utils/version-utils.d.ts.map +1 -0
- package/dist/utils/version-utils.js +92 -0
- package/dist/utils/version-utils.js.map +1 -0
- package/package.json +11 -3
- package/scripts/copy-mr-skill-to-global.ts +252 -0
- package/scripts/demo-hooks.sh +125 -0
- package/scripts/test-hooks.sh +196 -0
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/INDEX.md +0 -205
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/TEMPLATE_SIZES.md +0 -74
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/layered-architecture.md.template +0 -143
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/project-structure.md.template +0 -127
- package/dist/agents/plugins/claude/plugin/commands/codemie-pr.md +0 -25
|
@@ -1,616 +1,345 @@
|
|
|
1
1
|
# Codemie Subagents - Generate Project-Specific Subagent Files
|
|
2
2
|
|
|
3
3
|
**Command Name**: `codemie-subagents`
|
|
4
|
-
**Description**: Generate project-specific subagent files from templates
|
|
5
|
-
**
|
|
6
|
-
**Complexity**: Medium-High
|
|
4
|
+
**Description**: Generate project-specific subagent files from templates by analyzing codebase and existing guides
|
|
5
|
+
**Output**: AI-optimized subagent definitions in `.claude/agents/`
|
|
7
6
|
|
|
8
7
|
---
|
|
8
|
+
## Additional user's input
|
|
9
|
+
Additional context/input from user: $ARGUMENTS. Might be empty by default.
|
|
9
10
|
|
|
10
11
|
## Purpose
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
- Unit Tester Agent -
|
|
14
|
-
- Solution Architect Agent -
|
|
15
|
-
- Code Review Agent -
|
|
16
|
-
|
|
17
|
-
Generated agents are placed in `.claude/agents/` directory for immediate use by Claude Code.
|
|
13
|
+
Analyze project and generate tailored subagent files:
|
|
14
|
+
- **Unit Tester Agent** - Project's testing patterns and framework
|
|
15
|
+
- **Solution Architect Agent** - Project's architecture and conventions
|
|
16
|
+
- **Code Review Agent** - Project's code standards and linting rules
|
|
17
|
+
- **Refactor Cleaner Agent** - Project's cleanup tools and critical paths
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
21
|
## Prerequisites
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
- [ ]
|
|
25
|
-
- [ ]
|
|
26
|
-
- [ ] Codemie templates are available at `.codemie/claude-templates/templates/agents/`
|
|
23
|
+
- [ ] Project is accessible
|
|
24
|
+
- [ ] Templates exist at `.codemie/claude-templates/templates/agents/`
|
|
25
|
+
- [ ] (Optional) Backup existing `.claude/agents/` if updating agents
|
|
27
26
|
|
|
28
|
-
**Note**:
|
|
27
|
+
**Safety Note**: If existing agents are found, original content will be preserved during updates. However, creating a backup before running this command is recommended for recovery purposes.
|
|
29
28
|
|
|
30
29
|
---
|
|
31
30
|
|
|
32
|
-
## 🚨
|
|
33
|
-
|
|
34
|
-
**MANDATORY**: Each generated subagent must be **300-500 lines maximum**.
|
|
35
|
-
|
|
36
|
-
### Enforcement Strategy
|
|
31
|
+
## 🚨 SIZE LIMITS
|
|
37
32
|
|
|
38
|
-
**
|
|
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
|
|
33
|
+
**Each generated subagent: 150-300 lines maximum**
|
|
48
34
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
35
|
+
| ✅ Do | ❌ Don't |
|
|
36
|
+
|-------|---------|
|
|
37
|
+
| Brief examples (10-15 lines) | Extensive code blocks |
|
|
38
|
+
| Tables for patterns | Long prose explanations |
|
|
39
|
+
| File:line references | Full code listings |
|
|
40
|
+
| One example per pattern | Multiple variations |
|
|
55
41
|
|
|
56
42
|
---
|
|
57
43
|
|
|
58
|
-
## Execution
|
|
59
|
-
|
|
60
|
-
### Phase 1: Template Discovery & Project Analysis
|
|
44
|
+
## Execution
|
|
61
45
|
|
|
62
|
-
|
|
46
|
+
### Phase 1: Discovery
|
|
63
47
|
|
|
64
|
-
|
|
48
|
+
#### Step 1.1: Find Templates
|
|
65
49
|
|
|
66
|
-
**Actions**:
|
|
67
50
|
```bash
|
|
68
|
-
|
|
69
|
-
ls .codemie/claude-templates/templates/subagents/
|
|
51
|
+
ls .codemie/claude-templates/templates/agents/
|
|
70
52
|
```
|
|
71
53
|
|
|
72
|
-
|
|
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
|
|
54
|
+
Expected: `code-review-agent-template.md`, `solution-architect-agent.md`, `unit-tester-agent.md`, `refactor-cleaner-agent.md`
|
|
76
55
|
|
|
77
|
-
|
|
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)
|
|
56
|
+
If no templates found → Report error and stop.
|
|
82
57
|
|
|
83
58
|
---
|
|
84
59
|
|
|
85
|
-
#### Step 1.
|
|
86
|
-
|
|
87
|
-
**Task**: Understand project organization, tech stack, and patterns
|
|
60
|
+
#### Step 1.1b: Check Existing Agents
|
|
88
61
|
|
|
89
|
-
**Actions**:
|
|
90
62
|
```bash
|
|
91
|
-
|
|
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.)
|
|
63
|
+
ls .claude/agents/ 2>/dev/null
|
|
98
64
|
```
|
|
99
65
|
|
|
100
|
-
**
|
|
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
|
|
66
|
+
**Purpose**: Identify existing agents to update rather than recreate
|
|
114
67
|
|
|
115
|
-
**
|
|
68
|
+
**Agent Name Variations to Match**:
|
|
69
|
+
| Template | Possible Existing Names |
|
|
70
|
+
|----------|------------------------|
|
|
71
|
+
| unit-tester-agent.md | unit-tester.md, tester.md, unit-test-agent.md, test-agent.md |
|
|
72
|
+
| solution-architect-agent.md | solution-architect.md, architect.md, architecture-agent.md |
|
|
73
|
+
| code-review-agent.md | code-review.md, reviewer.md, review-agent.md, code-reviewer.md |
|
|
74
|
+
| refactor-cleaner-agent.md | refactor-cleaner.md, refactor.md, cleaner.md, cleanup-agent.md |
|
|
116
75
|
|
|
117
|
-
**
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
-
|
|
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
|
-
```
|
|
76
|
+
**Match Logic**:
|
|
77
|
+
- Exact match (e.g., `solution-architect-agent.md`)
|
|
78
|
+
- Partial match (e.g., `architect.md` matches solution-architect template)
|
|
79
|
+
- Keyword match (e.g., `tester.md` matches unit-tester template)
|
|
126
80
|
|
|
127
|
-
**
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
- Architecture decisions
|
|
132
|
-
- Common patterns and anti-patterns
|
|
81
|
+
**Record Results**:
|
|
82
|
+
- List all existing agents found
|
|
83
|
+
- Map each to corresponding template (if match found)
|
|
84
|
+
- Note unmatched agents (leave unchanged)
|
|
133
85
|
|
|
134
86
|
---
|
|
135
87
|
|
|
136
|
-
|
|
88
|
+
#### Step 1.2: Read Project Context (PRIORITY ORDER)
|
|
137
89
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
|
90
|
+
**First**: Check `.codemie/guides/` folder
|
|
91
|
+
```bash
|
|
92
|
+
# If exists, read ALL guides first - this is the primary source
|
|
93
|
+
ls .codemie/guides/ 2>/dev/null && cat .codemie/guides/*.md
|
|
150
94
|
```
|
|
151
95
|
|
|
152
|
-
**
|
|
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**
|
|
96
|
+
**Second**: Read standard documentation
|
|
163
97
|
```bash
|
|
164
|
-
|
|
165
|
-
cat .codemie/claude-templates/templates/subagents/[template-file]
|
|
98
|
+
cat README.md CONTRIBUTING.md ARCHITECTURE.md CLAUDE.md 2>/dev/null
|
|
166
99
|
```
|
|
167
100
|
|
|
168
|
-
**
|
|
101
|
+
**Third**: Analyze codebase for missing information
|
|
102
|
+
- Package files (package.json, pyproject.toml, pom.xml, go.mod)
|
|
103
|
+
- Config files (tsconfig.json, .eslintrc, pytest.ini)
|
|
104
|
+
- Directory structure
|
|
105
|
+
- Sample source and test files
|
|
169
106
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
|
107
|
+
**Extract**:
|
|
108
|
+
| Item | Source Priority |
|
|
109
|
+
|------|-----------------|
|
|
110
|
+
| Architecture pattern | guides/ → ARCHITECTURE.md → directory structure |
|
|
111
|
+
| Code conventions | guides/ → CONTRIBUTING.md → linter configs |
|
|
112
|
+
| Testing patterns | guides/ → test files → package.json |
|
|
113
|
+
| Critical paths | guides/ → core business logic analysis |
|
|
184
114
|
|
|
185
115
|
---
|
|
186
116
|
|
|
187
|
-
### Phase
|
|
117
|
+
### Phase 2: Generate or Update Each Agent
|
|
188
118
|
|
|
189
|
-
|
|
119
|
+
For each template, create a todo item and process:
|
|
190
120
|
|
|
191
|
-
#### Step
|
|
121
|
+
#### Step 2.0: Determine Action (Create vs Update)
|
|
192
122
|
|
|
193
|
-
**For
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
-
|
|
197
|
-
-
|
|
198
|
-
- Test commands (npm test, pytest, go test, etc.)
|
|
199
|
-
- Example test files (2-3 representative examples)
|
|
200
|
-
- Common testing utilities and helpers
|
|
123
|
+
**For each template**:
|
|
124
|
+
1. Check if matching existing agent was found in Step 1.1b
|
|
125
|
+
2. Decide action:
|
|
126
|
+
- **UPDATE**: Existing agent found → Review and adjust existing file
|
|
127
|
+
- **CREATE**: No existing agent → Generate from template
|
|
201
128
|
|
|
202
|
-
**
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
# Read example test files
|
|
209
|
-
cat [test-file-path] # 2-3 representative examples
|
|
210
|
-
```
|
|
129
|
+
**Update Priority**:
|
|
130
|
+
- If existing agent is outdated (missing project info, has placeholders) → UPDATE
|
|
131
|
+
- If existing agent is custom/non-template based → ASK USER before updating
|
|
132
|
+
- If uncertain → ASK USER: "Found existing [agent-name]. Update it or create new?"
|
|
133
|
+
|
|
134
|
+
---
|
|
211
135
|
|
|
212
|
-
|
|
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
|
|
136
|
+
#### Step 2.1: Load Template or Existing Agent
|
|
219
137
|
|
|
220
|
-
**
|
|
138
|
+
**If CREATE (no existing agent)**:
|
|
221
139
|
```bash
|
|
222
|
-
|
|
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/
|
|
140
|
+
cat .codemie/claude-templates/templates/agents/[template-file]
|
|
228
141
|
```
|
|
229
142
|
|
|
230
|
-
|
|
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.)
|
|
143
|
+
Identify all `[PLACEHOLDERS]` and `[GENERATION INSTRUCTION]` blocks.
|
|
237
144
|
|
|
238
|
-
**
|
|
145
|
+
**If UPDATE (existing agent found)**:
|
|
239
146
|
```bash
|
|
240
|
-
#
|
|
241
|
-
cat .
|
|
242
|
-
|
|
243
|
-
cat .prettierrc* pyproject.toml .rustfmt.toml
|
|
244
|
-
# Read contribution guidelines
|
|
245
|
-
cat CONTRIBUTING.md | grep -A 10 "review\|style\|lint"
|
|
147
|
+
# Read both template and existing agent
|
|
148
|
+
cat .codemie/claude-templates/templates/agents/[template-file]
|
|
149
|
+
cat .claude/agents/[existing-agent-file]
|
|
246
150
|
```
|
|
247
151
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
-
|
|
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
|
|
152
|
+
**Compare and Identify**:
|
|
153
|
+
- Sections in template that are missing in existing agent
|
|
154
|
+
- Outdated information in existing agent
|
|
155
|
+
- Placeholders that need replacement
|
|
156
|
+
- Project-specific updates needed (new patterns, tools, conventions)
|
|
256
157
|
|
|
257
158
|
---
|
|
258
159
|
|
|
259
|
-
#### Step
|
|
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**
|
|
160
|
+
#### Step 2.2: Gather Agent-Specific Information
|
|
299
161
|
|
|
300
|
-
|
|
301
|
-
-
|
|
302
|
-
-
|
|
303
|
-
|
|
304
|
-
|
|
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
|
|
162
|
+
**Unit Tester**:
|
|
163
|
+
- Test framework, version, plugins
|
|
164
|
+
- Test directory and file patterns
|
|
165
|
+
- Mocking approach
|
|
166
|
+
- 1-2 representative test examples
|
|
310
167
|
|
|
311
|
-
**
|
|
168
|
+
**Solution Architect**:
|
|
169
|
+
- Architecture layers and their names
|
|
170
|
+
- Specs directory location
|
|
171
|
+
- Naming conventions
|
|
172
|
+
- Tech stack summary
|
|
312
173
|
|
|
313
|
-
|
|
314
|
-
-
|
|
315
|
-
-
|
|
316
|
-
-
|
|
174
|
+
**Code Review**:
|
|
175
|
+
- Linting tools and configs
|
|
176
|
+
- Severity thresholds
|
|
177
|
+
- 5-7 critical pattern categories
|
|
178
|
+
- Git workflow commands
|
|
317
179
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
180
|
+
**Refactor Cleaner**:
|
|
181
|
+
- Available analysis tools (knip, depcheck, vulture, etc.)
|
|
182
|
+
- Critical paths that must never be removed
|
|
183
|
+
- Deletion log location
|
|
184
|
+
- Build/test verification commands
|
|
321
185
|
|
|
322
|
-
**
|
|
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.
|
|
186
|
+
**Source Priority**: Always check `.codemie/guides/` first, then analyze code.
|
|
331
187
|
|
|
332
188
|
---
|
|
333
189
|
|
|
334
|
-
#### Step 3
|
|
335
|
-
|
|
336
|
-
**
|
|
337
|
-
|
|
338
|
-
**
|
|
190
|
+
#### Step 2.3: Populate Template or Update Existing
|
|
191
|
+
|
|
192
|
+
**If CREATE (from template)**:
|
|
193
|
+
1. **Replace all `[PLACEHOLDERS]`** with discovered values
|
|
194
|
+
2. **Fill pattern examples** using actual project code (brief, 10-15 lines)
|
|
195
|
+
3. **Remove all `[GENERATION INSTRUCTION]`** blocks
|
|
196
|
+
4. **Remove "Generation Instructions"** section from template
|
|
197
|
+
|
|
198
|
+
**If UPDATE (existing agent)**:
|
|
199
|
+
1. **Preserve custom content**: Keep user-added sections, custom examples, specific instructions
|
|
200
|
+
2. **Update outdated sections**:
|
|
201
|
+
- Replace old tool versions with current versions
|
|
202
|
+
- Update file paths if structure changed
|
|
203
|
+
- Refresh pattern examples with current codebase code
|
|
204
|
+
- Add missing sections from template
|
|
205
|
+
3. **Replace remaining placeholders** (if any)
|
|
206
|
+
4. **Enhance with new patterns**: Add newly discovered patterns not in original
|
|
207
|
+
5. **Maintain structure**: Keep existing organization unless template structure changed significantly
|
|
208
|
+
|
|
209
|
+
**Update Strategy**:
|
|
210
|
+
- **Section-by-section merge**: Compare template sections with existing agent sections
|
|
211
|
+
- **Preserve > Replace**: Keep existing content unless clearly outdated or incorrect
|
|
212
|
+
- **Add > Remove**: Add missing information rather than removing custom content
|
|
213
|
+
- **Validate > Assume**: Check if existing examples still exist in codebase
|
|
339
214
|
|
|
340
|
-
|
|
215
|
+
---
|
|
341
216
|
|
|
342
|
-
|
|
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`
|
|
217
|
+
#### Step 2.4: Write and Validate
|
|
346
218
|
|
|
347
|
-
**Step 3.4.2: Write File**
|
|
348
219
|
```bash
|
|
349
|
-
|
|
350
|
-
#
|
|
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
|
|
220
|
+
mkdir -p .claude/agents
|
|
221
|
+
# Write agent file (create new or overwrite existing)
|
|
367
222
|
```
|
|
368
223
|
|
|
369
|
-
**
|
|
370
|
-
- [ ]
|
|
371
|
-
- [ ]
|
|
372
|
-
- [ ]
|
|
373
|
-
- [ ]
|
|
374
|
-
- [ ]
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
- [ ]
|
|
378
|
-
- [ ]
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
3. Add troubleshooting section if missing
|
|
393
|
-
4. Ensure all template sections are filled
|
|
224
|
+
**Checklist (CREATE)**:
|
|
225
|
+
- [ ] No `[PLACEHOLDER]` text remains
|
|
226
|
+
- [ ] No `[GENERATION INSTRUCTION]` blocks remain
|
|
227
|
+
- [ ] Examples are from actual codebase
|
|
228
|
+
- [ ] File paths are accurate
|
|
229
|
+
- [ ] Commands are valid for project
|
|
230
|
+
|
|
231
|
+
**Checklist (UPDATE)**:
|
|
232
|
+
- [ ] Custom content preserved (user additions not lost)
|
|
233
|
+
- [ ] Outdated information refreshed
|
|
234
|
+
- [ ] New sections from template added if relevant
|
|
235
|
+
- [ ] Examples validated against current codebase
|
|
236
|
+
- [ ] File paths updated if project structure changed
|
|
237
|
+
- [ ] Tool versions/commands current
|
|
238
|
+
- [ ] No regression (agent still functional after update)
|
|
239
|
+
|
|
240
|
+
**Action Logging**:
|
|
241
|
+
Record for summary report:
|
|
242
|
+
- Agent name
|
|
243
|
+
- Action taken (CREATED or UPDATED)
|
|
244
|
+
- Key changes made (if updated)
|
|
245
|
+
|
|
246
|
+
Mark todo complete, proceed to next template.
|
|
394
247
|
|
|
395
248
|
---
|
|
396
249
|
|
|
397
|
-
|
|
250
|
+
### Phase 3: Finalize
|
|
398
251
|
|
|
399
|
-
|
|
400
|
-
- Mark current agent generation todo as "completed"
|
|
401
|
-
- Move to next template
|
|
252
|
+
#### Step 3.1: Verify All Agents
|
|
402
253
|
|
|
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
254
|
```bash
|
|
413
|
-
|
|
414
|
-
|
|
255
|
+
ls -la .claude/agents/
|
|
256
|
+
wc -l .claude/agents/*.md
|
|
415
257
|
```
|
|
416
258
|
|
|
417
|
-
|
|
418
|
-
-
|
|
419
|
-
-
|
|
420
|
-
-
|
|
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
|
-
```
|
|
259
|
+
Confirm:
|
|
260
|
+
- All agents created
|
|
261
|
+
- All within size limits
|
|
262
|
+
- No placeholder text remains
|
|
430
263
|
|
|
431
264
|
---
|
|
432
265
|
|
|
433
|
-
#### Step
|
|
434
|
-
|
|
435
|
-
**Task**: Create summary of what was generated
|
|
266
|
+
#### Step 3.2: Summary Report
|
|
436
267
|
|
|
437
|
-
**Report Structure**:
|
|
438
268
|
```markdown
|
|
439
269
|
# Subagent Generation Complete
|
|
440
270
|
|
|
441
|
-
##
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
-
|
|
451
|
-
-
|
|
452
|
-
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
**
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
-
|
|
461
|
-
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
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"
|
|
271
|
+
## Agents Processed
|
|
272
|
+
| Agent | Lines | Action | Key Changes |
|
|
273
|
+
|-------|-------|--------|-------------|
|
|
274
|
+
| unit-tester-agent.md | X | CREATED/UPDATED | [If updated: list changes] |
|
|
275
|
+
| solution-architect-agent.md | Y | CREATED/UPDATED | [If updated: list changes] |
|
|
276
|
+
| code-review-agent.md | Z | CREATED/UPDATED | [If updated: list changes] |
|
|
277
|
+
| refactor-cleaner-agent.md | W | CREATED/UPDATED | [If updated: list changes] |
|
|
278
|
+
|
|
279
|
+
## Actions Taken
|
|
280
|
+
- **Created**: X new agents
|
|
281
|
+
- **Updated**: Y existing agents
|
|
282
|
+
- **Preserved**: Z unmatched agents (left unchanged)
|
|
283
|
+
|
|
284
|
+
## Project Context Used
|
|
285
|
+
- **Guides**: [list of .codemie/guides/ files read, or "none found"]
|
|
286
|
+
- **Tech Stack**: [Language], [Framework], [Test Framework]
|
|
287
|
+
- **Architecture**: [Pattern]
|
|
288
|
+
|
|
289
|
+
## Update Details (if applicable)
|
|
290
|
+
- Outdated paths updated: [list]
|
|
291
|
+
- New patterns added: [list]
|
|
292
|
+
- Tool versions refreshed: [list]
|
|
293
|
+
- Custom content preserved: [yes/no, details]
|
|
294
|
+
|
|
295
|
+
## Usage
|
|
296
|
+
Agents are automatically available to Claude Code.
|
|
297
|
+
Explicit invocation: "Use the [agent-name] agent to [task]"
|
|
498
298
|
```
|
|
499
299
|
|
|
500
300
|
---
|
|
501
301
|
|
|
502
|
-
## Decision Gates
|
|
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)
|
|
302
|
+
## Decision Gates
|
|
508
303
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
-
|
|
517
|
-
|
|
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
|
|
304
|
+
| Gate | Condition | Pass | Fail |
|
|
305
|
+
|------|-----------|------|------|
|
|
306
|
+
| Templates exist | ≥1 template found | Continue | Stop with error |
|
|
307
|
+
| Existing agents check | Checked .claude/agents/ | Continue | Continue (assume no existing) |
|
|
308
|
+
| Update decision | Clear CREATE or UPDATE action | Continue | Ask user for preference |
|
|
309
|
+
| Custom content | Identified custom sections in existing agent | Preserve during update | Proceed with standard update |
|
|
310
|
+
| Project understood | ≥80% info gathered | Continue | Ask user for clarification |
|
|
311
|
+
| Agent size | 100-300 lines | Continue | Condense/expand as needed |
|
|
312
|
+
| Validation | No placeholders remain | Complete | Fix and revalidate |
|
|
313
|
+
| Update safety | Custom content preserved (if applicable) | Complete | Review and fix |
|
|
523
314
|
|
|
524
315
|
---
|
|
525
316
|
|
|
526
317
|
## Troubleshooting
|
|
527
318
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
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
|
|
319
|
+
| Issue | Action |
|
|
320
|
+
|-------|--------|
|
|
321
|
+
| Templates not found | Check path, ask user for correct location |
|
|
322
|
+
| Existing agent name doesn't match | Use partial/keyword matching logic (Step 1.1b) |
|
|
323
|
+
| Uncertain if existing agent is custom | Ask user: "Found [agent]. Update or preserve?" |
|
|
324
|
+
| Existing agent very different from template | Ask user before updating, risk losing custom content |
|
|
325
|
+
| Agent has placeholders after update | Re-gather project info, re-populate |
|
|
326
|
+
| Update causes agent to exceed size limit | Condense: prioritize new info, remove outdated examples |
|
|
327
|
+
| Unclear tech stack | Check `.codemie/guides/` first, then ask user |
|
|
328
|
+
| No test files found | Check alternate patterns, note in agent |
|
|
329
|
+
| Agent too large (>300) | Condense: use references, tables, single examples |
|
|
330
|
+
| Missing critical info | Check guides/, then analyze code, then ask user |
|
|
331
|
+
| Custom sections lost during update | Restore from backup (existing file), merge manually |
|
|
571
332
|
|
|
572
333
|
---
|
|
573
334
|
|
|
574
335
|
## Success Criteria
|
|
575
336
|
|
|
576
|
-
|
|
577
|
-
- ✅
|
|
578
|
-
- ✅ All agents
|
|
579
|
-
- ✅ All agents
|
|
580
|
-
- ✅
|
|
581
|
-
- ✅
|
|
582
|
-
- ✅
|
|
583
|
-
- ✅
|
|
584
|
-
- ✅
|
|
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
|
-
---
|
|
337
|
+
- ✅ All templates processed
|
|
338
|
+
- ✅ Existing agents checked and mapped to templates
|
|
339
|
+
- ✅ All agents in `.claude/agents/`
|
|
340
|
+
- ✅ All agents 100-300 lines
|
|
341
|
+
- ✅ No placeholders remain
|
|
342
|
+
- ✅ Project-specific content (not generic)
|
|
343
|
+
- ✅ Custom content preserved (if updating existing agents)
|
|
344
|
+
- ✅ Outdated information refreshed (if updating)
|
|
345
|
+
- ✅ Summary report generated with actions taken (CREATE/UPDATE)
|