@deimoscloud/coreai 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/dist/cli/index.js +7 -0
  2. package/dist/cli/index.js.map +1 -1
  3. package/dist/index.js +7 -0
  4. package/dist/index.js.map +1 -1
  5. package/package.json +6 -1
  6. package/.prettierrc +0 -9
  7. package/AGENT_SPEC.md +0 -347
  8. package/ARCHITECTURE.md +0 -547
  9. package/DRAFT_PRD.md +0 -1440
  10. package/IMPLEMENTATION_PLAN.md +0 -256
  11. package/PRODUCT.md +0 -473
  12. package/WORKFLOWS.md +0 -295
  13. package/commands/core/check-inbox.md +0 -34
  14. package/commands/core/delegate.md +0 -30
  15. package/commands/core/git-commit.md +0 -144
  16. package/commands/core/pr-create.md +0 -193
  17. package/commands/core/review.md +0 -56
  18. package/commands/core/sprint-status.md +0 -65
  19. package/commands/optional/docs-update.md +0 -200
  20. package/commands/optional/jira-create.md +0 -200
  21. package/commands/optional/jira-transition.md +0 -184
  22. package/commands/optional/worktree-cleanup.md +0 -167
  23. package/commands/optional/worktree-setup.md +0 -110
  24. package/eslint.config.js +0 -29
  25. package/jest.config.js +0 -22
  26. package/knowledge-library/README.md +0 -118
  27. package/knowledge-library/android-engineer/context/current.txt +0 -42
  28. package/knowledge-library/android-engineer/control/decisions.txt +0 -9
  29. package/knowledge-library/android-engineer/control/dependencies.txt +0 -19
  30. package/knowledge-library/android-engineer/control/objectives.txt +0 -26
  31. package/knowledge-library/android-engineer/history/.gitkeep +0 -0
  32. package/knowledge-library/android-engineer/inbox/processed/.gitkeep +0 -0
  33. package/knowledge-library/android-engineer/outbox/.gitkeep +0 -0
  34. package/knowledge-library/android-engineer/tech/.gitkeep +0 -0
  35. package/knowledge-library/architecture.txt +0 -61
  36. package/knowledge-library/backend-engineer/context/current.txt +0 -42
  37. package/knowledge-library/backend-engineer/control/decisions.txt +0 -9
  38. package/knowledge-library/backend-engineer/control/dependencies.txt +0 -19
  39. package/knowledge-library/backend-engineer/control/objectives.txt +0 -26
  40. package/knowledge-library/backend-engineer/history/.gitkeep +0 -0
  41. package/knowledge-library/backend-engineer/inbox/processed/.gitkeep +0 -0
  42. package/knowledge-library/backend-engineer/outbox/.gitkeep +0 -0
  43. package/knowledge-library/backend-engineer/tech/.gitkeep +0 -0
  44. package/knowledge-library/context.txt +0 -52
  45. package/knowledge-library/devops-engineer/context/current.txt +0 -42
  46. package/knowledge-library/devops-engineer/control/decisions.txt +0 -9
  47. package/knowledge-library/devops-engineer/control/dependencies.txt +0 -19
  48. package/knowledge-library/devops-engineer/control/objectives.txt +0 -26
  49. package/knowledge-library/devops-engineer/history/.gitkeep +0 -0
  50. package/knowledge-library/devops-engineer/inbox/processed/.gitkeep +0 -0
  51. package/knowledge-library/devops-engineer/outbox/.gitkeep +0 -0
  52. package/knowledge-library/devops-engineer/tech/.gitkeep +0 -0
  53. package/knowledge-library/engineering-manager/context/current.txt +0 -40
  54. package/knowledge-library/engineering-manager/control/decisions.txt +0 -9
  55. package/knowledge-library/engineering-manager/control/objectives.txt +0 -27
  56. package/knowledge-library/engineering-manager/history/.gitkeep +0 -0
  57. package/knowledge-library/engineering-manager/inbox/processed/.gitkeep +0 -0
  58. package/knowledge-library/engineering-manager/outbox/.gitkeep +0 -0
  59. package/knowledge-library/engineering-manager/tech/.gitkeep +0 -0
  60. package/knowledge-library/prd.txt +0 -81
  61. package/knowledge-library/product-manager/context/current.txt +0 -42
  62. package/knowledge-library/product-manager/control/decisions.txt +0 -9
  63. package/knowledge-library/product-manager/control/dependencies.txt +0 -19
  64. package/knowledge-library/product-manager/control/objectives.txt +0 -26
  65. package/knowledge-library/product-manager/history/.gitkeep +0 -0
  66. package/knowledge-library/product-manager/inbox/processed/.gitkeep +0 -0
  67. package/knowledge-library/product-manager/outbox/.gitkeep +0 -0
  68. package/knowledge-library/product-manager/tech/.gitkeep +0 -0
  69. package/knowledge-library/qa-engineer/context/current.txt +0 -42
  70. package/knowledge-library/qa-engineer/control/decisions.txt +0 -9
  71. package/knowledge-library/qa-engineer/control/dependencies.txt +0 -19
  72. package/knowledge-library/qa-engineer/control/objectives.txt +0 -26
  73. package/knowledge-library/qa-engineer/history/.gitkeep +0 -0
  74. package/knowledge-library/qa-engineer/inbox/processed/.gitkeep +0 -0
  75. package/knowledge-library/qa-engineer/outbox/.gitkeep +0 -0
  76. package/knowledge-library/qa-engineer/tech/.gitkeep +0 -0
  77. package/knowledge-library/security-engineer/context/current.txt +0 -42
  78. package/knowledge-library/security-engineer/control/decisions.txt +0 -9
  79. package/knowledge-library/security-engineer/control/dependencies.txt +0 -19
  80. package/knowledge-library/security-engineer/control/objectives.txt +0 -26
  81. package/knowledge-library/security-engineer/history/.gitkeep +0 -0
  82. package/knowledge-library/security-engineer/inbox/processed/.gitkeep +0 -0
  83. package/knowledge-library/security-engineer/outbox/.gitkeep +0 -0
  84. package/knowledge-library/security-engineer/tech/.gitkeep +0 -0
  85. package/knowledge-library/solutions-architect/context/current.txt +0 -42
  86. package/knowledge-library/solutions-architect/control/decisions.txt +0 -9
  87. package/knowledge-library/solutions-architect/control/dependencies.txt +0 -19
  88. package/knowledge-library/solutions-architect/control/objectives.txt +0 -26
  89. package/knowledge-library/solutions-architect/history/.gitkeep +0 -0
  90. package/knowledge-library/solutions-architect/inbox/processed/.gitkeep +0 -0
  91. package/knowledge-library/solutions-architect/outbox/.gitkeep +0 -0
  92. package/knowledge-library/solutions-architect/tech/.gitkeep +0 -0
  93. package/knowledge-library/wearos-engineer/context/current.txt +0 -42
  94. package/knowledge-library/wearos-engineer/control/decisions.txt +0 -9
  95. package/knowledge-library/wearos-engineer/control/dependencies.txt +0 -19
  96. package/knowledge-library/wearos-engineer/control/objectives.txt +0 -26
  97. package/knowledge-library/wearos-engineer/history/.gitkeep +0 -0
  98. package/knowledge-library/wearos-engineer/inbox/processed/.gitkeep +0 -0
  99. package/knowledge-library/wearos-engineer/outbox/.gitkeep +0 -0
  100. package/knowledge-library/wearos-engineer/tech/.gitkeep +0 -0
  101. package/scripts/add-agent.sh +0 -323
  102. package/scripts/install.sh +0 -354
  103. package/src/adapters/factory.test.ts +0 -386
  104. package/src/adapters/factory.ts +0 -305
  105. package/src/adapters/index.ts +0 -113
  106. package/src/adapters/interfaces.ts +0 -268
  107. package/src/adapters/mcp/client.test.ts +0 -130
  108. package/src/adapters/mcp/client.ts +0 -451
  109. package/src/adapters/mcp/discovery.test.ts +0 -315
  110. package/src/adapters/mcp/discovery.ts +0 -340
  111. package/src/adapters/mcp/index.ts +0 -66
  112. package/src/adapters/mcp/mapper.test.ts +0 -218
  113. package/src/adapters/mcp/mapper.ts +0 -536
  114. package/src/adapters/mcp/registry.test.ts +0 -433
  115. package/src/adapters/mcp/registry.ts +0 -550
  116. package/src/adapters/mcp/types.ts +0 -258
  117. package/src/adapters/native/filesystem.test.ts +0 -350
  118. package/src/adapters/native/filesystem.ts +0 -393
  119. package/src/adapters/native/github.test.ts +0 -173
  120. package/src/adapters/native/github.ts +0 -627
  121. package/src/adapters/native/index.ts +0 -22
  122. package/src/adapters/native/selector.test.ts +0 -224
  123. package/src/adapters/native/selector.ts +0 -150
  124. package/src/adapters/types.ts +0 -270
  125. package/src/agents/compiler.test.ts +0 -410
  126. package/src/agents/compiler.ts +0 -424
  127. package/src/agents/index.ts +0 -37
  128. package/src/agents/loader.test.ts +0 -319
  129. package/src/agents/loader.ts +0 -143
  130. package/src/agents/resolver.test.ts +0 -282
  131. package/src/agents/resolver.ts +0 -262
  132. package/src/agents/types.ts +0 -97
  133. package/src/cache/index.ts +0 -38
  134. package/src/cache/interfaces.ts +0 -283
  135. package/src/cache/manager.test.ts +0 -266
  136. package/src/cache/manager.ts +0 -388
  137. package/src/cache/provider.test.ts +0 -485
  138. package/src/cache/provider.ts +0 -745
  139. package/src/cache/types.test.ts +0 -192
  140. package/src/cache/types.ts +0 -313
  141. package/src/cli/commands/build.test.ts +0 -248
  142. package/src/cli/commands/build.ts +0 -284
  143. package/src/cli/commands/cache.test.ts +0 -221
  144. package/src/cli/commands/cache.ts +0 -229
  145. package/src/cli/commands/index.ts +0 -63
  146. package/src/cli/commands/init.test.ts +0 -173
  147. package/src/cli/commands/init.ts +0 -296
  148. package/src/cli/commands/skills.test.ts +0 -272
  149. package/src/cli/commands/skills.ts +0 -348
  150. package/src/cli/commands/status.test.ts +0 -392
  151. package/src/cli/commands/status.ts +0 -332
  152. package/src/cli/commands/sync.test.ts +0 -213
  153. package/src/cli/commands/sync.ts +0 -251
  154. package/src/cli/commands/validate.test.ts +0 -216
  155. package/src/cli/commands/validate.ts +0 -340
  156. package/src/cli/index.test.ts +0 -190
  157. package/src/cli/index.ts +0 -493
  158. package/src/commands/context.test.ts +0 -163
  159. package/src/commands/context.ts +0 -111
  160. package/src/commands/index.ts +0 -56
  161. package/src/commands/loader.test.ts +0 -273
  162. package/src/commands/loader.ts +0 -355
  163. package/src/commands/registry.test.ts +0 -384
  164. package/src/commands/registry.ts +0 -248
  165. package/src/commands/runner.test.ts +0 -297
  166. package/src/commands/runner.ts +0 -222
  167. package/src/commands/types.ts +0 -361
  168. package/src/config/index.ts +0 -19
  169. package/src/config/loader.test.ts +0 -262
  170. package/src/config/loader.ts +0 -188
  171. package/src/config/types.ts +0 -154
  172. package/src/context/index.ts +0 -14
  173. package/src/context/loader.test.ts +0 -334
  174. package/src/context/loader.ts +0 -357
  175. package/src/index.test.ts +0 -13
  176. package/src/index.ts +0 -268
  177. package/src/knowledge-library/index.ts +0 -44
  178. package/src/knowledge-library/manager.test.ts +0 -536
  179. package/src/knowledge-library/manager.ts +0 -804
  180. package/src/knowledge-library/types.ts +0 -432
  181. package/src/skills/generator.test.ts +0 -602
  182. package/src/skills/generator.ts +0 -491
  183. package/src/skills/index.ts +0 -27
  184. package/src/skills/templates.ts +0 -520
  185. package/src/skills/types.ts +0 -251
  186. package/templates/completion-report.md +0 -72
  187. package/templates/feedback.md +0 -56
  188. package/templates/project-files/CLAUDE.md.template +0 -109
  189. package/templates/project-files/coreai.json.example +0 -47
  190. package/templates/project-files/mcp.json.template +0 -20
  191. package/templates/review-complete.md +0 -64
  192. package/templates/review-request.md +0 -67
  193. package/templates/task-assignment.md +0 -51
  194. package/tsconfig.build.json +0 -4
  195. package/tsconfig.json +0 -26
  196. package/tsup.config.ts +0 -23
