@deimoscloud/coreai 0.1.9 → 0.1.10
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/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -1
- package/.prettierrc +0 -9
- package/AGENT_SPEC.md +0 -347
- package/ARCHITECTURE.md +0 -547
- package/DRAFT_PRD.md +0 -1440
- package/IMPLEMENTATION_PLAN.md +0 -256
- package/PRODUCT.md +0 -473
- package/WORKFLOWS.md +0 -295
- package/commands/core/check-inbox.md +0 -34
- package/commands/core/delegate.md +0 -30
- package/commands/core/git-commit.md +0 -144
- package/commands/core/pr-create.md +0 -193
- package/commands/core/review.md +0 -56
- package/commands/core/sprint-status.md +0 -65
- package/commands/optional/docs-update.md +0 -200
- package/commands/optional/jira-create.md +0 -200
- package/commands/optional/jira-transition.md +0 -184
- package/commands/optional/worktree-cleanup.md +0 -167
- package/commands/optional/worktree-setup.md +0 -110
- package/eslint.config.js +0 -29
- package/jest.config.js +0 -22
- package/knowledge-library/README.md +0 -118
- package/knowledge-library/android-engineer/context/current.txt +0 -42
- package/knowledge-library/android-engineer/control/decisions.txt +0 -9
- package/knowledge-library/android-engineer/control/dependencies.txt +0 -19
- package/knowledge-library/android-engineer/control/objectives.txt +0 -26
- 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 +0 -61
- package/knowledge-library/backend-engineer/context/current.txt +0 -42
- package/knowledge-library/backend-engineer/control/decisions.txt +0 -9
- package/knowledge-library/backend-engineer/control/dependencies.txt +0 -19
- package/knowledge-library/backend-engineer/control/objectives.txt +0 -26
- 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 +0 -52
- package/knowledge-library/devops-engineer/context/current.txt +0 -42
- package/knowledge-library/devops-engineer/control/decisions.txt +0 -9
- package/knowledge-library/devops-engineer/control/dependencies.txt +0 -19
- package/knowledge-library/devops-engineer/control/objectives.txt +0 -26
- 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 +0 -40
- package/knowledge-library/engineering-manager/control/decisions.txt +0 -9
- package/knowledge-library/engineering-manager/control/objectives.txt +0 -27
- 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 +0 -81
- package/knowledge-library/product-manager/context/current.txt +0 -42
- package/knowledge-library/product-manager/control/decisions.txt +0 -9
- package/knowledge-library/product-manager/control/dependencies.txt +0 -19
- package/knowledge-library/product-manager/control/objectives.txt +0 -26
- 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 +0 -42
- package/knowledge-library/qa-engineer/control/decisions.txt +0 -9
- package/knowledge-library/qa-engineer/control/dependencies.txt +0 -19
- package/knowledge-library/qa-engineer/control/objectives.txt +0 -26
- 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 +0 -42
- package/knowledge-library/security-engineer/control/decisions.txt +0 -9
- package/knowledge-library/security-engineer/control/dependencies.txt +0 -19
- package/knowledge-library/security-engineer/control/objectives.txt +0 -26
- 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 +0 -42
- package/knowledge-library/solutions-architect/control/decisions.txt +0 -9
- package/knowledge-library/solutions-architect/control/dependencies.txt +0 -19
- package/knowledge-library/solutions-architect/control/objectives.txt +0 -26
- 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 +0 -42
- package/knowledge-library/wearos-engineer/control/decisions.txt +0 -9
- package/knowledge-library/wearos-engineer/control/dependencies.txt +0 -19
- package/knowledge-library/wearos-engineer/control/objectives.txt +0 -26
- 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/scripts/add-agent.sh +0 -323
- package/scripts/install.sh +0 -354
- package/src/adapters/factory.test.ts +0 -386
- package/src/adapters/factory.ts +0 -305
- package/src/adapters/index.ts +0 -113
- package/src/adapters/interfaces.ts +0 -268
- package/src/adapters/mcp/client.test.ts +0 -130
- package/src/adapters/mcp/client.ts +0 -451
- package/src/adapters/mcp/discovery.test.ts +0 -315
- package/src/adapters/mcp/discovery.ts +0 -340
- package/src/adapters/mcp/index.ts +0 -66
- package/src/adapters/mcp/mapper.test.ts +0 -218
- package/src/adapters/mcp/mapper.ts +0 -536
- package/src/adapters/mcp/registry.test.ts +0 -433
- package/src/adapters/mcp/registry.ts +0 -550
- package/src/adapters/mcp/types.ts +0 -258
- package/src/adapters/native/filesystem.test.ts +0 -350
- package/src/adapters/native/filesystem.ts +0 -393
- package/src/adapters/native/github.test.ts +0 -173
- package/src/adapters/native/github.ts +0 -627
- package/src/adapters/native/index.ts +0 -22
- package/src/adapters/native/selector.test.ts +0 -224
- package/src/adapters/native/selector.ts +0 -150
- package/src/adapters/types.ts +0 -270
- package/src/agents/compiler.test.ts +0 -410
- package/src/agents/compiler.ts +0 -424
- package/src/agents/index.ts +0 -37
- package/src/agents/loader.test.ts +0 -319
- package/src/agents/loader.ts +0 -143
- package/src/agents/resolver.test.ts +0 -282
- package/src/agents/resolver.ts +0 -262
- package/src/agents/types.ts +0 -97
- package/src/cache/index.ts +0 -38
- package/src/cache/interfaces.ts +0 -283
- package/src/cache/manager.test.ts +0 -266
- package/src/cache/manager.ts +0 -388
- package/src/cache/provider.test.ts +0 -485
- package/src/cache/provider.ts +0 -745
- package/src/cache/types.test.ts +0 -192
- package/src/cache/types.ts +0 -313
- package/src/cli/commands/build.test.ts +0 -248
- package/src/cli/commands/build.ts +0 -284
- package/src/cli/commands/cache.test.ts +0 -221
- package/src/cli/commands/cache.ts +0 -229
- package/src/cli/commands/index.ts +0 -63
- package/src/cli/commands/init.test.ts +0 -173
- package/src/cli/commands/init.ts +0 -296
- package/src/cli/commands/skills.test.ts +0 -272
- package/src/cli/commands/skills.ts +0 -348
- package/src/cli/commands/status.test.ts +0 -392
- package/src/cli/commands/status.ts +0 -332
- package/src/cli/commands/sync.test.ts +0 -213
- package/src/cli/commands/sync.ts +0 -251
- package/src/cli/commands/validate.test.ts +0 -216
- package/src/cli/commands/validate.ts +0 -340
- package/src/cli/index.test.ts +0 -190
- package/src/cli/index.ts +0 -493
- package/src/commands/context.test.ts +0 -163
- package/src/commands/context.ts +0 -111
- package/src/commands/index.ts +0 -56
- package/src/commands/loader.test.ts +0 -273
- package/src/commands/loader.ts +0 -355
- package/src/commands/registry.test.ts +0 -384
- package/src/commands/registry.ts +0 -248
- package/src/commands/runner.test.ts +0 -297
- package/src/commands/runner.ts +0 -222
- package/src/commands/types.ts +0 -361
- package/src/config/index.ts +0 -19
- package/src/config/loader.test.ts +0 -262
- package/src/config/loader.ts +0 -188
- package/src/config/types.ts +0 -154
- package/src/context/index.ts +0 -14
- package/src/context/loader.test.ts +0 -334
- package/src/context/loader.ts +0 -357
- package/src/index.test.ts +0 -13
- package/src/index.ts +0 -268
- package/src/knowledge-library/index.ts +0 -44
- package/src/knowledge-library/manager.test.ts +0 -536
- package/src/knowledge-library/manager.ts +0 -804
- package/src/knowledge-library/types.ts +0 -432
- package/src/skills/generator.test.ts +0 -602
- package/src/skills/generator.ts +0 -491
- package/src/skills/index.ts +0 -27
- package/src/skills/templates.ts +0 -520
- package/src/skills/types.ts +0 -251
- package/templates/completion-report.md +0 -72
- package/templates/feedback.md +0 -56
- package/templates/project-files/CLAUDE.md.template +0 -109
- package/templates/project-files/coreai.json.example +0 -47
- package/templates/project-files/mcp.json.template +0 -20
- package/templates/review-complete.md +0 -64
- package/templates/review-request.md +0 -67
- package/templates/task-assignment.md +0 -51
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -26
- package/tsup.config.ts +0 -23
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# [Agent Name] - Objectives
|
|
2
|
-
|
|
3
|
-
## Primary Objectives
|
|
4
|
-
|
|
5
|
-
1. [Primary objective based on role]
|
|
6
|
-
2. [Primary objective based on role]
|
|
7
|
-
|
|
8
|
-
## Current Sprint Objectives
|
|
9
|
-
|
|
10
|
-
- [ ] [Objective 1]
|
|
11
|
-
- [ ] [Objective 2]
|
|
12
|
-
|
|
13
|
-
## Quality Standards
|
|
14
|
-
|
|
15
|
-
- [ ] All code has tests
|
|
16
|
-
- [ ] Lint checks pass
|
|
17
|
-
- [ ] Static analysis passes
|
|
18
|
-
- [ ] Acceptance criteria met
|
|
19
|
-
|
|
20
|
-
## Workflow Responsibilities
|
|
21
|
-
|
|
22
|
-
- Move ticket to "In Progress" when starting
|
|
23
|
-
- Create branch with correct naming
|
|
24
|
-
- Run quality checks before PR
|
|
25
|
-
- Move ticket to "In Review" after PR
|
|
26
|
-
- Send completion report to EM
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# [Agent Name] - Current Context
|
|
2
|
-
|
|
3
|
-
> **Last Updated:** [YYYY-MM-DD HH:MM]
|
|
4
|
-
|
|
5
|
-
## Current Focus
|
|
6
|
-
|
|
7
|
-
[What you're currently working on]
|
|
8
|
-
|
|
9
|
-
## Active Tasks
|
|
10
|
-
|
|
11
|
-
| Ticket | Status | Branch | PR |
|
|
12
|
-
|--------|--------|--------|-----|
|
|
13
|
-
| [KEY-XX] | [in-progress/pr-created/in-review] | [branch] | [#XX or -] |
|
|
14
|
-
|
|
15
|
-
## Work in Progress
|
|
16
|
-
|
|
17
|
-
### [KEY-XX] - [Title]
|
|
18
|
-
- **Status:** [status]
|
|
19
|
-
- **Branch:** [branch name]
|
|
20
|
-
- **Progress:**
|
|
21
|
-
- [x] Completed item
|
|
22
|
-
- [ ] Pending item
|
|
23
|
-
- **Blockers:** [None or description]
|
|
24
|
-
|
|
25
|
-
## Pending Reviews
|
|
26
|
-
|
|
27
|
-
| PR | Ticket | Requested By | Status |
|
|
28
|
-
|----|--------|--------------|--------|
|
|
29
|
-
| #XX | [KEY-XX] | [agent] | [pending/done] |
|
|
30
|
-
|
|
31
|
-
## Technical Notes
|
|
32
|
-
|
|
33
|
-
[Any technical context to remember]
|
|
34
|
-
|
|
35
|
-
## Next Actions
|
|
36
|
-
|
|
37
|
-
1. [ ] [Action 1]
|
|
38
|
-
2. [ ] [Action 2]
|
|
39
|
-
|
|
40
|
-
## Questions/Blockers
|
|
41
|
-
|
|
42
|
-
- [Any questions for EM or other agents]
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# [Agent Name] - Dependencies
|
|
2
|
-
|
|
3
|
-
## Waiting On
|
|
4
|
-
|
|
5
|
-
| Dependency | From | Ticket | Status |
|
|
6
|
-
|------------|------|--------|--------|
|
|
7
|
-
| [what you need] | [agent] | [KEY-XX] | [waiting/resolved] |
|
|
8
|
-
|
|
9
|
-
## Providing To
|
|
10
|
-
|
|
11
|
-
| Deliverable | To | Ticket | Status |
|
|
12
|
-
|-------------|-----|--------|--------|
|
|
13
|
-
| [what you're providing] | [agent] | [KEY-XX] | [pending/delivered] |
|
|
14
|
-
|
|
15
|
-
## External Dependencies
|
|
16
|
-
|
|
17
|
-
| Dependency | Type | Status |
|
|
18
|
-
|------------|------|--------|
|
|
19
|
-
| [e.g., API access] | [service/data/approval] | [status] |
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# [Agent Name] - Objectives
|
|
2
|
-
|
|
3
|
-
## Primary Objectives
|
|
4
|
-
|
|
5
|
-
1. [Primary objective based on role]
|
|
6
|
-
2. [Primary objective based on role]
|
|
7
|
-
|
|
8
|
-
## Current Sprint Objectives
|
|
9
|
-
|
|
10
|
-
- [ ] [Objective 1]
|
|
11
|
-
- [ ] [Objective 2]
|
|
12
|
-
|
|
13
|
-
## Quality Standards
|
|
14
|
-
|
|
15
|
-
- [ ] All code has tests
|
|
16
|
-
- [ ] Lint checks pass
|
|
17
|
-
- [ ] Static analysis passes
|
|
18
|
-
- [ ] Acceptance criteria met
|
|
19
|
-
|
|
20
|
-
## Workflow Responsibilities
|
|
21
|
-
|
|
22
|
-
- Move ticket to "In Progress" when starting
|
|
23
|
-
- Create branch with correct naming
|
|
24
|
-
- Run quality checks before PR
|
|
25
|
-
- Move ticket to "In Review" after PR
|
|
26
|
-
- Send completion report to EM
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# [Agent Name] - Current Context
|
|
2
|
-
|
|
3
|
-
> **Last Updated:** [YYYY-MM-DD HH:MM]
|
|
4
|
-
|
|
5
|
-
## Current Focus
|
|
6
|
-
|
|
7
|
-
[What you're currently working on]
|
|
8
|
-
|
|
9
|
-
## Active Tasks
|
|
10
|
-
|
|
11
|
-
| Ticket | Status | Branch | PR |
|
|
12
|
-
|--------|--------|--------|-----|
|
|
13
|
-
| [KEY-XX] | [in-progress/pr-created/in-review] | [branch] | [#XX or -] |
|
|
14
|
-
|
|
15
|
-
## Work in Progress
|
|
16
|
-
|
|
17
|
-
### [KEY-XX] - [Title]
|
|
18
|
-
- **Status:** [status]
|
|
19
|
-
- **Branch:** [branch name]
|
|
20
|
-
- **Progress:**
|
|
21
|
-
- [x] Completed item
|
|
22
|
-
- [ ] Pending item
|
|
23
|
-
- **Blockers:** [None or description]
|
|
24
|
-
|
|
25
|
-
## Pending Reviews
|
|
26
|
-
|
|
27
|
-
| PR | Ticket | Requested By | Status |
|
|
28
|
-
|----|--------|--------------|--------|
|
|
29
|
-
| #XX | [KEY-XX] | [agent] | [pending/done] |
|
|
30
|
-
|
|
31
|
-
## Technical Notes
|
|
32
|
-
|
|
33
|
-
[Any technical context to remember]
|
|
34
|
-
|
|
35
|
-
## Next Actions
|
|
36
|
-
|
|
37
|
-
1. [ ] [Action 1]
|
|
38
|
-
2. [ ] [Action 2]
|
|
39
|
-
|
|
40
|
-
## Questions/Blockers
|
|
41
|
-
|
|
42
|
-
- [Any questions for EM or other agents]
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# [Agent Name] - Dependencies
|
|
2
|
-
|
|
3
|
-
## Waiting On
|
|
4
|
-
|
|
5
|
-
| Dependency | From | Ticket | Status |
|
|
6
|
-
|------------|------|--------|--------|
|
|
7
|
-
| [what you need] | [agent] | [KEY-XX] | [waiting/resolved] |
|
|
8
|
-
|
|
9
|
-
## Providing To
|
|
10
|
-
|
|
11
|
-
| Deliverable | To | Ticket | Status |
|
|
12
|
-
|-------------|-----|--------|--------|
|
|
13
|
-
| [what you're providing] | [agent] | [KEY-XX] | [pending/delivered] |
|
|
14
|
-
|
|
15
|
-
## External Dependencies
|
|
16
|
-
|
|
17
|
-
| Dependency | Type | Status |
|
|
18
|
-
|------------|------|--------|
|
|
19
|
-
| [e.g., API access] | [service/data/approval] | [status] |
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# [Agent Name] - Objectives
|
|
2
|
-
|
|
3
|
-
## Primary Objectives
|
|
4
|
-
|
|
5
|
-
1. [Primary objective based on role]
|
|
6
|
-
2. [Primary objective based on role]
|
|
7
|
-
|
|
8
|
-
## Current Sprint Objectives
|
|
9
|
-
|
|
10
|
-
- [ ] [Objective 1]
|
|
11
|
-
- [ ] [Objective 2]
|
|
12
|
-
|
|
13
|
-
## Quality Standards
|
|
14
|
-
|
|
15
|
-
- [ ] All code has tests
|
|
16
|
-
- [ ] Lint checks pass
|
|
17
|
-
- [ ] Static analysis passes
|
|
18
|
-
- [ ] Acceptance criteria met
|
|
19
|
-
|
|
20
|
-
## Workflow Responsibilities
|
|
21
|
-
|
|
22
|
-
- Move ticket to "In Progress" when starting
|
|
23
|
-
- Create branch with correct naming
|
|
24
|
-
- Run quality checks before PR
|
|
25
|
-
- Move ticket to "In Review" after PR
|
|
26
|
-
- Send completion report to EM
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/scripts/add-agent.sh
DELETED
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# CoreAI Add Agent Script
|
|
4
|
-
# Creates a new agent with KnowledgeLibrary directory structure
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
# Colors for output
|
|
9
|
-
RED='\033[0;31m'
|
|
10
|
-
GREEN='\033[0;32m'
|
|
11
|
-
YELLOW='\033[1;33m'
|
|
12
|
-
BLUE='\033[0;34m'
|
|
13
|
-
NC='\033[0m' # No Color
|
|
14
|
-
|
|
15
|
-
# Script directory (where coreai is located)
|
|
16
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
17
|
-
COREAI_DIR="$(dirname "$SCRIPT_DIR")"
|
|
18
|
-
|
|
19
|
-
# Default values
|
|
20
|
-
AGENT_NAME=""
|
|
21
|
-
AGENT_TYPE="ic" # ic or reviewer
|
|
22
|
-
TARGET_DIR=""
|
|
23
|
-
DESCRIPTION=""
|
|
24
|
-
DISPLAY_NAME=""
|
|
25
|
-
|
|
26
|
-
# Function to print usage
|
|
27
|
-
print_usage() {
|
|
28
|
-
echo "Usage: $0 <agent-name> [OPTIONS]"
|
|
29
|
-
echo ""
|
|
30
|
-
echo "Arguments:"
|
|
31
|
-
echo " agent-name Agent name (lowercase, hyphenated, e.g., backend-engineer)"
|
|
32
|
-
echo ""
|
|
33
|
-
echo "Options:"
|
|
34
|
-
echo " --type TYPE Agent type: 'ic' (default) or 'reviewer'"
|
|
35
|
-
echo " --target DIR Target project directory (default: current directory)"
|
|
36
|
-
echo " --description DESC Agent description"
|
|
37
|
-
echo " --display-name NAME Display name (default: Title Case of agent-name)"
|
|
38
|
-
echo " -h, --help Show this help message"
|
|
39
|
-
echo ""
|
|
40
|
-
echo "Examples:"
|
|
41
|
-
echo " $0 backend-engineer --type ic"
|
|
42
|
-
echo " $0 security-engineer --type reviewer --description 'Security reviews and audits'"
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
# Parse arguments
|
|
46
|
-
if [[ $# -lt 1 ]]; then
|
|
47
|
-
print_usage
|
|
48
|
-
exit 1
|
|
49
|
-
fi
|
|
50
|
-
|
|
51
|
-
AGENT_NAME="$1"
|
|
52
|
-
shift
|
|
53
|
-
|
|
54
|
-
while [[ $# -gt 0 ]]; do
|
|
55
|
-
case $1 in
|
|
56
|
-
--type)
|
|
57
|
-
AGENT_TYPE="$2"
|
|
58
|
-
shift 2
|
|
59
|
-
;;
|
|
60
|
-
--target)
|
|
61
|
-
TARGET_DIR="$2"
|
|
62
|
-
shift 2
|
|
63
|
-
;;
|
|
64
|
-
--description)
|
|
65
|
-
DESCRIPTION="$2"
|
|
66
|
-
shift 2
|
|
67
|
-
;;
|
|
68
|
-
--display-name)
|
|
69
|
-
DISPLAY_NAME="$2"
|
|
70
|
-
shift 2
|
|
71
|
-
;;
|
|
72
|
-
-h|--help)
|
|
73
|
-
print_usage
|
|
74
|
-
exit 0
|
|
75
|
-
;;
|
|
76
|
-
*)
|
|
77
|
-
echo -e "${RED}Unknown option: $1${NC}"
|
|
78
|
-
print_usage
|
|
79
|
-
exit 1
|
|
80
|
-
;;
|
|
81
|
-
esac
|
|
82
|
-
done
|
|
83
|
-
|
|
84
|
-
# Validate agent name (lowercase, hyphenated)
|
|
85
|
-
if [[ ! "$AGENT_NAME" =~ ^[a-z][a-z0-9-]*$ ]]; then
|
|
86
|
-
echo -e "${RED}Error: Agent name must be lowercase, start with a letter, and use hyphens (e.g., backend-engineer)${NC}"
|
|
87
|
-
exit 1
|
|
88
|
-
fi
|
|
89
|
-
|
|
90
|
-
# Validate agent type
|
|
91
|
-
if [[ "$AGENT_TYPE" != "ic" && "$AGENT_TYPE" != "reviewer" ]]; then
|
|
92
|
-
echo -e "${RED}Error: Agent type must be 'ic' or 'reviewer'${NC}"
|
|
93
|
-
exit 1
|
|
94
|
-
fi
|
|
95
|
-
|
|
96
|
-
# Set defaults
|
|
97
|
-
TARGET_DIR="${TARGET_DIR:-.}"
|
|
98
|
-
TARGET_DIR="$(cd "$TARGET_DIR" && pwd)"
|
|
99
|
-
|
|
100
|
-
# Generate display name from agent name (e.g., backend-engineer -> Backend Engineer)
|
|
101
|
-
if [[ -z "$DISPLAY_NAME" ]]; then
|
|
102
|
-
DISPLAY_NAME=$(echo "$AGENT_NAME" | sed 's/-/ /g' | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) tolower(substr($i,2))}1')
|
|
103
|
-
fi
|
|
104
|
-
|
|
105
|
-
# Set default description
|
|
106
|
-
if [[ -z "$DESCRIPTION" ]]; then
|
|
107
|
-
if [[ "$AGENT_TYPE" == "ic" ]]; then
|
|
108
|
-
DESCRIPTION="$DISPLAY_NAME implementing features and fixing bugs."
|
|
109
|
-
else
|
|
110
|
-
DESCRIPTION="$DISPLAY_NAME reviewing code and providing guidance."
|
|
111
|
-
fi
|
|
112
|
-
fi
|
|
113
|
-
|
|
114
|
-
echo -e "${BLUE}Adding Agent: $AGENT_NAME${NC}"
|
|
115
|
-
echo "=============================="
|
|
116
|
-
echo "Type: $AGENT_TYPE"
|
|
117
|
-
echo "Display Name: $DISPLAY_NAME"
|
|
118
|
-
echo "Description: $DESCRIPTION"
|
|
119
|
-
echo "Target: $TARGET_DIR"
|
|
120
|
-
echo ""
|
|
121
|
-
|
|
122
|
-
# Check if agent already exists
|
|
123
|
-
if [[ -f "$TARGET_DIR/.claude/agents/${AGENT_NAME}.md" ]]; then
|
|
124
|
-
echo -e "${RED}Error: Agent ${AGENT_NAME} already exists at .claude/agents/${AGENT_NAME}.md${NC}"
|
|
125
|
-
exit 1
|
|
126
|
-
fi
|
|
127
|
-
|
|
128
|
-
# Check if coreai.json exists
|
|
129
|
-
if [[ ! -f "$TARGET_DIR/coreai.json" ]]; then
|
|
130
|
-
echo -e "${YELLOW}Warning: coreai.json not found. Run install.sh first or create manually.${NC}"
|
|
131
|
-
fi
|
|
132
|
-
|
|
133
|
-
# Read config values from coreai.json if it exists
|
|
134
|
-
if [[ -f "$TARGET_DIR/coreai.json" ]]; then
|
|
135
|
-
PROJECT_NAME=$(jq -r '.project.name // "My Project"' "$TARGET_DIR/coreai.json")
|
|
136
|
-
JIRA_PROJECT=$(jq -r '.project.jiraProject // "PROJ"' "$TARGET_DIR/coreai.json")
|
|
137
|
-
GITHUB_REPO=$(jq -r '.project.githubRepo // ""' "$TARGET_DIR/coreai.json")
|
|
138
|
-
CONFLUENCE_SPACE=$(jq -r '.project.confluenceSpace // ""' "$TARGET_DIR/coreai.json")
|
|
139
|
-
CONFLUENCE_URL=$(jq -r '.project.confluenceUrl // "https://yourcompany.atlassian.net/wiki"' "$TARGET_DIR/coreai.json")
|
|
140
|
-
LINT_CMD=$(jq -r '.qualityChecks.lint // "npm run lint"' "$TARGET_DIR/coreai.json")
|
|
141
|
-
TEST_CMD=$(jq -r '.qualityChecks.test // "npm test"' "$TARGET_DIR/coreai.json")
|
|
142
|
-
else
|
|
143
|
-
PROJECT_NAME="My Project"
|
|
144
|
-
JIRA_PROJECT="PROJ"
|
|
145
|
-
GITHUB_REPO=""
|
|
146
|
-
CONFLUENCE_SPACE=""
|
|
147
|
-
CONFLUENCE_URL="https://yourcompany.atlassian.net/wiki"
|
|
148
|
-
LINT_CMD="npm run lint"
|
|
149
|
-
TEST_CMD="npm test"
|
|
150
|
-
fi
|
|
151
|
-
|
|
152
|
-
# Select template based on type
|
|
153
|
-
if [[ "$AGENT_TYPE" == "ic" ]]; then
|
|
154
|
-
TEMPLATE_FILE="$COREAI_DIR/agents/_templates/ic-engineer.md"
|
|
155
|
-
else
|
|
156
|
-
TEMPLATE_FILE="$COREAI_DIR/agents/_templates/reviewer.md"
|
|
157
|
-
fi
|
|
158
|
-
|
|
159
|
-
# Fallback: check if an example agent exists for this name
|
|
160
|
-
if [[ ! -f "$TEMPLATE_FILE" ]] && [[ -f "$COREAI_DIR/agents/examples/${AGENT_NAME}.md" ]]; then
|
|
161
|
-
echo -e "${BLUE}Found existing example agent, copying instead of using template...${NC}"
|
|
162
|
-
TEMPLATE_FILE="$COREAI_DIR/agents/examples/${AGENT_NAME}.md"
|
|
163
|
-
fi
|
|
164
|
-
|
|
165
|
-
if [[ ! -f "$TEMPLATE_FILE" ]]; then
|
|
166
|
-
echo -e "${RED}Error: Template file not found: $TEMPLATE_FILE${NC}"
|
|
167
|
-
exit 1
|
|
168
|
-
fi
|
|
169
|
-
|
|
170
|
-
# Create agent file from template
|
|
171
|
-
echo -e "${YELLOW}Creating agent file...${NC}"
|
|
172
|
-
mkdir -p "$TARGET_DIR/.claude/agents"
|
|
173
|
-
|
|
174
|
-
cp "$TEMPLATE_FILE" "$TARGET_DIR/.claude/agents/${AGENT_NAME}.md"
|
|
175
|
-
|
|
176
|
-
# Replace placeholders
|
|
177
|
-
sed -i.bak \
|
|
178
|
-
-e "s|{{AGENT_NAME}}|$AGENT_NAME|g" \
|
|
179
|
-
-e "s|{{AGENT_DISPLAY_NAME}}|$DISPLAY_NAME|g" \
|
|
180
|
-
-e "s|{{AGENT_DESCRIPTION}}|$DESCRIPTION|g" \
|
|
181
|
-
-e "s|{{AGENT_ROLE_DESCRIPTION}}|$DESCRIPTION|g" \
|
|
182
|
-
-e "s|{{PROJECT_NAME}}|$PROJECT_NAME|g" \
|
|
183
|
-
-e "s|{{JIRA_PROJECT}}|$JIRA_PROJECT|g" \
|
|
184
|
-
-e "s|{{GITHUB_REPO}}|$GITHUB_REPO|g" \
|
|
185
|
-
-e "s|{{CONFLUENCE_SPACE}}|$CONFLUENCE_SPACE|g" \
|
|
186
|
-
-e "s|{{CONFLUENCE_URL}}|$CONFLUENCE_URL|g" \
|
|
187
|
-
-e "s|{{LINT_CMD}}|$LINT_CMD|g" \
|
|
188
|
-
-e "s|{{TEST_CMD}}|$TEST_CMD|g" \
|
|
189
|
-
"$TARGET_DIR/.claude/agents/${AGENT_NAME}.md"
|
|
190
|
-
|
|
191
|
-
rm -f "$TARGET_DIR/.claude/agents/${AGENT_NAME}.md.bak"
|
|
192
|
-
|
|
193
|
-
echo " - .claude/agents/${AGENT_NAME}.md"
|
|
194
|
-
|
|
195
|
-
# Create KnowledgeLibrary directory structure
|
|
196
|
-
echo -e "${YELLOW}Creating KnowledgeLibrary directories...${NC}"
|
|
197
|
-
AGENT_DIR="$TARGET_DIR/KnowledgeLibrary/$AGENT_NAME"
|
|
198
|
-
|
|
199
|
-
mkdir -p "$AGENT_DIR/context"
|
|
200
|
-
mkdir -p "$AGENT_DIR/history"
|
|
201
|
-
mkdir -p "$AGENT_DIR/inbox/processed"
|
|
202
|
-
mkdir -p "$AGENT_DIR/outbox"
|
|
203
|
-
mkdir -p "$AGENT_DIR/tech"
|
|
204
|
-
mkdir -p "$AGENT_DIR/control"
|
|
205
|
-
|
|
206
|
-
# Create placeholder files
|
|
207
|
-
cat > "$AGENT_DIR/context/current.txt" << EOF
|
|
208
|
-
# $DISPLAY_NAME Context
|
|
209
|
-
# Last Updated: $(date +%Y-%m-%d)
|
|
210
|
-
|
|
211
|
-
## Current Status
|
|
212
|
-
Not Started
|
|
213
|
-
|
|
214
|
-
## Active Tasks
|
|
215
|
-
- [ ] None
|
|
216
|
-
|
|
217
|
-
## Current Priorities
|
|
218
|
-
### P0 (Critical)
|
|
219
|
-
- None
|
|
220
|
-
|
|
221
|
-
### P1 (High)
|
|
222
|
-
- None
|
|
223
|
-
|
|
224
|
-
## In Progress Work
|
|
225
|
-
| Task | Started | ETA | Blockers |
|
|
226
|
-
|------|---------|-----|----------|
|
|
227
|
-
| | | | |
|
|
228
|
-
|
|
229
|
-
## Blockers
|
|
230
|
-
- None
|
|
231
|
-
|
|
232
|
-
## Notes
|
|
233
|
-
[Working notes and context]
|
|
234
|
-
EOF
|
|
235
|
-
|
|
236
|
-
cat > "$AGENT_DIR/control/objectives.txt" << EOF
|
|
237
|
-
# $DISPLAY_NAME Objectives
|
|
238
|
-
# Last Updated: $(date +%Y-%m-%d)
|
|
239
|
-
|
|
240
|
-
## Primary Objectives
|
|
241
|
-
1. [Define primary objective]
|
|
242
|
-
2. [Define secondary objective]
|
|
243
|
-
|
|
244
|
-
## Current Sprint Goals
|
|
245
|
-
- [ ] TBD
|
|
246
|
-
|
|
247
|
-
## Success Criteria
|
|
248
|
-
- [Define success criteria]
|
|
249
|
-
EOF
|
|
250
|
-
|
|
251
|
-
cat > "$AGENT_DIR/control/decisions.txt" << EOF
|
|
252
|
-
# $DISPLAY_NAME Decision Log
|
|
253
|
-
# Format: [YYYY-MM-DD] Decision: [summary] | Rationale: [why]
|
|
254
|
-
|
|
255
|
-
## Decisions
|
|
256
|
-
|
|
257
|
-
[No decisions logged yet]
|
|
258
|
-
EOF
|
|
259
|
-
|
|
260
|
-
cat > "$AGENT_DIR/control/dependencies.txt" << EOF
|
|
261
|
-
# $DISPLAY_NAME Dependencies
|
|
262
|
-
# Last Updated: $(date +%Y-%m-%d)
|
|
263
|
-
|
|
264
|
-
## Blocking Dependencies (Waiting On)
|
|
265
|
-
| Dependency | Owner | Status | Impact |
|
|
266
|
-
|------------|-------|--------|--------|
|
|
267
|
-
| | | | |
|
|
268
|
-
|
|
269
|
-
## Providing To (Others Waiting On Me)
|
|
270
|
-
| Deliverable | Consumer | Status | ETA |
|
|
271
|
-
|-------------|----------|--------|-----|
|
|
272
|
-
| | | | |
|
|
273
|
-
|
|
274
|
-
## External Dependencies
|
|
275
|
-
- None
|
|
276
|
-
EOF
|
|
277
|
-
|
|
278
|
-
# Create .gitkeep files
|
|
279
|
-
touch "$AGENT_DIR/history/.gitkeep"
|
|
280
|
-
touch "$AGENT_DIR/inbox/processed/.gitkeep"
|
|
281
|
-
touch "$AGENT_DIR/outbox/.gitkeep"
|
|
282
|
-
touch "$AGENT_DIR/tech/.gitkeep"
|
|
283
|
-
|
|
284
|
-
echo " - KnowledgeLibrary/$AGENT_NAME/"
|
|
285
|
-
|
|
286
|
-
# Update coreai.json if it exists
|
|
287
|
-
if [[ -f "$TARGET_DIR/coreai.json" ]]; then
|
|
288
|
-
echo -e "${YELLOW}Updating coreai.json...${NC}"
|
|
289
|
-
|
|
290
|
-
# Add agent to installed list using jq
|
|
291
|
-
jq --arg agent "$AGENT_NAME" \
|
|
292
|
-
'.agents.installed += [$agent] | .agents.installed |= unique' \
|
|
293
|
-
"$TARGET_DIR/coreai.json" > "$TARGET_DIR/coreai.json.tmp"
|
|
294
|
-
|
|
295
|
-
mv "$TARGET_DIR/coreai.json.tmp" "$TARGET_DIR/coreai.json"
|
|
296
|
-
echo " - Added $AGENT_NAME to agents.installed"
|
|
297
|
-
fi
|
|
298
|
-
|
|
299
|
-
echo ""
|
|
300
|
-
echo -e "${GREEN}=============================="
|
|
301
|
-
echo "Agent $AGENT_NAME created!"
|
|
302
|
-
echo "==============================${NC}"
|
|
303
|
-
echo ""
|
|
304
|
-
echo "Created:"
|
|
305
|
-
echo " .claude/agents/${AGENT_NAME}.md"
|
|
306
|
-
echo " KnowledgeLibrary/$AGENT_NAME/"
|
|
307
|
-
echo " ├── context/current.txt"
|
|
308
|
-
echo " ├── control/objectives.txt"
|
|
309
|
-
echo " ├── control/decisions.txt"
|
|
310
|
-
echo " ├── control/dependencies.txt"
|
|
311
|
-
echo " ├── inbox/"
|
|
312
|
-
echo " ├── outbox/"
|
|
313
|
-
echo " ├── history/"
|
|
314
|
-
echo " └── tech/"
|
|
315
|
-
echo ""
|
|
316
|
-
echo "Next steps:"
|
|
317
|
-
echo " 1. Review and customize .claude/agents/${AGENT_NAME}.md"
|
|
318
|
-
echo " 2. Update the technical stack and responsibilities"
|
|
319
|
-
echo " 3. Add to engineering-manager's team list"
|
|
320
|
-
echo ""
|
|
321
|
-
echo -e "${BLUE}To invoke:${NC}"
|
|
322
|
-
echo " @${AGENT_NAME} check your inbox"
|
|
323
|
-
echo ""
|