@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
package/README.md ADDED
@@ -0,0 +1,303 @@
1
+ # CoreAI - AI Agent Orchestration Platform
2
+
3
+ A configurable, team-ready AI agent orchestration platform for Claude Code.
4
+
5
+ ## Features
6
+
7
+ - **YAML-based agent definitions** - Define agents in structured YAML, compile to Claude-compatible markdown
8
+ - **Variable resolution** - Use `${config.*}`, `${agent.*}`, and `${remote.*}` variables in definitions
9
+ - **Core + custom agents** - Built-in agent library with support for project-specific customizations
10
+ - **Team filtering** - Configure which agents are available per project
11
+ - **Override system** - Customize core agents without modifying the source
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install -g @deimoscloud/coreai
17
+ ```
18
+
19
+ ## Quick Start
20
+
21
+ ```bash
22
+ # Initialize a new project (coming soon)
23
+ coreai init
24
+
25
+ # Build agents to .claude/agents/
26
+ coreai build
27
+
28
+ # List available agents
29
+ coreai agents list
30
+
31
+ # Show details for a specific agent
32
+ coreai agents show backend-engineer
33
+ ```
34
+
35
+ ## Commands
36
+
37
+ ### `coreai build`
38
+
39
+ Compile agent definitions to Claude-compatible markdown files.
40
+
41
+ ```bash
42
+ # Build to default output (.claude/agents/)
43
+ coreai build
44
+
45
+ # Build to custom directory
46
+ coreai build --output ./my-agents
47
+
48
+ # Watch mode (coming soon)
49
+ coreai build --watch
50
+ ```
51
+
52
+ ### `coreai agents list`
53
+
54
+ List all available agents.
55
+
56
+ ```bash
57
+ # List all agents
58
+ coreai agents list
59
+
60
+ # List only core agents
61
+ coreai agents list --core
62
+
63
+ # List only custom/override agents
64
+ coreai agents list --custom
65
+ ```
66
+
67
+ ### `coreai agents show <name>`
68
+
69
+ Display details for a specific agent.
70
+
71
+ ```bash
72
+ # Human-readable output
73
+ coreai agents show backend-engineer
74
+
75
+ # JSON output
76
+ coreai agents show backend-engineer --json
77
+
78
+ # Compiled markdown output
79
+ coreai agents show backend-engineer --markdown
80
+ ```
81
+
82
+ ### Other Commands
83
+
84
+ ```bash
85
+ # Show version
86
+ coreai --version
87
+
88
+ # Show help
89
+ coreai --help
90
+
91
+ # Validate configuration (coming soon)
92
+ coreai validate
93
+
94
+ # Sync remote context (coming soon)
95
+ coreai sync
96
+
97
+ # Show project status (coming soon)
98
+ coreai status
99
+
100
+ # Cache management (coming soon)
101
+ coreai cache status
102
+ coreai cache clear
103
+ ```
104
+
105
+ ## Configuration
106
+
107
+ Create a `coreai.config.yaml` in your project root:
108
+
109
+ ```yaml
110
+ project:
111
+ name: "My Project"
112
+ description: "Project description"
113
+
114
+ team:
115
+ agents:
116
+ - backend-engineer
117
+ - frontend-engineer
118
+ - devops-engineer
119
+
120
+ integrations:
121
+ github:
122
+ repo: "owner/repo"
123
+ jira:
124
+ project: "PROJ"
125
+
126
+ quality_gates:
127
+ lint: "npm run lint"
128
+ test: "npm test"
129
+ build: "npm run build"
130
+
131
+ tech_stack:
132
+ languages:
133
+ - TypeScript
134
+ - Node.js
135
+ frameworks:
136
+ - Express
137
+ - React
138
+ ```
139
+
140
+ ## Built-in Agents
141
+
142
+ CoreAI includes these core agents:
143
+
144
+ | Agent | Type | Description |
145
+ |-------|------|-------------|
146
+ | `backend-engineer` | IC Engineer | Server-side development specialist |
147
+ | `frontend-engineer` | IC Engineer | UI/UX implementation specialist |
148
+ | `devops-engineer` | Specialist | Infrastructure and deployment expert |
149
+ | `engineering-manager` | Manager | Team coordination and delivery |
150
+
151
+ ## Custom Agents
152
+
153
+ Create custom agents in `coreai/agents/` directory:
154
+
155
+ ```yaml
156
+ # coreai/agents/mobile-engineer.yaml
157
+ role: mobile-engineer
158
+ type: ic-engineer
159
+ display_name: "Mobile Engineer"
160
+ description: "React Native mobile development specialist"
161
+
162
+ responsibilities:
163
+ - Implement mobile features
164
+ - Ensure cross-platform compatibility
165
+ - Optimize mobile performance
166
+
167
+ expertise:
168
+ primary:
169
+ - React Native
170
+ - iOS development
171
+ - Android development
172
+
173
+ behaviors:
174
+ workflow: implementation
175
+ quality_gates:
176
+ - lint
177
+ - test
178
+ - build
179
+ ```
180
+
181
+ ### Overriding Core Agents
182
+
183
+ To customize a core agent, create a file with the same name in `coreai/agents/`:
184
+
185
+ ```yaml
186
+ # coreai/agents/backend-engineer.yaml
187
+ # This overrides the core backend-engineer agent
188
+
189
+ role: backend-engineer
190
+ type: ic-engineer
191
+ display_name: "Backend Engineer"
192
+ description: "Custom backend engineer for our Python stack"
193
+
194
+ # ... rest of definition
195
+ ```
196
+
197
+ ## Variable Resolution
198
+
199
+ Agent definitions support three variable namespaces:
200
+
201
+ ### `${config.*}` - Project Configuration
202
+
203
+ ```yaml
204
+ description: "Backend engineer for ${config.project.name}"
205
+ ```
206
+
207
+ ### `${agent.*}` - Agent Self-Reference
208
+
209
+ ```yaml
210
+ description: "I am ${agent.display_name}, responsible for ${agent.role}"
211
+ ```
212
+
213
+ ### `${remote.*}` - Remote Content (Coming Soon)
214
+
215
+ ```yaml
216
+ context:
217
+ - "${remote.confluence.architecture-docs}"
218
+ ```
219
+
220
+ ## Project Structure
221
+
222
+ ```
223
+ your-project/
224
+ ├── coreai.config.yaml # Project configuration
225
+ ├── coreai/
226
+ │ └── agents/ # Custom agent definitions
227
+ │ └── my-agent.yaml
228
+ ├── .claude/
229
+ │ └── agents/ # Compiled agents (generated)
230
+ │ ├── backend-engineer.md
231
+ │ └── my-agent.md
232
+ └── .coreai/
233
+ └── cache/ # Local cache (coming soon)
234
+ ```
235
+
236
+ ## Development
237
+
238
+ ### Prerequisites
239
+
240
+ - Node.js 18+
241
+ - npm or yarn
242
+
243
+ ### Setup
244
+
245
+ ```bash
246
+ # Clone the repository
247
+ git clone https://github.com/your-org/coreai.git
248
+ cd coreai
249
+
250
+ # Install dependencies
251
+ npm install
252
+
253
+ # Build
254
+ npm run build
255
+
256
+ # Run tests
257
+ npm test
258
+
259
+ # Run CLI locally
260
+ npm run cli -- --help
261
+ npm run cli -- agents list
262
+ ```
263
+
264
+ ### Testing
265
+
266
+ ```bash
267
+ # Run all tests
268
+ npm test
269
+
270
+ # Run with coverage
271
+ npm run test:coverage
272
+
273
+ # Run in watch mode
274
+ npm run test:watch
275
+ ```
276
+
277
+ ## Roadmap
278
+
279
+ See [IMPLEMENTATION_PLAN.md](IMPLEMENTATION_PLAN.md) for detailed implementation status.
280
+
281
+ ### Completed
282
+
283
+ - Project foundation (TypeScript, CLI, configuration)
284
+ - Agent YAML schema and validation
285
+ - Variable resolution system
286
+ - Agent compiler (YAML to Markdown)
287
+ - Agent CLI commands (build, list, show)
288
+
289
+ ### In Progress
290
+
291
+ - Integration adapter framework
292
+ - MCP integration layer
293
+
294
+ ### Planned
295
+
296
+ - Shared context and caching
297
+ - Remote content fetching
298
+ - Skill generation
299
+ - Local state management
300
+
301
+ ## License
302
+
303
+ MIT
package/WORKFLOWS.md ADDED
@@ -0,0 +1,295 @@
1
+ # Workflow Definitions
2
+
3
+ > **PURPOSE:** Defines mandatory workflows as state machines.
4
+ > All agents MUST follow these workflows. Each state has required outputs.
5
+
6
+ ---
7
+
8
+ ## Workflow 1: Ticket Implementation
9
+
10
+ **Applies to:** Any Jira ticket being implemented
11
+
12
+ ### State Machine
13
+
14
+ ```
15
+ BACKLOG → IN_PROGRESS → PR_CREATED → IN_REVIEW → APPROVED → MERGED → DONE
16
+ ```
17
+
18
+ ### State Definitions
19
+
20
+ #### BACKLOG
21
+ - **Entry:** Ticket exists, not yet assigned
22
+ - **Owner:** EM
23
+ - **Exit to IN_PROGRESS:** EM delegates to engineer via inbox
24
+
25
+ #### IN_PROGRESS
26
+ - **Entry conditions:**
27
+ - Engineer received task via inbox
28
+ - Engineer moves ticket to "In Progress" via Jira
29
+ - Engineer adds Jira comment: "Starting work. Branch: `feature/SUR-XX-description`"
30
+ - **Owner:** Engineer
31
+ - **Required outputs before exit:**
32
+ - [ ] Code changes complete
33
+ - [ ] Unit tests written and passing
34
+ - [ ] Lint checks pass
35
+ - [ ] Static analysis passes
36
+ - [ ] All acceptance criteria addressed
37
+ - **Exit to PR_CREATED:** Engineer creates PR
38
+
39
+ #### PR_CREATED
40
+ - **Entry conditions:**
41
+ - Branch pushed to origin
42
+ - PR created with correct title format
43
+ - **Owner:** Engineer
44
+ - **Required outputs:**
45
+ - PR URL logged in completion report
46
+ - Jira comment: "PR created: [URL]"
47
+ - **Exit to IN_REVIEW:** Engineer moves ticket to "In Review"
48
+
49
+ #### IN_REVIEW
50
+ - **Entry conditions:**
51
+ - Ticket status is "In Review"
52
+ - CI checks passing
53
+ - Completion report sent to EM inbox
54
+ - **Owner:** Engineer → EM → Reviewers
55
+ - **EM validation:**
56
+ - [ ] Ticket status correct
57
+ - [ ] PR exists
58
+ - [ ] CI passing
59
+ - [ ] Completion report valid
60
+ - **Required outputs:**
61
+ - EM assigns reviewers via inbox
62
+ - Reviewers post approval/feedback on PR
63
+ - **Exit to APPROVED:** Reviewer posts APPROVED decision
64
+
65
+ #### APPROVED
66
+ - **Entry conditions:**
67
+ - At least one approval posted on PR
68
+ - All review comments addressed
69
+ - CI still passing
70
+ - **Owner:** User (human)
71
+ - **Required action:** User merges PR
72
+ - **Exit to MERGED:** PR merged to main
73
+
74
+ #### MERGED
75
+ - **Entry conditions:**
76
+ - PR merged to main
77
+ - CI passes on main
78
+ - **Owner:** EM
79
+ - **Required outputs:**
80
+ - Jira comment: "Merged to main: [commit SHA]"
81
+ - Ticket moved to "Done"
82
+ - **Exit to DONE:** Verification complete
83
+
84
+ #### DONE
85
+ - **Entry conditions:**
86
+ - Jira ticket is "Done"
87
+ - All documentation updated
88
+ - **Owner:** EM
89
+ - **Workflow complete**
90
+
91
+ ---
92
+
93
+ ## Workflow 2: Code Review
94
+
95
+ **Applies to:** Any PR assigned for review
96
+
97
+ ### State Machine
98
+
99
+ ```
100
+ ASSIGNED → REVIEWING → DECISION_POSTED
101
+ ```
102
+
103
+ ### State Definitions
104
+
105
+ #### ASSIGNED
106
+ - **Entry:** Reviewer receives request via inbox
107
+ - **Owner:** Reviewer (solutions-architect, security-engineer, etc.)
108
+ - **Exit to REVIEWING:** Reviewer begins review
109
+
110
+ #### REVIEWING
111
+ - **Required checks:**
112
+ - [ ] Code follows development standards
113
+ - [ ] Tests are adequate for changes
114
+ - [ ] No security vulnerabilities
115
+ - [ ] Architecture aligns with design
116
+ - [ ] Performance implications considered
117
+ - **Exit to DECISION_POSTED:** Review complete
118
+
119
+ #### DECISION_POSTED
120
+ - **Required outputs:**
121
+ - Review comment posted on GitHub PR (via `gh pr comment`)
122
+ - Completion report sent to EM inbox
123
+ - **Review comment format:**
124
+
125
+ ```markdown
126
+ ## Code Review: SUR-XX
127
+
128
+ ### Summary
129
+ [Brief description of what was reviewed]
130
+
131
+ ### Checklist
132
+ - [x] Code follows development standards
133
+ - [x] Tests are adequate
134
+ - [x] No security vulnerabilities
135
+ - [x] Architecture aligns with design
136
+ - [x] Performance considered
137
+
138
+ ### Findings
139
+ - [Positive/concern/blocking items]
140
+
141
+ ### **DECISION: APPROVED** | **DECISION: CHANGES REQUESTED**
142
+
143
+ [If APPROVED]: Ready for merge by repository owner.
144
+ [If CHANGES REQUESTED]: Please address the issues marked above.
145
+
146
+ ---
147
+ *Review by: [agent-name]*
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Workflow 3: Release Process
153
+
154
+ **Applies to:** Creating a new release for deployment
155
+
156
+ ### State Machine
157
+
158
+ ```
159
+ PLANNING → VERSION_BUMPED → TAGGED → BUILD_VERIFIED → DEPLOYED
160
+ ```
161
+
162
+ ### State Definitions
163
+
164
+ #### PLANNING
165
+ - **Entry:** Release scope defined
166
+ - **Required:** All included tickets merged to main
167
+ - **Exit:** Version numbers updated
168
+
169
+ #### VERSION_BUMPED
170
+ - **Required outputs:**
171
+ - versionCode incremented
172
+ - versionName updated
173
+ - Version bump commit pushed
174
+ - **Exit:** Git tag created
175
+
176
+ #### TAGGED
177
+ - **Required outputs:**
178
+ - Annotated tag: `watch-vX.Y.Z` or `phone-vX.Y.Z`
179
+ - Tag message includes release notes
180
+ - Release workflow triggered
181
+ - **Exit:** Build completes
182
+
183
+ #### BUILD_VERIFIED
184
+ - **Required outputs:**
185
+ - GitHub Release created with artifacts
186
+ - ProGuard mapping attached
187
+ - **Exit:** Deployed to testing track
188
+
189
+ #### DEPLOYED
190
+ - **Required outputs:**
191
+ - Deployed to Play Console track
192
+ - Installation verified
193
+ - Notification sent
194
+
195
+ ---
196
+
197
+ ## Workflow 4: Hotfix Process
198
+
199
+ **Applies to:** Critical bugs requiring immediate fix
200
+
201
+ ### State Machine
202
+
203
+ ```
204
+ IDENTIFIED → HOTFIX_BRANCH → FIX_IMPLEMENTED → EXPEDITED_REVIEW → DEPLOYED
205
+ ```
206
+
207
+ ### State Definitions
208
+
209
+ #### IDENTIFIED
210
+ - **Entry:** Critical bug confirmed
211
+ - **Required:** HOTFIX label on ticket, team notified
212
+ - **Exit:** Hotfix branch created
213
+
214
+ #### HOTFIX_BRANCH
215
+ - **Required:** Branch from affected release or main
216
+ - **Naming:** `hotfix/SUR-XX-description`
217
+ - **Exit:** Fix coding started
218
+
219
+ #### FIX_IMPLEMENTED
220
+ - **Required outputs:**
221
+ - Minimal fix (no feature creep)
222
+ - Regression test added
223
+ - All checks passing
224
+ - **Exit:** PR created
225
+
226
+ #### EXPEDITED_REVIEW
227
+ - **Required:** Single reviewer, focused on fix correctness
228
+ - **Exit:** Approved and merged
229
+
230
+ #### DEPLOYED
231
+ - **Required outputs:**
232
+ - Version bumped to patch release
233
+ - Deployed directly to production
234
+ - Post-mortem scheduled
235
+
236
+ ---
237
+
238
+ ## Checkpoint Reporting Format
239
+
240
+ When completing any workflow state, report using this format:
241
+
242
+ ```markdown
243
+ ## Workflow Checkpoint
244
+ **Workflow:** [Ticket Implementation | Code Review | Release | Hotfix]
245
+ **Ticket:** SUR-XX
246
+ **Previous State:** [state name]
247
+ **Current State:** [state name]
248
+ **Timestamp:** [YYYY-MM-DD HH:MM]
249
+
250
+ ### Entry Conditions Verified
251
+ - [x] Condition 1
252
+ - [x] Condition 2
253
+
254
+ ### Required Outputs Completed
255
+ - [x] Output 1: [details/link]
256
+ - [x] Output 2: [details/link]
257
+
258
+ ### Next State
259
+ **Target:** [next state name]
260
+ **Blockers:** [None | list blockers]
261
+ ```
262
+
263
+ ---
264
+
265
+ ## Workflow Violations
266
+
267
+ If unable to complete a required output:
268
+
269
+ 1. **STOP** - Do not proceed to next state
270
+ 2. **Report blocker** - Document what's missing
271
+ 3. **Escalate** - Notify appropriate agent
272
+ 4. **Wait** - Do not skip the step
273
+
274
+ **Common violations to catch:**
275
+ - Creating PR before tests pass
276
+ - Merging without CI green
277
+ - Skipping Jira status updates
278
+ - Not posting review to GitHub PR
279
+ - Missing workflow checkpoint in completion report
280
+
281
+ ---
282
+
283
+ ## Quick Reference
284
+
285
+ | Workflow | When to Use | Final State |
286
+ |----------|-------------|-------------|
287
+ | Ticket Implementation | Implementing a Jira ticket | DONE |
288
+ | Code Review | Reviewing a PR | DECISION_POSTED |
289
+ | Release | Creating a scheduled release | DEPLOYED |
290
+ | Hotfix | Critical production bug | DEPLOYED |
291
+
292
+ ---
293
+
294
+ *Version: 1.0.0*
295
+ *Last Updated: 2026-01-05*