@phuc1403/musketeer 0.4.0 → 0.6.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/INSTALLATION.md +47 -32
- package/README.md +49 -49
- package/bin/musketeer.js +168 -79
- package/manifest.json +303 -292
- package/package.json +46 -46
- package/src/dotnet-scaffold-copier.js +72 -72
- package/src/provisioner/detect.js +113 -93
- package/src/self-update.js +77 -73
- package/template/.claude/hooks/block-unsafe-adr-title.cjs +72 -70
- package/template/.claude/hooks/init-adr-dir.cjs +153 -110
- package/template/.claude/hooks/inject-adr-env.cjs +83 -82
- package/template/.claude/hooks/lib/adr/command-scan.cjs +107 -0
- package/template/.claude/hooks/lib/characteristics/checker.cjs +357 -0
- package/template/.claude/hooks/sync-adr-toc.cjs +111 -111
- package/template/.claude/hooks/validate-characteristics-hook.cjs +66 -0
- package/template/.claude/skills/architecture-characteristic-writer/SKILL.md +197 -99
- package/template/.claude/skills/architecture-characteristic-writer/assets/worksheet-template.md +18 -29
- package/template/.claude/skills/architecture-characteristic-writer/references/characteristics-catalog.md +22 -88
- package/template/.claude/skills/architecture-characteristic-writer/scripts/ranking-table.cjs +171 -0
- package/template/dotnet-scaffold/src/__SolutionName__.Api/obj/Debug/net10.0/__SolutionName__.Api.AssemblyInfo.cs +1 -1
- package/template/dotnet-scaffold/src/__SolutionName__.Api/obj/Debug/net10.0/__SolutionName__.Api.AssemblyInfoInputs.cache +1 -1
- package/template/dotnet-scaffold/src/__SolutionName__.Application/obj/Debug/net10.0/__SolutionName__.Application.AssemblyInfo.cs +1 -1
- package/template/dotnet-scaffold/src/__SolutionName__.Application/obj/Debug/net10.0/__SolutionName__.Application.AssemblyInfoInputs.cache +1 -1
- package/template/dotnet-scaffold/src/__SolutionName__.Domain/obj/Debug/net10.0/__SolutionName__.Domain.AssemblyInfo.cs +1 -1
- package/template/dotnet-scaffold/src/__SolutionName__.Domain/obj/Debug/net10.0/__SolutionName__.Domain.AssemblyInfoInputs.cache +1 -1
- package/template/dotnet-scaffold/src/__SolutionName__.Infrastructure/obj/Debug/net10.0/__SolutionName__.Infrastructure.AssemblyInfo.cs +1 -1
- package/template/dotnet-scaffold/src/__SolutionName__.Infrastructure/obj/Debug/net10.0/__SolutionName__.Infrastructure.AssemblyInfoInputs.cache +1 -1
- package/template/dotnet-scaffold/tests/__SolutionName__.Api.Tests/obj/Debug/net10.0/__SolutionName__.Api.Tests.AssemblyInfo.cs +1 -1
- package/template/dotnet-scaffold/tests/__SolutionName__.Api.Tests/obj/Debug/net10.0/__SolutionName__.Api.Tests.AssemblyInfoInputs.cache +1 -1
- package/template/dotnet-scaffold/tests/__SolutionName__.Application.Tests/obj/Debug/net10.0/__SolutionName__.Application.Tests.AssemblyInfo.cs +1 -1
- package/template/dotnet-scaffold/tests/__SolutionName__.Application.Tests/obj/Debug/net10.0/__SolutionName__.Application.Tests.AssemblyInfoInputs.cache +1 -1
- package/template/dotnet-scaffold/tests/__SolutionName__.Domain.Tests/obj/Debug/net10.0/__SolutionName__.Domain.Tests.AssemblyInfo.cs +1 -1
- package/template/dotnet-scaffold/tests/__SolutionName__.Domain.Tests/obj/Debug/net10.0/__SolutionName__.Domain.Tests.AssemblyInfoInputs.cache +1 -1
- package/template/dotnet-scaffold/tests/__SolutionName__.Infrastructure.Tests/obj/Debug/net10.0/__SolutionName__.Infrastructure.Tests.AssemblyInfo.cs +1 -1
- package/template/dotnet-scaffold/tests/__SolutionName__.Infrastructure.Tests/obj/Debug/net10.0/__SolutionName__.Infrastructure.Tests.AssemblyInfoInputs.cache +1 -1
- package/template/dotnet-scaffold/src/__SolutionName__.Api/obj/Debug/net10.0/__SolutionName__.Api.assets.cache +0 -0
- package/template/dotnet-scaffold/src/__SolutionName__.Api/obj/__SolutionName__.Api.csproj.nuget.dgspec.json +0 -1536
- package/template/dotnet-scaffold/src/__SolutionName__.Api/obj/__SolutionName__.Api.csproj.nuget.g.props +0 -16
- package/template/dotnet-scaffold/src/__SolutionName__.Api/obj/__SolutionName__.Api.csproj.nuget.g.targets +0 -2
- package/template/dotnet-scaffold/src/__SolutionName__.Api/obj/project.assets.json +0 -559
- package/template/dotnet-scaffold/src/__SolutionName__.Api/obj/project.nuget.cache +0 -8
- package/template/dotnet-scaffold/src/__SolutionName__.Application/obj/Debug/net10.0/__SolutionName__.Application.assets.cache +0 -0
- package/template/dotnet-scaffold/src/__SolutionName__.Application/obj/__SolutionName__.Application.csproj.nuget.dgspec.json +0 -690
- package/template/dotnet-scaffold/src/__SolutionName__.Application/obj/__SolutionName__.Application.csproj.nuget.g.props +0 -16
- package/template/dotnet-scaffold/src/__SolutionName__.Application/obj/__SolutionName__.Application.csproj.nuget.g.targets +0 -2
- package/template/dotnet-scaffold/src/__SolutionName__.Application/obj/project.assets.json +0 -376
- package/template/dotnet-scaffold/src/__SolutionName__.Application/obj/project.nuget.cache +0 -8
- package/template/dotnet-scaffold/src/__SolutionName__.Domain/obj/Debug/net10.0/__SolutionName__.Domain.assets.cache +0 -0
- package/template/dotnet-scaffold/src/__SolutionName__.Domain/obj/__SolutionName__.Domain.csproj.nuget.dgspec.json +0 -347
- package/template/dotnet-scaffold/src/__SolutionName__.Domain/obj/__SolutionName__.Domain.csproj.nuget.g.props +0 -16
- package/template/dotnet-scaffold/src/__SolutionName__.Domain/obj/__SolutionName__.Domain.csproj.nuget.g.targets +0 -2
- package/template/dotnet-scaffold/src/__SolutionName__.Domain/obj/project.assets.json +0 -353
- package/template/dotnet-scaffold/src/__SolutionName__.Domain/obj/project.nuget.cache +0 -8
- package/template/dotnet-scaffold/src/__SolutionName__.Infrastructure/obj/Debug/net10.0/__SolutionName__.Infrastructure.assets.cache +0 -0
- package/template/dotnet-scaffold/src/__SolutionName__.Infrastructure/obj/Debug/net10.0/__SolutionName__.Infrastructure.csproj.AssemblyReference.cache +0 -0
- package/template/dotnet-scaffold/src/__SolutionName__.Infrastructure/obj/__SolutionName__.Infrastructure.csproj.nuget.dgspec.json +0 -1047
- package/template/dotnet-scaffold/src/__SolutionName__.Infrastructure/obj/__SolutionName__.Infrastructure.csproj.nuget.g.props +0 -16
- package/template/dotnet-scaffold/src/__SolutionName__.Infrastructure/obj/__SolutionName__.Infrastructure.csproj.nuget.g.targets +0 -7
- package/template/dotnet-scaffold/src/__SolutionName__.Infrastructure/obj/project.assets.json +0 -858
- package/template/dotnet-scaffold/src/__SolutionName__.Infrastructure/obj/project.nuget.cache +0 -17
- package/template/dotnet-scaffold/tests/__SolutionName__.Api.Tests/bin/Debug/net10.0/.msCoverageSourceRootsMapping___SolutionName__.Api.Tests +0 -0
- package/template/dotnet-scaffold/tests/__SolutionName__.Api.Tests/obj/Debug/net10.0/__SolutionName__.Api.Tests.assets.cache +0 -0
- package/template/dotnet-scaffold/tests/__SolutionName__.Api.Tests/obj/Debug/net10.0/__SolutionName__.Api.Tests.csproj.AssemblyReference.cache +0 -0
- package/template/dotnet-scaffold/tests/__SolutionName__.Api.Tests/obj/__SolutionName__.Api.Tests.csproj.nuget.dgspec.json +0 -1908
- package/template/dotnet-scaffold/tests/__SolutionName__.Api.Tests/obj/__SolutionName__.Api.Tests.csproj.nuget.g.props +0 -27
- package/template/dotnet-scaffold/tests/__SolutionName__.Api.Tests/obj/__SolutionName__.Api.Tests.csproj.nuget.g.targets +0 -16
- package/template/dotnet-scaffold/tests/__SolutionName__.Api.Tests/obj/project.assets.json +0 -3283
- package/template/dotnet-scaffold/tests/__SolutionName__.Api.Tests/obj/project.nuget.cache +0 -60
- package/template/dotnet-scaffold/tests/__SolutionName__.Application.Tests/bin/Debug/net10.0/.msCoverageSourceRootsMapping___SolutionName__.Application.Tests +0 -0
- package/template/dotnet-scaffold/tests/__SolutionName__.Application.Tests/obj/Debug/net10.0/__SolutionName__.Application.Tests.assets.cache +0 -0
- package/template/dotnet-scaffold/tests/__SolutionName__.Application.Tests/obj/Debug/net10.0/__SolutionName__.Application.Tests.csproj.AssemblyReference.cache +0 -0
- package/template/dotnet-scaffold/tests/__SolutionName__.Application.Tests/obj/__SolutionName__.Application.Tests.csproj.nuget.dgspec.json +0 -1055
- package/template/dotnet-scaffold/tests/__SolutionName__.Application.Tests/obj/__SolutionName__.Application.Tests.csproj.nuget.g.props +0 -26
- package/template/dotnet-scaffold/tests/__SolutionName__.Application.Tests/obj/__SolutionName__.Application.Tests.csproj.nuget.g.targets +0 -11
- package/template/dotnet-scaffold/tests/__SolutionName__.Application.Tests/obj/project.assets.json +0 -1662
- package/template/dotnet-scaffold/tests/__SolutionName__.Application.Tests/obj/project.nuget.cache +0 -30
- package/template/dotnet-scaffold/tests/__SolutionName__.Domain.Tests/bin/Debug/net10.0/.msCoverageSourceRootsMapping___SolutionName__.Domain.Tests +0 -0
- package/template/dotnet-scaffold/tests/__SolutionName__.Domain.Tests/obj/Debug/net10.0/__SolutionName__.Domain.Tests.assets.cache +0 -0
- package/template/dotnet-scaffold/tests/__SolutionName__.Domain.Tests/obj/Debug/net10.0/__SolutionName__.Domain.Tests.csproj.AssemblyReference.cache +0 -0
- package/template/dotnet-scaffold/tests/__SolutionName__.Domain.Tests/obj/__SolutionName__.Domain.Tests.csproj.nuget.dgspec.json +0 -712
- package/template/dotnet-scaffold/tests/__SolutionName__.Domain.Tests/obj/__SolutionName__.Domain.Tests.csproj.nuget.g.props +0 -26
- package/template/dotnet-scaffold/tests/__SolutionName__.Domain.Tests/obj/__SolutionName__.Domain.Tests.csproj.nuget.g.targets +0 -11
- package/template/dotnet-scaffold/tests/__SolutionName__.Domain.Tests/obj/project.assets.json +0 -1644
- package/template/dotnet-scaffold/tests/__SolutionName__.Domain.Tests/obj/project.nuget.cache +0 -30
- package/template/dotnet-scaffold/tests/__SolutionName__.Infrastructure.Tests/bin/Debug/net10.0/.msCoverageSourceRootsMapping___SolutionName__.Infrastructure.Tests +0 -0
- package/template/dotnet-scaffold/tests/__SolutionName__.Infrastructure.Tests/obj/Debug/net10.0/__SolutionName__.Infrastructure.Tests.assets.cache +0 -0
- package/template/dotnet-scaffold/tests/__SolutionName__.Infrastructure.Tests/obj/Debug/net10.0/__SolutionName__.Infrastructure.Tests.csproj.AssemblyReference.cache +0 -0
- package/template/dotnet-scaffold/tests/__SolutionName__.Infrastructure.Tests/obj/__SolutionName__.Infrastructure.Tests.csproj.nuget.dgspec.json +0 -1412
- package/template/dotnet-scaffold/tests/__SolutionName__.Infrastructure.Tests/obj/__SolutionName__.Infrastructure.Tests.csproj.nuget.g.props +0 -26
- package/template/dotnet-scaffold/tests/__SolutionName__.Infrastructure.Tests/obj/__SolutionName__.Infrastructure.Tests.csproj.nuget.g.targets +0 -13
- package/template/dotnet-scaffold/tests/__SolutionName__.Infrastructure.Tests/obj/project.assets.json +0 -2130
- package/template/dotnet-scaffold/tests/__SolutionName__.Infrastructure.Tests/obj/project.nuget.cache +0 -38
package/INSTALLATION.md
CHANGED
|
@@ -1,32 +1,47 @@
|
|
|
1
|
-
# Prerequisites & Auto-Install
|
|
2
|
-
|
|
3
|
-
`musketeer` auto-installs the external prerequisites required by your selected company
|
|
4
|
-
(announced before each install, never silent). When no OS package manager is available — or
|
|
5
|
-
an elevation prompt is refused — it falls back to printing the exact manual command below.
|
|
6
|
-
|
|
7
|
-
> Filled in detail during Phase 06 (provisioner) / Phase 08 (publish).
|
|
8
|
-
|
|
9
|
-
## Per-prerequisite matrix
|
|
10
|
-
|
|
11
|
-
| Prereq | Needed by | Windows | macOS | Linux |
|
|
12
|
-
|--------|-----------|---------|-------|-------|
|
|
13
|
-
| Node 18+ | core | `winget install OpenJS.NodeJS.LTS` | `brew install node` | NodeSource / distro |
|
|
14
|
-
| git | core, code-review | `winget install Git.Git` | `brew install git` | `apt/dnf/pacman install git` |
|
|
15
|
-
| Python 3.8+ | core (skill-creator) | `winget install Python.Python.3.12` | `brew install python@3.12` | `apt install python3 python3-pip` |
|
|
16
|
-
| Java 8+ | architecture (context-map) | `winget install Microsoft.OpenJDK` | `brew install --cask temurin` | `apt install openjdk-17-jdk` |
|
|
17
|
-
| adr-tools | architecture (adr-writer) | download the [release zip](https://github.com/npryce/adr-tools/releases), copy `src/*` into `C:\Program Files\Git\usr\bin` (Git Bash) | `brew install adr-tools` | `apt install adr-tools` · Arch: AUR `adr-tools` · Fedora/RHEL: clone + add `src/` to `PATH` |
|
|
18
|
-
| gh | code-review (PR mode) | `winget install GitHub.cli` | `brew install gh` | `apt install gh` |
|
|
19
|
-
|
|
20
|
-
> `adr-tools` is a set of bash scripts. On Windows it runs inside Git Bash (already required by
|
|
21
|
-
> core),
|
|
22
|
-
>
|
|
23
|
-
>
|
|
24
|
-
>
|
|
25
|
-
>
|
|
26
|
-
>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
# Prerequisites & Auto-Install
|
|
2
|
+
|
|
3
|
+
`musketeer` auto-installs the external prerequisites required by your selected company
|
|
4
|
+
(announced before each install, never silent). When no OS package manager is available — or
|
|
5
|
+
an elevation prompt is refused — it falls back to printing the exact manual command below.
|
|
6
|
+
|
|
7
|
+
> Filled in detail during Phase 06 (provisioner) / Phase 08 (publish).
|
|
8
|
+
|
|
9
|
+
## Per-prerequisite matrix
|
|
10
|
+
|
|
11
|
+
| Prereq | Needed by | Windows | macOS | Linux |
|
|
12
|
+
|--------|-----------|---------|-------|-------|
|
|
13
|
+
| Node 18+ | core | `winget install OpenJS.NodeJS.LTS` | `brew install node` | NodeSource / distro |
|
|
14
|
+
| git | core, code-review | `winget install Git.Git` | `brew install git` | `apt/dnf/pacman install git` |
|
|
15
|
+
| Python 3.8+ | core (skill-creator) | `winget install Python.Python.3.12` | `brew install python@3.12` | `apt install python3 python3-pip` |
|
|
16
|
+
| Java 8+ | architecture (context-map) | `winget install Microsoft.OpenJDK` | `brew install --cask temurin` | `apt install openjdk-17-jdk` |
|
|
17
|
+
| adr-tools | architecture (adr-writer) | download the [release zip](https://github.com/npryce/adr-tools/releases), copy `src/*` into `C:\Program Files\Git\usr\bin` (Git Bash) | `brew install adr-tools` | `apt install adr-tools` · Arch: AUR `adr-tools` · Fedora/RHEL: clone + add `src/` to `PATH` |
|
|
18
|
+
| gh | code-review (PR mode) | `winget install GitHub.cli` | `brew install gh` | `apt install gh` |
|
|
19
|
+
|
|
20
|
+
> `adr-tools` is a set of bash scripts. On Windows it runs inside Git Bash (already required by
|
|
21
|
+
> core), which is where muster now probes for it, so a working install is reported as present.
|
|
22
|
+
>
|
|
23
|
+
> On Windows, keep the project on a path with no spaces. `adr-tools` resolves its ADR directory
|
|
24
|
+
> with an unquoted path test, so a space makes it fall back to a `doc/adr` default and write the
|
|
25
|
+
> record where nothing indexes it. Musketeer refuses the call rather than let that happen, but the
|
|
26
|
+
> underlying tool is still wrong.
|
|
27
|
+
|
|
28
|
+
### Running muster without a terminal
|
|
29
|
+
|
|
30
|
+
`musketeer muster` opens a picker, which needs a terminal. For CI, onboarding scripts, and agent
|
|
31
|
+
sessions, name the company instead and the picker is skipped:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
musketeer muster --company architecture,dotnet # set the company to exactly these
|
|
35
|
+
musketeer muster --keep # refresh the company already in .musketeer.json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`--keep` is the one to reach for after upgrading the CLI: it re-applies the latest templates
|
|
39
|
+
without changing which musketeers are installed. Both flags survive the self-update re-exec.
|
|
40
|
+
|
|
41
|
+
The `apt`/`brew` prereq installs can still prompt for `sudo` or wait on input. Pre-install them, or
|
|
42
|
+
set `MUSKETEER_SKIP_INSTALL=1` to print the manual command instead of running it.
|
|
43
|
+
|
|
44
|
+
## Secrets (never auto-installed)
|
|
45
|
+
|
|
46
|
+
- `ANTHROPIC_API_KEY` — needed only by skill-creator's improve/loop scripts. You will be
|
|
47
|
+
prompted / shown how to set it; musketeer never writes it to the repo.
|
package/README.md
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
# musketeer
|
|
2
|
-
|
|
3
|
-
> Distributable custom Claude Code harness. One declarative command scaffolds a curated
|
|
4
|
-
> **company** of **musketeers** (skills + agents + hooks) into any project's `./.claude/`.
|
|
5
|
-
|
|
6
|
-
## Install
|
|
7
|
-
|
|
8
|
-
```bash
|
|
9
|
-
npm i -g @phuc1403/musketeer
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
## Use
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
musketeer muster # self-update → pick company (multi-select) → refresh all selected skills to latest
|
|
16
|
-
musketeer promote # update the musketeer CLI itself to the latest published version
|
|
17
|
-
musketeer # show usage
|
|
18
|
-
musketeer --help # show usage
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
`musketeer muster` **self-updates first**: it pulls the latest published version (re-execing when behind),
|
|
22
|
-
so the refresh always applies the newest template. Set `MUSKETEER_NO_SELF_UPDATE=1` to skip (offline / pinned).
|
|
23
|
-
|
|
24
|
-
It is also **idempotent** and **force-updating**: the picker pre-checks your current company (from
|
|
25
|
-
`.musketeer.json`); on confirm it **re-writes every selected musketeer's files to the latest template**
|
|
26
|
-
(overwriting any local edits), removes newly-unchecked ones, regenerates `settings.json`, and auto-installs
|
|
27
|
-
any missing prerequisites.
|
|
28
|
-
|
|
29
|
-
`musketeer promote` upgrades the **CLI tool** itself (not your project's company): it checks the npm
|
|
30
|
-
registry, and if a newer version exists, runs `npm i -g @phuc1403/musketeer@latest`. _muster = which
|
|
31
|
-
musketeers are in this project; promote = upgrade the binary._
|
|
32
|
-
|
|
33
|
-
## Musketeers (v1)
|
|
34
|
-
|
|
35
|
-
| Musketeer | Default in muster | What it adds |
|
|
36
|
-
|-----------|-------------------|--------------|
|
|
37
|
-
| **core** | always on (locked, hidden) | research, handoff, skill-creator, git (+ git-manager agent) · statusline, usage-context, format-json hooks |
|
|
38
|
-
| **architecture** | off | adr-writer, architecture-characteristic-writer, context-map · CML validation hook |
|
|
39
|
-
| **hallmark** | off | hallmark, hallmark-explore, hallmark-loop · auditor/explorer agents |
|
|
40
|
-
| **code-review** | off | code-review skill + code-reviewer agent |
|
|
41
|
-
| **dotnet** | off | tdd, knowledge-crunching · EF migration guard hook · always merges 4 quality-gate props into root `Directory.Build.props` (`MUSKETEER_SKIP_DOTNET_PROPS=1` to skip) · scaffolds a generic `src`/`tests` Clean Architecture skeleton when the project is blank |
|
|
42
|
-
| **design-docs** | off | inject-design-docs SessionStart hook |
|
|
43
|
-
|
|
44
|
-
The muster starts every musketeer **unselected**, except ones you already installed (pre-checked from
|
|
45
|
-
`.musketeer.json`). **core** is always included and isn't shown as a toggle — it can't be removed.
|
|
46
|
-
|
|
47
|
-
Vocabulary: **musketeer** = a selectable unit · **muster** = the picker · **company** = your recruited set.
|
|
48
|
-
|
|
49
|
-
See [INSTALLATION.md](INSTALLATION.md) for prerequisites and auto-install behavior.
|
|
1
|
+
# musketeer
|
|
2
|
+
|
|
3
|
+
> Distributable custom Claude Code harness. One declarative command scaffolds a curated
|
|
4
|
+
> **company** of **musketeers** (skills + agents + hooks) into any project's `./.claude/`.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm i -g @phuc1403/musketeer
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Use
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
musketeer muster # self-update → pick company (multi-select) → refresh all selected skills to latest
|
|
16
|
+
musketeer promote # update the musketeer CLI itself to the latest published version
|
|
17
|
+
musketeer # show usage
|
|
18
|
+
musketeer --help # show usage
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`musketeer muster` **self-updates first**: it pulls the latest published version (re-execing when behind),
|
|
22
|
+
so the refresh always applies the newest template. Set `MUSKETEER_NO_SELF_UPDATE=1` to skip (offline / pinned).
|
|
23
|
+
|
|
24
|
+
It is also **idempotent** and **force-updating**: the picker pre-checks your current company (from
|
|
25
|
+
`.musketeer.json`); on confirm it **re-writes every selected musketeer's files to the latest template**
|
|
26
|
+
(overwriting any local edits), removes newly-unchecked ones, regenerates `settings.json`, and auto-installs
|
|
27
|
+
any missing prerequisites.
|
|
28
|
+
|
|
29
|
+
`musketeer promote` upgrades the **CLI tool** itself (not your project's company): it checks the npm
|
|
30
|
+
registry, and if a newer version exists, runs `npm i -g @phuc1403/musketeer@latest`. _muster = which
|
|
31
|
+
musketeers are in this project; promote = upgrade the binary._
|
|
32
|
+
|
|
33
|
+
## Musketeers (v1)
|
|
34
|
+
|
|
35
|
+
| Musketeer | Default in muster | What it adds |
|
|
36
|
+
|-----------|-------------------|--------------|
|
|
37
|
+
| **core** | always on (locked, hidden) | research, handoff, skill-creator, git (+ git-manager agent) · statusline, usage-context, format-json hooks |
|
|
38
|
+
| **architecture** | off | adr-writer, architecture-characteristic-writer, context-map · CML validation hook |
|
|
39
|
+
| **hallmark** | off | hallmark, hallmark-explore, hallmark-loop · auditor/explorer agents |
|
|
40
|
+
| **code-review** | off | code-review skill + code-reviewer agent |
|
|
41
|
+
| **dotnet** | off | tdd, knowledge-crunching · EF migration guard hook · always merges 4 quality-gate props into root `Directory.Build.props` (`MUSKETEER_SKIP_DOTNET_PROPS=1` to skip) · scaffolds a generic `src`/`tests` Clean Architecture skeleton when the project is blank |
|
|
42
|
+
| **design-docs** | off | inject-design-docs SessionStart hook |
|
|
43
|
+
|
|
44
|
+
The muster starts every musketeer **unselected**, except ones you already installed (pre-checked from
|
|
45
|
+
`.musketeer.json`). **core** is always included and isn't shown as a toggle — it can't be removed.
|
|
46
|
+
|
|
47
|
+
Vocabulary: **musketeer** = a selectable unit · **muster** = the picker · **company** = your recruited set.
|
|
48
|
+
|
|
49
|
+
See [INSTALLATION.md](INSTALLATION.md) for prerequisites and auto-install behavior.
|
package/bin/musketeer.js
CHANGED
|
@@ -1,79 +1,168 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
const { parseArgs } = require('node:util');
|
|
5
|
-
|
|
6
|
-
const USAGE = `musketeer — scaffold a curated company of Claude Code musketeers into ./.claude
|
|
7
|
-
|
|
8
|
-
Usage:
|
|
9
|
-
musketeer muster Self-update to latest, then pick your company and refresh all selected skills
|
|
10
|
-
musketeer
|
|
11
|
-
|
|
12
|
-
musketeer --
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const { parseArgs } = require('node:util');
|
|
5
|
+
|
|
6
|
+
const USAGE = `musketeer — scaffold a curated company of Claude Code musketeers into ./.claude
|
|
7
|
+
|
|
8
|
+
Usage:
|
|
9
|
+
musketeer muster Self-update to latest, then pick your company and refresh all selected skills
|
|
10
|
+
musketeer muster --keep
|
|
11
|
+
Refresh the company already recorded in .musketeer.json, no picker
|
|
12
|
+
musketeer muster --company a,b
|
|
13
|
+
Set the company to exactly these musketeers, no picker
|
|
14
|
+
musketeer promote Update the musketeer CLI itself to the latest published version
|
|
15
|
+
musketeer Show this help
|
|
16
|
+
musketeer --help Show this help
|
|
17
|
+
|
|
18
|
+
Notes:
|
|
19
|
+
* "muster" changes which musketeers are in THIS project; "promote" upgrades the CLI itself.
|
|
20
|
+
* On confirm, muster REFRESHES every selected musketeer's files to the latest template (overwrites local edits).
|
|
21
|
+
* muster auto-updates the CLI to the latest published version first (set MUSKETEER_NO_SELF_UPDATE=1 to skip).
|
|
22
|
+
* "core" is always installed and locked — it cannot be removed.
|
|
23
|
+
* The muster is multi-select: check every musketeer you want, then confirm.
|
|
24
|
+
* settings.json is GENERATED per-selection; missing prereqs are auto-installed (announced).
|
|
25
|
+
* --keep and --company skip the picker, so muster runs in CI and other sessions with no terminal.
|
|
26
|
+
* Without either flag and without a terminal, muster stops and tells you which flag to use.`;
|
|
27
|
+
|
|
28
|
+
function parse(argv) {
|
|
29
|
+
return parseArgs({
|
|
30
|
+
args: argv,
|
|
31
|
+
options: {
|
|
32
|
+
help: { type: 'boolean', short: 'h', default: false },
|
|
33
|
+
company: { type: 'string' },
|
|
34
|
+
keep: { type: 'boolean', default: false },
|
|
35
|
+
},
|
|
36
|
+
allowPositionals: true,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Work out what this muster should do before anything touches the disk.
|
|
42
|
+
*
|
|
43
|
+
* Bare `muster` opens the picker, which needs a terminal. Under CI, or any
|
|
44
|
+
* agent without one, the picker used to die inside its own TTY setup with no
|
|
45
|
+
* hint that a flag could have avoided it. Both flags skip the picker: --company
|
|
46
|
+
* states the company outright, --keep reconciles the one already recorded.
|
|
47
|
+
*
|
|
48
|
+
* `forward` is what the self-update must replay when it re-execs the newer
|
|
49
|
+
* binary, so a scripted run does not land back at the picker.
|
|
50
|
+
*
|
|
51
|
+
* @param {{company?:string, keep:boolean}} values parsed flags
|
|
52
|
+
* @param {{isTTY:boolean, projectDir:string, readLockfile:function}} ctx
|
|
53
|
+
* @returns {{desiredIds:?string[], interactive:boolean, forward:string[]}}
|
|
54
|
+
*/
|
|
55
|
+
function resolveMusterPlan(values, ctx) {
|
|
56
|
+
if (values.company !== undefined && values.keep) {
|
|
57
|
+
throw new Error('Use either --company or --keep, not both: one sets the company, the other keeps it.');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (values.company !== undefined) {
|
|
61
|
+
const ids = values.company
|
|
62
|
+
.split(',')
|
|
63
|
+
.map((s) => s.trim())
|
|
64
|
+
.filter(Boolean);
|
|
65
|
+
if (ids.length === 0) {
|
|
66
|
+
throw new Error('--company needs at least one musketeer, for example: --company architecture,dotnet');
|
|
67
|
+
}
|
|
68
|
+
return { desiredIds: ids, interactive: false, forward: [`--company=${ids.join(',')}`] };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (values.keep) {
|
|
72
|
+
const prev = ctx.readLockfile(ctx.projectDir);
|
|
73
|
+
if (!prev.musketeers || prev.musketeers.length === 0) {
|
|
74
|
+
throw new Error(
|
|
75
|
+
'No company recorded in .musketeer.json, so there is nothing for --keep to keep. ' +
|
|
76
|
+
'Name one with --company, for example: --company architecture,dotnet'
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
return { desiredIds: prev.musketeers, interactive: false, forward: ['--keep'] };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (!ctx.isTTY) {
|
|
83
|
+
throw new Error(
|
|
84
|
+
'muster needs a terminal for its picker, and this session has none. ' +
|
|
85
|
+
'Refresh the company already recorded with `musketeer muster --keep`, ' +
|
|
86
|
+
'or state one with `musketeer muster --company architecture,dotnet`.'
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return { desiredIds: null, interactive: true, forward: [] };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async function main(argv = process.argv.slice(2)) {
|
|
94
|
+
let parsed;
|
|
95
|
+
try {
|
|
96
|
+
parsed = parse(argv);
|
|
97
|
+
} catch (err) {
|
|
98
|
+
process.stderr.write(`${err.message}\n\n${USAGE}\n`);
|
|
99
|
+
process.exitCode = 2;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const { values, positionals } = parsed;
|
|
104
|
+
const command = positionals[0];
|
|
105
|
+
|
|
106
|
+
// `musketeer` alone (or --help) → usage.
|
|
107
|
+
if (values.help || !command) {
|
|
108
|
+
process.stdout.write(`${USAGE}\n`);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (command === 'muster') {
|
|
113
|
+
const { readLockfile } = require('../src/lockfile');
|
|
114
|
+
let plan;
|
|
115
|
+
try {
|
|
116
|
+
plan = resolveMusterPlan(values, {
|
|
117
|
+
isTTY: !!process.stdin.isTTY,
|
|
118
|
+
projectDir: process.cwd(),
|
|
119
|
+
readLockfile,
|
|
120
|
+
});
|
|
121
|
+
} catch (err) {
|
|
122
|
+
process.stderr.write(`${err.message}\n`);
|
|
123
|
+
process.exitCode = 2;
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Pull the latest published version first, so the picker refreshes installed
|
|
128
|
+
// skills to the newest template (not a stale package's). Re-execs when behind.
|
|
129
|
+
const { ensureLatest } = require('../src/self-update');
|
|
130
|
+
const reexecCode = ensureLatest({ args: plan.forward });
|
|
131
|
+
if (reexecCode !== null) {
|
|
132
|
+
if (reexecCode !== 0) {
|
|
133
|
+
// The update landed, the refresh did not. Say so: the CLI is now newer
|
|
134
|
+
// than the templates in this project, and nothing announced the split.
|
|
135
|
+
process.stderr.write(
|
|
136
|
+
'The CLI was updated but this project was not refreshed — nothing in .claude changed. ' +
|
|
137
|
+
'Re-run `musketeer muster` once the problem above is resolved.\n'
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
process.exitCode = reexecCode;
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
// Lazy-require so help never pays the cost of loading the engine/manifest.
|
|
144
|
+
const reconcile = require('../src/reconcile');
|
|
145
|
+
await reconcile.run({ desiredIds: plan.desiredIds, interactive: plan.interactive });
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (command === 'promote') {
|
|
150
|
+
const promote = require('../src/promote');
|
|
151
|
+
await promote.run();
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
process.stderr.write(`Unknown command "${command}".\n\n${USAGE}\n`);
|
|
156
|
+
process.exitCode = 2;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Only run as a command. Requiring this file (the tests do, for
|
|
160
|
+
// resolveMusterPlan) must not start a muster.
|
|
161
|
+
if (require.main === module) {
|
|
162
|
+
main().catch((err) => {
|
|
163
|
+
process.stderr.write(`musketeer: ${err && err.message ? err.message : err}\n`);
|
|
164
|
+
process.exitCode = 1;
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
module.exports = { resolveMusterPlan, main };
|