agent-project-sdlc 0.1.1 → 0.1.3
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/assets/agents/AGENTS_CORE.md +6 -6
- package/assets/skills/pjsdlc_architect_design/SKILL.md +1 -1
- package/assets/skills/pjsdlc_dev_sprint/SKILL.md +9 -9
- package/assets/skills/pjsdlc_implementation_doc/SKILL.md +14 -12
- package/assets/skills/pjsdlc_manager/SKILL.md +1 -1
- package/assets/templates/IMPLEMENTATION_DOC_TEMPLATE.md +12 -4
- package/assets/templates/PLAN_TEMPLATE.yaml +1 -1
- package/assets/templates/TECH_DESIGN_TEMPLATE.md +2 -0
- package/dist/lib/config.js +4 -1
- package/package.json +1 -1
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
|
|
32
32
|
- `plan.yaml` 是当前和未来任务的短期执行计划事实源。open task 直接包含 `allowed_paths`、`required_gates`、`acceptance_criteria` 和必要的 `working_notes`。
|
|
33
33
|
- `next_task_sequence` 记录下一个可分配的 `DEV-*` 序号,避免删除历史 task 后发生 id 冲突。
|
|
34
|
-
- task
|
|
34
|
+
- task 完成并写入或更新相关 implementation doc 后,从 `plan.yaml` 的 `tasks` 列表移除该 task;不要长期保留 done/cancelled task 摘要。
|
|
35
35
|
- `plan.draft.yaml` 是架构阶段生成的计划草案,不自动覆盖 `plan.yaml`。
|
|
36
36
|
- 不维护 checkpoint 文件;任务现场只存在于 open task 的 plan 条目里。
|
|
37
|
-
- 历史动作记录以 git commit
|
|
37
|
+
- 历史动作记录以 git commit 为准,产物结果以模块、子系统或核心数据流级 implementation doc 为准。
|
|
38
38
|
- `SPRINTING` 阶段每完成一个 task,先在 task 仍位于 `plan.yaml` 时创建 task implementation commit;随后再从 `plan.yaml` 移除该 task 并创建 task completion ledger commit。两段提交 push 成功前不进入下一个 task。
|
|
39
|
-
- 历史 task
|
|
39
|
+
- 历史 task 查询默认面向产物结果和变更意图,读取模块级 implementation doc、RFC、PRD、tech plan 和代码;task id 和 commit 只作为 provenance,`allowed_paths`、`required_gates`、临时 `working_notes` 是执行期约束,不作为历史查询 API。
|
|
40
40
|
- 过去 phase/task/gate 执行流水不是默认上下文;除非用户明确要求 forensic/audit/regression 追溯,否则不要读取或恢复历史执行信息。
|
|
41
41
|
|
|
42
42
|
## Prompt Language Contract
|
|
@@ -135,15 +135,15 @@ Strong success criteria 可以让你 independent loop。Weak criteria,例如
|
|
|
135
135
|
4. 在 `SPRINTING` 阶段,一次只执行一个任务。
|
|
136
136
|
5. 在 `SPRINTING` 阶段,只编辑当前 open task 的 `allowed_paths` 允许的文件。
|
|
137
137
|
6. 不要在当前 open task 的 `required_gates` 通过前把任务标记为 `done`。
|
|
138
|
-
7. 代码 gate
|
|
138
|
+
7. 代码 gate 通过后,更新相关 implementation doc 和 `.docs/INDEX.md`。
|
|
139
139
|
8. `reviewer` 角色只读,不直接修改源码。
|
|
140
140
|
9. 需求变更必须进入 RFC 工作流。
|
|
141
141
|
10. task/release 历史动作记录使用 git commit、tag 或外部 release 系统,不维护 `.agent/archive/` 常规归档。
|
|
142
142
|
11. 在 `SPRINTING` 阶段,task 完成闭环必须先创建 task implementation commit,再提交移除该 task 后的 task completion ledger commit;如果没有 remote/upstream、权限或凭证导致无法 push,不要开始下一个 task,先报告 blocker。
|
|
143
143
|
12. 文档 slice 发生变化后,运行 `make docs-overview` 刷新对应 `overview.md`。
|
|
144
144
|
13. open task 必须在 `plan.yaml` 中包含完整执行合同,再继续推进或交接。
|
|
145
|
-
14. 默认不读取过去 task 或 phase 执行流水;修 bug、补功能和阶段交付以当前代码、测试、PRD
|
|
146
|
-
15. gate 证据写入当前 task `working_notes`
|
|
145
|
+
14. 默认不读取过去 task 或 phase 执行流水;修 bug、补功能和阶段交付以当前代码、测试、PRD、技术方案和模块级 implementation doc 为准。
|
|
146
|
+
15. gate 证据写入当前 task `working_notes` 或相关 implementation doc 的 `Verification`;不要维护独立 gate results state。
|
|
147
147
|
16. 如果信息缺失,或 gate 因基础设施原因失败,停止推进并报告 blocker。
|
|
148
148
|
|
|
149
149
|
## 宏指令
|
|
@@ -49,7 +49,7 @@ description: Use during ARCHITECTING to create architecture docs, technical plan
|
|
|
49
49
|
2. 每个 open task 必须包含 `id`、`title`、`status`、`summary`、`docs`、`allowed_paths`、`required_gates`、`acceptance_criteria` 和 `implementation_doc`。
|
|
50
50
|
3. `plan.draft.yaml` 不得自动覆盖 `plan.yaml`。
|
|
51
51
|
4. 风险或不清晰的问题按 `<harnessRoot>/pjsdlc_managed/policies/risk_matrix.yaml` 标记。
|
|
52
|
-
5.
|
|
52
|
+
5. 任务边界应足够小,能在一次开发执行内闭环;`implementation_doc` 应指向将被更新或新增的模块、子系统或核心数据流文档。
|
|
53
53
|
|
|
54
54
|
## 完成检查
|
|
55
55
|
|
|
@@ -15,7 +15,7 @@ description: Use during SPRINTING to execute one task from plan.yaml, respecting
|
|
|
15
15
|
|
|
16
16
|
开始编码前,先确认当前 open task 是否完整,修改范围是否覆盖必要文件,验收标准是否能被测试或 gate 验证。如果发现任务边界、产品行为或技术方案不清晰,要停下来说明 blocker、给出可能解释和推荐下一步,而不是扩大范围继续写。
|
|
17
17
|
|
|
18
|
-
实现时遵循小步闭环:先检查 `git status`,确认工作区没有未归属到当前 task 的脏变更;再定位相关代码和测试,做必要修改,运行 gate
|
|
18
|
+
实现时遵循小步闭环:先检查 `git status`,确认工作区没有未归属到当前 task 的脏变更;再定位相关代码和测试,做必要修改,运行 gate,修复失败,写入或更新相关 implementation doc 并刷新文档派生视图。此时先不要从 `plan.yaml` 移除当前 task,要在当前 task 仍位于 `plan.yaml` 时创建 task implementation commit;随后再移除 task,创建 task completion ledger commit,并 push 两个 commit。不要顺手重构、重排格式或处理无关问题;如果发现无关风险,只记录或报告。
|
|
19
19
|
|
|
20
20
|
## 输入
|
|
21
21
|
|
|
@@ -28,7 +28,7 @@ description: Use during SPRINTING to execute one task from plan.yaml, respecting
|
|
|
28
28
|
|
|
29
29
|
- 当前 task `allowed_paths` 范围内的源码改动
|
|
30
30
|
- 当前 task `allowed_paths` 范围内的测试改动
|
|
31
|
-
- `.docs/04_implementation/`
|
|
31
|
+
- `.docs/04_implementation/` 下相关模块、子系统或核心数据流的 implementation doc
|
|
32
32
|
- 当前 task `working_notes` 或 implementation doc `Verification` 中的 gate evidence
|
|
33
33
|
- 更新后的 `<harnessRoot>/state/plan.yaml`
|
|
34
34
|
- 更新后的 `.docs/INDEX.md`
|
|
@@ -39,13 +39,13 @@ description: Use during SPRINTING to execute one task from plan.yaml, respecting
|
|
|
39
39
|
## 语义切片
|
|
40
40
|
|
|
41
41
|
- `SPRINTING` 阶段的执行单元是 `current_task_id`,不要在开发中重新生成整个 Sprint 计划。
|
|
42
|
-
-
|
|
42
|
+
- 当前 task 是开发阶段的执行单元、修改边界和提交边界;implementation doc 的长期语义切片是模块、子系统或核心数据流。
|
|
43
43
|
- open task 在 `plan.yaml` 中直接保存 `docs`、`allowed_paths`、`required_gates`、`acceptance_criteria` 和必要的 `working_notes`。
|
|
44
44
|
- task implementation commit 必须发生在 task 移除之前,避免实现变更和计划短期化混在同一个提交里。
|
|
45
45
|
- task completion ledger commit 发生在 implementation commit 之后,只负责将该 task 从当前 `plan.yaml` 移除。
|
|
46
46
|
- 一个开发 task 默认对应一个主要 implementation commit 和一个轻量 completion ledger commit。implementation commit message 应包含 task id,例如 `DEV-003: implement login rate limit`;push 成功前,不进入下一个 task。
|
|
47
47
|
- 本 Skill 不直接重切 PRD 或 tech plan;如果发现上游语义边界错误,进入 `BLOCKED`、创建 RFC,或请求回到 `ARCHITECTING`。
|
|
48
|
-
- gate 通过后调用 `implementation_doc`,由该 Skill
|
|
48
|
+
- gate 通过后调用 `implementation_doc`,由该 Skill 按真实实现更新或新增 `.docs/04_implementation/` 模块级 slice。
|
|
49
49
|
- 如果一个任务实际变成多个独立实现边界,应停止扩大范围,拆分后续任务或回到任务规划。
|
|
50
50
|
|
|
51
51
|
## Plan Protocol
|
|
@@ -59,7 +59,7 @@ description: Use during SPRINTING to execute one task from plan.yaml, respecting
|
|
|
59
59
|
5. implementation commit 完成后,再把该 task 从 `plan.yaml` 的 `tasks` 列表移除,并保留/递增 `next_task_sequence`。
|
|
60
60
|
6. 将移除当前 task 后的 `plan.yaml` 提交为 task completion ledger commit,并 `git push` 两个 commit 到当前 upstream branch。
|
|
61
61
|
|
|
62
|
-
done task 的执行流水不在当前 `plan.yaml` 长期保留,也不是默认上下文。修 bug、补功能和继续开发时,优先读取当前代码、测试、PRD
|
|
62
|
+
done task 的执行流水不在当前 `plan.yaml` 长期保留,也不是默认上下文。修 bug、补功能和继续开发时,优先读取当前代码、测试、PRD、技术方案和模块级 implementation doc;历史 task 查询主要看“做了什么、为什么做、影响哪个模块、验证了什么”,task id 和 commit 作为 implementation doc 的 provenance。`allowed_paths`、`required_gates`、临时 `working_notes` 是执行期约束,不作为历史查询 API。只有用户明确要求 forensic/audit/regression 追溯时,才临时使用 git、PR 或 CI 记录。
|
|
63
63
|
|
|
64
64
|
## 规则
|
|
65
65
|
|
|
@@ -71,8 +71,8 @@ done task 的执行流水不在当前 `plan.yaml` 长期保留,也不是默认
|
|
|
71
71
|
6. 如果 gate 因基础设施、凭证缺失、产品行为不清或高风险架构变化失败,进入 `BLOCKED`。
|
|
72
72
|
7. gate 通过后调用 `implementation_doc`。
|
|
73
73
|
8. 只有 gate 通过且 implementation doc 校验通过后,才能把任务标记为 `done`。
|
|
74
|
-
9.
|
|
75
|
-
10. task implementation commit 必须发生在 task
|
|
74
|
+
9. 任务完成并写入或更新相关 implementation doc、刷新 `overview.md`、记录 gate 后,先创建 task implementation commit;此时不要移除该 task。
|
|
75
|
+
10. task implementation commit 必须发生在 task 移除前;后续默认不要读取其中的执行期字段,历史查询以模块级 implementation doc、RFC、PRD、tech plan 和代码为主。
|
|
76
76
|
11. implementation commit 完成后,从当前 `plan.yaml` 移除该 task,并创建 task completion ledger commit。
|
|
77
77
|
12. 默认不追溯已完成 task 的执行流水;只有显式 forensic/audit/regression 任务才临时查询 git、PR 或 CI 记录。
|
|
78
78
|
13. 两个 commit 后必须 `git push` 到当前 upstream branch;如果没有 remote/upstream、权限或凭证导致无法 push,停止推进并报告 blocker。
|
|
@@ -82,8 +82,8 @@ done task 的执行流水不在当前 `plan.yaml` 长期保留,也不是默认
|
|
|
82
82
|
- [ ] 代码和测试改动都在当前 task `allowed_paths` 范围内。
|
|
83
83
|
- [ ] 当前 task `required_gates` 已通过,或 blocker 已记录。
|
|
84
84
|
- [ ] open task 在 `plan.yaml` 中包含完整执行合同。
|
|
85
|
-
- [ ]
|
|
86
|
-
- [ ] implementation doc
|
|
85
|
+
- [ ] 当前任务仍然是单一清晰的执行单元。
|
|
86
|
+
- [ ] implementation doc 已生成或更新,并反映相关模块的真实代码。
|
|
87
87
|
- [ ] gate 结果已写入 implementation doc `Verification`,必要时当前 task `working_notes` 也记录了恢复现场所需的 gate evidence。
|
|
88
88
|
- [ ] task implementation commit 已在 task 移除前创建。
|
|
89
89
|
- [ ] done task 已在 implementation commit 之后从当前 `plan.yaml` 移除。
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pjsdlc_implementation_doc
|
|
3
|
-
description: Use after
|
|
3
|
+
description: Use after development gates pass to update module-level implementation facts and plan deviations.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Implementation Doc Skill
|
|
7
7
|
|
|
8
8
|
## 目的
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
按模块、子系统或核心数据流记录真实实现事实,包括代码结构、数据流、防御逻辑、测试覆盖,以及相对原技术方案的偏移。
|
|
11
11
|
|
|
12
12
|
## 角色提示词
|
|
13
13
|
|
|
@@ -15,11 +15,11 @@ description: Use after a development task passes code gates to document the real
|
|
|
15
15
|
|
|
16
16
|
开始记录前,先读取 task、PRD、技术方案、git diff、测试结果和相关源码。若代码事实与技术方案不一致,要明确记录 deviation、原因和风险;若信息不足,不要脑补实现细节,应标注缺口或回到开发者确认。
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
文档应帮助后来者快速理解:某个模块或核心数据流的当前实现是什么、关键对象/函数职责是什么、行为如何从输入流到输出、测试覆盖了什么、还有什么未覆盖。task id 只作为 provenance,不作为默认切片粒度。
|
|
19
19
|
|
|
20
20
|
## 输入
|
|
21
21
|
|
|
22
|
-
- `<harnessRoot>/state/plan.yaml`
|
|
22
|
+
- `<harnessRoot>/state/plan.yaml` 中当前 task 的 `implementation_doc` 路径和 task ID
|
|
23
23
|
- 当前 `git diff`
|
|
24
24
|
- 关联 PRD
|
|
25
25
|
- 关联技术方案
|
|
@@ -28,28 +28,30 @@ description: Use after a development task passes code gates to document the real
|
|
|
28
28
|
|
|
29
29
|
## 输出
|
|
30
30
|
|
|
31
|
-
- `.docs/04_implementation/<domain>/<
|
|
31
|
+
- `.docs/04_implementation/<domain>/<module_or_flow>.md`
|
|
32
32
|
- 更新后的 `.docs/INDEX.md`
|
|
33
33
|
|
|
34
34
|
## 语义切片
|
|
35
35
|
|
|
36
|
-
- `.docs/04_implementation/`
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
36
|
+
- `.docs/04_implementation/` 默认按稳定的模块、子系统或核心数据流切片,并尽量与 architecture / tech plan 的边界对应。
|
|
37
|
+
- task 是执行单元和提交边界,不是 implementation doc 的默认文档边界。task ID、commit 和 RFC 只记录在文档的 provenance 或变更记录中。
|
|
38
|
+
- 如果一个 task 修改已有模块或数据流,应更新对应的原 implementation doc,而不是创建 `dev_*.md` task ledger。
|
|
39
|
+
- 如果一个 task 真实产出多个独立模块或核心数据流,可以更新或新增多份 implementation docs;每份都记录相关 Task ID 和 commit。
|
|
40
|
+
- 只有当某个 task 本身就是一个稳定模块/数据流边界时,implementation doc 才可以与单个 task 一一对应。
|
|
40
41
|
- 如果真实代码边界与技术方案边界不同,必须在文档中记录偏移,并更新 `.docs/INDEX.md`。
|
|
41
42
|
|
|
42
43
|
## 规则
|
|
43
44
|
|
|
44
45
|
1. implementation doc 描述当前代码事实,而不是期望中的未来设计。
|
|
45
|
-
2.
|
|
46
|
+
2. 每个被记录的文件都应说明它在该模块或数据流中的作用和关键函数/对象。
|
|
46
47
|
3. 与技术方案的偏移必须明确记录,即便该偏移是合理的。
|
|
47
48
|
4. 测试覆盖必须列出具体测试,或明确记录覆盖缺口。
|
|
48
|
-
5.
|
|
49
|
+
5. 文档粒度保持在模块、子系统或核心数据流级别;不要默认按 task 建文档,也不要写成跨全项目的巨型百科。
|
|
49
50
|
|
|
50
51
|
## 完成检查
|
|
51
52
|
|
|
52
|
-
- [ ]
|
|
53
|
+
- [ ] 模块/子系统/核心数据流边界明确,并与相关 architecture / tech plan 对齐或记录偏移。
|
|
54
|
+
- [ ] Task ID、commit 和关联产物路径已作为 provenance 记录。
|
|
53
55
|
- [ ] 真实代码结构表已填写。
|
|
54
56
|
- [ ] 核心数据流已说明。
|
|
55
57
|
- [ ] 已判断 implementation doc 的语义切片边界。
|
|
@@ -49,7 +49,7 @@ Skill、执行出口 gate,并记录 blocker。
|
|
|
49
49
|
|
|
50
50
|
## Plan Protocol
|
|
51
51
|
|
|
52
|
-
每个 open task 都必须在 `plan.yaml` 中包含 `docs`、`allowed_paths`、`required_gates` 和 `acceptance_criteria`;done/cancelled task 不长期留在当前 `plan.yaml
|
|
52
|
+
每个 open task 都必须在 `plan.yaml` 中包含 `docs`、`allowed_paths`、`required_gates` 和 `acceptance_criteria`;done/cancelled task 不长期留在当前 `plan.yaml`。完成后的产物事实以模块、子系统或核心数据流级 implementation doc 为准,动作历史以 git/PR/CI/release 系统作为 cold archive,`next_task_sequence` 负责继续分配后续 task id。
|
|
53
53
|
|
|
54
54
|
`lifecycle.yaml` 和 `plan.yaml` 只用于当前可执行状态。默认不要读取过去 phase/task/gate 执行流水;只有用户明确要求 forensic/audit/regression 追溯时,才临时查询 git、PR、CI 或 release 记录。
|
|
55
55
|
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
# [
|
|
1
|
+
# [Module/Subsystem/Core Flow] Implementation Doc
|
|
2
2
|
|
|
3
3
|
## 1. 关联信息
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- Domain:
|
|
6
|
+
- Module / subsystem / core flow:
|
|
7
|
+
- Updated by task:
|
|
6
8
|
- Linked PRD:
|
|
7
9
|
- Linked technical design:
|
|
8
10
|
- Linked RFC:
|
|
9
11
|
- Linked commit:
|
|
10
12
|
|
|
11
|
-
## 2.
|
|
13
|
+
## 2. 当前实现范围
|
|
12
14
|
|
|
13
15
|
- 新增(Added):
|
|
14
16
|
- 修改(Changed):
|
|
@@ -48,6 +50,12 @@ Input
|
|
|
48
50
|
|---|---|---|
|
|
49
51
|
| | | |
|
|
50
52
|
|
|
51
|
-
## 8.
|
|
53
|
+
## 8. 变更记录(Change Log)
|
|
54
|
+
|
|
55
|
+
| 日期(Date) | Task ID | Commit | 摘要(Summary) |
|
|
56
|
+
|---|---|---|---|
|
|
57
|
+
| | | | |
|
|
58
|
+
|
|
59
|
+
## 9. 后续维护注意事项
|
|
52
60
|
|
|
53
61
|
-
|
|
@@ -43,6 +43,8 @@ Input
|
|
|
43
43
|
|---|---|---|---|---|
|
|
44
44
|
| DEV-001 | | `src/**`, `tests/**` | `make lint`, `make test-current-domain` | `.docs/04_implementation/...` |
|
|
45
45
|
|
|
46
|
+
`Implementation Doc` 应指向模块、子系统或核心数据流级文档;多个 task 可以更新同一份文档,task id 和 commit 记录在该文档的 provenance / Change Log 中。
|
|
47
|
+
|
|
46
48
|
## 7. 风险与缓解
|
|
47
49
|
|
|
48
50
|
| 风险(Risk) | 等级(Level) | 缓解措施(Mitigation) |
|
package/dist/lib/config.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
2
3
|
import { harnessConfigPath, harnessPath, harnessRoot } from "./harness-root.js";
|
|
3
4
|
import { pathExists, readText, writeTextIfChanged } from "./fs.js";
|
|
4
5
|
import { parseYaml, stringifyYaml } from "./yaml.js";
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const packageMetadata = require("../../package.json");
|
|
5
8
|
export function defaultConfig(root) {
|
|
6
9
|
return {
|
|
7
10
|
core: {
|
|
8
11
|
package: "agent-project-sdlc",
|
|
9
|
-
version: "0.
|
|
12
|
+
version: packageMetadata.version ?? "0.0.0",
|
|
10
13
|
schema_version: "1"
|
|
11
14
|
},
|
|
12
15
|
managed_files: [
|