@deimoscloud/coreai 0.1.0

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 (216) hide show
  1. package/.prettierrc +9 -0
  2. package/AGENT_SPEC.md +347 -0
  3. package/ARCHITECTURE.md +547 -0
  4. package/DRAFT_PRD.md +1440 -0
  5. package/IMPLEMENTATION_PLAN.md +256 -0
  6. package/PRODUCT.md +473 -0
  7. package/README.md +303 -0
  8. package/WORKFLOWS.md +295 -0
  9. package/agents/_templates/ic-engineer.md +185 -0
  10. package/agents/_templates/reviewer.md +182 -0
  11. package/agents/backend-engineer.yaml +72 -0
  12. package/agents/devops-engineer.yaml +72 -0
  13. package/agents/engineering-manager.yaml +70 -0
  14. package/agents/examples/android-engineer.md +302 -0
  15. package/agents/examples/backend-engineer.md +320 -0
  16. package/agents/examples/devops-engineer.md +742 -0
  17. package/agents/examples/engineering-manager.md +469 -0
  18. package/agents/examples/frontend-engineer.md +58 -0
  19. package/agents/examples/product-manager.md +315 -0
  20. package/agents/examples/qa-engineer.md +371 -0
  21. package/agents/examples/security-engineer.md +525 -0
  22. package/agents/examples/solutions-architect.md +351 -0
  23. package/agents/examples/wearos-engineer.md +359 -0
  24. package/agents/frontend-engineer.yaml +72 -0
  25. package/commands/core/check-inbox.md +34 -0
  26. package/commands/core/delegate.md +30 -0
  27. package/commands/core/git-commit.md +144 -0
  28. package/commands/core/pr-create.md +193 -0
  29. package/commands/core/review.md +56 -0
  30. package/commands/core/sprint-status.md +65 -0
  31. package/commands/optional/docs-update.md +200 -0
  32. package/commands/optional/jira-create.md +200 -0
  33. package/commands/optional/jira-transition.md +184 -0
  34. package/commands/optional/worktree-cleanup.md +167 -0
  35. package/commands/optional/worktree-setup.md +110 -0
  36. package/dist/cli/index.js +4037 -0
  37. package/dist/cli/index.js.map +1 -0
  38. package/dist/index.d.ts +2978 -0
  39. package/dist/index.js +3867 -0
  40. package/dist/index.js.map +1 -0
  41. package/eslint.config.js +29 -0
  42. package/jest.config.js +22 -0
  43. package/knowledge-library/README.md +118 -0
  44. package/knowledge-library/android-engineer/context/current.txt +42 -0
  45. package/knowledge-library/android-engineer/control/decisions.txt +9 -0
  46. package/knowledge-library/android-engineer/control/dependencies.txt +19 -0
  47. package/knowledge-library/android-engineer/control/objectives.txt +26 -0
  48. package/knowledge-library/android-engineer/history/.gitkeep +0 -0
  49. package/knowledge-library/android-engineer/inbox/processed/.gitkeep +0 -0
  50. package/knowledge-library/android-engineer/outbox/.gitkeep +0 -0
  51. package/knowledge-library/android-engineer/tech/.gitkeep +0 -0
  52. package/knowledge-library/architecture.txt +61 -0
  53. package/knowledge-library/backend-engineer/context/current.txt +42 -0
  54. package/knowledge-library/backend-engineer/control/decisions.txt +9 -0
  55. package/knowledge-library/backend-engineer/control/dependencies.txt +19 -0
  56. package/knowledge-library/backend-engineer/control/objectives.txt +26 -0
  57. package/knowledge-library/backend-engineer/history/.gitkeep +0 -0
  58. package/knowledge-library/backend-engineer/inbox/processed/.gitkeep +0 -0
  59. package/knowledge-library/backend-engineer/outbox/.gitkeep +0 -0
  60. package/knowledge-library/backend-engineer/tech/.gitkeep +0 -0
  61. package/knowledge-library/context.txt +52 -0
  62. package/knowledge-library/devops-engineer/context/current.txt +42 -0
  63. package/knowledge-library/devops-engineer/control/decisions.txt +9 -0
  64. package/knowledge-library/devops-engineer/control/dependencies.txt +19 -0
  65. package/knowledge-library/devops-engineer/control/objectives.txt +26 -0
  66. package/knowledge-library/devops-engineer/history/.gitkeep +0 -0
  67. package/knowledge-library/devops-engineer/inbox/processed/.gitkeep +0 -0
  68. package/knowledge-library/devops-engineer/outbox/.gitkeep +0 -0
  69. package/knowledge-library/devops-engineer/tech/.gitkeep +0 -0
  70. package/knowledge-library/engineering-manager/context/current.txt +40 -0
  71. package/knowledge-library/engineering-manager/control/decisions.txt +9 -0
  72. package/knowledge-library/engineering-manager/control/objectives.txt +27 -0
  73. package/knowledge-library/engineering-manager/history/.gitkeep +0 -0
  74. package/knowledge-library/engineering-manager/inbox/processed/.gitkeep +0 -0
  75. package/knowledge-library/engineering-manager/outbox/.gitkeep +0 -0
  76. package/knowledge-library/engineering-manager/tech/.gitkeep +0 -0
  77. package/knowledge-library/prd.txt +81 -0
  78. package/knowledge-library/product-manager/context/current.txt +42 -0
  79. package/knowledge-library/product-manager/control/decisions.txt +9 -0
  80. package/knowledge-library/product-manager/control/dependencies.txt +19 -0
  81. package/knowledge-library/product-manager/control/objectives.txt +26 -0
  82. package/knowledge-library/product-manager/history/.gitkeep +0 -0
  83. package/knowledge-library/product-manager/inbox/processed/.gitkeep +0 -0
  84. package/knowledge-library/product-manager/outbox/.gitkeep +0 -0
  85. package/knowledge-library/product-manager/tech/.gitkeep +0 -0
  86. package/knowledge-library/qa-engineer/context/current.txt +42 -0
  87. package/knowledge-library/qa-engineer/control/decisions.txt +9 -0
  88. package/knowledge-library/qa-engineer/control/dependencies.txt +19 -0
  89. package/knowledge-library/qa-engineer/control/objectives.txt +26 -0
  90. package/knowledge-library/qa-engineer/history/.gitkeep +0 -0
  91. package/knowledge-library/qa-engineer/inbox/processed/.gitkeep +0 -0
  92. package/knowledge-library/qa-engineer/outbox/.gitkeep +0 -0
  93. package/knowledge-library/qa-engineer/tech/.gitkeep +0 -0
  94. package/knowledge-library/security-engineer/context/current.txt +42 -0
  95. package/knowledge-library/security-engineer/control/decisions.txt +9 -0
  96. package/knowledge-library/security-engineer/control/dependencies.txt +19 -0
  97. package/knowledge-library/security-engineer/control/objectives.txt +26 -0
  98. package/knowledge-library/security-engineer/history/.gitkeep +0 -0
  99. package/knowledge-library/security-engineer/inbox/processed/.gitkeep +0 -0
  100. package/knowledge-library/security-engineer/outbox/.gitkeep +0 -0
  101. package/knowledge-library/security-engineer/tech/.gitkeep +0 -0
  102. package/knowledge-library/solutions-architect/context/current.txt +42 -0
  103. package/knowledge-library/solutions-architect/control/decisions.txt +9 -0
  104. package/knowledge-library/solutions-architect/control/dependencies.txt +19 -0
  105. package/knowledge-library/solutions-architect/control/objectives.txt +26 -0
  106. package/knowledge-library/solutions-architect/history/.gitkeep +0 -0
  107. package/knowledge-library/solutions-architect/inbox/processed/.gitkeep +0 -0
  108. package/knowledge-library/solutions-architect/outbox/.gitkeep +0 -0
  109. package/knowledge-library/solutions-architect/tech/.gitkeep +0 -0
  110. package/knowledge-library/wearos-engineer/context/current.txt +42 -0
  111. package/knowledge-library/wearos-engineer/control/decisions.txt +9 -0
  112. package/knowledge-library/wearos-engineer/control/dependencies.txt +19 -0
  113. package/knowledge-library/wearos-engineer/control/objectives.txt +26 -0
  114. package/knowledge-library/wearos-engineer/history/.gitkeep +0 -0
  115. package/knowledge-library/wearos-engineer/inbox/processed/.gitkeep +0 -0
  116. package/knowledge-library/wearos-engineer/outbox/.gitkeep +0 -0
  117. package/knowledge-library/wearos-engineer/tech/.gitkeep +0 -0
  118. package/package.json +66 -0
  119. package/schemas/agent.schema.json +171 -0
  120. package/schemas/coreai.config.schema.json +257 -0
  121. package/scripts/add-agent.sh +323 -0
  122. package/scripts/install.sh +354 -0
  123. package/src/adapters/factory.test.ts +386 -0
  124. package/src/adapters/factory.ts +305 -0
  125. package/src/adapters/index.ts +113 -0
  126. package/src/adapters/interfaces.ts +268 -0
  127. package/src/adapters/mcp/client.test.ts +130 -0
  128. package/src/adapters/mcp/client.ts +451 -0
  129. package/src/adapters/mcp/discovery.test.ts +315 -0
  130. package/src/adapters/mcp/discovery.ts +340 -0
  131. package/src/adapters/mcp/index.ts +66 -0
  132. package/src/adapters/mcp/mapper.test.ts +218 -0
  133. package/src/adapters/mcp/mapper.ts +536 -0
  134. package/src/adapters/mcp/registry.test.ts +433 -0
  135. package/src/adapters/mcp/registry.ts +550 -0
  136. package/src/adapters/mcp/types.ts +258 -0
  137. package/src/adapters/native/filesystem.test.ts +350 -0
  138. package/src/adapters/native/filesystem.ts +393 -0
  139. package/src/adapters/native/github.test.ts +173 -0
  140. package/src/adapters/native/github.ts +627 -0
  141. package/src/adapters/native/index.ts +22 -0
  142. package/src/adapters/native/selector.test.ts +224 -0
  143. package/src/adapters/native/selector.ts +150 -0
  144. package/src/adapters/types.ts +270 -0
  145. package/src/agents/compiler.test.ts +399 -0
  146. package/src/agents/compiler.ts +359 -0
  147. package/src/agents/index.ts +36 -0
  148. package/src/agents/loader.test.ts +319 -0
  149. package/src/agents/loader.ts +143 -0
  150. package/src/agents/resolver.test.ts +282 -0
  151. package/src/agents/resolver.ts +262 -0
  152. package/src/agents/types.ts +87 -0
  153. package/src/cache/index.ts +38 -0
  154. package/src/cache/interfaces.ts +283 -0
  155. package/src/cache/manager.test.ts +266 -0
  156. package/src/cache/manager.ts +388 -0
  157. package/src/cache/provider.test.ts +485 -0
  158. package/src/cache/provider.ts +745 -0
  159. package/src/cache/types.test.ts +192 -0
  160. package/src/cache/types.ts +313 -0
  161. package/src/cli/commands/build.test.ts +248 -0
  162. package/src/cli/commands/build.ts +244 -0
  163. package/src/cli/commands/cache.test.ts +221 -0
  164. package/src/cli/commands/cache.ts +229 -0
  165. package/src/cli/commands/index.ts +63 -0
  166. package/src/cli/commands/init.test.ts +173 -0
  167. package/src/cli/commands/init.ts +296 -0
  168. package/src/cli/commands/skills.test.ts +272 -0
  169. package/src/cli/commands/skills.ts +348 -0
  170. package/src/cli/commands/status.test.ts +392 -0
  171. package/src/cli/commands/status.ts +332 -0
  172. package/src/cli/commands/sync.test.ts +213 -0
  173. package/src/cli/commands/sync.ts +251 -0
  174. package/src/cli/commands/validate.test.ts +216 -0
  175. package/src/cli/commands/validate.ts +340 -0
  176. package/src/cli/index.test.ts +190 -0
  177. package/src/cli/index.ts +493 -0
  178. package/src/commands/context.test.ts +163 -0
  179. package/src/commands/context.ts +111 -0
  180. package/src/commands/index.ts +56 -0
  181. package/src/commands/loader.test.ts +273 -0
  182. package/src/commands/loader.ts +355 -0
  183. package/src/commands/registry.test.ts +384 -0
  184. package/src/commands/registry.ts +248 -0
  185. package/src/commands/runner.test.ts +297 -0
  186. package/src/commands/runner.ts +222 -0
  187. package/src/commands/types.ts +361 -0
  188. package/src/config/index.ts +19 -0
  189. package/src/config/loader.test.ts +262 -0
  190. package/src/config/loader.ts +188 -0
  191. package/src/config/types.ts +154 -0
  192. package/src/context/index.ts +14 -0
  193. package/src/context/loader.test.ts +334 -0
  194. package/src/context/loader.ts +357 -0
  195. package/src/index.test.ts +13 -0
  196. package/src/index.ts +244 -0
  197. package/src/knowledge-library/index.ts +44 -0
  198. package/src/knowledge-library/manager.test.ts +536 -0
  199. package/src/knowledge-library/manager.ts +804 -0
  200. package/src/knowledge-library/types.ts +432 -0
  201. package/src/skills/generator.test.ts +602 -0
  202. package/src/skills/generator.ts +491 -0
  203. package/src/skills/index.ts +27 -0
  204. package/src/skills/templates.ts +520 -0
  205. package/src/skills/types.ts +251 -0
  206. package/templates/completion-report.md +72 -0
  207. package/templates/feedback.md +56 -0
  208. package/templates/project-files/CLAUDE.md.template +109 -0
  209. package/templates/project-files/coreai.json.example +47 -0
  210. package/templates/project-files/mcp.json.template +20 -0
  211. package/templates/review-complete.md +64 -0
  212. package/templates/review-request.md +67 -0
  213. package/templates/task-assignment.md +51 -0
  214. package/tsconfig.build.json +4 -0
  215. package/tsconfig.json +26 -0
  216. package/tsup.config.ts +23 -0
