@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.
- package/AGENTS.md +148 -0
- package/CANON.md +53 -0
- package/CLAUDE.md +60 -0
- package/CONTEXT.md +49 -0
- package/DEBUG.md +59 -0
- package/ISSUE_CONTEXT.md +25 -0
- package/README.md +143 -0
- package/VERSION +1 -0
- package/agents/cleanup-auditor/cleanup-auditor.md +56 -0
- package/agents/grill-master.md +26 -0
- package/agents/implementer.md +32 -0
- package/agents/review-army/accessibility-reviewer.md +54 -0
- package/agents/review-army/code-quality-reviewer.md +54 -0
- package/agents/review-army/security-reviewer.md +56 -0
- package/agents/review-army/spec-compliance-reviewer.md +51 -0
- package/agents/review-army/test-reviewer.md +55 -0
- package/agents/reviewer.md +59 -0
- package/agents/ship-audit-army/docs-auditor.md +53 -0
- package/agents/ship-audit-army/performance-auditor.md +52 -0
- package/agents/ship-audit-army/security-auditor.md +52 -0
- package/agents/specifier.md +55 -0
- package/agents/triage-officer.md +27 -0
- package/bin/gxpm +17 -0
- package/bin/gxpm-browser +17 -0
- package/bin/gxpm-config +15 -0
- package/bin/gxpm-eval +13 -0
- package/bin/gxpm-global-discover +15 -0
- package/bin/gxpm-init +38 -0
- package/bin/gxpm-investigate +194 -0
- package/bin/gxpm-uninstall +15 -0
- package/bin/gxpm-update-check +165 -0
- package/commands/build.md +40 -0
- package/commands/help.md +53 -0
- package/commands/plan.md +34 -0
- package/commands/refine.md +46 -0
- package/commands/review.md +34 -0
- package/commands/ship.md +37 -0
- package/core/ac-check.ts +20 -0
- package/core/agent-runtime.ts +363 -0
- package/core/artifact-validator.ts +151 -0
- package/core/artifacts.ts +313 -0
- package/core/autopilot.ts +250 -0
- package/core/capabilities.ts +779 -0
- package/core/checkpoint.ts +370 -0
- package/core/cleanup.ts +32 -0
- package/core/command-probe.ts +82 -0
- package/core/config.ts +533 -0
- package/core/contracts/behavior-spec.schema.ts +38 -0
- package/core/contracts/converter.ts +61 -0
- package/core/contracts/host.ts +43 -0
- package/core/converters/converter.ts +93 -0
- package/core/converters/index.ts +8 -0
- package/core/converters/managed-artifact.ts +119 -0
- package/core/converters/parser.ts +159 -0
- package/core/converters/template-renderer.ts +35 -0
- package/core/converters/writer.ts +61 -0
- package/core/dag-executor.ts +426 -0
- package/core/dag-loader.ts +292 -0
- package/core/dag-schemas.ts +150 -0
- package/core/dispatch.ts +125 -0
- package/core/evidence.ts +148 -0
- package/core/gate.ts +269 -0
- package/core/hook-engine.ts +566 -0
- package/core/host-probe.ts +64 -0
- package/core/implement.ts +16 -0
- package/core/isolation-errors.ts +174 -0
- package/core/isolation-resolver.ts +921 -0
- package/core/issue-context.ts +381 -0
- package/core/issue-readiness.ts +457 -0
- package/core/issue-sync.ts +427 -0
- package/core/issues.ts +132 -0
- package/core/land.ts +108 -0
- package/core/orchestrator.ts +54 -0
- package/core/phase-artifact.ts +32 -0
- package/core/phase-gates.ts +130 -0
- package/core/phase-rewind.ts +94 -0
- package/core/plan-lint.ts +61 -0
- package/core/plan.ts +77 -0
- package/core/port-allocation.ts +50 -0
- package/core/pr-check.ts +15 -0
- package/core/preset-system/preset-resolver.ts +221 -0
- package/core/project-init-status.ts +127 -0
- package/core/qa.ts +15 -0
- package/core/resilience.ts +165 -0
- package/core/runs.ts +288 -0
- package/core/safe-path.test.ts +80 -0
- package/core/safe-path.ts +60 -0
- package/core/sdd-gate.test.ts +98 -0
- package/core/sdd-gate.ts +134 -0
- package/core/self-review.ts +62 -0
- package/core/session.ts +70 -0
- package/core/ship.ts +86 -0
- package/core/specify.ts +173 -0
- package/core/state.ts +1002 -0
- package/core/template-engine.ts +152 -0
- package/core/template-resolver.test.ts +70 -0
- package/core/template-resolver.ts +156 -0
- package/core/triage.ts +26 -0
- package/core/verify.ts +15 -0
- package/core/wiki-native.ts +2423 -0
- package/core/wiki.ts +27 -0
- package/core/workflow-event-emitter.ts +163 -0
- package/core/workflows/engine.ts +273 -0
- package/core/workflows/expressions.ts +76 -0
- package/core/workflows/index.ts +38 -0
- package/core/workflows/steps/command.ts +43 -0
- package/core/workflows/steps/gate.ts +47 -0
- package/core/workflows/steps/gxpm.ts +44 -0
- package/core/workflows/steps/linear.ts +31 -0
- package/core/workflows/steps/shell.ts +65 -0
- package/core/workflows/types.ts +62 -0
- package/core/workspace-runtime.ts +227 -0
- package/core/worktree-init-steps.ts +647 -0
- package/core/worktree-init.ts +330 -0
- package/core/worktree-owner.ts +143 -0
- package/docs/GXPM_VERIFY.md +98 -0
- package/docs/INSTALL_FOR_AGENTS.md +113 -0
- package/docs/README.md +57 -0
- package/docs/adr/adr-005-multi-platform-skill-converter.md +72 -0
- package/docs/agents/domain.md +30 -0
- package/docs/agents/issue-tracker.md +30 -0
- package/docs/agents/triage-labels.md +32 -0
- package/docs/architecture/gxpm-architecture-diagram.md +265 -0
- package/docs/architecture/gxpm-current-architecture.md +175 -0
- package/docs/architecture/gxpm-current-flow.md +278 -0
- package/docs/architecture/gxpm-replacement-architecture.md +211 -0
- package/docs/architecture/gxpm-target-architecture.md +449 -0
- package/docs/architecture/gxpm-v0-contract.md +311 -0
- package/docs/architecture/layered-workflow-boundaries.md +193 -0
- package/docs/architecture/preset-system.md +126 -0
- package/docs/architecture/scaffold-northstar.md +23 -0
- package/docs/brainstorms/2026-05-14-bdd-then-tdd-design.md +320 -0
- package/docs/brainstorms/README.md +22 -0
- package/docs/brainstorms/docs-knowledge-system-requirements.md +29 -0
- package/docs/governance/beta-skill-promotion.md +39 -0
- package/docs/governance/development-contract.md +144 -0
- package/docs/governance/gherkin-style.md +90 -0
- package/docs/governance/host-adapter.md +56 -0
- package/docs/governance/skill-authoring.md +87 -0
- package/docs/governance/skill-testing.md +356 -0
- package/docs/governance/template-authoring.md +53 -0
- package/docs/migrations/v0.2.md +51 -0
- package/docs/plans/README.md +23 -0
- package/docs/plans/bdd-then-tdd-plan.md +1767 -0
- package/docs/plans/docs-knowledge-system-plan.md +31 -0
- package/docs/plans/spec-kit-sdd-adoption-plan.md +305 -0
- package/docs/research/agents-md-best-practices.md +207 -0
- package/docs/research/archon-study.md +351 -0
- package/docs/research/claude-hooks-study.md +440 -0
- package/docs/research/codex-hooks-study.md +624 -0
- package/docs/research/everything-claude-code-study.md +252 -0
- package/docs/research/from-skills-to-layered-workflow.md +322 -0
- package/docs/research/gsd-study.md +69 -0
- package/docs/research/kimi-hooks-study.md +274 -0
- package/docs/research/mattpocock-skills-comparison.md +429 -0
- package/docs/research/mattpocock-skills-study.md +275 -0
- package/docs/research/oh-my-codex-study.md +279 -0
- package/docs/research/perplexity-agent-skills-design.md +168 -0
- package/docs/research/pmc-gstack-skill-study.md +122 -0
- package/docs/research/spec-kit-study.md +224 -0
- package/docs/research/superpowers-study.md +209 -0
- package/docs/roadmap/initial-roadmap.md +53 -0
- package/docs/solutions/README.md +45 -0
- package/docs/solutions/artifact-nesting-recovery.md +58 -0
- package/docs/solutions/session-context-restore-practice.md +67 -0
- package/docs/solutions/workflow/version-drift-recovery.md +49 -0
- package/docs/solutions/worktree-gate-recovery.md +62 -0
- package/docs/specs/README.md +28 -0
- package/docs/specs/claude.md +45 -0
- package/docs/specs/codex.md +44 -0
- package/docs/specs/cursor.md +44 -0
- package/hosts/adapters/claude.ts +29 -0
- package/hosts/adapters/codex.ts +27 -0
- package/hosts/adapters/cursor.ts +27 -0
- package/hosts/adapters/kimi.ts +27 -0
- package/hosts/claude.ts +23 -0
- package/hosts/codex.ts +26 -0
- package/hosts/cursor.ts +19 -0
- package/hosts/index.ts +33 -0
- package/hosts/registry.test.ts +52 -0
- package/hosts/registry.ts +57 -0
- package/hosts/schema.ts +58 -0
- package/package.json +52 -0
- package/scripts/browser.ts +185 -0
- package/scripts/cleanup.ts +142 -0
- package/scripts/commands/artifact.ts +115 -0
- package/scripts/commands/autopilot.ts +143 -0
- package/scripts/commands/capability.ts +57 -0
- package/scripts/commands/config.ts +69 -0
- package/scripts/commands/dag.ts +126 -0
- package/scripts/commands/feedback.ts +123 -0
- package/scripts/commands/gate.ts +291 -0
- package/scripts/commands/helpers.ts +126 -0
- package/scripts/commands/hook.ts +66 -0
- package/scripts/commands/init.ts +515 -0
- package/scripts/commands/issue.ts +825 -0
- package/scripts/commands/phase.ts +61 -0
- package/scripts/commands/preset.ts +159 -0
- package/scripts/commands/runtime.ts +199 -0
- package/scripts/commands/specify.ts +71 -0
- package/scripts/commands/upgrade.ts +243 -0
- package/scripts/commands/verify.ts +183 -0
- package/scripts/commands/wiki.ts +242 -0
- package/scripts/commands/workflow.ts +131 -0
- package/scripts/dev-skill.ts +55 -0
- package/scripts/discover-skills.ts +116 -0
- package/scripts/doctor.ts +410 -0
- package/scripts/dogfood-check.ts +125 -0
- package/scripts/eval-functional.ts +218 -0
- package/scripts/eval.ts +246 -0
- package/scripts/gen-skill-docs.ts +201 -0
- package/scripts/global-discover.ts +217 -0
- package/scripts/governance-check.ts +75 -0
- package/scripts/gxpm-check.ts +12 -0
- package/scripts/gxpm.ts +216 -0
- package/scripts/host-config.ts +62 -0
- package/scripts/install-claude-hooks.ts +138 -0
- package/scripts/install-codex-hooks.ts +271 -0
- package/scripts/install-hooks.ts +128 -0
- package/scripts/install-kimi-hooks.ts +92 -0
- package/scripts/install-skill.ts +184 -0
- package/scripts/phase-artifact-commands.ts +100 -0
- package/scripts/post-land-sync.ts +46 -0
- package/scripts/scaffold-check.ts +85 -0
- package/scripts/skill-naming-check.ts +78 -0
- package/scripts/skill-structure-check.ts +157 -0
- package/scripts/skills-lock-check.ts +60 -0
- package/scripts/sync-markdown-artifacts.ts +172 -0
- package/scripts/uninstall.ts +162 -0
- package/scripts/version.ts +47 -0
- package/scripts/wait-pr-ready.ts +407 -0
- package/skills/gxpm/SKILL.md +485 -0
- package/skills/gxpm/SKILL.md.tmpl +422 -0
- package/skills/gxpm/references/CANON.md +53 -0
- package/skills/gxpm/references/key-rules.md +130 -0
- package/skills/gxpm-architecture/SKILL.md +106 -0
- package/skills/gxpm-architecture/references/DEEPENING.md +37 -0
- package/skills/gxpm-architecture/references/INTERFACE-DESIGN.md +44 -0
- package/skills/gxpm-autopilot/SKILL.md +116 -0
- package/skills/gxpm-autopilot/SKILL.md.tmpl +107 -0
- package/skills/gxpm-browser/SKILL.md +105 -0
- package/skills/gxpm-browser/SKILL.md.tmpl +41 -0
- package/skills/gxpm-browser/references/commands.md +43 -0
- package/skills/gxpm-browser/references/evidence-path.md +20 -0
- package/skills/gxpm-build/SKILL.md +78 -0
- package/skills/gxpm-cleanup/SKILL.md +76 -0
- package/skills/gxpm-debug-issue/SKILL.md +39 -0
- package/skills/gxpm-diagnose/SKILL.md +220 -0
- package/skills/gxpm-diagnose/SKILL.md.tmpl +31 -0
- package/skills/gxpm-diagnose/references/feedback-loop.md +34 -0
- package/skills/gxpm-diagnose/references/feedback-loops.md +43 -0
- package/skills/gxpm-diagnose/references/phases.md +60 -0
- package/skills/gxpm-eval/SKILL.md +78 -0
- package/skills/gxpm-explore-codebase/SKILL.md +36 -0
- package/skills/gxpm-explore-codebase/scripts/summarize-communities.ts +51 -0
- package/skills/gxpm-feedback/SKILL.md +122 -0
- package/skills/gxpm-grill/SKILL.md +159 -0
- package/skills/gxpm-grill/SKILL.md.tmpl +77 -0
- package/skills/gxpm-grill/references/documentation-templates.md +56 -0
- package/skills/gxpm-grill/references/process.md +25 -0
- package/skills/gxpm-handoff/SKILL.md +112 -0
- package/skills/gxpm-hygiene/SKILL.md +69 -0
- package/skills/gxpm-implementer/SKILL.md +142 -0
- package/skills/gxpm-implementer/SKILL.md.tmpl +141 -0
- package/skills/gxpm-linear/SKILL.md +282 -0
- package/skills/gxpm-linear/SKILL.md.tmpl +86 -0
- package/skills/gxpm-linear/references/commands.md +75 -0
- package/skills/gxpm-linear/references/workflows.md +120 -0
- package/skills/gxpm-planning/SKILL.md +134 -0
- package/skills/gxpm-prototype/SKILL.md +64 -0
- package/skills/gxpm-refactor-safely/SKILL.md +62 -0
- package/skills/gxpm-review-army/SKILL.md +117 -0
- package/skills/gxpm-review-changes/SKILL.md +36 -0
- package/skills/gxpm-setup/SKILL.md +101 -0
- package/skills/gxpm-specifier/SKILL.md +135 -0
- package/skills/gxpm-tdd/SKILL.md +187 -0
- package/skills/gxpm-tdd/references/interface-design.md +23 -0
- package/skills/gxpm-tdd/references/mocking.md +27 -0
- package/skills/gxpm-tdd/references/red-green-refactor.md +61 -0
- package/skills/gxpm-tdd/references/troubleshooting.md +28 -0
- package/skills/gxpm-tdd/references/workflow.md +50 -0
- package/skills/gxpm-tdd/testing-anti-patterns.tmpl +304 -0
- package/skills/gxpm-triage/SKILL.md +160 -0
- package/skills/gxpm-verify/SKILL.md +107 -0
- package/skills/gxpm-write-skill/SKILL.md +131 -0
- package/skills/gxpm-zoom-out/SKILL.md +69 -0
- package/skills/maintain-hygiene-skills-lock/SKILL.md +54 -0
- package/skills/maintain-hygiene-skills-lock/SKILL.md.tmpl +53 -0
- package/templates/constitution-template.md +63 -0
- package/templates/hooks/gxpm-commit-msg +16 -0
- package/templates/hooks/gxpm-post-checkout +19 -0
- package/templates/hooks/gxpm-post-commit +7 -0
- package/templates/hooks/gxpm-post-merge +29 -0
- package/templates/hooks/gxpm-pre-commit +39 -0
- package/templates/hooks/gxpm-pre-push +33 -0
- package/templates/plan-template.md.tmpl +46 -0
- package/templates/spec-template.md.tmpl +63 -0
- package/templates/specify-stub.tmpl +22 -0
- package/templates/tasks-template.md.tmpl +32 -0
package/docs/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# gxpm 文档体系
|
|
2
|
+
|
|
3
|
+
本文档目录采用结构化分类模式,确保工程决策、最佳实践和平台规范可跨会话恢复。
|
|
4
|
+
|
|
5
|
+
## 目录结构
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
docs/
|
|
9
|
+
├── README.md # 本文件:文档体系导航
|
|
10
|
+
├── brainstorms/ # 需求文档与问题探索
|
|
11
|
+
│ ├── README.md
|
|
12
|
+
│ └── *-requirements.md
|
|
13
|
+
├── plans/ # 实现计划与技术方案
|
|
14
|
+
│ ├── README.md
|
|
15
|
+
│ └── *-plan.md
|
|
16
|
+
├── solutions/ # 最佳实践、恢复手册、决策记录
|
|
17
|
+
│ ├── README.md
|
|
18
|
+
│ └── *.md(含 frontmatter)
|
|
19
|
+
├── specs/ # Host 平台规范镜像
|
|
20
|
+
│ ├── README.md
|
|
21
|
+
│ └── claude.md / codex.md / cursor.md
|
|
22
|
+
├── architecture/ # 架构设计文档(存量)
|
|
23
|
+
├── governance/ # 治理契约与规范(存量)
|
|
24
|
+
├── research/ # 上游研究与调研(存量)
|
|
25
|
+
├── roadmap/ # 产品路线图(存量)
|
|
26
|
+
├── migrations/ # 迁移指南(存量)
|
|
27
|
+
├── agents/ # Agent 相关文档(存量)
|
|
28
|
+
├── GXPM_VERIFY.md # 验证清单
|
|
29
|
+
└── INSTALL_FOR_AGENTS.md # 代理安装指南
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 快速导航
|
|
33
|
+
|
|
34
|
+
| 场景 | 目标目录 |
|
|
35
|
+
|------|----------|
|
|
36
|
+
| 新功能需求探索 | `docs/brainstorms/` |
|
|
37
|
+
| 制定实现计划 | `docs/plans/` |
|
|
38
|
+
| 记录故障恢复步骤 | `docs/solutions/` |
|
|
39
|
+
| 查看 host 平台约束 | `docs/specs/` |
|
|
40
|
+
| 理解系统设计 | `docs/architecture/` |
|
|
41
|
+
| 查阅开发规范 | `docs/governance/` |
|
|
42
|
+
|
|
43
|
+
## 新会话恢复上下文
|
|
44
|
+
|
|
45
|
+
1. 读取 `AGENTS.md`(项目根目录)— 代理契约
|
|
46
|
+
2. 读取 `CONTEXT.md`(项目根目录)— 共享术语表
|
|
47
|
+
3. 按需查阅 `docs/solutions/` — 工程决策与恢复手册
|
|
48
|
+
4. 按需查阅 `docs/specs/<host>.md` — 当前 host 平台规范
|
|
49
|
+
5. 运行 `./bin/gxpm issue list` — 查看当前 issue 状态
|
|
50
|
+
|
|
51
|
+
## 维护约定
|
|
52
|
+
|
|
53
|
+
- **solutions/** 文档必须包含 YAML frontmatter(title, category, date, severity, component, tags)
|
|
54
|
+
- **brainstorms/** 采用 `*-requirements.md` 命名
|
|
55
|
+
- **plans/** 采用 `*-plan.md` 命名
|
|
56
|
+
- 每次重大决策后同步更新 solutions/
|
|
57
|
+
- 每次 host 适配变更后同步更新 specs/
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# ADR-005: 多平台插件转换/分发基础设施
|
|
2
|
+
|
|
3
|
+
## 状态
|
|
4
|
+
|
|
5
|
+
Accepted — 最小可行实现已完成(GXPM-80)。
|
|
6
|
+
|
|
7
|
+
## 背景
|
|
8
|
+
|
|
9
|
+
gxpm 当前通过 `scripts/gen-skill-docs.ts` 和 `scripts/install-skill.ts` 将 skill 从源格式(`.tmpl` 模板 + 静态 `.md`)分发到目标宿主(Codex CLI、Claude Code、Cursor)。
|
|
10
|
+
|
|
11
|
+
现有管道的问题:
|
|
12
|
+
1. **Ad-hoc 转换**:`gen-skill-docs.ts` 使用简单的字符串替换(`replaceAll`)渲染模板,没有正式的解析层。
|
|
13
|
+
2. **平台差异硬编码**:frontmatter 过滤、env var 注入、preamble 生成等逻辑散落在 `gen-skill-docs.ts` 和 `install-skill.ts` 中。
|
|
14
|
+
3. **无托管区块**:生成的 SKILL.md 是完整覆盖的,用户无法在生成内容之间插入自定义内容而不被下次生成覆盖。
|
|
15
|
+
4. **扩展成本高**:新增宿主平台需要同时修改 `gen-skill-docs.ts` 和 `install-skill.ts`。
|
|
16
|
+
|
|
17
|
+
## 决策
|
|
18
|
+
|
|
19
|
+
引入 **parser → converter → target-writer** 三层转换架构,作为 gxpm skill 分发的正式基础设施。
|
|
20
|
+
|
|
21
|
+
### 源格式(Canonical Source)
|
|
22
|
+
|
|
23
|
+
- **模板文件**(`.tmpl`):保留现有字符串占位符体系(`{{PREAMBLE}}`、`{{ARTIFACT_READ_COMMANDS}}` 等),因为它们在 skill 作者侧直观且有效。
|
|
24
|
+
- **静态文件**(`.md`):走新的 AST 管道,支持 frontmatter 过滤、 preamble 注入和 managed-artifacts。
|
|
25
|
+
|
|
26
|
+
### 三层架构
|
|
27
|
+
|
|
28
|
+
| 层级 | 职责 | 对应模块 |
|
|
29
|
+
|------|------|----------|
|
|
30
|
+
| Parser | 将 Markdown 解析为 `SkillDocument` AST(frontmatter + sections + managed blocks) | `core/converters/parser.ts` |
|
|
31
|
+
| Converter | 根据 `HostConfig` 转换 AST(过滤 frontmatter、注入 preamble、调整结构) | `core/converters/converter.ts` |
|
|
32
|
+
| TargetWriter | 将 AST 序列化为目标平台字符串,支持 managed-artifacts 合并 | `core/converters/writer.ts` |
|
|
33
|
+
|
|
34
|
+
### 平台优先级
|
|
35
|
+
|
|
36
|
+
1. **Codex CLI**(已有,保持兼容)
|
|
37
|
+
2. **Claude Code**(已有,通过新管道增强静态文件支持)
|
|
38
|
+
3. **Cursor**(后续 issue 跟进)
|
|
39
|
+
|
|
40
|
+
### Managed Artifacts
|
|
41
|
+
|
|
42
|
+
采用 HTML 注释标记:
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
<!-- BEGIN MANAGED:section-id -->
|
|
46
|
+
... generated content ...
|
|
47
|
+
<!-- END MANAGED:section-id -->
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
重新生成时,Writer 会保留旧文件中的非托管内容,只替换匹配的托管区块。当前最小实现中,Writer 以生成内容为准,未来可扩展为严格合并模式。
|
|
51
|
+
|
|
52
|
+
## 替代方案
|
|
53
|
+
|
|
54
|
+
| 方案 | 优点 | 缺点 | 结论 |
|
|
55
|
+
|------|------|------|------|
|
|
56
|
+
| A. 保持现有字符串替换 | 零改动,风险低 | 无法支持 managed-artifacts,扩展性差 | 拒绝 |
|
|
57
|
+
| B. 引入完整 Markdown AST(如 remark) | 解析精确 | 引入外部依赖,overkill for skill 文档 | 拒绝 |
|
|
58
|
+
| C. **轻量自定义 parser + converter** | 零外部依赖,足够精确,可控 | 需要维护 parser | **采纳** |
|
|
59
|
+
| D. 每个平台独立维护 skill 副本 | 平台完全自由 | 违背 "一次编写,多平台分发" 目标 | 拒绝 |
|
|
60
|
+
|
|
61
|
+
## 影响
|
|
62
|
+
|
|
63
|
+
- `scripts/gen-skill-docs.ts`:静态文件路径切换为新管道;`.tmpl` 路径保持字符串替换以保证向后兼容。
|
|
64
|
+
- `scripts/install-skill.ts`:静态文件安装使用新管道;`.tmpl` 继续委托 `gen-skill-docs.ts`。
|
|
65
|
+
- 新增 `core/contracts/converter.ts` 类型定义和 `core/converters/` 实现目录。
|
|
66
|
+
- 现有测试(`test/gen-skill-docs.test.ts`)继续通过,无回归。
|
|
67
|
+
|
|
68
|
+
## 后续工作
|
|
69
|
+
|
|
70
|
+
- GXPM-XX:将 `.tmpl` 模板体系逐步迁移到新 AST 管道,统一字符串替换和 AST 转换。
|
|
71
|
+
- GXPM-XX:为 Cursor 宿主实现专门的 `HostConverter` 扩展。
|
|
72
|
+
- GXPM-XX:严格合并模式(`mergeManagedBlocksStrict`),保留用户在生成文件中的非托管自定义内容。
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Domain Docs Layout
|
|
2
|
+
|
|
3
|
+
> Defines where domain documentation lives and how skills consume it.
|
|
4
|
+
|
|
5
|
+
## Layout
|
|
6
|
+
|
|
7
|
+
This repo uses a **single-context** layout:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
/
|
|
11
|
+
├── CONTEXT.md # shared language / glossary
|
|
12
|
+
├── docs/adr/ # architecture decision records
|
|
13
|
+
│ ├── 0001-example-decision.md
|
|
14
|
+
│ └── ...
|
|
15
|
+
└── skills/ # agent skills
|
|
16
|
+
└── ...
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Consumer Rules
|
|
20
|
+
|
|
21
|
+
- `/grill` reads and writes `CONTEXT.md` during alignment sessions.
|
|
22
|
+
- `/architecture` reads `CONTEXT.md` for domain vocabulary and `docs/adr/` for past decisions.
|
|
23
|
+
- `/diagnose` and `/tdd` read `CONTEXT.md` to name tests and interfaces consistently.
|
|
24
|
+
- Skills must not read implementation details into `CONTEXT.md` — only terms meaningful to domain experts.
|
|
25
|
+
|
|
26
|
+
## Creating docs lazily
|
|
27
|
+
|
|
28
|
+
- Create `CONTEXT.md` when the first domain term is resolved.
|
|
29
|
+
- Create `docs/adr/` when the first ADR is needed.
|
|
30
|
+
- Do not create empty scaffolding.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Issue Tracker Configuration
|
|
2
|
+
|
|
3
|
+
> Generated by gxpm setup. Edit directly when switching issue trackers.
|
|
4
|
+
|
|
5
|
+
## Current Issue Tracker
|
|
6
|
+
|
|
7
|
+
**Linear** — issues are tracked in Linear and synced to local `.gxpm/issues/` state.
|
|
8
|
+
|
|
9
|
+
Linear serves as the **collaboration front door** (human-readable, shareable, threaded discussion). The local `.gxpm/issues/<id>/` directory is the **execution source of truth** (machine-readable state, artifacts, phase history).
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
1. External issues arrive via Linear.
|
|
14
|
+
2. `gxpm issue create <linear-id>` creates local state for the issue.
|
|
15
|
+
3. All phase transitions, artifact writes, and evidence captures happen locally.
|
|
16
|
+
4. Linear remains the human collaboration layer; `.gxpm/` remains the agent execution layer.
|
|
17
|
+
|
|
18
|
+
## Alternative Trackers
|
|
19
|
+
|
|
20
|
+
If migrating away from Linear, the supported alternatives are:
|
|
21
|
+
|
|
22
|
+
- **GitHub Issues** — uses `gh issue create` / `gh issue list` / `gh issue view`
|
|
23
|
+
- **GitLab Issues** — uses `glab` CLI
|
|
24
|
+
- **Local markdown** — issues live as files under `.gxpm/issues/` (good for solo projects)
|
|
25
|
+
|
|
26
|
+
## Consumer Rules
|
|
27
|
+
|
|
28
|
+
- Skills like `/triage`, `/planning`, and `/gxpm` read from and write to the local `.gxpm/` state.
|
|
29
|
+
- Linear sync is one-directional for execution state: local state does not push back to Linear automatically.
|
|
30
|
+
- When a Linear issue is referenced, prefer the local `.gxpm/issues/<id>/` state over fetching from Linear API.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Triage Label Vocabulary
|
|
2
|
+
|
|
3
|
+
> Maps canonical triage roles to actual label strings in the issue tracker.
|
|
4
|
+
> Edit when your issue tracker uses different label names.
|
|
5
|
+
|
|
6
|
+
## Canonical Roles
|
|
7
|
+
|
|
8
|
+
| Canonical role | Default label string | Meaning |
|
|
9
|
+
|----------------|---------------------|---------|
|
|
10
|
+
| `needs-triage` | `needs-triage` | Maintainer needs to evaluate |
|
|
11
|
+
| `needs-info` | `needs-info` | Waiting on reporter for more information |
|
|
12
|
+
| `ready-for-agent` | `ready-for-agent` | Fully specified, AFK-ready (agent can pick up with no human context) |
|
|
13
|
+
| `ready-for-human` | `ready-for-human` | Needs human implementation |
|
|
14
|
+
| `wontfix` | `wontfix` | Will not be actioned |
|
|
15
|
+
|
|
16
|
+
## Category Roles
|
|
17
|
+
|
|
18
|
+
| Canonical role | Default label string | Meaning |
|
|
19
|
+
|----------------|---------------------|---------|
|
|
20
|
+
| `bug` | `bug` | Something is broken |
|
|
21
|
+
| `enhancement` | `enhancement` | New feature or improvement |
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
- Every triaged issue should carry exactly one category role and one state role.
|
|
26
|
+
- If state roles conflict, flag it and ask the maintainer before doing anything else.
|
|
27
|
+
- The maintainer can override at any time — flag transitions that look unusual and ask before proceeding.
|
|
28
|
+
|
|
29
|
+
## gxpm Integration
|
|
30
|
+
|
|
31
|
+
- The `acceptance-contract` artifact includes a `triageRole` field that maps to these canonical names.
|
|
32
|
+
- `gxpm issue list --type` filters by classification but does not alter phase gates.
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# gxpm 架构图
|
|
2
|
+
|
|
3
|
+
> 基于 `gxpm-replacement-architecture.md` 和 `gxpm-v0-contract.md` 绘制
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. 顶层公式
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
gxpm = State Graph + Capability Runtime + Evidence Store + Policy Engine + Skill Surface
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. 整体架构图 (Mermaid)
|
|
16
|
+
|
|
17
|
+
```mermaid
|
|
18
|
+
flowchart TB
|
|
19
|
+
subgraph User["👤 用户 / Agent"]
|
|
20
|
+
CLI["gxpm CLI\n/gxpm triage | plan | dispatch | verify | qa | land | ship ..."]
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
subgraph SkillSurface["🎤 Skill Surface"]
|
|
24
|
+
CMD_Triage["gxpm triage"]
|
|
25
|
+
CMD_Plan["gxpm plan"]
|
|
26
|
+
CMD_Dispatch["gxpm dispatch"]
|
|
27
|
+
CMD_Implement["gxpm implement"]
|
|
28
|
+
CMD_Verify["gxpm verify"]
|
|
29
|
+
CMD_QA["gxpm qa"]
|
|
30
|
+
CMD_Land["gxpm land"]
|
|
31
|
+
CMD_Ship["gxpm ship"]
|
|
32
|
+
CMD_Review["gxpm review"]
|
|
33
|
+
CMD_Investigate["gxpm investigate"]
|
|
34
|
+
CMD_Learn["gxpm learn"]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
subgraph Core["🔧 gxpm Core (统一控制面)"]
|
|
38
|
+
direction TB
|
|
39
|
+
|
|
40
|
+
subgraph StateGraph["📊 State Graph"]
|
|
41
|
+
Issue["Issue 状态机"]
|
|
42
|
+
Phase["Phase 阶段\ntriage → plan → dispatch → implement → local-verify → ac-check → self-review → ship → pr-check → verify → qa → land"]
|
|
43
|
+
Transition["Transition Gate\n(严格顺序 + artifact 校验)"]
|
|
44
|
+
Graph["Graph.json\n(依赖图 / 阻塞关系)"]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
subgraph PolicyEngine["⚖️ Policy Engine"]
|
|
48
|
+
Gate["Gate 判定\n(能进入下一阶段吗?)"]
|
|
49
|
+
AC["Acceptance Criterion\n(哪些需要 browser evidence?)"]
|
|
50
|
+
Risk["Risk Profile\n(fast / standard / high-risk / regression)"]
|
|
51
|
+
Confirm["不可逆操作确认\n(land/merge/deploy)"]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
subgraph CapabilityRuntime["🚀 Capability Runtime"]
|
|
55
|
+
IssueRT["issueRuntime\n(Linear/GitHub sync)"]
|
|
56
|
+
ExecRT["executionRuntime\n(worktree / dispatch / verify)"]
|
|
57
|
+
ReviewRT["reviewRuntime\n(diff / specialist / adversarial)"]
|
|
58
|
+
BrowserRT["browserRuntime\n(QA / screenshot / console)"]
|
|
59
|
+
ReleaseRT["releaseRuntime\n(PR / version / changelog)"]
|
|
60
|
+
MemoryRT["memoryRuntime\n(timeline / learn / resume)"]
|
|
61
|
+
SkillRT["skillRuntime\n(discovery / routing / template)"]
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
subgraph EvidenceStore["📁 Evidence Store"]
|
|
65
|
+
State["state.json"]
|
|
66
|
+
Artifacts["artifacts/*.json\n(acceptance-contract, dispatch-handoff,\nlocal-verify, qa-findings, land-findings...)"]
|
|
67
|
+
Evidence["evidence/\n(screenshots, console.jsonl,\nnetwork.jsonl, commands.jsonl)"]
|
|
68
|
+
Memory["memory/\n(resume-packet.json, checkpoints/)"]
|
|
69
|
+
Runs["runs/\n(run-ledger, 审计日志)"]
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
subgraph External["🌐 外部系统"]
|
|
74
|
+
Linear["Linear (Issue Provider)"]
|
|
75
|
+
GitHub["GitHub (PR / Code)"]
|
|
76
|
+
Browser["Browser / QA 环境"]
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
subgraph Hosts["💻 Host Adapters"]
|
|
80
|
+
Codex["Codex CLI"]
|
|
81
|
+
Claude["Claude Code"]
|
|
82
|
+
OpenClaw["OpenClaw / 其他"]
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
subgraph Codebase["📂 代码库"]
|
|
86
|
+
Worktree["git worktree\n(隔离开发)"]
|
|
87
|
+
Source["源代码"]
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
%% === 连接关系 ===
|
|
91
|
+
User --> CLI
|
|
92
|
+
CLI --> SkillSurface
|
|
93
|
+
|
|
94
|
+
SkillSurface --> StateGraph
|
|
95
|
+
SkillSurface --> CapabilityRuntime
|
|
96
|
+
|
|
97
|
+
StateGraph <-- "读写 state / graph" --> EvidenceStore
|
|
98
|
+
CapabilityRuntime <-- "写入 evidence / artifacts" --> EvidenceStore
|
|
99
|
+
CapabilityRuntime --> PolicyEngine
|
|
100
|
+
PolicyEngine --> StateGraph
|
|
101
|
+
|
|
102
|
+
IssueRT --> Linear
|
|
103
|
+
ReleaseRT --> GitHub
|
|
104
|
+
BrowserRT --> Browser
|
|
105
|
+
ExecRT --> Worktree
|
|
106
|
+
|
|
107
|
+
Hosts --> CLI
|
|
108
|
+
Codebase --> ExecRT
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 3. 核心数据流
|
|
114
|
+
|
|
115
|
+
```mermaid
|
|
116
|
+
sequenceDiagram
|
|
117
|
+
autonumber
|
|
118
|
+
actor U as 用户 / Agent
|
|
119
|
+
participant SS as Skill Surface
|
|
120
|
+
participant SG as State Graph
|
|
121
|
+
participant PE as Policy Engine
|
|
122
|
+
participant CR as Capability Runtime
|
|
123
|
+
participant ES as Evidence Store
|
|
124
|
+
participant EX as 外部系统 (Linear/GitHub)
|
|
125
|
+
|
|
126
|
+
U->>SS: gxpm triage init GXPM-001
|
|
127
|
+
SS->>SG: 读取当前 phase (triage)
|
|
128
|
+
SG->>PE: 请求 gate 判定
|
|
129
|
+
PE-->>SG: 允许 (当前 phase = triage)
|
|
130
|
+
SS->>CR: 调用 issueRuntime + planning
|
|
131
|
+
CR->>EX: 从 Linear 读取 issue 详情
|
|
132
|
+
CR->>ES: 写入 artifact: acceptance-contract.json
|
|
133
|
+
CR-->>SS: 返回 triage 结果
|
|
134
|
+
SS->>SG: 推进 phase: triage → plan
|
|
135
|
+
SG->>ES: 更新 state.json + events.jsonl
|
|
136
|
+
SS-->>U: 完成 triage
|
|
137
|
+
|
|
138
|
+
U->>SS: gxpm plan init GXPM-001
|
|
139
|
+
SS->>SG: 读取 phase (plan)
|
|
140
|
+
SG->>PE: gate 判定 (需 acceptance-contract)
|
|
141
|
+
PE->>ES: 检查 artifacts/acceptance-contract.json
|
|
142
|
+
ES-->>PE: 存在 ✓
|
|
143
|
+
PE-->>SG: 允许
|
|
144
|
+
SS->>CR: 调用 planning capability
|
|
145
|
+
CR->>ES: 写入 artifact: implementation-plan.json
|
|
146
|
+
SS->>SG: 推进 phase: plan → dispatch
|
|
147
|
+
SG->>ES: 更新 state
|
|
148
|
+
SS-->>U: 完成 plan
|
|
149
|
+
|
|
150
|
+
Note over U,EX: ... 各阶段以此类推 ...
|
|
151
|
+
|
|
152
|
+
U->>SS: gxpm qa land GXPM-001
|
|
153
|
+
SS->>SG: 读取 phase (qa)
|
|
154
|
+
SG->>PE: gate 判定 (需 qa-findings, land-findings)
|
|
155
|
+
PE->>ES: 检查所有前置 artifacts
|
|
156
|
+
ES-->>PE: 全部存在 ✓
|
|
157
|
+
PE->>PE: 判定是否涉及不可逆操作
|
|
158
|
+
PE-->>U: 请求用户确认
|
|
159
|
+
U-->>PE: 确认
|
|
160
|
+
PE-->>SG: 允许
|
|
161
|
+
SS->>CR: 调用 releaseRuntime
|
|
162
|
+
CR->>EX: GitHub merge PR
|
|
163
|
+
SS->>SG: 推进 phase: qa → land
|
|
164
|
+
SG->>ES: 最终 state 更新
|
|
165
|
+
SS-->>U: land 完成
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 4. V0 本地目录结构 (Evidence Store 实体)
|
|
171
|
+
|
|
172
|
+
```text
|
|
173
|
+
.gxpm/
|
|
174
|
+
└── issues/<issue-id>/
|
|
175
|
+
├── state.json ← 状态机真值
|
|
176
|
+
├── graph.json ← 依赖/阻塞关系
|
|
177
|
+
├── events.jsonl ← 阶段转换审计日志
|
|
178
|
+
├── artifacts/
|
|
179
|
+
│ ├── index.json
|
|
180
|
+
│ ├── acceptance-contract.json
|
|
181
|
+
│ ├── implementation-plan.json
|
|
182
|
+
│ ├── dispatch-handoff.json
|
|
183
|
+
│ ├── local-verify.json
|
|
184
|
+
│ ├── acceptance-check.json
|
|
185
|
+
│ ├── self-review.json
|
|
186
|
+
│ ├── ship-readiness.json
|
|
187
|
+
│ ├── pr-check.json
|
|
188
|
+
│ ├── verify-findings.json
|
|
189
|
+
│ ├── qa-findings.json
|
|
190
|
+
│ └── land-findings.json
|
|
191
|
+
├── reports/ ← (未来) Markdown 渲染视图
|
|
192
|
+
├── evidence/
|
|
193
|
+
│ ├── command-logs/
|
|
194
|
+
│ ├── browser-snapshots/
|
|
195
|
+
│ ├── browser-screenshots/
|
|
196
|
+
│ ├── browser-console/
|
|
197
|
+
│ ├── browser-errors/
|
|
198
|
+
│ ├── investigations/
|
|
199
|
+
│ ├── review/
|
|
200
|
+
│ ├── release/
|
|
201
|
+
│ └── screenshots/ ← 兼容旧路径
|
|
202
|
+
├── memory/
|
|
203
|
+
│ ├── resume-packet.json ← 会话恢复入口
|
|
204
|
+
│ └── checkpoints/
|
|
205
|
+
│ └── 20260427-044500-handoff.md
|
|
206
|
+
└── runs/
|
|
207
|
+
└── run-20260428123000-1a2b3c4d.json
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## 5. 真值优先级金字塔
|
|
213
|
+
|
|
214
|
+
```text
|
|
215
|
+
┌─────────────────┐
|
|
216
|
+
│ phase JSON │ ← 最高真值
|
|
217
|
+
│ artifacts │
|
|
218
|
+
├─────────────────┤
|
|
219
|
+
│ state.json │
|
|
220
|
+
├─────────────────┤
|
|
221
|
+
│ resume-packet │
|
|
222
|
+
├─────────────────┤
|
|
223
|
+
│ rendered md │
|
|
224
|
+
│ reports │
|
|
225
|
+
├─────────────────┤
|
|
226
|
+
│ Linear comments │
|
|
227
|
+
│ PR body │
|
|
228
|
+
│ chat history │ ← 最低真值
|
|
229
|
+
└─────────────────┘
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## 6. 与上游项目的关系
|
|
235
|
+
|
|
236
|
+
```text
|
|
237
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
238
|
+
│ gxpm (二代产品) │
|
|
239
|
+
│ ┌─────────────┐ ┌──────────────┐ ┌─────────────────────┐ │
|
|
240
|
+
│ │ State Graph │ │ Capability │ │ Evidence Store │ │
|
|
241
|
+
│ │ (统一状态机)│ │ Runtime │ │ (统一证据层) │ │
|
|
242
|
+
│ └─────────────┘ │ (统一能力) │ └─────────────────────┘ │
|
|
243
|
+
│ └──────────────┘ │
|
|
244
|
+
│ ▲ │
|
|
245
|
+
│ ┌─────────────────┴─────────────────┐ │
|
|
246
|
+
│ ▼ ▼ │
|
|
247
|
+
│ ┌─────────────┐ ┌─────────────┐ │
|
|
248
|
+
│ │ PMC │ ── 吸收/迁移 ──▶ │ gxpm Core │ │
|
|
249
|
+
│ │(phase gate, │ │ (native) │ │
|
|
250
|
+
│ │ checkpoint) │ │ │ │
|
|
251
|
+
│ └─────────────┘ └─────────────┘ │
|
|
252
|
+
│ ┌─────────────┐ ┌─────────────┐ │
|
|
253
|
+
│ │ gstack │ ── 吸收/迁移 ──▶ │ gxpm Core │ │
|
|
254
|
+
│ │(browser QA, │ │ (native) │ │
|
|
255
|
+
│ │ review,ship)│ │ │ │
|
|
256
|
+
│ └─────────────┘ └─────────────┘ │
|
|
257
|
+
│ │
|
|
258
|
+
│ 原则:PMC/gstack 是上游研究对象与能力来源,不是长期运行时依赖 │
|
|
259
|
+
└─────────────────────────────────────────────────────────────┘
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
*生成时间: 2026-05-02*
|
|
265
|
+
*来源文档: `docs/architecture/gxpm-replacement-architecture.md`, `docs/architecture/gxpm-v0-contract.md`*
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# gxpm 当前系统架构图(v0)
|
|
2
|
+
|
|
3
|
+
> 绘制日期:2026-05-02
|
|
4
|
+
> 目的:可视化当前 gxpm 的组件关系与数据流,作为重构规划的基线
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. 系统分层架构图
|
|
9
|
+
|
|
10
|
+
```mermaid
|
|
11
|
+
graph TB
|
|
12
|
+
subgraph "External Systems"
|
|
13
|
+
LINEAR["Linear<br/>Issue Tracker"]
|
|
14
|
+
GITNEXUS["GitNexus<br/>MCP Server"]
|
|
15
|
+
GIT["Git Repository"]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
subgraph "Host Layer"
|
|
19
|
+
CODEX["Codex CLI<br/>OpenAI"]
|
|
20
|
+
CLAUDE["Claude Code<br/>Anthropic"]
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
subgraph "Skill Layer"
|
|
24
|
+
direction TB
|
|
25
|
+
SKILL_GXPM["skills/gxpm/<br/>SKILL.md.tmpl"]
|
|
26
|
+
SKILL_GEN["scripts/<br/>gen-skill-docs.ts"]
|
|
27
|
+
SKILL_OUT["skills/gxpm/<br/>SKILL.md<br/>(generated)"]
|
|
28
|
+
SKILL_INST["scripts/<br/>install-skill.ts"]
|
|
29
|
+
SKILL_DEV["scripts/<br/>dev-skill.ts"]
|
|
30
|
+
SKILL_ORPHAN[".claude/skills/<br/>*.md<br/>(4 orphans)"]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
subgraph "Hook Layer"
|
|
34
|
+
GIT_HOOKS[".githooks/<br/>pre-commit, commit-msg,<br/>pre-push, post-merge"]
|
|
35
|
+
CODEX_HOOKS[".codex/hooks/<br/>SessionStart,<br/>UserPromptSubmit"]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
subgraph "CLI Layer (bin/)"
|
|
39
|
+
CLI_MAIN["gxpm<br/>main CLI"]
|
|
40
|
+
CLI_INIT["gxpm-init<br/>install skill + hooks"]
|
|
41
|
+
CLI_INV["gxpm-investigate<br/>browser evidence"]
|
|
42
|
+
CLI_CFG["gxpm-config<br/>config mgmt"]
|
|
43
|
+
CLI_OTHERS["gxpm-update-check<br/>gxpm-global-discover<br/>gxpm-uninstall"]
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
subgraph "Core Runtime (core/)"
|
|
47
|
+
direction TB
|
|
48
|
+
|
|
49
|
+
subgraph "Issue & State"
|
|
50
|
+
ISSUES["issues.ts<br/>CRUD"]
|
|
51
|
+
STATE["state.ts<br/>state machine"]
|
|
52
|
+
SESSION["session.ts<br/>ownership"]
|
|
53
|
+
CHECKPOINT["checkpoint.ts<br/>handoff"]
|
|
54
|
+
RUNS["runs.ts<br/>execution ledger"]
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
subgraph "Phase Engine"
|
|
58
|
+
PHASE_GATES["phase-gates.ts<br/>gate definitions"]
|
|
59
|
+
PHASE_ART["phase-artifact.ts<br/>artifact mapping"]
|
|
60
|
+
TRIAGE["triage.ts"]
|
|
61
|
+
PLAN["plan.ts"]
|
|
62
|
+
DISPATCH["dispatch.ts"]
|
|
63
|
+
IMPLEMENT["implement.ts"]
|
|
64
|
+
AC_CHECK["ac-check.ts"]
|
|
65
|
+
SELF_REVIEW["self-review.ts"]
|
|
66
|
+
SHIP["ship.ts"]
|
|
67
|
+
PR_CHECK["pr-check.ts"]
|
|
68
|
+
VERIFY["verify.ts"]
|
|
69
|
+
QA["qa.ts"]
|
|
70
|
+
LAND["land.ts"]
|
|
71
|
+
GATE["gate.ts<br/>enforcement"]
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
subgraph "Workspace & Orchestration"
|
|
75
|
+
WORKSPACE["workspace-runtime.ts"]
|
|
76
|
+
ORCH["orchestrator.ts<br/>tick dispatch"]
|
|
77
|
+
READINESS["issue-readiness.ts"]
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
subgraph "Artifact & Evidence"
|
|
81
|
+
ARTIFACTS["artifacts.ts"]
|
|
82
|
+
EVIDENCE["evidence.ts"]
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
subgraph "Knowledge & Wiki"
|
|
86
|
+
WIKI["wiki.ts"]
|
|
87
|
+
WIKI_NATIVE["wiki-native.ts<br/>first-party"]
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
subgraph "Config & Capabilities"
|
|
91
|
+
CONFIG["config.ts<br/>resolution chain"]
|
|
92
|
+
CAPS["capabilities.ts<br/>registry"]
|
|
93
|
+
PROBE["command-probe.ts"]
|
|
94
|
+
PLAN_LINT["plan-lint.ts"]
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
subgraph "Storage Layer (.gxpm/)"
|
|
99
|
+
ISSUE_STATE[".gxpm/issues/<id>/<br/>state + artifacts"]
|
|
100
|
+
LOCAL_RUN[".gxpm/local/<br/>workspaces + runs"]
|
|
101
|
+
WIKI_STORE[".gxpm/wiki/<br/>native index + content"]
|
|
102
|
+
CONFIG_STORE[".gxpm/config.json"]
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
%% Host → Skill
|
|
106
|
+
CODEX --> |"loads"| SKILL_OUT
|
|
107
|
+
CLAUDE --> |"loads"| SKILL_ORPHAN
|
|
108
|
+
|
|
109
|
+
%% Skill generation flow
|
|
110
|
+
SKILL_GXPM --> |"renderTemplate<br/>PHASE_GATE_RULES"| SKILL_GEN
|
|
111
|
+
SKILL_GEN --> SKILL_OUT
|
|
112
|
+
SKILL_OUT --> |"copy to host"| SKILL_INST
|
|
113
|
+
SKILL_INST --> |"installs to"| CODEX
|
|
114
|
+
SKILL_DEV --> |"watch"| SKILL_GXPM
|
|
115
|
+
|
|
116
|
+
%% CLI → Core
|
|
117
|
+
CLI_MAIN --> ISSUES
|
|
118
|
+
CLI_MAIN --> STATE
|
|
119
|
+
CLI_MAIN --> ARTIFACTS
|
|
120
|
+
CLI_MAIN --> GATE
|
|
121
|
+
CLI_MAIN --> WIKI
|
|
122
|
+
CLI_MAIN --> CONFIG
|
|
123
|
+
CLI_INIT --> SKILL_INST
|
|
124
|
+
CLI_INIT --> GIT_HOOKS
|
|
125
|
+
CLI_INIT --> CODEX_HOOKS
|
|
126
|
+
CLI_INV --> EVIDENCE
|
|
127
|
+
|
|
128
|
+
%% Core → Storage
|
|
129
|
+
ISSUES --> ISSUE_STATE
|
|
130
|
+
STATE --> ISSUE_STATE
|
|
131
|
+
ARTIFACTS --> ISSUE_STATE
|
|
132
|
+
RUNS --> LOCAL_RUN
|
|
133
|
+
WORKSPACE --> LOCAL_RUN
|
|
134
|
+
WIKI_NATIVE --> WIKI_STORE
|
|
135
|
+
CONFIG --> CONFIG_STORE
|
|
136
|
+
|
|
137
|
+
%% Core → External
|
|
138
|
+
ISSUES -.-> |"sync"| LINEAR
|
|
139
|
+
QODER_MOD -.-> |"optional link"| QODER
|
|
140
|
+
ORCH -.-> |"dispatch"| CODEX
|
|
141
|
+
|
|
142
|
+
%% Hooks → Core
|
|
143
|
+
GIT_HOOKS --> |"calls"| GATE
|
|
144
|
+
CODEX_HOOKS --> |"inject context"| STATE
|
|
145
|
+
|
|
146
|
+
%% Code-intelligence skills now use GitNexus (external tool)
|
|
147
|
+
SKILL_ORPHAN -.-> |"uses MCP"| GITNEXUS
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 2. 关键观察
|
|
153
|
+
|
|
154
|
+
### 2.1 Skill 层是"单点 + 孤儿"结构
|
|
155
|
+
|
|
156
|
+
- **主 skill**:`skills/gxpm/SKILL.md.tmpl` → `SKILL.md`(673 行,所有能力塞在一起)
|
|
157
|
+
- **代码智能 skill**:`skills/gxpm-*`(GitNexus 驱动,随项目维护;旧 Claude-only 图谱 skill 已归档)
|
|
158
|
+
- **生成管道**:`discoverTemplates()` 虽支持递归发现,但 `install-skill.ts` 和 `dev-skill.ts` 硬编码只处理 `skills/gxpm/SKILL.md.tmpl`
|
|
159
|
+
|
|
160
|
+
### 2.2 Core 是按 Phase 组织的,但 Skill 是平铺的
|
|
161
|
+
|
|
162
|
+
- Core 有清晰的 phase 文件:`triage.ts`, `plan.ts`, `dispatch.ts` ... `land.ts`
|
|
163
|
+
- 但 Skill 把所有 phase 的指引塞进一个文件,导致 progressive disclosure 失效
|
|
164
|
+
|
|
165
|
+
### 2.3 Host 适配层只处理安装路径,不处理 skill 内容分发
|
|
166
|
+
|
|
167
|
+
- `hosts/codex.ts` 定义了 `globalRoot: ".codex/skills/gxpm"`
|
|
168
|
+
- `hosts/claude.ts` 定义了 `globalRoot: ".claude/skills/gxpm"`
|
|
169
|
+
- GitNexus code-intelligence skill 已收敛到 `skills/gxpm-*`,不再依赖 Claude-only 的旧图谱路径
|
|
170
|
+
|
|
171
|
+
### 2.4 外部系统集成是"可选依赖"模式
|
|
172
|
+
|
|
173
|
+
- Linear:协作前门,同步 issue,但不替代本地 state
|
|
174
|
+
- GitNexus:MCP 工具,Agent 默认代码智能层,用于代码导航、调试、重构影响面和 review
|
|
175
|
+
- gxpm wiki:可选人类文档层,用于 onboarding、phase/CLI/governance 导览;不替代 GitNexus
|