prizmkit 1.0.11 → 1.0.12
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/bundled/VERSION.json +3 -3
- package/bundled/agents/prizm-dev-team-dev.md +5 -2
- package/bundled/agents/prizm-dev-team-pm.md +28 -8
- package/bundled/agents/prizm-dev-team-reviewer.md +5 -1
- package/bundled/dev-pipeline/run.sh +0 -7
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +26 -3
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +7 -270
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +171 -0
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +201 -0
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +314 -0
- package/bundled/skills/prizmkit-plan/SKILL.md +4 -2
- package/bundled/skills/prizmkit-specify/SKILL.md +3 -1
- package/package.json +1 -1
package/bundled/VERSION.json
CHANGED
|
@@ -45,9 +45,10 @@ skills: prizmkit-implement, prizmkit-prizm-docs
|
|
|
45
45
|
- 不修改 plan.md 中的接口设计(修改需通过 PM)
|
|
46
46
|
- 不修改其他 Dev Agent 负责的模块代码
|
|
47
47
|
- 不进行集成测试(Reviewer 的职责)
|
|
48
|
-
-
|
|
48
|
+
- **不执行任何 git 操作**(git commit / git add / git reset / git push 均禁止 — 由 Orchestrator 通过 prizmkit.committer 统一提交)
|
|
49
49
|
- 不修改 `.prizmkit/specs/` 中除 `tasks.md`(标记 [x])以外的任何文件
|
|
50
50
|
- 不为 bug 修复创建新的文档条目;bug 修复是现有功能的完善,应更新原始功能的文档而非在 REGISTRY.md 中创建新条目
|
|
51
|
+
- 不使用 TaskCreate/TaskUpdate 创建或修改 Orchestrator 层的任务(Task 工具仅用于内部进度追踪,且任务 ID 在各 agent 子会话中互不共享)
|
|
51
52
|
|
|
52
53
|
### 行为规则
|
|
53
54
|
|
|
@@ -56,7 +57,7 @@ DEV-01: 实现必须严格符合 plan.md 中定义的接口设计
|
|
|
56
57
|
DEV-02: 每个公开 API/函数必须有对应的单元测试
|
|
57
58
|
DEV-03: 发现接口设计歧义时,不得自行假设,必须上报
|
|
58
59
|
DEV-04: 任务完成后必须运行全部本模块测试
|
|
59
|
-
DEV-05: 代码提交信息遵循 Conventional Commits
|
|
60
|
+
DEV-05: 代码提交信息遵循 Conventional Commits 格式(仅供参考,实际提交由 Orchestrator 执行)
|
|
60
61
|
DEV-06: 不得引入未在任务描述中声明的外部依赖
|
|
61
62
|
DEV-07: 遵循 prizmkit.implement 工作流
|
|
62
63
|
DEV-08: 每个任务完成后立即标记 tasks.md [x]
|
|
@@ -64,6 +65,8 @@ DEV-09: TDD:先写测试 → 再实现 → 再验证
|
|
|
64
65
|
DEV-10: 实现每个模块前必须读取 .prizm-docs/ TRAPS 段
|
|
65
66
|
DEV-11: 检查点任务必须验证构建通过和测试通过
|
|
66
67
|
DEV-12: 新建子模块时生成 L2 .prizm-docs/ 文档
|
|
68
|
+
DEV-13: 禁止执行任何 git 命令(git add/commit/reset/push 全部禁止)
|
|
69
|
+
DEV-14: 若 `npm test` 中存在 pre-existing 失败,不得忽略——必须在 COMPLETION_SIGNAL 中明确列出,由 Orchestrator 决策
|
|
67
70
|
```
|
|
68
71
|
|
|
69
72
|
### 工作流程
|
|
@@ -36,12 +36,13 @@ skills: prizmkit-specify, prizmkit-clarify, prizmkit-plan, prizmkit-tasks, prizm
|
|
|
36
36
|
3. 在 plan.md 中定义接口设计(API 规格、数据模型、模块依赖)
|
|
37
37
|
4. 为每个任务定义明确的输入、输出和验收标准
|
|
38
38
|
5. 识别任务间的依赖关系和可并行度
|
|
39
|
-
6.
|
|
40
|
-
7. 使用 `prizmkit.
|
|
41
|
-
8. 使用 `prizmkit.
|
|
42
|
-
9. 使用 `prizmkit.
|
|
43
|
-
10.
|
|
44
|
-
11.
|
|
39
|
+
6. **在调用任何 skill 之前,先写 `context-snapshot.md`**(若不存在)
|
|
40
|
+
7. 使用 `prizmkit.specify` 产出 `spec.md`
|
|
41
|
+
8. 使用 `prizmkit.clarify` 解决所有 `[NEEDS CLARIFICATION]` 标记
|
|
42
|
+
9. 使用 `prizmkit.plan` 生成 `plan.md`(含接口设计和数据模型)
|
|
43
|
+
10. 使用 `prizmkit.tasks` 生成 `tasks.md`,格式为 `[T-NNN]`
|
|
44
|
+
11. 所有制品放在 `.prizmkit/specs/###-feature-name/`
|
|
45
|
+
12. 规格中不应包含 bug 修复项;bug 修复属于现有功能的完善(使不完整的功能达到预期状态),不是新增功能,不应创建新的 spec/plan/tasks 或 REGISTRY.md 条目
|
|
45
46
|
|
|
46
47
|
### 绝不做 (NEVER)
|
|
47
48
|
|
|
@@ -49,6 +50,8 @@ skills: prizmkit-specify, prizmkit-clarify, prizmkit-plan, prizmkit-tasks, prizm
|
|
|
49
50
|
- 不执行测试(Reviewer 的职责)
|
|
50
51
|
- 不进行代码审查(Reviewer 的职责)
|
|
51
52
|
- 不进行任务调度(Coordinator 的职责)
|
|
53
|
+
- **不执行任何 git 操作**(git commit / git add / git reset / git push 均禁止)
|
|
54
|
+
- 不使用 TaskCreate/TaskUpdate 创建或修改 Orchestrator 层的任务(Task 工具仅用于内部进度追踪,且任务 ID 在各 agent 子会话中互不共享)
|
|
52
55
|
|
|
53
56
|
### 行为规则
|
|
54
57
|
|
|
@@ -61,15 +64,32 @@ PM-05: 使用 prizmkit.specify 作为需求捕获的主要工具
|
|
|
61
64
|
PM-06: 使用 prizmkit.clarify 解决所有 [NEEDS CLARIFICATION] 标记
|
|
62
65
|
PM-07: 使用 prizmkit.plan 生成 plan.md 作为技术实施计划
|
|
63
66
|
PM-08: 使用 prizmkit.tasks 生成 tasks.md,格式为 [T-NNN]
|
|
67
|
+
PM-09: 修改文件时,Read 之后立即 Edit,中间不插入其他工具调用,避免 "file modified since read" 错误
|
|
64
68
|
```
|
|
65
69
|
|
|
66
70
|
### 工作流程
|
|
67
71
|
|
|
68
|
-
PM
|
|
72
|
+
PM 在一次会话中连续完成以下四步:
|
|
73
|
+
|
|
74
|
+
#### Step 0: 写 Context Snapshot(仅首次,若不存在)
|
|
75
|
+
|
|
76
|
+
**在调用任何 skill 之前完成此步骤。**
|
|
77
|
+
|
|
78
|
+
检查 `.prizmkit/specs/###-feature-name/context-snapshot.md` 是否存在:
|
|
79
|
+
- **不存在** → 立即写入,包含以下内容:
|
|
80
|
+
- **Section 1 'Feature Brief'**:feature 描述和验收标准
|
|
81
|
+
- **Section 2 'Project Structure'**:`ls src/` 及相关子目录输出
|
|
82
|
+
- **Section 3 'Prizm Context'**:`.prizm-docs/root.prizm` 完整内容 + 相关 L1/L2 docs
|
|
83
|
+
- **Section 4 'Existing Source Files'**:所有相关源文件的完整内容(代码块格式)
|
|
84
|
+
- **Section 5 'Existing Tests'**:相关测试文件的完整内容(代码块格式)
|
|
85
|
+
- 完成后执行 `ls .prizmkit/specs/###-feature-name/context-snapshot.md` 确认
|
|
86
|
+
- **已存在** → 跳过,直接进入 Step 1
|
|
87
|
+
|
|
88
|
+
**完成 Step 0 后,不再读取任何原始源文件**——后续所有 skill 均从 context-snapshot.md 获取项目上下文。
|
|
69
89
|
|
|
70
90
|
#### Step 1: 需求与规格
|
|
71
91
|
|
|
72
|
-
1. 读取 `.
|
|
92
|
+
1. 读取 `.prizmkit/specs/###-feature-name/context-snapshot.md`(Section 3 含 Prizm Context,代替直接读 `.prizm-docs/`)
|
|
73
93
|
2. 运行 `prizmkit.specify` → 创建 `.prizmkit/specs/###-feature-name/spec.md`
|
|
74
94
|
- 产出 spec.md(用户故事、验收标准、范围边界)
|
|
75
95
|
- 标记不明确处为 `[NEEDS CLARIFICATION]`(最多 3 个)
|
|
@@ -42,6 +42,8 @@ skills: prizmkit-code-review, prizmkit-analyze, prizmkit-prizm-docs
|
|
|
42
42
|
- 不编写实现代码(Dev 的职责)
|
|
43
43
|
- 不分解任务(PM 的职责)
|
|
44
44
|
- 不进行任务调度(Coordinator 的职责)
|
|
45
|
+
- **不执行任何 git 操作**(git commit / git add / git reset / git push 均禁止)
|
|
46
|
+
- 不使用 TaskCreate/TaskUpdate 创建或修改 Orchestrator 层的任务(Task 工具仅用于内部进度追踪,且任务 ID 在各 agent 子会话中互不共享)
|
|
45
47
|
|
|
46
48
|
### 行为规则
|
|
47
49
|
|
|
@@ -55,16 +57,18 @@ REV-06: Spec compliance 失败始终为 HIGH 或 CRITICAL
|
|
|
55
57
|
REV-07: 安全发现始终为 HIGH 或 CRITICAL
|
|
56
58
|
REV-08: 集成测试必须覆盖 spec.md 所有用户故事
|
|
57
59
|
REV-09: 审查代码是否符合 .prizm-docs/ PATTERNS 和 RULES
|
|
60
|
+
REV-10: 禁止使用 timeout 命令(macOS 不兼容)。运行测试时直接使用 node --test 或 npm test,不加 timeout 前缀
|
|
58
61
|
```
|
|
59
62
|
|
|
60
63
|
### Phase 4 工作流程:交叉校验
|
|
61
64
|
|
|
62
65
|
**前置条件**: PM 已完成 spec.md / plan.md / tasks.md
|
|
63
66
|
|
|
64
|
-
1.
|
|
67
|
+
1. 调用 `prizmkit.analyze` skill(**不是 CLI 命令**,使用 Skill 工具或 `/prizmkit-analyze` 指令调用)
|
|
65
68
|
- 输入: spec.md, plan.md, tasks.md
|
|
66
69
|
- 6 个检测通道: 重复检测、歧义检测、不完整检测、Prizm 规则对齐、覆盖缺口、不一致性
|
|
67
70
|
- 输出: 一致性分析报告(仅对话输出)
|
|
71
|
+
- 若 Skill 工具不可用,则根据 6 个检测通道手动执行交叉一致性分析
|
|
68
72
|
2. 如发现 CRITICAL 问题,报告给 Coordinator 退回 PM 修复
|
|
69
73
|
3. 发送 COMPLETION_SIGNAL(含分析结果)
|
|
70
74
|
|
|
@@ -516,13 +516,6 @@ sys.exit(1)
|
|
|
516
516
|
return 0
|
|
517
517
|
fi
|
|
518
518
|
|
|
519
|
-
# Mark feature as in-progress before spawning session
|
|
520
|
-
python3 "$SCRIPTS_DIR/update-feature-status.py" \
|
|
521
|
-
--feature-list "$feature_list" \
|
|
522
|
-
--state-dir "$STATE_DIR" \
|
|
523
|
-
--feature-id "$feature_id" \
|
|
524
|
-
--action start >/dev/null 2>&1 || true
|
|
525
|
-
|
|
526
519
|
# Spawn AI CLI Session
|
|
527
520
|
echo ""
|
|
528
521
|
echo -e "${BOLD}════════════════════════════════════════════════════${NC}"
|
|
@@ -508,9 +508,32 @@ def main():
|
|
|
508
508
|
if args.template:
|
|
509
509
|
template_path = args.template
|
|
510
510
|
else:
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
511
|
+
# Determine pipeline mode to select the right tier template
|
|
512
|
+
_complexity = None
|
|
513
|
+
try:
|
|
514
|
+
_fl, _ = load_json_file(args.feature_list)
|
|
515
|
+
if _fl:
|
|
516
|
+
for _f in _fl.get("features", []):
|
|
517
|
+
if isinstance(_f, dict) and _f.get("id") == args.feature_id:
|
|
518
|
+
_complexity = _f.get("estimated_complexity", "medium")
|
|
519
|
+
break
|
|
520
|
+
except Exception:
|
|
521
|
+
pass
|
|
522
|
+
_mode = args.mode or determine_pipeline_mode(_complexity or "medium")
|
|
523
|
+
_tier_file_map = {
|
|
524
|
+
"lite": "bootstrap-tier1.md",
|
|
525
|
+
"standard": "bootstrap-tier2.md",
|
|
526
|
+
"full": "bootstrap-tier3.md",
|
|
527
|
+
}
|
|
528
|
+
_tier_file = _tier_file_map.get(_mode, "bootstrap-tier2.md")
|
|
529
|
+
_tier_path = os.path.join(script_dir, "..", "templates", _tier_file)
|
|
530
|
+
# Fall back to legacy monolithic template if tier file doesn't exist
|
|
531
|
+
if os.path.isfile(_tier_path):
|
|
532
|
+
template_path = _tier_path
|
|
533
|
+
else:
|
|
534
|
+
template_path = os.path.join(
|
|
535
|
+
script_dir, "..", "templates", "bootstrap-prompt.md"
|
|
536
|
+
)
|
|
514
537
|
|
|
515
538
|
# Load template
|
|
516
539
|
template_content, err = read_text_file(template_path)
|
|
@@ -1,273 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# DEPRECATED — bootstrap-prompt.md
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This file has been replaced by tier-specific templates:
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
- **Feature Title**: {{FEATURE_TITLE}}
|
|
9
|
-
- **Feature Slug**: {{FEATURE_SLUG}}
|
|
10
|
-
- **Complexity**: {{COMPLEXITY}} (mode: {{PIPELINE_MODE}})
|
|
11
|
-
- **Retry Count**: {{RETRY_COUNT}} / {{MAX_RETRIES}}
|
|
12
|
-
- **Previous Session Status**: {{PREV_SESSION_STATUS}}
|
|
13
|
-
- **Resume From Phase**: {{RESUME_PHASE}}
|
|
14
|
-
- **Init Status**: {{INIT_DONE}} | Artifacts: spec={{HAS_SPEC}} plan={{HAS_PLAN}} tasks={{HAS_TASKS}}
|
|
5
|
+
- `bootstrap-tier1.md` — Tier 1: Single Agent (complexity: low)
|
|
6
|
+
- `bootstrap-tier2.md` — Tier 2: Dual Agent (complexity: medium)
|
|
7
|
+
- `bootstrap-tier3.md` — Tier 3: Full Team (complexity: high)
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
You are the **session orchestrator**. Implement Feature {{FEATURE_ID}}: "{{FEATURE_TITLE}}".
|
|
19
|
-
|
|
20
|
-
**CRITICAL SESSION LIFECYCLE RULE**: You are the main session process. You MUST NOT exit until ALL work is complete and session-status.json is written. When you spawn subagents, you MUST **wait for each to finish** (run_in_background=false) before proceeding. Do NOT spawn an agent in the background and exit — that kills the session.
|
|
21
|
-
|
|
22
|
-
**MANDATORY TEAM REQUIREMENT**: You MUST use the `prizm-dev-team` multi-agent team to complete this feature. This is NON-NEGOTIABLE. You are FORBIDDEN from implementing the feature as a single agent — all work MUST be distributed through the prizm-dev-team members (PM, Dev, Reviewer). Specifically:
|
|
23
|
-
1. You MUST ensure a prizm-dev-team is available before starting any phase (see Step 1 below for reuse-or-create logic)
|
|
24
|
-
2. You MUST spawn PM, Dev, and Reviewer agents using the `Task` tool with `team_name` and `subagent_type` parameters
|
|
25
|
-
3. Every implementation, planning, and review phase MUST be executed by the appropriate team agent — NOT by you directly
|
|
26
|
-
4. If you attempt to do the work yourself without spawning team agents, the session is considered FAILED
|
|
27
|
-
|
|
28
|
-
### Team Definition Reference
|
|
29
|
-
|
|
30
|
-
The prizm-dev-team definition is maintained in the project at:
|
|
31
|
-
- **Source of truth**: `core/team/prizm-dev-team.json`
|
|
32
|
-
- **Installed team config (current platform)**: `{{TEAM_CONFIG_PATH}}`
|
|
33
|
-
- CodeBuddy: `~/.codebuddy/teams/prizm-dev-team/config.json` — full team config with members, may support reuse
|
|
34
|
-
- Claude Code: `.claude/team-info.json` — reference only (no native team system; agents are in `.claude/agents/`)
|
|
35
|
-
|
|
36
|
-
When creating a new team, use these files as reference for team member names, roles, agentTypes, and prompts.
|
|
37
|
-
|
|
38
|
-
### Feature Description
|
|
39
|
-
|
|
40
|
-
{{FEATURE_DESCRIPTION}}
|
|
41
|
-
|
|
42
|
-
### Acceptance Criteria
|
|
43
|
-
|
|
44
|
-
{{ACCEPTANCE_CRITERIA}}
|
|
45
|
-
|
|
46
|
-
### Dependencies (Already Completed)
|
|
47
|
-
|
|
48
|
-
{{COMPLETED_DEPENDENCIES}}
|
|
49
|
-
|
|
50
|
-
### App Global Context
|
|
51
|
-
|
|
52
|
-
{{GLOBAL_CONTEXT}}
|
|
53
|
-
|
|
54
|
-
## PrizmKit Directory Convention
|
|
55
|
-
|
|
56
|
-
**ALWAYS** use per-feature subdirectory `.prizmkit/specs/{{FEATURE_SLUG}}/`:
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
.prizmkit/specs/{{FEATURE_SLUG}}/spec.md
|
|
60
|
-
.prizmkit/specs/{{FEATURE_SLUG}}/plan.md
|
|
61
|
-
.prizmkit/specs/{{FEATURE_SLUG}}/tasks.md
|
|
62
|
-
.prizmkit/specs/REGISTRY.md
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Execution Instructions
|
|
66
|
-
|
|
67
|
-
**YOU are the orchestrator. Do NOT delegate to a Coordinator agent. Execute each phase yourself by spawning the appropriate team agent with run_in_background=false and waiting for its result.**
|
|
68
|
-
|
|
69
|
-
**TEAM ENFORCEMENT**: Every phase below that mentions spawning a PM/Dev/Reviewer agent MUST use the `Task` tool with the active team's `team_name`. You MUST NOT skip the team setup step or attempt to perform PM/Dev/Reviewer work yourself. Violation of this rule constitutes a session failure.
|
|
70
|
-
|
|
71
|
-
### Step 1: Initialize
|
|
72
|
-
|
|
73
|
-
#### Team Setup: Reuse or Create
|
|
74
|
-
|
|
75
|
-
Different AI CLI platforms have different team lifecycle behaviors. Some support reusing an existing team across sessions; others require creating a new team every time.
|
|
76
|
-
|
|
77
|
-
**Follow this logic to determine team availability:**
|
|
78
|
-
|
|
79
|
-
1. **Check if a team already exists and can be reused**:
|
|
80
|
-
- Read the team config file at `{{TEAM_CONFIG_PATH}}`
|
|
81
|
-
- If it exists and is valid (has members with correct agentTypes like `prizm-dev-team-pm`, `prizm-dev-team-dev`, `prizm-dev-team-reviewer`), try to reuse it
|
|
82
|
-
- Set `TEAM_REUSED=true` and record the `team_name` from the config
|
|
83
|
-
|
|
84
|
-
2. **If no reusable team exists, create a new one**:
|
|
85
|
-
- Reference the team definition at `core/team/prizm-dev-team.json` (source of truth for member roles and prompts)
|
|
86
|
-
- Call `TeamCreate` with `team_name="prizm-dev-team-{{FEATURE_ID}}"` and `description="Implementing {{FEATURE_TITLE}}"`
|
|
87
|
-
- Set `TEAM_REUSED=false`
|
|
88
|
-
|
|
89
|
-
3. **Record which path was taken** — this determines whether `TeamDelete` is needed at the end (only delete if you created; do NOT delete a reused team)
|
|
90
|
-
|
|
91
|
-
{{IF_FRESH_START}}
|
|
92
|
-
#### Initialize dev-team directories
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}
|
|
96
|
-
```
|
|
97
|
-
{{END_IF_FRESH_START}}
|
|
98
|
-
|
|
99
|
-
{{IF_RESUME}}
|
|
100
|
-
#### Resume Context
|
|
101
|
-
|
|
102
|
-
This is a **resume** from Phase {{RESUME_PHASE}}. After completing the team setup above:
|
|
103
|
-
1. Read artifacts in `.prizmkit/specs/{{FEATURE_SLUG}}/` (spec.md, plan.md, tasks.md)
|
|
104
|
-
2. Resume the pipeline from Phase {{RESUME_PHASE}} below
|
|
105
|
-
{{END_IF_RESUME}}
|
|
106
|
-
|
|
107
|
-
### Step 2: Pipeline Phases
|
|
108
|
-
|
|
109
|
-
{{IF_INIT_NEEDED}}
|
|
110
|
-
#### Phase 0: Project Bootstrap
|
|
111
|
-
- Run `prizmkit.init` (invoke the prizmkit-init skill)
|
|
112
|
-
- Run `python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
|
|
113
|
-
- **CP-0**: Verify `.prizm-docs/root.prizm`, `.prizmkit/config.json` exist
|
|
114
|
-
{{END_IF_INIT_NEEDED}}
|
|
115
|
-
{{IF_INIT_DONE}}
|
|
116
|
-
#### Phase 0: SKIP (already initialized)
|
|
117
|
-
{{END_IF_INIT_DONE}}
|
|
118
|
-
|
|
119
|
-
{{IF_MODE_LITE}}
|
|
120
|
-
#### Phase 1-3: Lightweight Planning (combined)
|
|
121
|
-
- Spawn PM agent (Task tool, subagent_type="prizm-dev-team-pm", run_in_background=false)
|
|
122
|
-
Prompt: "Read {{PM_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}), create a CONCISE implementation plan. Write:
|
|
123
|
-
1. `.prizmkit/specs/{{FEATURE_SLUG}}/plan.md` — brief architecture (under 100 lines): key components, data flow, file structure
|
|
124
|
-
2. `.prizmkit/specs/{{FEATURE_SLUG}}/tasks.md` — task checklist with `[ ]` checkboxes, each task = one implementable unit
|
|
125
|
-
Do NOT generate spec.md. Keep it minimal."
|
|
126
|
-
- **Wait for PM to return**
|
|
127
|
-
- **CP-1**: plan.md and tasks.md exist
|
|
128
|
-
|
|
129
|
-
#### Phase 4: SKIP (lite mode)
|
|
130
|
-
{{END_IF_MODE_LITE}}
|
|
131
|
-
|
|
132
|
-
{{IF_MODE_STANDARD}}
|
|
133
|
-
#### Phase 1-3: Specify + Plan + Tasks (combined, one PM session)
|
|
134
|
-
- Spawn PM agent (Task tool, subagent_type="prizm-dev-team-pm", run_in_background=false)
|
|
135
|
-
Prompt: "Read {{PM_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}), complete all three planning steps in this single session:
|
|
136
|
-
1. Run prizmkit-specify → generate `.prizmkit/specs/{{FEATURE_SLUG}}/spec.md` (concise, under 150 lines)
|
|
137
|
-
2. Run prizmkit-plan → generate `.prizmkit/specs/{{FEATURE_SLUG}}/plan.md` (architecture, components, interface design, data model, testing strategy — all in one file)
|
|
138
|
-
3. Run prizmkit-tasks → generate `.prizmkit/specs/{{FEATURE_SLUG}}/tasks.md` with `[ ]` checkboxes
|
|
139
|
-
All three files go under `.prizmkit/specs/{{FEATURE_SLUG}}/`."
|
|
140
|
-
- **Wait for PM to return**
|
|
141
|
-
- **CP-1**: spec.md, plan.md, and tasks.md all exist
|
|
142
|
-
|
|
143
|
-
#### Phase 4: Analyze (cross-check)
|
|
144
|
-
- Spawn Reviewer agent (Task tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false)
|
|
145
|
-
Prompt: "Read {{REVIEWER_SUBAGENT_PATH}}. Run prizmkit-analyze for feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}). Cross-check `.prizmkit/specs/{{FEATURE_SLUG}}/spec.md`, `plan.md`, and `tasks.md` for consistency. Report any CRITICAL or HIGH issues."
|
|
146
|
-
- **Wait for Reviewer to return**
|
|
147
|
-
- If CRITICAL issues found: spawn PM to fix, then re-run analyze (max 1 round)
|
|
148
|
-
- **CP-2**: No CRITICAL issues
|
|
149
|
-
{{END_IF_MODE_STANDARD}}
|
|
150
|
-
|
|
151
|
-
{{IF_MODE_FULL}}
|
|
152
|
-
#### Phase 1-3: Specify + Plan + Tasks (combined, one PM session)
|
|
153
|
-
- Spawn PM agent (Task tool, subagent_type="prizm-dev-team-pm", run_in_background=false)
|
|
154
|
-
Prompt: "Read {{PM_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}), complete all three planning steps in this single session:
|
|
155
|
-
1. Run prizmkit-specify → generate `.prizmkit/specs/{{FEATURE_SLUG}}/spec.md`. If there are `[NEEDS CLARIFICATION]` markers, run prizmkit-clarify to resolve them.
|
|
156
|
-
2. Run prizmkit-plan → generate `.prizmkit/specs/{{FEATURE_SLUG}}/plan.md` (architecture, components, interface design, data model, testing strategy, risk assessment — all in one file)
|
|
157
|
-
3. Run prizmkit-tasks → generate `.prizmkit/specs/{{FEATURE_SLUG}}/tasks.md` with `[ ]` checkboxes
|
|
158
|
-
All three files go under `.prizmkit/specs/{{FEATURE_SLUG}}/`."
|
|
159
|
-
- **Wait for PM to return**
|
|
160
|
-
- **CP-1**: spec.md, plan.md, and tasks.md all exist
|
|
161
|
-
|
|
162
|
-
#### Phase 4: Analyze (cross-check)
|
|
163
|
-
- Spawn Reviewer agent (Task tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false)
|
|
164
|
-
Prompt: "Read {{REVIEWER_SUBAGENT_PATH}}. Run prizmkit-analyze for feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}). Cross-check `.prizmkit/specs/{{FEATURE_SLUG}}/spec.md`, `plan.md`, and `tasks.md` for consistency. Report any CRITICAL or HIGH issues."
|
|
165
|
-
- **Wait for Reviewer to return**
|
|
166
|
-
- If CRITICAL issues found: spawn PM to fix, then re-run analyze (max 1 round)
|
|
167
|
-
- **CP-2**: No CRITICAL issues
|
|
168
|
-
{{END_IF_MODE_FULL}}
|
|
169
|
-
|
|
170
|
-
#### Phase 5: Schedule & Implement
|
|
171
|
-
- Read tasks from `.prizmkit/specs/{{FEATURE_SLUG}}/tasks.md`
|
|
172
|
-
- Create TaskList entries and assign to Dev agents
|
|
173
|
-
- Spawn Dev agent (Task tool, subagent_type="prizm-dev-team-dev", run_in_background=false)
|
|
174
|
-
Prompt: "Read {{DEV_SUBAGENT_PATH}}. Implement all tasks for feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}) using prizmkit-implement with TDD. Read the plan from `.prizmkit/specs/{{FEATURE_SLUG}}/plan.md` and tasks from `tasks.md`. Mark completed tasks [x] in tasks.md."
|
|
175
|
-
- **Wait for Dev to return**
|
|
176
|
-
- All tasks marked `[x]`, tests pass
|
|
177
|
-
|
|
178
|
-
#### Phase 6: Review
|
|
179
|
-
- Spawn Reviewer agent (Task tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false)
|
|
180
|
-
Prompt: "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
|
|
181
|
-
1. Run prizmkit-code-review for spec compliance and code quality
|
|
182
|
-
2. Write and execute integration tests covering all user stories from spec.md
|
|
183
|
-
Report verdict: PASS, PASS_WITH_WARNINGS, or NEEDS_FIXES."
|
|
184
|
-
- **Wait for Reviewer to return**
|
|
185
|
-
- If NEEDS_FIXES: spawn Dev to fix, then re-run Review (max 3 rounds)
|
|
186
|
-
- **CP-3**: Integration tests pass, review verdict is not NEEDS_FIXES
|
|
187
|
-
|
|
188
|
-
#### Phase 7: Summarize & Commit — DO NOT SKIP
|
|
189
|
-
|
|
190
|
-
**IMPORTANT**: Phase 7 is for **new feature** commits only. If this session is a bug fix to an existing feature, skip `prizmkit.summarize` (do NOT create new REGISTRY.md entries for bug fixes — bugs are refinements of incomplete features, not new functionality). Still run `prizmkit.committer` with `fix(<scope>):` prefix.
|
|
191
|
-
|
|
192
|
-
**7a.** Run `prizmkit.summarize` (invoke the prizmkit-summarize skill) → archive to REGISTRY.md
|
|
193
|
-
|
|
194
|
-
**7b.** BEFORE commit, mark current feature as completed in feature-list:
|
|
195
|
-
```bash
|
|
196
|
-
python3 {{VALIDATOR_SCRIPTS_DIR}}/update-feature-status.py \
|
|
197
|
-
--feature-list "{{FEATURE_LIST_PATH}}" \
|
|
198
|
-
--state-dir "{{PROJECT_ROOT}}/dev-pipeline/state" \
|
|
199
|
-
--feature-id "{{FEATURE_ID}}" \
|
|
200
|
-
--session-id "{{SESSION_ID}}" \
|
|
201
|
-
--action complete
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
**7c.** Run `prizmkit.committer` (invoke the prizmkit-committer skill) → `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`, do NOT push
|
|
205
|
-
|
|
206
|
-
### Step 3: Report Session Status
|
|
207
|
-
|
|
208
|
-
**CRITICAL**: Before this session ends, you MUST write the session status file.
|
|
209
|
-
|
|
210
|
-
Write to: `{{SESSION_STATUS_PATH}}`
|
|
211
|
-
|
|
212
|
-
```json
|
|
213
|
-
{
|
|
214
|
-
"session_id": "{{SESSION_ID}}",
|
|
215
|
-
"feature_id": "{{FEATURE_ID}}",
|
|
216
|
-
"feature_slug": "{{FEATURE_SLUG}}",
|
|
217
|
-
"status": "<success|partial|failed>",
|
|
218
|
-
"completed_phases": [0, 1, 2, 3, 4, 5, 6, 7],
|
|
219
|
-
"current_phase": 7,
|
|
220
|
-
"checkpoint_reached": "CP-3",
|
|
221
|
-
"tasks_completed": 12,
|
|
222
|
-
"tasks_total": 12,
|
|
223
|
-
"errors": [],
|
|
224
|
-
"can_resume": false,
|
|
225
|
-
"resume_from_phase": null,
|
|
226
|
-
"artifacts": {
|
|
227
|
-
"spec_path": ".prizmkit/specs/{{FEATURE_SLUG}}/spec.md",
|
|
228
|
-
"plan_path": ".prizmkit/specs/{{FEATURE_SLUG}}/plan.md",
|
|
229
|
-
"tasks_path": ".prizmkit/specs/{{FEATURE_SLUG}}/tasks.md"
|
|
230
|
-
},
|
|
231
|
-
"git_commit": "<commit hash if Phase 7 completed>",
|
|
232
|
-
"timestamp": "2026-03-04T10:00:00Z"
|
|
233
|
-
}
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
**Status values**: `success` (all phases done) | `partial` (can resume) | `failed` (unrecoverable)
|
|
237
|
-
|
|
238
|
-
If you encounter an error, still write session-status.json with status="failed" and error details.
|
|
239
|
-
|
|
240
|
-
### Step 4: Team Cleanup (conditional)
|
|
241
|
-
|
|
242
|
-
**Only if you CREATED the team in Step 1** (i.e. `TEAM_REUSED=false`), clean up:
|
|
243
|
-
```
|
|
244
|
-
TeamDelete
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
**If you REUSED an existing team** (i.e. `TEAM_REUSED=true`), do NOT call `TeamDelete` — the team is shared and may be used by other sessions.
|
|
248
|
-
|
|
249
|
-
## Critical Paths
|
|
250
|
-
|
|
251
|
-
| Resource | Path |
|
|
252
|
-
|----------|------|
|
|
253
|
-
| Team Definition (source of truth) | `core/team/prizm-dev-team.json` |
|
|
254
|
-
| Team Config (installed) | `{{TEAM_CONFIG_PATH}}` |
|
|
255
|
-
| Feature Artifacts Dir | `.prizmkit/specs/{{FEATURE_SLUG}}/` |
|
|
256
|
-
| PM Agent Def | {{PM_SUBAGENT_PATH}} |
|
|
257
|
-
| Dev Agent Def | {{DEV_SUBAGENT_PATH}} |
|
|
258
|
-
| Reviewer Agent Def | {{REVIEWER_SUBAGENT_PATH}} |
|
|
259
|
-
| Session Status Output | {{SESSION_STATUS_PATH}} |
|
|
260
|
-
| Project Root | {{PROJECT_ROOT}} |
|
|
261
|
-
| Feature List Path | {{FEATURE_LIST_PATH}} |
|
|
262
|
-
|
|
263
|
-
## Reminders
|
|
264
|
-
|
|
265
|
-
- **MANDATORY**: You MUST use `prizm-dev-team` (reuse existing or create new) — single-agent execution is FORBIDDEN
|
|
266
|
-
- **Team definition source**: `core/team/prizm-dev-team.json`; installed at `{{TEAM_CONFIG_PATH}}`
|
|
267
|
-
- **All artifacts go under `.prizmkit/specs/{{FEATURE_SLUG}}/`** — only 3 files: spec.md, plan.md, tasks.md
|
|
268
|
-
- Dev agents use TDD approach
|
|
269
|
-
- Phase 7 (summarize + commit) is MANDATORY
|
|
270
|
-
- ALWAYS write session-status.json before exiting
|
|
271
|
-
- **NEVER exit the session early** — wait for all spawned agents to complete
|
|
272
|
-
- Do NOT use `run_in_background=true` when spawning agents
|
|
273
|
-
- Only call `TeamDelete` if you created the team; do NOT delete a reused team
|
|
9
|
+
`generate-bootstrap-prompt.py` selects the correct file automatically based on `estimated_complexity`.
|
|
10
|
+
This file is kept as a fallback only — if none of the tier files exist, the script falls back to this path.
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Dev-Pipeline Session Bootstrap — Tier 1 (Single Agent)
|
|
2
|
+
|
|
3
|
+
## Session Context
|
|
4
|
+
|
|
5
|
+
- **Feature ID**: {{FEATURE_ID}} | **Session**: {{SESSION_ID}} | **Run**: {{RUN_ID}}
|
|
6
|
+
- **Complexity**: {{COMPLEXITY}} | **Retry**: {{RETRY_COUNT}} / {{MAX_RETRIES}}
|
|
7
|
+
- **Previous Status**: {{PREV_SESSION_STATUS}} | **Resume From**: {{RESUME_PHASE}}
|
|
8
|
+
- **Init**: {{INIT_DONE}} | Artifacts: spec={{HAS_SPEC}} plan={{HAS_PLAN}} tasks={{HAS_TASKS}}
|
|
9
|
+
|
|
10
|
+
## Your Mission
|
|
11
|
+
|
|
12
|
+
You are the **session orchestrator**. Implement Feature {{FEATURE_ID}}: "{{FEATURE_TITLE}}".
|
|
13
|
+
|
|
14
|
+
**CRITICAL**: You MUST NOT exit until ALL work is complete and session-status.json is written.
|
|
15
|
+
|
|
16
|
+
**Tier 1 — Single Agent**: You handle everything directly. No subagents, no TeamCreate.
|
|
17
|
+
|
|
18
|
+
### Feature Description
|
|
19
|
+
|
|
20
|
+
{{FEATURE_DESCRIPTION}}
|
|
21
|
+
|
|
22
|
+
### Acceptance Criteria
|
|
23
|
+
|
|
24
|
+
{{ACCEPTANCE_CRITERIA}}
|
|
25
|
+
|
|
26
|
+
### Dependencies (Already Completed)
|
|
27
|
+
|
|
28
|
+
{{COMPLETED_DEPENDENCIES}}
|
|
29
|
+
|
|
30
|
+
### App Global Context
|
|
31
|
+
|
|
32
|
+
{{GLOBAL_CONTEXT}}
|
|
33
|
+
|
|
34
|
+
## PrizmKit Directory Convention
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md
|
|
38
|
+
.prizmkit/specs/{{FEATURE_SLUG}}/plan.md
|
|
39
|
+
.prizmkit/specs/{{FEATURE_SLUG}}/tasks.md
|
|
40
|
+
.prizmkit/specs/REGISTRY.md
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Execution
|
|
46
|
+
|
|
47
|
+
{{IF_INIT_NEEDED}}
|
|
48
|
+
### Phase 0: Project Bootstrap
|
|
49
|
+
- Run `prizmkit.init` (invoke the prizmkit-init skill)
|
|
50
|
+
- Run `python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
|
|
51
|
+
- **CP-0**: Verify `.prizm-docs/root.prizm`, `.prizmkit/config.json` exist
|
|
52
|
+
{{END_IF_INIT_NEEDED}}
|
|
53
|
+
{{IF_INIT_DONE}}
|
|
54
|
+
### Phase 0: SKIP (already initialized)
|
|
55
|
+
{{END_IF_INIT_DONE}}
|
|
56
|
+
|
|
57
|
+
{{IF_RESUME}}
|
|
58
|
+
### Resume from Phase {{RESUME_PHASE}}
|
|
59
|
+
Check `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — if it exists, skip Phase 1 and use it directly.
|
|
60
|
+
{{END_IF_RESUME}}
|
|
61
|
+
|
|
62
|
+
### Phase 1: Build Context Snapshot
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
ls .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md 2>/dev/null && echo "EXISTS" || echo "MISSING"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
If MISSING — build it now:
|
|
69
|
+
1. Read `.prizm-docs/root.prizm` and relevant L1 prizm docs
|
|
70
|
+
2. Scan `src/` for files related to this feature; read each one
|
|
71
|
+
3. Write `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
|
|
72
|
+
- **Section 1 — Feature Brief**: feature description + acceptance criteria (copy from above)
|
|
73
|
+
- **Section 2 — Project Structure**: output of relevant `ls src/` calls
|
|
74
|
+
- **Section 3 — Prizm Context**: content of root.prizm and relevant L1/L2 docs
|
|
75
|
+
- **Section 4 — Existing Source Files**: full content of each related file as code block
|
|
76
|
+
- **Section 5 — Existing Tests**: full content of related test files as code block
|
|
77
|
+
|
|
78
|
+
### Phase 2: Plan & Tasks
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
ls .prizmkit/specs/{{FEATURE_SLUG}}/ 2>/dev/null
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
If plan.md or tasks.md missing, write them directly (no PM needed):
|
|
85
|
+
- `plan.md`: key components, data flow, files to create/modify (under 80 lines)
|
|
86
|
+
- `tasks.md`: checklist with `[ ]` checkboxes, each task = one implementable unit
|
|
87
|
+
|
|
88
|
+
**CP-1**: plan.md and tasks.md exist.
|
|
89
|
+
|
|
90
|
+
### Phase 3: Implement
|
|
91
|
+
|
|
92
|
+
For each task in tasks.md:
|
|
93
|
+
1. Read the relevant section from `context-snapshot.md` (no need to re-read individual files)
|
|
94
|
+
2. Write/edit the code
|
|
95
|
+
3. Run tests after each task
|
|
96
|
+
4. Mark task `[x]` in tasks.md immediately
|
|
97
|
+
|
|
98
|
+
After all tasks complete, append to `context-snapshot.md`:
|
|
99
|
+
```
|
|
100
|
+
## Implementation Log
|
|
101
|
+
Files changed/created: [list]
|
|
102
|
+
Key decisions: [list]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Phase 4: Self-Review
|
|
106
|
+
|
|
107
|
+
1. Re-read acceptance criteria from Section 1 of context-snapshot.md
|
|
108
|
+
2. Run the full test suite
|
|
109
|
+
3. Check error handling and edge cases
|
|
110
|
+
4. Fix any issues found
|
|
111
|
+
|
|
112
|
+
**CP-2**: All acceptance criteria met, tests pass.
|
|
113
|
+
|
|
114
|
+
### Phase 5: Commit
|
|
115
|
+
|
|
116
|
+
- Run `prizmkit.summarize` → archive to REGISTRY.md
|
|
117
|
+
- Mark feature complete:
|
|
118
|
+
```bash
|
|
119
|
+
python3 {{VALIDATOR_SCRIPTS_DIR}}/update-feature-status.py \
|
|
120
|
+
--feature-list "{{FEATURE_LIST_PATH}}" \
|
|
121
|
+
--state-dir "{{PROJECT_ROOT}}/dev-pipeline/state" \
|
|
122
|
+
--feature-id "{{FEATURE_ID}}" --session-id "{{SESSION_ID}}" --action complete
|
|
123
|
+
```
|
|
124
|
+
- Run `prizmkit.committer` → `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`, do NOT push
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Step 3: Write Session Status
|
|
129
|
+
|
|
130
|
+
Write to: `{{SESSION_STATUS_PATH}}`
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"session_id": "{{SESSION_ID}}",
|
|
135
|
+
"feature_id": "{{FEATURE_ID}}",
|
|
136
|
+
"feature_slug": "{{FEATURE_SLUG}}",
|
|
137
|
+
"exec_tier": 1,
|
|
138
|
+
"status": "<success|partial|failed>",
|
|
139
|
+
"completed_phases": [0, 1, 2, 3, 4, 5],
|
|
140
|
+
"current_phase": 5,
|
|
141
|
+
"checkpoint_reached": "CP-2",
|
|
142
|
+
"tasks_completed": 0,
|
|
143
|
+
"tasks_total": 0,
|
|
144
|
+
"errors": [],
|
|
145
|
+
"can_resume": false,
|
|
146
|
+
"resume_from_phase": null,
|
|
147
|
+
"artifacts": {
|
|
148
|
+
"context_snapshot_path": ".prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md",
|
|
149
|
+
"plan_path": ".prizmkit/specs/{{FEATURE_SLUG}}/plan.md",
|
|
150
|
+
"tasks_path": ".prizmkit/specs/{{FEATURE_SLUG}}/tasks.md"
|
|
151
|
+
},
|
|
152
|
+
"git_commit": "<commit hash>",
|
|
153
|
+
"timestamp": "2026-03-04T10:00:00Z"
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Critical Paths
|
|
158
|
+
|
|
159
|
+
| Resource | Path |
|
|
160
|
+
|----------|------|
|
|
161
|
+
| Feature Artifacts Dir | `.prizmkit/specs/{{FEATURE_SLUG}}/` |
|
|
162
|
+
| Context Snapshot | `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` |
|
|
163
|
+
| Session Status Output | {{SESSION_STATUS_PATH}} |
|
|
164
|
+
| Project Root | {{PROJECT_ROOT}} |
|
|
165
|
+
|
|
166
|
+
## Reminders
|
|
167
|
+
|
|
168
|
+
- Tier 1: you do everything — no subagents, no TeamCreate
|
|
169
|
+
- Build context-snapshot.md FIRST; use it throughout instead of re-reading files
|
|
170
|
+
- ALWAYS write session-status.json before exiting
|
|
171
|
+
- `prizmkit.committer` is mandatory — do NOT skip the commit phase
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# Dev-Pipeline Session Bootstrap — Tier 2 (Dual Agent)
|
|
2
|
+
|
|
3
|
+
## Session Context
|
|
4
|
+
|
|
5
|
+
- **Feature ID**: {{FEATURE_ID}} | **Session**: {{SESSION_ID}} | **Run**: {{RUN_ID}}
|
|
6
|
+
- **Complexity**: {{COMPLEXITY}} | **Retry**: {{RETRY_COUNT}} / {{MAX_RETRIES}}
|
|
7
|
+
- **Previous Status**: {{PREV_SESSION_STATUS}} | **Resume From**: {{RESUME_PHASE}}
|
|
8
|
+
- **Init**: {{INIT_DONE}} | Artifacts: spec={{HAS_SPEC}} plan={{HAS_PLAN}} tasks={{HAS_TASKS}}
|
|
9
|
+
|
|
10
|
+
## Your Mission
|
|
11
|
+
|
|
12
|
+
You are the **session orchestrator**. Implement Feature {{FEATURE_ID}}: "{{FEATURE_TITLE}}".
|
|
13
|
+
|
|
14
|
+
**CRITICAL**: You MUST NOT exit until ALL work is complete and session-status.json is written. When you spawn subagents, wait for each to finish (run_in_background=false).
|
|
15
|
+
|
|
16
|
+
**Tier 2 — Dual Agent**: You handle context + planning directly. Then spawn Dev and Reviewer subagents. No TeamCreate required.
|
|
17
|
+
|
|
18
|
+
### Feature Description
|
|
19
|
+
|
|
20
|
+
{{FEATURE_DESCRIPTION}}
|
|
21
|
+
|
|
22
|
+
### Acceptance Criteria
|
|
23
|
+
|
|
24
|
+
{{ACCEPTANCE_CRITERIA}}
|
|
25
|
+
|
|
26
|
+
### Dependencies (Already Completed)
|
|
27
|
+
|
|
28
|
+
{{COMPLETED_DEPENDENCIES}}
|
|
29
|
+
|
|
30
|
+
### App Global Context
|
|
31
|
+
|
|
32
|
+
{{GLOBAL_CONTEXT}}
|
|
33
|
+
|
|
34
|
+
## PrizmKit Directory Convention
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md ← written by you, read by Dev + Reviewer
|
|
38
|
+
.prizmkit/specs/{{FEATURE_SLUG}}/plan.md
|
|
39
|
+
.prizmkit/specs/{{FEATURE_SLUG}}/tasks.md
|
|
40
|
+
.prizmkit/specs/REGISTRY.md
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**`context-snapshot.md`** is the shared knowledge base. You write it once; Dev and Reviewer read it instead of re-scanning individual files.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Subagent Timeout Recovery
|
|
48
|
+
|
|
49
|
+
If a subagent times out:
|
|
50
|
+
1. `ls .prizmkit/specs/{{FEATURE_SLUG}}/` — check what exists
|
|
51
|
+
2. Re-spawn with: `"Read .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md for full context. Do NOT re-read individual source files."` + only remaining steps + `model: "lite"`
|
|
52
|
+
3. Max 2 retries. After 2 failures, complete the work yourself.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Execution
|
|
57
|
+
|
|
58
|
+
{{IF_INIT_NEEDED}}
|
|
59
|
+
### Phase 0: Project Bootstrap
|
|
60
|
+
- Run `prizmkit.init` (invoke the prizmkit-init skill)
|
|
61
|
+
- Run `python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
|
|
62
|
+
- **CP-0**: Verify `.prizm-docs/root.prizm`, `.prizmkit/config.json` exist
|
|
63
|
+
{{END_IF_INIT_NEEDED}}
|
|
64
|
+
{{IF_INIT_DONE}}
|
|
65
|
+
### Phase 0: SKIP (already initialized)
|
|
66
|
+
{{END_IF_INIT_DONE}}
|
|
67
|
+
|
|
68
|
+
{{IF_RESUME}}
|
|
69
|
+
### Resume from Phase {{RESUME_PHASE}}
|
|
70
|
+
Check `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — if exists, skip Phase 1 and proceed to Phase {{RESUME_PHASE}}.
|
|
71
|
+
{{END_IF_RESUME}}
|
|
72
|
+
|
|
73
|
+
### Phase 1: Build Context Snapshot (you, the orchestrator)
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
ls .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md 2>/dev/null && echo "EXISTS" || echo "MISSING"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
If MISSING — build it now:
|
|
80
|
+
1. Read `.prizm-docs/root.prizm` and relevant L1/L2 prizm docs
|
|
81
|
+
2. Scan `src/` for files related to this feature; read each one
|
|
82
|
+
3. Write `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
|
|
83
|
+
- **Section 1 — Feature Brief**: feature description + acceptance criteria (copy from above)
|
|
84
|
+
- **Section 2 — Project Structure**: relevant `ls src/` output
|
|
85
|
+
- **Section 3 — Prizm Context**: full content of root.prizm and relevant L1/L2 docs
|
|
86
|
+
- **Section 4 — Existing Source Files**: full content of each related file as code block
|
|
87
|
+
- **Section 5 — Existing Tests**: full content of related test files as code blocks
|
|
88
|
+
|
|
89
|
+
### Phase 2: Plan & Tasks (you, the orchestrator)
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
ls .prizmkit/specs/{{FEATURE_SLUG}}/plan.md .prizmkit/specs/{{FEATURE_SLUG}}/tasks.md 2>/dev/null
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
If either missing, write them yourself:
|
|
96
|
+
- `plan.md`: architecture — components, interfaces, data flow, files to create/modify, testing approach
|
|
97
|
+
- `tasks.md`: checklist with `[ ]` checkboxes ordered by dependency
|
|
98
|
+
|
|
99
|
+
**CP-1**: plan.md and tasks.md exist.
|
|
100
|
+
|
|
101
|
+
### Phase 3: Implement — Dev Subagent
|
|
102
|
+
|
|
103
|
+
Spawn Dev subagent (Task tool, subagent_type="prizm-dev-team-dev", run_in_background=false).
|
|
104
|
+
|
|
105
|
+
Prompt:
|
|
106
|
+
> "Read {{DEV_SUBAGENT_PATH}}. Implement feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
|
|
107
|
+
>
|
|
108
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — all project context, source files, and tests are embedded there. Do NOT re-read individual source files.
|
|
109
|
+
> 2. Read `.prizmkit/specs/{{FEATURE_SLUG}}/plan.md` and `.prizmkit/specs/{{FEATURE_SLUG}}/tasks.md`.
|
|
110
|
+
> 3. Implement task-by-task using TDD. Mark each task `[x]` in tasks.md immediately after completion.
|
|
111
|
+
> 4. After ALL tasks complete, append an 'Implementation Log' section to `context-snapshot.md`:
|
|
112
|
+
> - Files created/modified (with paths)
|
|
113
|
+
> - Key implementation decisions
|
|
114
|
+
> - Any deviations from plan.md
|
|
115
|
+
> Do NOT exit until all tasks are [x] and the Implementation Log is written."
|
|
116
|
+
|
|
117
|
+
Wait for Dev to return. All tasks must be `[x]`, tests pass.
|
|
118
|
+
|
|
119
|
+
### Phase 4: Review — Reviewer Subagent
|
|
120
|
+
|
|
121
|
+
Spawn Reviewer subagent (Task tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false).
|
|
122
|
+
|
|
123
|
+
Prompt:
|
|
124
|
+
> "Read {{REVIEWER_SUBAGENT_PATH}}. Review feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
|
|
125
|
+
>
|
|
126
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST:
|
|
127
|
+
> - Section 1: acceptance criteria to verify against
|
|
128
|
+
> - Section 4: original source files (before changes)
|
|
129
|
+
> - 'Implementation Log': what Dev changed
|
|
130
|
+
> 2. Run prizmkit-code-review: verify all acceptance criteria, check code quality and correctness. Only read files mentioned in the Implementation Log.
|
|
131
|
+
> 3. Run the test suite and report results.
|
|
132
|
+
> 4. Append a 'Review Notes' section to `context-snapshot.md`: issues found (severity), test results, final verdict.
|
|
133
|
+
> Report verdict: PASS, PASS_WITH_WARNINGS, or NEEDS_FIXES."
|
|
134
|
+
|
|
135
|
+
Wait for Reviewer to return.
|
|
136
|
+
- If NEEDS_FIXES: spawn Dev to fix (Dev reads updated snapshot), re-run Review (max 3 rounds)
|
|
137
|
+
|
|
138
|
+
**CP-2**: Tests pass, verdict is not NEEDS_FIXES.
|
|
139
|
+
|
|
140
|
+
### Phase 5: Commit
|
|
141
|
+
|
|
142
|
+
- Run `prizmkit.summarize` → archive to REGISTRY.md
|
|
143
|
+
- Mark feature complete:
|
|
144
|
+
```bash
|
|
145
|
+
python3 {{VALIDATOR_SCRIPTS_DIR}}/update-feature-status.py \
|
|
146
|
+
--feature-list "{{FEATURE_LIST_PATH}}" \
|
|
147
|
+
--state-dir "{{PROJECT_ROOT}}/dev-pipeline/state" \
|
|
148
|
+
--feature-id "{{FEATURE_ID}}" --session-id "{{SESSION_ID}}" --action complete
|
|
149
|
+
```
|
|
150
|
+
- Run `prizmkit.committer` → `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`, do NOT push
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Step 3: Write Session Status
|
|
155
|
+
|
|
156
|
+
Write to: `{{SESSION_STATUS_PATH}}`
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"session_id": "{{SESSION_ID}}",
|
|
161
|
+
"feature_id": "{{FEATURE_ID}}",
|
|
162
|
+
"feature_slug": "{{FEATURE_SLUG}}",
|
|
163
|
+
"exec_tier": 2,
|
|
164
|
+
"status": "<success|partial|failed>",
|
|
165
|
+
"completed_phases": [0, 1, 2, 3, 4, 5],
|
|
166
|
+
"current_phase": 5,
|
|
167
|
+
"checkpoint_reached": "CP-2",
|
|
168
|
+
"tasks_completed": 0,
|
|
169
|
+
"tasks_total": 0,
|
|
170
|
+
"errors": [],
|
|
171
|
+
"can_resume": false,
|
|
172
|
+
"resume_from_phase": null,
|
|
173
|
+
"artifacts": {
|
|
174
|
+
"context_snapshot_path": ".prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md",
|
|
175
|
+
"plan_path": ".prizmkit/specs/{{FEATURE_SLUG}}/plan.md",
|
|
176
|
+
"tasks_path": ".prizmkit/specs/{{FEATURE_SLUG}}/tasks.md"
|
|
177
|
+
},
|
|
178
|
+
"git_commit": "<commit hash>",
|
|
179
|
+
"timestamp": "2026-03-04T10:00:00Z"
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Critical Paths
|
|
184
|
+
|
|
185
|
+
| Resource | Path |
|
|
186
|
+
|----------|------|
|
|
187
|
+
| Feature Artifacts Dir | `.prizmkit/specs/{{FEATURE_SLUG}}/` |
|
|
188
|
+
| Context Snapshot | `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` |
|
|
189
|
+
| Dev Agent Def | {{DEV_SUBAGENT_PATH}} |
|
|
190
|
+
| Reviewer Agent Def | {{REVIEWER_SUBAGENT_PATH}} |
|
|
191
|
+
| Session Status Output | {{SESSION_STATUS_PATH}} |
|
|
192
|
+
| Project Root | {{PROJECT_ROOT}} |
|
|
193
|
+
|
|
194
|
+
## Reminders
|
|
195
|
+
|
|
196
|
+
- Tier 2: orchestrator builds context+plan, Dev implements, Reviewer reviews — no TeamCreate
|
|
197
|
+
- Build context-snapshot.md FIRST; all subagents read it instead of re-reading source files
|
|
198
|
+
- Do NOT use `run_in_background=true` when spawning subagents
|
|
199
|
+
- ALWAYS write session-status.json before exiting
|
|
200
|
+
- `prizmkit.committer` is mandatory
|
|
201
|
+
- On timeout: check snapshot → model:lite → remaining steps only → max 2 retries → orchestrator fallback
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
# Dev-Pipeline Session Bootstrap — Tier 3 (Full Team)
|
|
2
|
+
|
|
3
|
+
## Session Context
|
|
4
|
+
|
|
5
|
+
- **Feature ID**: {{FEATURE_ID}} | **Session**: {{SESSION_ID}} | **Run**: {{RUN_ID}}
|
|
6
|
+
- **Complexity**: {{COMPLEXITY}} | **Retry**: {{RETRY_COUNT}} / {{MAX_RETRIES}}
|
|
7
|
+
- **Previous Status**: {{PREV_SESSION_STATUS}} | **Resume From**: {{RESUME_PHASE}}
|
|
8
|
+
- **Init**: {{INIT_DONE}} | Artifacts: spec={{HAS_SPEC}} plan={{HAS_PLAN}} tasks={{HAS_TASKS}}
|
|
9
|
+
|
|
10
|
+
## Your Mission
|
|
11
|
+
|
|
12
|
+
You are the **session orchestrator**. Implement Feature {{FEATURE_ID}}: "{{FEATURE_TITLE}}".
|
|
13
|
+
|
|
14
|
+
**CRITICAL**: You MUST NOT exit until ALL work is complete and session-status.json is written. When you spawn subagents, wait for each to finish (run_in_background=false). Do NOT spawn agents in background and exit — that kills the session.
|
|
15
|
+
|
|
16
|
+
**Tier 3 — Full Team**: PM + Dev + Reviewer agents spawned directly via Task tool. Full 7-phase pipeline.
|
|
17
|
+
|
|
18
|
+
### Feature Description
|
|
19
|
+
|
|
20
|
+
{{FEATURE_DESCRIPTION}}
|
|
21
|
+
|
|
22
|
+
### Acceptance Criteria
|
|
23
|
+
|
|
24
|
+
{{ACCEPTANCE_CRITERIA}}
|
|
25
|
+
|
|
26
|
+
### Dependencies (Already Completed)
|
|
27
|
+
|
|
28
|
+
{{COMPLETED_DEPENDENCIES}}
|
|
29
|
+
|
|
30
|
+
### App Global Context
|
|
31
|
+
|
|
32
|
+
{{GLOBAL_CONTEXT}}
|
|
33
|
+
|
|
34
|
+
## PrizmKit Directory Convention
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md ← PM writes, all agents read
|
|
38
|
+
.prizmkit/specs/{{FEATURE_SLUG}}/spec.md
|
|
39
|
+
.prizmkit/specs/{{FEATURE_SLUG}}/plan.md
|
|
40
|
+
.prizmkit/specs/{{FEATURE_SLUG}}/tasks.md
|
|
41
|
+
.prizmkit/specs/REGISTRY.md
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**`context-snapshot.md`** is the shared knowledge base. PM writes it once; Dev and Reviewer read it instead of re-scanning source files. This eliminates redundant I/O across all agents.
|
|
45
|
+
|
|
46
|
+
### Agent Files
|
|
47
|
+
- PM Agent: `{{PM_SUBAGENT_PATH}}`
|
|
48
|
+
- Dev Agent: `{{DEV_SUBAGENT_PATH}}`
|
|
49
|
+
- Reviewer Agent: `{{REVIEWER_SUBAGENT_PATH}}`
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Subagent Timeout Recovery
|
|
54
|
+
|
|
55
|
+
If any agent times out:
|
|
56
|
+
1. `ls .prizmkit/specs/{{FEATURE_SLUG}}/` — check what exists
|
|
57
|
+
2. If `context-snapshot.md` exists: open recovery prompt with `"Read .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md for full context. Do NOT re-read individual source files."` + only remaining steps + `model: "lite"`
|
|
58
|
+
3. Max 2 retries per phase. After 2 failures, orchestrator completes the work directly and appends a Recovery Note to context-snapshot.md.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Execution
|
|
63
|
+
|
|
64
|
+
{{IF_INIT_NEEDED}}
|
|
65
|
+
### Phase 0: Project Bootstrap
|
|
66
|
+
- Run `prizmkit.init` (invoke the prizmkit-init skill)
|
|
67
|
+
- Run `python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
|
|
68
|
+
- **CP-0**: Verify `.prizm-docs/root.prizm`, `.prizmkit/config.json` exist
|
|
69
|
+
{{END_IF_INIT_NEEDED}}
|
|
70
|
+
{{IF_INIT_DONE}}
|
|
71
|
+
### Phase 0: Record Test Baseline & Detect Test Command
|
|
72
|
+
|
|
73
|
+
**Step 1 — Detect the correct test command** (run once, save as `TEST_CMD`):
|
|
74
|
+
```bash
|
|
75
|
+
# Try in order, use the first one that exits 0
|
|
76
|
+
node --test tests/**/*.test.js 2>&1 | tail -3 # Node built-in
|
|
77
|
+
npm test 2>&1 | tail -3 # npm script fallback
|
|
78
|
+
```
|
|
79
|
+
Record the working command as `TEST_CMD`. If both fail, record `TEST_CMD="npm test"` as default.
|
|
80
|
+
|
|
81
|
+
**Step 2 — Record pre-existing failure baseline**:
|
|
82
|
+
```bash
|
|
83
|
+
$TEST_CMD 2>&1 | tail -20
|
|
84
|
+
```
|
|
85
|
+
Save the list of **pre-existing failing tests** (if any) as `BASELINE_FAILURES`. These are known failures that existed before this session — Dev must NOT be blamed for them, but must list them in COMPLETION_SIGNAL.
|
|
86
|
+
{{END_IF_INIT_DONE}}
|
|
87
|
+
|
|
88
|
+
### Step 1: Team Setup
|
|
89
|
+
|
|
90
|
+
No TeamCreate required. Agents are spawned directly via the `Task` tool using `subagent_type`.
|
|
91
|
+
|
|
92
|
+
1. Run init script:
|
|
93
|
+
`python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
|
|
94
|
+
|
|
95
|
+
2. Check for existing artifacts:
|
|
96
|
+
`ls .prizmkit/specs/{{FEATURE_SLUG}}/ 2>/dev/null`
|
|
97
|
+
|
|
98
|
+
Agent files are at:
|
|
99
|
+
- PM: `{{PM_SUBAGENT_PATH}}`
|
|
100
|
+
- Dev: `{{DEV_SUBAGENT_PATH}}`
|
|
101
|
+
- Reviewer: `{{REVIEWER_SUBAGENT_PATH}}`
|
|
102
|
+
|
|
103
|
+
{{IF_FRESH_START}}
|
|
104
|
+
```bash
|
|
105
|
+
python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}
|
|
106
|
+
```
|
|
107
|
+
{{END_IF_FRESH_START}}
|
|
108
|
+
|
|
109
|
+
{{IF_RESUME}}
|
|
110
|
+
### Resume from Phase {{RESUME_PHASE}}
|
|
111
|
+
After team setup: check `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — if exists, all agents MUST use it. Read existing artifacts and resume from Phase {{RESUME_PHASE}}.
|
|
112
|
+
{{END_IF_RESUME}}
|
|
113
|
+
|
|
114
|
+
### Phase 1-3: Specify + Plan + Tasks — PM Agent
|
|
115
|
+
|
|
116
|
+
Check existing artifacts first:
|
|
117
|
+
```bash
|
|
118
|
+
ls .prizmkit/specs/{{FEATURE_SLUG}}/ 2>/dev/null
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
- All three (spec.md, plan.md, tasks.md) exist → **SKIP to CP-1**
|
|
122
|
+
- `context-snapshot.md` exists → PM reads it instead of re-scanning source files
|
|
123
|
+
- Some missing → PM generates only missing files
|
|
124
|
+
|
|
125
|
+
Before spawning PM, check whether feature code already exists in the project:
|
|
126
|
+
```bash
|
|
127
|
+
grep -r "{{FEATURE_SLUG}}" src/ --include="*.js" --include="*.ts" -l 2>/dev/null | head -20
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Record result as `EXISTING_CODE` (list of files, or empty). Pass this to PM prompt below.
|
|
131
|
+
|
|
132
|
+
Spawn PM agent (Task tool, subagent_type="prizm-dev-team-pm", run_in_background=false).
|
|
133
|
+
|
|
134
|
+
**Construct prompt dynamically** — always prefix with:
|
|
135
|
+
> "Read {{PM_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}), complete the following IN THIS SINGLE SESSION — do NOT exit until ALL listed steps are done and files are written to disk:"
|
|
136
|
+
|
|
137
|
+
If `EXISTING_CODE` is non-empty, append to prefix:
|
|
138
|
+
> "NOTE: The following files related to this feature already exist in the codebase: `<EXISTING_CODE list>`. Your spec/plan/tasks must reflect this existing implementation — document what exists, identify gaps, do NOT re-implement what is already done."
|
|
139
|
+
|
|
140
|
+
**Step A — Build Context Snapshot** (include only if `context-snapshot.md` does NOT exist):
|
|
141
|
+
> "Step A: Write `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`. This is the team knowledge base — complete it before anything else. Include:
|
|
142
|
+
> - Section 1 'Feature Brief': feature description and acceptance criteria
|
|
143
|
+
> - Section 2 'Project Structure': output of `ls src/` and relevant subdirectories
|
|
144
|
+
> - Section 3 'Prizm Context': full content of `.prizm-docs/root.prizm` and relevant L1/L2 docs
|
|
145
|
+
> - Section 4 'Existing Source Files': full content of every related source file as a code block
|
|
146
|
+
> - Section 5 'Existing Tests': full content of related test files as code blocks
|
|
147
|
+
> Confirm with `ls .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`."
|
|
148
|
+
|
|
149
|
+
**Step B — Planning Artifacts** (include only missing files):
|
|
150
|
+
- spec.md missing: "Run prizmkit-specify → generate spec.md. Resolve any `[NEEDS CLARIFICATION]` markers using the feature description — do NOT pause for interactive input."
|
|
151
|
+
- plan.md missing: "Run prizmkit-plan → generate plan.md (architecture, components, interface design, data model, testing strategy, risk assessment — all in one file)"
|
|
152
|
+
- tasks.md missing: "Run prizmkit-tasks → generate tasks.md with `[ ]` checkboxes"
|
|
153
|
+
|
|
154
|
+
> "All files go under `.prizmkit/specs/{{FEATURE_SLUG}}/`. Confirm each with `ls` after writing."
|
|
155
|
+
|
|
156
|
+
Wait for PM to return. **CP-1**: All three files exist. If missing, diagnose from PM output — do NOT spawn another PM blindly.
|
|
157
|
+
|
|
158
|
+
### Phase 4: Analyze — Reviewer Agent
|
|
159
|
+
|
|
160
|
+
Spawn Reviewer agent (Task tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false).
|
|
161
|
+
|
|
162
|
+
Prompt:
|
|
163
|
+
> "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
|
|
164
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — all source files and project context are there. Do NOT re-read individual source files.
|
|
165
|
+
> 2. Run prizmkit-analyze: cross-check `spec.md`, `plan.md`, and `tasks.md` for consistency.
|
|
166
|
+
> 3. Before flagging CRITICAL or HIGH issues, verify each against Section 4 of the snapshot. Do NOT report based on incomplete information.
|
|
167
|
+
> Report: CRITICAL, HIGH, MEDIUM issues found (or 'No issues found')."
|
|
168
|
+
|
|
169
|
+
Wait for Reviewer to return.
|
|
170
|
+
- If CRITICAL issues found: spawn PM to fix — use this prompt:
|
|
171
|
+
> "Read {{PM_SUBAGENT_PATH}}. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST for full project context. Do NOT re-read individual source files. Fix ONLY the following CRITICAL issues in spec.md/plan.md/tasks.md: `<list issues>`. Do NOT exit until all files are updated."
|
|
172
|
+
Then re-run analyze (max 1 round).
|
|
173
|
+
|
|
174
|
+
**CP-2**: No CRITICAL issues.
|
|
175
|
+
|
|
176
|
+
### Phase 5: Implement — Dev Agent
|
|
177
|
+
|
|
178
|
+
Before spawning Dev, check tasks.md:
|
|
179
|
+
```bash
|
|
180
|
+
grep -c '^\- \[ \]' .prizmkit/specs/{{FEATURE_SLUG}}/tasks.md 2>/dev/null || echo 0
|
|
181
|
+
```
|
|
182
|
+
- If result is `0` (all tasks already `[x]`) → **SKIP Phase 5**, go directly to Phase 6. Do NOT spawn Dev.
|
|
183
|
+
- If result is non-zero → spawn Dev agent below.
|
|
184
|
+
|
|
185
|
+
Spawn Dev agent (Task tool, subagent_type="prizm-dev-team-dev", run_in_background=false).
|
|
186
|
+
|
|
187
|
+
Prompt:
|
|
188
|
+
> "Read {{DEV_SUBAGENT_PATH}}. Implement feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}) using TDD.
|
|
189
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — all source files and context are there. Do NOT re-read individual source files.
|
|
190
|
+
> 2. Read `plan.md` and `tasks.md` from `.prizmkit/specs/{{FEATURE_SLUG}}/`.
|
|
191
|
+
> 3. Implement task-by-task. Mark each `[x]` in tasks.md **immediately** after completion (do NOT batch).
|
|
192
|
+
> 4. Use `TEST_CMD=<TEST_CMD>` to run tests — do NOT explore alternative test commands.
|
|
193
|
+
> 5. After ALL tasks done, append 'Implementation Log' to context-snapshot.md: files changed/created, key decisions, deviations from plan.
|
|
194
|
+
> 6. Do NOT execute any git commands (no git add/commit/reset/push).
|
|
195
|
+
> 7. If `<TEST_CMD>` shows failures, check against BASELINE_FAILURES=`<BASELINE_FAILURES>`. Failures present in the baseline are pre-existing — list them explicitly in your COMPLETION_SIGNAL.
|
|
196
|
+
> Do NOT exit until all tasks are [x] and the Implementation Log is written."
|
|
197
|
+
|
|
198
|
+
Wait for Dev to return. **If Dev times out before all tasks are `[x]`**:
|
|
199
|
+
1. Check progress: `grep -c '^\- \[ \]' .prizmkit/specs/{{FEATURE_SLUG}}/tasks.md`
|
|
200
|
+
2. If any tasks remain: re-spawn Dev with this recovery prompt:
|
|
201
|
+
> "Read {{DEV_SUBAGENT_PATH}}. You are resuming implementation of feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
|
|
202
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — Section 4 has original source, 'Implementation Log' (if present) has what was already done. Do NOT re-read individual source files.
|
|
203
|
+
> 2. Read `tasks.md` — complete ONLY the remaining `[ ]` tasks. Do NOT redo completed `[x]` tasks.
|
|
204
|
+
> 3. Use `TEST_CMD=<TEST_CMD>` to run tests.
|
|
205
|
+
> 4. Append progress to 'Implementation Log' in context-snapshot.md.
|
|
206
|
+
> 5. Do NOT execute any git commands."
|
|
207
|
+
3. Max 2 recovery retries. After 2 failures, orchestrator implements remaining tasks directly.
|
|
208
|
+
|
|
209
|
+
All tasks `[x]`, tests pass.
|
|
210
|
+
|
|
211
|
+
### Phase 6: Review — Reviewer Agent
|
|
212
|
+
|
|
213
|
+
Spawn Reviewer agent (Task tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false).
|
|
214
|
+
|
|
215
|
+
Prompt:
|
|
216
|
+
> "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
|
|
217
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 4 has original source files, 'Implementation Log' section lists exactly what Dev changed. Do NOT re-read source files that are NOT mentioned in the Implementation Log.
|
|
218
|
+
> 2. Run prizmkit-code-review: spec compliance (against spec.md), code quality, correctness. Read ONLY files listed in Implementation Log.
|
|
219
|
+
> 3. Write and execute integration tests covering all user stories from spec.md. Use `TEST_CMD=<TEST_CMD>` — do NOT try alternative test commands.
|
|
220
|
+
> 4. Append 'Review Notes' to context-snapshot.md: issues (severity), test results, final verdict.
|
|
221
|
+
> Report verdict: PASS, PASS_WITH_WARNINGS, or NEEDS_FIXES."
|
|
222
|
+
|
|
223
|
+
Wait for Reviewer to return.
|
|
224
|
+
- If NEEDS_FIXES: spawn Dev to fix with this prompt:
|
|
225
|
+
> "Read {{DEV_SUBAGENT_PATH}}. Fix NEEDS_FIXES issues for feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
|
|
226
|
+
> 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — 'Review Notes' section lists the exact issues to fix. Do NOT re-read source files not mentioned there.
|
|
227
|
+
> 2. Fix ONLY the issues listed in 'Review Notes'. Do NOT refactor unrelated code.
|
|
228
|
+
> 3. Use `TEST_CMD=<TEST_CMD>` to verify fixes.
|
|
229
|
+
> 4. Append fix summary to 'Implementation Log' in context-snapshot.md.
|
|
230
|
+
> 5. Do NOT execute any git commands."
|
|
231
|
+
Then re-run Review (max 3 rounds).
|
|
232
|
+
|
|
233
|
+
**CP-3**: Integration tests pass, verdict is not NEEDS_FIXES.
|
|
234
|
+
|
|
235
|
+
### Phase 7: Summarize & Commit — DO NOT SKIP
|
|
236
|
+
|
|
237
|
+
**For bug fixes**: skip `prizmkit.summarize`, use `fix(<scope>):` commit prefix.
|
|
238
|
+
|
|
239
|
+
**7a.** Check if feature already committed:
|
|
240
|
+
```bash
|
|
241
|
+
git log --oneline | grep "{{FEATURE_ID}}" | head -3
|
|
242
|
+
```
|
|
243
|
+
- If a commit for `{{FEATURE_ID}}` already exists → **skip 7c** (do NOT run prizmkit.committer, do NOT run git reset, do NOT stage or unstage anything). Proceed directly to Step 3.
|
|
244
|
+
- If no existing commit → proceed normally with 7a–7c.
|
|
245
|
+
|
|
246
|
+
**7b.** Run `prizmkit.summarize` → archive to REGISTRY.md
|
|
247
|
+
|
|
248
|
+
**7c.** Mark feature complete:
|
|
249
|
+
```bash
|
|
250
|
+
python3 {{VALIDATOR_SCRIPTS_DIR}}/update-feature-status.py \
|
|
251
|
+
--feature-list "{{FEATURE_LIST_PATH}}" \
|
|
252
|
+
--state-dir "{{PROJECT_ROOT}}/dev-pipeline/state" \
|
|
253
|
+
--feature-id "{{FEATURE_ID}}" --session-id "{{SESSION_ID}}" --action complete
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**7d.** Run `prizmkit.committer` → `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`, do NOT push
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Step 3: Write Session Status
|
|
261
|
+
|
|
262
|
+
Write to: `{{SESSION_STATUS_PATH}}`
|
|
263
|
+
|
|
264
|
+
```json
|
|
265
|
+
{
|
|
266
|
+
"session_id": "{{SESSION_ID}}",
|
|
267
|
+
"feature_id": "{{FEATURE_ID}}",
|
|
268
|
+
"feature_slug": "{{FEATURE_SLUG}}",
|
|
269
|
+
"exec_tier": 3,
|
|
270
|
+
"status": "<success|partial|failed>",
|
|
271
|
+
"completed_phases": [0, 1, 2, 3, 4, 5, 6, 7],
|
|
272
|
+
"current_phase": 7,
|
|
273
|
+
"checkpoint_reached": "CP-3",
|
|
274
|
+
"tasks_completed": 0,
|
|
275
|
+
"tasks_total": 0,
|
|
276
|
+
"errors": [],
|
|
277
|
+
"can_resume": false,
|
|
278
|
+
"resume_from_phase": null,
|
|
279
|
+
"artifacts": {
|
|
280
|
+
"context_snapshot_path": ".prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md",
|
|
281
|
+
"spec_path": ".prizmkit/specs/{{FEATURE_SLUG}}/spec.md",
|
|
282
|
+
"plan_path": ".prizmkit/specs/{{FEATURE_SLUG}}/plan.md",
|
|
283
|
+
"tasks_path": ".prizmkit/specs/{{FEATURE_SLUG}}/tasks.md"
|
|
284
|
+
},
|
|
285
|
+
"git_commit": "<commit hash>",
|
|
286
|
+
"timestamp": "2026-03-04T10:00:00Z"
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
## Step 4: Team Cleanup
|
|
291
|
+
|
|
292
|
+
No team cleanup needed — agents were spawned directly without TeamCreate.
|
|
293
|
+
|
|
294
|
+
## Critical Paths
|
|
295
|
+
|
|
296
|
+
| Resource | Path |
|
|
297
|
+
|----------|------|
|
|
298
|
+
| Feature Artifacts Dir | `.prizmkit/specs/{{FEATURE_SLUG}}/` |
|
|
299
|
+
| Context Snapshot | `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` |
|
|
300
|
+
| Team Config | `{{TEAM_CONFIG_PATH}}` |
|
|
301
|
+
| PM Agent Def | {{PM_SUBAGENT_PATH}} |
|
|
302
|
+
| Dev Agent Def | {{DEV_SUBAGENT_PATH}} |
|
|
303
|
+
| Reviewer Agent Def | {{REVIEWER_SUBAGENT_PATH}} |
|
|
304
|
+
| Session Status Output | {{SESSION_STATUS_PATH}} |
|
|
305
|
+
| Project Root | {{PROJECT_ROOT}} |
|
|
306
|
+
| Feature List Path | {{FEATURE_LIST_PATH}} |
|
|
307
|
+
|
|
308
|
+
## Reminders
|
|
309
|
+
|
|
310
|
+
- Tier 3: full team — PM (planning) → Dev (implementation) → Reviewer (review) — agents spawned directly via Task tool (no TeamCreate needed)
|
|
311
|
+
- context-snapshot.md is the team knowledge base: PM writes it once, all agents read it
|
|
312
|
+
- Do NOT use `run_in_background=true` when spawning agents
|
|
313
|
+
- ALWAYS write session-status.json before exiting
|
|
314
|
+
- On timeout: check snapshot → model:lite → remaining steps only → max 2 retries → orchestrator fallback
|
|
@@ -18,8 +18,10 @@ Create a technical implementation plan for a specified feature.
|
|
|
18
18
|
**STEPS:**
|
|
19
19
|
|
|
20
20
|
**Phase 0 — Research:**
|
|
21
|
-
1. Read `spec.md`
|
|
22
|
-
2.
|
|
21
|
+
1. Read `spec.md` for feature requirements
|
|
22
|
+
2. Load project context (use first available source):
|
|
23
|
+
- If `.prizmkit/specs/###-feature-name/context-snapshot.md` exists → read it for all context (Section 3 'Prizm Context' for docs, Section 4 'Existing Source Files' for code). Do NOT re-read `.prizm-docs/` or individual source files.
|
|
24
|
+
- Otherwise → read `.prizm-docs/root.prizm` and relevant `.prizm-docs/` L1/L2 docs for affected modules
|
|
23
25
|
3. Resolve any remaining `[NEEDS CLARIFICATION]` by proposing solutions
|
|
24
26
|
4. Research technical approach based on project's tech stack
|
|
25
27
|
|
|
@@ -19,7 +19,9 @@ Create a new feature specification.
|
|
|
19
19
|
2. Auto-generate 2-4 word feature slug from description
|
|
20
20
|
3. Determine next feature number by scanning `.prizmkit/specs/`
|
|
21
21
|
4. Create directory: `.prizmkit/specs/###-feature-name/`
|
|
22
|
-
5.
|
|
22
|
+
5. Load project context (use first available source):
|
|
23
|
+
- If `.prizmkit/specs/###-feature-name/context-snapshot.md` exists → read Section 3 'Prizm Context' from it (do NOT re-read `.prizm-docs/` files)
|
|
24
|
+
- Otherwise → read `.prizm-docs/root.prizm`
|
|
23
25
|
6. Generate `spec.md` from template (`${SKILL_DIR}/assets/spec-template.md`) focusing on:
|
|
24
26
|
- Feature title and description
|
|
25
27
|
- User stories (As a... I want... So that...)
|