ai-eng-system 0.0.14 → 0.0.16

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 (65) hide show
  1. package/README.md +24 -5
  2. package/dist/.claude-plugin/agents/agent-creator.md +1 -1
  3. package/dist/.claude-plugin/agents/command-creator.md +0 -1
  4. package/dist/.claude-plugin/agents/docs-writer.md +0 -1
  5. package/dist/.claude-plugin/agents/documentation_specialist.md +0 -1
  6. package/dist/.claude-plugin/agents/plugin-validator.md +0 -1
  7. package/dist/.claude-plugin/agents/subagent-orchestration.md +224 -0
  8. package/dist/.claude-plugin/analyzer.ts +447 -0
  9. package/dist/.claude-plugin/commands/create-skill.md +2 -2
  10. package/dist/.claude-plugin/commands/optimize.md +1075 -32
  11. package/dist/.claude-plugin/commands/plan.md +62 -32
  12. package/dist/.claude-plugin/commands/research.md +67 -63
  13. package/dist/.claude-plugin/commands/review.md +83 -10
  14. package/dist/.claude-plugin/commands/specify.md +54 -16
  15. package/dist/.claude-plugin/commands/work.md +57 -14
  16. package/dist/.claude-plugin/formatter.ts +274 -0
  17. package/dist/.claude-plugin/hooks/hooks.json +0 -0
  18. package/dist/.claude-plugin/hooks/prompt-optimizer-hook.py +0 -0
  19. package/dist/.claude-plugin/index.ts +54 -0
  20. package/dist/.claude-plugin/marketplace.json +3 -3
  21. package/dist/.claude-plugin/optimizer.ts +441 -0
  22. package/dist/.claude-plugin/plugin.json +9 -9
  23. package/dist/.claude-plugin/skills/plugin-dev/SKILL.md +0 -2
  24. package/dist/.claude-plugin/skills/plugin-dev/references/agent-format.md +1 -6
  25. package/dist/.claude-plugin/skills/plugin-dev/references/claude-code-plugins.md +0 -2
  26. package/dist/.claude-plugin/skills/plugin-dev/references/command-format.md +0 -3
  27. package/dist/.claude-plugin/skills/plugin-dev/references/opencode-plugins.md +7 -7
  28. package/dist/.claude-plugin/skills/plugin-dev/references/skill-format.md +1 -1
  29. package/dist/.claude-plugin/techniques.ts +230 -0
  30. package/dist/.claude-plugin/types.ts +214 -0
  31. package/dist/.opencode/agent/ai-eng/development/docs-writer.md +0 -1
  32. package/dist/.opencode/agent/ai-eng/development/documentation_specialist.md +0 -1
  33. package/dist/.opencode/agent/ai-eng/general/subagent-orchestration.md +225 -0
  34. package/dist/.opencode/agent/ai-eng/meta/agent-creator.md +1 -1
  35. package/dist/.opencode/agent/ai-eng/meta/command-creator.md +0 -1
  36. package/dist/.opencode/agent/ai-eng/quality-testing/plugin-validator.md +0 -1
  37. package/dist/.opencode/command/ai-eng/create-skill.md +2 -2
  38. package/dist/.opencode/command/ai-eng/optimize.md +1075 -32
  39. package/dist/.opencode/command/ai-eng/plan.md +62 -32
  40. package/dist/.opencode/command/ai-eng/research.md +67 -63
  41. package/dist/.opencode/command/ai-eng/review.md +83 -10
  42. package/dist/.opencode/command/ai-eng/specify.md +54 -16
  43. package/dist/.opencode/command/ai-eng/work.md +57 -14
  44. package/dist/.opencode/skill/plugin-dev/SKILL.md +0 -2
  45. package/dist/.opencode/skill/plugin-dev/references/agent-format.md +1 -6
  46. package/dist/.opencode/skill/plugin-dev/references/claude-code-plugins.md +0 -2
  47. package/dist/.opencode/skill/plugin-dev/references/command-format.md +0 -3
  48. package/dist/.opencode/skill/plugin-dev/references/opencode-plugins.md +7 -7
  49. package/dist/.opencode/skill/plugin-dev/references/skill-format.md +1 -1
  50. package/dist/.opencode/tool/prompt-optimize.ts +184 -0
  51. package/dist/index.js +36 -4
  52. package/dist/prompt-optimization/analyzer.ts +447 -0
  53. package/dist/prompt-optimization/formatter.ts +274 -0
  54. package/dist/prompt-optimization/index.ts +54 -0
  55. package/dist/prompt-optimization/optimizer.ts +441 -0
  56. package/dist/prompt-optimization/techniques.ts +230 -0
  57. package/dist/prompt-optimization/types.ts +214 -0
  58. package/dist/skills/plugin-dev/SKILL.md +0 -2
  59. package/dist/skills/plugin-dev/references/agent-format.md +1 -6
  60. package/dist/skills/plugin-dev/references/claude-code-plugins.md +0 -2
  61. package/dist/skills/plugin-dev/references/command-format.md +0 -3
  62. package/dist/skills/plugin-dev/references/opencode-plugins.md +7 -7
  63. package/dist/skills/plugin-dev/references/skill-format.md +1 -1
  64. package/package.json +95 -87
  65. package/scripts/install.js +333 -47
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # AI Engineering System
2
2
 
