@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
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: gxpm-hygiene
3
+ description: Pre-commit hygiene and atomic commit discipline. Use before every commit, or when preparing changes for self-review or ship.
4
+ ---
5
+
6
+ # gxpm-hygiene
7
+
8
+ ## 入口条件
9
+
10
+ 在以下场景触发本 skill:
11
+
12
+ - 每次提交前
13
+ - 准备变更进行自审(`self-review`)时
14
+ - 准备进入 `ship` 阶段、整理 PR 时
15
+
16
+ **Skill 边界**:本 skill 聚焦 **git 层纪律**(即将提交的内容本身),不验证代码是否可编译或通过测试。编译与测试验证是 `gxpm-build`(开发中)和 `gxpm-verify`(`local-verify` 关卡)的职责。在 hygiene 中重复运行那些检查会造成冗余循环并模糊责任边界。
17
+
18
+ 在 gxpm 工作流中:
19
+ - `implement` 阶段每次提交前都运行本检查清单
20
+ - `self-review` 阶段必须确认所有提交都遵循了本纪律
21
+ - `ship` 阶段将本检查清单作为 PR 准备的一部分
22
+
23
+ ## 可操作流程
24
+
25
+ 按以下顺序执行预提交检查:
26
+
27
+ ```bash
28
+ # 1. Review what you're about to commit
29
+ git diff --staged
30
+
31
+ # 2. Secret leak scan (manual review)
32
+ git diff --staged --name-only | xargs grep -l "\.env" 2>/dev/null || true
33
+ # Also review diff for high-entropy strings that look like keys/tokens
34
+
35
+ # 3. Confirm atomicity — one logical change
36
+ git diff --staged --stat
37
+ ```
38
+
39
+ **为什么这里不运行 `bun run check` / `bun test` / `bun run build`?**
40
+ These are the responsibility of `gxpm-build` (during development) and `gxpm-verify` (at the `local-verify` gate). Running them in hygiene creates redundant cycles and blurs accountability.
41
+
42
+ ### 原子提交规则
43
+
44
+ - **One logical change per commit.** Do not mix refactoring, features, and unrelated cleanups.
45
+ - **Generated files:** If `.tmpl` was modified, `bun run gen:skill-docs` must run first.
46
+ - **Issue reference:** Commit message must include `GXPM-N` reference.
47
+ - **Worktree discipline:** Main checkout stays on `main`. Feature work happens in dedicated worktrees.
48
+
49
+ ## 红旗清单 / 反模式
50
+
51
+ - Committing with `--no-verify` to bypass checks
52
+ - Build or tests failing at commit time
53
+ - Missing `GXPM-N` reference in commit message
54
+ - One commit mixing refactor + feature + cleanup
55
+ - Uncommitted generated files after modifying templates
56
+ - Committing secrets or `.env` files
57
+ - Running the same check twice without code changes in between
58
+
59
+ ## 验证清单 / 出口条件
60
+
61
+ 提交前必须确认:
62
+
63
+ - [ ] 已审查 `git diff --staged` 中的全部变更
64
+ - [ ] 已扫描潜在密钥/令牌泄漏和高熵字符串
65
+ - [ ] 本次提交只包含一个逻辑变更(原子性)
66
+ - [ ] 如修改了 `.tmpl`,已重新生成关联文件
67
+ - [ ] Commit message 包含 `GXPM-N` 引用
68
+ - [ ] 未使用 `--no-verify` 绕过检查
69
+ - [ ] 未提交 `.env` 或密钥文件
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: gxpm-implementer
3
+ description: Subagent implementer behavior template enforcing four-dimension self-review. Use when dispatching a task to an implementer subagent, or when a subagent needs structured self-review and reporting rules.
4
+ ---
5
+ <!-- AUTO-GENERATED from SKILL.md.tmpl - do not edit directly -->
6
+
7
+ # Implementer Subagent Prompt Template
8
+
9
+ Use this template when dispatching an implementer subagent through gxpm's dispatch phase.
10
+
11
+ ## 入口条件
12
+
13
+ 在以下场景使用本模板:
14
+
15
+ - 通过 gxpm 的 dispatch 阶段派遣 implementer subagent
16
+ - Subagent 需要结构化自审和报告规则
17
+
18
+ 派遣前填充以下 Task Header:
19
+
20
+ ```
21
+ You are implementing Task N: [task name]
22
+
23
+ ## Task Description
24
+
25
+ [FULL TEXT of task from implementation plan - paste it here]
26
+
27
+ ## Context
28
+
29
+ [Scene-setting: where this fits, dependencies, architectural context]
30
+ ```
31
+
32
+ ### 开始前确认
33
+
34
+ If you have questions about:
35
+ - The requirements or acceptance criteria
36
+ - The approach or implementation strategy
37
+ - Dependencies or assumptions
38
+ - Anything unclear in the task description
39
+
40
+ **Ask them now.** Raise any concerns before starting work.
41
+
42
+ ## 可操作流程
43
+
44
+ ### 你的职责
45
+
46
+ Once you're clear on requirements:
47
+ 1. Implement exactly what the task specifies
48
+ 2. Write tests (following TDD if task says to)
49
+ 3. Verify implementation works:
50
+ - Load `/gxpm-build` to verify compilation and type checking
51
+ - Load `/gxpm-verify` to run the full verification pipeline and collect evidence
52
+ 4. Commit your work (load `/gxpm-hygiene` for pre-commit checklist)
53
+ 5. Self-review (see 验证清单 / 出口条件)
54
+ 6. Report back
55
+
56
+ Work from: [directory]
57
+
58
+ **While you work:** If you encounter something unexpected or unclear, **ask questions**.
59
+ It's always OK to pause and clarify. Don't guess or make assumptions.
60
+
61
+ ### 代码组织原则
62
+
63
+ You reason best about code you can hold in context at once, and your edits are more
64
+ reliable when files are focused. Keep this in mind:
65
+ - Follow the file structure defined in the plan
66
+ - Each file should have one clear responsibility with a well-defined interface
67
+ - If a file you're creating is growing beyond the plan's intent, stop and report
68
+ it as DONE_WITH_CONCERNS — don't split files on your own without plan guidance
69
+ - If an existing file you're modifying is already large or tangled, work carefully
70
+ and note it as a concern in your report
71
+ - In existing codebases, follow established patterns. Improve code you're touching
72
+ the way a good developer would, but don't restructure things outside your task.
73
+
74
+ ### 升级流程
75
+
76
+ It is always OK to stop and say "this is too hard for me." Bad work is worse than
77
+ no work. You will not be penalized for escalating.
78
+
79
+ **STOP and escalate when:**
80
+ - The task requires architectural decisions with multiple valid approaches
81
+ - You need to understand code beyond what was provided and can't find clarity
82
+ - You feel uncertain about whether your approach is correct
83
+ - The task involves restructuring existing code in ways the plan didn't anticipate
84
+ - You've been reading file after file trying to understand the system without progress
85
+
86
+ **How to escalate:** Report back with status BLOCKED or NEEDS_CONTEXT. Describe
87
+ specifically what you're stuck on, what you've tried, and what kind of help you need.
88
+ The controller can provide more context, re-dispatch with a more capable model,
89
+ or break the task into smaller pieces.
90
+
91
+ ## 红旗清单 / 反模式
92
+
93
+ - **不要擅自拆分文件。** 如果文件超出计划预期,报告 DONE_WITH_CONCERNS 而非自行拆分。
94
+ - **不要修改任务范围外的代码结构。** 遵循现有模式,只改进你正在接触的代码。
95
+ - **不要猜测需求。** 遇到不清楚的地方必须暂停并提问,不能假设。
96
+ - **不要忽视警告信号。** 连续阅读文件仍无法理解系统时应立即升级(BLOCKED/NEEDS_CONTEXT),而不是硬推。
97
+ - **不要在需要架构决策时独断。** 存在多个有效方案时必须上报。
98
+
99
+ ## 验证清单 / 出口条件
100
+
101
+ 报告前必须完成四维自审:
102
+
103
+ **Completeness:**
104
+ - Did I fully implement everything in the spec?
105
+ - Did I miss any requirements?
106
+ - Are there edge cases I didn't handle?
107
+
108
+ **Quality:**
109
+ - Is this my best work?
110
+ - Are names clear and accurate (match what things do, not how they work)?
111
+ - Is the code clean and maintainable?
112
+
113
+ **Discipline:**
114
+ - Did I avoid overbuilding (YAGNI)?
115
+ - Did I only build what was requested?
116
+ - Did I follow existing patterns in the codebase?
117
+
118
+ **Testing:**
119
+ - Do tests actually verify behavior (not just mock behavior)?
120
+ - Did I follow TDD if required?
121
+ - Are tests comprehensive?
122
+
123
+ **Verification:**
124
+ - Did I run `/gxpm-build` and confirm compilation passes?
125
+ - Did I run `/gxpm-verify` and collect evidence for all steps?
126
+ - Did I run `/gxpm-hygiene` before committing?
127
+
128
+ If you find issues during self-review, fix them now before reporting.
129
+
130
+ ### 报告格式
131
+
132
+ When done, report:
133
+ - **Status:** DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
134
+ - What you implemented (or what you attempted, if blocked)
135
+ - What you tested and test results
136
+ - Files changed
137
+ - Self-review findings (if any)
138
+ - Any issues or concerns
139
+
140
+ Use DONE_WITH_CONCERNS if you completed the work but have doubts about correctness.
141
+ Use BLOCKED if you cannot complete the task. Use NEEDS_CONTEXT if you need
142
+ information that wasn't provided. Never silently produce work you're unsure about.
@@ -0,0 +1,141 @@
1
+ ---
2
+ name: gxpm-implementer
3
+ description: Subagent implementer behavior template enforcing four-dimension self-review. Use when dispatching a task to an implementer subagent, or when a subagent needs structured self-review and reporting rules.
4
+ ---
5
+
6
+ # Implementer Subagent Prompt Template
7
+
8
+ Use this template when dispatching an implementer subagent through gxpm's dispatch phase.
9
+
10
+ ## 入口条件
11
+
12
+ 在以下场景使用本模板:
13
+
14
+ - 通过 gxpm 的 dispatch 阶段派遣 implementer subagent
15
+ - Subagent 需要结构化自审和报告规则
16
+
17
+ 派遣前填充以下 Task Header:
18
+
19
+ ```
20
+ You are implementing Task N: [task name]
21
+
22
+ ## Task Description
23
+
24
+ [FULL TEXT of task from implementation plan - paste it here]
25
+
26
+ ## Context
27
+
28
+ [Scene-setting: where this fits, dependencies, architectural context]
29
+ ```
30
+
31
+ ### 开始前确认
32
+
33
+ If you have questions about:
34
+ - The requirements or acceptance criteria
35
+ - The approach or implementation strategy
36
+ - Dependencies or assumptions
37
+ - Anything unclear in the task description
38
+
39
+ **Ask them now.** Raise any concerns before starting work.
40
+
41
+ ## 可操作流程
42
+
43
+ ### 你的职责
44
+
45
+ Once you're clear on requirements:
46
+ 1. Implement exactly what the task specifies
47
+ 2. Write tests (following TDD if task says to)
48
+ 3. Verify implementation works:
49
+ - Load `/gxpm-build` to verify compilation and type checking
50
+ - Load `/gxpm-verify` to run the full verification pipeline and collect evidence
51
+ 4. Commit your work (load `/gxpm-hygiene` for pre-commit checklist)
52
+ 5. Self-review (see 验证清单 / 出口条件)
53
+ 6. Report back
54
+
55
+ Work from: [directory]
56
+
57
+ **While you work:** If you encounter something unexpected or unclear, **ask questions**.
58
+ It's always OK to pause and clarify. Don't guess or make assumptions.
59
+
60
+ ### 代码组织原则
61
+
62
+ You reason best about code you can hold in context at once, and your edits are more
63
+ reliable when files are focused. Keep this in mind:
64
+ - Follow the file structure defined in the plan
65
+ - Each file should have one clear responsibility with a well-defined interface
66
+ - If a file you're creating is growing beyond the plan's intent, stop and report
67
+ it as DONE_WITH_CONCERNS — don't split files on your own without plan guidance
68
+ - If an existing file you're modifying is already large or tangled, work carefully
69
+ and note it as a concern in your report
70
+ - In existing codebases, follow established patterns. Improve code you're touching
71
+ the way a good developer would, but don't restructure things outside your task.
72
+
73
+ ### 升级流程
74
+
75
+ It is always OK to stop and say "this is too hard for me." Bad work is worse than
76
+ no work. You will not be penalized for escalating.
77
+
78
+ **STOP and escalate when:**
79
+ - The task requires architectural decisions with multiple valid approaches
80
+ - You need to understand code beyond what was provided and can't find clarity
81
+ - You feel uncertain about whether your approach is correct
82
+ - The task involves restructuring existing code in ways the plan didn't anticipate
83
+ - You've been reading file after file trying to understand the system without progress
84
+
85
+ **How to escalate:** Report back with status BLOCKED or NEEDS_CONTEXT. Describe
86
+ specifically what you're stuck on, what you've tried, and what kind of help you need.
87
+ The controller can provide more context, re-dispatch with a more capable model,
88
+ or break the task into smaller pieces.
89
+
90
+ ## 红旗清单 / 反模式
91
+
92
+ - **不要擅自拆分文件。** 如果文件超出计划预期,报告 DONE_WITH_CONCERNS 而非自行拆分。
93
+ - **不要修改任务范围外的代码结构。** 遵循现有模式,只改进你正在接触的代码。
94
+ - **不要猜测需求。** 遇到不清楚的地方必须暂停并提问,不能假设。
95
+ - **不要忽视警告信号。** 连续阅读文件仍无法理解系统时应立即升级(BLOCKED/NEEDS_CONTEXT),而不是硬推。
96
+ - **不要在需要架构决策时独断。** 存在多个有效方案时必须上报。
97
+
98
+ ## 验证清单 / 出口条件
99
+
100
+ 报告前必须完成四维自审:
101
+
102
+ **Completeness:**
103
+ - Did I fully implement everything in the spec?
104
+ - Did I miss any requirements?
105
+ - Are there edge cases I didn't handle?
106
+
107
+ **Quality:**
108
+ - Is this my best work?
109
+ - Are names clear and accurate (match what things do, not how they work)?
110
+ - Is the code clean and maintainable?
111
+
112
+ **Discipline:**
113
+ - Did I avoid overbuilding (YAGNI)?
114
+ - Did I only build what was requested?
115
+ - Did I follow existing patterns in the codebase?
116
+
117
+ **Testing:**
118
+ - Do tests actually verify behavior (not just mock behavior)?
119
+ - Did I follow TDD if required?
120
+ - Are tests comprehensive?
121
+
122
+ **Verification:**
123
+ - Did I run `/gxpm-build` and confirm compilation passes?
124
+ - Did I run `/gxpm-verify` and collect evidence for all steps?
125
+ - Did I run `/gxpm-hygiene` before committing?
126
+
127
+ If you find issues during self-review, fix them now before reporting.
128
+
129
+ ### 报告格式
130
+
131
+ When done, report:
132
+ - **Status:** DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
133
+ - What you implemented (or what you attempted, if blocked)
134
+ - What you tested and test results
135
+ - Files changed
136
+ - Self-review findings (if any)
137
+ - Any issues or concerns
138
+
139
+ Use DONE_WITH_CONCERNS if you completed the work but have doubts about correctness.
140
+ Use BLOCKED if you cannot complete the task. Use NEEDS_CONTEXT if you need
141
+ information that wasn't provided. Never silently produce work you're unsure about.
@@ -0,0 +1,282 @@
1
+ ---
2
+ name: gxpm-linear
3
+ description: Linear CLI integration for gxpm issue lifecycle management. Use when creating, updating, or querying Linear issues, syncing gxpm issues to Linear, or managing issue lifecycle via command line.
4
+ status: stable
5
+ ---
6
+ <!-- AUTO-GENERATED from SKILL.md.tmpl - do not edit directly -->
7
+
8
+ # gxpm-linear
9
+
10
+ Linear 协作前门,通过 CLI 与 issue tracker 交互。**不使用 MCP** — 所有操作走 `linear` 命令。
11
+
12
+ ## 入口条件
13
+
14
+ - 需要创建/更新/查询 Linear issue
15
+ - gxpm issue 需要同步到 Linear(`maybeSyncIssue` 的替代路径)
16
+ - Sprint 规划、backlog 分类、批量操作
17
+ - 需要读取 issue 评论获取上下文
18
+
19
+ ### 前置条件
20
+
21
+ ```bash
22
+ # CLI 已安装在
23
+ /opt/homebrew/bin/linear
24
+
25
+ # 如不在 PATH
26
+ export PATH="/opt/homebrew/bin:$PATH"
27
+ ```
28
+
29
+ ### 认证
30
+
31
+ ```bash
32
+ linear auth login # 首次使用或 token 过期
33
+ linear config # 查看默认 team/workspace
34
+ ```
35
+
36
+ > **认证收敛**:gxpm 内置 issue-sync 直接调用 `linear` CLI,**不再单独配置 API key**。
37
+ > 只需确保 `linear auth login` 已完成,gxpm 会自动复用其认证状态。
38
+ > 旧配置 `sync.linearApiKey` 和 `GXPM_LINEAR_API_KEY` 已废弃,可安全移除。
39
+
40
+ ## 可操作流程
41
+
42
+ ## CLI Commands
43
+
44
+ ### Issue Commands
45
+
46
+ | Task | Command |
47
+ |------|---------|
48
+ | List my issues | `linear issue list --team GXG --sort priority --json` |
49
+ | List all issues | `linear issue list --team GXG --all --sort priority --json` |
50
+ | Filter by state | `linear issue list --team GXG --state todo --sort priority -A --json` |
51
+ | Filter by project | `linear issue list --team GXG --project "Name" --sort priority -A --json` |
52
+ | Search by text | `linear issue list --team GXG --query "keyword" --sort priority -A --json` |
53
+ | View issue | `linear issue view GXG-123 --json` |
54
+ | View with children | `linear issue children GXG-123 --json` |
55
+ | Create issue | `linear issue create -t "Title" --team GXG --priority 2 --label feature --json` |
56
+ | Create with parent | `linear issue create -t "Sub-task" --team GXG --parent GXG-123 --json` |
57
+ | Create with desc file | `cat desc.md \| linear issue create -t "Title" --team GXG --json` |
58
+ | Update state | `linear issue update GXG-123 --state "In Progress" --json` |
59
+ | Move (shorthand) | `linear issue move GXG-123 "In Progress"` |
60
+ | Update title | `linear issue update GXG-123 -t "New Title" --json` |
61
+ | Set priority | `linear issue priority GXG-123 2` |
62
+ | Assign | `linear issue assign GXG-123 self` |
63
+ | Set estimate | `linear issue estimate GXG-123 3` |
64
+ | Add comment | `linear issue comment add GXG-123 --body "text" --json` |
65
+ | Batch create | `linear issue create-batch --json < batch.json` |
66
+ | Dry-run preview | `linear issue create -t "Title" --team GXG --dry-run --json` |
67
+
68
+ ### Comment Subcommands
69
+
70
+ | Task | Command |
71
+ |------|---------|
72
+ | Add comment | `linear issue comment add GXG-123 --body "text" --json` |
73
+ | Update comment | `linear issue comment update <commentId> --body "text"` |
74
+ | List/Delete comments | Use `linear api` GraphQL queries/mutations |
75
+
76
+ **Note**: `linear issue comment list` and `linear issue comment delete` were **removed** in CLI v3.2.0. Use `linear api` for comment reads and deletes.
77
+
78
+ ### Issue Relations
79
+
80
+ | Task | Command |
81
+ |------|---------|
82
+ | List relations | `linear issue relation list GXG-123 --json` |
83
+ | Add relation | `linear issue relation add GXG-123 blocked-by GXG-456 --json` |
84
+ | Delete relation | `linear issue relation delete <relationId>` |
85
+
86
+ ### Other Commands
87
+
88
+ | Task | Command |
89
+ |------|---------|
90
+ | List teams | `linear team list --json` |
91
+ | Team members | `linear user list --json` |
92
+ | Workflow states | `linear workflow-state list --json` |
93
+ | Labels | `linear label list --json` |
94
+ | Current cycle | `linear cycle current --json` |
95
+ | Next cycle | `linear cycle next --json` |
96
+ | List cycles | `linear cycle list --json` |
97
+ | List projects | `linear project list --json` |
98
+ | View project | `linear project view <slug> --json` |
99
+ | Create project | `linear project create --name "Name" --json` |
100
+ | List milestones | `linear milestone list --json` |
101
+ | List initiatives | `linear initiative list --json` |
102
+ | List documents | `linear document list --json` |
103
+ | List users | `linear user list --json` |
104
+ | Notifications | `linear notification list --json` |
105
+ | GraphQL escape hatch | `linear api '{ issues { nodes { id title } } }'` |
106
+
107
+ ### Troubleshooting
108
+
109
+ | Problem | Fix |
110
+ |---------|-----|
111
+ | Auth failure | Re-run `linear auth login` |
112
+ | Rate limited | Batch operations, add delays |
113
+ | "No team configured" | Add `--team GXG` or run `linear config` |
114
+ | "Sort must be provided" | Add `--sort priority` to `issue list` |
115
+ | CLI not found | Use full path `/Users/x/.nvm/versions/node/v25.8.0/bin/linear` |
116
+ | Wrong workflow states | Query `linear workflow-state list --json` first |
117
+
118
+
119
+ ## Workflows
120
+
121
+ ### Full Context = View + Comments
122
+
123
+ `linear issue view` 只返回标题、描述、状态和元数据。**评论是独立 API 调用。**
124
+
125
+ **规则**:接手 issue 时必须运行:
126
+ ```bash
127
+ linear issue view GXG-123 --json
128
+ ```
129
+ Comments require a GraphQL query via `linear api` (CLI v3.2.0 removed `issue comment list`).
130
+
131
+ 评论中可能包含 scope 定义、设计决策、PoC 结果、review 反馈、跨 agent 交接上下文。仅在批量 list/triage 时可跳过评论阅读。
132
+
133
+ ### Creating an Issue
134
+
135
+ 1. 搜索重复:`linear issue list --team GXG --query "keyword" --all --sort priority --json`
136
+ 2. 检测当前 git branch:`git branch --show-current`
137
+ 3. 起草 issue(标题、描述、标签、项目、团队、负责人、优先级)
138
+ 4. 呈现给用户确认
139
+ 5. 执行:
140
+ ```bash
141
+ linear issue create \
142
+ -t "[Domain] Clear description" \
143
+ --team GXG \
144
+ --priority 2 \
145
+ --label feature --label backend \
146
+ --json
147
+ ```
148
+ 6. 报告 issue identifier 和链接
149
+
150
+ ### Implementing a Linear Issue
151
+
152
+ 1. 获取完整上下文(view + comments)
153
+ 2. 移到 Todo:`linear issue update GXG-123 --state "Todo" --json`
154
+ 3. 读取 acceptance criteria 和依赖
155
+ 4. 创建 feature branch(命名含 issue ID)
156
+ 5. TDD 实现
157
+ 6. 完成后移到 In Review:`linear issue update GXG-123 --state "In Review" --json`
158
+ 7. 添加 completion comment:
159
+ ```bash
160
+ BRANCH=$(git branch --show-current)
161
+ linear issue comment add GXG-123 --body "## Completion Summary
162
+ **Branch:** \`$BRANCH\`
163
+ **PR:** <pr-url-or-pending>
164
+ **Summary:** <what was done>" --json
165
+ ```
166
+
167
+ ### Bulk Operations
168
+
169
+ 3+ issue 的批量操作:
170
+ 1. 收集所有目标 issue
171
+ 2. 以表格呈现:Issue ID、Current State、Proposed Change、Reason
172
+ 3. 加 `--dry-run` 预览
173
+ 4. 等用户确认后执行
174
+ 5. 报告摘要:N succeeded, N failed
175
+
176
+ ### Sub-Issue Management
177
+
178
+ 子 issue 继承父 issue:
179
+ - 相同 project 和 team
180
+ - 相同标签(除非有理由覆盖)
181
+ - 通过 parent 关系链接
182
+
183
+ ```bash
184
+ # 创建子 issue
185
+ linear issue create -t "Sub-task title" --team GXG --parent GXG-123 --json
186
+ # 或给已有 issue 设置 parent
187
+ linear issue update GXG-456 --parent GXG-123 --json
188
+ ```
189
+
190
+ ### Sprint Planning
191
+
192
+ 1. 收集当前状态:
193
+ ```bash
194
+ linear cycle current --json
195
+ linear cycle next --json
196
+ linear issue list --team GXG --state backlog --sort priority -A --json
197
+ linear user list --json
198
+ ```
199
+ 2. 分析:按优先级排序(P0 bugs > blockers > high-value features > tech debt)
200
+ 3. 以表格呈现计划:issue、priority、assignee、estimate、rationale
201
+ 4. 确认后批量分配到 cycle
202
+
203
+ ### Backlog Triage
204
+
205
+ 1. 拉取未分类项:
206
+ ```bash
207
+ linear issue list --team GXG --state triage --sort priority -A --json
208
+ linear issue list --team GXG --state backlog --sort priority -A --json
209
+ ```
210
+ 2. 对每个 issue 推荐:priority、labels、assignee、cycle placement
211
+ 3. 以表格呈现 triage 计划
212
+ 4. 确认后执行
213
+ 5. 标记 stale issue(3+ cycles 无活动)— 先提醒用户 review
214
+
215
+ ### Status Integrity
216
+
217
+ - 永远不要硬编码 state 名称,先查:
218
+ ```bash
219
+ linear workflow-state list --json
220
+ ```
221
+ - 关父 issue 前先查子 issue:
222
+ ```bash
223
+ linear issue children GXG-123 --json
224
+ ```
225
+ - 任何子 issue 未 Done 都不能关父 issue
226
+
227
+ ### Label Taxonomy
228
+
229
+ 应用标签前先确认存在:
230
+ ```bash
231
+ linear label list --json
232
+ ```
233
+
234
+ | Category | Labels | Rule |
235
+ |----------|--------|------|
236
+ | **Type** | `feature`, `bug`, `chore`, `tech-debt`, `spike` | 恰好一个 |
237
+ | **Domain** | `frontend`, `backend`, `infra`, `design`, `security`, `testing` | 1-2 个 |
238
+ | **Workflow** | `blocked`, `in-review`, `needs-design`, `needs-split` | 按需 |
239
+
240
+
241
+ ### 常用全局参数
242
+
243
+ | Flag | 说明 |
244
+ |------|------|
245
+ | `--json` | 机器可读输出(默认使用) |
246
+ | `--text` | 人类可读输出 |
247
+ | `--dry-run` | 预览不执行 |
248
+ | `--team <KEY>` | 指定 team(如 `GXG`) |
249
+
250
+ ### 操作原则
251
+
252
+ 1. **Issue 是单一真相源** — 所有需求、bug、变更都先落地 Linear issue
253
+ 2. **创建前先查重** — `linear issue list --query "keyword"` 避免重复
254
+ 3. **写操作需确认** — 批量操作先呈现表格,等用户点头再执行
255
+ 4. **状态完整性** — 子 issue 全 Done 才能关父 issue
256
+
257
+ ### Tips
258
+
259
+ - `--json` 优先于 `--text`,方便脚本解析
260
+ - `issue list` 默认只显示分配给当前用户的,加 `-A` 看全部
261
+ - `issue list` 必须加 `--sort`(`manual` 或 `priority`)
262
+ - GraphQL escape hatch: `linear api '{ issues { nodes { id title } } }'`
263
+
264
+ ## 红旗清单 / 反模式
265
+
266
+ - **不使用 MCP** — 所有操作走 `linear` 命令,禁止通过 MCP 操作 Linear
267
+ - 禁止绕过查重直接创建 issue
268
+ - 禁止未确认就执行批量写操作
269
+ - 禁止在子 issue 未完成时关闭父 issue
270
+ - 不要混用旧 API key 认证方式(`sync.linearApiKey`、`GXPM_LINEAR_API_KEY` 已废弃)
271
+
272
+ ## 验证清单 / 出口条件
273
+
274
+ - [ ] issue 创建/更新/查询结果与预期一致
275
+ - [ ] 同步后的 gxpm issue 与 Linear issue 状态一致
276
+ - [ ] 批量操作已获用户确认
277
+ - [ ] `--json` 输出可被脚本正确解析(如需要)
278
+
279
+ ## Read Next
280
+
281
+ - `docs/governance/development-contract.md`
282
+ - Main `/gxpm` skill for phase gate details