@@ -0,0 +1,167 @@
1
+ ---
2
+ description: Use when a PR has been merged, a ticket is complete, or development work is finished. Cleans up the git worktree created for parallel agent work. Typically used by the Engineering Manager after merge.
3
+ argument-hint: TICKET-XX or worktree path
4
+ ---
5
+
6
+ # Worktree Cleanup
7
+
8
+ You are cleaning up the worktree for: **$ARGUMENTS**
9
+
10
+ ## When to Use
11
+
12
+ - PR has been merged to main
13
+ - Ticket is marked as Done
14
+ - Development work is complete and no longer needed
15
+
16
+ ## Cleanup Steps
17
+
18
+ ### 1. Identify Worktree to Remove
19
+
20
+ List all active worktrees:
21
+ ```bash
22
+ cd {{PROJECT_ROOT}}
23
+ git worktree list
24
+ ```
25
+
26
+ **Expected output:**
27
+ ```
28
+ {{PROJECT_ROOT}} abc1234 [main]
29
+ {{PROJECT_ROOT}}/../{{PROJECT_NAME}}-agent1-{{JIRA_PROJECT}}-123 def5678 [feature/{{JIRA_PROJECT}}-123-description]
30
+ {{PROJECT_ROOT}}/../{{PROJECT_NAME}}-agent2-{{JIRA_PROJECT}}-456 ghi9012 [feature/{{JIRA_PROJECT}}-456-description]
31
+ ```
32
+
33
+ ### 2. Verify PR is Merged
34
+
35
+ Before removing, confirm the PR is merged:
36
+ ```bash
37
+ gh pr list --state merged --search "{{JIRA_PROJECT}}-XX"
38
+ ```
39
+
40
+ Or check if the branch exists on remote:
41
+ ```bash
42
+ git ls-remote --heads origin feature/{{JIRA_PROJECT}}-XX-description
43
+ # Empty output = branch deleted (PR merged)
44
+ ```
45
+
46
+ ### 3. Remove Worktree
47
+
48
+ ```bash
49
+ # From the main repository
50
+ cd {{PROJECT_ROOT}}
51
+
52
+ # Remove the worktree
53
+ git worktree remove ../{{PROJECT_NAME}}-[agent-name]-{{JIRA_PROJECT}}-XX
54
+ ```
55
+
56
+ ### 4. Delete Local Branch (if exists)
57
+
58
+ ```bash
59
+ git branch -d feature/{{JIRA_PROJECT}}-XX-description
60
+ ```
61
+
62
+ If branch wasn't merged (force delete with caution):
63
+ ```bash
64
+ git branch -D feature/{{JIRA_PROJECT}}-XX-description
65
+ ```
66
+
67
+ ### 5. Prune Stale Worktrees
68
+
69
+ Clean up any stale worktree references:
70
+ ```bash
71
+ git worktree prune
72
+ ```
73
+
74
+ ### 6. Verify Cleanup
75
+
76
+ ```bash
77
+ git worktree list
78
+ ```
79
+
80
+ Confirm the worktree no longer appears.
81
+
82
+ ## Batch Cleanup
83
+
84
+ To clean up multiple worktrees at once:
85
+
86
+ ```bash
87
+ # List all worktrees
88
+ git worktree list
89
+
90
+ # Remove each one
91
+ git worktree remove ../{{PROJECT_NAME}}-agent1-{{JIRA_PROJECT}}-XXX
92
+ git worktree remove ../{{PROJECT_NAME}}-agent2-{{JIRA_PROJECT}}-YYY
93
+
94
+ # Prune all stale references
95
+ git worktree prune
96
+ ```
97
+
98
+ ## Error Handling
99
+
100
+ **If worktree has uncommitted changes:**
101
+ ```
102
+ error: '<path>' contains modified or untracked files, use --force to delete it
103
+ ```
104
+
105
+ Options:
106
+ 1. **If changes are needed:** Commit and push first, then remove
107
+ 2. **If changes can be discarded:** `git worktree remove --force ../path`
108
+
109
+ **If worktree directory doesn't exist but git tracks it:**
110
+ ```bash
111
+ git worktree prune
112
+ ```
113
+
114
+ **If branch is not fully merged:**
115
+ ```bash
116
+ # Check if branch was merged
117
+ git branch --merged main | grep feature/{{JIRA_PROJECT}}-XX
118
+
119
+ # If not merged but PR is closed/merged on GitHub, force delete
120
+ git branch -D feature/{{JIRA_PROJECT}}-XX-description
121
+ ```
122
+
123
+ ## Update Jira (Optional)
124
+
125
+ If the ticket isn't already Done, transition it:
126
+ - Use `/jira-transition` to move to "Done"
127
+ - Or use Atlassian MCP directly
128
+
129
+ ## Completion
130
+
131
+ After cleanup, report:
132
+ ```
133
+ Worktree Cleanup Complete
134
+
135
+ Removed:
136
+ - Worktree: {{PROJECT_ROOT}}/../{{PROJECT_NAME}}-[agent-name]-{{JIRA_PROJECT}}-XX
137
+ - Branch: feature/{{JIRA_PROJECT}}-XX-description
138
+
139
+ Active Worktrees:
140
+ <output of git worktree list>
141
+
142
+ Ticket {{JIRA_PROJECT}}-XX is ready to be marked as Done (if not already).
143
+ ```
144
+
145
+ ## Bulk Cleanup After Sprint
146
+
147
+ To clean up all worktrees from a completed sprint:
148
+
149
+ ```bash
150
+ # List all worktrees
151
+ git worktree list
152
+
153
+ # Remove all agent worktrees (keep main)
154
+ for dir in ../{{PROJECT_NAME}}-*-{{JIRA_PROJECT}}-*; do
155
+ if [ -d "$dir" ]; then
156
+ git worktree remove "$dir" --force
157
+ fi
158
+ done
159
+
160
+ # Prune
161
+ git worktree prune
162
+
163
+ # Clean up merged branches
164
+ git branch --merged main | grep -E "feature/{{JIRA_PROJECT}}-" | xargs -r git branch -d
165
+ ```
166
+
167
+ Now proceed with the worktree cleanup.
@@ -0,0 +1,110 @@
1
+ ---
2
+ description: Use when starting work on a ticket, implementing a feature, fixing a bug, or beginning any development task. Sets up an isolated git worktree for parallel agent work, preventing conflicts when multiple agents work simultaneously.
3
+ argument-hint: TICKET-XX [short-description]
4
+ ---
5
+
6
+ # Worktree Setup for Parallel Development
7
+
8
+ You are setting up an isolated git worktree to work on: **$ARGUMENTS**
9
+
10
+ ## Why Worktrees?
11
+
12
+ Multiple agents can work on different tickets simultaneously without conflicts. Each agent gets its own working directory with its own branch, completely isolated from other agents.
13
+
14
+ ## Setup Steps
15
+
16
+ ### 1. Parse Arguments
17
+
18
+ Extract from `$ARGUMENTS`:
19
+ - **Ticket ID:** {{JIRA_PROJECT}}-XX (required)
20
+ - **Description:** Short description for branch name (optional, derive from ticket if not provided)
21
+
22
+ ### 2. Determine Your Agent Name
23
+
24
+ Identify which agent you are (e.g., `backend-engineer`, `frontend-engineer`). This is used in the worktree path.
25
+
26
+ ### 3. Fetch Latest Main
27
+
28
+ ```bash
29
+ cd {{PROJECT_ROOT}}
30
+ git fetch origin main
31
+ ```
32
+
33
+ ### 4. Create Worktree
34
+
35
+ ```bash
36
+ # Pattern: ../{{PROJECT_NAME}}-[agent-name]-{{JIRA_PROJECT}}-XX
37
+ git worktree add ../{{PROJECT_NAME}}-[agent-name]-{{JIRA_PROJECT}}-XX -b feature/{{JIRA_PROJECT}}-XX-[description] origin/main
38
+ ```
39
+
40
+ **Example:**
41
+ ```bash
42
+ git worktree add ../{{PROJECT_NAME}}-backend-engineer-{{JIRA_PROJECT}}-123 -b feature/{{JIRA_PROJECT}}-123-feature-name origin/main
43
+ ```
44
+
45
+ ### 5. Verify Worktree
46
+
47
+ ```bash
48
+ git worktree list
49
+ ```
50
+
51
+ Confirm your new worktree appears in the list.
52
+
53
+ ### 6. Set Working Directory
54
+
55
+ **CRITICAL:** All subsequent work must happen in the worktree directory:
56
+
57
+ ```
58
+ {{PROJECT_ROOT}}/../{{PROJECT_NAME}}-[agent-name]-{{JIRA_PROJECT}}-XX/
59
+ ```
60
+
61
+ Announce to the user:
62
+ ```
63
+ Worktree created. Working directory is now:
64
+ {{PROJECT_ROOT}}/../{{PROJECT_NAME}}-[agent-name]-{{JIRA_PROJECT}}-XX
65
+
66
+ All code changes will be made in this isolated directory.
67
+ ```
68
+
69
+ ### 7. Update Jira (if not already done)
70
+
71
+ If the ticket is not already "In Progress":
72
+ - Transition ticket to "In Progress"
73
+ - Add comment: "Starting work. Branch: `feature/{{JIRA_PROJECT}}-XX-[description]`"
74
+
75
+ ## Important Notes
76
+
77
+ - **Never work in the main repository** when a worktree is active for your ticket
78
+ - **One worktree per ticket** - if you already have a worktree for this ticket, use it instead of creating a new one
79
+ - **Worktree cleanup** is handled by the Engineering Manager after PR merge via `/worktree-cleanup`
80
+
81
+ ## Error Handling
82
+
83
+ **If worktree already exists:**
84
+ ```bash
85
+ # Check existing worktrees
86
+ git worktree list
87
+
88
+ # If your worktree exists, just use it
89
+ cd ../{{PROJECT_NAME}}-[agent-name]-{{JIRA_PROJECT}}-XX
90
+ ```
91
+
92
+ **If branch already exists:**
93
+ ```bash
94
+ # Use existing branch in new worktree
95
+ git worktree add ../{{PROJECT_NAME}}-[agent-name]-{{JIRA_PROJECT}}-XX feature/{{JIRA_PROJECT}}-XX-[description]
96
+ ```
97
+
98
+ ## Completion
99
+
100
+ After setup, announce:
101
+ ```
102
+ Worktree ready for {{JIRA_PROJECT}}-XX
103
+
104
+ Directory: {{PROJECT_ROOT}}/../{{PROJECT_NAME}}-[agent-name]-{{JIRA_PROJECT}}-XX
105
+ Branch: feature/{{JIRA_PROJECT}}-XX-[description]
106
+
107
+ Ready to begin implementation.
108
+ ```
109
+
110
+ Now proceed with the worktree setup.