3
- Advanced development tools with context engineering, research orchestration, and 29 specialized agents for Claude Code & OpenCode.
3
+ Advanced development tools with context engineering, research orchestration, and 28 specialized agents for Claude Code & OpenCode.
4
4
 
5
5
  ## 🚀 Quick Start
6
6
 
@@ -57,11 +57,11 @@ See [docs/spec-driven-workflow.md](./docs/spec-driven-workflow.md) for complete
57
57
  | 2. Specify | `/ai-eng/specify` | Create feature specifications with TCRO framework |
58
58
  | 3. Plan | `/ai-eng/plan` | Create detailed implementation plans from specs |
59
59
  | 4. Work | `/ai-eng/work` | Execute plans with quality gates and validation |
60
- | 5. Review | `/ai-eng/review` | Multi-perspective code review (29 agents) |
60
+ | 5. Review | `/ai-eng/review` | Multi-perspective code review (28 agents) |
61
61
 
62
62
  > **Methodology**: Based on [GitHub's spec-driven development approach](https://github.blog/ai-and-ml/generative-ai/spec-driven-development-with-ai-get-started-with-a-new-open-source-toolkit/)
63
63
 
64
- ### Additional Commands (12 total)
64
+ ### Additional Commands (13 total)
65
65
  - `/ai-eng/optimize` - Prompt enhancement (+45% quality)
66
66
  - `/ai-eng/deploy` - Pre-deployment checklists
67
67
  - `/ai-eng/compound` - Document solved problems
@@ -86,13 +86,32 @@ See [docs/spec-driven-workflow.md](./docs/spec-driven-workflow.md) for complete
86
86
  - **Content & SEO**: `seo-specialist`, `prompt-optimizer`
87
87
  - **Plugin Development**: `agent-creator`, `command-creator`, `skill-creator`, `tool-creator`, `plugin-validator`
88
88
 
89
- ### Skills (13 files)
89
+ ### Skills (7 files)
90
90
  - `devops` - Coolify deployment, Git worktree workflows
91
91
  - `prompting` - Research-backed incentive prompting techniques
92
92
  - `research` - Comprehensive multi-phase research orchestration
93
93
  - `plugin-dev` - Plugin development knowledge base and references
94
94
  - `text-cleanup` - Pattern-based text cleanup (slop, comments)
95
95
 
96
+ ## 🔄 Subagent Orchestrator Configuration
97
+
98
+ **New!** [docs/subagent-orchestration-guide.md](./docs/subagent-orchestration-guide.md) - Configure automatic agent routing for ai-eng-system
99
+
100
+ Learn how to configure subagent orchestration when using ai-eng-system with OpenCode or Claude Code:
101
+
102
+ - **For OpenCode**: Inject orchestration into primary agent's prompt for zero-latency routing
103
+ - **For Claude Code**: Use UserPromptSubmit hook for dynamic, per-prompt routing
104
+ - **Platform-specific configurations** for both OpenCode and Claude Code
105
+ - **Three-layer approach**: Base instructions + dynamic enhancement + detailed knowledge
106
+ - **Complete examples** and troubleshooting for reliable agent delegation
107
+
108
+ **Quick Answer**: How does orchestrator always work?
109
+
110
+ - **OpenCode**: Orchestrator is injected into primary agent's prompt (part of agent identity)
111
+ - **Claude Code**: UserPromptSubmit Hook runs before every prompt and adds routing guidance
112
+
113
+ Both ensure reliable routing to ai-eng-system's 28 specialized agents!
114
+
96
115
  ## 🏗️ Architecture
97
116
 
98
117
  This repo follows Anthropic's official Claude Code marketplace pattern:
@@ -178,7 +197,7 @@ npm install ai-eng-system
178
197
  **When OpenCode loads the plugin**, it automatically:
179
198
  - ✅ Installs 16 commands to `.opencode/command/ai-eng/`
180
199
  - ✅ Installs 30 agents to `.opencode/agent/ai-eng/`
181
- - ✅ Installs 13 skill files to `.opencode/skills/`
200
+ - ✅ Installs 7 skill files to `.opencode/skill/`
182
201
 
183
202
  ### Using Commands
184
203
 
@@ -73,7 +73,7 @@ Analyze user's description to understand:
73
73
  name: agent-identifier
74
74
  description: Use this agent when user asks to "specific trigger phrases" or describes agent functionality. Examples: <example>...</example>
75
75
  mode: subagent
76
- model: sonnet
76
+ model: opencode/glm-4.7-free
77
77
  color: cyan
78
78
  temperature: 0.3
79
79
  tools:
@@ -65,7 +65,6 @@ Analyze user's description to understand:
65
65
  # description: Brief description of what this command does
66
66
  # agent: build # Optional: which agent handles this
67
67
  # subtask: true # Optional: run as subtask
68
- # model: sonnet # Optional: override model
69
68
  # temperature: 0.3 # Optional: override temperature
70
69
  # tools: # Optional: tool restrictions
71
70
  # read: true
@@ -2,7 +2,6 @@
2
2
  name: docs-writer
3
3
  description: Write concise documentation pages in required format.
4
4
  mode: primary
5
- model: sonnet
6
5
  color: cyan
7
6
  temperature: 0.3
8
7
  tools:
@@ -2,7 +2,6 @@
2
2
  name: documentation-specialist
3
3
  description: Analyze codebases and generate comprehensive technical documentation.
4
4
  mode: subagent
5
- model: sonnet
6
5
  color: cyan
7
6
  temperature: 0.3
8
7
  tools:
@@ -115,7 +115,6 @@ export default (async ({ project, client, $, directory, worktree }) => {
115
115
  # name: agent-name
116
116
  # description: Agent description
117
117
  # mode: subagent
118
- # model: sonnet
119
118
  # color: cyan
120
119
  ```
121
120
 
@@ -0,0 +1,224 @@
1
+ ---
2
+ name: subagent-orchestration
3
+ description: Ensures proper delegation to ai-eng-system specialized agents. Apply before any development task. Use for routing decisions when working with ai-eng-system.
4
+ mode: subagent
5
+ ---
6
+
7
+ # AI Engineering System - Subagent Orchestration
8
+
9
+ ## Core Directive
10
+
11
+ You are working with **ai-eng-system**, an advanced engineering toolkit with 28 specialized agents. Your role is to route tasks to the appropriate ai-eng-system specialist rather than handling them directly yourself.
12
+
13
+ ## Why This Matters
14
+
15
+ ai-eng-system provides specialized agents for:
16
+ - **Architecture & Planning**: `architect-advisor`, `backend-architect`, `infrastructure-builder`
17
+ - **Development & Coding**: `full-stack-developer`, `api-builder-advanced`, `frontend-reviewer`
18
+ - **Quality & Testing**: `code-reviewer`, `test-generator`, `security-scanner`
19
+ - **DevOps & Deployment**: `deployment-engineer`, `monitoring-expert`
20
+ - **AI & ML**: `ai-engineer`, `ml-engineer`
21
+ - **Content & SEO**: `seo-specialist`, `prompt-optimizer`
22
+
23
+ ## Available ai-eng-system Specialists
24
+
25
+ ### Architecture & Planning
26
+
27
+ | Agent | Purpose | Trigger Words |
28
+ |--------|---------|---------------|
29
+ | `@architect-advisor` | System architecture decisions | design, architecture, structure, pattern |
30
+ | `@backend-architect` | Backend system design | backend, api, database, schema |
31
+ | `@infrastructure-builder` | Cloud infrastructure | infra, cloud, deployment, iac |
32
+
33
+ ### Development & Coding
34
+
35
+ | Agent | Purpose | Trigger Words |
36
+ |--------|---------|---------------|
37
+ | `@full-stack-developer` | End-to-end development | implement, feature, build, code |
38
+ | `@frontend-reviewer` | Frontend code review | frontend, react, vue, ui |
39
+ | `@api-builder-advanced` | REST/GraphQL API development | api, endpoint, graphql |
40
+
41
+ ### Quality & Testing
42
+
43
+ | Agent | Purpose | Trigger Words |
44
+ |--------|---------|---------------|
45
+ | `@code-reviewer` | Code quality assessment | review, quality, audit, analyze |
46
+ | `@test-generator` | Automated test suite generation | test, spec, verify |
47
+ | `@security-scanner` | Security vulnerability detection | security, vulnerability, audit |
48
+
49
+ ### DevOps & Deployment
50
+
51
+ | Agent | Purpose | Trigger Words |
52
+ |--------|---------|---------------|
53
+ | `@deployment-engineer` | CI/CD pipeline design | deploy, ci/cd, pipeline |
54
+ | `@monitoring-expert` | System monitoring | monitoring, alerting, metrics |
55
+
56
+ ## Routing Algorithm
57
+
58
+ ### Step 1: Analyze Task Type
59
+
60
+ Identify the **primary domain** of the request:
61
+ - Architecture/Planning?
62
+ - Development/Coding?
63
+ - Quality/Testing?
64
+ - DevOps/Deployment?
65
+
66
+ ### Step 2: Check Trigger Words
67
+
68
+ Match request against agent trigger words:
69
+ - "Design system architecture" → `@architect-advisor`
70
+ - "Review my frontend code" → `@frontend-reviewer`
71
+ - "Create REST API endpoints" → `@api-builder-advanced`
72
+ - "Generate test suite" → `@test-generator`
73
+ - "Set up CI/CD pipeline" → `@deployment-engineer`
74
+
75
+ ### Step 3: Select Specialist
76
+
77
+ Choose the **most appropriate ai-eng-system agent** based on:
78
+ - Primary domain
79
+ - Trigger word matches
80
+ - Task complexity
81
+
82
+ ### Step 4: Delegate
83
+
84
+ Route the task to the selected specialist:
85
+ ```
86
+ Use @agent-name for this task: [description]
87
+ ```
88
+
89
+ ### Step 5: Coordinate Multi-Agent Workflows (if needed)
90
+
91
+ For complex tasks spanning multiple domains:
92
+ 1. Break into sub-tasks
93
+ 2. Sequence specialists appropriately
94
+ 3. Aggregate and synthesize results
95
+
96
+ ## Example Workflows
97
+
98
+ ### Single Agent Delegation
99
+
100
+ **User**: "Review my authentication code"
101
+
102
+ **Routing**:
103
+ 1. Domain: Quality & Testing
104
+ 2. Triggers: "review", "code"
105
+ 3. Agent: `@code-reviewer`
106
+
107
+ **Action**:
108
+ ```
109
+ Use @code-reviewer to review authentication code
110
+ ```
111
+
112
+ ### Multi-Agent Sequential Workflow
113
+
114
+ **User**: "Design and implement a scalable microservices architecture"
115
+
116
+ **Routing**:
117
+ 1. Domain: Architecture + Development
118
+ 2. Agents: `@architect-advisor` → `@full-stack-developer`
119
+
120
+ **Action**:
121
+ ```
122
+ Use @architect-advisor to design microservices architecture
123
+ Then use @full-stack-developer to implement the design
124
+ ```
125
+
126
+ ### Complex Coordinated Workflow
127
+
128
+ **User**: "Build a new feature with CI/CD deployment and monitoring"
129
+
130
+ **Routing**:
131
+ 1. Domain: Development + DevOps
132
+ 2. Agents: `@architect-advisor` → `@full-stack-developer` → `@deployment-engineer` → `@monitoring-expert`
133
+
134
+ **Action**:
135
+ ```
136
+ Use @architect-advisor to design feature architecture
137
+ Use @full-stack-developer to implement the feature
138
+ Use @deployment-engineer to set up CI/CD pipeline
139
+ Use @monitoring-expert to configure monitoring
140
+ ```
141
+
142
+ ## Required Behavior
143
+
144
+ ✅ **ALWAYS** analyze task type before starting
145
+ ✅ **ALWAYS** select most appropriate ai-eng-system specialist
146
+ ✅ **ALWAYS** delegate using agent invocation
147
+ ✅ **ALWAYS** coordinate multiple agents for complex tasks
148
+ ✅ **ALWAYS** provide clear rationale for routing decisions
149
+ ✅ **ALWAYS** verify agent results before presenting to user
150
+
151
+ ## Forbidden Actions
152
+
153
+ ❌ **DO NOT** write code directly when `@full-stack-developer` exists
154
+ ❌ **DO NOT** review code directly when `@code-reviewer` exists
155
+ ❌ **DO NOT** deploy directly when `@deployment-engineer` exists
156
+ ❌ **DO NOT** design architecture directly when `@architect-advisor` exists
157
+ ❌ **DO NOT** skip specialists for "simple" tasks
158
+
159
+ ## Quality Gates
160
+
161
+ Before presenting results to user:
162
+ 1. ✅ Verify specialist completed the task correctly
163
+ 2. ✅ Check if additional agents are needed
164
+ 3. ✅ Ensure quality standards were met
165
+ 4. ✅ Document any trade-offs or considerations
166
+ 5. ✅ Provide clear next steps if applicable
167
+
168
+ ## Advanced Routing
169
+
170
+ For ambiguous requests or complex scenarios:
171
+
172
+ 1. **Ask clarifying question** if domain is unclear
173
+ - "Should I focus on architecture or implementation?"
174
+ - "Do you need code review or test generation?"
175
+
176
+ 2. **Propose multi-agent workflow** if task spans domains
177
+ - "This requires architecture design and implementation"
178
+ - "I'll use @architect-advisor then @full-stack-developer"
179
+
180
+ 3. **Coordinate sequential execution** when order matters
181
+ - Architect → Implement → Test → Deploy
182
+
183
+ ## Integration Notes
184
+
185
+ This skill is designed to work with:
186
+ - **ai-eng-system agents** (28 specialized agents available)
187
+ - **OpenCode primary agents** (Build, Plan)
188
+ - **Custom commands** (via `/ai-eng/*` commands)
189
+ - **Research-backed prompting** (+45-115% quality improvement)
190
+
191
+ ## Quick Reference
192
+
193
+ **Architecture**:
194
+ - `@architect-advisor` - System design and trade-offs
195
+ - `@backend-architect` - Backend system design
196
+ - `@infrastructure-builder` - Cloud infrastructure
197
+
198
+ **Development**:
199
+ - `@full-stack-developer` - End-to-end features
200
+ - `@frontend-reviewer` - Frontend code review
201
+ - `@api-builder-advanced` - API development
202
+
203
+ **Quality**:
204
+ - `@code-reviewer` - Code quality assessment
205
+ - `@test-generator` - Test suite generation
206
+ - `@security-scanner` - Security vulnerability detection
207
+
208
+ **DevOps**:
209
+ - `@deployment-engineer` - CI/CD pipelines
210
+ - `@monitoring-expert` - System monitoring
211
+
212
+ **AI/ML**:
213
+ - `@ai-engineer` - AI application development
214
+ - `@ml-engineer` - ML model deployment
215
+
216
+ **Content/SEO**:
217
+ - `@seo-specialist` - SEO optimization
218
+ - `@prompt-optimizer` - Prompt enhancement
219
+
220
+ ## See Also
221
+
222
+ - [AGENTS.md](../AGENTS.md) - Complete agent registry
223
+ - [spec-driven-workflow.md](./spec-driven-workflow.md) - Development methodology
224
+ - [research-command-guide.md](./research-command-guide.md) - Research orchestration