@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
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gxpm-architecture
|
|
3
|
+
description: Find deepening opportunities in a codebase using domain language and ADRs. Use when user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Improve Codebase Architecture
|
|
7
|
+
|
|
8
|
+
Surface architectural friction and propose **deepening opportunities** — refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.
|
|
9
|
+
|
|
10
|
+
## 入口条件
|
|
11
|
+
|
|
12
|
+
Load this skill when you see:
|
|
13
|
+
- User asks to "improve architecture", "refactor", "make this more testable", or "reduce coupling".
|
|
14
|
+
- A diagnosis surfaces an architectural root cause (tight coupling, shallow modules, missing seams).
|
|
15
|
+
- A new module is introduced during `self-review` and its depth is questionable.
|
|
16
|
+
- The codebase has grown and `CONTEXT.md` terms no longer map cleanly to file structure.
|
|
17
|
+
|
|
18
|
+
### 核心术语
|
|
19
|
+
|
|
20
|
+
Use these terms exactly in every suggestion:
|
|
21
|
+
|
|
22
|
+
- **Module** — anything with an interface and an implementation (function, class, package, slice).
|
|
23
|
+
- **Interface** — everything a caller must know to use the module: types, invariants, error modes, ordering, config. Not just the type signature.
|
|
24
|
+
- **Implementation** — the code inside.
|
|
25
|
+
- **Depth** — leverage at the interface: a lot of behaviour behind a small interface. **Deep** = high leverage. **Shallow** = interface nearly as complex as the implementation.
|
|
26
|
+
- **Seam** — where an interface lives; a place behaviour can be altered without editing in place.
|
|
27
|
+
- **Adapter** — a concrete thing satisfying an interface at a seam.
|
|
28
|
+
- **Leverage** — what callers get from depth.
|
|
29
|
+
- **Locality** — what maintainers get from depth: change, bugs, knowledge concentrated in one place.
|
|
30
|
+
|
|
31
|
+
Key principles:
|
|
32
|
+
|
|
33
|
+
- **Deletion test**: imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.
|
|
34
|
+
- **The interface is the test surface.**
|
|
35
|
+
- **One adapter = hypothetical seam. Two adapters = real seam.**
|
|
36
|
+
|
|
37
|
+
## 可操作流程
|
|
38
|
+
|
|
39
|
+
### 1. Explore
|
|
40
|
+
|
|
41
|
+
Read the project's domain glossary (`CONTEXT.md`) and any ADRs in the area you're touching first.
|
|
42
|
+
|
|
43
|
+
Then explore the codebase organically and note where you experience friction:
|
|
44
|
+
|
|
45
|
+
- Where does understanding one concept require bouncing between many small modules?
|
|
46
|
+
- Where are modules **shallow** — interface nearly as complex as the implementation?
|
|
47
|
+
- Where have pure functions been extracted just for testability, but the real bugs hide in how they're called (no **locality**)?
|
|
48
|
+
- Where do tightly-coupled modules leak across their seams?
|
|
49
|
+
- Which parts of the codebase are untested, or hard to test through their current interface?
|
|
50
|
+
|
|
51
|
+
Apply the **deletion test** to anything you suspect is shallow.
|
|
52
|
+
|
|
53
|
+
### 2. Present candidates
|
|
54
|
+
|
|
55
|
+
Present a numbered list of deepening opportunities. For each candidate:
|
|
56
|
+
|
|
57
|
+
- **Files** — which files/modules are involved
|
|
58
|
+
- **Problem** — why the current architecture is causing friction
|
|
59
|
+
- **Solution** — plain English description of what would change
|
|
60
|
+
- **Benefits** — explained in terms of locality and leverage, and also in how tests would improve
|
|
61
|
+
- **Dependencies** — classify into [references/DEEPENING.md](references/DEEPENING.md) categories so the testing strategy is clear
|
|
62
|
+
|
|
63
|
+
**Use CONTEXT.md vocabulary for the domain.** If `CONTEXT.md` defines "Order," talk about "the Order intake module" — not "the FooBarHandler."
|
|
64
|
+
|
|
65
|
+
**ADR conflicts**: if a candidate contradicts an existing ADR, only surface it when the friction is real enough to warrant revisiting the ADR.
|
|
66
|
+
|
|
67
|
+
Do NOT propose interfaces yet. Ask the user: "Which of these would you like to explore?"
|
|
68
|
+
|
|
69
|
+
### 3. Grilling loop
|
|
70
|
+
|
|
71
|
+
Once the user picks a candidate, drop into a grilling conversation. Walk the design tree with them — constraints, dependencies, the shape of the deepened module, what sits behind the seam, what tests survive.
|
|
72
|
+
|
|
73
|
+
Side effects happen inline:
|
|
74
|
+
- **Naming a deepened module after a concept not in CONTEXT.md?** Add the term to `CONTEXT.md`.
|
|
75
|
+
- **Sharpening a fuzzy term?** Update `CONTEXT.md` right there.
|
|
76
|
+
- **User rejects the candidate with a load-bearing reason?** Offer an ADR so future architecture reviews don't re-suggest it.
|
|
77
|
+
|
|
78
|
+
### 4. Interface design (optional)
|
|
79
|
+
|
|
80
|
+
If the user wants to explore alternative interfaces for the chosen candidate, load [references/INTERFACE-DESIGN.md](references/INTERFACE-DESIGN.md) and run the parallel sub-agent pattern.
|
|
81
|
+
|
|
82
|
+
### gxpm 集成
|
|
83
|
+
|
|
84
|
+
- Run `/architecture` once every few days, or after `/diagnose` surfaces an architectural root cause.
|
|
85
|
+
- During `self-review`, apply the deletion test to new modules introduced in the PR.
|
|
86
|
+
- After `land`, if architecture recommendations were deferred, create a follow-up issue via `gxpm issue create --auto-id`.
|
|
87
|
+
|
|
88
|
+
## 红旗清单 / 反模式
|
|
89
|
+
|
|
90
|
+
Do NOT use architecture deepening when:
|
|
91
|
+
|
|
92
|
+
- The user wants a purely cosmetic rename. Use `gxpm-refactor-safely` instead.
|
|
93
|
+
- The code is already deep, well-tested, and stable. If the deletion test shows the module earns its keep, leave it alone.
|
|
94
|
+
- The change is urgent and tactical (hotfix, security patch). Architecture work is strategic; defer it.
|
|
95
|
+
- You have not read `CONTEXT.md` and the relevant ADRs. Surfacing friction without domain vocabulary produces shallow advice.
|
|
96
|
+
|
|
97
|
+
**Counter-examples:** Proposing full seam extraction for a simple rename is wrong — architecture skill is for structural depth, not naming preferences. Suggesting to split a module that passes the deletion test because it "looks large" is wrong — size is not depth.
|
|
98
|
+
|
|
99
|
+
## 验证清单 / 出口条件
|
|
100
|
+
|
|
101
|
+
- [ ] 已阅读 `CONTEXT.md` 和相关 ADR
|
|
102
|
+
- [ ] 已用删除测试(deletion test)排查候选模块
|
|
103
|
+
- [ ] deepening opportunities 已按 Files / Problem / Solution / Benefits / Dependencies 结构化呈现
|
|
104
|
+
- [ ] 用户使用 `CONTEXT.md` 术语确认候选方案
|
|
105
|
+
- [ ] 如需接口设计,已运行并行 sub-agent 模式并给出有主见的推荐
|
|
106
|
+
- [ ] 如需更新 `CONTEXT.md` 或新增 ADR,已 inline 完成
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Deepening
|
|
2
|
+
|
|
3
|
+
How to deepen a cluster of shallow modules safely, given its dependencies. Assumes the vocabulary in [SKILL.md](../SKILL.md) — **module**, **interface**, **seam**, **adapter**.
|
|
4
|
+
|
|
5
|
+
## Dependency categories
|
|
6
|
+
|
|
7
|
+
When assessing a candidate for deepening, classify its dependencies. The category determines how the deepened module is tested across its seam.
|
|
8
|
+
|
|
9
|
+
### 1. In-process
|
|
10
|
+
|
|
11
|
+
Pure computation, in-memory state, no I/O. Always deepenable — merge the modules and test through the new interface directly. No adapter needed.
|
|
12
|
+
|
|
13
|
+
### 2. Local-substitutable
|
|
14
|
+
|
|
15
|
+
Dependencies that have local test stand-ins (PGLite for Postgres, in-memory filesystem, SQLite for a real DB). Deepenable if the stand-in exists. The deepened module is tested with the stand-in running in the test suite. The seam is internal; no port at the module's external interface.
|
|
16
|
+
|
|
17
|
+
### 3. Remote but owned (Ports & Adapters)
|
|
18
|
+
|
|
19
|
+
Your own services across a network boundary (microservices, internal APIs). Define a **port** (interface) at the seam. The deep module owns the logic; the transport is injected as an **adapter**. Tests use an in-memory adapter. Production uses an HTTP/gRPC/queue adapter.
|
|
20
|
+
|
|
21
|
+
Recommendation shape: *"Define a port at the seam, implement an HTTP adapter for production and an in-memory adapter for testing, so the logic sits in one deep module even though it's deployed across a network."*
|
|
22
|
+
|
|
23
|
+
### 4. True external (Mock)
|
|
24
|
+
|
|
25
|
+
Third-party services (Stripe, Twilio, etc.) you don't control. The deepened module takes the external dependency as an injected port; tests provide a mock adapter.
|
|
26
|
+
|
|
27
|
+
## Seam discipline
|
|
28
|
+
|
|
29
|
+
- **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a port unless at least two adapters are justified (typically production + test). A single-adapter seam is just indirection.
|
|
30
|
+
- **Internal seams vs external seams.** A deep module can have internal seams (private to its implementation, used by its own tests) as well as the external seam at its interface. Don't expose internal seams through the interface just because tests use them.
|
|
31
|
+
|
|
32
|
+
## Testing strategy: replace, don't layer
|
|
33
|
+
|
|
34
|
+
- Old unit tests on shallow modules become waste once tests at the deepened module's interface exist — delete them.
|
|
35
|
+
- Write new tests at the deepened module's interface. The **interface is the test surface**.
|
|
36
|
+
- Tests assert on observable outcomes through the interface, not internal state.
|
|
37
|
+
- Tests should survive internal refactors — they describe behaviour, not implementation. If a test has to change when the implementation changes, it's testing past the interface.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Interface Design
|
|
2
|
+
|
|
3
|
+
When the user wants to explore alternative interfaces for a chosen deepening candidate, use this parallel sub-agent pattern. Based on "Design It Twice" (Ousterhout) — your first idea is unlikely to be the best.
|
|
4
|
+
|
|
5
|
+
Uses the vocabulary in [SKILL.md](../SKILL.md) — **module**, **interface**, **seam**, **adapter**, **leverage**.
|
|
6
|
+
|
|
7
|
+
## Process
|
|
8
|
+
|
|
9
|
+
### 1. Frame the problem space
|
|
10
|
+
|
|
11
|
+
Before spawning sub-agents, write a user-facing explanation of the problem space for the chosen candidate:
|
|
12
|
+
|
|
13
|
+
- The constraints any new interface would need to satisfy
|
|
14
|
+
- The dependencies it would rely on, and which category they fall into (see [DEEPENING.md](DEEPENING.md))
|
|
15
|
+
- A rough illustrative code sketch to ground the constraints — not a proposal, just a way to make the constraints concrete
|
|
16
|
+
|
|
17
|
+
Show this to the user, then immediately proceed to Step 2. The user reads and thinks while the sub-agents work in parallel.
|
|
18
|
+
|
|
19
|
+
### 2. Spawn sub-agents
|
|
20
|
+
|
|
21
|
+
Spawn 3+ sub-agents in parallel using the Agent tool. Each must produce a **radically different** interface for the deepened module.
|
|
22
|
+
|
|
23
|
+
Prompt each sub-agent with a separate technical brief (file paths, coupling details, dependency category from [DEEPENING.md](DEEPENING.md), what sits behind the seam). The brief is independent of the user-facing problem-space explanation in Step 1. Give each agent a different design constraint:
|
|
24
|
+
|
|
25
|
+
- Agent 1: "Minimize the interface — aim for 1–3 entry points max. Maximise leverage per entry point."
|
|
26
|
+
- Agent 2: "Maximise flexibility — support many use cases and extension."
|
|
27
|
+
- Agent 3: "Optimise for the most common caller — make the default case trivial."
|
|
28
|
+
- Agent 4 (if applicable): "Design around ports & adapters for cross-seam dependencies."
|
|
29
|
+
|
|
30
|
+
Include both [SKILL.md](../SKILL.md) vocabulary and CONTEXT.md vocabulary in the brief so each sub-agent names things consistently with the architecture language and the project's domain language.
|
|
31
|
+
|
|
32
|
+
Each sub-agent outputs:
|
|
33
|
+
|
|
34
|
+
1. Interface (types, methods, params — plus invariants, ordering, error modes)
|
|
35
|
+
2. Usage example showing how callers use it
|
|
36
|
+
3. What the implementation hides behind the seam
|
|
37
|
+
4. Dependency strategy and adapters (see [DEEPENING.md](DEEPENING.md))
|
|
38
|
+
5. Trade-offs — where leverage is high, where it's thin
|
|
39
|
+
|
|
40
|
+
### 3. Present and compare
|
|
41
|
+
|
|
42
|
+
Present designs sequentially so the user can absorb each one, then compare them in prose. Contrast by **depth** (leverage at the interface), **locality** (where change concentrates), and **seam placement**.
|
|
43
|
+
|
|
44
|
+
After comparing, give your own recommendation: which design you think is strongest and why. If elements from different designs would combine well, propose a hybrid. Be opinionated — the user wants a strong read, not a menu.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gxpm-autopilot
|
|
3
|
+
description: 开启 gxpm 自动驾驶模式。使用 Autopilot Grant 持久化用户授权,让代理在授权 profile 内自主完成 issue delivery。
|
|
4
|
+
---
|
|
5
|
+
<!-- AUTO-GENERATED from SKILL.md.tmpl - do not edit directly -->
|
|
6
|
+
|
|
7
|
+
## Host Preamble
|
|
8
|
+
|
|
9
|
+
Target host: OpenAI Codex CLI.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
GXPM_ROOT="${GXPM_ROOT:-$PWD}"
|
|
13
|
+
GXPM_STATE_DIR="${GXPM_STATE_DIR:-$GXPM_ROOT/.gxpm}"
|
|
14
|
+
export GXPM_ROOT GXPM_STATE_DIR
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
# gxpm Autopilot
|
|
18
|
+
|
|
19
|
+
## 入口条件
|
|
20
|
+
|
|
21
|
+
**何时触发**
|
|
22
|
+
- 用户明确要求"自动驾驶模式"。
|
|
23
|
+
- 用户选择 autopilot command prompt。
|
|
24
|
+
- 用户授权代理不再逐步确认而完成整个 gxpm 工作流。
|
|
25
|
+
- 用户说"全程交给你"、"不需要确认"等类似 utterance。
|
|
26
|
+
|
|
27
|
+
**前置条件**
|
|
28
|
+
- 需要 issue(已有 issue ID,或通过 `--auto-id` 新建)。
|
|
29
|
+
- 用户已明确授权代理自主行动。
|
|
30
|
+
|
|
31
|
+
**Skill 边界(什么情况下应该加载别的 skill)**
|
|
32
|
+
- Hard stop 出现且需要专项分析时 → `/gxpm-diagnose`、 `/gxpm-debug-issue`、 `/gxpm-grill`
|
|
33
|
+
- 仅需要单阶段操作(如只写 plan 或只 review) → 使用对应专项 skill,不启动 autopilot
|
|
34
|
+
- 用户未明确授权 → 不加载此 skill,按常规逐步确认推进
|
|
35
|
+
|
|
36
|
+
## 可操作流程
|
|
37
|
+
|
|
38
|
+
### 启动
|
|
39
|
+
|
|
40
|
+
若用户已给出 issue:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
gxpm autopilot start <issue-id> --profile full-delivery --prompt "<user prompt>"
|
|
44
|
+
gxpm issue status <issue-id>
|
|
45
|
+
gxpm issue next <issue-id>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
若用户只给任务,没有 issue:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
gxpm autopilot start --auto-id --profile full-delivery --prompt "<user prompt>"
|
|
52
|
+
gxpm issue list
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
随后按 `gxpm issue next <issue-id>` 推进。不要停在"我可以继续"的确认话术里。
|
|
56
|
+
|
|
57
|
+
### 授权边界
|
|
58
|
+
|
|
59
|
+
`full-delivery` 授权以下动作:
|
|
60
|
+
|
|
61
|
+
- 创建/推进 issue phases
|
|
62
|
+
- 写入和更新 gxpm artifacts
|
|
63
|
+
- 创建或使用 worktree
|
|
64
|
+
- 修改代码和文档
|
|
65
|
+
- 运行本地验证、lint、测试、浏览器 QA
|
|
66
|
+
- 创建 commit、push branch、创建或更新 PR
|
|
67
|
+
- 在验证通过后 merge/land
|
|
68
|
+
- land 后执行 cleanup
|
|
69
|
+
|
|
70
|
+
### 核心原则
|
|
71
|
+
|
|
72
|
+
Autopilot 的核心不是跳过治理,而是把用户授权落到 `autopilot-grant` artifact。active grant 允许代理在 profile 范围内自主规划、实施、验证、开 PR、merge/land 和清理;phase gate、artifact、验证证据仍然必须完整保留。
|
|
73
|
+
|
|
74
|
+
### 命令
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
gxpm autopilot status <issue-id>
|
|
78
|
+
gxpm autopilot list
|
|
79
|
+
gxpm autopilot stop <issue-id> --reason "<reason>"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## 红旗清单 / 反模式
|
|
83
|
+
|
|
84
|
+
- **STOP:用户明确停止或撤销授权。** 立即停止,写入阻塞原因到当前阶段 artifact。
|
|
85
|
+
- **STOP:需要密钥、账号登录、付费外部 API 或用户私密输入。** 先写入阻塞原因,停止自动驾驶。
|
|
86
|
+
- **STOP:涉及生产数据、破坏性迁移或无法自动回滚的操作。** 必须 human-in-the-loop。
|
|
87
|
+
- **STOP:merge conflict、验证失败或安全/权限边界无法自主解决。** 停止并记录。
|
|
88
|
+
- **STOP:当前 repo 明确规则与 Autopilot Grant 冲突。** 遵守 repo 规则,停止自动驾驶。
|
|
89
|
+
- **STOP:在 allowed actions 内反复询问用户确认。** active grant 的含义就是无需反复确认;只在 hard stop 时停止。
|
|
90
|
+
- **STOP:不要将 autopilot 视为跳过阶段门。** phase gate、artifact、验证证据仍然必须完整保留。
|
|
91
|
+
- **STOP:`stop_hook_active` 已经为 true 时不再重复阻止。** 避免无限循环。
|
|
92
|
+
- **危险信号:** 用户未授权不可逆操作却试图 merge/land → 拒绝并请求显式授权。
|
|
93
|
+
|
|
94
|
+
## 验证清单 / 出口条件
|
|
95
|
+
|
|
96
|
+
- [ ] `autopilot-grant` artifact 已持久化(含 issue、profile、prompt)。
|
|
97
|
+
- [ ] `gxpm issue status` 和 `gxpm issue next` 已执行。
|
|
98
|
+
- [ ] 各阶段 artifact、phase gate、验证证据完整保留(与 manual 模式一致)。
|
|
99
|
+
- [ ] Hard stop 时阻塞原因已写入当前阶段 artifact。
|
|
100
|
+
- [ ] 到达 terminal phase(land + cleanup 完成)或用户停止/撤销时正常结束。
|
|
101
|
+
- [ ] `gxpm autopilot stop` 已调用并记录 reason。
|
|
102
|
+
|
|
103
|
+
**失败时路由**
|
|
104
|
+
- 调试/验证失败 → `/gxpm-diagnose` 或 `/gxpm-debug-issue`
|
|
105
|
+
- 需求/架构决策受阻 → `/gxpm-grill`
|
|
106
|
+
- 代码审查问题 → `/gxpm-review-changes`
|
|
107
|
+
- 安全/权限问题 → 停止 autopilot,等待 human-in-the-loop
|
|
108
|
+
|
|
109
|
+
## 常见说辞表
|
|
110
|
+
|
|
111
|
+
| 用户 utterance | 推荐回应 |
|
|
112
|
+
|----------------|----------|
|
|
113
|
+
| "全程交给你,不用确认。" | 启动 `gxpm autopilot start --auto-id --profile full-delivery --prompt "..."`,然后按 `gxpm issue next` 推进。 |
|
|
114
|
+
| "帮我自动驾驶 GXPM-42。" | 启动 `gxpm autopilot start GXPM-42 --profile full-delivery --prompt "..."`,然后按 `gxpm issue next` 推进。 |
|
|
115
|
+
| "可以停了。" / "暂停 autopilot" | `gxpm autopilot stop <issue-id> --reason "User requested pause"`,报告当前阶段和已产出 artifact。 |
|
|
116
|
+
| "autopilot 到哪了?" | `gxpm autopilot status <issue-id>`,结合 `gxpm issue status` 汇报当前阶段和 next 推荐。 |
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gxpm-autopilot
|
|
3
|
+
description: 开启 gxpm 自动驾驶模式。使用 Autopilot Grant 持久化用户授权,让代理在授权 profile 内自主完成 issue delivery。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
{{PREAMBLE}}
|
|
7
|
+
|
|
8
|
+
# gxpm Autopilot
|
|
9
|
+
|
|
10
|
+
## 入口条件
|
|
11
|
+
|
|
12
|
+
**何时触发**
|
|
13
|
+
- 用户明确要求"自动驾驶模式"。
|
|
14
|
+
- 用户选择 autopilot command prompt。
|
|
15
|
+
- 用户授权代理不再逐步确认而完成整个 gxpm 工作流。
|
|
16
|
+
- 用户说"全程交给你"、"不需要确认"等类似 utterance。
|
|
17
|
+
|
|
18
|
+
**前置条件**
|
|
19
|
+
- 需要 issue(已有 issue ID,或通过 `--auto-id` 新建)。
|
|
20
|
+
- 用户已明确授权代理自主行动。
|
|
21
|
+
|
|
22
|
+
**Skill 边界(什么情况下应该加载别的 skill)**
|
|
23
|
+
- Hard stop 出现且需要专项分析时 → `/gxpm-diagnose`、 `/gxpm-debug-issue`、 `/gxpm-grill`
|
|
24
|
+
- 仅需要单阶段操作(如只写 plan 或只 review) → 使用对应专项 skill,不启动 autopilot
|
|
25
|
+
- 用户未明确授权 → 不加载此 skill,按常规逐步确认推进
|
|
26
|
+
|
|
27
|
+
## 可操作流程
|
|
28
|
+
|
|
29
|
+
### 启动
|
|
30
|
+
|
|
31
|
+
若用户已给出 issue:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
gxpm autopilot start <issue-id> --profile full-delivery --prompt "<user prompt>"
|
|
35
|
+
gxpm issue status <issue-id>
|
|
36
|
+
gxpm issue next <issue-id>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
若用户只给任务,没有 issue:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
gxpm autopilot start --auto-id --profile full-delivery --prompt "<user prompt>"
|
|
43
|
+
gxpm issue list
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
随后按 `gxpm issue next <issue-id>` 推进。不要停在"我可以继续"的确认话术里。
|
|
47
|
+
|
|
48
|
+
### 授权边界
|
|
49
|
+
|
|
50
|
+
`full-delivery` 授权以下动作:
|
|
51
|
+
|
|
52
|
+
- 创建/推进 issue phases
|
|
53
|
+
- 写入和更新 gxpm artifacts
|
|
54
|
+
- 创建或使用 worktree
|
|
55
|
+
- 修改代码和文档
|
|
56
|
+
- 运行本地验证、lint、测试、浏览器 QA
|
|
57
|
+
- 创建 commit、push branch、创建或更新 PR
|
|
58
|
+
- 在验证通过后 merge/land
|
|
59
|
+
- land 后执行 cleanup
|
|
60
|
+
|
|
61
|
+
### 核心原则
|
|
62
|
+
|
|
63
|
+
Autopilot 的核心不是跳过治理,而是把用户授权落到 `autopilot-grant` artifact。active grant 允许代理在 profile 范围内自主规划、实施、验证、开 PR、merge/land 和清理;phase gate、artifact、验证证据仍然必须完整保留。
|
|
64
|
+
|
|
65
|
+
### 命令
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
gxpm autopilot status <issue-id>
|
|
69
|
+
gxpm autopilot list
|
|
70
|
+
gxpm autopilot stop <issue-id> --reason "<reason>"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## 红旗清单 / 反模式
|
|
74
|
+
|
|
75
|
+
- **STOP:用户明确停止或撤销授权。** 立即停止,写入阻塞原因到当前阶段 artifact。
|
|
76
|
+
- **STOP:需要密钥、账号登录、付费外部 API 或用户私密输入。** 先写入阻塞原因,停止自动驾驶。
|
|
77
|
+
- **STOP:涉及生产数据、破坏性迁移或无法自动回滚的操作。** 必须 human-in-the-loop。
|
|
78
|
+
- **STOP:merge conflict、验证失败或安全/权限边界无法自主解决。** 停止并记录。
|
|
79
|
+
- **STOP:当前 repo 明确规则与 Autopilot Grant 冲突。** 遵守 repo 规则,停止自动驾驶。
|
|
80
|
+
- **STOP:在 allowed actions 内反复询问用户确认。** active grant 的含义就是无需反复确认;只在 hard stop 时停止。
|
|
81
|
+
- **STOP:不要将 autopilot 视为跳过阶段门。** phase gate、artifact、验证证据仍然必须完整保留。
|
|
82
|
+
- **STOP:`stop_hook_active` 已经为 true 时不再重复阻止。** 避免无限循环。
|
|
83
|
+
- **危险信号:** 用户未授权不可逆操作却试图 merge/land → 拒绝并请求显式授权。
|
|
84
|
+
|
|
85
|
+
## 验证清单 / 出口条件
|
|
86
|
+
|
|
87
|
+
- [ ] `autopilot-grant` artifact 已持久化(含 issue、profile、prompt)。
|
|
88
|
+
- [ ] `gxpm issue status` 和 `gxpm issue next` 已执行。
|
|
89
|
+
- [ ] 各阶段 artifact、phase gate、验证证据完整保留(与 manual 模式一致)。
|
|
90
|
+
- [ ] Hard stop 时阻塞原因已写入当前阶段 artifact。
|
|
91
|
+
- [ ] 到达 terminal phase(land + cleanup 完成)或用户停止/撤销时正常结束。
|
|
92
|
+
- [ ] `gxpm autopilot stop` 已调用并记录 reason。
|
|
93
|
+
|
|
94
|
+
**失败时路由**
|
|
95
|
+
- 调试/验证失败 → `/gxpm-diagnose` 或 `/gxpm-debug-issue`
|
|
96
|
+
- 需求/架构决策受阻 → `/gxpm-grill`
|
|
97
|
+
- 代码审查问题 → `/gxpm-review-changes`
|
|
98
|
+
- 安全/权限问题 → 停止 autopilot,等待 human-in-the-loop
|
|
99
|
+
|
|
100
|
+
## 常见说辞表
|
|
101
|
+
|
|
102
|
+
| 用户 utterance | 推荐回应 |
|
|
103
|
+
|----------------|----------|
|
|
104
|
+
| "全程交给你,不用确认。" | 启动 `gxpm autopilot start --auto-id --profile full-delivery --prompt "..."`,然后按 `gxpm issue next` 推进。 |
|
|
105
|
+
| "帮我自动驾驶 GXPM-42。" | 启动 `gxpm autopilot start GXPM-42 --profile full-delivery --prompt "..."`,然后按 `gxpm issue next` 推进。 |
|
|
106
|
+
| "可以停了。" / "暂停 autopilot" | `gxpm autopilot stop <issue-id> --reason "User requested pause"`,报告当前阶段和已产出 artifact。 |
|
|
107
|
+
| "autopilot 到哪了?" | `gxpm autopilot status <issue-id>`,结合 `gxpm issue status` 汇报当前阶段和 next 推荐。 |
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gxpm-browser
|
|
3
|
+
description: Headless browser automation for QA evidence capture. Use when user asks to test a web page, take a screenshot, verify an element, fill a form, or capture browser evidence for an issue.
|
|
4
|
+
status: stable
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED from SKILL.md.tmpl - do not edit directly -->
|
|
7
|
+
|
|
8
|
+
# gxpm-browser
|
|
9
|
+
|
|
10
|
+
Minimal headless browser CLI built on Playwright. Designed for gxpm evidence
|
|
11
|
+
capture and QA automation, not general web scraping.
|
|
12
|
+
|
|
13
|
+
## 入口条件
|
|
14
|
+
|
|
15
|
+
- User asks to "test the site", "open in browser", "take a screenshot"
|
|
16
|
+
- QA phase needs browser/runtime proof
|
|
17
|
+
- Verify-gate requires visual evidence
|
|
18
|
+
- User describes a bug that needs reproduction with screenshot
|
|
19
|
+
|
|
20
|
+
## 可操作流程
|
|
21
|
+
|
|
22
|
+
## Commands
|
|
23
|
+
|
|
24
|
+
### Navigate and inspect
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
gxpm-browser navigate <url> [--json]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Returns page title and final URL after `networkidle`.
|
|
31
|
+
|
|
32
|
+
### Screenshot evidence
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
gxpm-browser screenshot <url> [--out <path>] [--full-page] [--json]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Default output: `/tmp/gxpm-browser-<ts>.png`.
|
|
39
|
+
If run inside a repo with an active issue, pass `--issueid <id>` to write to
|
|
40
|
+
`.gxpm/issues/<id>/evidence/browser/` automatically.
|
|
41
|
+
|
|
42
|
+
### Assert element text
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
gxpm-browser assert <url> --selector <css> --text <expected> [--json]
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Exits 1 if the first matching element does not contain the expected text.
|
|
49
|
+
Use this for pass/fail QA gates.
|
|
50
|
+
|
|
51
|
+
### Interact
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
gxpm-browser click <url> --selector <css> [--json]
|
|
55
|
+
gxpm-browser type <url> --selector <css> --text <value> [--json]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Headed mode for debugging
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
gxpm-browser screenshot <url> --no-headless
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Opens a visible Chrome window. Use sparingly; default is headless.
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## Evidence path
|
|
68
|
+
|
|
69
|
+
When `--issueid` is provided, screenshots are written to:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
.gxpm/issues/<issue-id>/evidence/browser/screenshot-<ts>.png
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Link them in `qa-findings` or `verify-findings` artifacts:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
gxpm artifact write <issue-id> qa-findings --json '{"evidence":["browser/screenshot-12345.png"]}'
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Limitations
|
|
82
|
+
|
|
83
|
+
- Uses Chromium/Chrome via Playwright. Requires Chrome or `playwright install chromium`.
|
|
84
|
+
- No persistent session state between commands (each command launches a fresh browser).
|
|
85
|
+
- No network interception or request mocking; use `agent-browser` for advanced automation.
|
|
86
|
+
- cmux browser session investigation is a separate path (see main gxpm skill).
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## 红旗清单 / 反模式
|
|
90
|
+
|
|
91
|
+
- **禁止用于通用网页抓取** — 本 skill 仅限 gxpm 证据捕获与 QA 自动化
|
|
92
|
+
- 不要在没有明确 QA 需求或证据要求时随意截图
|
|
93
|
+
- 不要在 verify-gate 未要求时产生冗余的浏览器证据
|
|
94
|
+
|
|
95
|
+
## 验证清单 / 出口条件
|
|
96
|
+
|
|
97
|
+
- [ ] 浏览器操作成功执行(页面加载、元素验证、截图等)
|
|
98
|
+
- [ ] 证据文件保存到正确路径并可在后续 QA 环节引用
|
|
99
|
+
- [ ] 截图/记录与 issue 中描述的 bug 或验收标准对应
|
|
100
|
+
- [ ] 相关证据已归档或链接到 verify-gate 交付物
|
|
101
|
+
|
|
102
|
+
## Read Next
|
|
103
|
+
|
|
104
|
+
- `docs/governance/development-contract.md`
|
|
105
|
+
- Main `/gxpm` skill for QA phase gate details
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gxpm-browser
|
|
3
|
+
description: Headless browser automation for QA evidence capture. Use when user asks to test a web page, take a screenshot, verify an element, fill a form, or capture browser evidence for an issue.
|
|
4
|
+
status: stable
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# gxpm-browser
|
|
8
|
+
|
|
9
|
+
Minimal headless browser CLI built on Playwright. Designed for gxpm evidence
|
|
10
|
+
capture and QA automation, not general web scraping.
|
|
11
|
+
|
|
12
|
+
## 入口条件
|
|
13
|
+
|
|
14
|
+
- User asks to "test the site", "open in browser", "take a screenshot"
|
|
15
|
+
- QA phase needs browser/runtime proof
|
|
16
|
+
- Verify-gate requires visual evidence
|
|
17
|
+
- User describes a bug that needs reproduction with screenshot
|
|
18
|
+
|
|
19
|
+
## 可操作流程
|
|
20
|
+
|
|
21
|
+
{{REFERENCE:commands}}
|
|
22
|
+
|
|
23
|
+
{{REFERENCE:evidence-path}}
|
|
24
|
+
|
|
25
|
+
## 红旗清单 / 反模式
|
|
26
|
+
|
|
27
|
+
- **禁止用于通用网页抓取** — 本 skill 仅限 gxpm 证据捕获与 QA 自动化
|
|
28
|
+
- 不要在没有明确 QA 需求或证据要求时随意截图
|
|
29
|
+
- 不要在 verify-gate 未要求时产生冗余的浏览器证据
|
|
30
|
+
|
|
31
|
+
## 验证清单 / 出口条件
|
|
32
|
+
|
|
33
|
+
- [ ] 浏览器操作成功执行(页面加载、元素验证、截图等)
|
|
34
|
+
- [ ] 证据文件保存到正确路径并可在后续 QA 环节引用
|
|
35
|
+
- [ ] 截图/记录与 issue 中描述的 bug 或验收标准对应
|
|
36
|
+
- [ ] 相关证据已归档或链接到 verify-gate 交付物
|
|
37
|
+
|
|
38
|
+
## Read Next
|
|
39
|
+
|
|
40
|
+
- `docs/governance/development-contract.md`
|
|
41
|
+
- Main `/gxpm` skill for QA phase gate details
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
## Commands
|
|
2
|
+
|
|
3
|
+
### Navigate and inspect
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
gxpm-browser navigate <url> [--json]
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Returns page title and final URL after `networkidle`.
|
|
10
|
+
|
|
11
|
+
### Screenshot evidence
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
gxpm-browser screenshot <url> [--out <path>] [--full-page] [--json]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Default output: `/tmp/gxpm-browser-<ts>.png`.
|
|
18
|
+
If run inside a repo with an active issue, pass `--issueid <id>` to write to
|
|
19
|
+
`.gxpm/issues/<id>/evidence/browser/` automatically.
|
|
20
|
+
|
|
21
|
+
### Assert element text
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
gxpm-browser assert <url> --selector <css> --text <expected> [--json]
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Exits 1 if the first matching element does not contain the expected text.
|
|
28
|
+
Use this for pass/fail QA gates.
|
|
29
|
+
|
|
30
|
+
### Interact
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
gxpm-browser click <url> --selector <css> [--json]
|
|
34
|
+
gxpm-browser type <url> --selector <css> --text <value> [--json]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Headed mode for debugging
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
gxpm-browser screenshot <url> --no-headless
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Opens a visible Chrome window. Use sparingly; default is headless.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
## Evidence path
|
|
2
|
+
|
|
3
|
+
When `--issueid` is provided, screenshots are written to:
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
.gxpm/issues/<issue-id>/evidence/browser/screenshot-<ts>.png
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Link them in `qa-findings` or `verify-findings` artifacts:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
gxpm artifact write <issue-id> qa-findings --json '{"evidence":["browser/screenshot-12345.png"]}'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Limitations
|
|
16
|
+
|
|
17
|
+
- Uses Chromium/Chrome via Playwright. Requires Chrome or `playwright install chromium`.
|
|
18
|
+
- No persistent session state between commands (each command launches a fresh browser).
|
|
19
|
+
- No network interception or request mocking; use `agent-browser` for advanced automation.
|
|
20
|
+
- cmux browser session investigation is a separate path (see main gxpm skill).
|