@geminix/gxpm 0.1.0

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.
Files changed (299) hide show
  1. package/AGENTS.md +148 -0
  2. package/CANON.md +53 -0
  3. package/CLAUDE.md +60 -0
  4. package/CONTEXT.md +49 -0
  5. package/DEBUG.md +59 -0
  6. package/ISSUE_CONTEXT.md +25 -0
  7. package/README.md +143 -0
  8. package/VERSION +1 -0
  9. package/agents/cleanup-auditor/cleanup-auditor.md +56 -0
  10. package/agents/grill-master.md +26 -0
  11. package/agents/implementer.md +32 -0
  12. package/agents/review-army/accessibility-reviewer.md +54 -0
  13. package/agents/review-army/code-quality-reviewer.md +54 -0
  14. package/agents/review-army/security-reviewer.md +56 -0
  15. package/agents/review-army/spec-compliance-reviewer.md +51 -0
  16. package/agents/review-army/test-reviewer.md +55 -0
  17. package/agents/reviewer.md +59 -0
  18. package/agents/ship-audit-army/docs-auditor.md +53 -0
  19. package/agents/ship-audit-army/performance-auditor.md +52 -0
  20. package/agents/ship-audit-army/security-auditor.md +52 -0
  21. package/agents/specifier.md +55 -0
  22. package/agents/triage-officer.md +27 -0
  23. package/bin/gxpm +17 -0
  24. package/bin/gxpm-browser +17 -0
  25. package/bin/gxpm-config +15 -0
  26. package/bin/gxpm-eval +13 -0
  27. package/bin/gxpm-global-discover +15 -0
  28. package/bin/gxpm-init +38 -0
  29. package/bin/gxpm-investigate +194 -0
  30. package/bin/gxpm-uninstall +15 -0
  31. package/bin/gxpm-update-check +165 -0
  32. package/commands/build.md +40 -0
  33. package/commands/help.md +53 -0
  34. package/commands/plan.md +34 -0
  35. package/commands/refine.md +46 -0
  36. package/commands/review.md +34 -0
  37. package/commands/ship.md +37 -0
  38. package/core/ac-check.ts +20 -0
  39. package/core/agent-runtime.ts +363 -0
  40. package/core/artifact-validator.ts +151 -0
  41. package/core/artifacts.ts +313 -0
  42. package/core/autopilot.ts +250 -0
  43. package/core/capabilities.ts +779 -0
  44. package/core/checkpoint.ts +370 -0
  45. package/core/cleanup.ts +32 -0
  46. package/core/command-probe.ts +82 -0
  47. package/core/config.ts +533 -0
  48. package/core/contracts/behavior-spec.schema.ts +38 -0
  49. package/core/contracts/converter.ts +61 -0
  50. package/core/contracts/host.ts +43 -0
  51. package/core/converters/converter.ts +93 -0
  52. package/core/converters/index.ts +8 -0
  53. package/core/converters/managed-artifact.ts +119 -0
  54. package/core/converters/parser.ts +159 -0
  55. package/core/converters/template-renderer.ts +35 -0
  56. package/core/converters/writer.ts +61 -0
  57. package/core/dag-executor.ts +426 -0
  58. package/core/dag-loader.ts +292 -0
  59. package/core/dag-schemas.ts +150 -0
  60. package/core/dispatch.ts +125 -0
  61. package/core/evidence.ts +148 -0
  62. package/core/gate.ts +269 -0
  63. package/core/hook-engine.ts +566 -0
  64. package/core/host-probe.ts +64 -0
  65. package/core/implement.ts +16 -0
  66. package/core/isolation-errors.ts +174 -0
  67. package/core/isolation-resolver.ts +921 -0
  68. package/core/issue-context.ts +381 -0
  69. package/core/issue-readiness.ts +457 -0
  70. package/core/issue-sync.ts +427 -0
  71. package/core/issues.ts +132 -0
  72. package/core/land.ts +108 -0
  73. package/core/orchestrator.ts +54 -0
  74. package/core/phase-artifact.ts +32 -0
  75. package/core/phase-gates.ts +130 -0
  76. package/core/phase-rewind.ts +94 -0
  77. package/core/plan-lint.ts +61 -0
  78. package/core/plan.ts +77 -0
  79. package/core/port-allocation.ts +50 -0
  80. package/core/pr-check.ts +15 -0
  81. package/core/preset-system/preset-resolver.ts +221 -0
  82. package/core/project-init-status.ts +127 -0
  83. package/core/qa.ts +15 -0
  84. package/core/resilience.ts +165 -0
  85. package/core/runs.ts +288 -0
  86. package/core/safe-path.test.ts +80 -0
  87. package/core/safe-path.ts +60 -0
  88. package/core/sdd-gate.test.ts +98 -0
  89. package/core/sdd-gate.ts +134 -0
  90. package/core/self-review.ts +62 -0
  91. package/core/session.ts +70 -0
  92. package/core/ship.ts +86 -0
  93. package/core/specify.ts +173 -0
  94. package/core/state.ts +1002 -0
  95. package/core/template-engine.ts +152 -0
  96. package/core/template-resolver.test.ts +70 -0
  97. package/core/template-resolver.ts +156 -0
  98. package/core/triage.ts +26 -0
  99. package/core/verify.ts +15 -0
  100. package/core/wiki-native.ts +2423 -0
  101. package/core/wiki.ts +27 -0
  102. package/core/workflow-event-emitter.ts +163 -0
  103. package/core/workflows/engine.ts +273 -0
  104. package/core/workflows/expressions.ts +76 -0
  105. package/core/workflows/index.ts +38 -0
  106. package/core/workflows/steps/command.ts +43 -0
  107. package/core/workflows/steps/gate.ts +47 -0
  108. package/core/workflows/steps/gxpm.ts +44 -0
  109. package/core/workflows/steps/linear.ts +31 -0
  110. package/core/workflows/steps/shell.ts +65 -0
  111. package/core/workflows/types.ts +62 -0
  112. package/core/workspace-runtime.ts +227 -0
  113. package/core/worktree-init-steps.ts +647 -0
  114. package/core/worktree-init.ts +330 -0
  115. package/core/worktree-owner.ts +143 -0
  116. package/docs/GXPM_VERIFY.md +98 -0
  117. package/docs/INSTALL_FOR_AGENTS.md +113 -0
  118. package/docs/README.md +57 -0
  119. package/docs/adr/adr-005-multi-platform-skill-converter.md +72 -0
  120. package/docs/agents/domain.md +30 -0
  121. package/docs/agents/issue-tracker.md +30 -0
  122. package/docs/agents/triage-labels.md +32 -0
  123. package/docs/architecture/gxpm-architecture-diagram.md +265 -0
  124. package/docs/architecture/gxpm-current-architecture.md +175 -0
  125. package/docs/architecture/gxpm-current-flow.md +278 -0
  126. package/docs/architecture/gxpm-replacement-architecture.md +211 -0
  127. package/docs/architecture/gxpm-target-architecture.md +449 -0
  128. package/docs/architecture/gxpm-v0-contract.md +311 -0
  129. package/docs/architecture/layered-workflow-boundaries.md +193 -0
  130. package/docs/architecture/preset-system.md +126 -0
  131. package/docs/architecture/scaffold-northstar.md +23 -0
  132. package/docs/brainstorms/2026-05-14-bdd-then-tdd-design.md +320 -0
  133. package/docs/brainstorms/README.md +22 -0
  134. package/docs/brainstorms/docs-knowledge-system-requirements.md +29 -0
  135. package/docs/governance/beta-skill-promotion.md +39 -0
  136. package/docs/governance/development-contract.md +144 -0
  137. package/docs/governance/gherkin-style.md +90 -0
  138. package/docs/governance/host-adapter.md +56 -0
  139. package/docs/governance/skill-authoring.md +87 -0
  140. package/docs/governance/skill-testing.md +356 -0
  141. package/docs/governance/template-authoring.md +53 -0
  142. package/docs/migrations/v0.2.md +51 -0
  143. package/docs/plans/README.md +23 -0
  144. package/docs/plans/bdd-then-tdd-plan.md +1767 -0
  145. package/docs/plans/docs-knowledge-system-plan.md +31 -0
  146. package/docs/plans/spec-kit-sdd-adoption-plan.md +305 -0
  147. package/docs/research/agents-md-best-practices.md +207 -0
  148. package/docs/research/archon-study.md +351 -0
  149. package/docs/research/claude-hooks-study.md +440 -0
  150. package/docs/research/codex-hooks-study.md +624 -0
  151. package/docs/research/everything-claude-code-study.md +252 -0
  152. package/docs/research/from-skills-to-layered-workflow.md +322 -0
  153. package/docs/research/gsd-study.md +69 -0
  154. package/docs/research/kimi-hooks-study.md +274 -0
  155. package/docs/research/mattpocock-skills-comparison.md +429 -0
  156. package/docs/research/mattpocock-skills-study.md +275 -0
  157. package/docs/research/oh-my-codex-study.md +279 -0
  158. package/docs/research/perplexity-agent-skills-design.md +168 -0
  159. package/docs/research/pmc-gstack-skill-study.md +122 -0
  160. package/docs/research/spec-kit-study.md +224 -0
  161. package/docs/research/superpowers-study.md +209 -0
  162. package/docs/roadmap/initial-roadmap.md +53 -0
  163. package/docs/solutions/README.md +45 -0
  164. package/docs/solutions/artifact-nesting-recovery.md +58 -0
  165. package/docs/solutions/session-context-restore-practice.md +67 -0
  166. package/docs/solutions/workflow/version-drift-recovery.md +49 -0
  167. package/docs/solutions/worktree-gate-recovery.md +62 -0
  168. package/docs/specs/README.md +28 -0
  169. package/docs/specs/claude.md +45 -0
  170. package/docs/specs/codex.md +44 -0
  171. package/docs/specs/cursor.md +44 -0
  172. package/hosts/adapters/claude.ts +29 -0
  173. package/hosts/adapters/codex.ts +27 -0
  174. package/hosts/adapters/cursor.ts +27 -0
  175. package/hosts/adapters/kimi.ts +27 -0
  176. package/hosts/claude.ts +23 -0
  177. package/hosts/codex.ts +26 -0
  178. package/hosts/cursor.ts +19 -0
  179. package/hosts/index.ts +33 -0
  180. package/hosts/registry.test.ts +52 -0
  181. package/hosts/registry.ts +57 -0
  182. package/hosts/schema.ts +58 -0
  183. package/package.json +52 -0
  184. package/scripts/browser.ts +185 -0
  185. package/scripts/cleanup.ts +142 -0
  186. package/scripts/commands/artifact.ts +115 -0
  187. package/scripts/commands/autopilot.ts +143 -0
  188. package/scripts/commands/capability.ts +57 -0
  189. package/scripts/commands/config.ts +69 -0
  190. package/scripts/commands/dag.ts +126 -0
  191. package/scripts/commands/feedback.ts +123 -0
  192. package/scripts/commands/gate.ts +291 -0
  193. package/scripts/commands/helpers.ts +126 -0
  194. package/scripts/commands/hook.ts +66 -0
  195. package/scripts/commands/init.ts +515 -0
  196. package/scripts/commands/issue.ts +825 -0
  197. package/scripts/commands/phase.ts +61 -0
  198. package/scripts/commands/preset.ts +159 -0
  199. package/scripts/commands/runtime.ts +199 -0
  200. package/scripts/commands/specify.ts +71 -0
  201. package/scripts/commands/upgrade.ts +243 -0
  202. package/scripts/commands/verify.ts +183 -0
  203. package/scripts/commands/wiki.ts +242 -0
  204. package/scripts/commands/workflow.ts +131 -0
  205. package/scripts/dev-skill.ts +55 -0
  206. package/scripts/discover-skills.ts +116 -0
  207. package/scripts/doctor.ts +410 -0
  208. package/scripts/dogfood-check.ts +125 -0
  209. package/scripts/eval-functional.ts +218 -0
  210. package/scripts/eval.ts +246 -0
  211. package/scripts/gen-skill-docs.ts +201 -0
  212. package/scripts/global-discover.ts +217 -0
  213. package/scripts/governance-check.ts +75 -0
  214. package/scripts/gxpm-check.ts +12 -0
  215. package/scripts/gxpm.ts +216 -0
  216. package/scripts/host-config.ts +62 -0
  217. package/scripts/install-claude-hooks.ts +138 -0
  218. package/scripts/install-codex-hooks.ts +271 -0
  219. package/scripts/install-hooks.ts +128 -0
  220. package/scripts/install-kimi-hooks.ts +92 -0
  221. package/scripts/install-skill.ts +184 -0
  222. package/scripts/phase-artifact-commands.ts +100 -0
  223. package/scripts/post-land-sync.ts +46 -0
  224. package/scripts/scaffold-check.ts +85 -0
  225. package/scripts/skill-naming-check.ts +78 -0
  226. package/scripts/skill-structure-check.ts +157 -0
  227. package/scripts/skills-lock-check.ts +60 -0
  228. package/scripts/sync-markdown-artifacts.ts +172 -0
  229. package/scripts/uninstall.ts +162 -0
  230. package/scripts/version.ts +47 -0
  231. package/scripts/wait-pr-ready.ts +407 -0
  232. package/skills/gxpm/SKILL.md +485 -0
  233. package/skills/gxpm/SKILL.md.tmpl +422 -0
  234. package/skills/gxpm/references/CANON.md +53 -0
  235. package/skills/gxpm/references/key-rules.md +130 -0
  236. package/skills/gxpm-architecture/SKILL.md +106 -0
  237. package/skills/gxpm-architecture/references/DEEPENING.md +37 -0
  238. package/skills/gxpm-architecture/references/INTERFACE-DESIGN.md +44 -0
  239. package/skills/gxpm-autopilot/SKILL.md +116 -0
  240. package/skills/gxpm-autopilot/SKILL.md.tmpl +107 -0
  241. package/skills/gxpm-browser/SKILL.md +105 -0
  242. package/skills/gxpm-browser/SKILL.md.tmpl +41 -0
  243. package/skills/gxpm-browser/references/commands.md +43 -0
  244. package/skills/gxpm-browser/references/evidence-path.md +20 -0
  245. package/skills/gxpm-build/SKILL.md +78 -0
  246. package/skills/gxpm-cleanup/SKILL.md +76 -0
  247. package/skills/gxpm-debug-issue/SKILL.md +39 -0
  248. package/skills/gxpm-diagnose/SKILL.md +220 -0
  249. package/skills/gxpm-diagnose/SKILL.md.tmpl +31 -0
  250. package/skills/gxpm-diagnose/references/feedback-loop.md +34 -0
  251. package/skills/gxpm-diagnose/references/feedback-loops.md +43 -0
  252. package/skills/gxpm-diagnose/references/phases.md +60 -0
  253. package/skills/gxpm-eval/SKILL.md +78 -0
  254. package/skills/gxpm-explore-codebase/SKILL.md +36 -0
  255. package/skills/gxpm-explore-codebase/scripts/summarize-communities.ts +51 -0
  256. package/skills/gxpm-feedback/SKILL.md +122 -0
  257. package/skills/gxpm-grill/SKILL.md +159 -0
  258. package/skills/gxpm-grill/SKILL.md.tmpl +77 -0
  259. package/skills/gxpm-grill/references/documentation-templates.md +56 -0
  260. package/skills/gxpm-grill/references/process.md +25 -0
  261. package/skills/gxpm-handoff/SKILL.md +112 -0
  262. package/skills/gxpm-hygiene/SKILL.md +69 -0
  263. package/skills/gxpm-implementer/SKILL.md +142 -0
  264. package/skills/gxpm-implementer/SKILL.md.tmpl +141 -0
  265. package/skills/gxpm-linear/SKILL.md +282 -0
  266. package/skills/gxpm-linear/SKILL.md.tmpl +86 -0
  267. package/skills/gxpm-linear/references/commands.md +75 -0
  268. package/skills/gxpm-linear/references/workflows.md +120 -0
  269. package/skills/gxpm-planning/SKILL.md +134 -0
  270. package/skills/gxpm-prototype/SKILL.md +64 -0
  271. package/skills/gxpm-refactor-safely/SKILL.md +62 -0
  272. package/skills/gxpm-review-army/SKILL.md +117 -0
  273. package/skills/gxpm-review-changes/SKILL.md +36 -0
  274. package/skills/gxpm-setup/SKILL.md +101 -0
  275. package/skills/gxpm-specifier/SKILL.md +135 -0
  276. package/skills/gxpm-tdd/SKILL.md +187 -0
  277. package/skills/gxpm-tdd/references/interface-design.md +23 -0
  278. package/skills/gxpm-tdd/references/mocking.md +27 -0
  279. package/skills/gxpm-tdd/references/red-green-refactor.md +61 -0
  280. package/skills/gxpm-tdd/references/troubleshooting.md +28 -0
  281. package/skills/gxpm-tdd/references/workflow.md +50 -0
  282. package/skills/gxpm-tdd/testing-anti-patterns.tmpl +304 -0
  283. package/skills/gxpm-triage/SKILL.md +160 -0
  284. package/skills/gxpm-verify/SKILL.md +107 -0
  285. package/skills/gxpm-write-skill/SKILL.md +131 -0
  286. package/skills/gxpm-zoom-out/SKILL.md +69 -0
  287. package/skills/maintain-hygiene-skills-lock/SKILL.md +54 -0
  288. package/skills/maintain-hygiene-skills-lock/SKILL.md.tmpl +53 -0
  289. package/templates/constitution-template.md +63 -0
  290. package/templates/hooks/gxpm-commit-msg +16 -0
  291. package/templates/hooks/gxpm-post-checkout +19 -0
  292. package/templates/hooks/gxpm-post-commit +7 -0
  293. package/templates/hooks/gxpm-post-merge +29 -0
  294. package/templates/hooks/gxpm-pre-commit +39 -0
  295. package/templates/hooks/gxpm-pre-push +33 -0
  296. package/templates/plan-template.md.tmpl +46 -0
  297. package/templates/spec-template.md.tmpl +63 -0
  298. package/templates/specify-stub.tmpl +22 -0
  299. package/templates/tasks-template.md.tmpl +32 -0
