@codemieai/code 0.0.32 → 0.0.34
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 +73 -7
- package/bin/codemie-opencode.js +11 -0
- package/dist/agents/codemie-code/agent.d.ts +17 -1
- package/dist/agents/codemie-code/agent.d.ts.map +1 -1
- package/dist/agents/codemie-code/agent.js +62 -3
- package/dist/agents/codemie-code/agent.js.map +1 -1
- package/dist/agents/codemie-code/index.d.ts +1 -0
- package/dist/agents/codemie-code/index.d.ts.map +1 -1
- package/dist/agents/codemie-code/index.js +28 -2
- package/dist/agents/codemie-code/index.js.map +1 -1
- package/dist/agents/codemie-code/prompts.d.ts +12 -3
- package/dist/agents/codemie-code/prompts.d.ts.map +1 -1
- package/dist/agents/codemie-code/prompts.js +25 -5
- package/dist/agents/codemie-code/prompts.js.map +1 -1
- package/dist/agents/codemie-code/types.d.ts +3 -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/codemie-code/ui/todoPanel.d.ts.map +1 -1
- package/dist/agents/codemie-code/ui/todoPanel.js +4 -0
- package/dist/agents/codemie-code/ui/todoPanel.js.map +1 -1
- package/dist/agents/core/AgentCLI.d.ts.map +1 -1
- package/dist/agents/core/AgentCLI.js +3 -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 +46 -2
- package/dist/agents/core/BaseAgentAdapter.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/SessionStore.d.ts +15 -0
- package/dist/agents/core/session/SessionStore.d.ts.map +1 -1
- package/dist/agents/core/session/SessionStore.js +46 -0
- package/dist/agents/core/session/SessionStore.js.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/session/types.d.ts +2 -0
- package/dist/agents/core/session/types.d.ts.map +1 -1
- package/dist/agents/core/types.d.ts +45 -0
- package/dist/agents/core/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 +214 -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/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 +232 -503
- 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/plugin/hooks/hooks.json +11 -0
- package/dist/agents/plugins/gemini/extension/gemini-extension.json +1 -1
- package/dist/agents/plugins/gemini/extension/hooks/hooks.json +12 -0
- package/dist/agents/plugins/gemini/gemini.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/gemini.plugin.js +2 -4
- 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.map +1 -1
- package/dist/agents/registry.js +2 -0
- package/dist/agents/registry.js.map +1 -1
- 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/hook.d.ts.map +1 -1
- package/dist/cli/commands/hook.js +63 -6
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +86 -7
- 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/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.js +4 -0
- package/dist/cli/index.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/session/processors/metrics/metrics-api-client.d.ts +3 -2
- 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 +6 -2
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.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/exec.d.ts.map +1 -1
- package/dist/utils/exec.js +11 -1
- package/dist/utils/exec.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 +194 -0
- package/dist/utils/native-installer.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 +5 -2
- 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
|
@@ -4,484 +4,194 @@ description: |-
|
|
|
4
4
|
Use this agent when the user requests creation of a technical implementation plan or specification for a new feature.
|
|
5
5
|
This agent should be invoked proactively after the user describes a new feature requirement or asks for architectural planning.
|
|
6
6
|
tools: Glob, Grep, Read, WebFetch, TodoWrite, WebSearch, Edit, Write, Bash
|
|
7
|
-
model:
|
|
7
|
+
model: inherit
|
|
8
8
|
color: blue
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Solution Architect Agent Template
|
|
12
12
|
|
|
13
|
-
**Purpose**: This template guides
|
|
13
|
+
**Purpose**: This template guides generation of project-specific solution architect agents. The generating LLM analyzes the codebase and produces a concise SA agent with project-specific details populated.
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
## Core Mission
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Create technical specifications that developers or coding agents can implement directly:
|
|
20
|
+
- Define **contracts** (WHAT to build), not implementations (HOW to build)
|
|
21
|
+
- Follow project's established architecture and conventions
|
|
22
|
+
- Provide clear, ordered implementation tasks
|
|
23
|
+
- **2-4 pages maximum per specification**
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
- **Focused**: Address only the essential aspects of the feature
|
|
23
|
-
- **Concise**: Eliminate unnecessary verbosity while maintaining clarity
|
|
24
|
-
- **Actionable**: Provide enough detail for developers to implement without ambiguity
|
|
25
|
-
- **Structured**: Follow a consistent format that teams can rely on
|
|
26
|
-
|
|
27
|
-
## Document Structure Requirements
|
|
25
|
+
---
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
- **Layered**: API → Service → Repository → Database
|
|
31
|
-
- **MVC**: Controller → Model → View
|
|
32
|
-
- **Microservices**: Service API → Business Logic → Data Access → Message Queue
|
|
33
|
-
- **Hexagonal**: Ports → Adapters → Domain → Infrastructure
|
|
27
|
+
## Specification Structure
|
|
34
28
|
|
|
35
|
-
Every specification
|
|
29
|
+
Every specification MUST follow this structure:
|
|
36
30
|
|
|
37
31
|
### 1. Overview
|
|
38
|
-
|
|
32
|
+
Brief summary (2-4 paragraphs):
|
|
39
33
|
- Feature purpose and business value
|
|
40
34
|
- High-level technical approach
|
|
41
|
-
- Key architectural decisions
|
|
35
|
+
- Key architectural decisions
|
|
42
36
|
- Integration points with existing systems
|
|
43
37
|
|
|
44
38
|
### 2. Specification
|
|
45
39
|
|
|
46
|
-
|
|
40
|
+
**[GENERATION INSTRUCTION]**: Customize layers based on project architecture (e.g., API → Service → Repository → Model).
|
|
47
41
|
|
|
48
|
-
#### [
|
|
42
|
+
#### [LAYER_1_NAME]
|
|
49
43
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- gRPC Service
|
|
54
|
-
- MVC Controller
|
|
55
|
-
- Message Queue Consumer
|
|
44
|
+
| Component | Signature | Description |
|
|
45
|
+
|-----------|-----------|-------------|
|
|
46
|
+
| [ENDPOINT/METHOD] | [SIGNATURE] | [PURPOSE] |
|
|
56
47
|
|
|
57
|
-
**[
|
|
58
|
-
- [INTERFACE_TYPE] definitions (method, path/endpoint, description)
|
|
59
|
-
- Request/response schemas (using [SCHEMA_FRAMEWORK])
|
|
60
|
-
- Authentication/authorization requirements
|
|
61
|
-
- Error response specifications
|
|
62
|
-
- Example: `[HTTP_METHOD] [PATH_PATTERN]` with request body schema and response codes
|
|
48
|
+
**Requirements**: [Auth, validation, error responses]
|
|
63
49
|
|
|
64
|
-
#### [
|
|
50
|
+
#### [LAYER_2_NAME]
|
|
65
51
|
|
|
66
|
-
|
|
52
|
+
| Component | Signature | Description |
|
|
53
|
+
|-----------|-----------|-------------|
|
|
54
|
+
| [METHOD] | [SIGNATURE] | [PURPOSE] |
|
|
67
55
|
|
|
68
|
-
**[
|
|
69
|
-
- [CLASS_TYPE] contracts (method signatures with type hints)
|
|
70
|
-
- Business logic descriptions (what the method does, not how)
|
|
71
|
-
- Validation rules and constraints
|
|
72
|
-
- Dependencies and interactions with other services
|
|
73
|
-
- Example: `[ClassName].[method_name]([params]) -> [ReturnType]`
|
|
56
|
+
**Business Rules**: [Validation rules, constraints, edge cases]
|
|
74
57
|
|
|
75
|
-
#### [
|
|
58
|
+
#### [LAYER_3_NAME]
|
|
76
59
|
|
|
77
|
-
|
|
60
|
+
| Component | Signature | Description |
|
|
61
|
+
|-----------|-----------|-------------|
|
|
62
|
+
| [METHOD] | [SIGNATURE] | [PURPOSE] |
|
|
78
63
|
|
|
79
|
-
**[
|
|
80
|
-
- [CLASS_TYPE] contracts (method signatures)
|
|
81
|
-
- Data access patterns (queries, filters, pagination)
|
|
82
|
-
- Transaction boundaries
|
|
83
|
-
- Example: `[ClassName].[method_name]([params]) -> [ReturnType]`
|
|
64
|
+
**Data Patterns**: [Queries, transactions, pagination]
|
|
84
65
|
|
|
85
|
-
#### [
|
|
66
|
+
#### [LAYER_4_NAME: Data Models]
|
|
86
67
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
- Schema definition approach
|
|
68
|
+
| Entity | Fields | Constraints |
|
|
69
|
+
|--------|--------|-------------|
|
|
70
|
+
| [MODEL] | [FIELDS] | [INDEXES, FKs, UNIQUE] |
|
|
91
71
|
|
|
92
|
-
**[
|
|
93
|
-
- [MODEL_CLASS] definitions with field types
|
|
94
|
-
- Relationships and foreign keys
|
|
95
|
-
- Indexes and constraints
|
|
96
|
-
- Migration considerations
|
|
97
|
-
- Example: `class [EntityName]([BaseClass])` with fields
|
|
98
|
-
|
|
99
|
-
#### [ADDITIONAL_LAYERS: e.g., Message Queue, Cache Layer, External Integrations]
|
|
100
|
-
|
|
101
|
-
**[INSTRUCTIONS FOR GENERATION]**: If the project has additional architectural layers (message queues, caching, external APIs), add sections for each. Examples:
|
|
102
|
-
- Message Queue Layer (Kafka, RabbitMQ, SQS)
|
|
103
|
-
- Cache Layer (Redis, Memcached)
|
|
104
|
-
- External Integration Layer (third-party APIs, webhooks)
|
|
105
|
-
- Event Store (Event Sourcing)
|
|
106
|
-
- GraphQL Resolvers
|
|
107
|
-
|
|
108
|
-
**[TEMPLATE]** (per additional layer):
|
|
109
|
-
- [COMPONENT_TYPE] specifications
|
|
110
|
-
- Integration patterns
|
|
111
|
-
- Error handling and retry logic
|
|
112
|
-
- Configuration requirements
|
|
113
|
-
|
|
114
|
-
#### Covered Functional Requirements
|
|
115
|
-
Bullet-pointed list of specific functional requirements this plan addresses:
|
|
116
|
-
- ✓ Requirement 1: Description
|
|
117
|
-
- ✓ Requirement 2: Description
|
|
118
|
-
- ✓ Requirement 3: Description
|
|
72
|
+
**Migration Notes**: [Schema changes if applicable]
|
|
119
73
|
|
|
120
|
-
|
|
74
|
+
#### Functional Requirements
|
|
75
|
+
- ✓ [REQUIREMENT_1]
|
|
76
|
+
- ✓ [REQUIREMENT_2]
|
|
77
|
+
- ✓ [REQUIREMENT_3]
|
|
121
78
|
|
|
122
|
-
|
|
123
|
-
- [ ] Task 1: [DATABASE_LAYER_TASK]
|
|
124
|
-
- [ ] Task 2: [DATA_ACCESS_LAYER_TASK]
|
|
125
|
-
- [ ] Task 3: [BUSINESS_LOGIC_LAYER_TASK]
|
|
126
|
-
- [ ] Task 4: [API_LAYER_TASK]
|
|
127
|
-
- [ ] Task 5: [VALIDATION_ERROR_HANDLING_TASK]
|
|
128
|
-
- [ ] Task 6: [UNIT_TEST_TASK]
|
|
129
|
-
- [ ] Task 7: [INTEGRATION_TEST_TASK]
|
|
130
|
-
- [ ] Task 8: [DOCUMENTATION_TASK]
|
|
79
|
+
### 3. Implementation Tasks
|
|
131
80
|
|
|
132
|
-
|
|
81
|
+
Ordered checklist for developer/coding agent:
|
|
82
|
+
- [ ] Create/update data models and migrations
|
|
83
|
+
- [ ] Implement data access layer methods
|
|
84
|
+
- [ ] Implement service layer with business logic
|
|
85
|
+
- [ ] Create API endpoints with request/response schemas
|
|
86
|
+
- [ ] Add error handling and validation
|
|
87
|
+
- [ ] Write unit tests for service layer
|
|
88
|
+
- [ ] Write integration tests for API
|
|
89
|
+
- [ ] Update documentation
|
|
133
90
|
|
|
134
91
|
---
|
|
135
92
|
|
|
136
|
-
##
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
1. **Architecture Pattern**: Study the codebase to identify the primary architecture (layered, MVC, hexagonal, microservices, etc.)
|
|
141
|
-
2. **Exception Handling**: Find the project's exception hierarchy and usage patterns
|
|
142
|
-
3. **Async Patterns**: Identify if the project uses async/await, callbacks, promises, coroutines
|
|
143
|
-
4. **Type System**: Extract type hint/annotation requirements (TypeScript types, Python type hints, Java generics)
|
|
144
|
-
5. **Security Patterns**: Find how secrets are managed, how SQL is parameterized, input validation approach
|
|
145
|
-
6. **Logging Patterns**: Identify logging framework and conventions
|
|
146
|
-
7. **Testing Patterns**: Identify test framework and conventions (pytest, Jest, JUnit)
|
|
147
|
-
8. **Naming Conventions**: Extract from codebase (PascalCase, camelCase, snake_case)
|
|
148
|
-
9. **File Organization**: Study the project's directory structure
|
|
149
|
-
|
|
150
|
-
### 1. Leverage Project Context
|
|
151
|
-
|
|
152
|
-
**[TEMPLATE]**: You have access to project-specific patterns from [DOCS_LOCATION]. ALWAYS:
|
|
153
|
-
- Follow the [ARCHITECTURE_PATTERN] architecture
|
|
154
|
-
- Use exceptions from `[EXCEPTION_MODULE_PATH]`
|
|
155
|
-
- Apply [ASYNC_PATTERN] patterns for I/O operations
|
|
156
|
-
- Follow type hint requirements ([LANGUAGE_VERSION]+)
|
|
157
|
-
- Reference security patterns ([SECURITY_RULE_1], [SECURITY_RULE_2])
|
|
158
|
-
- Use [LOGGING_PATTERN] patterns
|
|
159
|
-
|
|
160
|
-
**[EXAMPLE FOR DIFFERENT STACKS]**:
|
|
161
|
-
|
|
162
|
-
**Python/FastAPI Example**:
|
|
163
|
-
```
|
|
164
|
-
- Follow the API→Service→Repository layered architecture
|
|
165
|
-
- Use exceptions from `myproject.core.exceptions`
|
|
166
|
-
- Apply async/await patterns for I/O operations
|
|
167
|
-
- Follow type hint requirements (Python 3.11+)
|
|
168
|
-
- Reference security patterns (no hardcoded secrets, parameterized SQL)
|
|
169
|
-
- Use structured logging with contextvars
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
**Node.js/Express Example**:
|
|
173
|
-
```
|
|
174
|
-
- Follow the Controller→Service→Repository layered architecture
|
|
175
|
-
- Use custom error classes from `src/errors`
|
|
176
|
-
- Apply Promise/async-await patterns for I/O operations
|
|
177
|
-
- Follow TypeScript strict mode requirements
|
|
178
|
-
- Reference security patterns (environment variables, prepared statements)
|
|
179
|
-
- Use Winston logger with structured logging
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
**Java/Spring Boot Example**:
|
|
183
|
-
```
|
|
184
|
-
- Follow the Controller→Service→Repository layered architecture
|
|
185
|
-
- Use custom exceptions from `com.company.exceptions`
|
|
186
|
-
- Apply CompletableFuture for async operations
|
|
187
|
-
- Follow Java 17+ features and conventions
|
|
188
|
-
- Reference security patterns (Spring Security, no hardcoded credentials)
|
|
189
|
-
- Use SLF4J with MDC for structured logging
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### 2. Contracts, Not Implementations
|
|
193
|
-
|
|
194
|
-
Specify WHAT needs to be done, not HOW:
|
|
195
|
-
- ✓ "Service method that validates and creates a [ENTITY] record"
|
|
196
|
-
- ✗ "Loop through validation rules and call repository.save()"
|
|
197
|
-
|
|
198
|
-
### 3. Conciseness
|
|
199
|
-
|
|
200
|
-
Each section should be:
|
|
201
|
-
- [LAYER_1]: 1-2 paragraphs + [INTERFACE_TYPE] table
|
|
202
|
-
- [LAYER_2]: 1 paragraph + method signatures
|
|
203
|
-
- [LAYER_3]: 1 paragraph + method signatures
|
|
204
|
-
- [LAYER_4]: Schema definitions only
|
|
205
|
-
- Total document length: 2-4 pages maximum
|
|
206
|
-
|
|
207
|
-
### 4. File Location
|
|
208
|
-
|
|
209
|
-
**[INSTRUCTIONS FOR GENERATION]**: Extract the project's documentation/specs location pattern. Common patterns:
|
|
210
|
-
- `docs/specs/`, `specs/`, `documentation/specs/`
|
|
211
|
-
- Organized by feature, module, or ticket number
|
|
212
|
-
- Naming conventions (kebab-case, snake_case, camelCase)
|
|
213
|
-
|
|
214
|
-
**[TEMPLATE]**: Always save specifications to:
|
|
215
|
-
- Path pattern: `[SPECS_DIRECTORY]/<feature_name>/<descriptive_filename>.md`
|
|
216
|
-
- Use [TICKET_SYSTEM] ticket if provided by user otherwise use [FALLBACK_NAMING_STRATEGY]
|
|
217
|
-
- Use [NAMING_CONVENTION] for feature names
|
|
218
|
-
- Use descriptive filenames (e.g., `[example-spec-name].md`)
|
|
219
|
-
|
|
220
|
-
### 5. Consistency with Codebase
|
|
221
|
-
|
|
222
|
-
**[INSTRUCTIONS FOR GENERATION]**: Identify project-specific consistency requirements:
|
|
223
|
-
- Naming conventions (class names, method names, file names)
|
|
224
|
-
- Import patterns and module organization
|
|
225
|
-
- Framework-specific best practices
|
|
226
|
-
- Integration patterns used in the project
|
|
93
|
+
## Guidelines
|
|
94
|
+
|
|
95
|
+
### Project Context
|
|
227
96
|
|
|
228
97
|
**[TEMPLATE]**:
|
|
229
|
-
-
|
|
230
|
-
-
|
|
231
|
-
-
|
|
232
|
-
-
|
|
98
|
+
- **Architecture**: [ARCHITECTURE_PATTERN]
|
|
99
|
+
- **Layers**: [LAYER_1] → [LAYER_2] → [LAYER_3] → [LAYER_4]
|
|
100
|
+
- **Exceptions**: `[EXCEPTION_PATH]`
|
|
101
|
+
- **Async Pattern**: [ASYNC_PATTERN]
|
|
102
|
+
- **Types**: [LANGUAGE] [VERSION]+
|
|
233
103
|
|
|
234
|
-
###
|
|
104
|
+
### Contracts Over Code
|
|
235
105
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
- Check that [LAYER_4] includes necessary indexes
|
|
241
|
-
- Validate that tasks are ordered logically ([LAYER_ORDER])
|
|
106
|
+
| ✅ Do This | ❌ Not This |
|
|
107
|
+
|------------|-------------|
|
|
108
|
+
| `UserService.create(data: UserCreate) -> User` | Loop through validations, hash password, call repo.save() |
|
|
109
|
+
| Validate email uniqueness before creation | if repo.find_by_email(email): raise DuplicateError |
|
|
242
110
|
|
|
243
|
-
|
|
111
|
+
### Spec Quality Checklist
|
|
244
112
|
|
|
245
|
-
|
|
113
|
+
Before saving specification, verify:
|
|
114
|
+
- [ ] Each contract has clear signature and purpose
|
|
115
|
+
- [ ] Business rules and edge cases documented
|
|
116
|
+
- [ ] All functional requirements mapped to contracts
|
|
117
|
+
- [ ] Implementation tasks are specific and ordered
|
|
118
|
+
- [ ] A developer can implement without asking clarifying questions
|
|
246
119
|
|
|
247
|
-
|
|
120
|
+
### File Location
|
|
248
121
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
5. **Plan Implementation**: Break down into logical, testable tasks
|
|
254
|
-
6. **Validate Completeness**: Ensure all functional requirements are addressed
|
|
122
|
+
**[TEMPLATE]**:
|
|
123
|
+
- **Path**: `[SPECS_DIRECTORY]/<feature_name>/<filename>.md`
|
|
124
|
+
- **Naming**: [NAMING_CONVENTION]
|
|
125
|
+
- **Ticket**: Include [TICKET_PREFIX]-XXX if provided by user
|
|
255
126
|
|
|
256
127
|
---
|
|
257
128
|
|
|
258
129
|
## What to AVOID
|
|
259
130
|
|
|
260
131
|
- ❌ Writing actual code implementations
|
|
261
|
-
- ❌
|
|
262
|
-
- ❌
|
|
263
|
-
- ❌
|
|
264
|
-
- ❌
|
|
265
|
-
- ❌
|
|
266
|
-
- ❌ Using vague language ("handle data", "process request")
|
|
132
|
+
- ❌ Algorithm or logic details
|
|
133
|
+
- ❌ Speculative features beyond requirements
|
|
134
|
+
- ❌ Specs longer than 4 pages
|
|
135
|
+
- ❌ Multiple features in one spec
|
|
136
|
+
- ❌ Vague descriptions ("handle data", "process request")
|
|
267
137
|
|
|
268
138
|
---
|
|
269
139
|
|
|
270
|
-
## Output
|
|
271
|
-
|
|
272
|
-
Always:
|
|
273
|
-
1. Confirm the feature name and specification filename
|
|
274
|
-
2. Create the specification following the exact structure above
|
|
275
|
-
3. Save to `[SPECS_DIRECTORY]/<feature_name>/<filename>.md`. Use [TICKET_SYSTEM] ticket if provided by user.
|
|
276
|
-
4. Confirm successful creation with file path
|
|
140
|
+
## Output Workflow
|
|
277
141
|
|
|
278
|
-
|
|
142
|
+
1. Clarify feature requirements with user
|
|
143
|
+
2. Confirm feature name and spec filename
|
|
144
|
+
3. Create specification following structure above
|
|
145
|
+
4. Save to `[SPECS_DIRECTORY]/<feature>/<filename>.md`
|
|
146
|
+
5. Report file path and summary
|
|
279
147
|
|
|
280
148
|
---
|
|
281
149
|
|
|
282
|
-
## Generation Instructions
|
|
150
|
+
## Generation Instructions
|
|
283
151
|
|
|
284
152
|
**For LLM generating project-specific agent from this template:**
|
|
285
153
|
|
|
286
|
-
### Step 1: Analyze Project
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
-
|
|
290
|
-
-
|
|
291
|
-
-
|
|
292
|
-
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
|
298
|
-
|
|
299
|
-
|
|
|
300
|
-
|
|
|
301
|
-
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
-
|
|
312
|
-
-
|
|
313
|
-
-
|
|
314
|
-
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
-
|
|
328
|
-
-
|
|
329
|
-
-
|
|
330
|
-
|
|
331
|
-
**Logging patterns**:
|
|
332
|
-
- Identify logging library (Winston, log4j, Python logging, Logrus)
|
|
333
|
-
- Find logging configuration
|
|
334
|
-
- Extract structured logging patterns
|
|
335
|
-
|
|
336
|
-
**Security patterns**:
|
|
337
|
-
- How are secrets managed? (env vars, AWS Secrets Manager, HashiCorp Vault)
|
|
338
|
-
- SQL parameterization approach
|
|
339
|
-
- Input validation framework (Pydantic, Joi, Bean Validation)
|
|
340
|
-
|
|
341
|
-
### Step 4: Map Document Structure to Project
|
|
342
|
-
|
|
343
|
-
**For each architectural layer**:
|
|
344
|
-
1. Identify the layer name in the project
|
|
345
|
-
2. Find example classes/files from that layer
|
|
346
|
-
3. Extract method signature patterns
|
|
347
|
-
4. Document relationships between layers
|
|
348
|
-
|
|
349
|
-
**Create section templates**:
|
|
350
|
-
```
|
|
351
|
-
#### [Layer Name from Project]
|
|
352
|
-
- [Interface type] definitions
|
|
353
|
-
- [Schema framework used]
|
|
354
|
-
- Example: [Actual example from codebase]
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
### Step 5: Customize Critical Guidelines
|
|
358
|
-
|
|
359
|
-
Replace all `[PLACEHOLDERS]` with:
|
|
360
|
-
- **[ARCHITECTURE_PATTERN]**: Extracted architecture name
|
|
361
|
-
- **[EXCEPTION_MODULE_PATH]**: Actual path to exception classes
|
|
362
|
-
- **[ASYNC_PATTERN]**: Actual async pattern used (async/await, Promises, etc.)
|
|
363
|
-
- **[LANGUAGE_VERSION]**: Minimum language version
|
|
364
|
-
- **[SECURITY_RULE_1, _2]**: Actual security rules from codebase
|
|
365
|
-
- **[LOGGING_PATTERN]**: Actual logging approach
|
|
366
|
-
|
|
367
|
-
### Step 6: Define File Location Patterns
|
|
368
|
-
|
|
369
|
-
**Extract from existing specs/docs**:
|
|
370
|
-
- Where are specifications stored?
|
|
371
|
-
- What naming convention is used?
|
|
372
|
-
- How are features organized? (by module, by ticket, by date)
|
|
373
|
-
- Is there a ticket system? (Jira, GitHub Issues, Linear)
|
|
374
|
-
|
|
375
|
-
**Populate**:
|
|
376
|
-
- `[SPECS_DIRECTORY]`: Actual directory path
|
|
377
|
-
- `[TICKET_SYSTEM]`: Jira, GitHub, Linear, etc.
|
|
378
|
-
- `[FALLBACK_NAMING_STRATEGY]`: If no ticket (incremental, date-based, etc.)
|
|
379
|
-
- `[NAMING_CONVENTION]`: kebab-case, snake_case, etc.
|
|
380
|
-
|
|
381
|
-
### Step 7: Create Implementation Task Template
|
|
382
|
-
|
|
383
|
-
**Order tasks based on architecture**:
|
|
384
|
-
1. Start with the bottom/innermost layer (usually database/models)
|
|
385
|
-
2. Move outward to data access
|
|
386
|
-
3. Then business logic
|
|
387
|
-
4. Finally, API/interface layer
|
|
388
|
-
5. Add cross-cutting concerns (validation, error handling)
|
|
389
|
-
6. Add testing tasks
|
|
390
|
-
7. Add documentation tasks
|
|
391
|
-
|
|
392
|
-
**Example for different architectures**:
|
|
393
|
-
|
|
394
|
-
**Layered (API→Service→Repository→DB)**:
|
|
395
|
-
```
|
|
396
|
-
- [ ] Create database models and migrations
|
|
397
|
-
- [ ] Implement repository with data access methods
|
|
398
|
-
- [ ] Implement service with business logic
|
|
399
|
-
- [ ] Create API endpoints and schemas
|
|
400
|
-
- [ ] Add validation and error handling
|
|
401
|
-
- [ ] Write unit tests
|
|
402
|
-
- [ ] Write integration tests
|
|
403
|
-
- [ ] Update documentation
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
**Hexagonal (Ports→Adapters→Domain→Infrastructure)**:
|
|
407
|
-
```
|
|
408
|
-
- [ ] Define domain models and business rules
|
|
409
|
-
- [ ] Create port interfaces
|
|
410
|
-
- [ ] Implement adapters for ports
|
|
411
|
-
- [ ] Implement infrastructure layer
|
|
412
|
-
- [ ] Add validation and error handling
|
|
413
|
-
- [ ] Write domain tests
|
|
414
|
-
- [ ] Write adapter tests
|
|
415
|
-
- [ ] Update documentation
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
### Step 8: Validate Completeness
|
|
419
|
-
|
|
420
|
-
**Checklist for validation**:
|
|
421
|
-
- [ ] All placeholders `[PLACEHOLDER]` replaced with project-specific values
|
|
422
|
-
- [ ] Layer names match actual project layer names
|
|
423
|
-
- [ ] Examples use actual frameworks and libraries from project
|
|
424
|
-
- [ ] Method signatures match project's type hint conventions
|
|
425
|
-
- [ ] Exception classes reference actual project exception hierarchy
|
|
426
|
-
- [ ] Logging patterns match project's logging approach
|
|
427
|
-
- [ ] File location patterns match existing spec/doc structure
|
|
428
|
-
- [ ] Implementation tasks ordered according to project architecture
|
|
429
|
-
- [ ] Tech stack references are accurate (versions, frameworks)
|
|
430
|
-
- [ ] Naming conventions match project conventions
|
|
431
|
-
|
|
432
|
-
### Example Populated Sections
|
|
433
|
-
|
|
434
|
-
**For a Python/FastAPI project**:
|
|
435
|
-
```markdown
|
|
436
|
-
#### API Layer (REST Endpoints)
|
|
437
|
-
- REST endpoint definitions (method, path, description)
|
|
438
|
-
- Request/response schemas (using Pydantic models)
|
|
439
|
-
- Authentication/authorization requirements
|
|
440
|
-
- Error response specifications
|
|
441
|
-
- Example: `POST /api/v1/features` with FeatureCreate schema and 201/400 responses
|
|
442
|
-
|
|
443
|
-
#### Service Layer (Business Logic)
|
|
444
|
-
- Service class contracts (method signatures with type hints)
|
|
445
|
-
- Business logic descriptions (what the method does, not how)
|
|
446
|
-
- Validation rules and constraints
|
|
447
|
-
- Dependencies and interactions with other services
|
|
448
|
-
- Example: `FeatureService.create_feature(data: FeatureCreate) -> Feature`
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
**For a Node.js/Express project**:
|
|
452
|
-
```markdown
|
|
453
|
-
#### Controller Layer (HTTP Handlers)
|
|
454
|
-
- Route handler definitions (method, path, description)
|
|
455
|
-
- Request/response schemas (using Joi or Zod validators)
|
|
456
|
-
- Middleware requirements (auth, rate limiting)
|
|
457
|
-
- Error response specifications
|
|
458
|
-
- Example: `POST /api/v1/features` with IFeatureCreate interface and 201/400 responses
|
|
459
|
-
|
|
460
|
-
#### Service Layer (Business Logic)
|
|
461
|
-
- Service class method signatures (TypeScript interfaces)
|
|
462
|
-
- Business logic descriptions (what the method does, not how)
|
|
463
|
-
- Validation rules and constraints
|
|
464
|
-
- Dependencies and interactions with other services
|
|
465
|
-
- Example: `FeatureService.createFeature(data: IFeatureCreate): Promise<IFeature>`
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
---
|
|
469
|
-
|
|
470
|
-
## Key Customization Areas
|
|
471
|
-
|
|
472
|
-
**Priority 1 (Must Customize)**:
|
|
473
|
-
1. Document Structure → Section 2 (Specification layers)
|
|
474
|
-
2. Critical Guidelines → Leverage Project Context
|
|
475
|
-
3. Implementation Tasks template
|
|
476
|
-
|
|
477
|
-
**Priority 2 (Should Customize)**:
|
|
478
|
-
4. File Location patterns
|
|
479
|
-
5. Quality Assurance checklist
|
|
480
|
-
6. Technology-specific examples throughout
|
|
481
|
-
|
|
482
|
-
**Priority 3 (Nice to Customize)**:
|
|
483
|
-
7. Additional layer sections if needed
|
|
484
|
-
8. Decision-Making Framework details
|
|
485
|
-
9. What to AVOID section (add project-specific anti-patterns)
|
|
486
|
-
|
|
487
|
-
The goal is to produce an agent that generates specifications perfectly aligned with the project's existing architecture, conventions, and technology stack.
|
|
154
|
+
### Step 1: Analyze Project
|
|
155
|
+
|
|
156
|
+
Discover project context from:
|
|
157
|
+
- `.codemie/guides/` folder (if exists)
|
|
158
|
+
- README.md, CONTRIBUTING.md, ARCHITECTURE.md
|
|
159
|
+
- Directory structure and existing code patterns
|
|
160
|
+
- Package files (package.json, pyproject.toml, pom.xml, go.mod)
|
|
161
|
+
- Existing specifications (find where they're stored)
|
|
162
|
+
|
|
163
|
+
### Step 2: Extract and Populate
|
|
164
|
+
|
|
165
|
+
| Placeholder | What to Extract |
|
|
166
|
+
|-------------|-----------------|
|
|
167
|
+
| `[ARCHITECTURE_PATTERN]` | Layered, MVC, Hexagonal, etc. |
|
|
168
|
+
| `[LAYER_1-4_NAME]` | Actual layer names (e.g., Controller, Service, Repository, Entity) |
|
|
169
|
+
| `[EXCEPTION_PATH]` | Path to project's exception/error classes |
|
|
170
|
+
| `[ASYNC_PATTERN]` | async/await, Promises, CompletableFuture |
|
|
171
|
+
| `[LANGUAGE]` `[VERSION]` | From package files |
|
|
172
|
+
| `[SPECS_DIRECTORY]` | Where existing specs live |
|
|
173
|
+
| `[NAMING_CONVENTION]` | kebab-case, snake_case, etc. |
|
|
174
|
+
| `[TICKET_PREFIX]` | Jira/GitHub/Linear prefix |
|
|
175
|
+
|
|
176
|
+
### Step 3: Customize Contract Format
|
|
177
|
+
|
|
178
|
+
Match project's type signature style:
|
|
179
|
+
- **Python**: `method(param: Type) -> ReturnType`
|
|
180
|
+
- **TypeScript**: `method(param: Type): Promise<ReturnType>`
|
|
181
|
+
- **Java**: `ReturnType method(Type param)`
|
|
182
|
+
- **Go**: `func Method(param Type) (ReturnType, error)`
|
|
183
|
+
|
|
184
|
+
### Step 4: Finalize Agent
|
|
185
|
+
|
|
186
|
+
- Remove all `[GENERATION INSTRUCTION]` blocks
|
|
187
|
+
- Remove this "Generation Instructions" section
|
|
188
|
+
- Ensure all placeholders are replaced
|
|
189
|
+
- **Target generated agent: 100-150 lines**
|
|
190
|
+
|
|
191
|
+
### Validation
|
|
192
|
+
|
|
193
|
+
- [ ] All `[PLACEHOLDERS]` replaced
|
|
194
|
+
- [ ] Layer names match project structure
|
|
195
|
+
- [ ] Contract format matches project conventions
|
|
196
|
+
- [ ] Specs directory is accurate
|
|
197
|
+
- [ ] No generation instructions remain
|