thachvd-kit 1.0.34 → 1.0.36
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/README.md +42 -20
- package/bin/cli.js +187 -103
- package/bin/entry.js +2 -0
- package/bin/matt-skills.js +192 -0
- package/bin/policy.js +8 -4
- package/bin/upgrade.js +215 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# thachvd-kit
|
|
2
2
|
|
|
3
|
-
`thachvd-kit` bootstraps project context for AI coding agents. It creates shared entry files and scan-based documentation so an agent can understand the repository quickly.
|
|
3
|
+
`thachvd-kit` bootstraps project context for AI coding agents. It creates shared entry files and scan-based documentation so an agent can understand the repository quickly, and it installs/checks [Matt Pocock's promoted skills](https://github.com/mattpocock/skills) — the single workflow layer for planning, implementation, debugging, architecture, and review.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Skill bodies are intentionally not vendored into this kit or copied globally. `thachvd-kit skills install` delegates to the upstream `skills` CLI and installs the promoted set project-locally under `.agents/skills/`.
|
|
6
6
|
|
|
7
7
|
## Quick Start
|
|
8
8
|
|
|
@@ -15,9 +15,17 @@ thachvd-kit setup
|
|
|
15
15
|
thachvd-kit doctor
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
For an existing project:
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
```bash
|
|
21
|
+
thachvd-kit upgrade
|
|
22
|
+
thachvd-kit setup
|
|
23
|
+
thachvd-kit doctor
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`global` installs a managed tool-routing block into the current user's Antigravity and Codex global instruction files while preserving unrelated user content. `init` is safe and project-focused: it does not install external tools, install skills, or create a second workflow engine. For an existing project that already has refined `.agent/docs/*`, use `thachvd-kit upgrade` instead of re-running `init --yes` — it only adds/updates thachvd-kit's managed policy blocks and removes a small set of obsolete generated defaults, preserving project-specific knowledge (see Safe Project Upgrade below). `setup` installs the promoted Matt Pocock skill set by default (`--no-install-skills` to skip) alongside MCP/RTK tooling.
|
|
27
|
+
|
|
28
|
+
After the first skill install, run `/setup-matt-pocock-skills` once inside your AI client to configure the issue tracker, triage labels, and generated docs location — thachvd-kit does not simulate that skill.
|
|
21
29
|
|
|
22
30
|
## Generated Files
|
|
23
31
|
|
|
@@ -29,24 +37,25 @@ For an existing project that already has refined `.agent/docs/*`, use `thachvd-k
|
|
|
29
37
|
- `.agent/docs/architecture.md`: architecture notes to refine over time.
|
|
30
38
|
- `.agent/docs/conventions.md`: coding and verification conventions.
|
|
31
39
|
- `.agent/docs/workflow.md`: the project workflow contract.
|
|
32
|
-
- `.agent/docs/tooling.md`:
|
|
40
|
+
- `.agent/docs/tooling.md`: Matt Pocock skills, MCP, RTK, and Playwright setup.
|
|
33
41
|
- `.agent/docs/getting-started.md`: member onboarding guide.
|
|
34
42
|
- `.agent/docs/index-project-prompt.md`: durable prompt for the first project scan.
|
|
35
43
|
|
|
36
|
-
`init` does not generate `.agent/skills`, `.agent/workflows`, `.agent/agents`,
|
|
44
|
+
`init` does not generate `.agent/skills`, `.agent/workflows`, `.agent/agents`, or client-specific skill copies — skills are installed by `thachvd-kit setup`/`skills install` into `.agents/skills/` instead. `setup` can optionally add a Claude Code Stop hook (see below); it never adds workflow content of its own.
|
|
37
45
|
|
|
38
46
|
## Workflow
|
|
39
47
|
|
|
40
|
-
|
|
48
|
+
[Matt Pocock's promoted skills](https://github.com/mattpocock/skills) (`skills/engineering/` + `skills/productivity/`) are the workflow layer, installed project-locally under `.agents/skills/`:
|
|
41
49
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
- Ambiguous feature or design: `/grill-with-docs`, then optionally `/to-spec` for a durable contract.
|
|
51
|
+
- Normal feature: `/grill-with-docs` -> `/to-spec` -> `/implement`.
|
|
52
|
+
- Large feature needing decomposition: add `/to-tickets` before `/implement`.
|
|
53
|
+
- Huge, multi-session uncertainty: `/wayfinder`.
|
|
54
|
+
- Bug or failing behavior: `/diagnosing-bugs`.
|
|
55
|
+
- Test-driven implementation: `/tdd`.
|
|
56
|
+
- Architecture survey: `/improve-codebase-architecture` (`/codebase-design` for the design vocabulary).
|
|
57
|
+
- Pre-completion review: `/code-review`.
|
|
58
|
+
- Unsure which skill fits? Run `/ask-matt`.
|
|
50
59
|
|
|
51
60
|
Fast-path eligibility is based on risk and contract surface, not file count. A localized, mechanically obvious, low-risk change with focused verification can use the client fast path; a one-file security, schema, payment, concurrency, or public-contract change should not.
|
|
52
61
|
|
|
@@ -91,9 +100,19 @@ thachvd-kit upgrade
|
|
|
91
100
|
|
|
92
101
|
## Integrations
|
|
93
102
|
|
|
94
|
-
###
|
|
103
|
+
### Matt Pocock Skills
|
|
104
|
+
|
|
105
|
+
The promoted engineering + productivity catalog from [mattpocock/skills](https://github.com/mattpocock/skills), installed project-locally (never globally) under `.agents/skills/`:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
thachvd-kit skills install # install the promoted set (--dry-run to preview)
|
|
109
|
+
thachvd-kit skills check # read-only: report what's installed
|
|
110
|
+
thachvd-kit skills update # re-add each promoted skill individually to update it (slower: one clone per skill)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The manifest (`bin/matt-skills.js`) mirrors upstream's `skills/engineering/` + `skills/productivity/` catalog and deliberately excludes `skills/in-progress`, `skills/misc`, and `skills/deprecated`. Installation targets the Codex and Antigravity agent identifiers of the upstream `skills` CLI, both of which resolve to `.agents/skills/`.
|
|
95
114
|
|
|
96
|
-
|
|
115
|
+
After the first install, run `/setup-matt-pocock-skills` once inside your AI client — it configures the issue tracker, triage labels, and generated docs location. thachvd-kit does not simulate that skill.
|
|
97
116
|
|
|
98
117
|
### codebase-memory-mcp
|
|
99
118
|
|
|
@@ -122,15 +141,18 @@ Examples: `rtk git status`, `rtk npm test`, `rtk git log`. If it is not installe
|
|
|
122
141
|
thachvd-kit init [--yes]
|
|
123
142
|
thachvd-kit upgrade [--dry-run]
|
|
124
143
|
thachvd-kit global [--dry-run] [--antigravity-only|--codex-only]
|
|
125
|
-
thachvd-kit setup [--no-setup-mcp] [--no-setup-hook] [--no-install-rtk] [--no-index]
|
|
144
|
+
thachvd-kit setup [--no-setup-mcp] [--no-setup-hook] [--no-install-rtk] [--no-index] [--no-install-skills]
|
|
126
145
|
thachvd-kit doctor
|
|
127
146
|
thachvd-kit prompt
|
|
147
|
+
thachvd-kit skills install [--dry-run]
|
|
148
|
+
thachvd-kit skills check
|
|
149
|
+
thachvd-kit skills update [--dry-run]
|
|
128
150
|
thachvd-kit --help
|
|
129
151
|
```
|
|
130
152
|
|
|
131
|
-
`setup` configures MCP entries for detected clients,
|
|
153
|
+
`init` generates project context for a new project; `upgrade` and `global` are the safe, additive-only paths for an existing project or machine (see Safe Project Upgrade and Global Tool Routing above). `setup` installs the promoted Matt Pocock skill set by default (skip with `--no-install-skills`), configures MCP entries for detected clients, and adds a Claude Code Stop hook that checks for Plan/Review/Verification evidence before a feature or refactor can be reported as done (skip with `--no-setup-hook`). The hook only checks for evidence; it never prescribes which skill must produce it, so it works whether that evidence came from a Matt Pocock skill or a manual process. `setup` also auto-installs missing npm-based MCP packages (`codebase-memory-mcp`, `context7-mcp`, `playwright-mcp`), indexes the current repository with `codebase-memory-mcp` (skip with `--no-index`), and installs `rtk` via `cargo` when `cargo` is available (skip with `--no-install-rtk`). `doctor` is read-only and reports missing integrations, including the promoted skill set, without changing the machine.
|
|
132
154
|
|
|
133
|
-
The project-indexing prompt is saved by `init`, so installing
|
|
155
|
+
The project-indexing prompt is saved by `init`, so installing skills or RTK afterward cannot make it disappear. Run `thachvd-kit prompt` whenever you need to print it again.
|
|
134
156
|
|
|
135
157
|
## Development
|
|
136
158
|
|
package/bin/cli.js
CHANGED
|
@@ -6,6 +6,15 @@ const { spawnSync } = require('child_process');
|
|
|
6
6
|
const prompts = require('prompts');
|
|
7
7
|
const pc = require('picocolors');
|
|
8
8
|
const packageJson = require('../package.json');
|
|
9
|
+
const mattSkills = require('./matt-skills');
|
|
10
|
+
const {
|
|
11
|
+
QUALITY_FLOOR_SECTION,
|
|
12
|
+
AGENT_RULES_SECTION,
|
|
13
|
+
CONVENTIONS_STANDARDS_SECTION,
|
|
14
|
+
FAST_PATH_SECTION,
|
|
15
|
+
GETTING_STARTED_FAST_PATH_SECTION,
|
|
16
|
+
TOOL_ROUTING_SECTION
|
|
17
|
+
} = require('./policy');
|
|
9
18
|
|
|
10
19
|
const sourceDir = path.resolve(__dirname, '..');
|
|
11
20
|
const targetDir = process.cwd();
|
|
@@ -36,17 +45,25 @@ function printHelp() {
|
|
|
36
45
|
console.log(`
|
|
37
46
|
${pc.bold('Usage:')}
|
|
38
47
|
thachvd-kit init [--yes]
|
|
39
|
-
thachvd-kit
|
|
48
|
+
thachvd-kit upgrade [--dry-run]
|
|
49
|
+
thachvd-kit global [--dry-run] [--antigravity-only|--codex-only]
|
|
50
|
+
thachvd-kit setup [--yes] [--no-install-skills]
|
|
40
51
|
thachvd-kit doctor
|
|
41
52
|
thachvd-kit prompt
|
|
53
|
+
thachvd-kit skills install [--dry-run]
|
|
54
|
+
thachvd-kit skills check
|
|
55
|
+
thachvd-kit skills update [--dry-run]
|
|
42
56
|
thachvd-kit --version
|
|
43
57
|
thachvd-kit --help
|
|
44
58
|
|
|
45
59
|
${pc.bold('Commands:')}
|
|
46
|
-
init Generate project context files and documentation
|
|
47
|
-
|
|
60
|
+
init Generate project context files and documentation (new projects)
|
|
61
|
+
upgrade Safely add/update thachvd-kit's managed policy blocks in an existing project (does not rescan or regenerate)
|
|
62
|
+
global Patch a managed tool-routing block into the current user's Antigravity/Codex global instructions
|
|
63
|
+
setup Install/configure MCP, Matt Pocock skills, and recommended local tooling
|
|
48
64
|
doctor Check project context and local integrations
|
|
49
65
|
prompt Print the saved project-indexing prompt again
|
|
66
|
+
skills Install, check, or update the promoted Matt Pocock skill set
|
|
50
67
|
|
|
51
68
|
${pc.bold('Options:')}
|
|
52
69
|
--yes Overwrite generated files or accept setup defaults
|
|
@@ -54,6 +71,10 @@ ${pc.bold('Options:')}
|
|
|
54
71
|
--no-setup-hook Skip the Claude Code Definition-of-Done Stop hook during setup
|
|
55
72
|
--no-install-rtk Skip auto-installing rtk via cargo during setup
|
|
56
73
|
--no-index Skip auto-indexing the repository with codebase-memory-mcp during setup
|
|
74
|
+
--no-install-skills Skip installing Matt Pocock skills during setup
|
|
75
|
+
--dry-run Preview a change without writing it (upgrade/global/skills install/skills update)
|
|
76
|
+
--antigravity-only Limit global to the Antigravity global instructions
|
|
77
|
+
--codex-only Limit global to the Codex global instructions
|
|
57
78
|
--version Show the installed CLI version
|
|
58
79
|
--help Show this help message
|
|
59
80
|
|
|
@@ -64,19 +85,15 @@ ${pc.bold('What gets generated:')}
|
|
|
64
85
|
.cursorrules Cursor entry file that points to AGENTS.md
|
|
65
86
|
.agent/docs/ Project context, architecture, workflow, tooling, and durable onboarding prompt
|
|
66
87
|
|
|
67
|
-
${pc.bold('Workflow
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Bug or failing behavior systematic-debugging Find the root cause before editing
|
|
73
|
-
Pre-merge review requesting-code-review Review before completion or merge
|
|
74
|
-
UI / UX work $frontend-design, $webapp-testing
|
|
75
|
-
Project state thachvd-kit doctor
|
|
88
|
+
${pc.bold('Workflow:')}
|
|
89
|
+
Matt Pocock's promoted skills (installed under .agents/skills/) are the
|
|
90
|
+
workflow layer. Use the matching skill when a specialized workflow is
|
|
91
|
+
useful; if unsure which one, use /ask-matt. Do not invoke a heavyweight
|
|
92
|
+
skill for a localized, obvious change.
|
|
76
93
|
|
|
77
94
|
${pc.bold('Tip:')}
|
|
78
|
-
|
|
79
|
-
|
|
95
|
+
Run thachvd-kit setup to install the promoted skill set and configure
|
|
96
|
+
local tooling, then thachvd-kit doctor to verify the machine.
|
|
80
97
|
`);
|
|
81
98
|
}
|
|
82
99
|
|
|
@@ -742,7 +759,6 @@ function scanProject() {
|
|
|
742
759
|
infrastructure: uniq(infrastructure),
|
|
743
760
|
ci_cd: ciCd,
|
|
744
761
|
test_framework: TEST_FRAMEWORK_CHOICES.includes(testFramework) ? testFramework : 'auto-detect',
|
|
745
|
-
max_file_lines: '300',
|
|
746
762
|
code_style: 'project-standard',
|
|
747
763
|
architecture_notes: '<!-- Add notes -->',
|
|
748
764
|
current_phase: 'Initial setup',
|
|
@@ -769,35 +785,33 @@ If any \`.agent/docs/*.md\` file still contains \`TODO: refine\`, update the doc
|
|
|
769
785
|
|
|
770
786
|
## Workflow
|
|
771
787
|
|
|
772
|
-
|
|
788
|
+
Matt Pocock's promoted skills (installed under \`.agents/skills/\` by \`thachvd-kit setup\`) are the workflow layer. Use the matching skill when a specialized workflow is useful:
|
|
773
789
|
|
|
774
|
-
-
|
|
775
|
-
-
|
|
776
|
-
-
|
|
777
|
-
-
|
|
778
|
-
-
|
|
779
|
-
-
|
|
790
|
+
- Clear, localized change: inspect -> edit -> focused verification. Do not force a heavyweight skill.
|
|
791
|
+
- Ambiguous feature or design: \`/grill-with-docs\`, then optionally \`/to-spec\` for a durable contract.
|
|
792
|
+
- Normal feature: \`/grill-with-docs\` -> \`/to-spec\` -> \`/implement\`.
|
|
793
|
+
- Large feature needing decomposition: add \`/to-tickets\` before \`/implement\`.
|
|
794
|
+
- Huge, multi-session uncertainty: \`/wayfinder\`.
|
|
795
|
+
- Bug or failing behavior: \`/diagnosing-bugs\`.
|
|
796
|
+
- Test-driven implementation: \`/tdd\` (skip the ceremony for trivial config/text changes).
|
|
797
|
+
- Architecture survey: \`/improve-codebase-architecture\`; use \`/codebase-design\` as the design vocabulary.
|
|
798
|
+
- Pre-completion review: \`/code-review\` once when code risk warrants it.
|
|
780
799
|
|
|
781
|
-
|
|
800
|
+
If unsure which skill fits, use \`/ask-matt\`.
|
|
782
801
|
|
|
783
|
-
|
|
802
|
+
Questions and research do not edit product code. A fast path is allowed only when the change is localized, mechanically obvious, low-risk, and has focused verification; file count alone is not a gate. State the scope and verification before editing. If the task becomes ambiguous or its behavior, contract, or risk surface grows, use the matching planning skill above instead.
|
|
784
803
|
|
|
785
|
-
|
|
804
|
+
See \`.agent/docs/workflow.md\` for the full route matrix. This kit does not implement a second workflow engine; it only installs and checks the promoted skill set (\`thachvd-kit skills install|check|update\`).
|
|
786
805
|
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
- Keep changes surgical and remove only dead code introduced by your change.
|
|
791
|
-
- **MCP First**: Prioritize \`codebase-memory-mcp\` for symbols, call paths, architecture, and impact; use \`context7\` for API/docs queries and \`playwright\` for browser/UI verification. Fall back to normal file search when an integration is unavailable.
|
|
792
|
-
- Prefer \`rtk\` by default for verbose shell commands such as \`rtk git status\`, \`rtk npm test\`, and \`rtk git log\`. Run the underlying command directly only when RTK is unavailable or incompatible.
|
|
793
|
-
- Tests or equivalent verification are mandatory before claiming done.
|
|
794
|
-
- Keep files under ${data.max_file_lines || '300'} lines unless the project already has a different standard in \`.agent/docs/conventions.md\`.
|
|
806
|
+
${QUALITY_FLOOR_SECTION}
|
|
807
|
+
|
|
808
|
+
${AGENT_RULES_SECTION}
|
|
795
809
|
|
|
796
810
|
## Shared Knowledge
|
|
797
811
|
|
|
798
812
|
- Project context: \`.agent/docs/\`
|
|
799
813
|
- Tooling setup: \`.agent/docs/tooling.md\`
|
|
800
|
-
-
|
|
814
|
+
- Matt Pocock skills: promoted set installed under \`.agents/skills/\` via \`thachvd-kit skills install\`
|
|
801
815
|
- RTK: recommended local CLI for compact command output
|
|
802
816
|
- Antigravity and Cursor entry rules: \`GEMINI.md\` and \`.cursorrules\`
|
|
803
817
|
`;
|
|
@@ -807,7 +821,7 @@ function generateIndexProjectPrompt() {
|
|
|
807
821
|
return `# Project Indexing Prompt
|
|
808
822
|
|
|
809
823
|
Read CLAUDE.md (if using Claude Code), AGENTS.md, and all files under .agent/docs/.
|
|
810
|
-
Use
|
|
824
|
+
Use the project's Matt Pocock skills for workflow (see AGENTS.md; run /ask-matt if unsure which fits) and use codebase-memory MCP for structural code discovery when available.
|
|
811
825
|
Ask me what this project does and any important conventions I want preserved.
|
|
812
826
|
Then scan this repository and refine the generated context docs with factual rules.
|
|
813
827
|
Do not implement product code during onboarding.
|
|
@@ -985,16 +999,12 @@ Before non-trivial implementation work, inspect this file. If it is stale or sti
|
|
|
985
999
|
`;
|
|
986
1000
|
}
|
|
987
1001
|
|
|
988
|
-
function generateConventionsDoc(
|
|
1002
|
+
function generateConventionsDoc() {
|
|
989
1003
|
return `# Coding Conventions
|
|
990
1004
|
|
|
991
|
-
|
|
1005
|
+
${CONVENTIONS_STANDARDS_SECTION}
|
|
992
1006
|
|
|
993
|
-
|
|
994
|
-
- Code comments and identifiers should be written in English.
|
|
995
|
-
- Keep changes scoped to the user request.
|
|
996
|
-
- Prefer existing local patterns over introducing new abstractions.
|
|
997
|
-
- TODO: refine naming, formatting, folder, API, state, styling, and testing conventions from the real codebase.
|
|
1007
|
+
${QUALITY_FLOOR_SECTION}
|
|
998
1008
|
|
|
999
1009
|
## Verification
|
|
1000
1010
|
|
|
@@ -1008,34 +1018,38 @@ function generateConventionsDoc(data) {
|
|
|
1008
1018
|
function generateWorkflowDoc() {
|
|
1009
1019
|
return `# Agent Workflow
|
|
1010
1020
|
|
|
1011
|
-
This project uses
|
|
1021
|
+
This project uses Matt Pocock's promoted skills (installed under .agents/skills/ by \`thachvd-kit setup\`) as the workflow layer. thachvd-kit only provides project context, the skill manifest, and integration setup; it is not a second workflow engine.
|
|
1012
1022
|
|
|
1013
1023
|
## Before Every Task
|
|
1014
1024
|
|
|
1015
1025
|
1. Read AGENTS.md and the relevant files under .agent/docs/.
|
|
1016
|
-
2. Use the
|
|
1026
|
+
2. Use the promoted skill that matches the request, or run /ask-matt if unsure which one fits.
|
|
1017
1027
|
3. Use codebase-memory MCP for structural discovery when available.
|
|
1018
|
-
4. Make changes only after the required planning gate.
|
|
1028
|
+
4. Make changes only after the required planning gate for that situation.
|
|
1019
1029
|
5. Verify the change and request review before completion.
|
|
1020
1030
|
|
|
1021
1031
|
## Route Matrix
|
|
1022
1032
|
|
|
1023
|
-
| Situation |
|
|
1033
|
+
| Situation | Skill | Gate |
|
|
1024
1034
|
|---|---|---|
|
|
1025
1035
|
| Question or research only | direct answer or research | no product-code edits |
|
|
1026
|
-
|
|
|
1027
|
-
|
|
|
1028
|
-
|
|
|
1029
|
-
|
|
|
1030
|
-
|
|
|
1036
|
+
| Clear, localized change | fast path (no skill) | inspect -> edit -> focused verify |
|
|
1037
|
+
| Ambiguous feature or design | /grill-with-docs, then optionally /to-spec | durable contract before implementation when useful |
|
|
1038
|
+
| Normal feature | /grill-with-docs -> /to-spec -> /implement | spec agreed before implementation |
|
|
1039
|
+
| Large feature needing decomposition | /grill-with-docs -> /to-spec -> /to-tickets -> /implement | tickets agreed before implementation |
|
|
1040
|
+
| Huge, multi-session uncertainty | /wayfinder | shared decision map before implementation |
|
|
1041
|
+
| Bug or failing behavior | /diagnosing-bugs | reproduce -> root cause -> regression protection -> fix -> verify |
|
|
1042
|
+
| Test-driven implementation | /tdd | red -> green -> refactor per slice |
|
|
1043
|
+
| Architecture survey | /improve-codebase-architecture (+ /codebase-design vocabulary) | findings reviewed before large refactors |
|
|
1044
|
+
| Pre-merge | /code-review | blocking findings resolved |
|
|
1045
|
+
|
|
1046
|
+
Not sure which row applies? Run /ask-matt instead of guessing.
|
|
1031
1047
|
|
|
1032
1048
|
## Standard Feature Flow
|
|
1033
1049
|
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
## Fast Path
|
|
1050
|
+
/grill-with-docs -> /to-spec -> (/to-tickets for large work) -> /implement (with /tdd where it helps) -> /code-review.
|
|
1037
1051
|
|
|
1038
|
-
|
|
1052
|
+
${FAST_PATH_SECTION}
|
|
1039
1053
|
|
|
1040
1054
|
## Documentation Maintenance
|
|
1041
1055
|
|
|
@@ -1049,33 +1063,31 @@ Use it only for one-file, unambiguous changes with no behavior, API, schema, sec
|
|
|
1049
1063
|
function generateGettingStartedDoc() {
|
|
1050
1064
|
return `# Getting Started
|
|
1051
1065
|
|
|
1052
|
-
thachvd-kit creates project context.
|
|
1066
|
+
thachvd-kit creates project context. Matt Pocock's promoted skills own the development workflow.
|
|
1053
1067
|
|
|
1054
1068
|
## Setup
|
|
1055
1069
|
|
|
1056
1070
|
1. Run \`thachvd-kit init\` in the repository.
|
|
1057
1071
|
2. Open or print \`.agent/docs/index-project-prompt.md\` with \`thachvd-kit prompt\`.
|
|
1058
|
-
3.
|
|
1059
|
-
4.
|
|
1072
|
+
3. Run \`thachvd-kit setup\` (installs the promoted skill set by default; add \`--no-install-skills\` to skip) and RTK.
|
|
1073
|
+
4. Inside the AI client, run \`/setup-matt-pocock-skills\` once to configure the issue tracker, triage labels, and doc layout.
|
|
1074
|
+
5. Run \`thachvd-kit doctor\` and restart the AI client.
|
|
1060
1075
|
|
|
1061
1076
|
## Standard Flow
|
|
1062
1077
|
|
|
1063
|
-
|
|
1078
|
+
1. \`/grill-with-docs\` for unclear requirements or design.
|
|
1079
|
+
2. \`/to-spec\` when a durable implementation contract is useful.
|
|
1080
|
+
3. \`/to-tickets\` for large work that benefits from decomposition.
|
|
1081
|
+
4. \`/implement\`, with \`/tdd\` where red-green-refactor helps.
|
|
1082
|
+
5. \`/code-review\` once before completion.
|
|
1064
1083
|
|
|
1065
|
-
|
|
1066
|
-
2. \`using-git-worktrees\` for isolated work.
|
|
1067
|
-
3. \`writing-plans\`, then wait for explicit approval.
|
|
1068
|
-
4. \`test-driven-development\` and \`executing-plans\` or \`subagent-driven-development\`.
|
|
1069
|
-
5. \`requesting-code-review\` and \`verification-before-completion\`.
|
|
1070
|
-
6. \`finishing-a-development-branch\`.
|
|
1084
|
+
Not sure which skill fits? Run \`/ask-matt\`.
|
|
1071
1085
|
|
|
1072
1086
|
## Bug Flow
|
|
1073
1087
|
|
|
1074
|
-
Use
|
|
1088
|
+
Use \`/diagnosing-bugs\`: reproduce the symptom, inspect the path with codebase-memory MCP, test hypotheses, add regression protection, fix the root cause, and verify.
|
|
1075
1089
|
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
Use a fast path only for one-file, unambiguous changes with no behavior or contract change. State the scope and verification before editing. If the scope expands, return to brainstorming and writing-plans.
|
|
1090
|
+
${GETTING_STARTED_FAST_PATH_SECTION}
|
|
1079
1091
|
`;
|
|
1080
1092
|
}
|
|
1081
1093
|
|
|
@@ -1102,19 +1114,20 @@ function generateToolingDoc(data) {
|
|
|
1102
1114
|
|
|
1103
1115
|
return `# Optional Tooling
|
|
1104
1116
|
|
|
1105
|
-
Run \`thachvd-kit doctor\` to check the current machine.
|
|
1117
|
+
Run \`thachvd-kit doctor\` to check the current machine.
|
|
1106
1118
|
|
|
1107
|
-
##
|
|
1119
|
+
## Matt Pocock Skills
|
|
1108
1120
|
|
|
1109
|
-
|
|
1121
|
+
Matt Pocock's promoted engineering and productivity skills are the workflow layer for this project, installed project-locally under \`.agents/skills/\` (never globally):
|
|
1110
1122
|
|
|
1111
|
-
-
|
|
1112
|
-
-
|
|
1113
|
-
-
|
|
1114
|
-
-
|
|
1115
|
-
-
|
|
1123
|
+
- Install the promoted set: \`thachvd-kit skills install\` (\`--dry-run\` to preview the command without running it)
|
|
1124
|
+
- Check what is installed: \`thachvd-kit skills check\` (read-only)
|
|
1125
|
+
- Update the promoted set: \`thachvd-kit skills update\` (re-adds each skill individually for safety, so it is slower than install — one network clone per skill)
|
|
1126
|
+
- The full manifest lives in \`bin/matt-skills.js\` (\`PROMOTED_SKILLS\`); it mirrors upstream's \`skills/engineering/\` + \`skills/productivity/\` catalog and never includes \`in-progress\`, \`misc\`, or \`deprecated\` skills.
|
|
1127
|
+
- After the first install, run \`/setup-matt-pocock-skills\` once inside the AI client to configure the issue tracker, triage labels, and generated docs location. thachvd-kit does not simulate that skill.
|
|
1128
|
+
- Unsure which skill fits a task? Run \`/ask-matt\`.
|
|
1116
1129
|
|
|
1117
|
-
|
|
1130
|
+
${TOOL_ROUTING_SECTION}
|
|
1118
1131
|
|
|
1119
1132
|
## Codebase Memory MCP
|
|
1120
1133
|
|
|
@@ -1167,17 +1180,8 @@ function homePath(...parts) {
|
|
|
1167
1180
|
return home ? path.join(home, ...parts) : null;
|
|
1168
1181
|
}
|
|
1169
1182
|
|
|
1170
|
-
function
|
|
1171
|
-
console.log(`
|
|
1172
|
-
${pc.bold('Superpowers setup')} (official client integrations)
|
|
1173
|
-
Claude Code: /plugin install superpowers@claude-plugins-official
|
|
1174
|
-
Antigravity: agy plugin install https://github.com/obra/superpowers
|
|
1175
|
-
Codex App: install Superpowers from the Plugins sidebar
|
|
1176
|
-
Codex CLI: open /plugins, search Superpowers, then Install Plugin
|
|
1177
|
-
Cursor: /add-plugin superpowers
|
|
1178
|
-
|
|
1179
|
-
Full guide: https://github.com/obra/superpowers#installation
|
|
1180
|
-
`);
|
|
1183
|
+
function printMattSkillsSetupReminder() {
|
|
1184
|
+
console.log(` Run ${pc.bold('/setup-matt-pocock-skills')} once inside your AI client to configure the issue tracker, triage labels, and generated docs location.`);
|
|
1181
1185
|
}
|
|
1182
1186
|
|
|
1183
1187
|
function runDoctor() {
|
|
@@ -1191,10 +1195,7 @@ function runDoctor() {
|
|
|
1191
1195
|
|
|
1192
1196
|
const tools = [
|
|
1193
1197
|
[CODEBASE_MEMORY_BINARY, `npm install -g ${CODEBASE_MEMORY_PACKAGE}`],
|
|
1194
|
-
['rtk', `recommended: ${RTK_INSTALL_COMMAND}`]
|
|
1195
|
-
['agy', 'install Antigravity before running its Superpowers plugin command'],
|
|
1196
|
-
['claude', 'install Claude Code before installing its Superpowers plugin'],
|
|
1197
|
-
['codex', 'install Codex before using its Superpowers plugin']
|
|
1198
|
+
['rtk', `recommended: ${RTK_INSTALL_COMMAND}`]
|
|
1198
1199
|
];
|
|
1199
1200
|
console.log(`\n${pc.bold('Local integrations (RTK recommended)')}`);
|
|
1200
1201
|
for (const [binary, hint] of tools) {
|
|
@@ -1202,6 +1203,21 @@ function runDoctor() {
|
|
|
1202
1203
|
console.log(` ${ok ? pc.green('OK') : pc.yellow('WARN')} ${binary}${ok ? '' : ` - ${hint}`}`);
|
|
1203
1204
|
}
|
|
1204
1205
|
|
|
1206
|
+
console.log(`\n${pc.bold('Matt Pocock skills')}`);
|
|
1207
|
+
const skillStatus = mattSkills.checkSkills(targetDir);
|
|
1208
|
+
if (skillStatus.missing.length === 0) {
|
|
1209
|
+
console.log(` ${pc.green('OK')} promoted skill set installed (${skillStatus.total}/${skillStatus.total})`);
|
|
1210
|
+
} else {
|
|
1211
|
+
console.log(` ${pc.yellow('WARN')} ${skillStatus.missing.length} promoted skill(s) missing`);
|
|
1212
|
+
console.log(` Run: ${pc.bold('thachvd-kit skills install')}`);
|
|
1213
|
+
}
|
|
1214
|
+
const setupSkillOk = mattSkills.isSkillInstalled(targetDir, mattSkills.SETUP_SKILL_NAME);
|
|
1215
|
+
console.log(` ${setupSkillOk ? pc.green('OK') : pc.yellow('WARN')} ${mattSkills.SETUP_SKILL_NAME} available`);
|
|
1216
|
+
const contextMdExists = fs.existsSync(path.join(targetDir, 'CONTEXT.md'));
|
|
1217
|
+
const docsAdrExists = fs.existsSync(path.join(targetDir, 'docs', 'adr'));
|
|
1218
|
+
console.log(` ${pc.dim('-')} CONTEXT.md ${contextMdExists ? 'detected' : 'not created yet (informational only)'}`);
|
|
1219
|
+
console.log(` ${pc.dim('-')} docs/adr ${docsAdrExists ? 'detected' : 'not created yet (informational only)'}`);
|
|
1220
|
+
|
|
1205
1221
|
console.log(`\n${pc.bold('Next step')}`);
|
|
1206
1222
|
console.log(' Run thachvd-kit prompt to print the saved project-indexing prompt.');
|
|
1207
1223
|
}
|
|
@@ -1211,8 +1227,25 @@ async function runSetup(args) {
|
|
|
1211
1227
|
const skipHookSetup = args.includes('--no-setup-hook');
|
|
1212
1228
|
const skipRtkInstall = args.includes('--no-install-rtk');
|
|
1213
1229
|
const skipIndex = args.includes('--no-index');
|
|
1230
|
+
const skipSkillsInstall = args.includes('--no-install-skills');
|
|
1214
1231
|
console.log(pc.bold(pc.cyan('thachvd-kit setup')));
|
|
1215
|
-
|
|
1232
|
+
if (!skipSkillsInstall) {
|
|
1233
|
+
console.log(pc.bold('Matt Pocock skills'));
|
|
1234
|
+
const skillStatus = mattSkills.checkSkills(targetDir);
|
|
1235
|
+
if (skillStatus.missing.length === 0) {
|
|
1236
|
+
// Already fully installed: `setup` only ensures presence, it
|
|
1237
|
+
// never re-installs or updates on its own. Explicit
|
|
1238
|
+
// `thachvd-kit skills update` is required for that.
|
|
1239
|
+
console.log(` ${pc.green('OK')} promoted skill set already installed (${skillStatus.total}/${skillStatus.total})`);
|
|
1240
|
+
} else {
|
|
1241
|
+
const skillsResult = mattSkills.installSkills(targetDir);
|
|
1242
|
+
const skillsMarker = skillsResult.ok ? pc.green('OK') : pc.yellow('WARN');
|
|
1243
|
+
console.log(` ${skillsMarker} ${skillsResult.message}`);
|
|
1244
|
+
}
|
|
1245
|
+
printMattSkillsSetupReminder();
|
|
1246
|
+
} else {
|
|
1247
|
+
console.log(`${pc.bold('Matt Pocock skills')}\n ${pc.dim('skipped (--no-install-skills)')}`);
|
|
1248
|
+
}
|
|
1216
1249
|
if (!skipMcpSetup) {
|
|
1217
1250
|
console.log(pc.bold('MCP setup'));
|
|
1218
1251
|
for (const result of setupMcpServers({ install: true })) {
|
|
@@ -1393,7 +1426,7 @@ tool_timeout_sec = 120
|
|
|
1393
1426
|
const DOD_HOOK_MARKER = 'feature/refactor Definition-of-Done gate';
|
|
1394
1427
|
|
|
1395
1428
|
function generateDodStopHookPrompt() {
|
|
1396
|
-
return `Input JSON (Stop hook payload): $ARGUMENTS\n\nCheck this project's ${DOD_HOOK_MARKER}. This kit does not define its own workflow steps; it only verifies that evidence of the gate exists,
|
|
1429
|
+
return `Input JSON (Stop hook payload): $ARGUMENTS\n\nCheck this project's ${DOD_HOOK_MARKER}. This kit does not define its own workflow steps or require any specific workflow skill; it only verifies that evidence of the gate exists, however that evidence was produced (a documented planning/review skill, a manual process, or anything equivalent). Use the \`last_assistant_message\` field as the authoritative final response. Use \`transcript_path\` only for additional context because the transcript may not contain the final response yet.\n\nVerification is never optional: every change, fast path included, requires semantic evidence in the final response or visible transcript that focused tests or equivalent verification actually ran and passed (for example test/build output, or a described manual verification). Do not require a specific command; judge the evidence on its meaning.\n\nFor any change that is not a verified fast path (see below), completion additionally requires evidence of:\n- Plan: a plan was written and explicitly approved by the human before implementation started.\n- Review: the change was reviewed (correctness, simplicity, architecture, security, performance) and blocking issues were resolved.\n\nFast-path eligibility is based on risk and contract surface, not file count. A change is fast path only when it is localized, mechanically obvious, low-risk, and has no meaningful public API, schema, auth/security, data-integrity, payment, concurrency, dependency, CI/release, or architectural risk, with focused verification available. A source file plus its own focused test can still be fast path; a one-file auth, payment, schema, security, or concurrency change is not fast path no matter how small. A verified fast-path change is exempt from the Plan and Review evidence only when the final response states FAST_PATH: simple-fix, its reason, and its narrow scope — Verification evidence is still mandatory in that case, not optional.\n\nSteps:\n1. If the input JSON has \`stop_hook_active: true\`, allow stopping immediately (already checked once this cycle; never block twice in a row).\n2. Inspect the changed files and the \`last_assistant_message\` field.\n3. If no source files changed or the final response does not claim the task is done/complete, allow stopping.\n4. If the final response explicitly contains FAST_PATH: simple-fix, first check the claim against the risk criteria above, not file count. If it actually touches one of those risk areas regardless of file count, the FAST_PATH claim is invalid; treat it as a full feature/refactor change and continue to step 5. Otherwise, look for semantic evidence that focused verification actually ran and passed. If that evidence is present, allow stopping. If it is missing, block with {"ok": false, "reason": "Missing Verification evidence: ..."}.\n5. If the final response claims completion for a change that is not a verified fast path, check all three gates: (a) a plan was written and explicitly approved by the human before implementation started; (b) the change was reviewed and blocking issues were resolved; (c) tests or equivalent verification ran and passed. If any one of the three is missing, block naming exactly that gate; a generic statement that the task was simple, or that it touched only one file, is not enough on its own.\n6. Return exactly JSON: {"ok": true} to allow stopping, or {"ok": false, "reason": "..."} to block.\n\nWhen blocking, name exactly which gate is missing without prescribing which skill or workflow must produce it.`;
|
|
1397
1430
|
}
|
|
1398
1431
|
|
|
1399
1432
|
function isDefinitionOfDoneHook(hook) {
|
|
@@ -1488,9 +1521,57 @@ function setupMcpServers(options = {}) {
|
|
|
1488
1521
|
return results;
|
|
1489
1522
|
}
|
|
1490
1523
|
|
|
1524
|
+
function runSkillsCommand(args) {
|
|
1525
|
+
const subcommand = args[0];
|
|
1526
|
+
const dryRun = args.includes('--dry-run');
|
|
1527
|
+
|
|
1528
|
+
if (subcommand === 'install') {
|
|
1529
|
+
console.log(pc.bold(pc.cyan('thachvd-kit skills install')));
|
|
1530
|
+
const result = mattSkills.installSkills(targetDir, { dryRun });
|
|
1531
|
+
console.log(` ${result.ok ? pc.green('OK') : pc.yellow('WARN')} ${result.message}`);
|
|
1532
|
+
if (!dryRun && result.ok) printMattSkillsSetupReminder();
|
|
1533
|
+
if (!result.ok) process.exitCode = 1;
|
|
1534
|
+
return;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
if (subcommand === 'check') {
|
|
1538
|
+
console.log(pc.bold(pc.cyan('thachvd-kit skills check')));
|
|
1539
|
+
const status = mattSkills.checkSkills(targetDir);
|
|
1540
|
+
for (const name of mattSkills.PROMOTED_SKILLS) {
|
|
1541
|
+
const installed = status.installed.includes(name);
|
|
1542
|
+
console.log(` ${installed ? pc.green('OK') : pc.yellow('WARN')} ${name}`);
|
|
1543
|
+
}
|
|
1544
|
+
console.log(`\n ${status.installed.length}/${status.total} promoted skills installed in ${mattSkills.SKILLS_RELATIVE_DIR}`);
|
|
1545
|
+
if (status.missing.length > 0) {
|
|
1546
|
+
console.log(` Run: ${pc.bold('thachvd-kit skills install')}`);
|
|
1547
|
+
}
|
|
1548
|
+
return;
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
if (subcommand === 'update') {
|
|
1552
|
+
console.log(pc.bold(pc.cyan('thachvd-kit skills update')));
|
|
1553
|
+
const result = mattSkills.updateSkills(targetDir, { dryRun });
|
|
1554
|
+
if (dryRun) {
|
|
1555
|
+
for (const item of result.results) console.log(` ${pc.dim('would run')} ${item.command}`);
|
|
1556
|
+
} else {
|
|
1557
|
+
for (const item of result.results) console.log(` ${item.ok ? pc.green('OK') : pc.yellow('WARN')} ${item.name}`);
|
|
1558
|
+
}
|
|
1559
|
+
console.log(`\n ${result.ok ? pc.green('OK') : pc.yellow('WARN')} ${result.message}`);
|
|
1560
|
+
if (!result.ok) process.exitCode = 1;
|
|
1561
|
+
return;
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
console.error(pc.red(`Unknown skills subcommand: ${subcommand || '(none)'}`));
|
|
1565
|
+
console.error('Usage: thachvd-kit skills install|check|update [--dry-run]');
|
|
1566
|
+
process.exit(1);
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1491
1569
|
// --- Main CLI ---
|
|
1492
1570
|
|
|
1493
1571
|
async function main() {
|
|
1572
|
+
// Note: 'upgrade' and 'global' are handled directly by bin/entry.js
|
|
1573
|
+
// (bin/upgrade.js / bin/global.js) before this module is even required,
|
|
1574
|
+
// so they never reach here.
|
|
1494
1575
|
const rawArgs = process.argv.slice(2);
|
|
1495
1576
|
const command = rawArgs[0] && !rawArgs[0].startsWith('-') ? rawArgs[0] : 'init';
|
|
1496
1577
|
const args = command === 'init' ? rawArgs.slice(rawArgs[0] === 'init' ? 1 : 0) : rawArgs.slice(1);
|
|
@@ -1520,6 +1601,11 @@ async function main() {
|
|
|
1520
1601
|
return;
|
|
1521
1602
|
}
|
|
1522
1603
|
|
|
1604
|
+
if (command === 'skills') {
|
|
1605
|
+
runSkillsCommand(rawArgs.slice(1));
|
|
1606
|
+
return;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1523
1609
|
if (command !== 'init') {
|
|
1524
1610
|
console.error(pc.red(`Unknown command: ${command}`));
|
|
1525
1611
|
printHelp();
|
|
@@ -1559,8 +1645,7 @@ async function main() {
|
|
|
1559
1645
|
uses_docker: scanned?.uses_docker ?? true,
|
|
1560
1646
|
cloud: scanned?.cloud || 'none',
|
|
1561
1647
|
package_manager: scanned?.package_manager || 'auto-detect',
|
|
1562
|
-
test_framework: scanned?.test_framework || 'auto-detect'
|
|
1563
|
-
max_file_lines: scanned?.max_file_lines || '300'
|
|
1648
|
+
test_framework: scanned?.test_framework || 'auto-detect'
|
|
1564
1649
|
};
|
|
1565
1650
|
|
|
1566
1651
|
data.database = data.database || scanned?.database || 'none';
|
|
@@ -1568,7 +1653,6 @@ async function main() {
|
|
|
1568
1653
|
data.cloud = data.cloud || scanned?.cloud || 'none';
|
|
1569
1654
|
data.package_manager = data.package_manager || scanned?.package_manager || 'auto-detect';
|
|
1570
1655
|
data.test_framework = data.test_framework || scanned?.test_framework || 'auto-detect';
|
|
1571
|
-
data.max_file_lines = data.max_file_lines || scanned?.max_file_lines || '300';
|
|
1572
1656
|
data.framework_details = scanned?.framework_details || [];
|
|
1573
1657
|
data.scan_evidence = scanned?.scan_evidence || [];
|
|
1574
1658
|
data.app_root = scanned?.app_root || '.';
|
|
@@ -1583,7 +1667,7 @@ async function main() {
|
|
|
1583
1667
|
|
|
1584
1668
|
// Shared entry files are written after the .agent folder is available.
|
|
1585
1669
|
|
|
1586
|
-
console.log(` ${pc.green('OK')} Project context generation enabled;
|
|
1670
|
+
console.log(` ${pc.green('OK')} Project context generation enabled; run thachvd-kit setup to install the promoted Matt Pocock skill set`);
|
|
1587
1671
|
|
|
1588
1672
|
|
|
1589
1673
|
const generatedFiles = [
|
|
@@ -1593,7 +1677,7 @@ async function main() {
|
|
|
1593
1677
|
['.cursorrules', generateSharedCursorrules(data)],
|
|
1594
1678
|
[path.join('.agent', 'docs', 'project.md'), generateProjectDoc(data)],
|
|
1595
1679
|
[path.join('.agent', 'docs', 'architecture.md'), generateArchitectureDoc(data)],
|
|
1596
|
-
[path.join('.agent', 'docs', 'conventions.md'), generateConventionsDoc(
|
|
1680
|
+
[path.join('.agent', 'docs', 'conventions.md'), generateConventionsDoc()],
|
|
1597
1681
|
[path.join('.agent', 'docs', 'workflow.md'), generateWorkflowDoc()],
|
|
1598
1682
|
[path.join('.agent', 'docs', 'tooling.md'), generateToolingDoc(data)],
|
|
1599
1683
|
[path.join('.agent', 'docs', 'getting-started.md'), generateGettingStartedDoc()],
|
|
@@ -1628,12 +1712,12 @@ async function main() {
|
|
|
1628
1712
|
- ${pc.bold('.agent/docs/index-project-prompt.md')} durable onboarding prompt
|
|
1629
1713
|
|
|
1630
1714
|
${pc.bold('MCP/tooling setup:')}
|
|
1631
|
-
-
|
|
1632
|
-
- Run ${pc.bold('thachvd-kit setup')} to configure codebase-memory MCP and recommended RTK
|
|
1715
|
+
- Matt Pocock's promoted skills (.agents/skills/) are the workflow layer
|
|
1716
|
+
- Run ${pc.bold('thachvd-kit setup')} to install them and configure codebase-memory MCP and recommended RTK
|
|
1633
1717
|
|
|
1634
1718
|
${pc.bold('Next steps:')}
|
|
1635
1719
|
1. Run ${pc.bold('thachvd-kit prompt')} and paste the saved prompt into your AI editor
|
|
1636
|
-
2.
|
|
1720
|
+
2. Run ${pc.bold('thachvd-kit setup')} to install the promoted skill set and RTK
|
|
1637
1721
|
3. Run ${pc.bold('thachvd-kit doctor')} to verify the machine
|
|
1638
1722
|
4. Re-run ${pc.bold('thachvd-kit prompt')} whenever you need the onboarding prompt again
|
|
1639
1723
|
|
package/bin/entry.js
CHANGED
|
@@ -11,6 +11,8 @@ function isInitInvocation(args) {
|
|
|
11
11
|
if (args.includes('--help') || args.includes('-h') || args.includes('--version') || args.includes('-v')) {
|
|
12
12
|
return false;
|
|
13
13
|
}
|
|
14
|
+
// Note: 'upgrade' and 'global' are handled and returned above before this
|
|
15
|
+
// is ever called, so they never reach here.
|
|
14
16
|
const first = args[0];
|
|
15
17
|
return !first || first === 'init' || first.startsWith('-');
|
|
16
18
|
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { spawnSync } = require('child_process');
|
|
4
|
+
|
|
5
|
+
// Source repository for Matt Pocock's promoted skills, installed via the
|
|
6
|
+
// upstream `skills` CLI (npx skills@latest add <source>).
|
|
7
|
+
const MATT_SKILLS_SOURCE = 'mattpocock/skills';
|
|
8
|
+
|
|
9
|
+
// This list mirrors upstream's promoted daily-driver catalog:
|
|
10
|
+
// https://github.com/mattpocock/skills -> skills/engineering/ + skills/productivity/
|
|
11
|
+
// Do NOT add anything from skills/in-progress, skills/misc, or skills/deprecated —
|
|
12
|
+
// those are explicitly not part of the supported set. Update this list by hand
|
|
13
|
+
// when upstream promotes a new skill or retires one; there is no reliable
|
|
14
|
+
// upstream "promoted only" filter, so this manifest is the source of truth.
|
|
15
|
+
const PROMOTED_SKILLS = [
|
|
16
|
+
// skills/engineering
|
|
17
|
+
'ask-matt',
|
|
18
|
+
'code-review',
|
|
19
|
+
'codebase-design',
|
|
20
|
+
'diagnosing-bugs',
|
|
21
|
+
'domain-modeling',
|
|
22
|
+
'grill-with-docs',
|
|
23
|
+
'implement',
|
|
24
|
+
'improve-codebase-architecture',
|
|
25
|
+
'prototype',
|
|
26
|
+
'research',
|
|
27
|
+
'resolving-merge-conflicts',
|
|
28
|
+
'setup-matt-pocock-skills',
|
|
29
|
+
'tdd',
|
|
30
|
+
'to-spec',
|
|
31
|
+
'to-tickets',
|
|
32
|
+
'triage',
|
|
33
|
+
'wayfinder',
|
|
34
|
+
'wizard',
|
|
35
|
+
// skills/productivity
|
|
36
|
+
'grill-me',
|
|
37
|
+
'grilling',
|
|
38
|
+
'handoff',
|
|
39
|
+
'teach',
|
|
40
|
+
'to-questionnaire',
|
|
41
|
+
'wait-what',
|
|
42
|
+
'writing-for-agents'
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
// Agent identifiers as understood by the upstream `skills` CLI. Codex and
|
|
46
|
+
// Antigravity share the project-local .agents/skills directory; Claude Code
|
|
47
|
+
// also receives its native .claude/skills integration so skills are exposed
|
|
48
|
+
// as slash commands such as /ask-matt and /implement.
|
|
49
|
+
const SUPPORTED_AGENTS = ['codex', 'antigravity', 'claude-code'];
|
|
50
|
+
|
|
51
|
+
// Project-local install target. Skills are intentionally not installed
|
|
52
|
+
// globally (see AGENTS.md / .agent/docs/tooling.md for the reasoning).
|
|
53
|
+
const SKILLS_RELATIVE_DIR = path.join('.agents', 'skills');
|
|
54
|
+
|
|
55
|
+
const SETUP_SKILL_NAME = 'setup-matt-pocock-skills';
|
|
56
|
+
|
|
57
|
+
function npxCommand() {
|
|
58
|
+
return process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function skillsDirFor(targetDir) {
|
|
62
|
+
return path.join(targetDir, SKILLS_RELATIVE_DIR);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isSkillInstalled(targetDir, name) {
|
|
66
|
+
return fs.existsSync(path.join(skillsDirFor(targetDir), name, 'SKILL.md'));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Read-only: never spawns a process. Safe to call from `doctor` and
|
|
70
|
+
// `skills check`.
|
|
71
|
+
function checkSkills(targetDir) {
|
|
72
|
+
const installed = [];
|
|
73
|
+
const missing = [];
|
|
74
|
+
for (const name of PROMOTED_SKILLS) {
|
|
75
|
+
(isSkillInstalled(targetDir, name) ? installed : missing).push(name);
|
|
76
|
+
}
|
|
77
|
+
return { installed, missing, total: PROMOTED_SKILLS.length };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Builds the argv for `npx skills@latest add <source> ...`. Always passes
|
|
81
|
+
// `--skill <name>` as separate argv entries (never `--skill=<name>`): current
|
|
82
|
+
// `skills` CLI versions have a parsing bug where the `--skill=<name>` form is
|
|
83
|
+
// silently ignored and installs every skill in the source repository,
|
|
84
|
+
// including skills/in-progress, skills/misc, and skills/deprecated.
|
|
85
|
+
function buildAddArgs(skillNames) {
|
|
86
|
+
return [
|
|
87
|
+
'-y', // npx: auto-confirm installing the `skills` package itself
|
|
88
|
+
'skills@latest',
|
|
89
|
+
'add',
|
|
90
|
+
MATT_SKILLS_SOURCE,
|
|
91
|
+
'--skill', ...skillNames,
|
|
92
|
+
'--agent', ...SUPPORTED_AGENTS,
|
|
93
|
+
'-y' // skills CLI: skip its own confirmation prompts
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function formatCommand(args) {
|
|
98
|
+
return `${npxCommand()} ${args.join(' ')}`;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function runNpx(args, options = {}) {
|
|
102
|
+
return spawnSync(npxCommand(), args, {
|
|
103
|
+
cwd: options.cwd,
|
|
104
|
+
encoding: 'utf8',
|
|
105
|
+
stdio: options.stdio || 'pipe',
|
|
106
|
+
shell: process.platform === 'win32'
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Installs the full promoted set in a single `add` call (one clone, one
|
|
111
|
+
// filtered install). Never uses `--all`, which would also install
|
|
112
|
+
// in-progress/misc/deprecated skills.
|
|
113
|
+
function installSkills(targetDir, options = {}) {
|
|
114
|
+
const dryRun = options.dryRun === true;
|
|
115
|
+
const args = buildAddArgs(PROMOTED_SKILLS);
|
|
116
|
+
const command = formatCommand(args);
|
|
117
|
+
|
|
118
|
+
if (dryRun) {
|
|
119
|
+
return { ok: true, dryRun: true, command, message: `Dry run: would run ${command}` };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const result = runNpx(args, { cwd: targetDir, stdio: 'inherit' });
|
|
123
|
+
if (result.error || result.status !== 0) {
|
|
124
|
+
return { ok: false, dryRun: false, command, message: `failed to install promoted skills; run manually: ${command}` };
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
ok: true,
|
|
128
|
+
dryRun: false,
|
|
129
|
+
command,
|
|
130
|
+
message: `installed ${PROMOTED_SKILLS.length} promoted Matt Pocock skills to ${SKILLS_RELATIVE_DIR}`
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Updates each promoted skill by re-adding it individually and idempotently.
|
|
135
|
+
// This is deliberately NOT `npx skills update`: upstream has a known issue
|
|
136
|
+
// where updating one project skill can reinstall every skill from the
|
|
137
|
+
// source. Re-adding by explicit single-skill name only ever touches that
|
|
138
|
+
// skill's directory (verified manually against the upstream CLI).
|
|
139
|
+
// Trade-off: this does one network clone of the source repo per promoted
|
|
140
|
+
// skill (~PROMOTED_SKILLS.length calls), so it is noticeably slower than
|
|
141
|
+
// `installSkills`'s single batched call. That cost is accepted deliberately
|
|
142
|
+
// for the safety guarantee above; revisit only if upstream ships a scoped,
|
|
143
|
+
// non-destructive `update`.
|
|
144
|
+
function updateSkills(targetDir, options = {}) {
|
|
145
|
+
const dryRun = options.dryRun === true;
|
|
146
|
+
const results = [];
|
|
147
|
+
|
|
148
|
+
for (const name of PROMOTED_SKILLS) {
|
|
149
|
+
const args = buildAddArgs([name]);
|
|
150
|
+
const command = formatCommand(args);
|
|
151
|
+
|
|
152
|
+
if (dryRun) {
|
|
153
|
+
results.push({ name, ok: true, dryRun: true, command });
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const result = runNpx(args, { cwd: targetDir, stdio: 'pipe' });
|
|
158
|
+
const ok = !result.error && result.status === 0;
|
|
159
|
+
results.push({
|
|
160
|
+
name,
|
|
161
|
+
ok,
|
|
162
|
+
dryRun: false,
|
|
163
|
+
command,
|
|
164
|
+
error: ok ? null : (result.stderr || result.stdout || `exit ${result.status}`)
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const failed = results.filter(r => !r.ok);
|
|
169
|
+
const message = dryRun
|
|
170
|
+
? `Dry run: would update ${PROMOTED_SKILLS.length} promoted skills one by one`
|
|
171
|
+
: failed.length === 0
|
|
172
|
+
? `updated ${PROMOTED_SKILLS.length} promoted Matt Pocock skills`
|
|
173
|
+
: `updated ${results.length - failed.length}/${PROMOTED_SKILLS.length} promoted skills; failed: ${failed.map(f => f.name).join(', ')}`;
|
|
174
|
+
|
|
175
|
+
return { ok: failed.length === 0, dryRun, results, message };
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
module.exports = {
|
|
179
|
+
MATT_SKILLS_SOURCE,
|
|
180
|
+
PROMOTED_SKILLS,
|
|
181
|
+
SUPPORTED_AGENTS,
|
|
182
|
+
SKILLS_RELATIVE_DIR,
|
|
183
|
+
SETUP_SKILL_NAME,
|
|
184
|
+
npxCommand,
|
|
185
|
+
skillsDirFor,
|
|
186
|
+
isSkillInstalled,
|
|
187
|
+
checkSkills,
|
|
188
|
+
buildAddArgs,
|
|
189
|
+
formatCommand,
|
|
190
|
+
installSkills,
|
|
191
|
+
updateSkills
|
|
192
|
+
};
|
package/bin/policy.js
CHANGED
|
@@ -49,11 +49,11 @@ const FAST_PATH_SECTION = `## Fast Path
|
|
|
49
49
|
|
|
50
50
|
Fast-path eligibility is based on risk and contract surface, not file count. Use it only when the change is localized, mechanically obvious, has no meaningful public API, schema, security, data-integrity, dependency, CI/release, or architectural risk, and has focused verification available. A two-file change such as code plus its focused test may still be fast-path; a one-file auth, payment, schema, concurrency, or other high-risk change is not.
|
|
51
51
|
|
|
52
|
-
State the narrow scope and verification before editing. If the task becomes ambiguous, introduces new behavior or architectural decisions, or its risk/contract surface grows, switch to
|
|
52
|
+
State the narrow scope and verification before editing. If the task becomes ambiguous, introduces new behavior or architectural decisions, or its risk/contract surface grows, switch to the matching planning skill (for example /grill-with-docs or /wayfinder).`;
|
|
53
53
|
|
|
54
54
|
const GETTING_STARTED_FAST_PATH_SECTION = `## Fast Path
|
|
55
55
|
|
|
56
|
-
Use a fast path when the change is localized, mechanically obvious, low-risk, and has focused verification. File count alone does not determine eligibility: code plus a focused test can still be trivial, while a one-file security, schema, payment, concurrency, or public-contract change requires the full workflow. If scope or risk grows, return to
|
|
56
|
+
Use a fast path when the change is localized, mechanically obvious, low-risk, and has focused verification. File count alone does not determine eligibility: code plus a focused test can still be trivial, while a one-file security, schema, payment, concurrency, or public-contract change requires the full workflow. If scope or risk grows, return to the matching planning skill (for example /grill-with-docs or /wayfinder).`;
|
|
57
57
|
|
|
58
58
|
const TOOL_ROUTING_SECTION = `## Tool Routing
|
|
59
59
|
|
|
@@ -100,11 +100,11 @@ function replaceFastPathInline(markdown) {
|
|
|
100
100
|
return normalizeNewlines(markdown)
|
|
101
101
|
.replace(
|
|
102
102
|
'Questions and research do not edit product code. A simple fix may use a fast path only when it is one-file, unambiguous, and changes no behavior or contract. State the scope and verification before editing. If the scope grows, switch to the full Superpowers flow.',
|
|
103
|
-
'Questions and research do not edit product code. A fast path is allowed only when the change is localized, mechanically obvious, low-risk, and has focused verification; file count alone is not a gate. State the scope and verification before editing. If the task becomes ambiguous or its behavior, contract, or risk surface grows, switch to the
|
|
103
|
+
'Questions and research do not edit product code. A fast path is allowed only when the change is localized, mechanically obvious, low-risk, and has focused verification; file count alone is not a gate. State the scope and verification before editing. If the task becomes ambiguous or its behavior, contract, or risk surface grows, switch to the matching planning skill instead.'
|
|
104
104
|
)
|
|
105
105
|
.replace(
|
|
106
106
|
'Questions and research do not edit product code. A simple fix may use a fast path only when it is one-file, unambiguous, and changes no behavior or contract. State the narrow scope and verification before editing. If the scope grows, return to brainstorming and planning.',
|
|
107
|
-
'Questions and research do not edit product code. A fast path is allowed only when the change is localized, mechanically obvious, low-risk, and has focused verification; file count alone is not a gate. State the narrow scope and verification before editing. If scope or risk grows, return to
|
|
107
|
+
'Questions and research do not edit product code. A fast path is allowed only when the change is localized, mechanically obvious, low-risk, and has focused verification; file count alone is not a gate. State the narrow scope and verification before editing. If scope or risk grows, return to the matching planning skill instead.'
|
|
108
108
|
);
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -183,8 +183,12 @@ module.exports = {
|
|
|
183
183
|
POLICY_PATHS,
|
|
184
184
|
QUALITY_FLOOR_SECTION,
|
|
185
185
|
AGENT_RULES_SECTION,
|
|
186
|
+
CONVENTIONS_STANDARDS_SECTION,
|
|
186
187
|
FAST_PATH_SECTION,
|
|
188
|
+
GETTING_STARTED_FAST_PATH_SECTION,
|
|
187
189
|
TOOL_ROUTING_SECTION,
|
|
190
|
+
normalizeNewlines,
|
|
191
|
+
replaceSection,
|
|
188
192
|
upgradeGeneratedContent,
|
|
189
193
|
upgradeAgentsMarkdown,
|
|
190
194
|
upgradeConventionsMarkdown,
|
package/bin/upgrade.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
|
+
const { normalizeNewlines, replaceSection, FAST_PATH_SECTION, GETTING_STARTED_FAST_PATH_SECTION } = require('./policy');
|
|
3
4
|
|
|
4
5
|
const START = '<!-- thachvd-kit:project-policy:start -->';
|
|
5
6
|
const END = '<!-- thachvd-kit:project-policy:end -->';
|
|
@@ -19,6 +20,8 @@ Prefer the smallest sufficient change, not the fewest lines of code.
|
|
|
19
20
|
- Tests or equivalent verification are mandatory before claiming completion.
|
|
20
21
|
${END}`;
|
|
21
22
|
|
|
23
|
+
// Files managed by the "## Engineering Policy" block above (unchanged from
|
|
24
|
+
// before the Matt Pocock migration).
|
|
22
25
|
const TARGETS = [
|
|
23
26
|
'AGENTS.md',
|
|
24
27
|
path.join('.agent', 'docs', 'conventions.md'),
|
|
@@ -27,7 +30,7 @@ const TARGETS = [
|
|
|
27
30
|
];
|
|
28
31
|
|
|
29
32
|
function normalize(text) {
|
|
30
|
-
return
|
|
33
|
+
return normalizeNewlines(text);
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
function removeKnownObsoleteDefaults(text) {
|
|
@@ -57,16 +60,223 @@ function upsertManagedBlock(content) {
|
|
|
57
60
|
return `${trimmed}${trimmed ? '\n\n' : ''}${PROJECT_POLICY}\n`;
|
|
58
61
|
}
|
|
59
62
|
|
|
63
|
+
// --- Superpowers -> Matt Pocock skills migration -------------------------
|
|
64
|
+
//
|
|
65
|
+
// thachvd-kit used to generate Superpowers-branded workflow content into
|
|
66
|
+
// AGENTS.md, .cursorrules, and .agent/docs/{workflow,tooling,getting-started,
|
|
67
|
+
// index-project-prompt}.md. `upgrade` must move an existing project's
|
|
68
|
+
// *generated* sections over to the current Matt Pocock skill workflow while
|
|
69
|
+
// leaving hand-written/custom content alone.
|
|
70
|
+
//
|
|
71
|
+
// This never does a blind "contains Superpowers" strip. Each replacement is
|
|
72
|
+
// gated on the exact signature thachvd-kit itself used to emit for that
|
|
73
|
+
// section (checked with `LEGACY.test(...)` against the section body before
|
|
74
|
+
// touching it); a section whose content doesn't match is left untouched,
|
|
75
|
+
// including if the user rewrote it themselves. The "## Fast Path" sections
|
|
76
|
+
// are the one exception: they are already synced unconditionally by
|
|
77
|
+
// bin/policy.js for `init`, and this mirrors that exact behavior instead of
|
|
78
|
+
// duplicating a second definition of "current" fast-path wording.
|
|
79
|
+
|
|
80
|
+
const SUPERPOWERS_MIGRATION_TARGETS = [
|
|
81
|
+
'AGENTS.md',
|
|
82
|
+
'.cursorrules',
|
|
83
|
+
path.join('.agent', 'docs', 'workflow.md'),
|
|
84
|
+
path.join('.agent', 'docs', 'tooling.md'),
|
|
85
|
+
path.join('.agent', 'docs', 'getting-started.md'),
|
|
86
|
+
path.join('.agent', 'docs', 'index-project-prompt.md')
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
function extractSection(text, heading) {
|
|
90
|
+
const marker = `${heading}\n`;
|
|
91
|
+
const start = text.indexOf(marker);
|
|
92
|
+
if (start < 0) return null;
|
|
93
|
+
const searchFrom = start + marker.length;
|
|
94
|
+
const nextHeading = text.indexOf('\n## ', searchFrom);
|
|
95
|
+
const end = nextHeading >= 0 ? nextHeading + 1 : text.length;
|
|
96
|
+
return { start, end, body: text.slice(start, end) };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Replaces a heading-delimited section only when its current body matches a
|
|
100
|
+
// known legacy signature. Leaves the text unchanged if the heading is
|
|
101
|
+
// missing or its content doesn't look like thachvd-kit's own old output.
|
|
102
|
+
function replaceLegacySection(text, heading, legacySignature, replacement) {
|
|
103
|
+
const section = extractSection(text, heading);
|
|
104
|
+
if (!section || !legacySignature.test(section.body)) return text;
|
|
105
|
+
const prefix = text.slice(0, section.start);
|
|
106
|
+
const suffix = text.slice(section.end).replace(/^\n+/, '');
|
|
107
|
+
return `${prefix}${replacement.trimEnd()}\n\n${suffix}`.replace(/\n{3,}/g, '\n\n');
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Replaces one exact known-legacy line/sentence with its current
|
|
111
|
+
// equivalent. Safe because the match is the full, specific sentence
|
|
112
|
+
// thachvd-kit generated, not a loose keyword.
|
|
113
|
+
function replaceLegacyLine(text, legacyLine, replacementLine) {
|
|
114
|
+
return text.includes(legacyLine) ? text.split(legacyLine).join(replacementLine) : text;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const AGENTS_WORKFLOW_SECTION = `## Workflow
|
|
118
|
+
|
|
119
|
+
Matt Pocock's promoted skills (installed under \`.agents/skills/\` by \`thachvd-kit setup\`) are the workflow layer. Use the matching skill when a specialized workflow is useful:
|
|
120
|
+
|
|
121
|
+
- Clear, localized change: inspect -> edit -> focused verification. Do not force a heavyweight skill.
|
|
122
|
+
- Ambiguous feature or design: \`/grill-with-docs\`, then optionally \`/to-spec\` for a durable contract.
|
|
123
|
+
- Normal feature: \`/grill-with-docs\` -> \`/to-spec\` -> \`/implement\`.
|
|
124
|
+
- Large feature needing decomposition: add \`/to-tickets\` before \`/implement\`.
|
|
125
|
+
- Huge, multi-session uncertainty: \`/wayfinder\`.
|
|
126
|
+
- Bug or failing behavior: \`/diagnosing-bugs\`.
|
|
127
|
+
- Test-driven implementation: \`/tdd\` (skip the ceremony for trivial config/text changes).
|
|
128
|
+
- Architecture survey: \`/improve-codebase-architecture\`; use \`/codebase-design\` as the design vocabulary.
|
|
129
|
+
- Pre-completion review: \`/code-review\` once when code risk warrants it.
|
|
130
|
+
|
|
131
|
+
If unsure which skill fits, use \`/ask-matt\`.
|
|
132
|
+
|
|
133
|
+
Questions and research do not edit product code. A fast path is allowed only when the change is localized, mechanically obvious, low-risk, and has focused verification; file count alone is not a gate. State the scope and verification before editing. If the task becomes ambiguous or its behavior, contract, or risk surface grows, use the matching planning skill above instead.
|
|
134
|
+
|
|
135
|
+
See \`.agent/docs/workflow.md\` for the full route matrix. This kit does not implement a second workflow engine; it only installs and checks the promoted skill set (\`thachvd-kit skills install|check|update\`).`;
|
|
136
|
+
|
|
137
|
+
function migrateAgentsStyleMarkdown(content) {
|
|
138
|
+
let text = normalize(content);
|
|
139
|
+
text = replaceLegacySection(text, '## Workflow', /Superpowers is the primary workflow backend/, AGENTS_WORKFLOW_SECTION);
|
|
140
|
+
text = replaceLegacyLine(
|
|
141
|
+
text,
|
|
142
|
+
"- Superpowers: installed through the AI client's official plugin surface",
|
|
143
|
+
'- Matt Pocock skills: promoted set installed under `.agents/skills/` via `thachvd-kit skills install`'
|
|
144
|
+
);
|
|
145
|
+
// Older, short-form .cursorrules that never embedded the full AGENTS.md body.
|
|
146
|
+
text = replaceLegacyLine(
|
|
147
|
+
text,
|
|
148
|
+
'Use Superpowers as the workflow backend. Use direct local evidence when it is sufficient and structural tooling such as codebase-memory MCP only when ownership, call paths, architecture, or impact need discovery.',
|
|
149
|
+
"Use Matt Pocock's promoted skills (`.agents/skills/`) as the workflow backend; run `/ask-matt` if unsure which one fits. Use direct local evidence when it is sufficient and structural tooling such as codebase-memory MCP only when ownership, call paths, architecture, or impact need discovery."
|
|
150
|
+
);
|
|
151
|
+
return text;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const WORKFLOW_ROUTE_MATRIX_SECTION = `## Route Matrix
|
|
155
|
+
|
|
156
|
+
| Situation | Skill | Gate |
|
|
157
|
+
|---|---|---|
|
|
158
|
+
| Question or research only | direct answer or research | no product-code edits |
|
|
159
|
+
| Clear, localized change | fast path (no skill) | inspect -> edit -> focused verify |
|
|
160
|
+
| Ambiguous feature or design | /grill-with-docs, then optionally /to-spec | durable contract before implementation when useful |
|
|
161
|
+
| Normal feature | /grill-with-docs -> /to-spec -> /implement | spec agreed before implementation |
|
|
162
|
+
| Large feature needing decomposition | /grill-with-docs -> /to-spec -> /to-tickets -> /implement | tickets agreed before implementation |
|
|
163
|
+
| Huge, multi-session uncertainty | /wayfinder | shared decision map before implementation |
|
|
164
|
+
| Bug or failing behavior | /diagnosing-bugs | reproduce -> root cause -> regression protection -> fix -> verify |
|
|
165
|
+
| Test-driven implementation | /tdd | red -> green -> refactor per slice |
|
|
166
|
+
| Architecture survey | /improve-codebase-architecture (+ /codebase-design vocabulary) | findings reviewed before large refactors |
|
|
167
|
+
| Pre-merge | /code-review | blocking findings resolved |
|
|
168
|
+
|
|
169
|
+
Not sure which row applies? Run /ask-matt instead of guessing.`;
|
|
170
|
+
|
|
171
|
+
const WORKFLOW_STANDARD_FLOW_SECTION = `## Standard Feature Flow
|
|
172
|
+
|
|
173
|
+
/grill-with-docs -> /to-spec -> (/to-tickets for large work) -> /implement (with /tdd where it helps) -> /code-review.`;
|
|
174
|
+
|
|
175
|
+
function migrateWorkflowMarkdown(content) {
|
|
176
|
+
let text = normalize(content);
|
|
177
|
+
text = replaceLegacyLine(
|
|
178
|
+
text,
|
|
179
|
+
'This project uses Superpowers as the workflow backend. thachvd-kit only provides project context and integration setup.',
|
|
180
|
+
"This project uses Matt Pocock's promoted skills (installed under .agents/skills/ by `thachvd-kit setup`) as the workflow layer. thachvd-kit only provides project context, the skill manifest, and integration setup; it is not a second workflow engine."
|
|
181
|
+
);
|
|
182
|
+
text = replaceLegacyLine(
|
|
183
|
+
text,
|
|
184
|
+
'2. Use the native Superpowers skill that matches the request.',
|
|
185
|
+
'2. Use the promoted skill that matches the request, or run /ask-matt if unsure which one fits.'
|
|
186
|
+
);
|
|
187
|
+
text = replaceLegacySection(text, '## Route Matrix', /Superpowers path/, WORKFLOW_ROUTE_MATRIX_SECTION);
|
|
188
|
+
text = replaceLegacySection(text, '## Standard Feature Flow', /\bbrainstorming\s*->/, WORKFLOW_STANDARD_FLOW_SECTION);
|
|
189
|
+
// Always kept in sync with the current risk-based wording, same as
|
|
190
|
+
// bin/policy.js does for a freshly generated project.
|
|
191
|
+
text = replaceSection(text, '## Fast Path', FAST_PATH_SECTION);
|
|
192
|
+
return text;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const TOOLING_MATT_SKILLS_SECTION = `## Matt Pocock Skills
|
|
196
|
+
|
|
197
|
+
Matt Pocock's promoted engineering and productivity skills are the workflow layer for this project, installed project-locally under \`.agents/skills/\` (never globally):
|
|
198
|
+
|
|
199
|
+
- Install the promoted set: \`thachvd-kit skills install\` (\`--dry-run\` to preview the command without running it)
|
|
200
|
+
- Check what is installed: \`thachvd-kit skills check\` (read-only)
|
|
201
|
+
- Update the promoted set: \`thachvd-kit skills update\` (re-adds each skill individually for safety, so it is slower than install — one network clone per skill)
|
|
202
|
+
- The full manifest lives in \`bin/matt-skills.js\` (\`PROMOTED_SKILLS\`); it mirrors upstream's \`skills/engineering/\` + \`skills/productivity/\` catalog and never includes \`in-progress\`, \`misc\`, or \`deprecated\` skills.
|
|
203
|
+
- After the first install, run \`/setup-matt-pocock-skills\` once inside the AI client to configure the issue tracker, triage labels, and generated docs location. thachvd-kit does not simulate that skill.
|
|
204
|
+
- Unsure which skill fits a task? Run \`/ask-matt\`.`;
|
|
205
|
+
|
|
206
|
+
function migrateToolingMarkdown(content) {
|
|
207
|
+
const text = normalize(content);
|
|
208
|
+
return replaceLegacySection(text, '## Superpowers', /Install Superpowers separately/, TOOLING_MATT_SKILLS_SECTION);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const GETTING_STARTED_SETUP_SECTION = `## Setup
|
|
212
|
+
|
|
213
|
+
1. Run \`thachvd-kit init\` in the repository.
|
|
214
|
+
2. Open or print \`.agent/docs/index-project-prompt.md\` with \`thachvd-kit prompt\`.
|
|
215
|
+
3. Run \`thachvd-kit setup\` (installs the promoted skill set by default; add \`--no-install-skills\` to skip) and RTK.
|
|
216
|
+
4. Inside the AI client, run \`/setup-matt-pocock-skills\` once to configure the issue tracker, triage labels, and doc layout.
|
|
217
|
+
5. Run \`thachvd-kit doctor\` and restart the AI client.`;
|
|
218
|
+
|
|
219
|
+
const GETTING_STARTED_STANDARD_FLOW_SECTION = `## Standard Flow
|
|
220
|
+
|
|
221
|
+
1. \`/grill-with-docs\` for unclear requirements or design.
|
|
222
|
+
2. \`/to-spec\` when a durable implementation contract is useful.
|
|
223
|
+
3. \`/to-tickets\` for large work that benefits from decomposition.
|
|
224
|
+
4. \`/implement\`, with \`/tdd\` where red-green-refactor helps.
|
|
225
|
+
5. \`/code-review\` once before completion.
|
|
226
|
+
|
|
227
|
+
Not sure which skill fits? Run \`/ask-matt\`.`;
|
|
228
|
+
|
|
229
|
+
const GETTING_STARTED_BUG_FLOW_SECTION = `## Bug Flow
|
|
230
|
+
|
|
231
|
+
Use \`/diagnosing-bugs\`: reproduce the symptom, inspect the path with codebase-memory MCP, test hypotheses, add regression protection, fix the root cause, and verify.`;
|
|
232
|
+
|
|
233
|
+
function migrateGettingStartedMarkdown(content) {
|
|
234
|
+
let text = normalize(content);
|
|
235
|
+
text = replaceLegacyLine(
|
|
236
|
+
text,
|
|
237
|
+
'thachvd-kit creates project context. Superpowers owns the development workflow.',
|
|
238
|
+
"thachvd-kit creates project context. Matt Pocock's promoted skills own the development workflow."
|
|
239
|
+
);
|
|
240
|
+
text = replaceLegacySection(text, '## Setup', /Install Superpowers and RTK/, GETTING_STARTED_SETUP_SECTION);
|
|
241
|
+
text = replaceLegacySection(text, '## Standard Flow', /Use Superpowers native skills/, GETTING_STARTED_STANDARD_FLOW_SECTION);
|
|
242
|
+
text = replaceLegacySection(text, '## Bug Flow', /`systematic-debugging`/, GETTING_STARTED_BUG_FLOW_SECTION);
|
|
243
|
+
// Always kept in sync, same reasoning as the workflow.md Fast Path above.
|
|
244
|
+
text = replaceSection(text, '## Fast Path', GETTING_STARTED_FAST_PATH_SECTION);
|
|
245
|
+
return text;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function migrateIndexProjectPrompt(content) {
|
|
249
|
+
return replaceLegacyLine(
|
|
250
|
+
normalize(content),
|
|
251
|
+
'Use Superpowers for the workflow and use codebase-memory MCP for structural code discovery when available.',
|
|
252
|
+
'Use the project\'s Matt Pocock skills for workflow (see AGENTS.md; run /ask-matt if unsure which fits) and use codebase-memory MCP for structural code discovery when available.'
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function migrateSuperpowersWorkflow(relativePath, content) {
|
|
257
|
+
const normalized = relativePath.split(path.sep).join('/');
|
|
258
|
+
if (normalized === 'AGENTS.md' || normalized === '.cursorrules') return migrateAgentsStyleMarkdown(content);
|
|
259
|
+
if (normalized.endsWith('/workflow.md')) return migrateWorkflowMarkdown(content);
|
|
260
|
+
if (normalized.endsWith('/tooling.md')) return migrateToolingMarkdown(content);
|
|
261
|
+
if (normalized.endsWith('/getting-started.md')) return migrateGettingStartedMarkdown(content);
|
|
262
|
+
if (normalized.endsWith('/index-project-prompt.md')) return migrateIndexProjectPrompt(content);
|
|
263
|
+
return normalize(content);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const ALL_UPGRADE_TARGETS = Array.from(new Set([...TARGETS, ...SUPERPOWERS_MIGRATION_TARGETS]));
|
|
267
|
+
|
|
60
268
|
function upgradeProject(rootDir, options = {}) {
|
|
61
269
|
const dryRun = options.dryRun === true;
|
|
62
270
|
const results = [];
|
|
63
271
|
|
|
64
|
-
for (const relativePath of
|
|
272
|
+
for (const relativePath of ALL_UPGRADE_TARGETS) {
|
|
65
273
|
const fullPath = path.join(rootDir, relativePath);
|
|
66
274
|
if (!fs.existsSync(fullPath)) continue;
|
|
67
275
|
|
|
68
276
|
const existing = fs.readFileSync(fullPath, 'utf8');
|
|
69
|
-
|
|
277
|
+
let updated = migrateSuperpowersWorkflow(relativePath, existing);
|
|
278
|
+
if (TARGETS.includes(relativePath)) updated = upsertManagedBlock(updated);
|
|
279
|
+
|
|
70
280
|
const changed = normalize(existing) !== updated;
|
|
71
281
|
if (changed && !dryRun) fs.writeFileSync(fullPath, updated, 'utf8');
|
|
72
282
|
results.push({ path: relativePath, changed, dryRun: changed && dryRun });
|
|
@@ -80,7 +290,9 @@ module.exports = {
|
|
|
80
290
|
END,
|
|
81
291
|
PROJECT_POLICY,
|
|
82
292
|
TARGETS,
|
|
293
|
+
SUPERPOWERS_MIGRATION_TARGETS,
|
|
83
294
|
removeKnownObsoleteDefaults,
|
|
84
295
|
upsertManagedBlock,
|
|
296
|
+
migrateSuperpowersWorkflow,
|
|
85
297
|
upgradeProject
|
|
86
298
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thachvd-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.36",
|
|
4
4
|
"description": "Cross-agent project rules bootstrap kit for Codex, Antigravity, and Claude Code",
|
|
5
5
|
"bin": {
|
|
6
6
|
"thachvd-kit": "./bin/entry.js"
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"node": ">=16.7"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
-
"test": "node test/cli.test.js && node test/policy.test.js && node test/upgrade.test.js && node test/global.test.js",
|
|
19
|
-
"release:verify": "npm test && node --check bin/cli.js && node --check bin/entry.js && node --check bin/policy.js && node --check bin/upgrade.js && node --check bin/global.js && npm pack --dry-run",
|
|
18
|
+
"test": "node test/cli.test.js && node test/policy.test.js && node test/matt-skills.test.js && node test/upgrade.test.js && node test/global.test.js",
|
|
19
|
+
"release:verify": "npm test && node --check bin/cli.js && node --check bin/entry.js && node --check bin/policy.js && node --check bin/matt-skills.js && node --check bin/upgrade.js && node --check bin/global.js && npm pack --dry-run",
|
|
20
20
|
"preversion": "npm run release:verify",
|
|
21
21
|
"release:patch": "npm version patch",
|
|
22
22
|
"release:dry-run": "npm pack --dry-run",
|