@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.
- package/.prettierrc +9 -0
- package/AGENT_SPEC.md +347 -0
- package/ARCHITECTURE.md +547 -0
- package/DRAFT_PRD.md +1440 -0
- package/IMPLEMENTATION_PLAN.md +256 -0
- package/PRODUCT.md +473 -0
- package/README.md +303 -0
- package/WORKFLOWS.md +295 -0
- package/agents/_templates/ic-engineer.md +185 -0
- package/agents/_templates/reviewer.md +182 -0
- package/agents/backend-engineer.yaml +72 -0
- package/agents/devops-engineer.yaml +72 -0
- package/agents/engineering-manager.yaml +70 -0
- package/agents/examples/android-engineer.md +302 -0
- package/agents/examples/backend-engineer.md +320 -0
- package/agents/examples/devops-engineer.md +742 -0
- package/agents/examples/engineering-manager.md +469 -0
- package/agents/examples/frontend-engineer.md +58 -0
- package/agents/examples/product-manager.md +315 -0
- package/agents/examples/qa-engineer.md +371 -0
- package/agents/examples/security-engineer.md +525 -0
- package/agents/examples/solutions-architect.md +351 -0
- package/agents/examples/wearos-engineer.md +359 -0
- package/agents/frontend-engineer.yaml +72 -0
- package/commands/core/check-inbox.md +34 -0
- package/commands/core/delegate.md +30 -0
- package/commands/core/git-commit.md +144 -0
- package/commands/core/pr-create.md +193 -0
- package/commands/core/review.md +56 -0
- package/commands/core/sprint-status.md +65 -0
- package/commands/optional/docs-update.md +200 -0
- package/commands/optional/jira-create.md +200 -0
- package/commands/optional/jira-transition.md +184 -0
- package/commands/optional/worktree-cleanup.md +167 -0
- package/commands/optional/worktree-setup.md +110 -0
- package/dist/cli/index.js +4037 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +2978 -0
- package/dist/index.js +3867 -0
- package/dist/index.js.map +1 -0
- package/eslint.config.js +29 -0
- package/jest.config.js +22 -0
- package/knowledge-library/README.md +118 -0
- package/knowledge-library/android-engineer/context/current.txt +42 -0
- package/knowledge-library/android-engineer/control/decisions.txt +9 -0
- package/knowledge-library/android-engineer/control/dependencies.txt +19 -0
- package/knowledge-library/android-engineer/control/objectives.txt +26 -0
- package/knowledge-library/android-engineer/history/.gitkeep +0 -0
- package/knowledge-library/android-engineer/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/android-engineer/outbox/.gitkeep +0 -0
- package/knowledge-library/android-engineer/tech/.gitkeep +0 -0
- package/knowledge-library/architecture.txt +61 -0
- package/knowledge-library/backend-engineer/context/current.txt +42 -0
- package/knowledge-library/backend-engineer/control/decisions.txt +9 -0
- package/knowledge-library/backend-engineer/control/dependencies.txt +19 -0
- package/knowledge-library/backend-engineer/control/objectives.txt +26 -0
- package/knowledge-library/backend-engineer/history/.gitkeep +0 -0
- package/knowledge-library/backend-engineer/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/backend-engineer/outbox/.gitkeep +0 -0
- package/knowledge-library/backend-engineer/tech/.gitkeep +0 -0
- package/knowledge-library/context.txt +52 -0
- package/knowledge-library/devops-engineer/context/current.txt +42 -0
- package/knowledge-library/devops-engineer/control/decisions.txt +9 -0
- package/knowledge-library/devops-engineer/control/dependencies.txt +19 -0
- package/knowledge-library/devops-engineer/control/objectives.txt +26 -0
- package/knowledge-library/devops-engineer/history/.gitkeep +0 -0
- package/knowledge-library/devops-engineer/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/devops-engineer/outbox/.gitkeep +0 -0
- package/knowledge-library/devops-engineer/tech/.gitkeep +0 -0
- package/knowledge-library/engineering-manager/context/current.txt +40 -0
- package/knowledge-library/engineering-manager/control/decisions.txt +9 -0
- package/knowledge-library/engineering-manager/control/objectives.txt +27 -0
- package/knowledge-library/engineering-manager/history/.gitkeep +0 -0
- package/knowledge-library/engineering-manager/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/engineering-manager/outbox/.gitkeep +0 -0
- package/knowledge-library/engineering-manager/tech/.gitkeep +0 -0
- package/knowledge-library/prd.txt +81 -0
- package/knowledge-library/product-manager/context/current.txt +42 -0
- package/knowledge-library/product-manager/control/decisions.txt +9 -0
- package/knowledge-library/product-manager/control/dependencies.txt +19 -0
- package/knowledge-library/product-manager/control/objectives.txt +26 -0
- package/knowledge-library/product-manager/history/.gitkeep +0 -0
- package/knowledge-library/product-manager/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/product-manager/outbox/.gitkeep +0 -0
- package/knowledge-library/product-manager/tech/.gitkeep +0 -0
- package/knowledge-library/qa-engineer/context/current.txt +42 -0
- package/knowledge-library/qa-engineer/control/decisions.txt +9 -0
- package/knowledge-library/qa-engineer/control/dependencies.txt +19 -0
- package/knowledge-library/qa-engineer/control/objectives.txt +26 -0
- package/knowledge-library/qa-engineer/history/.gitkeep +0 -0
- package/knowledge-library/qa-engineer/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/qa-engineer/outbox/.gitkeep +0 -0
- package/knowledge-library/qa-engineer/tech/.gitkeep +0 -0
- package/knowledge-library/security-engineer/context/current.txt +42 -0
- package/knowledge-library/security-engineer/control/decisions.txt +9 -0
- package/knowledge-library/security-engineer/control/dependencies.txt +19 -0
- package/knowledge-library/security-engineer/control/objectives.txt +26 -0
- package/knowledge-library/security-engineer/history/.gitkeep +0 -0
- package/knowledge-library/security-engineer/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/security-engineer/outbox/.gitkeep +0 -0
- package/knowledge-library/security-engineer/tech/.gitkeep +0 -0
- package/knowledge-library/solutions-architect/context/current.txt +42 -0
- package/knowledge-library/solutions-architect/control/decisions.txt +9 -0
- package/knowledge-library/solutions-architect/control/dependencies.txt +19 -0
- package/knowledge-library/solutions-architect/control/objectives.txt +26 -0
- package/knowledge-library/solutions-architect/history/.gitkeep +0 -0
- package/knowledge-library/solutions-architect/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/solutions-architect/outbox/.gitkeep +0 -0
- package/knowledge-library/solutions-architect/tech/.gitkeep +0 -0
- package/knowledge-library/wearos-engineer/context/current.txt +42 -0
- package/knowledge-library/wearos-engineer/control/decisions.txt +9 -0
- package/knowledge-library/wearos-engineer/control/dependencies.txt +19 -0
- package/knowledge-library/wearos-engineer/control/objectives.txt +26 -0
- package/knowledge-library/wearos-engineer/history/.gitkeep +0 -0
- package/knowledge-library/wearos-engineer/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/wearos-engineer/outbox/.gitkeep +0 -0
- package/knowledge-library/wearos-engineer/tech/.gitkeep +0 -0
- package/package.json +66 -0
- package/schemas/agent.schema.json +171 -0
- package/schemas/coreai.config.schema.json +257 -0
- package/scripts/add-agent.sh +323 -0
- package/scripts/install.sh +354 -0
- package/src/adapters/factory.test.ts +386 -0
- package/src/adapters/factory.ts +305 -0
- package/src/adapters/index.ts +113 -0
- package/src/adapters/interfaces.ts +268 -0
- package/src/adapters/mcp/client.test.ts +130 -0
- package/src/adapters/mcp/client.ts +451 -0
- package/src/adapters/mcp/discovery.test.ts +315 -0
- package/src/adapters/mcp/discovery.ts +340 -0
- package/src/adapters/mcp/index.ts +66 -0
- package/src/adapters/mcp/mapper.test.ts +218 -0
- package/src/adapters/mcp/mapper.ts +536 -0
- package/src/adapters/mcp/registry.test.ts +433 -0
- package/src/adapters/mcp/registry.ts +550 -0
- package/src/adapters/mcp/types.ts +258 -0
- package/src/adapters/native/filesystem.test.ts +350 -0
- package/src/adapters/native/filesystem.ts +393 -0
- package/src/adapters/native/github.test.ts +173 -0
- package/src/adapters/native/github.ts +627 -0
- package/src/adapters/native/index.ts +22 -0
- package/src/adapters/native/selector.test.ts +224 -0
- package/src/adapters/native/selector.ts +150 -0
- package/src/adapters/types.ts +270 -0
- package/src/agents/compiler.test.ts +399 -0
- package/src/agents/compiler.ts +359 -0
- package/src/agents/index.ts +36 -0
- package/src/agents/loader.test.ts +319 -0
- package/src/agents/loader.ts +143 -0
- package/src/agents/resolver.test.ts +282 -0
- package/src/agents/resolver.ts +262 -0
- package/src/agents/types.ts +87 -0
- package/src/cache/index.ts +38 -0
- package/src/cache/interfaces.ts +283 -0
- package/src/cache/manager.test.ts +266 -0
- package/src/cache/manager.ts +388 -0
- package/src/cache/provider.test.ts +485 -0
- package/src/cache/provider.ts +745 -0
- package/src/cache/types.test.ts +192 -0
- package/src/cache/types.ts +313 -0
- package/src/cli/commands/build.test.ts +248 -0
- package/src/cli/commands/build.ts +244 -0
- package/src/cli/commands/cache.test.ts +221 -0
- package/src/cli/commands/cache.ts +229 -0
- package/src/cli/commands/index.ts +63 -0
- package/src/cli/commands/init.test.ts +173 -0
- package/src/cli/commands/init.ts +296 -0
- package/src/cli/commands/skills.test.ts +272 -0
- package/src/cli/commands/skills.ts +348 -0
- package/src/cli/commands/status.test.ts +392 -0
- package/src/cli/commands/status.ts +332 -0
- package/src/cli/commands/sync.test.ts +213 -0
- package/src/cli/commands/sync.ts +251 -0
- package/src/cli/commands/validate.test.ts +216 -0
- package/src/cli/commands/validate.ts +340 -0
- package/src/cli/index.test.ts +190 -0
- package/src/cli/index.ts +493 -0
- package/src/commands/context.test.ts +163 -0
- package/src/commands/context.ts +111 -0
- package/src/commands/index.ts +56 -0
- package/src/commands/loader.test.ts +273 -0
- package/src/commands/loader.ts +355 -0
- package/src/commands/registry.test.ts +384 -0
- package/src/commands/registry.ts +248 -0
- package/src/commands/runner.test.ts +297 -0
- package/src/commands/runner.ts +222 -0
- package/src/commands/types.ts +361 -0
- package/src/config/index.ts +19 -0
- package/src/config/loader.test.ts +262 -0
- package/src/config/loader.ts +188 -0
- package/src/config/types.ts +154 -0
- package/src/context/index.ts +14 -0
- package/src/context/loader.test.ts +334 -0
- package/src/context/loader.ts +357 -0
- package/src/index.test.ts +13 -0
- package/src/index.ts +244 -0
- package/src/knowledge-library/index.ts +44 -0
- package/src/knowledge-library/manager.test.ts +536 -0
- package/src/knowledge-library/manager.ts +804 -0
- package/src/knowledge-library/types.ts +432 -0
- package/src/skills/generator.test.ts +602 -0
- package/src/skills/generator.ts +491 -0
- package/src/skills/index.ts +27 -0
- package/src/skills/templates.ts +520 -0
- package/src/skills/types.ts +251 -0
- package/templates/completion-report.md +72 -0
- package/templates/feedback.md +56 -0
- package/templates/project-files/CLAUDE.md.template +109 -0
- package/templates/project-files/coreai.json.example +47 -0
- package/templates/project-files/mcp.json.template +20 -0
- package/templates/review-complete.md +64 -0
- package/templates/review-request.md +67 -0
- package/templates/task-assignment.md +51 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.json +26 -0
- package/tsup.config.ts +23 -0
package/PRODUCT.md
ADDED
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
# CoreAI - Multi-Agent Development System
|
|
2
|
+
|
|
3
|
+
> **Product Vision:** A reusable, template-based system for orchestrating AI agents that simulate a software development team.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Executive Summary
|
|
8
|
+
|
|
9
|
+
CoreAI is a framework for setting up AI agent teams that work together on software development tasks. It provides:
|
|
10
|
+
|
|
11
|
+
- **Agent definitions** with clear roles and responsibilities
|
|
12
|
+
- **Workflow state machines** for ticket lifecycle management
|
|
13
|
+
- **Inbox-based communication** for async agent collaboration
|
|
14
|
+
- **Standardized message templates** for consistent handoffs
|
|
15
|
+
- **Knowledge library structure** for shared context and state
|
|
16
|
+
|
|
17
|
+
The system is designed to be cloned and customized for any software project.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Problem Statement
|
|
22
|
+
|
|
23
|
+
### The Challenge
|
|
24
|
+
|
|
25
|
+
When using AI agents for software development:
|
|
26
|
+
|
|
27
|
+
1. **Inconsistent behavior** - Agents forget instructions or ignore workflow rules
|
|
28
|
+
2. **Lost context** - Each conversation starts fresh with no memory
|
|
29
|
+
3. **MCP access issues** - Subagents lose access to external tools (Jira, GitHub)
|
|
30
|
+
4. **Manual overhead** - Too much human intervention required
|
|
31
|
+
5. **No standard patterns** - Each project reinvents agent workflows
|
|
32
|
+
|
|
33
|
+
### Our Solution
|
|
34
|
+
|
|
35
|
+
A template-based system that:
|
|
36
|
+
|
|
37
|
+
- Embeds critical instructions in commands (not just agent files)
|
|
38
|
+
- Maintains persistent context via file-based knowledge library
|
|
39
|
+
- Uses direct agent invocation to preserve MCP access
|
|
40
|
+
- Provides explicit validation checkpoints
|
|
41
|
+
- Can be cloned and customized for any project
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Goals
|
|
46
|
+
|
|
47
|
+
### Primary Goals
|
|
48
|
+
|
|
49
|
+
1. **Reusability** - Clone this template for any new project
|
|
50
|
+
2. **Consistency** - Agents follow workflows reliably
|
|
51
|
+
3. **Minimal overhead** - Reduce human intervention in agent orchestration
|
|
52
|
+
4. **Clear ownership** - Engineers own ticket lifecycle, EM validates
|
|
53
|
+
|
|
54
|
+
### Success Metrics
|
|
55
|
+
|
|
56
|
+
- Agents follow ticket workflow correctly (status transitions)
|
|
57
|
+
- PRs have proper reviews posted to GitHub (not just inbox)
|
|
58
|
+
- Completion reports include valid workflow checkpoints
|
|
59
|
+
- New project setup time < 30 minutes
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Architecture
|
|
64
|
+
|
|
65
|
+
### System Overview
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
69
|
+
│ User │
|
|
70
|
+
│ (invokes agents via @agent-name or /command) │
|
|
71
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
72
|
+
↓
|
|
73
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
74
|
+
│ Claude Code + MCP │
|
|
75
|
+
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
|
|
76
|
+
│ │ Atlassian │ │ GitHub │ │ Other │ │
|
|
77
|
+
│ │ (Jira/ │ │ (gh CLI) │ │ MCPs │ │
|
|
78
|
+
│ │ Confluence)│ │ │ │ │ │
|
|
79
|
+
│ └─────────────┘ └─────────────┘ └─────────────┘ │
|
|
80
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
81
|
+
↓
|
|
82
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
83
|
+
│ Agent Layer │
|
|
84
|
+
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
|
85
|
+
│ │ EM │ │ Engineer │ │ Reviewer │ │ PM │ │
|
|
86
|
+
│ │(delegate,│ │(implement│ │(review, │ │(require- │ │
|
|
87
|
+
│ │ validate)│ │ own life-│ │ approve) │ │ ments) │ │
|
|
88
|
+
│ │ │ │ cycle) │ │ │ │ │ │
|
|
89
|
+
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
|
|
90
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
91
|
+
↓
|
|
92
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
93
|
+
│ Knowledge Library │
|
|
94
|
+
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
95
|
+
│ │ Shared Context: context.txt, architecture.txt, prd.txt │ │
|
|
96
|
+
│ └─────────────────────────────────────────────────────────┘ │
|
|
97
|
+
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
98
|
+
│ │ Agent Directories: inbox/, outbox/, context/, control/ │ │
|
|
99
|
+
│ └─────────────────────────────────────────────────────────┘ │
|
|
100
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Key Components
|
|
104
|
+
|
|
105
|
+
| Component | Location | Purpose |
|
|
106
|
+
|-----------|----------|---------|
|
|
107
|
+
| Agent Specs | `coreai/AGENT_SPEC.md` | Master behavior specification |
|
|
108
|
+
| Workflows | `coreai/WORKFLOWS.md` | State machines for ticket/review |
|
|
109
|
+
| Agent Files | `coreai/agents/*.md` | Individual agent definitions |
|
|
110
|
+
| Commands | `coreai/commands/*.md` | User-invocable slash commands |
|
|
111
|
+
| Templates | `coreai/templates/*.md` | Inbox message formats |
|
|
112
|
+
| Knowledge Library | `coreai/knowledge-library/` | Shared context & communication |
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Agent Roles & Responsibilities
|
|
117
|
+
|
|
118
|
+
### Engineering Manager (EM)
|
|
119
|
+
|
|
120
|
+
**Role:** Coordination and validation (NOT implementation)
|
|
121
|
+
|
|
122
|
+
| Does | Does NOT |
|
|
123
|
+
|------|----------|
|
|
124
|
+
| Delegate tasks via inbox | Write code |
|
|
125
|
+
| Validate completion reports | Create PRs |
|
|
126
|
+
| Assign reviewers | Move tickets to In Progress |
|
|
127
|
+
| Track sprint progress | Move tickets to In Review |
|
|
128
|
+
| Remove blockers | Use Task tool for agents |
|
|
129
|
+
|
|
130
|
+
### IC Engineers (wearos, android, backend, devops)
|
|
131
|
+
|
|
132
|
+
**Role:** Implementation with full lifecycle ownership
|
|
133
|
+
|
|
134
|
+
| Responsibility | When |
|
|
135
|
+
|----------------|------|
|
|
136
|
+
| Move ticket to In Progress | On task start |
|
|
137
|
+
| Create feature branch | After status update |
|
|
138
|
+
| Implement with tests | During development |
|
|
139
|
+
| Run quality checks | Before PR |
|
|
140
|
+
| Create PR | After tests pass |
|
|
141
|
+
| Move ticket to In Review | After PR created |
|
|
142
|
+
| Send completion report | After all above |
|
|
143
|
+
|
|
144
|
+
### Reviewers (solutions-architect, security-engineer, qa-engineer)
|
|
145
|
+
|
|
146
|
+
**Role:** Code review and specialized guidance
|
|
147
|
+
|
|
148
|
+
| Responsibility | Where |
|
|
149
|
+
|----------------|-------|
|
|
150
|
+
| Review PR thoroughly | GitHub |
|
|
151
|
+
| Post review comment | On the PR (not just inbox) |
|
|
152
|
+
| State APPROVED or CHANGES_REQUESTED | In PR comment |
|
|
153
|
+
| Send summary to EM | Via inbox |
|
|
154
|
+
|
|
155
|
+
### Product Manager
|
|
156
|
+
|
|
157
|
+
**Role:** Requirements and prioritization
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Workflow Design
|
|
162
|
+
|
|
163
|
+
### Ticket Implementation Workflow
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
BACKLOG → IN_PROGRESS → PR_CREATED → IN_REVIEW → APPROVED → MERGED → DONE
|
|
167
|
+
│ │ │ │ │ │ │
|
|
168
|
+
│ │ │ │ │ │ │
|
|
169
|
+
▼ ▼ ▼ ▼ ▼ ▼ ▼
|
|
170
|
+
EM Engineer Engineer Engineer→ Reviewer User EM
|
|
171
|
+
delegates moves tkt, creates PR EM→Reviewer approves merges validates
|
|
172
|
+
branches & closes
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Key Design Decisions
|
|
176
|
+
|
|
177
|
+
1. **Engineers own ticket lifecycle** - Reduces EM overhead, clearer ownership
|
|
178
|
+
2. **EM validates, doesn't execute** - Separation of concerns
|
|
179
|
+
3. **Reviews on GitHub PR** - Visible to everyone, not hidden in inbox
|
|
180
|
+
4. **Standardized messages** - YAML frontmatter + workflow checkpoint
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Lessons Learned
|
|
185
|
+
|
|
186
|
+
### From SurfTrack Development (3 weeks)
|
|
187
|
+
|
|
188
|
+
#### What Worked Well
|
|
189
|
+
|
|
190
|
+
1. **Custom commands** - Embedding instructions in `/delegate`, `/review` prevented agents from ignoring workflow rules
|
|
191
|
+
2. **Inbox-based communication** - Persistent async messaging survived context resets
|
|
192
|
+
3. **Direct @agent invocation** - Full MCP access without workarounds
|
|
193
|
+
4. **Workflow checkpoints** - Explicit validation gates caught issues early
|
|
194
|
+
5. **Processed folder pattern** - Moving messages to `processed/` prevented duplicate work
|
|
195
|
+
|
|
196
|
+
#### What Didn't Work
|
|
197
|
+
|
|
198
|
+
1. **Long agent files** - 400+ line agent files were hard to maintain and often ignored
|
|
199
|
+
2. **Implicit validation** - EM wasn't checking if tickets were in correct status
|
|
200
|
+
3. **Freeform messages** - Inconsistent formats led to missed information
|
|
201
|
+
4. **EM doing too much** - EM was moving tickets, should have been engineers
|
|
202
|
+
5. **Task tool for agents** - Lost MCP access, required workarounds
|
|
203
|
+
|
|
204
|
+
#### Key Insights
|
|
205
|
+
|
|
206
|
+
1. **Shorter is better** - Lean agent files that reference specs work better than verbose ones
|
|
207
|
+
2. **Commands > Agent files** - Critical instructions in commands get followed more reliably
|
|
208
|
+
3. **Explicit > Implicit** - Validation checklists catch what assumptions miss
|
|
209
|
+
4. **Ownership matters** - Clear ownership of ticket lifecycle reduces back-and-forth
|
|
210
|
+
|
|
211
|
+
### Common Failure Modes
|
|
212
|
+
|
|
213
|
+
| Failure | Cause | Solution |
|
|
214
|
+
|---------|-------|----------|
|
|
215
|
+
| Agent uses Task tool | Default behavior, ignores instructions | FORBIDDEN ACTIONS section + commands |
|
|
216
|
+
| Review not posted to PR | Agent only sends to inbox | Explicit requirement in reviewer template |
|
|
217
|
+
| Ticket stuck in wrong status | Engineer didn't move it | Engineer responsibility in workflow |
|
|
218
|
+
| Missing workflow checkpoint | Agent forgot | Required in completion report template |
|
|
219
|
+
| Duplicate work | Inbox message processed twice | Move to `processed/` folder |
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Agent Autonomy Roadmap
|
|
224
|
+
|
|
225
|
+
### Phase 1: Task Tool Subagents (Deprecated)
|
|
226
|
+
|
|
227
|
+
**Status:** Superseded
|
|
228
|
+
|
|
229
|
+
- Agents invoked via Task tool as subagents
|
|
230
|
+
- No MCP access - required workarounds
|
|
231
|
+
- User/parent executed MCP operations on agent's behalf
|
|
232
|
+
|
|
233
|
+
**User effort:** High
|
|
234
|
+
|
|
235
|
+
### Phase 2: Direct Agent Invocation (Current)
|
|
236
|
+
|
|
237
|
+
**Status:** Active
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
@engineering-manager /delegate SUR-XX to wearos-engineer
|
|
241
|
+
@wearos-engineer /check-inbox
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
**Benefits:**
|
|
245
|
+
- Full MCP access (Atlassian, GitHub)
|
|
246
|
+
- No workarounds needed
|
|
247
|
+
- Agents can update Jira/GitHub directly
|
|
248
|
+
|
|
249
|
+
**Limitations:**
|
|
250
|
+
- Can't approve own PRs (GitHub restriction)
|
|
251
|
+
- User must invoke each agent manually
|
|
252
|
+
- No automatic agent-to-agent handoffs
|
|
253
|
+
|
|
254
|
+
**User effort:** Low-Medium
|
|
255
|
+
|
|
256
|
+
### Phase 3: Agent-to-Agent Orchestration (Future)
|
|
257
|
+
|
|
258
|
+
EM can directly invoke other agents with full MCP access.
|
|
259
|
+
|
|
260
|
+
**Requirements:**
|
|
261
|
+
- Agent invocation that preserves MCP context
|
|
262
|
+
- Or: Each agent as separate root conversation
|
|
263
|
+
- Possibly: Claude Code hooks
|
|
264
|
+
|
|
265
|
+
**User effort:** Low
|
|
266
|
+
|
|
267
|
+
### Phase 4: Event-Driven Automation (Future)
|
|
268
|
+
|
|
269
|
+
Agents triggered by events:
|
|
270
|
+
|
|
271
|
+
| Event | Trigger | Action |
|
|
272
|
+
|-------|---------|--------|
|
|
273
|
+
| PR created | GitHub webhook | QA runs tests |
|
|
274
|
+
| CI passes | GitHub Actions | SA reviews |
|
|
275
|
+
| Review approved | PR comment | EM notified |
|
|
276
|
+
|
|
277
|
+
**Requirements:**
|
|
278
|
+
- Webhook infrastructure
|
|
279
|
+
- Agent persistence
|
|
280
|
+
- Event routing
|
|
281
|
+
|
|
282
|
+
**User effort:** Minimal
|
|
283
|
+
|
|
284
|
+
### Phase 5: Full Autonomy (Vision)
|
|
285
|
+
|
|
286
|
+
- Agents collaborate without intervention
|
|
287
|
+
- Self-healing and self-improving
|
|
288
|
+
- Human-in-the-loop only for strategic decisions
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Implementation Approaches
|
|
293
|
+
|
|
294
|
+
### Option A: Shared Knowledge Base (Current)
|
|
295
|
+
|
|
296
|
+
```
|
|
297
|
+
┌─────────────────────────────────┐
|
|
298
|
+
│ Knowledge Library │
|
|
299
|
+
│ ├── context.txt │
|
|
300
|
+
│ └── [agent]/inbox/ │
|
|
301
|
+
└─────────────────────────────────┘
|
|
302
|
+
↑ ↑ ↑
|
|
303
|
+
Agent 1 Agent 2 Agent 3
|
|
304
|
+
(root) (root) (root)
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
- Agents communicate via inbox files
|
|
308
|
+
- User invokes agents as needed
|
|
309
|
+
- Each has full MCP access
|
|
310
|
+
|
|
311
|
+
### Option B: Custom Orchestration Layer
|
|
312
|
+
|
|
313
|
+
External service manages agent invocation:
|
|
314
|
+
|
|
315
|
+
```
|
|
316
|
+
┌────────────────────────────┐
|
|
317
|
+
│ Orchestration Service │
|
|
318
|
+
│ - Event listeners │
|
|
319
|
+
│ - Agent invocation API │
|
|
320
|
+
└────────────────────────────┘
|
|
321
|
+
↓ invokes
|
|
322
|
+
Claude Agents (via API)
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Option C: Claude Code Hooks
|
|
326
|
+
|
|
327
|
+
Use hooks for event-driven automation:
|
|
328
|
+
|
|
329
|
+
```javascript
|
|
330
|
+
// .claude/hooks/pr-created.js
|
|
331
|
+
module.exports = async (context) => {
|
|
332
|
+
await context.invokeAgent('solutions-architect', {
|
|
333
|
+
task: `Review PR #${context.pr.number}`
|
|
334
|
+
});
|
|
335
|
+
};
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## Directory Structure
|
|
341
|
+
|
|
342
|
+
```
|
|
343
|
+
coreai/
|
|
344
|
+
├── PRODUCT.md # This file - vision, goals, lessons
|
|
345
|
+
├── README.md # Setup instructions
|
|
346
|
+
├── AGENT_SPEC.md # Master agent specification
|
|
347
|
+
├── WORKFLOWS.md # Workflow state machines
|
|
348
|
+
├── ARCHITECTURE.md # Technical architecture
|
|
349
|
+
│
|
|
350
|
+
├── scripts/
|
|
351
|
+
│ ├── install.sh # Main installer
|
|
352
|
+
│ └── add-agent.sh # Add new agent
|
|
353
|
+
│
|
|
354
|
+
├── agents/
|
|
355
|
+
│ ├── _templates/ # Agent templates for add-agent.sh
|
|
356
|
+
│ │ ├── ic-engineer.md
|
|
357
|
+
│ │ └── reviewer.md
|
|
358
|
+
│ └── examples/ # Ready-to-use agents (copied on install)
|
|
359
|
+
│ ├── engineering-manager.md
|
|
360
|
+
│ ├── backend-engineer.md
|
|
361
|
+
│ ├── android-engineer.md
|
|
362
|
+
│ ├── wearos-engineer.md
|
|
363
|
+
│ ├── devops-engineer.md
|
|
364
|
+
│ ├── solutions-architect.md
|
|
365
|
+
│ ├── qa-engineer.md
|
|
366
|
+
│ ├── security-engineer.md
|
|
367
|
+
│ ├── product-manager.md
|
|
368
|
+
│ └── frontend-engineer.md
|
|
369
|
+
│
|
|
370
|
+
├── commands/
|
|
371
|
+
│ ├── core/ # Always installed
|
|
372
|
+
│ │ ├── delegate.md
|
|
373
|
+
│ │ ├── check-inbox.md
|
|
374
|
+
│ │ ├── review.md
|
|
375
|
+
│ │ ├── sprint-status.md
|
|
376
|
+
│ │ ├── git-commit.md
|
|
377
|
+
│ │ └── pr-create.md
|
|
378
|
+
│ └── optional/ # Install as needed
|
|
379
|
+
│ ├── worktree-setup.md
|
|
380
|
+
│ ├── worktree-cleanup.md
|
|
381
|
+
│ ├── jira-create.md
|
|
382
|
+
│ ├── jira-transition.md
|
|
383
|
+
│ └── docs-update.md
|
|
384
|
+
│
|
|
385
|
+
├── templates/ # Inbox message formats
|
|
386
|
+
│ ├── task-assignment.md
|
|
387
|
+
│ ├── completion-report.md
|
|
388
|
+
│ ├── review-request.md
|
|
389
|
+
│ ├── review-complete.md
|
|
390
|
+
│ └── feedback.md
|
|
391
|
+
│
|
|
392
|
+
└── knowledge-library/ # → KnowledgeLibrary/
|
|
393
|
+
├── README.md
|
|
394
|
+
├── context.txt
|
|
395
|
+
├── architecture.txt
|
|
396
|
+
├── prd.txt
|
|
397
|
+
└── [agent-name]/
|
|
398
|
+
├── inbox/processed/
|
|
399
|
+
├── outbox/
|
|
400
|
+
├── context/current.txt
|
|
401
|
+
├── history/
|
|
402
|
+
├── tech/
|
|
403
|
+
└── control/
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## Quick Start for New Project
|
|
409
|
+
|
|
410
|
+
```bash
|
|
411
|
+
# 1. Navigate to your project
|
|
412
|
+
cd /path/to/your-project
|
|
413
|
+
|
|
414
|
+
# 2. Run the installer
|
|
415
|
+
/path/to/coreai/scripts/install.sh \
|
|
416
|
+
--name "Your Project" \
|
|
417
|
+
--jira "PROJ" \
|
|
418
|
+
--github "owner/repo" \
|
|
419
|
+
--agents "engineering-manager,backend-engineer,qa-engineer" \
|
|
420
|
+
--all-commands
|
|
421
|
+
|
|
422
|
+
# 3. Add additional agents as needed
|
|
423
|
+
./coreai/scripts/add-agent.sh frontend-engineer --type ic
|
|
424
|
+
./coreai/scripts/add-agent.sh security-engineer --type reviewer
|
|
425
|
+
|
|
426
|
+
# 4. Customize
|
|
427
|
+
# - Update tech stack in agent files
|
|
428
|
+
# - Update Jira project key, GitHub repo
|
|
429
|
+
# - Fill in KnowledgeLibrary/context.txt, architecture.txt, prd.txt
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
## Next Steps
|
|
435
|
+
|
|
436
|
+
### Immediate
|
|
437
|
+
|
|
438
|
+
1. Test the template with a sample workflow
|
|
439
|
+
2. Create specific engineer agents from templates
|
|
440
|
+
3. Validate message templates work as expected
|
|
441
|
+
|
|
442
|
+
### Short Term
|
|
443
|
+
|
|
444
|
+
1. Migrate SurfTrack to use coreai patterns
|
|
445
|
+
2. Refine based on real usage
|
|
446
|
+
3. Add more commands as needed
|
|
447
|
+
|
|
448
|
+
### Medium Term
|
|
449
|
+
|
|
450
|
+
1. Explore Phase 3 (agent-to-agent orchestration)
|
|
451
|
+
2. Consider GitHub Actions integration
|
|
452
|
+
3. Build release/hotfix commands
|
|
453
|
+
|
|
454
|
+
### Long Term
|
|
455
|
+
|
|
456
|
+
1. Event-driven automation
|
|
457
|
+
2. Self-improving agent patterns
|
|
458
|
+
3. Full autonomy for routine tasks
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
## References
|
|
463
|
+
|
|
464
|
+
- [README.md](README.md) - Setup instructions
|
|
465
|
+
- [AGENT_SPEC.md](AGENT_SPEC.md) - Master specification
|
|
466
|
+
- [WORKFLOWS.md](WORKFLOWS.md) - State machines
|
|
467
|
+
- [knowledge-library/README.md](knowledge-library/README.md) - Communication hub
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
*Version: 1.0.0*
|
|
472
|
+
*Created: 2026-01-05*
|
|
473
|
+
*Origin: SurfTrack multi-agent system learnings*
|