mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-12 03:27:47 +08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0fc5eaaa2d | ||
|
|
420eb857ff | ||
|
|
661656c587 | ||
|
|
ed4b088631 | ||
|
|
55a574280a | ||
|
|
8f05626075 | ||
|
|
4395c5785d | ||
|
|
b0d7a09ff2 |
@@ -1,209 +1,47 @@
|
|||||||
{
|
{
|
||||||
"name": "claude-code-dev-workflows",
|
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
|
||||||
|
"name": "myclaude",
|
||||||
|
"version": "5.6.1",
|
||||||
|
"description": "Professional multi-agent development workflows with OmO orchestration, Requirements-Driven and BMAD methodologies",
|
||||||
"owner": {
|
"owner": {
|
||||||
"name": "Claude Code Dev Workflows",
|
"name": "cexll",
|
||||||
"email": "contact@example.com",
|
"email": "evanxian9@gmail.com"
|
||||||
"url": "https://github.com/cexll/myclaude"
|
|
||||||
},
|
|
||||||
"metadata": {
|
|
||||||
"description": "Professional multi-agent development workflows with Requirements-Driven and BMAD methodologies, featuring 16+ specialized agents and 12+ commands",
|
|
||||||
"version": "1.0.0"
|
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
"name": "requirements-driven-development",
|
"name": "omo",
|
||||||
"source": "./requirements-driven-workflow/",
|
"description": "Multi-agent orchestration for code analysis, bug investigation, fix planning, and implementation with intelligent routing to specialized agents",
|
||||||
"description": "Streamlined requirements-driven development workflow with 90% quality gates for practical feature implementation",
|
"version": "5.6.1",
|
||||||
"version": "1.0.0",
|
"source": "./skills/omo",
|
||||||
"author": {
|
"category": "development"
|
||||||
"name": "Claude Code Dev Workflows",
|
|
||||||
"url": "https://github.com/cexll/myclaude"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/cexll/myclaude",
|
|
||||||
"repository": "https://github.com/cexll/myclaude",
|
|
||||||
"license": "MIT",
|
|
||||||
"keywords": [
|
|
||||||
"requirements",
|
|
||||||
"workflow",
|
|
||||||
"automation",
|
|
||||||
"quality-gates",
|
|
||||||
"feature-development",
|
|
||||||
"agile",
|
|
||||||
"specifications"
|
|
||||||
],
|
|
||||||
"category": "workflows",
|
|
||||||
"strict": false,
|
|
||||||
"commands": [
|
|
||||||
"./commands/requirements-pilot.md"
|
|
||||||
],
|
|
||||||
"agents": [
|
|
||||||
"./agents/requirements-generate.md",
|
|
||||||
"./agents/requirements-code.md",
|
|
||||||
"./agents/requirements-testing.md",
|
|
||||||
"./agents/requirements-review.md"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "bmad-agile-workflow",
|
"name": "dev",
|
||||||
"source": "./bmad-agile-workflow/",
|
"description": "Lightweight development workflow with requirements clarification, parallel codex execution, and mandatory 90% test coverage",
|
||||||
|
"version": "5.6.1",
|
||||||
|
"source": "./dev-workflow",
|
||||||
|
"category": "development"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "requirements",
|
||||||
|
"description": "Requirements-driven development workflow with quality gates for practical feature implementation",
|
||||||
|
"version": "5.6.1",
|
||||||
|
"source": "./requirements-driven-workflow",
|
||||||
|
"category": "development"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "bmad",
|
||||||
"description": "Full BMAD agile workflow with role-based agents (PO, Architect, SM, Dev, QA) and interactive approval gates",
|
"description": "Full BMAD agile workflow with role-based agents (PO, Architect, SM, Dev, QA) and interactive approval gates",
|
||||||
"version": "1.0.0",
|
"version": "5.6.1",
|
||||||
"author": {
|
"source": "./bmad-agile-workflow",
|
||||||
"name": "Claude Code Dev Workflows",
|
"category": "development"
|
||||||
"url": "https://github.com/cexll/myclaude"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/cexll/myclaude",
|
|
||||||
"repository": "https://github.com/cexll/myclaude",
|
|
||||||
"license": "MIT",
|
|
||||||
"keywords": [
|
|
||||||
"bmad",
|
|
||||||
"agile",
|
|
||||||
"scrum",
|
|
||||||
"product-owner",
|
|
||||||
"architect",
|
|
||||||
"developer",
|
|
||||||
"qa",
|
|
||||||
"workflow-orchestration"
|
|
||||||
],
|
|
||||||
"category": "workflows",
|
|
||||||
"strict": false,
|
|
||||||
"commands": [
|
|
||||||
"./commands/bmad-pilot.md"
|
|
||||||
],
|
|
||||||
"agents": [
|
|
||||||
"./agents/bmad-po.md",
|
|
||||||
"./agents/bmad-architect.md",
|
|
||||||
"./agents/bmad-sm.md",
|
|
||||||
"./agents/bmad-dev.md",
|
|
||||||
"./agents/bmad-qa.md",
|
|
||||||
"./agents/bmad-orchestrator.md",
|
|
||||||
"./agents/bmad-review.md"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "development-essentials",
|
"name": "dev-kit",
|
||||||
"source": "./development-essentials/",
|
|
||||||
"description": "Essential development commands for coding, debugging, testing, optimization, and documentation",
|
"description": "Essential development commands for coding, debugging, testing, optimization, and documentation",
|
||||||
"version": "1.0.0",
|
"version": "5.6.1",
|
||||||
"author": {
|
"source": "./development-essentials",
|
||||||
"name": "Claude Code Dev Workflows",
|
"category": "productivity"
|
||||||
"url": "https://github.com/cexll/myclaude"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/cexll/myclaude",
|
|
||||||
"repository": "https://github.com/cexll/myclaude",
|
|
||||||
"license": "MIT",
|
|
||||||
"keywords": [
|
|
||||||
"code",
|
|
||||||
"debug",
|
|
||||||
"test",
|
|
||||||
"optimize",
|
|
||||||
"review",
|
|
||||||
"bugfix",
|
|
||||||
"refactor",
|
|
||||||
"documentation"
|
|
||||||
],
|
|
||||||
"category": "essentials",
|
|
||||||
"strict": false,
|
|
||||||
"commands": [
|
|
||||||
"./commands/code.md",
|
|
||||||
"./commands/debug.md",
|
|
||||||
"./commands/test.md",
|
|
||||||
"./commands/optimize.md",
|
|
||||||
"./commands/review.md",
|
|
||||||
"./commands/bugfix.md",
|
|
||||||
"./commands/refactor.md",
|
|
||||||
"./commands/docs.md",
|
|
||||||
"./commands/ask.md",
|
|
||||||
"./commands/think.md"
|
|
||||||
],
|
|
||||||
"agents": [
|
|
||||||
"./agents/code.md",
|
|
||||||
"./agents/bugfix.md",
|
|
||||||
"./agents/bugfix-verify.md",
|
|
||||||
"./agents/optimize.md",
|
|
||||||
"./agents/debug.md"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "codex-cli",
|
|
||||||
"source": "./skills/codex/",
|
|
||||||
"description": "Execute Codex CLI for code analysis, refactoring, and automated code changes with file references (@syntax) and structured output",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"author": {
|
|
||||||
"name": "Claude Code Dev Workflows",
|
|
||||||
"url": "https://github.com/cexll/myclaude"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/cexll/myclaude",
|
|
||||||
"repository": "https://github.com/cexll/myclaude",
|
|
||||||
"license": "MIT",
|
|
||||||
"keywords": [
|
|
||||||
"codex",
|
|
||||||
"code-analysis",
|
|
||||||
"refactoring",
|
|
||||||
"automation",
|
|
||||||
"gpt-5",
|
|
||||||
"ai-coding"
|
|
||||||
],
|
|
||||||
"category": "essentials",
|
|
||||||
"strict": false,
|
|
||||||
"skills": [
|
|
||||||
"./SKILL.md"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "gemini-cli",
|
|
||||||
"source": "./skills/gemini/",
|
|
||||||
"description": "Execute Gemini CLI for AI-powered code analysis and generation with Google's latest Gemini models",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"author": {
|
|
||||||
"name": "Claude Code Dev Workflows",
|
|
||||||
"url": "https://github.com/cexll/myclaude"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/cexll/myclaude",
|
|
||||||
"repository": "https://github.com/cexll/myclaude",
|
|
||||||
"license": "MIT",
|
|
||||||
"keywords": [
|
|
||||||
"gemini",
|
|
||||||
"google-ai",
|
|
||||||
"code-analysis",
|
|
||||||
"code-generation",
|
|
||||||
"ai-reasoning"
|
|
||||||
],
|
|
||||||
"category": "essentials",
|
|
||||||
"strict": false,
|
|
||||||
"skills": [
|
|
||||||
"./SKILL.md"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dev-workflow",
|
|
||||||
"source": "./dev-workflow/",
|
|
||||||
"description": "Minimal lightweight development workflow with requirements clarification, parallel codex execution, and mandatory 90% test coverage",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"author": {
|
|
||||||
"name": "Claude Code Dev Workflows",
|
|
||||||
"url": "https://github.com/cexll/myclaude"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/cexll/myclaude",
|
|
||||||
"repository": "https://github.com/cexll/myclaude",
|
|
||||||
"license": "MIT",
|
|
||||||
"keywords": [
|
|
||||||
"dev",
|
|
||||||
"workflow",
|
|
||||||
"codex",
|
|
||||||
"testing",
|
|
||||||
"coverage",
|
|
||||||
"concurrent",
|
|
||||||
"lightweight"
|
|
||||||
],
|
|
||||||
"category": "workflows",
|
|
||||||
"strict": false,
|
|
||||||
"commands": [
|
|
||||||
"./commands/dev.md"
|
|
||||||
],
|
|
||||||
"agents": [
|
|
||||||
"./agents/dev-plan-generator.md"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
35
README.md
35
README.md
@@ -35,6 +35,41 @@ python3 install.py --install-dir ~/.claude
|
|||||||
|
|
||||||
## Workflows Overview
|
## Workflows Overview
|
||||||
|
|
||||||
|
### 0. OmO Multi-Agent Orchestrator (Recommended for Complex Tasks)
|
||||||
|
|
||||||
|
**Intelligent multi-agent orchestration that routes tasks to specialized agents based on risk signals.**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
/omo "analyze and fix this authentication bug"
|
||||||
|
```
|
||||||
|
|
||||||
|
**Agent Hierarchy:**
|
||||||
|
| Agent | Role | Backend | Model |
|
||||||
|
|-------|------|---------|-------|
|
||||||
|
| `oracle` | Technical advisor | Claude | claude-opus-4-5 |
|
||||||
|
| `librarian` | External research | Claude | claude-sonnet-4-5 |
|
||||||
|
| `explore` | Codebase search | OpenCode | grok-code |
|
||||||
|
| `develop` | Code implementation | Codex | gpt-5.2 |
|
||||||
|
| `frontend-ui-ux-engineer` | UI/UX specialist | Gemini | gemini-3-pro |
|
||||||
|
| `document-writer` | Documentation | Gemini | gemini-3-flash |
|
||||||
|
|
||||||
|
**Routing Signals (Not Fixed Pipeline):**
|
||||||
|
- Code location unclear → `explore`
|
||||||
|
- External library/API → `librarian`
|
||||||
|
- Risky/multi-file change → `oracle`
|
||||||
|
- Implementation needed → `develop` / `frontend-ui-ux-engineer`
|
||||||
|
|
||||||
|
**Common Recipes:**
|
||||||
|
- Explain code: `explore`
|
||||||
|
- Small fix with known location: `develop` directly
|
||||||
|
- Bug fix, location unknown: `explore → develop`
|
||||||
|
- Cross-cutting refactor: `explore → oracle → develop`
|
||||||
|
- External API integration: `explore + librarian → oracle → develop`
|
||||||
|
|
||||||
|
**Best For:** Complex bug investigation, multi-file refactoring, architecture decisions
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### 1. Dev Workflow (Recommended)
|
### 1. Dev Workflow (Recommended)
|
||||||
|
|
||||||
**The primary workflow for most development tasks.**
|
**The primary workflow for most development tasks.**
|
||||||
|
|||||||
35
README_CN.md
35
README_CN.md
@@ -30,6 +30,41 @@ python3 install.py --install-dir ~/.claude
|
|||||||
|
|
||||||
## 工作流概览
|
## 工作流概览
|
||||||
|
|
||||||
|
### 0. OmO 多智能体编排器(复杂任务推荐)
|
||||||
|
|
||||||
|
**基于风险信号智能路由任务到专业智能体的多智能体编排系统。**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
/omo "分析并修复这个认证 bug"
|
||||||
|
```
|
||||||
|
|
||||||
|
**智能体层级:**
|
||||||
|
| 智能体 | 角色 | 后端 | 模型 |
|
||||||
|
|-------|------|------|------|
|
||||||
|
| `oracle` | 技术顾问 | Claude | claude-opus-4-5 |
|
||||||
|
| `librarian` | 外部研究 | Claude | claude-sonnet-4-5 |
|
||||||
|
| `explore` | 代码库搜索 | OpenCode | grok-code |
|
||||||
|
| `develop` | 代码实现 | Codex | gpt-5.2 |
|
||||||
|
| `frontend-ui-ux-engineer` | UI/UX 专家 | Gemini | gemini-3-pro |
|
||||||
|
| `document-writer` | 文档撰写 | Gemini | gemini-3-flash |
|
||||||
|
|
||||||
|
**路由信号(非固定流水线):**
|
||||||
|
- 代码位置不明确 → `explore`
|
||||||
|
- 外部库/API → `librarian`
|
||||||
|
- 高风险/多文件变更 → `oracle`
|
||||||
|
- 需要实现 → `develop` / `frontend-ui-ux-engineer`
|
||||||
|
|
||||||
|
**常用配方:**
|
||||||
|
- 解释代码:`explore`
|
||||||
|
- 位置已知的小修复:直接 `develop`
|
||||||
|
- Bug 修复,位置未知:`explore → develop`
|
||||||
|
- 跨模块重构:`explore → oracle → develop`
|
||||||
|
- 外部 API 集成:`explore + librarian → oracle → develop`
|
||||||
|
|
||||||
|
**适用场景:** 复杂 bug 调查、多文件重构、架构决策
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### 1. Dev 工作流(推荐)
|
### 1. Dev 工作流(推荐)
|
||||||
|
|
||||||
**大多数开发任务的首选工作流。**
|
**大多数开发任务的首选工作流。**
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "bmad-agile-workflow",
|
|
||||||
"source": "./",
|
|
||||||
"description": "Full BMAD agile workflow with role-based agents (PO, Architect, SM, Dev, QA) and interactive approval gates",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"author": {
|
|
||||||
"name": "Claude Code Dev Workflows",
|
|
||||||
"url": "https://github.com/cexll/myclaude"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/cexll/myclaude",
|
|
||||||
"repository": "https://github.com/cexll/myclaude",
|
|
||||||
"license": "MIT",
|
|
||||||
"keywords": [
|
|
||||||
"bmad",
|
|
||||||
"agile",
|
|
||||||
"scrum",
|
|
||||||
"product-owner",
|
|
||||||
"architect",
|
|
||||||
"developer",
|
|
||||||
"qa",
|
|
||||||
"workflow-orchestration"
|
|
||||||
],
|
|
||||||
"category": "workflows",
|
|
||||||
"strict": false,
|
|
||||||
"commands": [
|
|
||||||
"./commands/bmad-pilot.md"
|
|
||||||
],
|
|
||||||
"agents": [
|
|
||||||
"./agents/bmad-po.md",
|
|
||||||
"./agents/bmad-architect.md",
|
|
||||||
"./agents/bmad-sm.md",
|
|
||||||
"./agents/bmad-dev.md",
|
|
||||||
"./agents/bmad-qa.md",
|
|
||||||
"./agents/bmad-orchestrator.md",
|
|
||||||
"./agents/bmad-review.md"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
9
bmad-agile-workflow/.claude-plugin/plugin.json
Normal file
9
bmad-agile-workflow/.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "bmad",
|
||||||
|
"description": "Full BMAD agile workflow with role-based agents (PO, Architect, SM, Dev, QA) and interactive approval gates",
|
||||||
|
"version": "5.6.1",
|
||||||
|
"author": {
|
||||||
|
"name": "cexll",
|
||||||
|
"email": "cexll@cexll.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,7 +26,6 @@ var defaultModelsConfig = ModelsConfig{
|
|||||||
DefaultBackend: "opencode",
|
DefaultBackend: "opencode",
|
||||||
DefaultModel: "opencode/grok-code",
|
DefaultModel: "opencode/grok-code",
|
||||||
Agents: map[string]AgentModelConfig{
|
Agents: map[string]AgentModelConfig{
|
||||||
"sisyphus": {Backend: "claude", Model: "claude-sonnet-4-20250514", PromptFile: "~/.claude/skills/omo/references/sisyphus.md", Description: "Primary orchestrator"},
|
|
||||||
"oracle": {Backend: "claude", Model: "claude-sonnet-4-20250514", PromptFile: "~/.claude/skills/omo/references/oracle.md", Description: "Technical advisor"},
|
"oracle": {Backend: "claude", Model: "claude-sonnet-4-20250514", PromptFile: "~/.claude/skills/omo/references/oracle.md", Description: "Technical advisor"},
|
||||||
"librarian": {Backend: "claude", Model: "claude-sonnet-4-5-20250514", PromptFile: "~/.claude/skills/omo/references/librarian.md", Description: "Researcher"},
|
"librarian": {Backend: "claude", Model: "claude-sonnet-4-5-20250514", PromptFile: "~/.claude/skills/omo/references/librarian.md", Description: "Researcher"},
|
||||||
"explore": {Backend: "opencode", Model: "opencode/grok-code", PromptFile: "~/.claude/skills/omo/references/explore.md", Description: "Code search"},
|
"explore": {Backend: "opencode", Model: "opencode/grok-code", PromptFile: "~/.claude/skills/omo/references/explore.md", Description: "Code search"},
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ func TestResolveAgentConfig_Defaults(t *testing.T) {
|
|||||||
wantModel string
|
wantModel string
|
||||||
wantPromptFile string
|
wantPromptFile string
|
||||||
}{
|
}{
|
||||||
{"sisyphus", "claude", "claude-sonnet-4-20250514", "~/.claude/skills/omo/references/sisyphus.md"},
|
|
||||||
{"oracle", "claude", "claude-sonnet-4-20250514", "~/.claude/skills/omo/references/oracle.md"},
|
{"oracle", "claude", "claude-sonnet-4-20250514", "~/.claude/skills/omo/references/oracle.md"},
|
||||||
{"librarian", "claude", "claude-sonnet-4-5-20250514", "~/.claude/skills/omo/references/librarian.md"},
|
{"librarian", "claude", "claude-sonnet-4-5-20250514", "~/.claude/skills/omo/references/librarian.md"},
|
||||||
{"explore", "opencode", "opencode/grok-code", "~/.claude/skills/omo/references/explore.md"},
|
{"explore", "opencode", "opencode/grok-code", "~/.claude/skills/omo/references/explore.md"},
|
||||||
@@ -69,8 +68,8 @@ func TestLoadModelsConfig_NoFile(t *testing.T) {
|
|||||||
if cfg.DefaultBackend != "opencode" {
|
if cfg.DefaultBackend != "opencode" {
|
||||||
t.Errorf("DefaultBackend = %q, want %q", cfg.DefaultBackend, "opencode")
|
t.Errorf("DefaultBackend = %q, want %q", cfg.DefaultBackend, "opencode")
|
||||||
}
|
}
|
||||||
if len(cfg.Agents) != 7 {
|
if len(cfg.Agents) != 6 {
|
||||||
t.Errorf("len(Agents) = %d, want 7", len(cfg.Agents))
|
t.Errorf("len(Agents) = %d, want 6", len(cfg.Agents))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,8 +122,8 @@ func TestLoadModelsConfig_WithFile(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check that defaults are merged
|
// Check that defaults are merged
|
||||||
if _, ok := cfg.Agents["sisyphus"]; !ok {
|
if _, ok := cfg.Agents["oracle"]; !ok {
|
||||||
t.Error("default agent sisyphus should be merged")
|
t.Error("default agent oracle should be merged")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ func TestValidateAgentName(t *testing.T) {
|
|||||||
input string
|
input string
|
||||||
wantErr bool
|
wantErr bool
|
||||||
}{
|
}{
|
||||||
{name: "simple", input: "sisyphus", wantErr: false},
|
{name: "simple", input: "develop", wantErr: false},
|
||||||
{name: "upper", input: "ABC", wantErr: false},
|
{name: "upper", input: "ABC", wantErr: false},
|
||||||
{name: "digits", input: "a1", wantErr: false},
|
{name: "digits", input: "a1", wantErr: false},
|
||||||
{name: "dash underscore", input: "a-b_c", wantErr: false},
|
{name: "dash underscore", input: "a-b_c", wantErr: false},
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ type TaskSpec struct {
|
|||||||
ReasoningEffort string `json:"reasoning_effort,omitempty"`
|
ReasoningEffort string `json:"reasoning_effort,omitempty"`
|
||||||
Agent string `json:"agent,omitempty"`
|
Agent string `json:"agent,omitempty"`
|
||||||
PromptFile string `json:"prompt_file,omitempty"`
|
PromptFile string `json:"prompt_file,omitempty"`
|
||||||
|
SkipPermissions bool `json:"skip_permissions,omitempty"`
|
||||||
Mode string `json:"-"`
|
Mode string `json:"-"`
|
||||||
UseStdin bool `json:"-"`
|
UseStdin bool `json:"-"`
|
||||||
Context context.Context `json:"-"`
|
Context context.Context `json:"-"`
|
||||||
@@ -184,6 +185,10 @@ func parseParallelConfig(data []byte) (*ParallelConfig, error) {
|
|||||||
case "id":
|
case "id":
|
||||||
task.ID = value
|
task.ID = value
|
||||||
case "workdir":
|
case "workdir":
|
||||||
|
// Validate workdir: "-" is not a valid directory
|
||||||
|
if value == "-" {
|
||||||
|
return nil, fmt.Errorf("task block #%d has invalid workdir: '-' is not a valid directory path", taskIndex)
|
||||||
|
}
|
||||||
task.WorkDir = value
|
task.WorkDir = value
|
||||||
case "session_id":
|
case "session_id":
|
||||||
task.SessionID = value
|
task.SessionID = value
|
||||||
@@ -197,6 +202,12 @@ func parseParallelConfig(data []byte) (*ParallelConfig, error) {
|
|||||||
case "agent":
|
case "agent":
|
||||||
agentSpecified = true
|
agentSpecified = true
|
||||||
task.Agent = value
|
task.Agent = value
|
||||||
|
case "skip_permissions", "skip-permissions":
|
||||||
|
if value == "" {
|
||||||
|
task.SkipPermissions = true
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
task.SkipPermissions = parseBoolFlag(value, false)
|
||||||
case "dependencies":
|
case "dependencies":
|
||||||
for _, dep := range strings.Split(value, ",") {
|
for _, dep := range strings.Split(value, ",") {
|
||||||
dep = strings.TrimSpace(dep)
|
dep = strings.TrimSpace(dep)
|
||||||
@@ -417,6 +428,10 @@ func parseArgs() (*Config, error) {
|
|||||||
cfg.Task = args[2]
|
cfg.Task = args[2]
|
||||||
cfg.ExplicitStdin = (args[2] == "-")
|
cfg.ExplicitStdin = (args[2] == "-")
|
||||||
if len(args) > 3 {
|
if len(args) > 3 {
|
||||||
|
// Validate workdir: "-" is not a valid directory
|
||||||
|
if args[3] == "-" {
|
||||||
|
return nil, fmt.Errorf("invalid workdir: '-' is not a valid directory path")
|
||||||
|
}
|
||||||
cfg.WorkDir = args[3]
|
cfg.WorkDir = args[3]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -424,6 +439,10 @@ func parseArgs() (*Config, error) {
|
|||||||
cfg.Task = args[0]
|
cfg.Task = args[0]
|
||||||
cfg.ExplicitStdin = (args[0] == "-")
|
cfg.ExplicitStdin = (args[0] == "-")
|
||||||
if len(args) > 1 {
|
if len(args) > 1 {
|
||||||
|
// Validate workdir: "-" is not a valid directory
|
||||||
|
if args[1] == "-" {
|
||||||
|
return nil, fmt.Errorf("invalid workdir: '-' is not a valid directory path")
|
||||||
|
}
|
||||||
cfg.WorkDir = args[1]
|
cfg.WorkDir = args[1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const postMessageTerminateDelay = 1 * time.Second
|
const postMessageTerminateDelay = 1 * time.Second
|
||||||
|
const forceKillWaitTimeout = 5 * time.Second
|
||||||
|
|
||||||
// commandRunner abstracts exec.Cmd for testability
|
// commandRunner abstracts exec.Cmd for testability
|
||||||
type commandRunner interface {
|
type commandRunner interface {
|
||||||
@@ -765,7 +766,7 @@ func buildCodexArgs(cfg *Config, targetArg string) []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if reasoningEffort := strings.TrimSpace(cfg.ReasoningEffort); reasoningEffort != "" {
|
if reasoningEffort := strings.TrimSpace(cfg.ReasoningEffort); reasoningEffort != "" {
|
||||||
args = append(args, "--reasoning-effort", reasoningEffort)
|
args = append(args, "-c", "model_reasoning_effort="+reasoningEffort)
|
||||||
}
|
}
|
||||||
|
|
||||||
args = append(args, "--skip-git-repo-check")
|
args = append(args, "--skip-git-repo-check")
|
||||||
@@ -814,6 +815,7 @@ func runCodexTaskWithContext(parentCtx context.Context, taskSpec TaskSpec, backe
|
|||||||
WorkDir: taskSpec.WorkDir,
|
WorkDir: taskSpec.WorkDir,
|
||||||
Model: taskSpec.Model,
|
Model: taskSpec.Model,
|
||||||
ReasoningEffort: taskSpec.ReasoningEffort,
|
ReasoningEffort: taskSpec.ReasoningEffort,
|
||||||
|
SkipPermissions: taskSpec.SkipPermissions,
|
||||||
Backend: defaultBackendName,
|
Backend: defaultBackendName,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1109,7 +1111,8 @@ func runCodexTaskWithContext(parentCtx context.Context, taskSpec TaskSpec, backe
|
|||||||
waitLoop:
|
waitLoop:
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case waitErr = <-waitCh:
|
case err := <-waitCh:
|
||||||
|
waitErr = err
|
||||||
break waitLoop
|
break waitLoop
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
ctxCancelled = true
|
ctxCancelled = true
|
||||||
@@ -1120,8 +1123,17 @@ waitLoop:
|
|||||||
terminated = true
|
terminated = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
waitErr = <-waitCh
|
for {
|
||||||
break waitLoop
|
select {
|
||||||
|
case err := <-waitCh:
|
||||||
|
waitErr = err
|
||||||
|
break waitLoop
|
||||||
|
case <-time.After(forceKillWaitTimeout):
|
||||||
|
if proc := cmd.Process(); proc != nil {
|
||||||
|
_ = proc.Kill()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
case <-messageTimerCh:
|
case <-messageTimerCh:
|
||||||
forcedAfterComplete = true
|
forcedAfterComplete = true
|
||||||
messageTimerCh = nil
|
messageTimerCh = nil
|
||||||
@@ -1135,8 +1147,17 @@ waitLoop:
|
|||||||
// Close pipes to unblock stream readers, then wait for process exit.
|
// Close pipes to unblock stream readers, then wait for process exit.
|
||||||
closeWithReason(stdout, "terminate")
|
closeWithReason(stdout, "terminate")
|
||||||
closeWithReason(stderr, "terminate")
|
closeWithReason(stderr, "terminate")
|
||||||
waitErr = <-waitCh
|
for {
|
||||||
break waitLoop
|
select {
|
||||||
|
case err := <-waitCh:
|
||||||
|
waitErr = err
|
||||||
|
break waitLoop
|
||||||
|
case <-time.After(forceKillWaitTimeout):
|
||||||
|
if proc := cmd.Process(); proc != nil {
|
||||||
|
_ = proc.Kill()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
case <-completeSeen:
|
case <-completeSeen:
|
||||||
completeSeenObserved = true
|
completeSeenObserved = true
|
||||||
if messageTimer != nil {
|
if messageTimer != nil {
|
||||||
|
|||||||
@@ -625,6 +625,27 @@ func TestExecutorRunCodexTaskWithContext(t *testing.T) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
t.Run("claudeSkipPermissionsPropagatesFromTaskSpec", func(t *testing.T) {
|
||||||
|
t.Setenv("CODEAGENT_SKIP_PERMISSIONS", "false")
|
||||||
|
var gotArgs []string
|
||||||
|
newCommandRunner = func(ctx context.Context, name string, args ...string) commandRunner {
|
||||||
|
gotArgs = append([]string(nil), args...)
|
||||||
|
return &execFakeRunner{
|
||||||
|
stdout: newReasonReadCloser(`{"type":"item.completed","item":{"type":"agent_message","text":"ok"}}`),
|
||||||
|
process: &execFakeProcess{pid: 15},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_ = closeLogger()
|
||||||
|
res := runCodexTaskWithContext(context.Background(), TaskSpec{ID: "task-skip", Task: "payload", WorkDir: ".", SkipPermissions: true}, ClaudeBackend{}, nil, false, false, 1)
|
||||||
|
if res.ExitCode != 0 || res.Error != "" {
|
||||||
|
t.Fatalf("unexpected result: %+v", res)
|
||||||
|
}
|
||||||
|
if !slices.Contains(gotArgs, "--dangerously-skip-permissions") {
|
||||||
|
t.Fatalf("expected --dangerously-skip-permissions in args, got %v", gotArgs)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
t.Run("missingMessage", func(t *testing.T) {
|
t.Run("missingMessage", func(t *testing.T) {
|
||||||
newCommandRunner = func(ctx context.Context, name string, args ...string) commandRunner {
|
newCommandRunner = func(ctx context.Context, name string, args ...string) commandRunner {
|
||||||
return &execFakeRunner{
|
return &execFakeRunner{
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
@@ -15,7 +14,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
version = "5.5.0"
|
version = "5.6.3"
|
||||||
defaultWorkdir = "."
|
defaultWorkdir = "."
|
||||||
defaultTimeout = 7200 // seconds (2 hours)
|
defaultTimeout = 7200 // seconds (2 hours)
|
||||||
defaultCoverageTarget = 90.0
|
defaultCoverageTarget = 90.0
|
||||||
@@ -32,8 +31,6 @@ const (
|
|||||||
stdoutDrainTimeout = 100 * time.Millisecond
|
stdoutDrainTimeout = 100 * time.Millisecond
|
||||||
)
|
)
|
||||||
|
|
||||||
var useASCIIMode = os.Getenv("CODEAGENT_ASCII_MODE") == "true"
|
|
||||||
|
|
||||||
// Test hooks for dependency injection
|
// Test hooks for dependency injection
|
||||||
var (
|
var (
|
||||||
stdinReader io.Reader = os.Stdin
|
stdinReader io.Reader = os.Stdin
|
||||||
@@ -45,7 +42,6 @@ var (
|
|||||||
buildCodexArgsFn = buildCodexArgs
|
buildCodexArgsFn = buildCodexArgs
|
||||||
selectBackendFn = selectBackend
|
selectBackendFn = selectBackend
|
||||||
commandContext = exec.CommandContext
|
commandContext = exec.CommandContext
|
||||||
jsonMarshal = json.Marshal
|
|
||||||
cleanupLogsFn = cleanupOldLogs
|
cleanupLogsFn = cleanupOldLogs
|
||||||
signalNotifyFn = signal.Notify
|
signalNotifyFn = signal.Notify
|
||||||
signalStopFn = signal.Stop
|
signalStopFn = signal.Stop
|
||||||
@@ -181,6 +177,7 @@ func run() (exitCode int) {
|
|||||||
backendName := defaultBackendName
|
backendName := defaultBackendName
|
||||||
model := ""
|
model := ""
|
||||||
fullOutput := false
|
fullOutput := false
|
||||||
|
skipPermissions := envFlagEnabled("CODEAGENT_SKIP_PERMISSIONS")
|
||||||
var extras []string
|
var extras []string
|
||||||
|
|
||||||
for i := 0; i < len(args); i++ {
|
for i := 0; i < len(args); i++ {
|
||||||
@@ -218,13 +215,19 @@ func run() (exitCode int) {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
model = value
|
model = value
|
||||||
|
case arg == "--skip-permissions", arg == "--dangerously-skip-permissions":
|
||||||
|
skipPermissions = true
|
||||||
|
case strings.HasPrefix(arg, "--skip-permissions="):
|
||||||
|
skipPermissions = parseBoolFlag(strings.TrimPrefix(arg, "--skip-permissions="), skipPermissions)
|
||||||
|
case strings.HasPrefix(arg, "--dangerously-skip-permissions="):
|
||||||
|
skipPermissions = parseBoolFlag(strings.TrimPrefix(arg, "--dangerously-skip-permissions="), skipPermissions)
|
||||||
default:
|
default:
|
||||||
extras = append(extras, arg)
|
extras = append(extras, arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(extras) > 0 {
|
if len(extras) > 0 {
|
||||||
fmt.Fprintln(os.Stderr, "ERROR: --parallel reads its task configuration from stdin; only --backend, --model and --full-output are allowed.")
|
fmt.Fprintln(os.Stderr, "ERROR: --parallel reads its task configuration from stdin; only --backend, --model, --full-output and --skip-permissions are allowed.")
|
||||||
fmt.Fprintln(os.Stderr, "Usage examples:")
|
fmt.Fprintln(os.Stderr, "Usage examples:")
|
||||||
fmt.Fprintf(os.Stderr, " %s --parallel < tasks.txt\n", name)
|
fmt.Fprintf(os.Stderr, " %s --parallel < tasks.txt\n", name)
|
||||||
fmt.Fprintf(os.Stderr, " echo '...' | %s --parallel\n", name)
|
fmt.Fprintf(os.Stderr, " echo '...' | %s --parallel\n", name)
|
||||||
@@ -261,6 +264,7 @@ func run() (exitCode int) {
|
|||||||
if strings.TrimSpace(cfg.Tasks[i].Model) == "" && model != "" {
|
if strings.TrimSpace(cfg.Tasks[i].Model) == "" && model != "" {
|
||||||
cfg.Tasks[i].Model = model
|
cfg.Tasks[i].Model = model
|
||||||
}
|
}
|
||||||
|
cfg.Tasks[i].SkipPermissions = cfg.Tasks[i].SkipPermissions || skipPermissions
|
||||||
}
|
}
|
||||||
|
|
||||||
timeoutSec := resolveTimeout()
|
timeoutSec := resolveTimeout()
|
||||||
@@ -440,6 +444,7 @@ func run() (exitCode int) {
|
|||||||
SessionID: cfg.SessionID,
|
SessionID: cfg.SessionID,
|
||||||
Model: cfg.Model,
|
Model: cfg.Model,
|
||||||
ReasoningEffort: cfg.ReasoningEffort,
|
ReasoningEffort: cfg.ReasoningEffort,
|
||||||
|
SkipPermissions: cfg.SkipPermissions,
|
||||||
UseStdin: useStdin,
|
UseStdin: useStdin,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -169,32 +169,6 @@ func parseIntegrationOutput(t *testing.T, out string) integrationOutput {
|
|||||||
return payload
|
return payload
|
||||||
}
|
}
|
||||||
|
|
||||||
func extractTaskBlock(t *testing.T, output, taskID string) string {
|
|
||||||
t.Helper()
|
|
||||||
header := fmt.Sprintf("--- Task: %s ---", taskID)
|
|
||||||
lines := strings.Split(output, "\n")
|
|
||||||
var block []string
|
|
||||||
collecting := false
|
|
||||||
for _, raw := range lines {
|
|
||||||
trimmed := strings.TrimSpace(raw)
|
|
||||||
if !collecting {
|
|
||||||
if trimmed == header {
|
|
||||||
collecting = true
|
|
||||||
block = append(block, trimmed)
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if strings.HasPrefix(trimmed, "--- Task: ") && trimmed != header {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
block = append(block, trimmed)
|
|
||||||
}
|
|
||||||
if len(block) == 0 {
|
|
||||||
t.Fatalf("task block %s not found in output:\n%s", taskID, output)
|
|
||||||
}
|
|
||||||
return strings.Join(block, "\n")
|
|
||||||
}
|
|
||||||
|
|
||||||
func findResultByID(t *testing.T, payload integrationOutput, id string) TaskResult {
|
func findResultByID(t *testing.T, payload integrationOutput, id string) TaskResult {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
for _, res := range payload.Results {
|
for _, res := range payload.Results {
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ func resetTestHooks() {
|
|||||||
newCommandRunner = func(ctx context.Context, name string, args ...string) commandRunner {
|
newCommandRunner = func(ctx context.Context, name string, args ...string) commandRunner {
|
||||||
return &realCmd{cmd: commandContext(ctx, name, args...)}
|
return &realCmd{cmd: commandContext(ctx, name, args...)}
|
||||||
}
|
}
|
||||||
jsonMarshal = json.Marshal
|
|
||||||
forceKillDelay.Store(5)
|
forceKillDelay.Store(5)
|
||||||
closeLogger()
|
closeLogger()
|
||||||
executablePathFn = os.Executable
|
executablePathFn = os.Executable
|
||||||
@@ -1095,6 +1094,11 @@ func TestBackendParseArgs_NewMode(t *testing.T) {
|
|||||||
args: []string{"codeagent-wrapper", "-", "/some/dir"},
|
args: []string{"codeagent-wrapper", "-", "/some/dir"},
|
||||||
want: &Config{Mode: "new", Task: "-", WorkDir: "/some/dir", ExplicitStdin: true, Backend: defaultBackendName},
|
want: &Config{Mode: "new", Task: "-", WorkDir: "/some/dir", ExplicitStdin: true, Backend: defaultBackendName},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "stdin with dash workdir rejected",
|
||||||
|
args: []string{"codeagent-wrapper", "-", "-"},
|
||||||
|
wantErr: true,
|
||||||
|
},
|
||||||
{name: "no args", args: []string{"codeagent-wrapper"}, wantErr: true},
|
{name: "no args", args: []string{"codeagent-wrapper"}, wantErr: true},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1156,6 +1160,7 @@ func TestBackendParseArgs_ResumeMode(t *testing.T) {
|
|||||||
{name: "resume missing task", args: []string{"codeagent-wrapper", "resume", "session-123"}, wantErr: true},
|
{name: "resume missing task", args: []string{"codeagent-wrapper", "resume", "session-123"}, wantErr: true},
|
||||||
{name: "resume empty session_id", args: []string{"codeagent-wrapper", "resume", "", "task"}, wantErr: true},
|
{name: "resume empty session_id", args: []string{"codeagent-wrapper", "resume", "", "task"}, wantErr: true},
|
||||||
{name: "resume whitespace session_id", args: []string{"codeagent-wrapper", "resume", " ", "task"}, wantErr: true},
|
{name: "resume whitespace session_id", args: []string{"codeagent-wrapper", "resume", " ", "task"}, wantErr: true},
|
||||||
|
{name: "resume with dash workdir rejected", args: []string{"codeagent-wrapper", "resume", "session-123", "task", "-"}, wantErr: true},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
@@ -1410,7 +1415,7 @@ func TestBackendParseArgs_PromptFileFlag(t *testing.T) {
|
|||||||
func TestBackendParseArgs_PromptFileOverridesAgent(t *testing.T) {
|
func TestBackendParseArgs_PromptFileOverridesAgent(t *testing.T) {
|
||||||
defer resetTestHooks()
|
defer resetTestHooks()
|
||||||
|
|
||||||
os.Args = []string{"codeagent-wrapper", "--prompt-file", "/tmp/custom.md", "--agent", "sisyphus", "task"}
|
os.Args = []string{"codeagent-wrapper", "--prompt-file", "/tmp/custom.md", "--agent", "develop", "task"}
|
||||||
cfg, err := parseArgs()
|
cfg, err := parseArgs()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("parseArgs() unexpected error: %v", err)
|
t.Fatalf("parseArgs() unexpected error: %v", err)
|
||||||
@@ -1419,7 +1424,7 @@ func TestBackendParseArgs_PromptFileOverridesAgent(t *testing.T) {
|
|||||||
t.Fatalf("PromptFile = %q, want %q", cfg.PromptFile, "/tmp/custom.md")
|
t.Fatalf("PromptFile = %q, want %q", cfg.PromptFile, "/tmp/custom.md")
|
||||||
}
|
}
|
||||||
|
|
||||||
os.Args = []string{"codeagent-wrapper", "--agent", "sisyphus", "--prompt-file", "/tmp/custom.md", "task"}
|
os.Args = []string{"codeagent-wrapper", "--agent", "develop", "--prompt-file", "/tmp/custom.md", "task"}
|
||||||
cfg, err = parseArgs()
|
cfg, err = parseArgs()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("parseArgs() unexpected error: %v", err)
|
t.Fatalf("parseArgs() unexpected error: %v", err)
|
||||||
@@ -1582,6 +1587,26 @@ do something`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestParallelParseConfig_SkipPermissions(t *testing.T) {
|
||||||
|
input := `---TASK---
|
||||||
|
id: task-1
|
||||||
|
skip_permissions: true
|
||||||
|
---CONTENT---
|
||||||
|
do something`
|
||||||
|
|
||||||
|
cfg, err := parseParallelConfig([]byte(input))
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("parseParallelConfig() unexpected error: %v", err)
|
||||||
|
}
|
||||||
|
if len(cfg.Tasks) != 1 {
|
||||||
|
t.Fatalf("expected 1 task, got %d", len(cfg.Tasks))
|
||||||
|
}
|
||||||
|
task := cfg.Tasks[0]
|
||||||
|
if !task.SkipPermissions {
|
||||||
|
t.Fatalf("SkipPermissions = %v, want true", task.SkipPermissions)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestParallelParseConfig_EmptySessionID(t *testing.T) {
|
func TestParallelParseConfig_EmptySessionID(t *testing.T) {
|
||||||
input := `---TASK---
|
input := `---TASK---
|
||||||
id: task-1
|
id: task-1
|
||||||
@@ -1945,7 +1970,7 @@ func TestRunBuildCodexArgs_NewMode_WithReasoningEffort(t *testing.T) {
|
|||||||
args := buildCodexArgs(cfg, "my task")
|
args := buildCodexArgs(cfg, "my task")
|
||||||
expected := []string{
|
expected := []string{
|
||||||
"e",
|
"e",
|
||||||
"--reasoning-effort", "high",
|
"-c", "model_reasoning_effort=high",
|
||||||
"--skip-git-repo-check",
|
"--skip-git-repo-check",
|
||||||
"-C", "/test/dir",
|
"-C", "/test/dir",
|
||||||
"--json",
|
"--json",
|
||||||
@@ -1985,13 +2010,13 @@ func TestRunCodexTaskWithContext_CodexReasoningEffort(t *testing.T) {
|
|||||||
|
|
||||||
found := false
|
found := false
|
||||||
for i := 0; i+1 < len(gotArgs); i++ {
|
for i := 0; i+1 < len(gotArgs); i++ {
|
||||||
if gotArgs[i] == "--reasoning-effort" && gotArgs[i+1] == "high" {
|
if gotArgs[i] == "-c" && gotArgs[i+1] == "model_reasoning_effort=high" {
|
||||||
found = true
|
found = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !found {
|
if !found {
|
||||||
t.Fatalf("expected --reasoning-effort high in args, got %v", gotArgs)
|
t.Fatalf("expected -c model_reasoning_effort=high in args, got %v", gotArgs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3711,7 +3736,7 @@ func TestVersionFlag(t *testing.T) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
want := "codeagent-wrapper version 5.5.0\n"
|
want := "codeagent-wrapper version 5.6.3\n"
|
||||||
|
|
||||||
if output != want {
|
if output != want {
|
||||||
t.Fatalf("output = %q, want %q", output, want)
|
t.Fatalf("output = %q, want %q", output, want)
|
||||||
@@ -3727,7 +3752,7 @@ func TestVersionShortFlag(t *testing.T) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
want := "codeagent-wrapper version 5.5.0\n"
|
want := "codeagent-wrapper version 5.6.3\n"
|
||||||
|
|
||||||
if output != want {
|
if output != want {
|
||||||
t.Fatalf("output = %q, want %q", output, want)
|
t.Fatalf("output = %q, want %q", output, want)
|
||||||
@@ -3743,7 +3768,7 @@ func TestVersionLegacyAlias(t *testing.T) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
want := "codex-wrapper version 5.5.0\n"
|
want := "codex-wrapper version 5.6.3\n"
|
||||||
|
|
||||||
if output != want {
|
if output != want {
|
||||||
t.Fatalf("output = %q, want %q", output, want)
|
t.Fatalf("output = %q, want %q", output, want)
|
||||||
@@ -4009,6 +4034,30 @@ do two`)
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
t.Run("parallelSkipPermissions", func(t *testing.T) {
|
||||||
|
defer resetTestHooks()
|
||||||
|
cleanupHook = func() {}
|
||||||
|
cleanupLogsFn = func() (CleanupStats, error) { return CleanupStats{}, nil }
|
||||||
|
t.Setenv("CODEAGENT_SKIP_PERMISSIONS", "false")
|
||||||
|
|
||||||
|
runCodexTaskFn = func(task TaskSpec, timeout int) TaskResult {
|
||||||
|
if !task.SkipPermissions {
|
||||||
|
return TaskResult{TaskID: task.ID, ExitCode: 1, Error: "SkipPermissions not propagated"}
|
||||||
|
}
|
||||||
|
return TaskResult{TaskID: task.ID, ExitCode: 0, Message: "ok"}
|
||||||
|
}
|
||||||
|
|
||||||
|
stdinReader = strings.NewReader(`---TASK---
|
||||||
|
id: only
|
||||||
|
backend: claude
|
||||||
|
---CONTENT---
|
||||||
|
do one`)
|
||||||
|
os.Args = []string{"codeagent-wrapper", "--parallel", "--skip-permissions"}
|
||||||
|
if code := run(); code != 0 {
|
||||||
|
t.Fatalf("run exit = %d, want 0", code)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
t.Run("parallelErrors", func(t *testing.T) {
|
t.Run("parallelErrors", func(t *testing.T) {
|
||||||
defer resetTestHooks()
|
defer resetTestHooks()
|
||||||
cleanupLogsFn = func() (CleanupStats, error) { return CleanupStats{}, nil }
|
cleanupLogsFn = func() (CleanupStats, error) { return CleanupStats{}, nil }
|
||||||
|
|||||||
@@ -59,14 +59,6 @@ const (
|
|||||||
jsonLinePreviewBytes = 256
|
jsonLinePreviewBytes = 256
|
||||||
)
|
)
|
||||||
|
|
||||||
type codexHeader struct {
|
|
||||||
Type string `json:"type"`
|
|
||||||
ThreadID string `json:"thread_id,omitempty"`
|
|
||||||
Item *struct {
|
|
||||||
Type string `json:"type"`
|
|
||||||
} `json:"item,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnifiedEvent combines all backend event formats into a single structure
|
// UnifiedEvent combines all backend event formats into a single structure
|
||||||
// to avoid multiple JSON unmarshal operations per event
|
// to avoid multiple JSON unmarshal operations per event
|
||||||
type UnifiedEvent struct {
|
type UnifiedEvent struct {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// sendTermSignal on Windows directly kills the process.
|
// sendTermSignal on Windows directly kills the process.
|
||||||
@@ -31,6 +32,56 @@ func sendTermSignal(proc processHandle) error {
|
|||||||
if err := cmd.Run(); err == nil {
|
if err := cmd.Run(); err == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if err := killProcessTree(pid); err == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return proc.Kill()
|
return proc.Kill()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func killProcessTree(pid int) error {
|
||||||
|
if pid <= 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
wmic := "wmic"
|
||||||
|
if root := os.Getenv("SystemRoot"); root != "" {
|
||||||
|
wmic = filepath.Join(root, "System32", "wbem", "WMIC.exe")
|
||||||
|
}
|
||||||
|
|
||||||
|
queryChildren := "(ParentProcessId=" + strconv.Itoa(pid) + ")"
|
||||||
|
listCmd := exec.Command(wmic, "process", "where", queryChildren, "get", "ProcessId", "/VALUE")
|
||||||
|
listCmd.Stderr = io.Discard
|
||||||
|
out, err := listCmd.Output()
|
||||||
|
if err == nil {
|
||||||
|
for _, childPID := range parseWMICPIDs(out) {
|
||||||
|
_ = killProcessTree(childPID)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
querySelf := "(ProcessId=" + strconv.Itoa(pid) + ")"
|
||||||
|
termCmd := exec.Command(wmic, "process", "where", querySelf, "call", "terminate")
|
||||||
|
termCmd.Stdout = io.Discard
|
||||||
|
termCmd.Stderr = io.Discard
|
||||||
|
if termErr := termCmd.Run(); termErr != nil && err == nil {
|
||||||
|
err = termErr
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func parseWMICPIDs(out []byte) []int {
|
||||||
|
const prefix = "ProcessId="
|
||||||
|
var pids []int
|
||||||
|
for _, line := range strings.Split(string(out), "\n") {
|
||||||
|
line = strings.TrimSpace(line)
|
||||||
|
if !strings.HasPrefix(line, prefix) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
n, err := strconv.Atoi(strings.TrimSpace(strings.TrimPrefix(line, prefix)))
|
||||||
|
if err != nil || n <= 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
pids = append(pids, n)
|
||||||
|
}
|
||||||
|
return pids
|
||||||
|
}
|
||||||
|
|||||||
@@ -273,30 +273,6 @@ func farewell(name string) string {
|
|||||||
return "goodbye " + name
|
return "goodbye " + name
|
||||||
}
|
}
|
||||||
|
|
||||||
// extractMessageSummary extracts a brief summary from task output
|
|
||||||
// Returns first meaningful line or truncated content up to maxLen chars
|
|
||||||
func extractMessageSummary(message string, maxLen int) string {
|
|
||||||
if message == "" || maxLen <= 0 {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try to find a meaningful summary line
|
|
||||||
lines := strings.Split(message, "\n")
|
|
||||||
for _, line := range lines {
|
|
||||||
line = strings.TrimSpace(line)
|
|
||||||
// Skip empty lines and common noise
|
|
||||||
if line == "" || strings.HasPrefix(line, "```") || strings.HasPrefix(line, "---") {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
// Found a meaningful line
|
|
||||||
return safeTruncate(line, maxLen)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fallback: truncate entire message
|
|
||||||
clean := strings.TrimSpace(message)
|
|
||||||
return safeTruncate(clean, maxLen)
|
|
||||||
}
|
|
||||||
|
|
||||||
// extractCoverageFromLines extracts coverage from pre-split lines.
|
// extractCoverageFromLines extracts coverage from pre-split lines.
|
||||||
func extractCoverageFromLines(lines []string) string {
|
func extractCoverageFromLines(lines []string) string {
|
||||||
if len(lines) == 0 {
|
if len(lines) == 0 {
|
||||||
@@ -592,15 +568,6 @@ func extractKeyOutputFromLines(lines []string, maxLen int) string {
|
|||||||
return safeTruncate(clean, maxLen)
|
return safeTruncate(clean, maxLen)
|
||||||
}
|
}
|
||||||
|
|
||||||
// extractKeyOutput extracts a brief summary of what the task accomplished
|
|
||||||
// Looks for summary lines, first meaningful sentence, or truncates message
|
|
||||||
func extractKeyOutput(message string, maxLen int) string {
|
|
||||||
if message == "" || maxLen <= 0 {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return extractKeyOutputFromLines(strings.Split(message, "\n"), maxLen)
|
|
||||||
}
|
|
||||||
|
|
||||||
// extractCoverageGap extracts what's missing from coverage reports
|
// extractCoverageGap extracts what's missing from coverage reports
|
||||||
// Looks for uncovered lines, branches, or functions
|
// Looks for uncovered lines, branches, or functions
|
||||||
func extractCoverageGap(message string) string {
|
func extractCoverageGap(message string) string {
|
||||||
|
|||||||
9
dev-workflow/.claude-plugin/plugin.json
Normal file
9
dev-workflow/.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "dev",
|
||||||
|
"description": "Lightweight development workflow with requirements clarification, parallel codex execution, and mandatory 90% test coverage",
|
||||||
|
"version": "5.6.1",
|
||||||
|
"author": {
|
||||||
|
"name": "cexll",
|
||||||
|
"email": "cexll@cexll.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "development-essentials",
|
|
||||||
"source": "./",
|
|
||||||
"description": "Essential development commands for coding, debugging, testing, optimization, and documentation",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"author": {
|
|
||||||
"name": "Claude Code Dev Workflows",
|
|
||||||
"url": "https://github.com/cexll/myclaude"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/cexll/myclaude",
|
|
||||||
"repository": "https://github.com/cexll/myclaude",
|
|
||||||
"license": "MIT",
|
|
||||||
"keywords": [
|
|
||||||
"code",
|
|
||||||
"debug",
|
|
||||||
"test",
|
|
||||||
"optimize",
|
|
||||||
"review",
|
|
||||||
"bugfix",
|
|
||||||
"refactor",
|
|
||||||
"documentation"
|
|
||||||
],
|
|
||||||
"category": "essentials",
|
|
||||||
"strict": false,
|
|
||||||
"commands": [
|
|
||||||
"./commands/code.md",
|
|
||||||
"./commands/debug.md",
|
|
||||||
"./commands/test.md",
|
|
||||||
"./commands/optimize.md",
|
|
||||||
"./commands/review.md",
|
|
||||||
"./commands/bugfix.md",
|
|
||||||
"./commands/refactor.md",
|
|
||||||
"./commands/docs.md",
|
|
||||||
"./commands/ask.md",
|
|
||||||
"./commands/think.md"
|
|
||||||
],
|
|
||||||
"agents": [
|
|
||||||
"./agents/code.md",
|
|
||||||
"./agents/bugfix.md",
|
|
||||||
"./agents/bugfix-verify.md",
|
|
||||||
"./agents/optimize.md",
|
|
||||||
"./agents/debug.md"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
9
development-essentials/.claude-plugin/plugin.json
Normal file
9
development-essentials/.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "essentials",
|
||||||
|
"description": "Essential development commands for coding, debugging, testing, optimization, and documentation",
|
||||||
|
"version": "5.6.1",
|
||||||
|
"author": {
|
||||||
|
"name": "cexll",
|
||||||
|
"email": "cexll@cexll.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "requirements-driven-development",
|
|
||||||
"source": "./",
|
|
||||||
"description": "Streamlined requirements-driven development workflow with 90% quality gates for practical feature implementation",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"author": {
|
|
||||||
"name": "Claude Code Dev Workflows",
|
|
||||||
"url": "https://github.com/cexll/myclaude"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/cexll/myclaude",
|
|
||||||
"repository": "https://github.com/cexll/myclaude",
|
|
||||||
"license": "MIT",
|
|
||||||
"keywords": [
|
|
||||||
"requirements",
|
|
||||||
"workflow",
|
|
||||||
"automation",
|
|
||||||
"quality-gates",
|
|
||||||
"feature-development",
|
|
||||||
"agile",
|
|
||||||
"specifications"
|
|
||||||
],
|
|
||||||
"category": "workflows",
|
|
||||||
"strict": false,
|
|
||||||
"commands": [
|
|
||||||
"./commands/requirements-pilot.md"
|
|
||||||
],
|
|
||||||
"agents": [
|
|
||||||
"./agents/requirements-generate.md",
|
|
||||||
"./agents/requirements-code.md",
|
|
||||||
"./agents/requirements-testing.md",
|
|
||||||
"./agents/requirements-review.md"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
9
requirements-driven-workflow/.claude-plugin/plugin.json
Normal file
9
requirements-driven-workflow/.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "requirements",
|
||||||
|
"description": "Requirements-driven development workflow with quality gates for practical feature implementation",
|
||||||
|
"version": "5.6.1",
|
||||||
|
"author": {
|
||||||
|
"name": "cexll",
|
||||||
|
"email": "cexll@cexll.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
9
skills/omo/.claude-plugin/plugin.json
Normal file
9
skills/omo/.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "omo",
|
||||||
|
"description": "Multi-agent orchestration for code analysis, bug investigation, fix planning, and implementation with intelligent routing to specialized agents",
|
||||||
|
"version": "5.6.1",
|
||||||
|
"author": {
|
||||||
|
"name": "cexll",
|
||||||
|
"email": "cexll@cexll.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,12 @@
|
|||||||
# OmO Multi-Agent Orchestration
|
# OmO Multi-Agent Orchestration
|
||||||
|
|
||||||
OmO (Oh-My-OpenCode) is a multi-agent orchestration skill that uses Sisyphus as the primary coordinator to delegate tasks to specialized agents.
|
OmO (Oh-My-OpenCode) is a multi-agent orchestration skill that delegates tasks to specialized agents based on routing signals.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 install.py --module omo
|
||||||
|
```
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
@@ -12,19 +18,17 @@ OmO (Oh-My-OpenCode) is a multi-agent orchestration skill that uses Sisyphus as
|
|||||||
|
|
||||||
| Agent | Role | Backend | Model |
|
| Agent | Role | Backend | Model |
|
||||||
|-------|------|---------|-------|
|
|-------|------|---------|-------|
|
||||||
| sisyphus | Primary orchestrator | claude | claude-sonnet-4-20250514 |
|
| oracle | Technical advisor | claude | claude-opus-4-5-20251101 |
|
||||||
| oracle | Technical advisor (EXPENSIVE) | claude | claude-sonnet-4-20250514 |
|
| librarian | External research | claude | claude-sonnet-4-5-20250929 |
|
||||||
| librarian | External research | claude | claude-sonnet-4-5-20250514 |
|
| explore | Codebase search | opencode | opencode/grok-code |
|
||||||
| explore | Codebase search (FREE) | opencode | opencode/grok-code |
|
| develop | Code implementation | codex | gpt-5.2 |
|
||||||
| develop | Code implementation | codex | (default) |
|
| frontend-ui-ux-engineer | UI/UX specialist | gemini | gemini-3-pro-high |
|
||||||
| frontend-ui-ux-engineer | UI/UX specialist | gemini | gemini-3-pro-preview |
|
| document-writer | Documentation | gemini | gemini-3-flash |
|
||||||
| document-writer | Documentation | gemini | gemini-3-flash-preview |
|
|
||||||
|
|
||||||
## How It Works
|
## How It Works
|
||||||
|
|
||||||
1. `/omo` loads Sisyphus as the entry point
|
1. `/omo` analyzes your request via routing signals
|
||||||
2. Sisyphus analyzes your request via routing signals
|
2. Based on task type, it either:
|
||||||
3. Based on task type, Sisyphus either:
|
|
||||||
- Answers directly (analysis/explanation tasks - no code changes)
|
- Answers directly (analysis/explanation tasks - no code changes)
|
||||||
- Delegates to specialized agents (implementation tasks)
|
- Delegates to specialized agents (implementation tasks)
|
||||||
- Fires parallel agents (exploration + research)
|
- Fires parallel agents (exploration + research)
|
||||||
@@ -44,7 +48,7 @@ OmO (Oh-My-OpenCode) is a multi-agent orchestration skill that uses Sisyphus as
|
|||||||
|
|
||||||
## Agent Delegation
|
## Agent Delegation
|
||||||
|
|
||||||
Sisyphus delegates via codeagent-wrapper with full Context Pack:
|
Delegates via codeagent-wrapper with full Context Pack:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
codeagent-wrapper --agent oracle - . <<'EOF'
|
codeagent-wrapper --agent oracle - . <<'EOF'
|
||||||
@@ -70,11 +74,43 @@ Agent-model mappings are configured in `~/.codeagent/models.json`:
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"default_backend": "opencode",
|
"default_backend": "codex",
|
||||||
"default_model": "opencode/grok-code",
|
"default_model": "gpt-5.2",
|
||||||
"agents": {
|
"agents": {
|
||||||
"sisyphus": {"backend": "claude", "model": "claude-sonnet-4-20250514"},
|
"oracle": {
|
||||||
"oracle": {"backend": "claude", "model": "claude-sonnet-4-20250514"}
|
"backend": "claude",
|
||||||
|
"model": "claude-opus-4-5-20251101",
|
||||||
|
"description": "Technical advisor",
|
||||||
|
"yolo": true
|
||||||
|
},
|
||||||
|
"librarian": {
|
||||||
|
"backend": "claude",
|
||||||
|
"model": "claude-sonnet-4-5-20250929",
|
||||||
|
"description": "Researcher",
|
||||||
|
"yolo": true
|
||||||
|
},
|
||||||
|
"explore": {
|
||||||
|
"backend": "opencode",
|
||||||
|
"model": "opencode/grok-code",
|
||||||
|
"description": "Code search"
|
||||||
|
},
|
||||||
|
"frontend-ui-ux-engineer": {
|
||||||
|
"backend": "gemini",
|
||||||
|
"model": "gemini-3-pro-high",
|
||||||
|
"description": "Frontend engineer"
|
||||||
|
},
|
||||||
|
"document-writer": {
|
||||||
|
"backend": "gemini",
|
||||||
|
"model": "gemini-3-flash",
|
||||||
|
"description": "Documentation"
|
||||||
|
},
|
||||||
|
"develop": {
|
||||||
|
"backend": "codex",
|
||||||
|
"model": "gpt-5.2",
|
||||||
|
"description": "codex develop",
|
||||||
|
"yolo": true,
|
||||||
|
"reasoning": "xhigh"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -82,4 +118,4 @@ Agent-model mappings are configured in `~/.codeagent/models.json`:
|
|||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- codeagent-wrapper with `--agent` support
|
- codeagent-wrapper with `--agent` support
|
||||||
- Backend CLIs: claude, opencode, gemini
|
- Backend CLIs: claude, opencode, codex, gemini
|
||||||
|
|||||||
Reference in New Issue
Block a user