@slamb2k/mad-skills 2.0.6 → 2.0.8

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.
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "slamb2k",
3
+ "description": "Claude Code plugins by Simon Lamb",
4
+ "version": "2.0.8",
5
+ "owner": {
6
+ "name": "Simon Lamb",
7
+ "url": "https://github.com/slamb2k"
8
+ },
9
+ "plugins": [
10
+ {
11
+ "name": "mad-skills",
12
+ "description": "AI-assisted planning, development and governance tools",
13
+ "version": "2.0.8",
14
+ "author": {
15
+ "name": "slamb2k",
16
+ "url": "https://github.com/slamb2k"
17
+ },
18
+ "source": "./",
19
+ "category": "development",
20
+ "homepage": "https://github.com/slamb2k/mad-skills",
21
+ "tags": [
22
+ "planning",
23
+ "tdd",
24
+ "architecture",
25
+ "llm-review",
26
+ "implementation"
27
+ ]
28
+ }
29
+ ]
30
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "mad-skills",
3
+ "description": "AI-assisted planning, development and governance tools",
4
+ "version": "2.0.8",
5
+ "author": {
6
+ "name": "slamb2k",
7
+ "url": "https://github.com/slamb2k"
8
+ },
9
+ "repository": "https://github.com/slamb2k/mad-skills",
10
+ "license": "MIT",
11
+ "keywords": [
12
+ "planning",
13
+ "tdd",
14
+ "architecture",
15
+ "llm-review",
16
+ "implementation"
17
+ ]
18
+ }
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ![Mad Skills](assets/mad-skills.png)
4
4
 
5
- An npm-based skill framework for Claude Code. Ships 7 skills covering the full development lifecycle — from project initialization to shipping PRs.
5
+ A skill framework for Claude Code. Ships 8 skills covering the full development lifecycle — from project initialization to shipping PRs.
6
6
 
7
7
  ## Skills
8
8
 
@@ -14,33 +14,111 @@ An npm-based skill framework for Claude Code. Ships 7 skills covering the full d
14
14
  | **prime** | `/prime` | Load project context before feature work. Supports domain-specific context (security, routing, dashboard, etc.). |
15
15
  | **rig** | `/rig` | Bootstrap repos with lefthook hooks, commit templates, PR templates, and GitHub Actions workflows. Idempotent. |
16
16
  | **ship** | `/ship` | Full PR lifecycle — sync with main, create branch, commit, push, create PR, wait for CI, fix issues, squash merge, cleanup. |
17
+ | **speccy** | `/speccy` | Interview-driven specification builder. Reviews code/docs, interviews through targeted questions, produces structured specs. |
17
18
  | **sync** | `/sync` | Sync local repo with origin/main. Stashes changes, pulls, restores stash, cleans up stale branches. |
18
19
 
19
20
  ## Installation
20
21
 
