agentic-skill-mill 1.0.9 → 1.0.11
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 +8 -12
- package/compiled/claude/agentic-skill-mill/SKILL.md +31 -26
- package/compiled/codex/agentic-skill-mill/SKILL.md +31 -26
- package/compiled/cursor/skills/agentic-skill-mill/SKILL.md +31 -26
- package/compiled/opencode/agentic-skill-mill.md +31 -26
- package/compiled/windsurf/skills/agentic-skill-mill/SKILL.md +31 -26
- package/dist/core/scaffold.js +0 -1
- package/dist/core/scaffold.js.map +1 -1
- package/install.js +555 -0
- package/package.json +10 -13
- package/skill/build/manifest.json +0 -2
- package/skill/fragments/meta/architecture-overview.md +6 -4
- package/skill/fragments/meta/distribution-and-ci.md +21 -17
- package/skill/fragments/meta/rename-workflow.md +2 -2
- package/skill/skills/agentic-skill-mill/agentic-skill-mill.md +2 -3
- package/compiled/cursor/rules/agentic-skill-mill.mdc +0 -547
- package/compiled/windsurf/rules/agentic-skill-mill.md +0 -547
- package/install-local.ps1 +0 -385
- package/install-local.sh +0 -265
- package/install.ps1 +0 -48
- package/install.sh +0 -44
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
### Distribution model
|
|
2
2
|
|
|
3
|
-
The project is published to npmjs as a public package and hosted at `https://agenticskillmill.com`.
|
|
3
|
+
The project is published to npmjs as a public package and hosted at `https://agenticskillmill.com`.
|
|
4
|
+
|
|
5
|
+
**Remote install (no clone):** Every project hosts `site/install.sh` and `site/install.ps1` bootstrap scripts served via GitHub Pages. Non-npm projects use a clone-to-temp pattern instead of `npm install -g`.
|
|
6
|
+
|
|
7
|
+
There are multiple ways users consume it:
|
|
4
8
|
|
|
5
9
|
| Method | Command | Who uses it |
|
|
6
10
|
|--------|---------|-------------|
|
|
7
|
-
| Remote install (
|
|
11
|
+
| Remote install (bash) | `bash <(curl -fsSL https://<domain>/install.sh)` | End users on Linux/macOS |
|
|
12
|
+
| Remote install (PowerShell) | `irm https://<domain>/install.ps1 \| iex` | End users on Windows |
|
|
8
13
|
| npx (no install) | `npx --yes agentic-skill-mill@latest <command>` | Users running CLI commands without global install |
|
|
9
|
-
| Local development | `git clone` then `
|
|
14
|
+
| Local development | `git clone` then `node install.js --all` | Contributors working on the project itself |
|
|
10
15
|
|
|
11
|
-
###
|
|
16
|
+
### One unified installer
|
|
12
17
|
|
|
13
|
-
**`install
|
|
14
|
-
- `npm install` + `npm run build` + `npm run compile`
|
|
15
|
-
- `npm link` to make `skillmill` available globally
|
|
18
|
+
**`install.js`** is a single cross-platform Node.js installer that replaces the old shell/PowerShell split:
|
|
19
|
+
- Runs `npm install` + `npm run build` + `npm run compile` + `npm link`
|
|
16
20
|
- Copies compiled skill outputs to IDE-specific directories (~/.claude/skills, ~/.cursor/rules, etc.)
|
|
17
21
|
- Supports `--skills-only` (skip build, just copy), `--uninstall`, `--compile-only`, and per-tool flags (`--cursor`, `--claude`, etc.)
|
|
18
22
|
- Auto-detects installed tools when no flags are provided
|
|
19
23
|
|
|
20
|
-
**`install.sh`** is the remote bootstrap installer. It is hosted at `https://agenticskillmill.com/install.sh` (source: `site/install.sh`) and bundled in the npm package. It:
|
|
24
|
+
**`site/install.sh`** is the remote bootstrap installer. It is hosted at `https://agenticskillmill.com/install.sh` (source: `site/install.sh`) and bundled in the npm package. It:
|
|
21
25
|
1. Runs `npm install -g agentic-skill-mill@latest`
|
|
22
|
-
2. Locates `install
|
|
23
|
-
3. Delegates to `install
|
|
26
|
+
2. Locates `install.js` inside the globally installed package
|
|
27
|
+
3. Delegates to `node install.js --skills-only` with the user's flags
|
|
24
28
|
|
|
25
29
|
Both scripts respect environment overrides `SKILLMILL_PACKAGE_NAME` and `SKILLMILL_PACKAGE_VERSION`.
|
|
26
30
|
|
|
@@ -31,11 +35,10 @@ The `files` array in `package.json` controls what ships to npm:
|
|
|
31
35
|
| Entry | Purpose |
|
|
32
36
|
|-------|---------|
|
|
33
37
|
| `dist` | Compiled TypeScript CLI and library |
|
|
34
|
-
| `compiled` | Pre-compiled skill outputs for all
|
|
38
|
+
| `compiled` | Pre-compiled skill outputs for all 5 IDE targets |
|
|
35
39
|
| `skill` | Skill sources, fragments, compiler, and manifest |
|
|
36
40
|
| `README.md` | Package documentation |
|
|
37
|
-
| `install.
|
|
38
|
-
| `install-local.sh` | Full local installer (used by bootstrap in --skills-only mode) |
|
|
41
|
+
| `install.js` | Unified cross-platform installer |
|
|
39
42
|
|
|
40
43
|
The `bin` field maps `skillmill` to `dist/cli/index.js`, so `npx agentic-skill-mill` and global install both expose the `skillmill` command.
|
|
41
44
|
|
|
@@ -63,15 +66,16 @@ Static site served via GitHub Pages at `https://agenticskillmill.com`:
|
|
|
63
66
|
| `site/index.html` | Landing page with architecture, CLI commands, and install instructions |
|
|
64
67
|
| `site/style.css` | Site styles |
|
|
65
68
|
| `site/install.sh` | Bootstrap installer served at `https://agenticskillmill.com/install.sh` |
|
|
69
|
+
| `site/install.ps1` | PowerShell bootstrap installer served at `https://agenticskillmill.com/install.ps1` |
|
|
66
70
|
|
|
67
|
-
When updating the bootstrap installer logic, edit `install.sh` at the repo root and copy
|
|
71
|
+
When updating the bootstrap installer logic, edit `install.sh` and `install.ps1` at the repo root and copy them to `site/install.sh` and `site/install.ps1` to keep both in sync. The release workflow publishes the repo-root copies to npm; the Pages workflow serves the site copies to the domain.
|
|
68
72
|
|
|
69
73
|
### Modifying distribution touchpoints
|
|
70
74
|
|
|
71
75
|
| Change | Files to update |
|
|
72
76
|
|--------|----------------|
|
|
73
|
-
| Add a new skill | `
|
|
74
|
-
| Change package name | `package.json` name + bin, `
|
|
75
|
-
| Change bootstrap behavior | `install.
|
|
77
|
+
| Add a new skill | `skill/build/manifest.json` |
|
|
78
|
+
| Change package name | `package.json` name + bin, `site/install.sh` default, `install.js` PROJECT_NAME + CLI_BIN_NAME, `site/index.html`, README |
|
|
79
|
+
| Change bootstrap behavior | `install.js`, then copy to `site/install.sh` and `site/install.ps1` |
|
|
76
80
|
| Add a GitHub Actions secret | Repo settings, document in README |
|
|
77
81
|
| Update domain | `site/CNAME`, README, skill source, architecture fragment |
|
|
@@ -22,9 +22,9 @@ When the project, skill, or CLI needs a new name, update all touchpoints in one
|
|
|
22
22
|
|
|
23
23
|
4. **Compiler marker** (`skill/build/compile.mjs`) -- update the `MANAGED_BY` constant
|
|
24
24
|
|
|
25
|
-
5. **
|
|
25
|
+
5. **Installer** (`install.js`) -- update `PROJECT_NAME`, `CLI_BIN_NAME`, constants
|
|
26
26
|
|
|
27
|
-
6. **Bootstrap installer** (`install.sh`) -- update the default `PACKAGE_NAME
|
|
27
|
+
6. **Bootstrap installer** (`site/install.sh`) -- update the default `PACKAGE_NAME`
|
|
28
28
|
|
|
29
29
|
7. **Package metadata** (`package.json`) -- update `name`, `bin` key, and `description`
|
|
30
30
|
|
|
@@ -89,8 +89,7 @@ Direct content or more includes.
|
|
|
89
89
|
Then register it:
|
|
90
90
|
|
|
91
91
|
1. Add the skill entry to `skill/build/manifest.json` with its source path and fragment dependencies
|
|
92
|
-
2.
|
|
93
|
-
3. Compile: `npm run compile`
|
|
92
|
+
2. Compile: `npm run compile`
|
|
94
93
|
|
|
95
94
|
### Step 8: If Renaming the Project
|
|
96
95
|
|
|
@@ -102,7 +101,7 @@ After any change, run the full verification sequence:
|
|
|
102
101
|
|
|
103
102
|
```bash
|
|
104
103
|
npm run build # TypeScript CLI compiles cleanly
|
|
105
|
-
npm run compile # Skills compile to
|
|
104
|
+
npm run compile # Skills compile to 5 IDE targets
|
|
106
105
|
npm run compile:validate # Cross-validates manifest vs source includes
|
|
107
106
|
npx --yes agentic-skill-mill@latest --help # CLI command surface works via npx
|
|
108
107
|
```
|
|
@@ -1,547 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
managed_by: agentic-skill-mill
|
|
3
|
-
description: "\"Build, augment, and maintain skill projects that follow the skill-system-template architecture. Covers adding CLI commands, creating fragments, composing skills, renaming projects, and turning research into actionable tooling. Use when the user mentions: add a command, new skill, new fragment, augment the CLI, build a utility, add a tool, rename the project, forge a component, or wants to extend an existing skill project.\""
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Agentic Skill Mill
|
|
8
|
-
|
|
9
|
-
Forge and refine skill projects that follow the skill-system-template architecture: fragment-composed skills compiled to multiple IDE targets, paired with a TypeScript companion CLI (`skillmill`) that provides structured commands for agents and humans. Prefer `npx --yes agentic-skill-mill@latest <command>` when the utility is not globally installed. Remote users can install everything via `bash <(curl -fsSL https://agenticskillmill.com/install.sh) --all`.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Architecture
|
|
14
|
-
|
|
15
|
-
The skill-system-template architecture has two halves that meet at the agent:
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
Skills (what to do) CLI Companion (tools to do it with)
|
|
19
|
-
skill/skills/*.md src/cli/commands/*.ts
|
|
20
|
-
skill/fragments/*.md src/core/*.ts
|
|
21
|
-
| |
|
|
22
|
-
v v
|
|
23
|
-
compiled/ (7 IDE formats) dist/ (npm -> npx or global CLI)
|
|
24
|
-
| |
|
|
25
|
-
+---------> Agent <----------+
|
|
26
|
-
^
|
|
27
|
-
|
|
|
28
|
-
Distribution: npm publish + agenticskillmill.com
|
|
29
|
-
.github/workflows/release.yml (build, test, version, publish)
|
|
30
|
-
.github/workflows/deploy-pages.yml (site/ -> GitHub Pages)
|
|
31
|
-
site/install.sh (curl-friendly bootstrap)
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
**Skills** are step-by-step runbooks in markdown with YAML frontmatter. They tell the agent *what* to do. Skills reference the CLI by name so the agent can invoke structured commands.
|
|
35
|
-
|
|
36
|
-
**Fragments** are shared knowledge blocks included by multiple skills via include markers (`\{\{include:path\}\}`). Edit a fragment once, recompile, and every skill that includes it gets the update. Fragments have no frontmatter.
|
|
37
|
-
|
|
38
|
-
**The compiler** (`skill/build/compile.mjs`) resolves includes, applies IDE-specific frontmatter transforms, and writes to `compiled/` with one subdirectory per target. It validates naming rules, checks for unresolved includes, and cross-validates manifest declarations against actual includes in source files.
|
|
39
|
-
|
|
40
|
-
**The CLI companion** is a TypeScript package with:
|
|
41
|
-
- `src/core/` — Pure logic modules with typed interfaces
|
|
42
|
-
- `src/cli/commands/` — Thin command wrappers that delegate to core modules
|
|
43
|
-
- `src/cli/index.ts` — Commander.js entry point wiring all commands
|
|
44
|
-
- `src/cli/output-formatter.ts` — JSON, table, and key-value formatters
|
|
45
|
-
- `src/errors/types.ts` — Typed error hierarchy (AppError, NotFoundError, etc.)
|
|
46
|
-
- `src/cache/cache-manager.ts` — Two-tier cache (memory + disk) with TTL
|
|
47
|
-
|
|
48
|
-
**The local installer** (`install-local.sh`) builds the CLI, compiles skills, and copies compiled outputs to IDE-specific directories (~/.claude/skills, ~/.cursor/rules, etc.) with marker-based stale file cleanup. The bootstrap installer is hosted at `https://agenticskillmill.com/install.sh` (source: `site/install.sh`) and is also bundled in the npm package as `install.sh`. It installs the npm utility first, then delegates to `install-local.sh --skills-only`. Local installer functions use `set -e` for fail-fast behavior. Any function that uses an early-exit guard (`[[ -d ... ]] || return`, `[[ -z ... ]] && return`) **must** use `return 0`, never bare `return`. Bare `return` inherits the exit code of the last command, which for a failed conditional test is 1 -- and `set -e` treats that as a script-terminating failure with no error message.
|
|
49
|
-
|
|
50
|
-
### Key files to modify when augmenting a project
|
|
51
|
-
|
|
52
|
-
| What | File(s) |
|
|
53
|
-
|------|---------|
|
|
54
|
-
| Add a CLI command | `src/core/<name>.ts`, `src/cli/commands/<name>.ts`, `src/cli/index.ts`, `src/index.ts` |
|
|
55
|
-
| Add a fragment | `skill/fragments/<category>/<name>.md`, `skill/build/manifest.json`, skill source |
|
|
56
|
-
| Add a skill | `skill/skills/<name>/<name>.md`, `skill/build/manifest.json`, `install-local.sh` SKILLS array |
|
|
57
|
-
| Change installer behavior | `install.sh` (repo root) then copy to `site/install.sh` |
|
|
58
|
-
| Update the landing page | `site/index.html`, `site/style.css` |
|
|
59
|
-
| Change CI secrets or workflow | `.github/workflows/release.yml` or `deploy-pages.yml`, repo settings |
|
|
60
|
-
| Rename the project | See the rename workflow |
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## Distribution and CI
|
|
65
|
-
|
|
66
|
-
### Distribution model
|
|
67
|
-
|
|
68
|
-
The project is published to npmjs as a public package and hosted at `https://agenticskillmill.com`. There are three ways users consume it:
|
|
69
|
-
|
|
70
|
-
| Method | Command | Who uses it |
|
|
71
|
-
|--------|---------|-------------|
|
|
72
|
-
| Remote install (no clone) | `bash <(curl -fsSL https://agenticskillmill.com/install.sh) --all` | End users who want skills installed into their IDE tools |
|
|
73
|
-
| npx (no install) | `npx --yes agentic-skill-mill@latest <command>` | Users running CLI commands without global install |
|
|
74
|
-
| Local development | `git clone` then `bash install-local.sh --all` | Contributors working on the project itself |
|
|
75
|
-
|
|
76
|
-
### Two installer scripts
|
|
77
|
-
|
|
78
|
-
**`install-local.sh`** is the full local installer. It runs from a cloned repo and handles:
|
|
79
|
-
- `npm install` + `npm run build` + `npm run compile`
|
|
80
|
-
- `npm link` to make `skillmill` available globally
|
|
81
|
-
- Copies compiled skill outputs to IDE-specific directories (~/.claude/skills, ~/.cursor/rules, etc.)
|
|
82
|
-
- Supports `--skills-only` (skip build, just copy), `--uninstall`, `--compile-only`, and per-tool flags (`--cursor`, `--claude`, etc.)
|
|
83
|
-
- Auto-detects installed tools when no flags are provided
|
|
84
|
-
|
|
85
|
-
**`install.sh`** is the remote bootstrap installer. It is hosted at `https://agenticskillmill.com/install.sh` (source: `site/install.sh`) and bundled in the npm package. It:
|
|
86
|
-
1. Runs `npm install -g agentic-skill-mill@latest`
|
|
87
|
-
2. Locates `install-local.sh` inside the globally installed package
|
|
88
|
-
3. Delegates to `install-local.sh --skills-only` with the user's flags
|
|
89
|
-
|
|
90
|
-
Both scripts respect environment overrides `SKILLMILL_PACKAGE_NAME` and `SKILLMILL_PACKAGE_VERSION`.
|
|
91
|
-
|
|
92
|
-
### npm package contents
|
|
93
|
-
|
|
94
|
-
The `files` array in `package.json` controls what ships to npm:
|
|
95
|
-
|
|
96
|
-
| Entry | Purpose |
|
|
97
|
-
|-------|---------|
|
|
98
|
-
| `dist` | Compiled TypeScript CLI and library |
|
|
99
|
-
| `compiled` | Pre-compiled skill outputs for all 7 IDE targets |
|
|
100
|
-
| `skill` | Skill sources, fragments, compiler, and manifest |
|
|
101
|
-
| `README.md` | Package documentation |
|
|
102
|
-
| `install.sh` | Bootstrap installer (bundled for remote delegation) |
|
|
103
|
-
| `install-local.sh` | Full local installer (used by bootstrap in --skills-only mode) |
|
|
104
|
-
|
|
105
|
-
The `bin` field maps `skillmill` to `dist/cli/index.js`, so `npx agentic-skill-mill` and global install both expose the `skillmill` command.
|
|
106
|
-
|
|
107
|
-
### GitHub Actions workflows
|
|
108
|
-
|
|
109
|
-
**Release to npm** (`.github/workflows/release.yml`):
|
|
110
|
-
- Triggers on push to `main` or `workflow_dispatch`
|
|
111
|
-
- Skips runs caused by its own release commits (loop guard via `chore(release):` in commit message)
|
|
112
|
-
- Steps: `npm ci` -> `npm run build` -> `npm run test -- --passWithNoTests` -> `npm run compile` -> `npm run compile:validate` -> version bump -> `git push --follow-tags` -> `npm publish --access public`
|
|
113
|
-
- Version bump finds the next available patch tag to avoid collisions with existing tags
|
|
114
|
-
- Required secrets: `AGENT_TOKEN` (PAT with repo scope for push), `AGENT_NPM_TOKEN` (npm automation token for publish)
|
|
115
|
-
|
|
116
|
-
**Deploy GitHub Pages** (`.github/workflows/deploy-pages.yml`):
|
|
117
|
-
- Triggers on push to `main` when files in `site/` change, or `workflow_dispatch`
|
|
118
|
-
- Uploads `site/` directory as the Pages artifact
|
|
119
|
-
- Deploys to the `github-pages` environment at `agenticskillmill.com`
|
|
120
|
-
|
|
121
|
-
### The `site/` directory
|
|
122
|
-
|
|
123
|
-
Static site served via GitHub Pages at `https://agenticskillmill.com`:
|
|
124
|
-
|
|
125
|
-
| File | Purpose |
|
|
126
|
-
|------|---------|
|
|
127
|
-
| `site/CNAME` | Custom domain binding |
|
|
128
|
-
| `site/index.html` | Landing page with architecture, CLI commands, and install instructions |
|
|
129
|
-
| `site/style.css` | Site styles |
|
|
130
|
-
| `site/install.sh` | Bootstrap installer served at `https://agenticskillmill.com/install.sh` |
|
|
131
|
-
|
|
132
|
-
When updating the bootstrap installer logic, edit `install.sh` at the repo root and copy it to `site/install.sh` to keep both in sync. The release workflow publishes the repo-root copy to npm; the Pages workflow serves the site copy to the domain.
|
|
133
|
-
|
|
134
|
-
### Modifying distribution touchpoints
|
|
135
|
-
|
|
136
|
-
| Change | Files to update |
|
|
137
|
-
|--------|----------------|
|
|
138
|
-
| Add a new skill | `install-local.sh` SKILLS array, `skill/build/manifest.json` |
|
|
139
|
-
| Change package name | `package.json` name + bin, `install.sh` default, `site/install.sh` default, `install-local.sh` PROJECT_NAME + CLI_BIN_NAME + MANAGED_MARKER, `site/index.html`, README |
|
|
140
|
-
| Change bootstrap behavior | `install.sh` (repo root), then copy to `site/install.sh` |
|
|
141
|
-
| Add a GitHub Actions secret | Repo settings, document in README |
|
|
142
|
-
| Update domain | `site/CNAME`, README, skill source, architecture fragment |
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## Workflow
|
|
147
|
-
|
|
148
|
-
### Step 1: Understand the Goal
|
|
149
|
-
|
|
150
|
-
Ask or infer:
|
|
151
|
-
|
|
152
|
-
| Question | Why It Matters |
|
|
153
|
-
|----------|---------------|
|
|
154
|
-
| What is the user trying to add or change? | Scopes the work: new command, new skill, new fragment, rename, or full project |
|
|
155
|
-
| Is there research or a requirements document? | Source material drives which CLI commands to build |
|
|
156
|
-
| What's the existing project state? | Read manifest.json, package.json, and src/cli/index.ts to understand what's already built |
|
|
157
|
-
| Does this need a new skill, a new fragment, or just a new CLI command? | Different paths require different steps |
|
|
158
|
-
|
|
159
|
-
### Step 2: Read the Project State
|
|
160
|
-
|
|
161
|
-
Before making changes, read these files to understand the current structure:
|
|
162
|
-
|
|
163
|
-
1. `skill/build/manifest.json` — what skills and fragments exist
|
|
164
|
-
2. `src/cli/index.ts` — what CLI commands are wired
|
|
165
|
-
3. `src/index.ts` — what's exported
|
|
166
|
-
4. `package.json` — package name, bin name, dependencies
|
|
167
|
-
|
|
168
|
-
### Step 3: If Adding CLI Commands from Research
|
|
169
|
-
|
|
170
|
-
### Extracting CLI utilities from research
|
|
171
|
-
|
|
172
|
-
When research documents, field observations, or domain expertise suggest actionable tooling, follow this process to turn insights into CLI commands:
|
|
173
|
-
|
|
174
|
-
**Step 1: Read the research and tag actionable items**
|
|
175
|
-
|
|
176
|
-
Scan the source material for:
|
|
177
|
-
- Checklists that could be generated dynamically (checklist generator command)
|
|
178
|
-
- Calculations that depend on user inputs (calculator command)
|
|
179
|
-
- Validation rules that can be checked programmatically (validator command)
|
|
180
|
-
- Structured data that can be extracted from existing files (extractor command)
|
|
181
|
-
- Schedules or plans that follow a formula (planner command)
|
|
182
|
-
- Analysis that can be automated against a codebase or artifact (scanner command)
|
|
183
|
-
|
|
184
|
-
**Step 2: Group by command**
|
|
185
|
-
|
|
186
|
-
Each command should do one thing well. If two items from the research share the same input and output shape, they belong in one command. If they have different inputs, they're separate commands.
|
|
187
|
-
|
|
188
|
-
| Research insight | CLI command type | Example |
|
|
189
|
-
|-----------------|-----------------|---------|
|
|
190
|
-
| "Audiences retain 3+/-1 points" | Validator | Check that outlines have 2-4 key sections |
|
|
191
|
-
| "Budget 130 WPM for speaking" | Calculator | Compute per-section word counts from time budgets |
|
|
192
|
-
| "Spaced retrieval beats rereading" | Planner | Generate rehearsal schedule from event date |
|
|
193
|
-
| "Audio quality affects credibility" | Checklist | Pre-flight checklist with audio test item |
|
|
194
|
-
| "Entry points tell the story structure" | Scanner | Analyze repo for entry points and connectivity |
|
|
195
|
-
|
|
196
|
-
**Step 3: Define the interface before writing code**
|
|
197
|
-
|
|
198
|
-
For each command, write the TypeScript interface first:
|
|
199
|
-
- What does the user provide? (Options interface)
|
|
200
|
-
- What does the command return? (Result interface)
|
|
201
|
-
- What warnings can it produce? (`warnings: string[]` in Result)
|
|
202
|
-
|
|
203
|
-
**Step 4: Implement bottom-up**
|
|
204
|
-
|
|
205
|
-
1. Core module in `src/core/` (pure logic, no CLI concerns)
|
|
206
|
-
2. Command wrapper in `src/cli/commands/` (thin delegate)
|
|
207
|
-
3. Wire into `src/cli/index.ts` (with --json support)
|
|
208
|
-
4. Export from `src/index.ts` (for library consumers)
|
|
209
|
-
5. Build and verify: `npm run build && node dist/cli/index.js <command> --help`
|
|
210
|
-
|
|
211
|
-
**Step 5: Embed the research rationale**
|
|
212
|
-
|
|
213
|
-
When a command produces items (checklist entries, warnings, schedule sessions), include a `rationale` or `description` field that cites the research principle. This teaches the user *why*, not just *what*.
|
|
214
|
-
|
|
215
|
-
### Step 4: Implement Core Modules
|
|
216
|
-
|
|
217
|
-
Every CLI command starts as a **core module** in `src/core/`. Core modules contain pure domain logic with no CLI concerns (no chalk, no console.log, no process.exit). This separation lets the logic be consumed as a library, tested independently, and composed by multiple commands.
|
|
218
|
-
|
|
219
|
-
### Structure of a core module
|
|
220
|
-
|
|
221
|
-
```typescript
|
|
222
|
-
// src/core/<name>.ts
|
|
223
|
-
|
|
224
|
-
/** Input options -- everything the caller needs to provide */
|
|
225
|
-
export interface <Name>Options {
|
|
226
|
-
requiredParam: string;
|
|
227
|
-
optionalParam?: number;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
/** Output result -- everything the caller gets back */
|
|
231
|
-
export interface <Name>Result {
|
|
232
|
-
data: SomeType[];
|
|
233
|
-
warnings: string[];
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/** Pure function: options in, result out. No side effects on stdout. */
|
|
237
|
-
export function <name>(options: <Name>Options): <Name>Result {
|
|
238
|
-
return { data: [], warnings: [] };
|
|
239
|
-
}
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
### Rules
|
|
243
|
-
|
|
244
|
-
- **Export typed interfaces** for both input and output so consumers get autocomplete and type safety
|
|
245
|
-
- **Return structured data**, never print to stdout -- the CLI wrapper decides how to format
|
|
246
|
-
- **Include a `warnings` array** in results when the function can detect non-fatal issues
|
|
247
|
-
- **Use `async` only when needed** (file I/O, network) -- synchronous logic stays synchronous
|
|
248
|
-
- **Throw typed errors** from `src/errors/types.ts` for unrecoverable failures
|
|
249
|
-
- **Keep modules focused** -- one concept per file. A pace calculator doesn't also validate outlines
|
|
250
|
-
- **Accept paths and options, not raw CLI strings** -- parsing belongs in the command wrapper
|
|
251
|
-
|
|
252
|
-
### Shared parsers
|
|
253
|
-
|
|
254
|
-
When two or more commands need to parse the same input format, extract a shared parser module. The parser returns a structured type that both consumers work with.
|
|
255
|
-
|
|
256
|
-
### Step 5: Implement CLI Command Wrappers
|
|
257
|
-
|
|
258
|
-
### Command wrapper pattern
|
|
259
|
-
|
|
260
|
-
Each CLI command lives in `src/cli/commands/<name>.ts` as a thin wrapper:
|
|
261
|
-
|
|
262
|
-
```typescript
|
|
263
|
-
// src/cli/commands/<name>.ts
|
|
264
|
-
import { doThing, type ThingOptions, type ThingResult } from '../../core/<name>.js';
|
|
265
|
-
|
|
266
|
-
export interface ThingCommandOptions extends ThingOptions {
|
|
267
|
-
json: boolean;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
export async function thingCommand(
|
|
271
|
-
options: ThingCommandOptions,
|
|
272
|
-
): Promise<ThingResult> {
|
|
273
|
-
return doThing({
|
|
274
|
-
param: options.param,
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
**Rules for command wrappers:**
|
|
280
|
-
- Import from core module using `.js` extension (ESM resolution)
|
|
281
|
-
- Extend the core options interface with `json: boolean`
|
|
282
|
-
- Delegate immediately to the core function -- no business logic in the wrapper
|
|
283
|
-
- Return the core result type -- formatting happens in `index.ts`
|
|
284
|
-
|
|
285
|
-
### Wiring into the CLI entry point
|
|
286
|
-
|
|
287
|
-
Add the command in `src/cli/index.ts`:
|
|
288
|
-
|
|
289
|
-
```typescript
|
|
290
|
-
import { thingCommand } from './commands/<name>.js';
|
|
291
|
-
|
|
292
|
-
program
|
|
293
|
-
.command('<name>')
|
|
294
|
-
.description('One-line description of what this does')
|
|
295
|
-
.argument('<required>', 'Description of required positional arg') // if needed
|
|
296
|
-
.requiredOption('--param <value>', 'Required option description') // if needed
|
|
297
|
-
.option('--json', 'Output as JSON', false)
|
|
298
|
-
.option('--optional <value>', 'Optional flag', 'default')
|
|
299
|
-
.action(async (positionalArg, options) => {
|
|
300
|
-
try {
|
|
301
|
-
const result = await thingCommand({
|
|
302
|
-
param: positionalArg,
|
|
303
|
-
json: options.json,
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
if (options.json) {
|
|
307
|
-
console.log(JSON.stringify(result, null, 2));
|
|
308
|
-
} else {
|
|
309
|
-
// Human-readable output using chalk
|
|
310
|
-
console.log();
|
|
311
|
-
console.log(chalk.bold('Title'));
|
|
312
|
-
for (const item of result.data) {
|
|
313
|
-
console.log(` ${item}`);
|
|
314
|
-
}
|
|
315
|
-
console.log();
|
|
316
|
-
}
|
|
317
|
-
} catch (error) {
|
|
318
|
-
handleError(error);
|
|
319
|
-
}
|
|
320
|
-
});
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
**Rules for CLI wiring:**
|
|
324
|
-
- Every command supports `--json` for structured agent consumption
|
|
325
|
-
- Human-readable output uses chalk for color and formatting
|
|
326
|
-
- Errors funnel through the shared `handleError()` function
|
|
327
|
-
- Use `.argument()` for required positional args, `.requiredOption()` for mandatory flags
|
|
328
|
-
- Parse string options to their real types (parseInt, parseFloat) in the action handler
|
|
329
|
-
- Comma-separated list options get `.split(',').map(s => s.trim())` in the action handler
|
|
330
|
-
|
|
331
|
-
### Updating exports
|
|
332
|
-
|
|
333
|
-
After adding a new core module, export its public API from `src/index.ts`:
|
|
334
|
-
|
|
335
|
-
```typescript
|
|
336
|
-
export { doThing } from './core/<name>.js';
|
|
337
|
-
export type { ThingOptions, ThingResult } from './core/<name>.js';
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
This allows the package to be consumed as a library, not just a CLI.
|
|
341
|
-
|
|
342
|
-
### Step 6: If Adding or Modifying Fragments
|
|
343
|
-
|
|
344
|
-
### Designing fragments
|
|
345
|
-
|
|
346
|
-
Fragments are reusable knowledge blocks stored in `skill/fragments/<category>/`. They are included in skill sources via include markers (`\{\{include:path\}\}`) and resolved at compile time.
|
|
347
|
-
|
|
348
|
-
**When to create a fragment:**
|
|
349
|
-
- The knowledge applies to 2+ skills (or likely will in the future)
|
|
350
|
-
- The content is self-contained and makes sense without its parent skill
|
|
351
|
-
- Updating the knowledge in one place should propagate everywhere
|
|
352
|
-
|
|
353
|
-
**When NOT to create a fragment:**
|
|
354
|
-
- The content is specific to exactly one skill and unlikely to be reused
|
|
355
|
-
- The content requires context from the surrounding skill to make sense
|
|
356
|
-
- The content is a single sentence or table row (too small to justify the indirection)
|
|
357
|
-
|
|
358
|
-
### Fragment categories
|
|
359
|
-
|
|
360
|
-
| Category | What goes here | Examples |
|
|
361
|
-
|----------|---------------|---------|
|
|
362
|
-
| `common/` | Rules and formats shared across all skills | Output format, guidelines, anti-patterns |
|
|
363
|
-
| `domain/` | Deep domain knowledge specific to the project's subject area | Pacing tables, narrative patterns, voice guides |
|
|
364
|
-
| `meta/` | Knowledge about the skill system itself | Architecture, patterns, workflows |
|
|
365
|
-
|
|
366
|
-
### Creating a fragment
|
|
367
|
-
|
|
368
|
-
1. **Create the file** at `skill/fragments/<category>/<name>.md`
|
|
369
|
-
- No YAML frontmatter -- fragments are pure content
|
|
370
|
-
- Write in the same imperative style as the parent skill
|
|
371
|
-
- Use markdown headers starting at `###` (they'll be nested inside the skill's `##` sections)
|
|
372
|
-
|
|
373
|
-
2. **Include it in the skill source** with an include marker: `\{\{include:<category>/<name>.md\}\}`
|
|
374
|
-
|
|
375
|
-
3. **Declare it in manifest.json** under the skill's `fragments` array -- the compiler cross-validates these declarations against actual includes and errors on mismatches
|
|
376
|
-
|
|
377
|
-
### Fragment rules
|
|
378
|
-
|
|
379
|
-
- **One level of includes only.** Fragments cannot include other fragments. This is enforced by the compiler.
|
|
380
|
-
- **No frontmatter.** Fragments are content blocks, not standalone documents.
|
|
381
|
-
- **Match the parent skill's voice.** If the skill uses imperative mood ("Do X"), the fragment should too.
|
|
382
|
-
- **Fragments are inlined verbatim.** The compiler replaces include markers with the fragment content, trimming trailing whitespace. No wrapping, no indentation changes.
|
|
383
|
-
- **Keep fragments focused.** A fragment about pacing shouldn't also cover narrative patterns. If they're separate concepts, they're separate fragments.
|
|
384
|
-
|
|
385
|
-
### Step 7: If Adding a New Skill
|
|
386
|
-
|
|
387
|
-
Create the skill source at `skill/skills/<name>/<name>.md` with this structure:
|
|
388
|
-
|
|
389
|
-
```markdown
|
|
390
|
-
---
|
|
391
|
-
name: <skill-name>
|
|
392
|
-
description: "One sentence explaining what this skill does and when to invoke it."
|
|
393
|
-
---
|
|
394
|
-
|
|
395
|
-
# Skill Title
|
|
396
|
-
|
|
397
|
-
Brief description of what this skill produces.
|
|
398
|
-
|
|
399
|
-
---
|
|
400
|
-
|
|
401
|
-
## Section Name
|
|
402
|
-
|
|
403
|
-
\{\{include:<category>/<fragment>.md\}\}
|
|
404
|
-
|
|
405
|
-
---
|
|
406
|
-
|
|
407
|
-
## Another Section
|
|
408
|
-
|
|
409
|
-
Direct content or more includes.
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
Then register it:
|
|
413
|
-
|
|
414
|
-
1. Add the skill entry to `skill/build/manifest.json` with its source path and fragment dependencies
|
|
415
|
-
2. Add the skill name to the `SKILLS` array in `install-local.sh`
|
|
416
|
-
3. Compile: `npm run compile`
|
|
417
|
-
|
|
418
|
-
### Step 8: If Renaming the Project
|
|
419
|
-
|
|
420
|
-
### Renaming a skill project
|
|
421
|
-
|
|
422
|
-
When the project, skill, or CLI needs a new name, update all touchpoints in one pass to avoid stale references. The rename affects three identity layers:
|
|
423
|
-
|
|
424
|
-
| Layer | Old example | New example |
|
|
425
|
-
|-------|-------------|-------------|
|
|
426
|
-
| npm package name | `presentation-creator` | `tech-demo-director` |
|
|
427
|
-
| CLI binary name | `presentation-util` | `demo-director` |
|
|
428
|
-
| Skill name + managed marker | `presentation-creator` | `tech-demo-director` |
|
|
429
|
-
|
|
430
|
-
### Rename checklist (in order)
|
|
431
|
-
|
|
432
|
-
1. **Skill source directory and file**
|
|
433
|
-
```bash
|
|
434
|
-
mv skill/skills/<old>/ skill/skills/<new>/
|
|
435
|
-
mv skill/skills/<new>/<old>.md skill/skills/<new>/<new>.md
|
|
436
|
-
```
|
|
437
|
-
|
|
438
|
-
2. **Skill source frontmatter** -- update `name:` and H1 title in the renamed .md
|
|
439
|
-
|
|
440
|
-
3. **Manifest** (`skill/build/manifest.json`) -- rename the skill key and `source` path
|
|
441
|
-
|
|
442
|
-
4. **Compiler marker** (`skill/build/compile.mjs`) -- update the `MANAGED_BY` constant
|
|
443
|
-
|
|
444
|
-
5. **Local installer** (`install-local.sh`) -- update `PROJECT_NAME`, `CLI_BIN_NAME`, `MANAGED_MARKER`, `SKILLS` array
|
|
445
|
-
|
|
446
|
-
6. **Bootstrap installer** (`install.sh`) -- update the default `PACKAGE_NAME`, then copy to `site/install.sh`
|
|
447
|
-
|
|
448
|
-
7. **Package metadata** (`package.json`) -- update `name`, `bin` key, and `description`
|
|
449
|
-
|
|
450
|
-
8. **CLI metadata** (`src/cli/index.ts`) -- update `.name()` and `.description()` calls
|
|
451
|
-
|
|
452
|
-
9. **README** -- update title, CLI references, project layout, npx examples, install URLs
|
|
453
|
-
|
|
454
|
-
10. **Landing page** (`site/index.html`) -- update title, CLI references, install commands, GitHub link
|
|
455
|
-
|
|
456
|
-
11. **GitHub Actions secrets** -- if the npm package name changed, verify `AGENT_NPM_TOKEN` still works for the new package scope
|
|
457
|
-
|
|
458
|
-
12. **Any docs** referencing the old name (translation-map, lessons-learned, etc.)
|
|
459
|
-
|
|
460
|
-
13. **Regenerate everything:**
|
|
461
|
-
```bash
|
|
462
|
-
rm -rf compiled
|
|
463
|
-
npm install # regenerates package-lock.json
|
|
464
|
-
npm run build # rebuilds TypeScript CLI
|
|
465
|
-
npm run compile # regenerates compiled/ under new paths
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
### Verification
|
|
469
|
-
|
|
470
|
-
After renaming, run this sweep to confirm no stale references remain:
|
|
471
|
-
|
|
472
|
-
```bash
|
|
473
|
-
grep -r "<old-name>" --include="*.md" --include="*.json" --include="*.mjs" --include="*.ts" --include="*.sh" --include="*.html" --include="*.yml" .
|
|
474
|
-
```
|
|
475
|
-
|
|
476
|
-
The grep should return zero results (excluding node_modules and dist).
|
|
477
|
-
|
|
478
|
-
### Step 9: Build, Compile, and Verify
|
|
479
|
-
|
|
480
|
-
After any change, run the full verification sequence:
|
|
481
|
-
|
|
482
|
-
```bash
|
|
483
|
-
npm run build # TypeScript CLI compiles cleanly
|
|
484
|
-
npm run compile # Skills compile to all 7 IDE targets
|
|
485
|
-
npm run compile:validate # Cross-validates manifest vs source includes
|
|
486
|
-
npx --yes agentic-skill-mill@latest --help # CLI command surface works via npx
|
|
487
|
-
```
|
|
488
|
-
|
|
489
|
-
If adding a new CLI command, also verify it runs:
|
|
490
|
-
|
|
491
|
-
```bash
|
|
492
|
-
npx --yes agentic-skill-mill@latest <command> --help # Options are correct
|
|
493
|
-
npx --yes agentic-skill-mill@latest <command> <args> # Human output works
|
|
494
|
-
npx --yes agentic-skill-mill@latest <command> --json # JSON output works
|
|
495
|
-
```
|
|
496
|
-
|
|
497
|
-
### Step 10: Commit
|
|
498
|
-
|
|
499
|
-
Use conventional commit format with a detailed body:
|
|
500
|
-
|
|
501
|
-
- `feat:` for new commands, skills, or fragments
|
|
502
|
-
- `refactor:` for renames or restructuring
|
|
503
|
-
- `fix:` for bug fixes
|
|
504
|
-
|
|
505
|
-
The commit body should list every file category changed (core modules, CLI wrappers, fragments, manifest, etc.) and what was done in each.
|
|
506
|
-
|
|
507
|
-
### Cross-Artifact Skill Signature
|
|
508
|
-
|
|
509
|
-
When updating or creating a skill, embed a deterministic signature in each externally searchable artifact so operators can query everything produced by that specific skill across systems.
|
|
510
|
-
|
|
511
|
-
Derive the signature per skill name:
|
|
512
|
-
|
|
513
|
-
- Compute `sha256("<skill-name>")`
|
|
514
|
-
- Use the first 8 lowercase hex characters
|
|
515
|
-
- Format as `skill-sig: <sig8>`
|
|
516
|
-
|
|
517
|
-
For a given skill name, the value is permanently static across all versions.
|
|
518
|
-
|
|
519
|
-
Example:
|
|
520
|
-
|
|
521
|
-
- `sha256("3pp-skill")` -> `ad61853a...`
|
|
522
|
-
- signature value: `skill-sig: ad61853a`
|
|
523
|
-
|
|
524
|
-
### Artifact Embedding Rules
|
|
525
|
-
|
|
526
|
-
- **Commit message body**: append a git trailer after a blank line: `Skill-Sig: <sig8>`
|
|
527
|
-
- **PR markdown doc**: append `<sub>skill-sig: <sig8></sub>` after the `## Notes` section
|
|
528
|
-
- **GUS HTML details**: append `<p style="font-size:0.8em;color:#888">skill-sig: <sig8></p>` before closing `</body></html>`
|
|
529
|
-
|
|
530
|
-
### Searchability Targets
|
|
531
|
-
|
|
532
|
-
- Git: `git log --grep="skill-sig: <sig8>"`
|
|
533
|
-
- GitHub: search for `"skill-sig: <sig8>"`
|
|
534
|
-
- GUS SOQL: `WHERE Details__c LIKE '%skill-sig: <sig8>%'`
|
|
535
|
-
|
|
536
|
-
---
|
|
537
|
-
|
|
538
|
-
## Anti-Patterns
|
|
539
|
-
|
|
540
|
-
- **Business logic in CLI wrappers.** Command wrappers delegate; they don't compute.
|
|
541
|
-
- **Console output in core modules.** Core modules return data; they don't print.
|
|
542
|
-
- **Fragments that include fragments.** Only one level of includes is supported.
|
|
543
|
-
- **Undeclared fragments.** Every include marker in a skill source must be declared in manifest.json. The compiler errors on mismatches.
|
|
544
|
-
- **Stale compiled outputs.** Always recompile after changing skills or fragments. Run `npm run compile:validate` to detect staleness.
|
|
545
|
-
- **Partial renames.** When renaming, update every touchpoint in one pass (see rename workflow). A grep sweep with zero results confirms completeness.
|
|
546
|
-
- **Missing --json support.** Every CLI command must support `--json` for structured agent consumption. Agents cannot parse chalk-colored terminal output.
|
|
547
|
-
- **Bare `return` in `set -e` scripts.** In `install-local.sh`, never write `[[ condition ]] || return` or `grep ... || return`. Bare `return` inherits the exit code of the failed test (1), which `set -e` treats as fatal -- killing the script silently. Always use `return 0` for early-exit guards: `[[ -d "$dir" ]] || return 0`, `[[ -z "$var" ]] && return 0`.
|