package/DRAFT_PRD.md DELETED
@@ -1,1440 +0,0 @@
1
- # CoreAI Platform - Product Requirements Document (DRAFT)
2
-
3
- **Version:** 0.1 (Draft)
4
- **Author:** [Your Name]
5
- **Date:** 2026-01-22
6
- **Status:** Draft for Review
7
-
8
- ---
9
-
10
- ## 1. Problem Statement
11
-
12
- ### Current State
13
- CoreAI is a file-based framework for orchestrating AI agents that simulate a software development team. It works well for a single engineer on a single project but breaks down when:
14
-
15
- 1. **Multiple engineers work on the same project** - Local KnowledgeLibrary files drift between engineers, causing context inconsistency and conflicting agent states.
16
-
17
- 2. **Adapting to different projects** - Agent files contain hardcoded references to specific projects (e.g., Surftrack), requiring extensive manual edits when reusing on new projects.
18
-
19
- 3. **Different tooling across clients/projects** - Some clients use Jira, others use Linear. Some use GitHub, others GitLab. Commands and workflows hardcode these assumptions.
20
-
21
- 4. **Different quality gates** - Infrastructure projects have different quality requirements than frontend apps. Build commands, linters, and test frameworks vary widely.
22
-
23
- 5. **Distribution and updates** - No mechanism to distribute improvements or push updates to projects already using the framework.
24
-
25
- ### Pain Points Observed
26
- - Copying framework to a client infrastructure project required extensive manual changes
27
- - Two SREs working on the same project would have divergent KnowledgeLibrary states
28
- - Agent files mixed generic role behavior with project-specific context
29
- - No way to "upgrade" a project to a newer version of CoreAI
30
-
31
- ---
32
-
33
- ## 2. Vision
34
-
35
- **CoreAI Platform** - A configurable, team-ready AI agent orchestration platform with remote state management and pluggable integrations.
36
-
37
- ### Core Principles
38
- 1. **Remote state by default** - All shared context lives in tools teams already use (Confluence, Notion, etc.)
39
- 2. **Configuration over customization** - Project differences are captured in config, not code changes
40
- 3. **Generic agents, specific context** - Agent files define behavior/role; project context comes from remote sources
41
- 4. **Seamless updates** - Teams can upgrade to new CoreAI versions without losing their configuration
42
-
43
- ---
44
-
45
- ## 3. Goals & Success Metrics
46
-
47
- ### Goals
48
- | Goal | Description |
49
- |------|-------------|
50
- | **G1** | Multiple engineers can use CoreAI on the same project with consistent shared state |
51
- | **G2** | Setting up CoreAI on a new project takes <10 minutes of configuration |
52
- | **G3** | Agent definitions are reusable across any project without modification |
53
- | **G4** | Supporting a new tooling combination (e.g., Linear + GitLab) requires only config changes |
54
- | **G5** | Updates to CoreAI core can be distributed to existing installations |
55
-
56
- ### Success Metrics
57
- | Metric | Target |
58
- |--------|--------|
59
- | Time to configure new project | < 10 minutes |
60
- | Manual file edits required after config | 0 |
61
- | Agent file changes needed per project | 0 |
62
- | State sync issues between team members | 0 |
63
-
64
- ---
65
-
66
- ## 4. User Personas
67
-
68
- ### Persona 1: Engineering Lead (Primary)
69
- - Sets up CoreAI for their team
70
- - Configures integrations (Jira/Linear, GitHub/GitLab, Confluence/Notion)
71
- - Maintains the configuration as project needs evolve
72
-
73
- ### Persona 2: Individual Contributor
74
- - Uses CoreAI daily without managing configuration
75
- - Expects consistent experience with teammates
76
- - Shouldn't need to understand CoreAI internals
77
-
78
- ### Persona 3: Platform Admin
79
- - Manages CoreAI across multiple client projects
80
- - Needs to distribute updates
81
- - Needs visibility into which projects use which versions
82
-
83
- ---
84
-
85
- ## 5. Architecture Proposal
86
-
87
- ### 5.1 High-Level Components
88
-
89
- ```
90
- ┌─────────────────────────────────────────────────────────────────┐
91
- │ CoreAI Platform │
92
- ├─────────────────────────────────────────────────────────────────┤
93
- │ │
94
- │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
95
- │ │ Agent │ │ Config │ │ Integration │ │
96
- │ │ Registry │ │ Schema │ │ Adapters │ │
97
- │ │ │ │ │ │ │ │
98
- │ │ - Generic │ │ - Project │ │ - Issue Trackers │ │
99
- │ │ role defs │ │ settings │ │ (Jira, Linear, │ │
100
- │ │ - Behaviors │ │ - Tooling │ │ GitHub Issues) │ │
101
- │ │ - Protocols │ │ - Quality │ │ │ │
102
- │ │ │ │ gates │ │ - Git Providers │ │
103
- │ └─────────────┘ │ - Team │ │ (GitHub, GitLab, │ │
104
- │ │ structure │ │ Bitbucket) │ │
105
- │ └─────────────┘ │ │ │
106
- │ │ - Documentation │ │
107
- │ │ (Confluence, │ │
108
- │ │ Notion, etc.) │ │
109
- │ └─────────────────────┘ │
110
- │ │
111
- └─────────────────────────────────────────────────────────────────┘
112
-
113
- ┌───────────────────┴───────────────────┐
114
- │ │
115
- ▼ ▼
116
- ┌─────────────────────────┐ ┌─────────────────────────┐
117
- │ REMOTE (Shared) │ │ LOCAL (Per-Engineer) │
118
- │ Confluence/Notion │ │ KnowledgeLibrary/ │
119
- ├─────────────────────────┤ ├─────────────────────────┤
120
- │ • PRD │ │ • Agent inbox/outbox │
121
- │ • Architecture docs │ │ • Personal context │
122
- │ • Project context │ │ • Objectives/decisions │
123
- │ • Tech decisions │ │ • Working notes │
124
- │ │ │ │
125
- │ Single source of truth │ │ Per-engineer state │
126
- │ for entire team │ │ (no sync needed) │
127
- └─────────────────────────┘ └─────────────────────────┘
128
- ```
129
-
130
- ### 5.2 Component Details
131
-
132
- #### Agent Registry
133
- A library of generic agent definitions stored as YAML, compiled to markdown for Claude.
134
-
135
- **Key Principles:**
136
- - YAML is the source of truth (structured, tooling-friendly)
137
- - Build step generates `.md` files Claude actually reads
138
- - Agent definitions contain NO project-specific information
139
- - Project context comes from config + remote sources at runtime
140
-
141
- **YAML → Markdown Pipeline:**
142
- ```
143
- agents/
144
- backend-engineer.yaml ──┐
145
- frontend-engineer.yaml │ coreai build
146
- devops-engineer.yaml ├─────────────────► .claude/agents/
147
- ... │ backend-engineer.md
148
- │ frontend-engineer.md
149
- coreai.config.yaml ───────────┘ ...
150
- ```
151
-
152
- **Example Agent Definition (YAML Source):**
153
- ```yaml
154
- # backend-engineer.yaml
155
- role: backend-engineer
156
- type: ic-engineer
157
- display_name: Backend Engineer
158
-
159
- # ─────────────────────────────────────────────────────────────
160
- # ROLE DEFINITION
161
- # ─────────────────────────────────────────────────────────────
162
-
163
- description: |
164
- You are a Backend Engineer responsible for server-side implementation,
165
- API development, database design, and backend infrastructure.
166
-
167
- responsibilities:
168
- - Implement backend features, APIs, and services
169
- - Write and maintain unit and integration tests
170
- - Design and optimize database schemas
171
- - Perform code reviews when requested
172
- - Document technical decisions and API contracts
173
-
174
- # ─────────────────────────────────────────────────────────────
175
- # EXPERTISE & SKILLS
176
- # ─────────────────────────────────────────────────────────────
177
-
178
- expertise:
179
- primary:
180
- - API design (REST, GraphQL, gRPC)
181
- - Database design and optimization
182
- - Authentication and authorization
183
- - Caching strategies
184
- - Message queues and async processing
185
-
186
- # Resolved from config at build time
187
- tech_stack: ${config.tech_stack} # e.g., Node.js, Python, Go, etc.
188
-
189
- skills:
190
- - Code review with focus on performance, security, maintainability
191
- - Debugging and troubleshooting production issues
192
- - Writing technical documentation
193
- - Estimating implementation complexity
194
-
195
- # ─────────────────────────────────────────────────────────────
196
- # DEVELOPMENT PRINCIPLES
197
- # ─────────────────────────────────────────────────────────────
198
-
199
- principles:
200
- code_quality:
201
- - Write clean, readable, self-documenting code
202
- - Follow SOLID principles and established patterns
203
- - Prefer composition over inheritance
204
- - Keep functions small and focused
205
-
206
- testing:
207
- - Write tests before or alongside implementation
208
- - Aim for high coverage on critical paths
209
- - Use meaningful test names that describe behavior
210
- - Mock external dependencies appropriately
211
-
212
- security:
213
- - Never trust user input - validate and sanitize
214
- - Use parameterized queries to prevent SQL injection
215
- - Implement proper authentication and authorization
216
- - Keep dependencies updated for security patches
217
-
218
- performance:
219
- - Profile before optimizing
220
- - Use appropriate data structures and algorithms
221
- - Implement caching where beneficial
222
- - Design for horizontal scalability
223
-
224
- # ─────────────────────────────────────────────────────────────
225
- # WORKFLOW & BEHAVIOR
226
- # ─────────────────────────────────────────────────────────────
227
-
228
- behaviors:
229
- workflow: ticket-implementation
230
- quality_gates: ${config.quality_gates} # Resolved from project config
231
-
232
- # ─────────────────────────────────────────────────────────────
233
- # CONTEXT SOURCES
234
- # ─────────────────────────────────────────────────────────────
235
-
236
- context_sources:
237
- # REMOTE - fetched from Confluence/Notion at startup
238
- shared:
239
- - ${remote.documentation}/architecture
240
- - ${remote.documentation}/prd
241
- - ${remote.documentation}/context
242
-
243
- # LOCAL - stays in local KnowledgeLibrary (per-engineer)
244
- personal:
245
- - KnowledgeLibrary/${agent.name}/context/current.txt
246
- - KnowledgeLibrary/${agent.name}/control/objectives.txt
247
-
248
- communication:
249
- inbox: KnowledgeLibrary/${agent.name}/inbox
250
- outbox: KnowledgeLibrary/${agent.name}/outbox
251
- ```
252
-
253
- **Generated Markdown Output:**
254
- The build process combines the YAML definition with project config to produce a complete `.md` file:
255
- - Resolves `${config.*}` variables from `coreai.config.yaml`
256
- - Fetches and embeds remote shared context (or includes fetch instructions)
257
- - Formats into the markdown structure Claude expects
258
- - Includes local context file paths
259
-
260
- #### Configuration Schema
261
- A single configuration file per project that defines:
262
-
263
- ```yaml
264
- # coreai.config.yaml
265
- version: "1.0"
266
-
267
- project:
268
- name: "Client Infrastructure"
269
- type: infrastructure # software | infrastructure | data | mobile
270
-
271
- team:
272
- agents:
273
- - backend-engineer
274
- - devops-engineer
275
- - security-engineer
276
- - engineering-manager
277
-
278
- integrations:
279
- issue_tracker:
280
- provider: jira # jira | linear | github-issues | azure-devops
281
- config:
282
- project_key: INFRA
283
- base_url: https://client.atlassian.net
284
-
285
- git:
286
- provider: github # github | gitlab | bitbucket | azure-devops
287
- config:
288
- repo: client-org/infrastructure
289
- default_branch: main
290
-
291
- documentation:
292
- provider: confluence # confluence | notion | github-wiki | local
293
- config:
294
- space_key: INFRA
295
- base_url: https://client.atlassian.net/wiki
296
-
297
- state:
298
- provider: confluence # confluence | notion | s3 | github-repo
299
- config:
300
- space_key: INFRA
301
- base_path: /CoreAI/State
302
-
303
- quality_gates:
304
- lint:
305
- command: "terraform fmt -check"
306
- required: true
307
- validate:
308
- command: "terraform validate"
309
- required: true
310
- security_scan:
311
- command: "tfsec ."
312
- required: true
313
- test:
314
- command: "terratest"
315
- required: false # Not all infra projects have tests
316
-
317
- tech_stack:
318
- primary_language: hcl
319
- frameworks: [terraform, terragrunt]
320
- cloud: aws
321
- ```
322
-
323
- #### Integration Adapters
324
- Pluggable adapters that translate CoreAI operations to specific tools. Each adapter implements a standard interface, allowing commands and workflows to work identically regardless of underlying tool.
325
-
326
- **Interface Summary:**
327
-
328
- | Interface | Operations | Implementations |
329
- |-----------|------------|-----------------|
330
- | `IssueTracker` | createTicket, transitionTicket, getTicket, search | JiraAdapter, LinearAdapter, GitHubIssuesAdapter |
331
- | `GitProvider` | createBranch, createPR, getPR, mergePR | GitHubAdapter, GitLabAdapter, BitbucketAdapter |
332
- | `DocumentationProvider` | getPage, updatePage, createPage | ConfluenceAdapter, NotionAdapter |
333
-
334
- **How Adapters Work:**
335
-
336
- ```
337
- ┌─────────────────────────────────────────────────────────────────┐
338
- │ CoreAI Command/Workflow │
339
- │ │
340
- │ "Create a ticket for this bug" │
341
- │ │ │
342
- │ ▼ │
343
- │ ┌─────────────────────┐ │
344
- │ │ IssueTracker │ ◄── Interface (abstract) │
345
- │ │ .createTicket() │ │
346
- │ └─────────────────────┘ │
347
- │ │ │
348
- │ ┌───────────────┼───────────────┐ │
349
- │ ▼ ▼ ▼ │
350
- │ ┌───────────┐ ┌───────────┐ ┌───────────┐ │
351
- │ │ Jira │ │ Linear │ │ GitHub │ │
352
- │ │ Adapter │ │ Adapter │ │ Issues │ │
353
- │ └───────────┘ └───────────┘ └───────────┘ │
354
- │ │ │ │ │
355
- │ ▼ ▼ ▼ │
356
- │ POST /rest/ GraphQL POST /repos/ │
357
- │ api/2/issue mutation {owner}/{repo}/issues │
358
- └─────────────────────────────────────────────────────────────────┘
359
- ```
360
-
361
- **Adapter Selection:**
362
- Determined by `coreai.config.yaml`:
363
- ```yaml
364
- integrations:
365
- issue_tracker:
366
- provider: jira # ← Selects JiraAdapter
367
- ```
368
-
369
- **Interface Definitions:**
370
-
371
- ```typescript
372
- // IssueTracker Interface
373
- interface IssueTracker {
374
- createTicket(params: {
375
- title: string;
376
- description: string;
377
- type: 'bug' | 'story' | 'task';
378
- priority?: 'low' | 'medium' | 'high' | 'critical';
379
- labels?: string[];
380
- assignee?: string;
381
- }): Promise<{ id: string; key: string; url: string }>;
382
-
383
- getTicket(key: string): Promise<{
384
- key: string;
385
- title: string;
386
- description: string;
387
- status: string;
388
- assignee?: string;
389
- labels: string[];
390
- }>;
391
-
392
- transitionTicket(key: string, status: string): Promise<void>;
393
-
394
- search(query: string, options?: {
395
- status?: string[];
396
- assignee?: string;
397
- limit?: number;
398
- }): Promise<Ticket[]>;
399
-
400
- addComment(key: string, comment: string): Promise<void>;
401
- }
402
-
403
- // GitProvider Interface
404
- interface GitProvider {
405
- createBranch(params: {
406
- name: string;
407
- from?: string; // default: main/master
408
- }): Promise<{ name: string; url: string }>;
409
-
410
- createPR(params: {
411
- title: string;
412
- body: string;
413
- head: string; // source branch
414
- base?: string; // target branch (default: main)
415
- draft?: boolean;
416
- reviewers?: string[];
417
- }): Promise<{ number: number; url: string }>;
418
-
419
- getPR(number: number): Promise<{
420
- number: number;
421
- title: string;
422
- body: string;
423
- status: 'open' | 'closed' | 'merged';
424
- reviews: Review[];
425
- checks: Check[];
426
- }>;
427
-
428
- mergePR(number: number, options?: {
429
- method?: 'merge' | 'squash' | 'rebase';
430
- deleteSourceBranch?: boolean;
431
- }): Promise<void>;
432
-
433
- getFile(path: string, ref?: string): Promise<string>;
434
-
435
- listFiles(path: string, ref?: string): Promise<string[]>;
436
- }
437
-
438
- // DocumentationProvider Interface
439
- interface DocumentationProvider {
440
- getPage(path: string): Promise<{
441
- title: string;
442
- content: string; // markdown
443
- lastModified: Date;
444
- version?: string;
445
- }>;
446
-
447
- updatePage(path: string, params: {
448
- content: string;
449
- message?: string; // commit message or version note
450
- }): Promise<void>;
451
-
452
- createPage(params: {
453
- path: string;
454
- title: string;
455
- content: string;
456
- parent?: string;
457
- }): Promise<{ url: string }>;
458
-
459
- searchPages(query: string): Promise<{
460
- path: string;
461
- title: string;
462
- snippet: string;
463
- }[]>;
464
- }
465
- ```
466
-
467
- **Adapter Implementation Example (Jira):**
468
-
469
- ```typescript
470
- // adapters/jira.ts
471
- import { IssueTracker, Ticket } from '../interfaces';
472
-
473
- export class JiraAdapter implements IssueTracker {
474
- private baseUrl: string;
475
- private projectKey: string;
476
- private auth: { email: string; token: string };
477
-
478
- constructor(config: JiraConfig) {
479
- this.baseUrl = config.base_url;
480
- this.projectKey = config.project_key;
481
- this.auth = { email: config.email, token: config.api_token };
482
- }
483
-
484
- async createTicket(params: CreateTicketParams): Promise<TicketResult> {
485
- const response = await fetch(`${this.baseUrl}/rest/api/3/issue`, {
486
- method: 'POST',
487
- headers: this.getHeaders(),
488
- body: JSON.stringify({
489
- fields: {
490
- project: { key: this.projectKey },
491
- summary: params.title,
492
- description: this.toADF(params.description), // Jira uses ADF format
493
- issuetype: { name: this.mapType(params.type) },
494
- priority: params.priority ? { name: params.priority } : undefined,
495
- labels: params.labels,
496
- assignee: params.assignee ? { accountId: params.assignee } : undefined,
497
- }
498
- })
499
- });
500
-
501
- const data = await response.json();
502
- return {
503
- id: data.id,
504
- key: data.key,
505
- url: `${this.baseUrl}/browse/${data.key}`
506
- };
507
- }
508
-
509
- async transitionTicket(key: string, status: string): Promise<void> {
510
- // 1. Get available transitions
511
- const transitions = await this.getTransitions(key);
512
- const transition = transitions.find(t => t.to.name === status);
513
-
514
- if (!transition) {
515
- throw new Error(`Cannot transition ${key} to ${status}`);
516
- }
517
-
518
- // 2. Execute transition
519
- await fetch(`${this.baseUrl}/rest/api/3/issue/${key}/transitions`, {
520
- method: 'POST',
521
- headers: this.getHeaders(),
522
- body: JSON.stringify({ transition: { id: transition.id } })
523
- });
524
- }
525
-
526
- // ... other methods
527
- }
528
- ```
529
-
530
- **Using Adapters in Commands:**
531
-
532
- Commands become tool-agnostic by using the interface:
533
-
534
- ```typescript
535
- // commands/create-ticket.ts
536
- export async function createTicket(args: Args, context: Context) {
537
- // Get the configured adapter (Jira, Linear, etc.)
538
- const issueTracker = context.getAdapter<IssueTracker>('issue_tracker');
539
-
540
- // Same code works for any issue tracker
541
- const ticket = await issueTracker.createTicket({
542
- title: args.title,
543
- description: args.description,
544
- type: args.type ?? 'task',
545
- });
546
-
547
- return `Created ticket: ${ticket.key} - ${ticket.url}`;
548
- }
549
- ```
550
-
551
- **MCP Server Integration:**
552
-
553
- Adapters can also be exposed as MCP tools, allowing Claude to call them directly:
554
-
555
- ```yaml
556
- # coreai.config.yaml
557
- mcp:
558
- expose_adapters: true # Makes adapters available as MCP tools
559
- ```
560
-
561
- This generates MCP tool definitions like:
562
- - `coreai_create_ticket` → IssueTracker.createTicket()
563
- - `coreai_transition_ticket` → IssueTracker.transitionTicket()
564
- - `coreai_create_pr` → GitProvider.createPR()
565
- - etc.
566
-
567
- **Authentication:**
568
-
569
- Each adapter handles auth according to its provider's requirements:
570
-
571
- | Provider | Auth Method | Config Location |
572
- |----------|-------------|-----------------|
573
- | Jira | API Token | `JIRA_EMAIL` + `JIRA_API_TOKEN` env vars |
574
- | Linear | API Key | `LINEAR_API_KEY` env var |
575
- | GitHub | PAT or App | `GITHUB_TOKEN` env var or GitHub App |
576
- | GitLab | PAT | `GITLAB_TOKEN` env var |
577
- | Confluence | API Token | `CONFLUENCE_EMAIL` + `CONFLUENCE_TOKEN` env vars |
578
- | Notion | Integration Token | `NOTION_TOKEN` env var |
579
-
580
- ---
581
-
582
- #### MCP-Backed Adapters
583
-
584
- When an MCP server already exists for a tool (Jira, GitHub, Confluence, etc.), we should use it instead of implementing our own API calls. This gives us:
585
- - Battle-tested implementations maintained by others
586
- - Consistent auth handling via MCP config
587
- - Less code to maintain
588
- - Community improvements for free
589
-
590
- **Adapter Implementation Strategies:**
591
-
592
- ```
593
- ┌─────────────────────────────────────────────────────────────────┐
594
- │ IssueTracker Interface │
595
- │ │
596
- │ .createTicket() │
597
- │ .transitionTicket() │
598
- │ .getTicket() │
599
- │ │ │
600
- │ ┌───────────────┼───────────────┐ │
601
- │ ▼ ▼ ▼ │
602
- │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
603
- │ │ Native │ │ MCP-Based │ │ Hybrid │ │
604
- │ │ Adapter │ │ Adapter │ │ Adapter │ │
605
- │ └─────────────┘ └─────────────┘ └─────────────┘ │
606
- │ │ │ │ │
607
- │ ▼ ▼ ▼ │
608
- │ Direct API calls MCP Server calls MCP + fallback │
609
- │ (fetch/axios) (tool invocation) to native API │
610
- └─────────────────────────────────────────────────────────────────┘
611
- ```
612
-
613
- **Configuration for MCP-Backed Adapters:**
614
-
615
- ```yaml
616
- # coreai.config.yaml
617
- integrations:
618
- issue_tracker:
619
- provider: jira
620
-
621
- # Strategy: 'mcp' | 'native' | 'auto'
622
- # - mcp: Use MCP server exclusively (fail if not available)
623
- # - native: Use built-in API adapter (no MCP dependency)
624
- # - auto: Use MCP if available, fall back to native
625
- strategy: mcp
626
-
627
- # MCP server configuration (when strategy is 'mcp' or 'auto')
628
- mcp:
629
- server: "@anthropic/jira-mcp" # npm package or path
630
- # OR reference existing MCP config
631
- server_name: "jira" # references server in claude_desktop_config.json
632
-
633
- # Native config (when strategy is 'native' or 'auto' fallback)
634
- config:
635
- project_key: PROJ
636
- base_url: https://company.atlassian.net
637
-
638
- git:
639
- provider: github
640
- strategy: mcp
641
- mcp:
642
- server_name: "github" # Use existing GitHub MCP from user's config
643
-
644
- documentation:
645
- provider: confluence
646
- strategy: auto # Try MCP first, fall back to native
647
- mcp:
648
- server: "@anthropic/confluence-mcp"
649
- config:
650
- space_key: DOCS
651
- base_url: https://company.atlassian.net/wiki
652
- ```
653
-
654
- **MCP Adapter Implementation:**
655
-
656
- ```typescript
657
- // adapters/mcp-jira.ts
658
- import { IssueTracker, Ticket } from '../interfaces';
659
- import { MCPClient } from '../mcp/client';
660
-
661
- export class MCPJiraAdapter implements IssueTracker {
662
- private mcp: MCPClient;
663
- private serverName: string;
664
-
665
- constructor(config: MCPAdapterConfig) {
666
- this.serverName = config.server_name;
667
- this.mcp = new MCPClient();
668
- }
669
-
670
- async createTicket(params: CreateTicketParams): Promise<TicketResult> {
671
- // Call the MCP tool instead of direct API
672
- const result = await this.mcp.callTool(this.serverName, 'jira_create_issue', {
673
- project: params.projectKey,
674
- summary: params.title,
675
- description: params.description,
676
- issuetype: params.type,
677
- priority: params.priority,
678
- });
679
-
680
- return {
681
- id: result.id,
682
- key: result.key,
683
- url: result.url,
684
- };
685
- }
686
-
687
- async transitionTicket(key: string, status: string): Promise<void> {
688
- await this.mcp.callTool(this.serverName, 'jira_transition_issue', {
689
- issue_key: key,
690
- transition: status,
691
- });
692
- }
693
-
694
- async getTicket(key: string): Promise<Ticket> {
695
- const result = await this.mcp.callTool(this.serverName, 'jira_get_issue', {
696
- issue_key: key,
697
- });
698
-
699
- return {
700
- key: result.key,
701
- title: result.summary,
702
- description: result.description,
703
- status: result.status,
704
- assignee: result.assignee,
705
- labels: result.labels,
706
- };
707
- }
708
-
709
- // ... other methods map to MCP tools
710
- }
711
- ```
712
-
713
- **How MCP Tool Mapping Works:**
714
-
715
- The challenge: MCP servers don't follow a standard naming convention. One Jira MCP might call it `jira_create_issue`, another calls it `create_ticket`. We need a translation layer.
716
-
717
- **Our approach: Supported MCP Servers (Curated List)**
718
-
719
- CoreAI maintains a curated list of **officially supported MCP servers** with built-in mappings. These are tested and maintained as part of CoreAI releases.
720
-
721
- ```
722
- ┌─────────────────────────────────────────────────────────────────┐
723
- │ CoreAI Supported MCP Servers │
724
- │ (Built-in, Maintained) │
725
- ├─────────────────────────────────────────────────────────────────┤
726
- │ │
727
- │ Issue Trackers: │
728
- │ ├── @anthropic/jira-mcp (official) │
729
- │ ├── @modelcontextprotocol/jira-server │
730
- │ └── @linear/mcp-server │
731
- │ │
732
- │ Git Providers: │
733
- │ ├── @anthropic/github-mcp (official) │
734
- │ ├── @modelcontextprotocol/github-server │
735
- │ └── @gitlab/mcp-server │
736
- │ │
737
- │ Documentation: │
738
- │ ├── @anthropic/confluence-mcp (official) │
739
- │ └── @notionhq/mcp-server │
740
- │ │
741
- └─────────────────────────────────────────────────────────────────┘
742
- ```
743
-
744
- **When you configure an integration:**
745
-
746
- ```yaml
747
- integrations:
748
- issue_tracker:
749
- provider: jira
750
- strategy: mcp
751
- mcp:
752
- server_name: "jira" # References your existing MCP config
753
- ```
754
-
755
- CoreAI:
756
- 1. Looks up "jira" in your MCP config to find the server
757
- 2. Identifies which supported MCP server it is (by package name or auto-detection)
758
- 3. Uses the built-in mapping for that server
759
-
760
- **No manual mapping required for supported servers.**
761
-
762
- **How We Identify the MCP Server:**
763
-
764
- ```typescript
765
- // On first use, CoreAI queries the MCP server
766
- const serverInfo = await mcp.getServerInfo("jira");
767
- // Returns: { name: "@anthropic/jira-mcp", version: "1.2.0", tools: [...] }
768
-
769
- // Look up in our supported servers registry
770
- const mapping = SUPPORTED_MCP_SERVERS["@anthropic/jira-mcp"];
771
- // Returns built-in mapping for this server
772
- ```
773
-
774
- **Auto-Discovery for Unknown Servers:**
775
-
776
- If the MCP server isn't in our supported list, we attempt auto-discovery:
777
-
778
- ```typescript
779
- // 1. Get available tools from the MCP server
780
- const tools = await mcp.listTools("custom-jira");
781
- // Returns: ["create_issue", "get_issue", "transition", "search", "comment"]
782
-
783
- // 2. Use fuzzy matching to map to our interface
784
- const autoMapping = {
785
- createTicket: findToolMatch(tools, ["create_issue", "create_ticket", "new_issue"]),
786
- getTicket: findToolMatch(tools, ["get_issue", "fetch_issue", "read_issue"]),
787
- // ...
788
- };
789
-
790
- // 3. If high confidence (>80% match), use auto-discovered mapping
791
- // 4. If low confidence, warn user and ask for explicit mapping
792
- ```
793
-
794
- **Three Scenarios:**
795
-
796
- | Scenario | What Happens | User Action |
797
- |----------|--------------|-------------|
798
- | **Supported MCP server** | Built-in mapping used automatically | None - just works |
799
- | **Unknown server, auto-discovery succeeds** | Auto-mapping used with warning | Review mapping (optional) |
800
- | **Unknown server, auto-discovery fails** | Error with helpful message | Provide explicit mapping |
801
-
802
- **Explicit Mapping (Only for Custom/Unsupported Servers):**
803
-
804
- If you're using a custom or unsupported MCP server, you provide the mapping:
805
-
806
- ```yaml
807
- integrations:
808
- issue_tracker:
809
- provider: jira
810
- strategy: mcp
811
- mcp:
812
- server_name: "my-custom-jira-mcp"
813
- # Only needed for unsupported servers
814
- tool_mappings:
815
- createTicket: my_create_ticket
816
- getTicket: my_get_ticket
817
- transitionTicket: my_transition
818
- search: my_search
819
- addComment: my_comment
820
- ```
821
-
822
- **Contributing New MCP Server Support:**
823
-
824
- When a new MCP server becomes popular, we add it to the supported list:
825
-
826
- ```typescript
827
- // src/mcp/supported-servers.ts
828
- export const SUPPORTED_MCP_SERVERS = {
829
- "@anthropic/jira-mcp": {
830
- type: "issue_tracker",
831
- provider: "jira",
832
- mappings: {
833
- createTicket: "jira_create_issue",
834
- getTicket: "jira_get_issue",
835
- transitionTicket: "jira_transition_issue",
836
- search: "jira_search",
837
- addComment: "jira_add_comment",
838
- },
839
- },
840
-
841
- "@linear/mcp-server": {
842
- type: "issue_tracker",
843
- provider: "linear",
844
- mappings: {
845
- createTicket: "createIssue",
846
- getTicket: "getIssue",
847
- transitionTicket: "updateIssueState",
848
- search: "searchIssues",
849
- addComment: "createComment",
850
- },
851
- },
852
-
853
- // ... more servers
854
- };
855
- ```
856
-
857
- This is similar to how database ORMs work:
858
- - Prisma supports PostgreSQL, MySQL, SQLite out of the box
859
- - Each has different SQL dialects, but Prisma handles the translation
860
- - You can add custom drivers for unsupported databases
861
-
862
- **Summary:**
863
-
864
- | Question | Answer |
865
- |----------|--------|
866
- | Do I need to map tools manually? | No, for supported MCP servers |
867
- | What if I use a custom MCP server? | Auto-discovery tries first, then explicit mapping |
868
- | How do new MCP servers get supported? | CoreAI releases add them to the curated list |
869
- | Can I contribute a mapping? | Yes, via PR to CoreAI repo |
870
-
871
- **Adapter Factory:**
872
-
873
- The system automatically selects the right adapter based on config:
874
-
875
- ```typescript
876
- // adapters/factory.ts
877
- export function createAdapter(
878
- type: 'issue_tracker' | 'git' | 'documentation',
879
- config: IntegrationConfig
880
- ): IssueTracker | GitProvider | DocumentationProvider {
881
-
882
- const strategy = config.strategy ?? 'auto';
883
-
884
- if (strategy === 'mcp' || strategy === 'auto') {
885
- // Check if MCP server is available
886
- if (config.mcp && isMCPServerAvailable(config.mcp)) {
887
- return createMCPAdapter(type, config);
888
- }
889
-
890
- if (strategy === 'mcp') {
891
- throw new Error(`MCP server required but not available: ${config.mcp.server_name}`);
892
- }
893
- }
894
-
895
- // Fall back to native adapter
896
- return createNativeAdapter(type, config);
897
- }
898
- ```
899
-
900
- **Benefits of MCP-First Approach:**
901
-
902
- | Benefit | Description |
903
- |---------|-------------|
904
- | **Reuse existing setup** | If user already has Jira MCP configured, just reference it |
905
- | **Auth handled by MCP** | No need to manage API tokens separately |
906
- | **Community maintained** | MCP servers get updates and fixes from maintainers |
907
- | **Consistent experience** | Same MCP tools work in Claude Desktop, CLI, and CoreAI |
908
- | **Fallback option** | Native adapters available when MCP not suitable |
909
-
910
- **When to Use Native vs MCP:**
911
-
912
- | Use MCP When | Use Native When |
913
- |--------------|-----------------|
914
- | MCP server exists and is maintained | No MCP server available for the tool |
915
- | User already has MCP configured | Running in CI/CD (no MCP context) |
916
- | Want community improvements | Need custom API behavior |
917
- | Simpler auth management | Offline/air-gapped environments |
918
-
919
- #### Remote State Layer
920
- Hybrid approach: shared context is remote, agent working state is local.
921
-
922
- **Shared Context (REMOTE):**
923
- - PRD, architecture decisions, project context
924
- - Stored in documentation provider (Confluence/Notion)
925
- - Single source of truth for all team members
926
- - Read by all agents at startup
927
- - Updated via designated workflows (EM/PM only for PRD, etc.)
928
-
929
- **Agent Working State (LOCAL):**
930
- - Personal context, objectives, decisions
931
- - Inbox/outbox messages
932
- - Stored in local KnowledgeLibrary (current approach)
933
- - Each engineer has their own agent instance
934
- - No sync needed - agent state is per-engineer, not shared
935
-
936
- **Why Hybrid?**
937
- - Shared context is what causes drift between team members - must be remote
938
- - Agent directories are personal working state - each engineer runs their own agents
939
- - Avoids API latency and rate limits for frequent inbox/outbox operations
940
- - Simpler implementation - only sync what actually needs to be shared
941
- - Local agent state can still be git-ignored or committed per team preference
942
-
943
- ---
944
-
945
- ## 6. Feature Requirements
946
-
947
- ### 6.1 Phase 1: Core Platform (MVP)
948
-
949
- #### F1.1 Configuration-Driven Setup
950
- - [ ] Define configuration schema (YAML/JSON)
951
- - [ ] Validate configuration on install
952
- - [ ] Generate all required files from config
953
- - [ ] Support multiple tech stack presets (node, python, go, terraform, etc.)
954
-
955
- #### F1.2 Generic Agent Definitions
956
- - [ ] Refactor existing agents to remove project-specific content
957
- - [ ] Create agent YAML schema with context references
958
- - [ ] Support runtime resolution of context sources
959
- - [ ] Maintain backward compatibility with existing agent invocation
960
-
961
- #### F1.3 Integration Adapters (Core Set)
962
- - [ ] Jira adapter (issue tracker)
963
- - [ ] GitHub adapter (git provider)
964
- - [ ] Confluence adapter (documentation + state)
965
- - [ ] Local filesystem adapter (fallback/offline mode)
966
-
967
- #### F1.4 Curated MCP Server Support (Phase 1)
968
-
969
- Start with the most common tools teams actually use:
970
-
971
- | Category | MCP Server | Priority | Rationale |
972
- |----------|------------|----------|-----------|
973
- | **Issue Tracker** | `@modelcontextprotocol/server-github` (issues) | P0 | Most common, free tier |
974
- | **Issue Tracker** | Jira MCP (TBD - find best option) | P0 | Enterprise standard |
975
- | **Git Provider** | `@modelcontextprotocol/server-github` | P0 | Most common |
976
- | **Documentation** | `@modelcontextprotocol/server-confluence` | P1 | Atlassian stack common |
977
- | **Documentation** | `@modelcontextprotocol/server-notion` | P1 | Popular for smaller teams |
978
-
979
- **Phase 1 Goal:** Support the Atlassian stack (Jira + Confluence + GitHub) since this covers the majority of enterprise teams.
980
-
981
- **How the curated list grows:**
982
- 1. Community requests via GitHub issues
983
- 2. Usage analytics (opt-in) show demand
984
- 3. PR contributions with mappings + tests
985
- 4. Each CoreAI release can add new servers
986
-
987
- **MCP Server Registry Structure:**
988
- ```typescript
989
- // src/mcp/registry.ts
990
- export const MCP_SERVER_REGISTRY = {
991
- // ─────────────────────────────────────────────────────────
992
- // PHASE 1: Core (MVP)
993
- // ─────────────────────────────────────────────────────────
994
- "@modelcontextprotocol/server-github": {
995
- phase: 1,
996
- types: ["issue_tracker", "git"],
997
- provider: "github",
998
- mappings: {
999
- // IssueTracker
1000
- createTicket: "create_issue",
1001
- getTicket: "get_issue",
1002
- // GitProvider
1003
- createBranch: "create_branch",
1004
- createPR: "create_pull_request",
1005
- getPR: "get_pull_request",
1006
- // ...
1007
- },
1008
- },
1009
-
1010
- "jira-mcp-server": { // TBD: identify best Jira MCP
1011
- phase: 1,
1012
- types: ["issue_tracker"],
1013
- provider: "jira",
1014
- mappings: {
1015
- createTicket: "create_issue",
1016
- getTicket: "get_issue",
1017
- transitionTicket: "transition_issue",
1018
- search: "search_issues",
1019
- addComment: "add_comment",
1020
- },
1021
- },
1022
-
1023
- // ─────────────────────────────────────────────────────────
1024
- // PHASE 2: Extended
1025
- // ─────────────────────────────────────────────────────────
1026
- "@modelcontextprotocol/server-gitlab": {
1027
- phase: 2,
1028
- types: ["issue_tracker", "git"],
1029
- provider: "gitlab",
1030
- mappings: { /* ... */ },
1031
- },
1032
-
1033
- "linear-mcp": { // TBD
1034
- phase: 2,
1035
- types: ["issue_tracker"],
1036
- provider: "linear",
1037
- mappings: { /* ... */ },
1038
- },
1039
-
1040
- "@modelcontextprotocol/server-confluence": {
1041
- phase: 2,
1042
- types: ["documentation"],
1043
- provider: "confluence",
1044
- mappings: { /* ... */ },
1045
- },
1046
-
1047
- "@modelcontextprotocol/server-notion": {
1048
- phase: 2,
1049
- types: ["documentation"],
1050
- provider: "notion",
1051
- mappings: { /* ... */ },
1052
- },
1053
- };
1054
- ```
1055
-
1056
- **Before Phase 1 ships, we need to:**
1057
- 1. Identify the actual MCP server packages for Jira (research existing options)
1058
- 2. Test each supported server end-to-end
1059
- 3. Document any quirks or limitations per server
1060
-
1061
- #### F1.5 Shared Context Sync
1062
- - [ ] Read shared context from remote (Confluence/Notion) on agent startup
1063
- - [ ] Cache shared context locally with TTL for performance
1064
- - [ ] Provide commands to update shared context (with proper permissions)
1065
- - [ ] Handle offline/disconnected gracefully (use cached version)
1066
- - [ ] Agent working state (inbox/outbox/personal context) remains local
1067
-
1068
- ### 6.2 Phase 2: Extended Integrations
1069
-
1070
- #### F2.1 Additional MCP Server Support
1071
- Expand the curated list based on user demand:
1072
-
1073
- | Category | MCP Server | Notes |
1074
- |----------|------------|-------|
1075
- | Issue Tracker | Linear MCP | Popular with startups |
1076
- | Issue Tracker | Azure DevOps MCP | Enterprise Microsoft shops |
1077
- | Git Provider | GitLab MCP | Self-hosted Git common in enterprise |
1078
- | Git Provider | Bitbucket MCP | Atlassian Git option |
1079
- | Documentation | Notion MCP | Popular for smaller/modern teams |
1080
-
1081
- #### F2.2 Native Adapter Fallbacks
1082
- For when MCP isn't available (CI/CD, offline):
1083
- - [ ] Native Jira adapter (direct API)
1084
- - [ ] Native GitHub adapter (direct API)
1085
- - [ ] Native GitLab adapter (direct API)
1086
- - [ ] Native Confluence adapter (direct API)
1087
-
1088
- #### F2.3 Additional State Providers
1089
- - [ ] S3/GCS adapter (state storage for teams without Confluence/Notion)
1090
- - [ ] GitHub repo adapter (state as files in a dedicated repo)
1091
-
1092
- ### 6.3 Phase 3: Distribution & Updates
1093
-
1094
- #### F3.1 Package Distribution
1095
- - [ ] Publish as npm package / brew formula / standalone binary
1096
- - [ ] Version management
1097
- - [ ] Dependency resolution
1098
-
1099
- #### F3.2 Update Mechanism
1100
- - [ ] Check for updates command
1101
- - [ ] Upgrade installed project to new version
1102
- - [ ] Preserve project configuration during upgrade
1103
- - [ ] Migration scripts for breaking changes
1104
-
1105
- #### F3.3 Enterprise Features
1106
- - [ ] Project registry (track all installations)
1107
- - [ ] Usage analytics (optional, opt-in)
1108
- - [ ] Centralized configuration inheritance
1109
-
1110
- ---
1111
-
1112
- ## 7. Technical Decisions
1113
-
1114
- ### 7.1 Implementation Language/Runtime
1115
- | Option | Pros | Cons |
1116
- |--------|------|------|
1117
- | **TypeScript/Node.js** | Familiar to web teams, npm distribution, good async | Requires Node.js installed |
1118
- | **Go** | Single binary, cross-platform, fast | Less familiar, harder to extend |
1119
- | **Python** | AI/ML ecosystem, pip distribution | Dependency management complexity |
1120
- | **Shell + jq** | No dependencies, current approach | Limited capabilities, harder to maintain |
1121
-
1122
- **Decision: TypeScript/Node.js**
1123
- - Distribution via npm
1124
- - Core platform maintained in main repo (modifications require repo access)
1125
- - Users can extend for project-specific needs without modifying core
1126
-
1127
- ### 7.2 Configuration Format
1128
- | Option | Pros | Cons |
1129
- |--------|------|------|
1130
- | **YAML** | Human-readable, supports comments | Whitespace-sensitive |
1131
- | **JSON** | Universal support, strict | No comments, verbose |
1132
- | **TOML** | Clean syntax, good for config | Less common |
1133
-
1134
- **Decision: YAML with JSON schema validation**
1135
- - Human-readable config files with inline comments
1136
- - JSON schema provides IDE autocomplete and validation
1137
- - Familiar to teams using k8s, docker-compose, GitHub Actions
1138
-
1139
- ### 7.3 State Provider Strategy
1140
- | Option | Pros | Cons |
1141
- |--------|------|------|
1142
- | **Fully remote** | Complete sync | API rate limits, latency, complexity |
1143
- | **Fully local** | Fast, simple | Drift between team members |
1144
- | **Hybrid (shared=remote, agent=local)** | Sync what matters, fast operations | Two systems to understand |
1145
-
1146
- **Decision: Hybrid approach**
1147
- - Shared context (PRD, architecture, project context) stored in Confluence/Notion
1148
- - Agent working state (inbox/outbox, personal context) stays local per-engineer
1149
- - Solves drift problem while keeping agent operations fast
1150
-
1151
- ### 7.4 Command/Skill Generation
1152
- | Option | Pros | Cons |
1153
- |--------|------|------|
1154
- | **Static templates with placeholders** | Simple, current approach | Limited flexibility |
1155
- | **Runtime generation from config** | Always up-to-date | More complex |
1156
- | **Plugin system** | Maximum flexibility | Over-engineering risk |
1157
-
1158
- **Decision: Runtime generation from config**
1159
- - Commands read `coreai.config.yaml` at execution and adapt behavior
1160
- - Skip steps gracefully if integration not configured (e.g., no issue tracker = skip ticket creation)
1161
- - Project-specific extensions via `coreai/commands/` directory without modifying core
1162
-
1163
- ---
1164
-
1165
- ## 8. Migration Path
1166
-
1167
- ### From Current CoreAI to Platform
1168
-
1169
- 1. **Phase 0: Preparation**
1170
- - Document all project-specific content in current agent files
1171
- - Identify all placeholder patterns used
1172
-
1173
- 2. **Phase 1: New Installation**
1174
- - New projects use config-driven installation
1175
- - Existing projects continue working unchanged
1176
-
1177
- 3. **Phase 2: Migration Tool**
1178
- - Tool to generate config from existing installation
1179
- - Tool to upgrade existing installation to new structure
1180
-
1181
- 4. **Phase 3: Deprecation**
1182
- - Mark file-based approach as legacy
1183
- - Provide migration guide
1184
- - Eventually remove legacy support
1185
-
1186
- ---
1187
-
1188
- ## 9. Open Questions (Answered)
1189
-
1190
- 1. **Authentication for remote providers** - How do we handle API tokens securely?
1191
-
1192
- **Answer:** MCP servers handle their own auth - CoreAI doesn't manage credentials separately. For native adapters or other credentials, store in config file. All config files (`.claude/`, `coreai.config.yaml`) must be gitignored.
1193
-
1194
- 2. **Offline mode** - Should there be a local cache of shared context for offline work? What's the TTL?
1195
-
1196
- **Answer:** Yes, local cache at `.coreai/cache/`. Cache until manual refresh - user runs `coreai sync` to update. On first run or empty cache, fetch from remote automatically. Commands: `coreai sync` (refresh), `coreai sync --force` (clear + refresh), `coreai cache clear`.
1197
-
1198
- 3. **Shared context updates** - Who can update shared context? Just EM/PM? How do we prevent conflicts when two people update simultaneously?
1199
-
1200
- **Answer:** No enforcement - CoreAI doesn't restrict who updates what (team process decision). For conflicts, rely on provider - Confluence/Notion have built-in version history and conflict handling. Keep CoreAI simple.
1201
-
1202
- 4. **Custom agents** - How do teams add project-specific agents without forking CoreAI?
1203
-
1204
- **Answer:** Both approaches:
1205
- - **Local agent directory** - `coreai/agents/` for custom YAML definitions (new roles like Security Reviewer)
1206
- - **Config-based customization** - `coreai.config.yaml` to extend/override core agents or disable unused ones
1207
- - **Manual option** - Can also create `.md` files directly in `.claude/agents/` for quick one-offs
1208
-
1209
- 5. **Workflow customization** - Should workflows be configurable, or are the 4 current workflows sufficient?
1210
-
1211
- **Answer:** Fixed workflows for MVP (ticket-implementation, bug-investigation, code-review, planning/estimation). Design architecture to support customization later. Phase 2+ will add workflow customization and custom workflow definitions - teams/clients always have nuances based on their operations.
1212
-
1213
- 6. **CI/CD integration** - Should CoreAI run in CI pipelines? How does that change state management?
1214
-
1215
- **Answer:** No CI/CD support - CoreAI is an interactive developer tool, not an automation tool. PR reviews are delegated so agents behave like human engineers. Ticket/doc changes are delegated or part of skills. Security scans happen via existing pipeline tooling.
1216
-
1217
- 7. **Audit trail** - Do we need history of shared context changes? Confluence/Notion have version history built-in.
1218
-
1219
- **Answer:** No audit trail - rely on provider. Confluence/Notion have built-in version history. CoreAI doesn't duplicate this functionality.
1220
-
1221
- 8. **Local state portability** - If an engineer switches machines, how do they handle local agent state? Git commit it? Start fresh?
1222
-
1223
- **Answer:** Start fresh - local state is ephemeral. Users can manually copy/paste local state files if needed (it's just files). Tooling for export/import can be added later if there's demand.
1224
-
1225
- ---
1226
-
1227
- ## 10. Risks & Mitigations
1228
-
1229
- | Risk | Impact | Mitigation |
1230
- |------|--------|------------|
1231
- | API rate limits on Confluence/Notion | High | Implement caching, batch operations |
1232
- | Network dependency for all operations | High | Offline mode with sync |
1233
- | Configuration complexity | Medium | Sensible defaults, presets, wizard |
1234
- | Breaking changes on updates | Medium | Semantic versioning, migration scripts |
1235
- | Adoption friction | Medium | Maintain CLI simplicity, good docs |
1236
-
1237
- ---
1238
-
1239
- ## 11. Timeline (Rough Estimates)
1240
-
1241
- | Phase | Scope | Notes |
1242
- |-------|-------|-------|
1243
- | **Phase 1** | Core platform, Jira/GitHub/Confluence, basic remote state | Foundation |
1244
- | **Phase 2** | Additional integrations, improved sync | Based on client needs |
1245
- | **Phase 3** | Distribution, updates, enterprise features | Scale |
1246
-
1247
- ---
1248
-
1249
- ## 12. Next Steps
1250
-
1251
- 1. [ ] Review and refine this PRD
1252
- 2. [ ] Decide on implementation language/runtime
1253
- 3. [ ] Design detailed configuration schema
1254
- 4. [ ] Prototype Confluence state adapter
1255
- 5. [ ] Refactor one agent file to new generic format
1256
- 6. [ ] Build minimal CLI that reads config and resolves agent context
1257
-
1258
- ---
1259
-
1260
- ## Appendix A: Current vs Proposed Agent File
1261
-
1262
- ### Current Format (agents/examples/backend-engineer.md)
1263
- ```markdown
1264
- # Backend Engineer
1265
-
1266
- You are the Backend Engineer for the Surftrack project...
1267
-
1268
- ## Context Sources
1269
- Read these files at the start of every task:
1270
- - KnowledgeLibrary/context.txt
1271
- - KnowledgeLibrary/backend-engineer/context/current.txt
1272
- ...
1273
- ```
1274
-
1275
- ### Proposed Format (agents/backend-engineer.yaml)
1276
- ```yaml
1277
- role: backend-engineer
1278
- type: ic-engineer
1279
- display_name: Backend Engineer
1280
-
1281
- description: |
1282
- You are a Backend Engineer responsible for server-side implementation,
1283
- API development, and backend infrastructure.
1284
-
1285
- responsibilities:
1286
- - Implement backend features and APIs
1287
- - Write and maintain unit and integration tests
1288
- - Perform code reviews when requested
1289
- - Document technical decisions
1290
-
1291
- context_sources:
1292
- # REMOTE - fetched from documentation provider at startup
1293
- shared:
1294
- - type: remote
1295
- provider: documentation
1296
- path: architecture
1297
- - type: remote
1298
- provider: documentation
1299
- path: prd
1300
- - type: remote
1301
- provider: documentation
1302
- path: project-context
1303
-
1304
- # LOCAL - read from local KnowledgeLibrary (per-engineer)
1305
- personal:
1306
- - type: local
1307
- path: KnowledgeLibrary/${agent.name}/context/current.txt
1308
- - type: local
1309
- path: KnowledgeLibrary/${agent.name}/control/objectives.txt
1310
-
1311
- communication:
1312
- # LOCAL - per-engineer working state
1313
- inbox: KnowledgeLibrary/${agent.name}/inbox
1314
- outbox: KnowledgeLibrary/${agent.name}/outbox
1315
-
1316
- quality_gates:
1317
- required:
1318
- - lint
1319
- - test
1320
- optional:
1321
- - build
1322
- - security_scan
1323
-
1324
- workflow: ticket-implementation
1325
- ```
1326
-
1327
- ---
1328
-
1329
- ## Appendix B: Example Configuration for Different Project Types
1330
-
1331
- ### B.1 Web Application (Node.js + React)
1332
- ```yaml
1333
- project:
1334
- name: "Customer Portal"
1335
- type: software
1336
-
1337
- integrations:
1338
- issue_tracker:
1339
- provider: jira
1340
- config:
1341
- project_key: PORTAL
1342
- git:
1343
- provider: github
1344
- config:
1345
- repo: company/customer-portal
1346
- documentation:
1347
- provider: confluence
1348
- config:
1349
- space_key: PORTAL
1350
-
1351
- quality_gates:
1352
- lint:
1353
- command: "npm run lint"
1354
- test:
1355
- command: "npm test"
1356
- build:
1357
- command: "npm run build"
1358
- type_check:
1359
- command: "npm run typecheck"
1360
-
1361
- tech_stack:
1362
- primary_language: typescript
1363
- frameworks: [react, express, prisma]
1364
- ```
1365
-
1366
- ### B.2 Infrastructure Project (Terraform)
1367
- ```yaml
1368
- project:
1369
- name: "AWS Infrastructure"
1370
- type: infrastructure
1371
-
1372
- integrations:
1373
- issue_tracker:
1374
- provider: jira
1375
- config:
1376
- project_key: INFRA
1377
- git:
1378
- provider: github
1379
- config:
1380
- repo: company/aws-infra
1381
- documentation:
1382
- provider: confluence
1383
- config:
1384
- space_key: INFRA
1385
-
1386
- quality_gates:
1387
- format:
1388
- command: "terraform fmt -check -recursive"
1389
- validate:
1390
- command: "terraform validate"
1391
- security:
1392
- command: "tfsec ."
1393
- plan:
1394
- command: "terraform plan -out=tfplan"
1395
-
1396
- tech_stack:
1397
- primary_language: hcl
1398
- frameworks: [terraform, terragrunt]
1399
- cloud: aws
1400
- ```
1401
-
1402
- ### B.3 Mobile App (Android/Kotlin)
1403
- ```yaml
1404
- project:
1405
- name: "Mobile App"
1406
- type: mobile
1407
-
1408
- integrations:
1409
- issue_tracker:
1410
- provider: linear
1411
- config:
1412
- team_key: MOB
1413
- git:
1414
- provider: github
1415
- config:
1416
- repo: company/mobile-app
1417
- documentation:
1418
- provider: notion
1419
- config:
1420
- workspace: company
1421
- database_id: abc123
1422
-
1423
- quality_gates:
1424
- lint:
1425
- command: "./gradlew ktlintCheck"
1426
- static_analysis:
1427
- command: "./gradlew detekt"
1428
- test:
1429
- command: "./gradlew testDebugUnitTest"
1430
- build:
1431
- command: "./gradlew assembleDebug"
1432
-
1433
- tech_stack:
1434
- primary_language: kotlin
1435
- frameworks: [android, compose, hilt]
1436
- ```
1437
-
1438
- ---
1439
-
1440
- *End of Document*