package/AGENTS.md ADDED
@@ -0,0 +1,148 @@
1
+ # gxpm Agent Contract
2
+
3
+ ## Role
4
+
5
+ gxpm 是面向完全替代 `pmc` 和 `gstack` 的第二代代理项目管理产品。PMC 和 gstack 是上游研究对象与能力来源,不是 gxpm 的长期运行依赖。
6
+
7
+ <!-- BEGIN USER-SPECIFIED -->
8
+ **核心定位:AI Agent 工作制度架构 + 工作流 + 状态机的可执行产品。**
9
+
10
+ 形态:**基于文档驱动的制度套件 + CLI 运行时。**
11
+
12
+ gxpm 不是 PMC 的兼容壳,也不是 gstack 的插件集合。所有设计都要服务于独立产品闭环:统一 state graph、capability runtime、browser evidence、review/ship governance 和 agent execution loop。
13
+
14
+ **架构哲学 —— 四维分工:**
15
+
16
+ | 维度 | 职责 | gxpm 体现 |
17
+ |---|---|---|
18
+ | **commit** | 阶段切分 | git worktree 隔离 + phase transition,物理与逻辑双重边界 |
19
+ | **Agent** | 角色分工 | triage/plan/implement/review/QA/land owner,责任视角而非人格模板 |
20
+ | **skill** | 能力注入 | `skills/*/SKILL.md` 可发现、可加载、可校验的方法目录 |
21
+ | **证据/事实** | 持久存储 | `artifacts/*.json` + `evidence/` + `state.json`,本地文件系统为唯一真值 |
22
+
23
+ **五层架构:**
24
+
25
+ ```
26
+ L1: 制度文档层 — CANON.md / AGENTS.md / CONTEXT.md / docs/governance/*.md
27
+ L2: 角色与技能层 — agents/*.md / skills/*/SKILL.md / templates/*.tmpl
28
+ L3: 工作流编排层 — workflows/*.yml / core/phase-gates.ts / PHASE_GATE_RULES
29
+ L4: 状态机执行层 — core/state.ts / core/capabilities.ts / CLI commands
30
+ L5: 证据与恢复层 — .gxpm/issues/<id>/{state,artifacts,evidence,memory}/
31
+ ```
32
+
33
+ **核心原则:**
34
+
35
+ 1. 文档即制度,制度可执行 —— 治理规则以文本存在,被 CLI 解析、被模板生成、被 hook 校验。
36
+ 2. 本地 state 永远比外部系统更权威 —— `state.json` 比 Linear comment、PR body、聊天上下文更权威。
37
+ 3. 所有 transition 都必须可审计、可重放、可恢复 —— 事件 append-only 写入 `events.jsonl`。
38
+ 4. Command 只路由,Agent 只担责,Skill 只注入,Artifact 只存真值 —— 分层边界不可漂移。
39
+
40
+ **Phase 顺序(14 阶段,按 `rigorLevel` 压缩):**
41
+
42
+ 完整:`triage → plan → dispatch → specify → implement → local-verify → ac-check → self-review → cleanup → ship → pr-check → verify → qa → land`
43
+
44
+ - `lite`(spike/meta):7 阶段,跳过 dispatch, local-verify, ac-check, cleanup, pr-check, verify, qa
45
+ - `standard`(默认):9 阶段,跳过 local-verify, ac-check, cleanup, pr-check, verify
46
+ - `full`:14 阶段,不跳过
47
+
48
+ 底层阶段不变,transition 允许跨阶段跳跃;跳过阶段仍记入 `phaseHistory` 保持审计链。
49
+
50
+ - **specify**:BDD 行为规约阶段。产出 `behavior-spec.json` artifact + 空测试 stub;必须由用户通过 `gxpm specify confirm <id>` 显式确认后才能进入 implement。Owner:`specifier`。Skill:`gxpm-specifier`。规则:`docs/governance/gherkin-style.md`。
51
+ - 进入 `implement` 之前,phase-gate 校验 `behavior-spec.confirmedAt` 非空;老 issue(在 `SPECIFY_PHASE_CUTOFF = 2026-05-14T00:00:00Z` 前已进入 implement)可豁免。
52
+ <!-- END USER-SPECIFIED -->
53
+
54
+ ## 全局纪律
55
+
56
+ **所有 Agent 在所有阶段都必须遵守 `CANON.md` 中的行为宪法。** 本文档不再重复那些纪律,只保留项目级入口信息。
57
+
58
+ ## Truth Sources
59
+
60
+ 1. 用户本轮明确指令。
61
+ 2. `CANON.md` — 全局行为宪法
62
+ 3. `CONTEXT.md` — 共享语言/术语表
63
+ 4. `README.md` — 产品定位与架构哲学(本文档的简化版)
64
+ 5. `docs/architecture/gxpm-replacement-architecture.md`
65
+ 6. `docs/architecture/gxpm-v0-contract.md`
66
+ 7. `docs/architecture/layered-workflow-boundaries.md`
67
+ 8. `docs/architecture/scaffold-northstar.md`
68
+ 9. `docs/governance/development-contract.md`
69
+ 10. `docs/governance/template-authoring.md`
70
+ 11. `docs/governance/host-adapter.md`
71
+ 12. `docs/governance/skill-authoring.md`
72
+ 13. `docs/governance/gherkin-style.md`(specify 阶段强制规则)
73
+ 14. `docs/research/pmc-gstack-skill-study.md`
74
+
75
+ 如果来源冲突,先指出冲突和建议的最小安全路径。
76
+
77
+ ## Reference Projects(工程实践优先参考)
78
+
79
+ 以下项目作为 gxpm 工程实践与 skill 设计的参考借鉴对象,本地路径如下:
80
+
81
+ ### 行为规范参考框架
82
+
83
+ - **ZeroZ-lab/unified-skills** — AI Agent 工作制度架构的完整参考实现
84
+ 路径:`/Users/x/Desktop/Project/github/unified-skills`
85
+
86
+ gxpm 的分层边界设计(Command / Agent / Skill / Artifact / Hook)直接继承并转译自 unified-skills 的四层分离制度。以下实践应作为 gxpm 的长期行为约束参考:
87
+
88
+ | unified-skills 实践 | gxpm 对应层 | 借鉴状态 |
89
+ |---|---|---|
90
+ | CANON.md 10 条行为宪法 | `CANON.md` | ✅ 已吸收 |
91
+ | Command 阶段协议(12 命令) | CLI phase commands + `core/phase-gates.ts` | ✅ 已转译为状态机 |
92
+ | Agent 角色责任边界(24 角色) | `agents/*.md` + future Agent Runtime | 🟡 结构存在,Runtime 待建 |
93
+ | Skill 能力注入(53 技能) | `skills/*/SKILL.md` | ✅ 已吸收模式 |
94
+ | `./validate` 治理检查 | `bun run check` + `scripts/scaffold-check.ts` | ✅ 已吸收 |
95
+ | Hooks 安全护栏(SessionStart / careful / freeze) | `core/hook-engine.ts` + `.githooks/` | ✅ 已转译 |
96
+ | 文档产物链(`docs/features/YYYYMMDD-<name>/`) | `.gxpm/issues/<id>/artifacts/` + `reports/` | ✅ 已转译为 JSON artifact |
97
+ | artifact_type 路由(software / document / article / deck / visual) | `issueType`(feature / meta / spike) | 🟡 可扩展 |
98
+ | Agent Army 并行审查模式 | future Agent Runtime | 🔴 待实现 |
99
+
100
+ **关键约束**:unified-skills 是 gxpm 的**上游行为规范来源**,不是运行时依赖。gxpm 吸收其分层原则和纪律设计,但用 state graph + capability runtime + evidence store 重新实现为可执行产品。
101
+
102
+ ### 其他工程参考
103
+
104
+ - **obra/superpowers** — 代理能力编排与权限管理参考
105
+ 路径:`/Users/x/Desktop/Project/github/superpowers`
106
+ - **garrytan/gstack** — 全栈 Agent 工具链与部署实践参考
107
+ 路径:`/Users/x/Desktop/Project/github/gstack`
108
+ - **affaan-m/everything-claude-code** — Claude Code 扩展生态与 skill 模式参考
109
+ 路径:`/Users/x/Desktop/Project/github/everything-claude-code`
110
+ - **Yeachan-Heo/oh-my-codex** — Codex CLI 工作流与 hook 设计参考
111
+ 路径:`/Users/x/Desktop/Project/github/oh-my-codex`
112
+ - **mattpocock/skills** — Skill 结构与类型驱动开发实践参考
113
+ 路径:`/Users/x/Desktop/Project/github/mattpocock-skills`
114
+
115
+ ## gxpm Config
116
+
117
+ - worktree.enforcement: required
118
+ - worktree.default: ask
119
+
120
+ 如需禁用 worktree,改为 `forbidden`。任何 `.gxpm/config.json` 中显式设置都会覆盖本段。
121
+
122
+ ## Commands
123
+
124
+ ```bash
125
+ bun test
126
+ bun run gen:skill-docs
127
+ bun run check
128
+ ```
129
+
130
+ ## Progressive Docs
131
+
132
+ - 全局纪律:`CANON.md`
133
+ - 产品定位与架构哲学:`README.md`
134
+ - 开发、验证、提交:`docs/governance/development-contract.md`
135
+ - skill 模板写法:`docs/governance/template-authoring.md`
136
+ - host adapter 扩展:`docs/governance/host-adapter.md`
137
+ - 产品架构:`docs/architecture/`
138
+ - 上游研究:`docs/research/`
139
+
140
+ <!-- gitnexus:start -->
141
+ # GitNexus — Code Intelligence
142
+
143
+ This project is indexed by GitNexus as **gxpm** (6575 symbols, 10872 relationships, 300 execution flows). Use GitNexus MCP tools (`query`, `context`, `impact`, `detect_changes`) to understand code, assess impact, and navigate safely. If index is stale, run `npx gitnexus analyze` first.
144
+
145
+ **Always Do:** run `impact` before editing any symbol; run `detect_changes` before committing; warn on HIGH/CRITICAL risk. **Never Do:** edit without impact analysis; ignore HIGH/CRITICAL risk; rename with find-and-replace; commit without `detect_changes`.
146
+
147
+ Resources: `gitnexus://repo/gxpm/context` (overview), `/clusters` (functional areas), `/processes` (execution flows), `/process/{name}` (step-by-step trace). Skill files: `gitnexus-exploring`, `gitnexus-impact-analysis`, `gitnexus-debugging`, `gitnexus-refactoring`, `gitnexus-guide`, `gitnexus-cli` under `.claude/skills/gitnexus/`.
148
+ <!-- gitnexus:end -->
package/CANON.md ADDED
@@ -0,0 +1,53 @@
1
+ # gxpm 行为宪法
2
+
3
+ > CANON.md 是 gxpm 的最高行为合同。它不描述某个具体技能怎么做,而是规定所有 Agent 在所有阶段都必须遵守的纪律。
4
+
5
+ ## 1. 真值优先
6
+
7
+ 先读本仓库真值和相关上游 skill/source,再改文件。来源冲突时,先指出冲突和建议的最小安全路径。
8
+
9
+ ## 2. Issue 驱动
10
+
11
+ 任何非平凡代码改动开始前,确认有对应 GXPM-N issue 处于正确阶段;否则先 `gxpm issue create --auto-id` 并走完 triage → plan → dispatch。
12
+
13
+ ## 3. Phase 不可臆测
14
+
15
+ 不从聊天记忆推断 phase 或完成状态。不确定下一步时,统一查 `gxpm issue next <id>`,不要自己拼 CLI。
16
+
17
+ ## 4. Artifact 先决
18
+
19
+ Phase 推进前先写完 artifact,再 `gxpm issue transition`。不要直接编辑 `.gxpm/issues/<id>/*.json`,统一通过 `gxpm artifact write` / `gxpm artifact edit`。
20
+
21
+ ## 5. 设计落盘
22
+
23
+ 方案、取舍、替代选项必须写到对应 artifact(triage-report / implementation-plan / ADR 等),不能只留在聊天里。下一个会话只读 `.gxpm/issues/<id>/` 也能恢复上下文是底线。
24
+
25
+ ## 6. 生成物纪律
26
+
27
+ 编辑 skill 时改 `*.tmpl`,再运行 `bun run gen:skill-docs`。生成物冲突只能通过模板和生成器解决,再重新生成。不手改生成产物当真值。
28
+
29
+ ## 7. Worktree 隔离
30
+
31
+ 进入 implement 前 `git status -sb` 检查未追踪文件;如有 3+ 个来源不明文件,默认走独立 worktree 隔离。`git worktree add` 之后必须 `cd` 进新 worktree 才能动代码。
32
+
33
+ ## 8. 证据可复核
34
+
35
+ browser/QA/review/ship 相关结论必须落到可复核证据。汇报包含路径、命令和验证证据。
36
+
37
+ ## 9. 安全门控
38
+
39
+ destructive cleanup、发布、合并、远端写操作前必须确认。不把 gxpm 写成 PMC/gstack wrapper,不引入 PMC/gstack 运行时依赖。不做 yes-machine。
40
+
41
+ ## 10. 失败归因
42
+
43
+ 不声称历史失败与本次无关,除非有 base/main 对照证据或仓库已有记录证明该失败是基线噪声。
44
+
45
+ ## 约束层级
46
+
47
+ ```text
48
+ CANON.md
49
+ ├─ 约束 Command:阶段不能跳过必要门控
50
+ ├─ 约束 Agent:角色不能越权自证通过
51
+ ├─ 约束 Skill:技能只能增加纪律,不能放松宪法
52
+ └─ 约束 Artifact:产物必须留下可审计证据
53
+ ```
package/CLAUDE.md ADDED
@@ -0,0 +1,60 @@
1
+ # gxpm Claude Bootstrap
2
+
3
+ 本文件只承担 Claude Code 的薄启动层。共享执行合同以 `AGENTS.md` 为准。
4
+
5
+ ## Load Order
6
+
7
+ 1. 先读 `AGENTS.md`。
8
+ 2. 涉及开发规范时读 `docs/governance/development-contract.md`。
9
+ 3. 涉及 skill 文档或 prompt 模板时读 `docs/governance/template-authoring.md`。
10
+ 4. 涉及 Codex/Claude/未来 host 输出时读 `docs/governance/host-adapter.md`。
11
+
12
+ ## Claude-Specific Notes
13
+
14
+ - 不要把 `/pm` 当 gxpm 的最终入口;PMC 只作为上游参考。
15
+ - 不要把 `/qa`、`/review`、`/ship` 的 gstack 实现直接 vendoring 到 gxpm;先抽象为 gxpm capability。
16
+ - 如果本地 `.claude/` 未来被脚手架生成或 symlink 到工作区,先确认 live install 风险,再改模板或生成器。
17
+
18
+ <!-- gitnexus:start -->
19
+ # GitNexus — Code Intelligence
20
+
21
+ This project is indexed by GitNexus as **gxpm** (6575 symbols, 10872 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
22
+
23
+ > If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.
24
+
25
+ ## Always Do
26
+
27
+ - **MUST run impact analysis before editing any symbol.** Before modifying a function, class, or method, run `gitnexus_impact({target: "symbolName", direction: "upstream"})` and report the blast radius (direct callers, affected processes, risk level) to the user.
28
+ - **MUST run `gitnexus_detect_changes()` before committing** to verify your changes only affect expected symbols and execution flows.
29
+ - **MUST warn the user** if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.
30
+ - When exploring unfamiliar code, use `gitnexus_query({query: "concept"})` to find execution flows instead of grepping. It returns process-grouped results ranked by relevance.
31
+ - When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use `gitnexus_context({name: "symbolName"})`.
32
+
33
+ ## Never Do
34
+
35
+ - NEVER edit a function, class, or method without first running `gitnexus_impact` on it.
36
+ - NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.
37
+ - NEVER rename symbols with find-and-replace — use `gitnexus_rename` which understands the call graph.
38
+ - NEVER commit changes without running `gitnexus_detect_changes()` to check affected scope.
39
+
40
+ ## Resources
41
+
42
+ | Resource | Use for |
43
+ |----------|---------|
44
+ | `gitnexus://repo/gxpm/context` | Codebase overview, check index freshness |
45
+ | `gitnexus://repo/gxpm/clusters` | All functional areas |
46
+ | `gitnexus://repo/gxpm/processes` | All execution flows |
47
+ | `gitnexus://repo/gxpm/process/{name}` | Step-by-step execution trace |
48
+
49
+ ## CLI
50
+
51
+ | Task | Read this skill file |
52
+ |------|---------------------|
53
+ | Understand architecture / "How does X work?" | `.claude/skills/gitnexus/gitnexus-exploring/SKILL.md` |
54
+ | Blast radius / "What breaks if I change X?" | `.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md` |
55
+ | Trace bugs / "Why is X failing?" | `.claude/skills/gitnexus/gitnexus-debugging/SKILL.md` |
56
+ | Rename / extract / split / refactor | `.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md` |
57
+ | Tools, resources, schema reference | `.claude/skills/gitnexus/gitnexus-guide/SKILL.md` |
58
+ | Index, status, clean, wiki CLI commands | `.claude/skills/gitnexus/gitnexus-cli/SKILL.md` |
59
+
60
+ <!-- gitnexus:end -->
package/CONTEXT.md ADDED
@@ -0,0 +1,49 @@
1
+ # gxpm Shared Language (CONTEXT.md)
2
+
3
+ > This file is the single source of truth for domain terminology used across the gxpm project.
4
+ > Update it inline during `/grill` sessions when terms are resolved or sharpened.
5
+
6
+ ## Language
7
+
8
+ **Issue tracker**:
9
+ The tool that hosts a repo's issues — GitHub Issues, Linear, a local `.gxpm/issues/` markdown convention, or similar.
10
+ _Avoid_: backlog manager, backlog backend, issue host
11
+
12
+ **Issue**:
13
+ A single tracked unit of work inside an **Issue tracker** — a bug, task, PRD, or slice produced by `/planning`.
14
+ _Avoid_: ticket (use only when quoting external systems that call them tickets)
15
+
16
+ **Triage role**:
17
+ A canonical state-machine label applied to an **Issue** during triage (e.g. `needs-triage`, `ready-for-agent`). Each role maps to a real label string in the **Issue tracker** via `docs/agents/triage-labels.md`.
18
+
19
+ **Phase**:
20
+ A canonical stage in the gxpm delivery pipeline: `triage` → `plan` → `dispatch` → `implement` → `local-verify` → `ac-check` → `self-review` → `ship` → `pr-check` → `verify` → `qa` → `land`.
21
+
22
+ **Artifact**:
23
+ A machine-readable JSON document persisted under `.gxpm/issues/<id>/artifacts/`. Each phase transition requires a specific artifact type as gate evidence.
24
+
25
+ **Autopilot Grant**:
26
+ A persisted `autopilot-grant` artifact that records the user's explicit authorization for an agent to complete a gxpm workflow autonomously within a named profile, including allowed actions, hard stops, and lifecycle status.
27
+
28
+ **Worktree**:
29
+ A git worktree used to isolate feature branch development from the canonical main checkout.
30
+
31
+ **Claim**:
32
+ A soft-state lock indicating which session is currently executing an issue. Not a write lock — ownership records the latest writing session for hook warnings.
33
+
34
+ **Skill**:
35
+ A reusable agent capability loaded by the host (Codex/Claude). Each skill is a self-contained directory with a `SKILL.md` file. gxpm skills live under `skills/` and are installed to the host's skill directory.
36
+
37
+ ## Relationships
38
+
39
+ - An **Issue tracker** holds many **Issues**
40
+ - An **Issue** carries one **Triage role** at a time
41
+ - An **Issue** progresses through one **Phase** at a time
42
+ - A **Phase** transition requires one **Artifact**
43
+ - An **Autopilot Grant** may authorize autonomous execution for one **Issue**
44
+ - A **Session** may **Claim** one **Issue** at a time
45
+
46
+ ## Flagged ambiguities
47
+
48
+ - "backlog" was previously used to mean both the *tool* hosting issues and the *body of work* inside it — resolved: the tool is the **Issue tracker**; "backlog" is no longer used as a domain term.
49
+ - "backlog backend" / "backlog manager" — resolved: collapsed into **Issue tracker**.
package/DEBUG.md ADDED
@@ -0,0 +1,59 @@
1
+ # GXPM-111 Test Baseline Debug Notes
2
+
3
+ ## Observations
4
+
5
+ - `bun test test/install-skill.test.ts --timeout 30000` reproduces a hard failure at `test/install-skill.test.ts:77`.
6
+ - The failing assertion expects `gxpm-explore-codebase/scripts/summarize-communities.ts` to be installed.
7
+ - `rg --files skills | rg '/scripts/'` returns no skill script files in the current repository.
8
+ - `scripts/discover-skills.ts` only reports `scripts/` files that physically exist beside a skill.
9
+ - `core/state.ts` and `core/artifacts.ts` fire-and-forget `maybeSyncIssue()` after issue creation, phase transitions, artifact writes, and archive changes.
10
+ - `core/issue-sync.ts` resolves sync config through `getConfigValue()`, whose precedence is env -> repo config -> global config. That means ordinary temp-root tests can inherit live Linear sync from the shell or global gxpm config.
11
+ - Prior baseline checks showed `issue-list` becomes stable when sync is explicitly disabled, while dedicated `issue-sync.test.ts` passes with repo-local fake Linear config.
12
+
13
+ ## Hypotheses
14
+
15
+ ### H1: Ordinary tests inherit live sync configuration from env/global config (ROOT HYPOTHESIS)
16
+
17
+ - Supports: issue-heavy tests create many local issues, and issue creation triggers `maybeSyncIssue()` asynchronously.
18
+ - Supports: `getConfigValue()` reads env/global config even when a test passes an isolated temp root.
19
+ - Supports: disabling sync made `issue-list` stable, while repo-local fake sync tests still pass.
20
+ - Conflicts: none found.
21
+ - Test: add test-runtime sync isolation so only repo-local `.gxpm/config.json` can enable sync under `NODE_ENV=test`, then rerun `issue-list` and `issue-sync`.
22
+
23
+ ### H2: issue-list itself has inefficient list/archive logic
24
+
25
+ - Supports: failures concentrate in tests that create many issues.
26
+ - Conflicts: the same tests stabilize when sync is disabled, pointing outside list logic.
27
+ - Test: rerun `issue-list` after sync isolation without changing list code.
28
+
29
+ ### H3: install-skill implementation dropped script copying
30
+
31
+ - Supports: failing test is about script installation.
32
+ - Conflicts: `discoverScripts()` and `installSkill()` still copy discovered script files; the repository simply has no `skills/**/scripts/*` assets.
33
+ - Test: change the stale real-repo expectation and keep script discovery covered by fixture-based tests.
34
+
35
+ ## Experiments
36
+
37
+ - Reproduced `install-skill.test.ts` failure on the stale hard-coded script path.
38
+ - Inspected `discover-skills.ts` and `install-skill.ts`; script install behavior is data-driven and only copies existing files.
39
+ - Inspected `issue-sync.ts`, `state.ts`, and `artifacts.ts`; temp-root issue operations can trigger external sync through inherited config.
40
+ - After test-runtime sync isolation, `bun test test/issue-list.test.ts --timeout 30000` passed 23 tests in 6.70s.
41
+ - After replacing the stale real-repo script assertion with fixture coverage, `bun test test/install-skill.test.ts --timeout 30000` passed 7 tests.
42
+ - After adding env/global sync isolation coverage, `bun test test/issue-sync.test.ts --timeout 30000` passed 12 tests.
43
+
44
+ ## Root Cause
45
+
46
+ The baseline combines two existing drifts: ordinary tests can accidentally inherit live sync configuration despite using temp roots, and `install-skill.test.ts` still expects a skill script file that no longer exists in this repository.
47
+
48
+ ## Fix Plan
49
+
50
+ - Isolate sync config during `NODE_ENV=test` so env/global sync cannot activate ordinary temp-root tests; allow repo-local sync config for dedicated fake Linear tests.
51
+ - Restore environment cleanup in sync tests for all sync-related env vars.
52
+ - Replace the stale script expectation in `install-skill.test.ts` with a current contract: references install from the repo, and missing script assets are not invented.
53
+ - Verify with focused tests, full `bun test --timeout 30000`, `bun run check`, and `git diff --check`.
54
+
55
+ ## Fix
56
+
57
+ - `core/issue-sync.ts` now resolves sync values through a test-aware helper. In `NODE_ENV=test`, unless `GXPM_TEST_ALLOW_LIVE_SYNC=1` is set, only repo-local `.gxpm/config.json` can enable sync.
58
+ - `test/issue-sync.test.ts` now restores sync-related env vars and verifies env/global sync config is ignored during tests.
59
+ - `test/install-skill.test.ts` now keeps repository reference installation coverage and uses a temp fixture to prove script assets are copied when a skill actually owns them.
@@ -0,0 +1,25 @@
1
+ # ISSUE_CONTEXT — GXPM-138
2
+
3
+ > 这是 gxpm 自动生成的上下文恢复文件。
4
+ > 如果 AI 代理忘记了当前正在处理的 issue,请阅读此文件。
5
+
6
+ - **Issue ID**: `GXPM-138`
7
+ - **当前阶段**: `implement`
8
+ - **分支**: `gxpm-GXPM-138`
9
+ - **工作目录**: `/Users/x/Desktop/Project/gxpm/.gxpm/worktrees/gxpm-GXPM-138`
10
+ - **更新时间**: 2026-05-20T01:09:27.405Z
11
+
12
+ ## 快速恢复
13
+
14
+ 如果你忘记了当前 issue,运行以下命令恢复上下文:
15
+
16
+ ```bash
17
+ gxpm issue context --auto
18
+ ```
19
+
20
+ ## 下一步
21
+
22
+ 下一阶段: `local-verify`
23
+
24
+ ---
25
+ *此文件由 gxpm 自动生成,请勿手动编辑。*
package/README.md ADDED
@@ -0,0 +1,143 @@
1
+ # gxpm
2
+
3
+ > **AI Agent 工作制度架构 + 工作流 + 状态机的可执行产品**
4
+ >
5
+ > 形态:基于文档驱动的制度套件 + CLI 运行时
6
+
7
+ gxpm 是给 AI Agent 建立的一套**"公司制操作系统"**:以 Markdown/JSON 文档承载治理规则与角色契约,以 CLI 运行时解析执行这些规则,驱动 Agent 在严格状态机中按 phase 交付,最终以 commit 切分阶段边界,以 skill 注入专业能力,将所有证据与事实持久化到本地文件系统,实现可审计、可中断、可恢复的全自动 issue 交付闭环。
8
+
9
+ 它面向完全替代 PMC 和 gstack,会系统吸收两者已验证有效的能力,然后重构成统一的原生产品:
10
+
11
+ - 从 PMC 继承 Linear-first 项目管理、issue phase、状态门禁、交付产物和可恢复执行。
12
+ - 从 gstack 继承技能框架、浏览器 runtime、QA/review/ship/investigate 流水线、上下文恢复、自学习和团队化安装。
13
+ - 在 gxpm 中重新定义统一的 state graph、capability runtime、agent execution loop、browser evidence layer 和 release governance。
14
+
15
+ 它不是 PMC 的兼容壳,也不是 gstack 的插件集合。所有设计都服务于**独立产品闭环**。
16
+
17
+ ---
18
+
19
+ ## 架构哲学
20
+
21
+ ### 四维分工
22
+
23
+ | 维度 | 职责 | 在 gxpm 中的体现 |
24
+ |---|---|---|
25
+ | **commit** | 阶段切分 | git worktree 隔离 + phase transition,物理与逻辑双重边界 |
26
+ | **Agent** | 角色分工 | triage/plan/implement/review/QA/land owner,责任视角而非人格模板 |
27
+ | **skill** | 能力注入 | `skills/*/SKILL.md` 可发现、可加载、可校验的方法目录 |
28
+ | **证据/事实** | 持久存储 | `artifacts/*.json` + `evidence/` + `state.json`,本地文件系统为唯一真值 |
29
+
30
+ ### 五层架构
31
+
32
+ ```
33
+ L1: 制度文档层 (Document Governance)
34
+ CANON.md / AGENTS.md / CONTEXT.md / docs/governance/*.md
35
+ ── 定义不可破坏的规则、术语、开发合同、架构决策
36
+
37
+ L2: 角色与技能层 (Agent & Skill Surface)
38
+ agents/*.md / skills/*/SKILL.md / templates/*.tmpl
39
+ ── Agent 是责任视角,Skill 是可加载能力,均通过文档声明契约
40
+
41
+ L3: 工作流编排层 (Workflow Orchestration)
42
+ workflows/*.yml / core/phase-gates.ts / PHASE_GATE_RULES
43
+ ── 12-phase pipeline,每步有输入 artifact、输出 artifact、gate 规则
44
+
45
+ L4: 状态机执行层 (State Machine Runtime)
46
+ core/state.ts / core/capabilities.ts / CLI commands
47
+ ── 强制执行 transition 顺序,检查 worktree/artifact gate,写事件日志
48
+
49
+ L5: 证据与恢复层 (Evidence & Recovery Store)
50
+ .gxpm/issues/<id>/{state,artifacts,evidence,memory}/
51
+ ── 文件系统为唯一真值,支持新会话零上下文恢复
52
+ ```
53
+
54
+ ### 核心原则
55
+
56
+ 1. **文档即制度,制度可执行** —— 治理规则以文本形式存在,被 CLI 解析、被模板引擎生成、被 hook 校验、被 Agent 加载。
57
+ 2. **本地 state 永远比外部系统更权威** —— phase JSON artifact 比 markdown report 更权威;`state.json` 比 Linear comment、PR body、聊天上下文更权威。
58
+ 3. **所有 transition 都必须可审计、可重放、可恢复** —— 事件 append-only 写入 `events.jsonl`,`graph.json` 记录完整 transition 历史。
59
+ 4. **Command 只路由,Agent 只担责,Skill 只注入,Artifact 只存真值** —— 分层边界不可漂移。
60
+
61
+ ---
62
+
63
+ ## 初始化产物
64
+
65
+ - `AGENTS.md`:本仓库代理规则。
66
+ - `CANON.md`:全局行为宪法。
67
+ - `CONTEXT.md`:共享语言与领域术语表。
68
+ - `package.json`:Bun/TypeScript 脚手架入口。
69
+ - `hosts/`:Codex 与 Claude Code 的 host adapter 注册。
70
+ - `scripts/`:skill 模板发现、生成和脚手架检查。
71
+ - `bin/`:未来安装/升级/检查命令的稳定入口。
72
+ - `docs/governance/`:代理开发规范、模板写法和 host adapter 治理。
73
+ - `docs/research/pmc-gstack-skill-study.md`:PMC 与 gstack 的调查结论。
74
+ - `docs/architecture/gxpm-replacement-architecture.md`:替代型二代架构。
75
+ - `docs/architecture/gxpm-v0-contract.md`:gxpm V0 合同与边界。
76
+ - `docs/architecture/layered-workflow-boundaries.md`:分层工作流边界。
77
+ - `docs/architecture/scaffold-northstar.md`:借鉴 gstack 的脚手架北极星。
78
+ - `docs/roadmap/initial-roadmap.md`:初始路线图。
79
+ - `skills/gxpm/SKILL.md.tmpl`:gxpm skill 模板真值。
80
+ - `skills/gxpm/SKILL.md`:由模板生成的 gxpm skill 入口。
81
+
82
+ ---
83
+
84
+ ## 快速开始
85
+
86
+ ```bash
87
+ git clone https://github.com/laozhong86/gxpm.git ~/gxpm && cd ~/gxpm
88
+ bun install && bun link
89
+
90
+ cd /path/to/your/project
91
+ gxpm init # 初始化项目(hooks + skills + config)
92
+ gxpm doctor --json # 健康检查
93
+ gxpm verify # 端到端验证
94
+ ```
95
+
96
+ Agent 自举协议见 `docs/INSTALL_FOR_AGENTS.md`。
97
+
98
+ ---
99
+
100
+ ## 本地命令
101
+
102
+ ```bash
103
+ bun test
104
+ bun run gen:skill-docs
105
+ bun run check
106
+
107
+ gxpm issue create --auto-id
108
+ gxpm issue status <id>
109
+ gxpm doctor --fix
110
+ gxpm upgrade
111
+ gxpm verify
112
+
113
+ bin/gxpm workspace plan local-demo
114
+ bin/gxpm run list local-demo
115
+ bin/gxpm orchestrator tick --dry-run
116
+ bin/gxpm artifact list local-demo
117
+ bin/gxpm artifact read local-demo acceptance-contract
118
+ ```
119
+
120
+ 完整 phase gate 命令由 `skills/gxpm/SKILL.md` 生成,真值来自 `core/phase-gates.ts`。
121
+
122
+ ---
123
+
124
+ ## 行为规范参考框架
125
+
126
+ gxpm 的分层架构设计直接继承并转译自 [ZeroZ-lab/unified-skills](https://github.com/ZeroZ-lab/unified-skills) 的四层分离制度:
127
+
128
+ | 层 | unified-skills | gxpm |
129
+ |---|---|---|
130
+ | 宪法 | CANON.md(10 条行为宪法) | CANON.md(10 条行为宪法) |
131
+ | 阶段协议 | 12 个 Command(/refine /plan /build /review /ship) | 12-phase state machine + CLI commands |
132
+ | 角色责任 | 24 个 Agent(7 核心 + 17 审查/侦察) | `agents/*.md` + future Agent Runtime |
133
+ | 能力注入 | 53 个 Skill(SKILL.md) | `skills/*/SKILL.md`(host-facing) |
134
+ | 产物链 | `docs/features/YYYYMMDD-<name>/` | `.gxpm/issues/<id>/artifacts/*.json` |
135
+ | 治理检查 | `./validate` | `bun run check` + `scripts/scaffold-check.ts` |
136
+
137
+ unified-skills 是 gxpm 的**上游行为规范来源**,不是运行时依赖。gxpm 吸收其分层原则和纪律设计,但用 state graph + capability runtime + evidence store 重新实现为可执行产品。
138
+
139
+ 本地参考路径:`/Users/x/Desktop/Project/github/unified-skills`
140
+
141
+ ## 当前边界
142
+
143
+ 当前已具备脚手架、host adapter、生成检查、`.gxpm` state graph、phase artifact gate、checkpoint/resume、原生 wiki init/update/query/context/eval,以及第一批 execution runtime 原语:run ledger、workspace runtime 和只读 orchestrator dry-run。下一步应继续把 PMC/gstack 能力拆成 gxpm 原生模块,并围绕 V0 最小替代闭环补齐真实 agent run、browser evidence 和 release governance。
package/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0.0
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: cleanup-auditor
3
+ description: 跨 issue 代码清理审计。负责在 cleanup 阶段审查多 issue worktree 合并后的代码质量,识别重复、命名不一致、接口错位和死代码。
4
+ role: quality
5
+ ---
6
+
7
+ # Agent: Cleanup Auditor
8
+
9
+ ## 负责
10
+ - 扫描同一 worktree 下多个 issue 的代码变更,识别重复逻辑
11
+ - 检查跨 issue 的命名一致性(函数、类型、变量)
12
+ - 验证 issue 之间的接口是否对齐(输入/输出格式、错误处理)
13
+ - 识别被后续 issue 替代但未删除的死代码
14
+ - 检查测试覆盖是否有冗余(同一边界条件被多个 issue 测试)
15
+
16
+ ## 不负责
17
+ - 单 issue 内部的代码质量(Code Quality Reviewer 的职责)
18
+ - 安全漏洞扫描(Security Reviewer 的职责)
19
+ - 性能优化(Performance Auditor 的职责)
20
+ - 实际执行重构(只识别问题,不修改代码)
21
+
22
+ ## 输入
23
+ - 当前 worktree 中所有 issue 的代码变更 diff
24
+ - 各 issue 的 implementation-plan 和 behavior-spec
25
+ - 现有代码库的术语表(CONTEXT.md)
26
+ - cleanup-report artifact(初始为空,由本角色填充)
27
+
28
+ ## 输出
29
+ - `cleanup-report` artifact 中的审计发现
30
+ - 每条 finding 包含:category(duplicate/rename/interface/dead-code/test-dedup)、location、rationale、recommendation
31
+
32
+ ## 审查维度
33
+
34
+ | 维度 | 检查点 |
35
+ |------|--------|
36
+ | 重复代码 | 两个+ issue 是否引入了功能相同的函数/模块 |
37
+ | 命名一致性 | 同一概念在不同 issue 中是否使用不同名称 |
38
+ | 接口对齐 | Issue A 的输出是否是 Issue B 期望的输入格式 |
39
+ | 死代码 | 某个 issue 的实现是否被后续 issue 完全替代 |
40
+ | 测试冗余 | 多个 issue 的测试是否覆盖了相同的边界条件 |
41
+
42
+ ## 红旗清单 / HARD-GATE
43
+
44
+ - **同一 worktree 中存在功能完全重复的模块(未提取)** → Blocking
45
+ - **跨 issue 的接口格式不兼容且无转换层** → Blocking
46
+ - **死代码占比 > 10%** → Important
47
+ - **同一概念有 3+ 种不同命名** → Important
48
+ - **测试冗余导致 CI 时间增加 > 20%** → Important
49
+
50
+ ## 验证清单
51
+
52
+ - [ ] 所有 issue 的变更范围已扫描
53
+ - [ ] 重复代码已标记并推荐提取位置
54
+ - [ ] 命名不一致已列出统一建议
55
+ - [ ] 接口错位已说明影响范围和修复方案
56
+ - [ ] 死代码已列出删除理由
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: grill-master
3
+ description: 压力测试计划与假设。负责在交付前暴露计划中的盲区、矛盾和不一致。
4
+ ---
5
+
6
+ # Agent: Grill Master
7
+
8
+ ## 负责
9
+ - 对照领域模型质疑计划中的每个决策
10
+ - 精炼术语,确保上下文中的词汇一致
11
+ - 内联更新 `CONTEXT.md` 和 ADR 作为决策结晶
12
+ - 在 triage 和 plan 阶段暴露盲区
13
+
14
+ ## 不负责
15
+ - 替用户做最终决定(只暴露问题,不裁决)
16
+ - 直接执行实现(Implementer 的职责)
17
+ - 定义工作流状态机(Command 的职责)
18
+
19
+ ## 调用 Skill
20
+ - `gxpm-grill` — 压力测试方法论与流程
21
+ - `gxpm-architecture` — 架构深度分析(需要时)
22
+
23
+ ## 输出
24
+ - 澄清后的 scope 和 acceptance criteria
25
+ - 更新后的 `CONTEXT.md`(术语和决策)
26
+ - ADR(架构决策记录)
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: implementer
3
+ description: 增量实现与四维自审。负责将已批准的计划转化为可验证的代码变更。
4
+ ---
5
+
6
+ # Agent: Implementer
7
+
8
+ ## 负责
9
+ - 按已批准的 `implementation-plan` 和 `dispatch-handoff` 执行增量实现
10
+ - 编写测试并验证实现(编译、类型检查、功能测试)
11
+ - 执行四维自审:Completeness / Quality / Discipline / Testing
12
+ - 遇到阻塞时及时升级(BLOCKED / NEEDS_CONTEXT),不猜测
13
+ - 遵循现有代码模式和架构约束
14
+
15
+ ## 不负责
16
+ - 定义整个工作流状态机(Command 的职责)
17
+ - 修改 CANON 纪律(CANON 是上层合同)
18
+ - 把方法论复制到自己内部(方法论应在 Skill)
19
+ - 无计划指导时自行拆分文件或重构范围外代码
20
+
21
+ ## 调用 Skill
22
+ - `gxpm-implementer` — 实现方法论与报告格式
23
+ - `gxpm-build` — 编译与类型检查验证
24
+ - `gxpm-verify` — 本地验证管道执行
25
+ - `gxpm-hygiene` — 提交卫生与原子提交纪律
26
+ - `gxpm-debug-issue` — 调试与根因分析(失败时)
27
+ - `gxpm-refactor-safely` — 安全重构(需要时)
28
+
29
+ ## 输出
30
+ - 代码变更(feature branch 上的 commit)
31
+ - 自审报告(DONE / DONE_WITH_CONCERNS / BLOCKED / NEEDS_CONTEXT)
32
+ - 测试证据与验证结果