Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "local-opencode-cabbage",
"interface": {
"displayName": "Local Cabbage Plugins"
},
"plugins": [
{
"name": "opencode-cabbage",
"source": {
"source": "local",
"path": "./plugins/opencode-cabbage"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Development"
}
]
}
39 changes: 39 additions & 0 deletions .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "opencode-cabbage",
"version": "1.1.0",
"description": "全流程开发编排插件 — 需求→设计→任务→编码→测试→审查→自动合并,兼容 OpenCode 与 Codex",
"author": {
"name": "devcxl",
"url": "https://github.com/devcxl"
},
"homepage": "https://devcxl.github.io/opencode-cabbage/",
"repository": "https://github.com/devcxl/opencode-cabbage",
"license": "MIT",
"keywords": [
"development-workflow",
"orchestration",
"tdd",
"codex",
"opencode",
"multi-agent"
],
"skills": "./skills/",
"mcpServers": "./.mcp.json",
"hooks": "./hooks/hooks.json",
"interface": {
"displayName": "OpenCode Cabbage",
"shortDescription": "全流程开发编排 — 需求到自动合并",
"longDescription": "覆盖需求、设计、DAG 任务拆解、并行编码(TDD)、审查与自动合并的全流程开发编排插件。支持自动编排与并行 Subagent,适配 OpenCode 与 Codex 双平台。",
"developerName": "devcxl",
"category": "Development",
"capabilities": ["Read", "Write"],
"defaultPrompt": [
"使用 OpenCode Cabbage 初始化项目 — 运行 /setup 开始",
"使用 OpenCode Cabbage 从需求到实现 — 运行 /requirements 开始",
"使用 OpenCode Cabbage 的 dev-lifecycle 自动编排全流程"
],
"brandColor": "#00bcd4",
"composerIcon": "./assets/icon.png",
"logo": "./assets/logo.png"
}
}
7 changes: 7 additions & 0 deletions .mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"cabbage": {
"command": "node",
"args": ["${PLUGIN_ROOT}/dist/mcp-server.js"],
"env": {}
}
}
15 changes: 15 additions & 0 deletions hooks/hooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "node ${PLUGIN_ROOT}/dist/hooks/session-start.js",
"statusMessage": "Loading Cabbage development context"
}
]
}
]
}
}
45 changes: 45 additions & 0 deletions hooks/session-start.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Cabbage Session Start Hook — loads project context and dev-lifecycle agent prompt.
* Runs on Codex SessionStart lifecycle event.
*
* This hook reads the dev-lifecycle agent prompt and injects it as session context.
*/
import { readFileSync, existsSync } from "node:fs"
import { join, dirname } from "node:path"

const PLUGIN_ROOT = process.env.PLUGIN_ROOT || process.cwd()
const PROJECT_DIR = process.cwd()

function getDevLifecyclePrompt(): string {
const agentPath = join(PLUGIN_ROOT, "assets", "agents", "dev-lifecycle.md")
if (!existsSync(agentPath)) return ""
const content = readFileSync(agentPath, "utf8")
// Strip frontmatter
const match = content.match(/^---\n[\s\S]*?\n---\n([\s\S]*)$/)
return match ? match[1].trim() : content.trim()
}

function getProjectContext(): string {
const agentsMd = join(PROJECT_DIR, "AGENTS.md")
if (existsSync(agentsMd)) {
const content = readFileSync(agentsMd, "utf8")
const profileMatch = content.match(/## Project Profile[\s\S]*?(?=##|$)/)
if (profileMatch) return profileMatch[0].trim()
}
return ""
}

function main() {
const prompt = getDevLifecyclePrompt()
const context = getProjectContext()

const parts: string[] = []
if (prompt) parts.push(prompt)
if (context) parts.push(`\n## Project Context\n\n${context}`)

if (parts.length > 0) {
console.log(parts.join("\n\n"))
}
}

main()
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@devcxl/opencode-cabbage",
"version": "1.1.0",
"description": "OpenCode 全流程开发插件 — 需求→设计→任务→编码→测试→审查→自动合并,支持自动编排与并行 Subagent",
"description": "OpenCode 全流程开发插件 — 需求→设计→任务→编码→测试→审查→自动合并,支持自动编排与并行 Subagent。兼容 OpenCode 与 Codex 双平台。",
"repository": {
"type": "git",
"url": "git+https://github.com/devcxl/opencode-cabbage.git"
Expand All @@ -12,7 +12,12 @@
},
"keywords": [
"opencode",
"opencode-plugin"
"opencode-plugin",
"codex",
"codex-plugin",
"development-workflow",
"orchestration",
"tdd"
],
"type": "module",
"engines": {
Expand Down Expand Up @@ -52,6 +57,7 @@
"docs:preview": "vitepress preview docs"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.30.0",
"@opencode-ai/plugin": "^1.17.0",
"@opencode-ai/sdk": "^1.17.14",
"yaml": "^2.8.3"
Expand Down
1 change: 1 addition & 0 deletions skills/flow-code
1 change: 1 addition & 0 deletions skills/flow-design
1 change: 1 addition & 0 deletions skills/flow-release
1 change: 1 addition & 0 deletions skills/flow-requirements
1 change: 1 addition & 0 deletions skills/flow-review
1 change: 1 addition & 0 deletions skills/flow-setup
1 change: 1 addition & 0 deletions skills/flow-tasks
1 change: 1 addition & 0 deletions skills/flow-tdd
Loading