prizmkit 1.1.118 → 1.1.120
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/bin/create-prizmkit.js +1 -5
- package/bundled/VERSION.json +3 -3
- package/bundled/dev-pipeline/README.md +41 -38
- package/bundled/dev-pipeline/assets/skill-subagent-integration.md +76 -0
- package/bundled/dev-pipeline/prizmkit_runtime/config.py +2 -8
- package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +2 -4
- package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -1
- package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +3 -3
- package/bundled/dev-pipeline/prizmkit_runtime/runner_bookkeeping.py +21 -11
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +45 -3
- package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +28 -6
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +60 -102
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +1 -19
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +1 -19
- package/bundled/dev-pipeline/scripts/{init-dev-team.py → init-change-artifact.py} +6 -16
- package/bundled/dev-pipeline/scripts/parse-stream-progress.py +364 -76
- package/bundled/dev-pipeline/scripts/utils.py +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +2 -2
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +7 -9
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +2 -2
- package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +1 -1
- package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -1
- package/bundled/dev-pipeline/templates/sections/critical-paths-full.md +0 -2
- package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +8 -1
- package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +6 -7
- package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +6 -7
- package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +4 -2
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +4 -2
- package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +20 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +2 -2
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +204 -141
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +16 -10
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +2 -13
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +13 -14
- package/bundled/dev-pipeline/tests/test_unified_cli.py +227 -7
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +2 -2
- package/bundled/skills/app-planner/references/architecture-decisions.md +1 -3
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +4 -2
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +40 -1
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +4 -2
- package/bundled/skills/feature-pipeline-launcher/references/configuration.md +40 -1
- package/bundled/skills/prizmkit-code-review/SKILL.md +16 -14
- package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +9 -9
- package/bundled/skills/prizmkit-implement/SKILL.md +21 -1
- package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +67 -0
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +4 -2
- package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +40 -1
- package/package.json +1 -1
- package/src/clean.js +12 -8
- package/src/config.js +24 -42
- package/src/index.js +1 -10
- package/src/manifest.js +3 -9
- package/src/metadata.js +0 -26
- package/src/prompts.js +0 -13
- package/src/scaffold.js +76 -201
- package/src/upgrade.js +16 -33
- package/bundled/adapters/claude/agent-adapter.js +0 -96
- package/bundled/adapters/claude/team-adapter.js +0 -183
- package/bundled/adapters/codebuddy/agent-adapter.js +0 -42
- package/bundled/adapters/codebuddy/team-adapter.js +0 -46
- package/bundled/adapters/codex/agent-adapter.js +0 -38
- package/bundled/adapters/codex/team-adapter.js +0 -37
- package/bundled/agents/prizm-dev-team-dev.md +0 -123
- package/bundled/agents/prizm-dev-team-reviewer.md +0 -113
- package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +0 -65
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +0 -436
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +0 -510
- package/bundled/team/prizm-dev-team.json +0 -27
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claude Code Agent Adapter
|
|
3
|
-
* Converts core/ agent definitions to .claude/agents/ format.
|
|
4
|
-
*
|
|
5
|
-
* Key differences from CodeBuddy agents:
|
|
6
|
-
* - tools: comma-separated string -> YAML array
|
|
7
|
-
* - model: "inherit" -> explicit model name (or kept as "inherit")
|
|
8
|
-
* - skills: kept as comma-separated string (Claude Code supports it natively)
|
|
9
|
-
* - TaskCreate/Get/Update/List -> Task (single tool)
|
|
10
|
-
* - SendMessage -> SendMessage (native Agent Teams communication)
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { parseFrontmatter, buildMarkdown } from '../shared/frontmatter.js';
|
|
14
|
-
import { TOOL_MAPPING } from '../shared/constants.js';
|
|
15
|
-
import { mkdirSync } from 'node:fs';
|
|
16
|
-
import { readFile, writeFile } from 'node:fs/promises';
|
|
17
|
-
import path from 'path';
|
|
18
|
-
|
|
19
|
-
// Default model for Claude Code agents
|
|
20
|
-
const DEFAULT_MODEL = 'claude-sonnet-4-20250514';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Convert a core agent definition to Claude Code format.
|
|
24
|
-
* @param {string} agentContent - Content of the core agent .md
|
|
25
|
-
* @param {Object} options - { model?: string }
|
|
26
|
-
* @returns {string} - Claude Code formatted agent .md content
|
|
27
|
-
*/
|
|
28
|
-
export function convertAgent(agentContent, options = {}) {
|
|
29
|
-
const { frontmatter, body } = parseFrontmatter(agentContent);
|
|
30
|
-
|
|
31
|
-
// Convert tools: comma-separated string -> deduplicated array
|
|
32
|
-
let tools = [];
|
|
33
|
-
if (frontmatter.tools) {
|
|
34
|
-
const rawTools = frontmatter.tools.split(',').map(t => t.trim());
|
|
35
|
-
const mapped = rawTools.map(t => {
|
|
36
|
-
if (TOOL_MAPPING.hasOwnProperty(t)) {
|
|
37
|
-
return TOOL_MAPPING[t];
|
|
38
|
-
}
|
|
39
|
-
return t;
|
|
40
|
-
}).filter(Boolean);
|
|
41
|
-
tools = [...new Set(mapped)];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Body content is used as-is — no injection or transformation needed.
|
|
45
|
-
// Claude Code natively supports skills in frontmatter and slash commands in body.
|
|
46
|
-
let convertedBody = body;
|
|
47
|
-
|
|
48
|
-
// Convert disallowedTools: comma-separated string -> deduplicated array
|
|
49
|
-
let disallowedTools = [];
|
|
50
|
-
if (frontmatter.disallowedTools) {
|
|
51
|
-
const rawDisallowed = frontmatter.disallowedTools.split(',').map(t => t.trim());
|
|
52
|
-
const mappedDisallowed = rawDisallowed.map(t => {
|
|
53
|
-
if (TOOL_MAPPING.hasOwnProperty(t)) {
|
|
54
|
-
return TOOL_MAPPING[t];
|
|
55
|
-
}
|
|
56
|
-
return t;
|
|
57
|
-
}).filter(Boolean);
|
|
58
|
-
disallowedTools = [...new Set(mappedDisallowed)];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Build Claude Code frontmatter
|
|
62
|
-
const claudeFrontmatter = {
|
|
63
|
-
name: frontmatter.name,
|
|
64
|
-
description: frontmatter.description,
|
|
65
|
-
tools: tools,
|
|
66
|
-
model: options.model || DEFAULT_MODEL,
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// Add disallowedTools if present
|
|
70
|
-
if (disallowedTools.length > 0) {
|
|
71
|
-
claudeFrontmatter.disallowedTools = disallowedTools;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Preserve skills field if present (Claude Code supports it natively)
|
|
75
|
-
if (frontmatter.skills) {
|
|
76
|
-
claudeFrontmatter.skills = frontmatter.skills;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return buildMarkdown(claudeFrontmatter, convertedBody);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Install an agent definition to the target project's .claude/agents/.
|
|
84
|
-
* @param {string} corePath - Path to core/agents/<name>.md
|
|
85
|
-
* @param {string} targetRoot - Target project root
|
|
86
|
-
* @param {Object} options - { model?: string }
|
|
87
|
-
*/
|
|
88
|
-
export async function installAgent(corePath, targetRoot, options = {}) {
|
|
89
|
-
const filename = path.basename(corePath);
|
|
90
|
-
const targetDir = path.join(targetRoot, '.claude', 'agents');
|
|
91
|
-
mkdirSync(targetDir, { recursive: true });
|
|
92
|
-
|
|
93
|
-
const content = await readFile(corePath, 'utf8');
|
|
94
|
-
const converted = convertAgent(content, options);
|
|
95
|
-
await writeFile(path.join(targetDir, filename), converted);
|
|
96
|
-
}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claude Code Team Adapter
|
|
3
|
-
*
|
|
4
|
-
* 支持 Claude Code 原生 Agent Teams 系统。
|
|
5
|
-
* 通过环境变量 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 启用原生团队模式。
|
|
6
|
-
*
|
|
7
|
-
* 两种模式:
|
|
8
|
-
* 1. 原生 Agent Teams 模式 (推荐): 使用 SendMessage 实现 teammate 间多向通信
|
|
9
|
-
* 2. Subagent 模式 (兜底): 通过 Task 工具由 Coordinator 单向编排
|
|
10
|
-
*
|
|
11
|
-
* 原生 Agent Teams 的核心机制:
|
|
12
|
-
* - 每个 agent 作为 teammate 持续运行
|
|
13
|
-
* - 通过 SendMessage 工具实现点对点、广播通信
|
|
14
|
-
* - 共享任务目录 ~/.claude/tasks/{team-name}/
|
|
15
|
-
* - 支持 shutdown 消息终止 teammate
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import { mkdirSync } from 'node:fs';
|
|
19
|
-
import { writeFile } from 'node:fs/promises';
|
|
20
|
-
import path from 'path';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* 检测是否启用了原生 Agent Teams 模式
|
|
24
|
-
* @returns {boolean}
|
|
25
|
-
*/
|
|
26
|
-
export function isNativeTeamsEnabled() {
|
|
27
|
-
return process.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS === '1';
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 生成原生 Agent Teams 配置
|
|
32
|
-
* 当 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 时使用此模式
|
|
33
|
-
*
|
|
34
|
-
* @param {Object} teamDef - 平台无关的团队定义 (core/team/*.json)
|
|
35
|
-
* @param {string} targetRoot - 目标项目根目录
|
|
36
|
-
*/
|
|
37
|
-
async function installNativeTeam(teamDef, targetRoot) {
|
|
38
|
-
const claudeDir = path.join(targetRoot, '.claude');
|
|
39
|
-
mkdirSync(claudeDir, { recursive: true });
|
|
40
|
-
|
|
41
|
-
// 构建原生 Agent Teams 配置
|
|
42
|
-
const teamConfig = {
|
|
43
|
-
name: teamDef.name,
|
|
44
|
-
description: teamDef.description,
|
|
45
|
-
platform: 'claude',
|
|
46
|
-
orchestrationMode: 'native-agent-teams',
|
|
47
|
-
envVar: 'CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1',
|
|
48
|
-
teammates: teamDef.members.map(m => ({
|
|
49
|
-
name: m.name,
|
|
50
|
-
role: m.role,
|
|
51
|
-
agentFile: `.claude/agents/${m.agentDefinition}.md`,
|
|
52
|
-
prompt: m.prompt || '',
|
|
53
|
-
subscriptions: m.subscriptions || [],
|
|
54
|
-
})),
|
|
55
|
-
communication: {
|
|
56
|
-
protocol: 'SendMessage',
|
|
57
|
-
modes: ['point-to-point', 'broadcast', 'shutdown'],
|
|
58
|
-
messageTypes: [
|
|
59
|
-
'STATUS_UPDATE',
|
|
60
|
-
'COMPLETION_SIGNAL',
|
|
61
|
-
'ISSUE_REPORT',
|
|
62
|
-
'ESCALATION',
|
|
63
|
-
'HEARTBEAT_CHECK',
|
|
64
|
-
'TASK_ASSIGNMENT',
|
|
65
|
-
],
|
|
66
|
-
routing: 'mesh',
|
|
67
|
-
note: 'Teammates 之间可直接通信 (SendMessage),关键消息同时通知 Coordinator。',
|
|
68
|
-
},
|
|
69
|
-
sharedTaskDir: `~/.claude/tasks/${teamDef.name}/`,
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
await writeFile(
|
|
73
|
-
path.join(claudeDir, 'team-info.json'),
|
|
74
|
-
JSON.stringify(teamConfig, null, 2)
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
// 生成 Agent Teams 使用说明
|
|
78
|
-
const teamGuide = `# ${teamDef.name} — Agent Teams 配置
|
|
79
|
-
|
|
80
|
-
## 启用方式
|
|
81
|
-
|
|
82
|
-
\`\`\`bash
|
|
83
|
-
export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
|
|
84
|
-
\`\`\`
|
|
85
|
-
|
|
86
|
-
## 团队成员
|
|
87
|
-
|
|
88
|
-
| 名称 | 角色 | Agent 文件 |
|
|
89
|
-
|------|------|-----------|
|
|
90
|
-
${teamDef.members.map(m => `| ${m.name} | ${m.role} | \`.claude/agents/${m.agentDefinition}.md\` |`).join('\n')}
|
|
91
|
-
|
|
92
|
-
## 通信机制
|
|
93
|
-
|
|
94
|
-
原生 Agent Teams 使用 **SendMessage** 工具实现 teammate 间通信:
|
|
95
|
-
|
|
96
|
-
- **点对点**: \`SendMessage(to: "pm", message: "...")\`
|
|
97
|
-
- **广播**: \`SendMessage(to: "*", message: "...")\`
|
|
98
|
-
- **终止**: \`SendMessage(to: "dev", type: "shutdown")\`
|
|
99
|
-
|
|
100
|
-
## 消息类型
|
|
101
|
-
|
|
102
|
-
- \`STATUS_UPDATE\` — Agent 汇报状态变化
|
|
103
|
-
- \`COMPLETION_SIGNAL\` — Agent 完成任务通知
|
|
104
|
-
- \`ISSUE_REPORT\` — Agent 报告问题
|
|
105
|
-
- \`ESCALATION\` — Agent 请求升级处理
|
|
106
|
-
- \`HEARTBEAT_CHECK\` — 检查 Agent 存活
|
|
107
|
-
- \`TASK_ASSIGNMENT\` — 任务分配指令
|
|
108
|
-
|
|
109
|
-
## 与 Subagent 模式的区别
|
|
110
|
-
|
|
111
|
-
| 维度 | Subagent 模式 | 原生 Agent Teams |
|
|
112
|
-
|------|---------------|-----------------|
|
|
113
|
-
| 通信方式 | Coordinator 通过 Task 单向 spawn | SendMessage 多向通信 |
|
|
114
|
-
| Agent 生命周期 | 完成即消亡 | 持续运行 |
|
|
115
|
-
| 协作模式 | 星型 (Coordinator 中心) | 网状 (任意 teammate 间) |
|
|
116
|
-
| 共享状态 | 无 | ~/.claude/tasks/${teamDef.name}/ |
|
|
117
|
-
`;
|
|
118
|
-
|
|
119
|
-
await writeFile(
|
|
120
|
-
path.join(claudeDir, 'team-guide.md'),
|
|
121
|
-
teamGuide
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* 生成 Subagent 模式配置 (兜底)
|
|
127
|
-
* 当未启用 Agent Teams 时使用此模式
|
|
128
|
-
*
|
|
129
|
-
* @param {Object} teamDef - 平台无关的团队定义
|
|
130
|
-
* @param {string} targetRoot - 目标项目根目录
|
|
131
|
-
*/
|
|
132
|
-
async function installSubagentTeam(teamDef, targetRoot) {
|
|
133
|
-
const claudeDir = path.join(targetRoot, '.claude');
|
|
134
|
-
mkdirSync(claudeDir, { recursive: true });
|
|
135
|
-
|
|
136
|
-
const teamInfo = {
|
|
137
|
-
name: teamDef.name,
|
|
138
|
-
description: teamDef.description,
|
|
139
|
-
platform: 'claude',
|
|
140
|
-
orchestrationMode: 'subagent',
|
|
141
|
-
note: 'Subagent 兜底模式。如需启用原生 Agent Teams,设置 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 后重新安装。',
|
|
142
|
-
agents: teamDef.members
|
|
143
|
-
.filter(m => m.role !== 'lead')
|
|
144
|
-
.map(m => ({
|
|
145
|
-
name: m.name,
|
|
146
|
-
role: m.role,
|
|
147
|
-
agentFile: `.claude/agents/${m.agentDefinition}.md`,
|
|
148
|
-
prompt: m.prompt,
|
|
149
|
-
})),
|
|
150
|
-
upgrade: {
|
|
151
|
-
envVar: 'CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS',
|
|
152
|
-
command: 'npx prizmkit init # 重新安装以启用原生 Agent Teams',
|
|
153
|
-
},
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
await writeFile(
|
|
157
|
-
path.join(claudeDir, 'team-info.json'),
|
|
158
|
-
JSON.stringify(teamInfo, null, 2)
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* 安装团队配置到目标项目。
|
|
164
|
-
* 自动检测环境变量决定使用原生 Agent Teams 或 Subagent 模式。
|
|
165
|
-
*
|
|
166
|
-
* @param {Object} teamDef - 平台无关的团队定义
|
|
167
|
-
* @param {string} targetRoot - 目标项目根目录
|
|
168
|
-
* @returns {Promise<{ mode: string }>} - 安装的模式
|
|
169
|
-
*/
|
|
170
|
-
export async function installTeam(teamDef, targetRoot) {
|
|
171
|
-
const nativeMode = isNativeTeamsEnabled();
|
|
172
|
-
|
|
173
|
-
if (nativeMode) {
|
|
174
|
-
console.log(' ✓ Agent Teams 模式: 原生 (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1)');
|
|
175
|
-
await installNativeTeam(teamDef, targetRoot);
|
|
176
|
-
return { mode: 'native-agent-teams' };
|
|
177
|
-
} else {
|
|
178
|
-
console.log(' ✓ Agent Teams 模式: Subagent (兜底模式)');
|
|
179
|
-
console.log(' 提示: 设置 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 可启用原生 Agent Teams');
|
|
180
|
-
await installSubagentTeam(teamDef, targetRoot);
|
|
181
|
-
return { mode: 'subagent' };
|
|
182
|
-
}
|
|
183
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CodeBuddy Agent Adapter
|
|
3
|
-
* Converts core/ agent definitions to .codebuddy/agents/ format.
|
|
4
|
-
* For CodeBuddy, this is mostly pass-through as the core format matches.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { existsSync, mkdirSync } from 'node:fs';
|
|
8
|
-
import { readFile, writeFile, symlink } from 'node:fs/promises';
|
|
9
|
-
import path from 'path';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Convert a core agent definition to CodeBuddy format.
|
|
13
|
-
* @param {string} agentContent - Content of the core agent .md
|
|
14
|
-
* @returns {string} - CodeBuddy-formatted agent .md content
|
|
15
|
-
*/
|
|
16
|
-
export function convertAgent(agentContent) {
|
|
17
|
-
// CodeBuddy format is already the native core format
|
|
18
|
-
return agentContent;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Install an agent definition to the target project.
|
|
23
|
-
* @param {string} corePath - Path to core/agents/<name>.md
|
|
24
|
-
* @param {string} targetRoot - Target project root
|
|
25
|
-
* @param {Object} options - { useSymlinks: boolean }
|
|
26
|
-
*/
|
|
27
|
-
export async function installAgent(corePath, targetRoot, options = {}) {
|
|
28
|
-
const filename = path.basename(corePath);
|
|
29
|
-
const targetDir = path.join(targetRoot, '.codebuddy', 'agents');
|
|
30
|
-
mkdirSync(targetDir, { recursive: true });
|
|
31
|
-
|
|
32
|
-
if (options.useSymlinks) {
|
|
33
|
-
const targetPath = path.join(targetDir, filename);
|
|
34
|
-
if (!existsSync(targetPath)) {
|
|
35
|
-
await symlink(corePath, targetPath);
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
const content = await readFile(corePath, 'utf8');
|
|
39
|
-
const converted = convertAgent(content);
|
|
40
|
-
await writeFile(path.join(targetDir, filename), converted);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CodeBuddy Team Adapter
|
|
3
|
-
* Generates ~/.codebuddy/teams/ config from core/team/ topology.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { existsSync, mkdirSync } from 'node:fs';
|
|
7
|
-
import { writeFile } from 'node:fs/promises';
|
|
8
|
-
import path from 'path';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Generate CodeBuddy team config and inboxes.
|
|
12
|
-
* @param {Object} teamDef - Platform-agnostic team definition from core/team/
|
|
13
|
-
* @param {string} targetDir - Target directory for team config (e.g. ~/.codebuddy/teams/<name>/)
|
|
14
|
-
*/
|
|
15
|
-
export async function installTeam(teamDef, targetDir) {
|
|
16
|
-
mkdirSync(path.join(targetDir, 'inboxes'), { recursive: true });
|
|
17
|
-
|
|
18
|
-
// Build CodeBuddy-native config.json
|
|
19
|
-
const config = {
|
|
20
|
-
name: teamDef.name,
|
|
21
|
-
description: teamDef.description,
|
|
22
|
-
createdAt: Date.now(),
|
|
23
|
-
leadAgentId: `${teamDef.lead}@${teamDef.name}`,
|
|
24
|
-
leadSessionId: '',
|
|
25
|
-
members: teamDef.members.map((m, i) => ({
|
|
26
|
-
agentId: `${m.name}@${teamDef.name}`,
|
|
27
|
-
name: m.name,
|
|
28
|
-
agentType: m.agentDefinition || m.name,
|
|
29
|
-
...(m.prompt ? { prompt: m.prompt } : {}),
|
|
30
|
-
joinedAt: Date.now() + i,
|
|
31
|
-
tmuxPaneId: '',
|
|
32
|
-
cwd: '',
|
|
33
|
-
subscriptions: m.subscriptions || [],
|
|
34
|
-
})),
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
await writeFile(path.join(targetDir, 'config.json'), JSON.stringify(config, null, 2));
|
|
38
|
-
|
|
39
|
-
// Create inbox files for each member
|
|
40
|
-
for (const member of teamDef.members) {
|
|
41
|
-
const inboxPath = path.join(targetDir, 'inboxes', `${member.name}.json`);
|
|
42
|
-
if (!existsSync(inboxPath)) {
|
|
43
|
-
await writeFile(inboxPath, JSON.stringify([], null, 2));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex Agent Adapter
|
|
3
|
-
*
|
|
4
|
-
* Converts core/ agent definitions to native Codex TOML subagent files.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { mkdirSync } from 'node:fs';
|
|
8
|
-
import { readFile, writeFile } from 'node:fs/promises';
|
|
9
|
-
import path from 'path';
|
|
10
|
-
import { parseFrontmatter } from '../shared/frontmatter.js';
|
|
11
|
-
|
|
12
|
-
function toTomlString(value) {
|
|
13
|
-
return JSON.stringify(String(value ?? ''));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function convertAgent(agentContent, options = {}) {
|
|
17
|
-
const { frontmatter, body } = parseFrontmatter(agentContent);
|
|
18
|
-
const name = frontmatter.name || options.name || 'prizmkit-agent';
|
|
19
|
-
const description = frontmatter.description || `${name} PrizmKit subagent`;
|
|
20
|
-
const developerInstructions = body.trimEnd();
|
|
21
|
-
|
|
22
|
-
return [
|
|
23
|
-
`name = ${toTomlString(name)}`,
|
|
24
|
-
`description = ${toTomlString(description)}`,
|
|
25
|
-
`developer_instructions = ${toTomlString(developerInstructions)}`,
|
|
26
|
-
'',
|
|
27
|
-
].join('\n');
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export async function installAgent(corePath, targetRoot) {
|
|
31
|
-
const baseName = path.basename(corePath, path.extname(corePath));
|
|
32
|
-
const filename = `${baseName}.toml`;
|
|
33
|
-
const targetDir = path.join(targetRoot, '.codex', 'agents');
|
|
34
|
-
mkdirSync(targetDir, { recursive: true });
|
|
35
|
-
|
|
36
|
-
const content = await readFile(corePath, 'utf8');
|
|
37
|
-
await writeFile(path.join(targetDir, filename), convertAgent(content, { name: baseName }));
|
|
38
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex Team Adapter
|
|
3
|
-
*
|
|
4
|
-
* Codex does not require a separate team registry for PrizmKit. The team
|
|
5
|
-
* topology is installed as project metadata and referenced by AGENTS.md and
|
|
6
|
-
* pipeline prompts.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { mkdirSync } from 'node:fs';
|
|
10
|
-
import { writeFile } from 'node:fs/promises';
|
|
11
|
-
import path from 'path';
|
|
12
|
-
|
|
13
|
-
export async function installTeam(teamDef, targetRoot) {
|
|
14
|
-
const codexDir = path.join(targetRoot, '.codex');
|
|
15
|
-
mkdirSync(codexDir, { recursive: true });
|
|
16
|
-
|
|
17
|
-
const teamInfo = {
|
|
18
|
-
name: teamDef.name,
|
|
19
|
-
description: teamDef.description,
|
|
20
|
-
platform: 'codex',
|
|
21
|
-
orchestrationMode: 'codex-subagents',
|
|
22
|
-
agents: teamDef.members
|
|
23
|
-
.filter(m => m.role !== 'lead')
|
|
24
|
-
.map(m => ({
|
|
25
|
-
name: m.name,
|
|
26
|
-
role: m.role,
|
|
27
|
-
agentFile: `.codex/agents/${m.agentDefinition}.toml`,
|
|
28
|
-
prompt: m.prompt,
|
|
29
|
-
subscriptions: m.subscriptions || [],
|
|
30
|
-
})),
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
await writeFile(
|
|
34
|
-
path.join(codexDir, 'team-info.json'),
|
|
35
|
-
JSON.stringify(teamInfo, null, 2)
|
|
36
|
-
);
|
|
37
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: prizm-dev-team-dev
|
|
3
|
-
description: PrizmKit-integrated module implementer (multi-instance). Follows /prizmkit-implement workflow with TDD, marks tasks [x] in plan.md Tasks section. Works directly in the repository; uses git worktree only if explicitly instructed. Use when implementing specific feature modules.
|
|
4
|
-
tools: Read, Write, Edit, Bash, Glob, Grep, TaskCreate, TaskGet, TaskUpdate, TaskList, SendMessage
|
|
5
|
-
disallowedTools: Agent
|
|
6
|
-
model: inherit
|
|
7
|
-
context_level: full
|
|
8
|
-
skills: prizmkit-implement, prizmkit-prizm-docs
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
You are the **Dev Agent**, the module implementer of the PrizmKit-integrated Multi-Agent software development collaboration team.
|
|
12
|
-
|
|
13
|
-
### Core Identity
|
|
14
|
-
|
|
15
|
-
You are the team's "construction worker" — you build strictly according to blueprints, using PrizmKit's implement workflow as your execution engine. Your focus:
|
|
16
|
-
- Implement feature modules task-by-task following the plan.md Tasks section and interface designs
|
|
17
|
-
- Develop using TDD (test-first)
|
|
18
|
-
- Mark `[x]` in the plan.md Tasks section immediately upon task completion
|
|
19
|
-
- Produce code and unit tests
|
|
20
|
-
|
|
21
|
-
### Project Context
|
|
22
|
-
|
|
23
|
-
Project documentation is in `.prizmkit/prizm-docs/`. Before implementation, read `context-snapshot.md` (if it exists in `.prizmkit/specs/###-feature-name/`); its Section 3 contains Prizm Context and Section 4 contains a File Manifest with paths and key interfaces.
|
|
24
|
-
|
|
25
|
-
**⚠️ File Reading Rule**: Do NOT re-read source files already listed in Section 4 File Manifest — the manifest already contains their key interfaces. Only read a source file directly if: (a) it is NOT in the manifest, or (b) you need a specific implementation detail not captured in the manifest's interface column. Unnecessary re-reads waste significant context budget.
|
|
26
|
-
|
|
27
|
-
If the snapshot does not exist:
|
|
28
|
-
1. Read `.prizmkit/prizm-docs/root.prizm` to understand rules and known traps (TRAPS)
|
|
29
|
-
2. Read relevant L1/L2 docs for affected modules
|
|
30
|
-
3. Read required source files directly
|
|
31
|
-
|
|
32
|
-
### Artifact Paths
|
|
33
|
-
|
|
34
|
-
| Path | Purpose |
|
|
35
|
-
|------|---------|
|
|
36
|
-
| `.prizmkit/prizm-docs/` | Architecture index — module structure, interfaces, dependencies, known traps (TRAPS), design decisions (DECISIONS) |
|
|
37
|
-
| `.prizmkit/specs/###-feature-name/` | Feature artifacts — spec.md / plan.md (with Tasks section) |
|
|
38
|
-
|
|
39
|
-
### Must Do (MUST)
|
|
40
|
-
|
|
41
|
-
1. Implement feature modules according to assigned tasks and interface designs in plan.md
|
|
42
|
-
2. Follow TDD: write tests first, then implement, then verify
|
|
43
|
-
3. Produced code must pass all unit tests for the module
|
|
44
|
-
4. Report interface design ambiguities to the Orchestrator immediately (do not assume)
|
|
45
|
-
5. Follow the `/prizmkit-implement` workflow: read plan.md (with Tasks section) + spec.md, implement task by task
|
|
46
|
-
6. Mark `[x]` in the plan.md Tasks section **immediately** after each task is completed (do not batch-mark)
|
|
47
|
-
7. Read the TRAPS section before implementation to avoid known pitfalls: prefer `context-snapshot.md` Section 3; if no snapshot exists, read `.prizmkit/prizm-docs/`
|
|
48
|
-
8. Checkpoint tasks must verify that build and tests pass before proceeding to the next phase
|
|
49
|
-
9. Execute sequential tasks in order; stop on failure. Parallel `[P]` tasks may continue
|
|
50
|
-
10. When creating a new sub-module, generate the corresponding `.prizmkit/prizm-docs/` L2 document. **Batch independent operations**: combine multiple `mkdir -p` into one command; issue multiple independent `Write` calls for different `.prizmkit/prizm-docs/` files in a single message turn (they have no dependencies between them).
|
|
51
|
-
11. **`.prizmkit/prizm-docs/` write safety**: Before writing ANY `.prizmkit/prizm-docs/` file, check if it already exists (`ls <path>`). If it **exists**: update only durable structural/knowledge fields (KEY_FILES, INTERFACES, DEPENDENCIES, file counts, RULES, TRAPS, DECISIONS) — **never overwrite the full file**. Do not add CHANGELOG, UPDATED/date fields, Bug IDs, feature IDs, refactor IDs, task IDs, session IDs, run IDs, pipeline IDs, workflow IDs, branch names, absolute worktree paths, pipeline artifact paths, or `.prizmkit/specs` / `.prizmkit/dev-pipeline` artifact paths. If a durable fact changes, update the existing section in place. If the file does **not** exist: create it only for sub-modules you are actively creating in this session. Do NOT write `.prizmkit/prizm-docs/` files for modules you are not directly creating.
|
|
52
|
-
12. After completing ALL tasks, append '## Implementation Log' to context-snapshot.md: files changed/created, key decisions, notable discoveries
|
|
53
|
-
|
|
54
|
-
### Never Do (NEVER)
|
|
55
|
-
|
|
56
|
-
- Do not modify interface designs in plan.md (modifications require the Orchestrator)
|
|
57
|
-
- Do not modify code in modules owned by other Dev Agents
|
|
58
|
-
- Do not perform integration testing (that is the Reviewer's responsibility)
|
|
59
|
-
- **Do not execute any git operations** (git commit / git add / git reset / git push are all prohibited — the Orchestrator handles commits via /prizmkit-committer)
|
|
60
|
-
- Do not modify any files in `.prizmkit/specs/` except `plan.md` (marking Tasks [x]) and `context-snapshot.md` (appending Implementation Log)
|
|
61
|
-
- Do not use TaskCreate/TaskUpdate to create or modify Orchestrator-level tasks (Task tools are for internal progress tracking only, and task IDs are not shared across agent sub-sessions)
|
|
62
|
-
- **Do not overwrite existing `.prizmkit/prizm-docs/` files in full** — if a doc already exists, only update the affected durable fields; never replace the entire file. Do NOT write `.prizmkit/prizm-docs/` entries for modules you are not actively creating in this session.
|
|
63
|
-
- **Do not leak internal PrizmKit metadata into product surfaces or memory docs** — feature IDs (`F-001`), bug/refactor IDs, task IDs, session IDs, run IDs, pipeline IDs, workflow IDs, branch names, absolute worktree paths, pipeline artifact paths, and `.prizmkit/specs` / `.prizmkit/dev-pipeline` artifact paths must not appear in `.prizmkit/prizm-docs/`, user-visible UI copy, API responses, emails, notifications, or tests that assert visible product text.
|
|
64
|
-
|
|
65
|
-
### Behavioral Rules
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
DEV-01: Implementation must strictly conform to interface designs defined in plan.md
|
|
69
|
-
DEV-02: Every public API/function must have a corresponding unit test
|
|
70
|
-
DEV-03: When interface design ambiguity is found, do not assume — escalate immediately
|
|
71
|
-
DEV-04: After task completion, run all unit tests for the module
|
|
72
|
-
DEV-05: Commit messages follow Conventional Commits format (for reference only — actual commits are handled by the Orchestrator)
|
|
73
|
-
DEV-06: Do not introduce external dependencies not declared in the task description
|
|
74
|
-
DEV-07: Follow the /prizmkit-implement workflow
|
|
75
|
-
DEV-08: Mark plan.md Tasks section [x] immediately after each task is completed
|
|
76
|
-
DEV-09: TDD: write tests → implement → verify
|
|
77
|
-
DEV-10: Read the TRAPS section before implementing each module: prefer context-snapshot.md Section 3; if no snapshot, read .prizmkit/prizm-docs/
|
|
78
|
-
DEV-11: Checkpoint tasks must verify that build and tests pass
|
|
79
|
-
DEV-12: Generate L2 .prizmkit/prizm-docs/ documentation when creating new sub-modules
|
|
80
|
-
DEV-13: Executing any git command is prohibited (git add/commit/reset/push are all forbidden)
|
|
81
|
-
DEV-14: If `npm test` has pre-existing failures, do not ignore them — list them explicitly in COMPLETION_SIGNAL for Orchestrator decision
|
|
82
|
-
DEV-15: After ALL tasks, append '## Implementation Log' to context-snapshot.md (files changed, key decisions, discoveries)
|
|
83
|
-
DEV-16: Without context-snapshot: read .prizmkit/prizm-docs/ → read source files directly
|
|
84
|
-
DEV-17: DO NOT re-read source files already listed in context-snapshot.md Section 4 File Manifest — the manifest already has their key interfaces. Only read a file directly if: (a) NOT in the manifest, (b) needing an implementation detail beyond the interface summary, or (c) needing a constant/enum/field-name value not representable as a function signature. Unnecessary re-reads waste significant context budget.
|
|
85
|
-
DEV-18: Internal tracking IDs are not product copy. Before writing UI text or UI-copy assertions, translate references like `F-003 guard` into product-language behavior such as `the high-risk guard`. Add regression coverage when a feature touches user-visible text.
|
|
86
|
-
DEV-19: Follow the framework-level Agent Operational Rules for Edit failure recovery, Read offset safety, stale line counts, consecutive read failures, test output hygiene, and incremental validation.
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Workflow
|
|
90
|
-
|
|
91
|
-
1. Receive task assignment
|
|
92
|
-
2. Read `.prizmkit/specs/###-feature-name/context-snapshot.md` (if it exists) — Section 3 contains Prizm Context, Section 4 contains a File Manifest.
|
|
93
|
-
**DO NOT re-read source files listed in Section 4** — the manifest already has their interfaces. Only read a source file if it is NOT in the manifest, or you need a specific detail beyond what the interface column provides. If the snapshot does not exist:
|
|
94
|
-
a. Read `.prizmkit/prizm-docs/root.prizm` and relevant module documentation
|
|
95
|
-
b. Read required source files directly
|
|
96
|
-
3. Read `plan.md` (with Tasks section) and `spec.md` in `.prizmkit/specs/###-feature-name/`
|
|
97
|
-
4. For each assigned task, execute in plan.md Tasks order:
|
|
98
|
-
a. Get target file context and TRAPS from context-snapshot.md (if no snapshot, read the target file module's documentation)
|
|
99
|
-
b. TDD: write tests based on acceptance criteria → implement feature code → run tests to verify
|
|
100
|
-
c. Mark the task as `[x]` in the plan.md Tasks section
|
|
101
|
-
d. After all tasks, append Implementation Log to context-snapshot.md
|
|
102
|
-
e. Send STATUS_UPDATE to the Orchestrator
|
|
103
|
-
5. For checkpoint tasks, verify that build and tests pass before continuing
|
|
104
|
-
6. On interface design ambiguity, send ESCALATION (do not assume)
|
|
105
|
-
7. If a new sub-module was created, generate the corresponding `.prizmkit/prizm-docs/` L2 document
|
|
106
|
-
8. Send COMPLETION_SIGNAL
|
|
107
|
-
|
|
108
|
-
### Exception Handling
|
|
109
|
-
|
|
110
|
-
| Scenario | Strategy |
|
|
111
|
-
|----------|----------|
|
|
112
|
-
| Interface design ambiguity | Mark BLOCKED → ESCALATION → wait for Orchestrator decision |
|
|
113
|
-
| Unit test failure | Retry fix up to 3 times → if still failing, ISSUE_REPORT |
|
|
114
|
-
| External dependency unavailable | Use mock → add annotation |
|
|
115
|
-
| Task exceeds estimate | ESCALATION → suggest Orchestrator split the task |
|
|
116
|
-
|
|
117
|
-
### Communication Rules
|
|
118
|
-
|
|
119
|
-
Direct communication between Agents is allowed, but key messages and conclusions must be reported to the Orchestrator.
|
|
120
|
-
- Send STATUS_UPDATE to report each sub-task completion
|
|
121
|
-
- Send COMPLETION_SIGNAL to indicate all tasks are complete
|
|
122
|
-
- Send ESCALATION to report interface ambiguities or task blockers
|
|
123
|
-
- Receive TASK_ASSIGNMENT to get assigned work
|