22
+ Three methods are available. The table below shows what each delivers:
23
+
24
+ | | Plugin | npx skills | npm package |
25
+ |---|---|---|---|
26
+ | Skills (slash commands) | ✅ all 8 | ✅ all 8 | — |
27
+ | Agents (e.g. ship-analyzer) | ✅ | ❌ | — |
28
+ | Session hooks (session-guard) | ✅ | ❌ | — |
29
+ | Cross-agent (Cursor, Cline, etc.) | ❌ Claude Code only | ✅ | — |
30
+ | Selective skill install | ❌ | ✅ | — |
31
+ | Auto-updates | ✅ | ❌ | — |
32
+
33
+ ### Plugin (recommended)
34
+
35
+ ```
36
+ /plugin install mad-skills@slamb2k
37
+ ```
38
+
39
+ Installs skills, agents, and session hooks from the GitHub repo into `~/.claude/plugins/`. Updates automatically. Claude Code only.
40
+
41
+ > **First time setup — add the marketplace (one-time):**
42
+ >
43
+ > **Option A** — CLI (outside Claude Code):
44
+ > ```bash
45
+ > claude plugin marketplace add slamb2k/mad-skills
46
+ > ```
47
+ >
48
+ > **Option B** — Manual (add to `~/.claude/settings.json`):
49
+ > ```json
50
+ > "extraKnownMarketplaces": {
51
+ > "slamb2k": {
52
+ > "source": { "source": "github", "repo": "slamb2k/mad-skills" }
53
+ > }
54
+ > }
55
+ > ```
56
+ >
57
+ > Then install the plugin inside Claude Code with `/plugin install mad-skills@slamb2k`, or from the CLI with `claude plugin install mad-skills@slamb2k`.
58
+
59
+ ### npx skills
60
+
61
+ ```bash
62
+ npx skills add slamb2k/mad-skills -g -y # All skills, global
63
+ npx skills add slamb2k/mad-skills --skill ship -g -y # Specific skill
64
+ ```
65
+
66
+ Installs skills into `~/.claude/skills/` (and `~/.agents/skills/` for other agents). **Does not install agents or hooks.** This means:
67
+
68
+ - `/build` falls back to `general-purpose` agent for the ship stage instead of the optimised `ship-analyzer` agent
69
+ - The session-guard hook (CLAUDE.md staleness detection, git validation) is not active
70
+
71
+ Use this method when you need cross-agent compatibility (Cursor, Cline, Amp, etc.) or want to install individual skills.
72
+
73
+ > **Note for dotfiles users:** If `~/.claude/skills/` is symlinked from a dotfiles repo, `npx skills` will create broken relative symlinks. Replace the skills directory symlink with a real directory before installing. See [dotfiles compatibility](#dotfiles-compatibility) below.
74
+
75
+ ### npm package
76
+
77
+ The `@slamb2k/mad-skills` npm package is the **release artifact** — it is published on every merge to main and is used internally by the plugin system. It does not provide a CLI and cannot be used to install skills directly.
78
+
79
+ ### Invoke skills
80
+
81
+ After installation, invoke skills with `/<skill-name>` (e.g., `/ship`, `/sync`).
82
+
83
+ ### Upgrading from the old CLI (`npx @slamb2k/mad-skills`)
84
+
85
+ If you previously installed via the v2.0.x CLI, clean up stale artifacts first:
86
+
21
87
  ```bash
22
- # Install globally
23
- npm install -g @slamb2k/mad-skills
88
+ # Remove old command stubs
89
+ rm -f ~/.claude/commands/{brace,build,distil,prime,rig,ship,sync,speccy}.md
90
+
91
+ # Remove installer manifest and stale skill files
92
+ rm -f ~/.claude/.mad-skills-manifest.json
93
+ rm -f ~/.claude/skills/*/instructions.md
94
+ ```
95
+
96
+ Then install fresh using plugin or npx skills above.
97
+
98
+ ### Dotfiles compatibility
99
+
100
+ If you manage `~/.claude` via a dotfiles repo with symlinked subdirectories, `npx skills` creates relative symlinks that break when `~/.claude/skills/` is not physically located at `~/.claude/skills/`.
24
101
 
25
- # Or run directly with npx
26
- npx @slamb2k/mad-skills --list # List available skills
27
- npx @slamb2k/mad-skills # Install all skills
28
- npx @slamb2k/mad-skills --skill ship,sync # Install specific skills
102
+ **Fix:** ensure `~/.claude/skills/` is a real directory (not a symlink), and do not re-symlink it from dotfiles. For custom/local skills you want in dotfiles, use per-skill absolute symlinks in your install script:
103
+
104
+ ```bash
105
+ ln -sfn "$DOTFILES_DIR/skills/my-skill" "$HOME/.claude/skills/my-skill"
29
106
  ```
30
107
 
31
- Skills are installed as slash commands in your Claude Code environment. After installation, invoke them with `/<skill-name>` (e.g., `/ship`, `/sync`).
108
+ `npx skills` will leave entries it did not create untouched.
32
109
 
33
110
  ## Repository Structure
34
111
 
35
112
  ```
36
113
  mad-skills/
37
- ├── skills/ # Skill definitions (7 skills)
114
+ ├── skills/ # Skill definitions (8 skills)
38
115
  │ ├── build/
39
116
  │ ├── brace/
40
117
  │ ├── distil/
41
118
  │ ├── prime/
42
119
  │ ├── rig/
43
120
  │ ├── ship/
121
+ │ ├── speccy/
44
122
  │ └── sync/
45
123
  ├── scripts/ # Build and CI tooling
46
124
  │ ├── validate-skills.js # Structural validation
@@ -48,10 +126,7 @@ mad-skills/
48
126
  │ ├── run-evals.js # Eval runner (Anthropic/OpenRouter)
49
127
  │ ├── build-manifests.js # Generate skills/manifest.json
50
128
  │ └── package-skills.js # Package .skill archives
51
- ├── src/
52
- │ └── cli.js # npx installer CLI
53
- ├── commands/ # Slash command stubs
54
- ├── hooks/ # Session hooks (session-guard)
129
+ ├── hooks/ # Session hooks + plugin hook config
55
130
  ├── agents/ # Agent definitions (ship-analyzer)
56
131
  ├── tests/results/ # Eval output
57
132
  ├── archive/ # Legacy skills (v1.x)
@@ -69,8 +144,7 @@ Each skill in `skills/<name>/` follows a standard layout:
69
144
 
70
145
  ```
71
146
  skills/<name>/
72
- ├── SKILL.md # Frontmatter (name, description) + banner
73
- ├── instructions.md # Execution logic (max 500 lines)
147
+ ├── SKILL.md # Frontmatter + banner + execution logic (single file)
74
148
  ├── references/ # Extracted prompts, contracts, guides
75
149
  ├── assets/ # Static files (templates, components)
76
150
  └── tests/
@@ -109,20 +183,22 @@ npm test # validate + lint + eval
109
183
  - Detects which skills changed and posts eval results as PR comments
110
184
 
111
185
  **Release pipeline** (`.github/workflows/release.yml`):
112
- - Triggers on push to main
113
- - Validates, lints, runs evals, builds manifests
114
- - Creates version tag from package.json, publishes to npm with provenance
186
+ - Phase 1: Triggers on push to main, validates, bumps patch version, creates auto-merge PR
187
+ - Phase 2: When version bump merges, creates tag, publishes to npm with provenance
115
188
  - Builds `.skill` packages and creates a GitHub Release
116
- - Skips publish if the version tag already exists
117
189
 
118
190
  ## Archive
119
191
 
120
- Legacy skills from v1.x are preserved in `archive/` for reference:
121
- - play-tight (Browser Automation)
122
- - pixel-pusher (UI/UX Design)
123
- - cyberarian (Document Lifecycle Management)
124
- - start-right (Repository Scaffolding)
125
- - graphite-skill (Git/Graphite Workflows)
192
+ The `archive/` folder contains **inactive** skills, agents, hooks, and other assets from previous versions. These are kept for historical reference only — they are **not part of the mad-skills release**, not published to npm, not installed by `npx skills`, and not supported.
193
+
194
+ | Name | Description |
195
+ |------|-------------|
196
+ | play-tight | Browser Automation (v1.x) |
197
+ | pixel-pusher | UI/UX Design (v1.x) |
198
+ | cyberarian | Document Lifecycle Management (v1.x) |
199
+ | start-right | Repository Scaffolding (v1.x) |
200
+ | graphite-skill | Git/Graphite Workflows (v1.x) |
201
+ | example-skill | Scaffold template for new skills |
126
202
 
127
203
  ## License
128
204
 
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: ship-analyzer
3
+ description: >
4
+ Analyzes working tree changes, creates semantic commits with well-crafted messages,
5
+ pushes to a feature branch, and creates a detailed pull request. Use this agent for
6
+ the commit+push+PR phase of shipping code. It reads diffs and source files to
7
+ understand what changed and why, producing high-quality commit messages and PR
8
+ descriptions that a Bash-only agent cannot.
9
+ model: sonnet
10
+ ---
11
+
12
+ You are a senior engineer responsible for crafting high-quality git commits and pull requests. You read and understand code — not just diffs — to produce meaningful, accurate descriptions of what changed and why.
13
+
14
+ ## Core Principles
15
+
16
+ 1. **Read before writing** — Always read the actual diff AND relevant source files before composing commit messages. Never guess at intent from filenames alone.
17
+ 2. **Semantic grouping** — Group related changes into logical commits. A "logical group" shares a single purpose (e.g., all security changes together, all test updates together).
18
+ 3. **Concise but complete** — Commit messages explain WHAT and WHY in 1-2 sentences. PR descriptions give the full picture.
19
+ 4. **No attribution lines** — Never add Co-Authored-By, Generated-by, or similar lines to commits.
20
+
21
+ ## Commit Message Format
22
+
23
+ ```
24
+ <type>(<scope>): <imperative description>
25
+
26
+ <optional body: what changed and why, wrapped at 72 chars>
27
+ ```
28
+
29
+ Types: `feat`, `fix`, `refactor`, `docs`, `chore`, `test`, `perf`
30
+
31
+ Examples of GOOD messages:
32
+ - `feat(auth): replace pairing gate with channel allowlist`
33
+ - `fix(memory): correct positional arg order in get_recent_commitments`
34
+ - `refactor(workspace): collapse per-user directories to single workspace`
35
+ - `test(commitments): update calls for keyword-arg signatures`
36
+
37
+ Examples of BAD messages:
38
+ - `update files` (too vague)
39
+ - `feat: changes to auth system` (no scope, vague description)
40
+ - `fix various issues across the codebase` (multiple concerns in one)
41
+
42
+ ## PR Description Format
43
+
44
+ ```markdown
45
+ ## Summary
46
+ <1-3 sentences: what this PR accomplishes and why>
47
+
48
+ ## Changes
49
+ <bullet list of key changes, grouped logically>
50
+
51
+ ## Testing
52
+ - [ ] <specific verification steps>
53
+ ```
54
+
55
+ Keep the PR title under 72 characters. Use the same `<type>: <description>` format.
56
+
57
+ ## Workflow
58
+
59
+ When given a set of files to ship:
60
+
61
+ 1. **Understand the changes**
62
+ - Run `git diff` and `git diff --cached` to see all changes
63
+ - Read source files where the diff alone doesn't explain intent
64
+ - Identify the logical groupings
65
+
66
+ 2. **Create branch** (if on main)
67
+ - Derive a semantic branch name from the changes: `feature/`, `fix/`, `refactor/`, `docs/`, `chore/`
68
+
69
+ 3. **Commit in logical groups**
70
+ - Stage specific files per group with `git add <files>`
71
+ - Write a commit message using the format above
72
+ - Use HEREDOC for multi-line messages
73
+
74
+ 4. **Push**
75
+ - `git push -u origin <branch>`
76
+
77
+ 5. **Create PR**
78
+ - Read the full diff against main to write the PR description
79
+ - Detect platform from remote URL (github.com → GitHub, dev.azure.com/visualstudio.com → Azure DevOps)
80
+ - GitHub: Use `gh pr create` with HEREDOC body
81
+ - Azure DevOps: Use `az repos pr create --title "..." --description "..." --source-branch <branch> --target-branch <default> --output json`
82
+
83
+ 6. **Report results** in the structured format requested by the caller
84
+
85
+ ## Important Rules
86
+
87
+ - If the caller specifies which files to include, respect that exactly — do not add extra files
88
+ - If the caller provides context about the changes (e.g., "single-tenant simplification"), use that to inform your descriptions
89
+ - When changes span many files, prioritize reading the most impactful diffs (source > tests > config)
90
+ - Use `git add -p` when only some hunks in a file should be in a given commit
91
+ - Always verify the branch pushed successfully before creating the PR
@@ -0,0 +1,18 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "type": "command",
6
+ "command": "./hooks/session-guard.sh",
7
+ "timeout": 30000
8
+ }
9
+ ],
10
+ "UserPromptSubmit": [
11
+ {
12
+ "type": "command",
13
+ "command": "./hooks/session-guard-prompt.sh",
14
+ "timeout": 10000
15
+ }
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env bash
2
+ # session-guard-prompt.sh — UserPromptSubmit companion hook for session-guard
3
+ #
4
+ # Checks if session-guard.sh left a pending context file from SessionStart.
5
+ # If found, re-emits the context as additionalContext on the first user prompt,
6
+ # then deletes the flag file so it only fires once.
7
+ #
8
+ # This works around the known limitation where SessionStart hook output is
9
+ # silently injected and may not surface until after the first prompt is
10
+ # already processed (see anthropics/claude-code#10808).
11
+ #
12
+ # Install globally in ~/.claude/settings.json:
13
+ # "command": "\"$HOME\"/.claude/hooks/session-guard-prompt.sh"
14
+ #
15
+ # Or per-project in .claude/settings.json:
16
+ # "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/session-guard-prompt.sh"
17
+
18
+ set -uo pipefail
19
+
20
+ PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(pwd)}"
21
+ PENDING_DIR="${TMPDIR:-/tmp}/claude-session-guard"
22
+ GUARD_KEY=$(echo "$PROJECT_DIR" | md5sum 2>/dev/null | cut -d' ' -f1 || echo "default")
23
+ PENDING_FILE="$PENDING_DIR/$GUARD_KEY.pending"
24
+
25
+ # No pending file — fast exit
26
+ if [[ ! -f "$PENDING_FILE" ]]; then
27
+ jq -n '{}'
28
+ exit 0
29
+ fi
30
+
31
+ CONTEXT=$(cat "$PENDING_FILE")
32
+ rm -f "$PENDING_FILE"
33
+
34
+ # Also clean up the dedup lock from session-guard.sh
35
+ rm -f "$PENDING_DIR/$GUARD_KEY.lock"
36
+
37
+ # Skip re-emit if session-guard found no issues (just the ✅ line, no warnings)
38
+ if [[ $(echo "$CONTEXT" | grep -c '⚠️\|ℹ️') -eq 0 ]]; then
39
+ jq -n '{}'
40
+ exit 0
41
+ fi
42
+
43
+ WRAPPED=$(cat <<EOF
44
+ [SESSION GUARD — FIRST PROMPT REMINDER]
45
+ The following was detected at session start. Act on these items NOW using
46
+ AskUserQuestion BEFORE proceeding with the user's request.
47
+
48
+ $CONTEXT
49
+ EOF
50
+ )
51
+
52
+ jq -n --arg ctx "$WRAPPED" '{
53
+ hookSpecificOutput: {
54
+ hookEventName: "UserPromptSubmit",
55
+ additionalContext: $ctx
56
+ }
57
+ }'
58
+
59
+ exit 0