mustard-claude 3.0.2 → 3.0.4
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/bin/mustard.js +0 -0
- package/dist/commands/init.js +53 -11
- package/dist/commands/init.js.map +1 -1
- package/package.json +59 -59
- package/templates/.claude/commands/guards.md +76 -0
- package/templates/.claude/commands/notes.md +22 -0
- package/templates/.claude/commands/patterns.md +173 -0
- package/templates/.claude/commands/recipes.md +91 -0
- package/templates/.claude/commands/stack.md +86 -0
- package/templates/.claude/skills/templates-command-authoring/SKILL.md +90 -0
- package/templates/.claude/skills/templates-command-authoring/references/examples.md +83 -0
- package/templates/.claude/skills/templates-hook-protocol/SKILL.md +73 -0
- package/templates/.claude/skills/templates-hook-protocol/references/examples.md +74 -0
- package/templates/.claude/skills/templates-settings-wiring/SKILL.md +75 -0
- package/templates/.claude/skills/templates-settings-wiring/references/examples.md +59 -0
- package/templates/.claude/skills/templates-skill-authoring/SKILL.md +97 -0
- package/templates/.claude/skills/templates-skill-authoring/references/examples.md +69 -0
- package/templates/.claude/skills/templates-sync-detect/SKILL.md +62 -0
- package/templates/.claude/skills/templates-sync-detect/references/examples.md +55 -0
- package/templates/CLAUDE.md +47 -0
- package/templates/commands/mustard/git/SKILL.md +9 -22
- package/templates/commands/mustard/review/SKILL.md +104 -0
- package/templates/hooks/__tests__/package.json +1 -0
- package/templates/hooks/package.json +1 -0
- package/templates/scripts/sync-detect.js +24 -6
- package/templates/settings.json +10 -10
package/bin/mustard.js
CHANGED
|
File without changes
|
package/dist/commands/init.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { existsSync, readdirSync } from 'fs';
|
|
1
|
+
import { existsSync, readdirSync, readFileSync } from 'fs';
|
|
2
2
|
import { mkdir, copyFile, cp, writeFile } from 'fs/promises';
|
|
3
3
|
import { join, resolve, dirname } from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { execSync } from 'child_process';
|
|
6
|
+
import { homedir } from 'os';
|
|
6
7
|
import chalk from 'chalk';
|
|
7
8
|
import ora from 'ora';
|
|
8
9
|
import inquirer from 'inquirer';
|
|
@@ -51,6 +52,7 @@ export async function initCommand(options) {
|
|
|
51
52
|
const spinner = ora('Copying templates...').start();
|
|
52
53
|
const count = await copyDir(templatesDir, claudePath, false);
|
|
53
54
|
spinner.succeed(`Copied ${count} new files (existing files preserved)`);
|
|
55
|
+
await ensureGlobalPermissions();
|
|
54
56
|
printNextSteps();
|
|
55
57
|
return;
|
|
56
58
|
}
|
|
@@ -86,6 +88,7 @@ export async function initCommand(options) {
|
|
|
86
88
|
const spinner = ora('Merging templates...').start();
|
|
87
89
|
const count = await copyDir(templatesDir, claudePath, false);
|
|
88
90
|
spinner.succeed(`Copied ${count} new files (existing files preserved)`);
|
|
91
|
+
await ensureGlobalPermissions();
|
|
89
92
|
printNextSteps();
|
|
90
93
|
return;
|
|
91
94
|
}
|
|
@@ -102,6 +105,8 @@ export async function initCommand(options) {
|
|
|
102
105
|
count; // already counted
|
|
103
106
|
}
|
|
104
107
|
spinner.succeed(`Copied ${count} files to .claude/`);
|
|
108
|
+
// Ensure global permissions for Claude Code (Read, Write, Edit)
|
|
109
|
+
await ensureGlobalPermissions();
|
|
105
110
|
// Generate mustard.json (git flow config)
|
|
106
111
|
await generateMustardJson(projectPath, options);
|
|
107
112
|
printNextSteps();
|
|
@@ -178,7 +183,7 @@ async function generateMustardJson(projectPath, options) {
|
|
|
178
183
|
config = {
|
|
179
184
|
git: {
|
|
180
185
|
flow,
|
|
181
|
-
|
|
186
|
+
provider: 'github',
|
|
182
187
|
submodules: hasSubmodules
|
|
183
188
|
}
|
|
184
189
|
};
|
|
@@ -205,19 +210,12 @@ async function generateMustardJson(projectPath, options) {
|
|
|
205
210
|
default: 'dev_*',
|
|
206
211
|
when: (a) => !!a.devBranch
|
|
207
212
|
},
|
|
208
|
-
{
|
|
209
|
-
type: 'confirm',
|
|
210
|
-
name: 'prEnabled',
|
|
211
|
-
message: 'Use Pull Requests for merging?',
|
|
212
|
-
default: true
|
|
213
|
-
},
|
|
214
213
|
{
|
|
215
214
|
type: 'list',
|
|
216
215
|
name: 'provider',
|
|
217
216
|
message: 'Git provider:',
|
|
218
217
|
choices: ['github', 'gitlab', 'bitbucket'],
|
|
219
|
-
default: 'github'
|
|
220
|
-
when: (a) => a.prEnabled
|
|
218
|
+
default: 'github'
|
|
221
219
|
}
|
|
222
220
|
]);
|
|
223
221
|
const flow = {};
|
|
@@ -230,7 +228,7 @@ async function generateMustardJson(projectPath, options) {
|
|
|
230
228
|
config = {
|
|
231
229
|
git: {
|
|
232
230
|
flow,
|
|
233
|
-
|
|
231
|
+
provider: answers.provider || 'github',
|
|
234
232
|
submodules: hasSubmodules
|
|
235
233
|
}
|
|
236
234
|
};
|
|
@@ -239,6 +237,50 @@ async function generateMustardJson(projectPath, options) {
|
|
|
239
237
|
await writeFile(configPath, JSON.stringify(config, null, 2) + '\n');
|
|
240
238
|
spinner.succeed('Created mustard.json');
|
|
241
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* Ensure ~/.claude/settings.json has Read, Write, Edit in allow list.
|
|
242
|
+
* Non-destructive: only adds missing permissions, preserves everything else.
|
|
243
|
+
*/
|
|
244
|
+
async function ensureGlobalPermissions() {
|
|
245
|
+
const claudeDir = join(homedir(), '.claude');
|
|
246
|
+
const settingsPath = join(claudeDir, 'settings.json');
|
|
247
|
+
const requiredPerms = ['Read', 'Write', 'Edit'];
|
|
248
|
+
let settings = {};
|
|
249
|
+
if (existsSync(settingsPath)) {
|
|
250
|
+
try {
|
|
251
|
+
settings = JSON.parse(readFileSync(settingsPath, 'utf-8'));
|
|
252
|
+
}
|
|
253
|
+
catch {
|
|
254
|
+
// Malformed JSON — start fresh but warn
|
|
255
|
+
console.log(chalk.yellow(' ⚠️ ~/.claude/settings.json is malformed — recreating permissions section'));
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (!settings.permissions)
|
|
259
|
+
settings.permissions = {};
|
|
260
|
+
if (!Array.isArray(settings.permissions.allow))
|
|
261
|
+
settings.permissions.allow = [];
|
|
262
|
+
const allow = settings.permissions.allow;
|
|
263
|
+
const added = [];
|
|
264
|
+
for (const perm of requiredPerms) {
|
|
265
|
+
// Check if already has a generic allow (e.g. "Write") or path-specific (e.g. "Write(//c/**)")
|
|
266
|
+
const hasGeneric = allow.includes(perm);
|
|
267
|
+
if (!hasGeneric) {
|
|
268
|
+
// Remove path-specific versions since we're adding the generic one
|
|
269
|
+
const filtered = allow.filter(p => !p.startsWith(`${perm}(`));
|
|
270
|
+
settings.permissions.allow = filtered;
|
|
271
|
+
settings.permissions.allow.push(perm);
|
|
272
|
+
added.push(perm);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
if (added.length > 0) {
|
|
276
|
+
await mkdir(claudeDir, { recursive: true });
|
|
277
|
+
await writeFile(settingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
278
|
+
console.log(chalk.green(` ✓ Global permissions: added ${added.join(', ')} to ~/.claude/settings.json`));
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
console.log(chalk.gray(' Global permissions: Read, Write, Edit already configured'));
|
|
282
|
+
}
|
|
283
|
+
}
|
|
242
284
|
function printNextSteps() {
|
|
243
285
|
console.log(chalk.green.bold('\n✅ Done!\n'));
|
|
244
286
|
console.log(chalk.white('Next: open Claude Code and run /scan to analyze your codebase.\n'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAY,MAAM,IAAI,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAU,EAAE,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE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-claude",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "Framework-agnostic CLI for Claude Code project setup",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"mustard": "./bin/mustard.js"
|
|
8
|
-
},
|
|
9
|
-
"main": "dist/cli.js",
|
|
10
|
-
"types": "dist/cli.d.ts",
|
|
11
|
-
"files": [
|
|
12
|
-
"bin/",
|
|
13
|
-
"dist/",
|
|
14
|
-
"templates/"
|
|
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
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "mustard-claude",
|
|
3
|
+
"version": "3.0.4",
|
|
4
|
+
"description": "Framework-agnostic CLI for Claude Code project setup",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"mustard": "./bin/mustard.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/cli.js",
|
|
10
|
+
"types": "dist/cli.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"bin/",
|
|
13
|
+
"dist/",
|
|
14
|
+
"templates/"
|
|
15
|
+
],
|
|
16
|
+
"keywords": [
|
|
17
|
+
"claude",
|
|
18
|
+
"claude-code",
|
|
19
|
+
"ai",
|
|
20
|
+
"cli",
|
|
21
|
+
"scaffold"
|
|
22
|
+
],
|
|
23
|
+
"author": "Competi",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/Competi/mustard.git"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/Competi/mustard#readme",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/Competi/mustard/issues"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"chalk": "^5.3.0",
|
|
38
|
+
"commander": "^12.1.0",
|
|
39
|
+
"inquirer": "^9.2.15",
|
|
40
|
+
"ora": "^8.0.1"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18.0.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/inquirer": "^9.0.9",
|
|
47
|
+
"@types/node": "^25.2.1",
|
|
48
|
+
"rimraf": "^6.1.2",
|
|
49
|
+
"typescript": "^5.9.3"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"start": "node bin/mustard.js",
|
|
53
|
+
"build": "tsc",
|
|
54
|
+
"clean": "rimraf dist",
|
|
55
|
+
"typecheck": "tsc --noEmit",
|
|
56
|
+
"test": "node --test",
|
|
57
|
+
"release": "npm version patch && npm run build && npm publish"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<!-- mustard:generated at:2026-03-25T00:00:00.000Z role:general -->
|
|
2
|
+
# Guards: Templates
|
|
3
|
+
|
|
4
|
+
> DO/DON'T rules for the Mustard templates subproject.
|
|
5
|
+
|
|
6
|
+
## Hook Development
|
|
7
|
+
|
|
8
|
+
| Rule | Type |
|
|
9
|
+
|------|------|
|
|
10
|
+
| DO read all stdin before processing (`on('end', ...)`) | DO |
|
|
11
|
+
| DO fail-open: `catch → stderr + exit(0)` | DO |
|
|
12
|
+
| DO normalize Windows paths (`\` to `/`) before pattern matching | DO |
|
|
13
|
+
| DO use `process.exit(0)` for approve (silent exit) | DO |
|
|
14
|
+
| DO write JSON to stdout for block/deny/context responses | DO |
|
|
15
|
+
| DON'T use any npm dependencies — only Node.js built-ins | DON'T |
|
|
16
|
+
| DON'T throw unhandled exceptions — always wrap in try/catch | DON'T |
|
|
17
|
+
| DON'T block on parse errors — treat as approve | DON'T |
|
|
18
|
+
| DON'T use `console.log` for debugging — use `process.stderr.write` | DON'T |
|
|
19
|
+
|
|
20
|
+
## Hook Response Protocol
|
|
21
|
+
|
|
22
|
+
| Rule | Type |
|
|
23
|
+
|------|------|
|
|
24
|
+
| DO use `permissionDecision: 'block'` or `'deny'` for PreToolUse hooks | DO |
|
|
25
|
+
| DO use `decision: 'approve'` or `'block'` for PostToolUse hooks | DO |
|
|
26
|
+
| DO include `hookEventName` matching the hook's lifecycle event | DO |
|
|
27
|
+
| DON'T mix PreToolUse and PostToolUse response formats | DON'T |
|
|
28
|
+
|
|
29
|
+
## Settings & Wiring
|
|
30
|
+
|
|
31
|
+
| Rule | Type |
|
|
32
|
+
|------|------|
|
|
33
|
+
| DO register every new hook in `settings.json` under the correct lifecycle event | DO |
|
|
34
|
+
| DO set a `timeout` for every hook registration (3-15 seconds) | DO |
|
|
35
|
+
| DO use `$CLAUDE_PROJECT_DIR` in hook command paths | DO |
|
|
36
|
+
| DON'T add hooks without a `matcher` — every hook must declare what it matches | DON'T |
|
|
37
|
+
|
|
38
|
+
## Commands (SKILL.md)
|
|
39
|
+
|
|
40
|
+
| Rule | Type |
|
|
41
|
+
|------|------|
|
|
42
|
+
| DO end every command SKILL.md with `ULTRATHINK` | DO |
|
|
43
|
+
| DO include `## Trigger` with exact invocation syntax | DO |
|
|
44
|
+
| DO include `## Rules` section with explicit constraints | DO |
|
|
45
|
+
| DON'T create commands that implement code directly — delegate via Task | DON'T |
|
|
46
|
+
|
|
47
|
+
## Scripts
|
|
48
|
+
|
|
49
|
+
| Rule | Type |
|
|
50
|
+
|------|------|
|
|
51
|
+
| DO use `execSync` with `stdio: ['pipe','pipe','pipe']` and `windowsHide: true` | DO |
|
|
52
|
+
| DO set timeouts on all `execSync` calls | DO |
|
|
53
|
+
| DO handle missing files/dirs gracefully (try/catch around fs ops) | DO |
|
|
54
|
+
| DON'T import external packages — all scripts must be self-contained | DON'T |
|
|
55
|
+
|
|
56
|
+
## Skills (SKILL.md)
|
|
57
|
+
|
|
58
|
+
| Rule | Type |
|
|
59
|
+
|------|------|
|
|
60
|
+
| DO include YAML frontmatter with `name` and `description` | DO |
|
|
61
|
+
| DO write "pushy" descriptions with casual trigger phrases | DO |
|
|
62
|
+
| DO add `<!-- mustard:generated -->` after the closing `---` | DO |
|
|
63
|
+
| DO keep SKILL.md under 500 lines (ideally under 200) | DO |
|
|
64
|
+
| DON'T put `<!-- mustard:generated -->` before the opening `---` | DON'T |
|
|
65
|
+
| DON'T use generic descriptions — be specific about what and when | DON'T |
|
|
66
|
+
|
|
67
|
+
## Generated Files
|
|
68
|
+
|
|
69
|
+
| Rule | Type |
|
|
70
|
+
|------|------|
|
|
71
|
+
| DO start every generated file with `<!-- mustard:generated at:{ISO} role:{role} -->` | DO |
|
|
72
|
+
| DO include H1 title + blockquote description | DO |
|
|
73
|
+
| DO keep under 200 lines per file | DO |
|
|
74
|
+
| DO reference real files with `Ref: path/file.ext` | DO |
|
|
75
|
+
| DON'T include generic information — only data traced from real code | DON'T |
|
|
76
|
+
| DON'T overwrite files without `<!-- mustard:generated` header (manual files) | DON'T |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Notes: Templates (General)
|
|
2
|
+
|
|
3
|
+
> Manual notes for the Mustard templates subproject. Never overwritten by /scan.
|
|
4
|
+
|
|
5
|
+
## Mandatory Patterns
|
|
6
|
+
|
|
7
|
+
- All hooks read JSON from stdin and write JSON to stdout
|
|
8
|
+
- All hooks fail-open (exit 0 on error) except when explicitly blocking
|
|
9
|
+
- All generated files start with `<!-- mustard:generated -->` header
|
|
10
|
+
- Skills use YAML frontmatter with `name` and `description` fields
|
|
11
|
+
|
|
12
|
+
## Known Pitfalls
|
|
13
|
+
|
|
14
|
+
- Hook stdin must be fully consumed before processing (`on('end', ...)`)
|
|
15
|
+
- Windows path separators must be normalized (`\` to `/`) in file-guard and guard-verify
|
|
16
|
+
- CLAUDE_PROJECT_DIR env var may not be set in all contexts — always fallback to cwd
|
|
17
|
+
|
|
18
|
+
## Observations
|
|
19
|
+
|
|
20
|
+
- Templates are copied verbatim to target projects by `mustard init`/`mustard update`
|
|
21
|
+
- The `settings.json` defines the full hook wiring — any new hook must be registered there
|
|
22
|
+
- Skills in `skills/` are foundation skills (stack-agnostic); subproject-specific skills go in `{sub}/.claude/skills/`
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<!-- mustard:generated at:2026-03-25T00:00:00.000Z role:general -->
|
|
2
|
+
# Patterns: Templates
|
|
3
|
+
|
|
4
|
+
> Recurring code patterns across hooks, scripts, and commands.
|
|
5
|
+
|
|
6
|
+
## P1. Hook Stdin/Stdout Protocol
|
|
7
|
+
|
|
8
|
+
All hooks read JSON from stdin, process, and either exit silently (approve) or write JSON to stdout (block/deny/context).
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
let input = '';
|
|
12
|
+
process.stdin.setEncoding('utf8');
|
|
13
|
+
process.stdin.on('data', chunk => input += chunk);
|
|
14
|
+
process.stdin.on('end', () => {
|
|
15
|
+
const data = JSON.parse(input);
|
|
16
|
+
// ... process
|
|
17
|
+
process.exit(0); // approve (silent)
|
|
18
|
+
});
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Ref: `hooks/bash-safety.js`, `hooks/file-guard.js`, `hooks/enforce-registry.js`
|
|
22
|
+
|
|
23
|
+
## P2. PreToolUse Block Response
|
|
24
|
+
|
|
25
|
+
Hooks that block return a specific JSON structure with `permissionDecision`:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
console.log(JSON.stringify({
|
|
29
|
+
hookSpecificOutput: {
|
|
30
|
+
hookEventName: 'PreToolUse',
|
|
31
|
+
permissionDecision: 'block', // or 'deny'
|
|
32
|
+
permissionDecisionReason: 'Reason message'
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Ref: `hooks/enforce-registry.js` (line 100-109), `hooks/bash-safety.js` (line 44-49)
|
|
38
|
+
|
|
39
|
+
## P3. PostToolUse Approve/Block Response
|
|
40
|
+
|
|
41
|
+
PostToolUse hooks use `decision` field (not `permissionDecision`):
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
process.stdout.write(JSON.stringify({ decision: 'approve' }));
|
|
45
|
+
// or
|
|
46
|
+
process.stdout.write(JSON.stringify({ decision: 'block', reason: '...' }));
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Ref: `hooks/guard-verify.js` (line 60-95)
|
|
50
|
+
|
|
51
|
+
## P4. Fail-Open Error Handling
|
|
52
|
+
|
|
53
|
+
Every hook wraps the main logic in try/catch and exits 0 on error — never blocking due to hook bugs:
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
} catch (err) {
|
|
57
|
+
process.stderr.write(`[hook-name] Error: ${err.message}\n`);
|
|
58
|
+
process.exit(0); // fail-open
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Ref: `hooks/bash-safety.js` (line 56-59), `hooks/file-guard.js` (line 57-60)
|
|
63
|
+
|
|
64
|
+
## P5. Regex-Based Dangerous Command Detection
|
|
65
|
+
|
|
66
|
+
`bash-safety.js` uses an array of `{ re, msg }` objects tested sequentially against the command string:
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
const DANGEROUS = [
|
|
70
|
+
{ re: /\brm\s+(-\w*r\w*f|...)\b/i, msg: 'Recursive force delete blocked' },
|
|
71
|
+
// ...
|
|
72
|
+
];
|
|
73
|
+
for (const { re, msg } of DANGEROUS) {
|
|
74
|
+
if (re.test(cmd)) { /* deny */ }
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Ref: `hooks/bash-safety.js` (line 14-28)
|
|
79
|
+
|
|
80
|
+
## P6. File Pattern Blocking
|
|
81
|
+
|
|
82
|
+
`file-guard.js` blocks access to sensitive files using regex patterns tested against both full path and basename:
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
const BLOCKED_PATTERNS = [/credentials/i, /\.pem$/i, /\.key$/i, ...];
|
|
86
|
+
for (const pattern of BLOCKED_PATTERNS) {
|
|
87
|
+
if (pattern.test(normalized) || pattern.test(basename)) { /* deny */ }
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Ref: `hooks/file-guard.js` (line 16-25)
|
|
92
|
+
|
|
93
|
+
## P7. Role Detection via Scoring
|
|
94
|
+
|
|
95
|
+
`sync-detect.js` assigns numeric weights (HIGH=10, MEDIUM=5, LOW=3) to file/dep signals, accumulating scores per role. Highest score wins:
|
|
96
|
+
|
|
97
|
+
| Weight | Signal Type | Example |
|
|
98
|
+
|--------|------------|---------|
|
|
99
|
+
| HIGH (10) | Config files | `.csproj` with Sdk.Web, `next.config.*` |
|
|
100
|
+
| MEDIUM (5) | Package deps | `react` in package.json, `express` |
|
|
101
|
+
| LOW (3) | Directories | `Controllers/`, `app/` + `components/` |
|
|
102
|
+
|
|
103
|
+
Ref: `scripts/sync-detect.js` (line 210-327)
|
|
104
|
+
|
|
105
|
+
## P8. SHA-256 Source Hashing for Incremental Scan
|
|
106
|
+
|
|
107
|
+
`sync-detect.js` computes deterministic hashes by sorting files and updating hash with both path and content:
|
|
108
|
+
|
|
109
|
+
```js
|
|
110
|
+
const hash = crypto.createHash('sha256');
|
|
111
|
+
for (const file of files.sort()) {
|
|
112
|
+
hash.update(file); // path (rename-sensitive)
|
|
113
|
+
hash.update(content); // content
|
|
114
|
+
}
|
|
115
|
+
return hash.digest('hex');
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Ref: `scripts/sync-detect.js` (line 643-659)
|
|
119
|
+
|
|
120
|
+
## P9. FIFO Queue with Type-Match Preference (Subagent Tracker)
|
|
121
|
+
|
|
122
|
+
Subagent tracker uses a queue to correlate Task tool calls with SubagentStart events. PreToolUse captures description; SubagentStart consumes by type-match first, FIFO fallback:
|
|
123
|
+
|
|
124
|
+
```js
|
|
125
|
+
const typeIdx = queue.findIndex(q => q.type === agentType);
|
|
126
|
+
if (typeIdx >= 0) { /* consume type-matched entry */ }
|
|
127
|
+
else { /* FIFO: consume first */ }
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Ref: `hooks/subagent-tracker.js` (line 80-95)
|
|
131
|
+
|
|
132
|
+
## P10. ANSI Statusline with Git Cache
|
|
133
|
+
|
|
134
|
+
`statusline.js` caches git status in a temp file with 5s TTL to avoid repeated `git` calls:
|
|
135
|
+
|
|
136
|
+
```js
|
|
137
|
+
const GIT_CACHE_FILE = path.join(os.tmpdir(), 'claude-statusline-git.json');
|
|
138
|
+
const GIT_CACHE_TTL = 5000;
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Ref: `scripts/statusline.js` (line 17-18, 296-326)
|
|
142
|
+
|
|
143
|
+
## P11. Command SKILL.md Structure
|
|
144
|
+
|
|
145
|
+
All slash commands follow the same structure: H1 title, trigger section, description, procedure/action, rules, and `ULTRATHINK` footer:
|
|
146
|
+
|
|
147
|
+
```markdown
|
|
148
|
+
# /command-name - Title
|
|
149
|
+
## Trigger
|
|
150
|
+
`/command-name <args>`
|
|
151
|
+
## Description / ## Procedure / ## Action
|
|
152
|
+
...
|
|
153
|
+
## Rules
|
|
154
|
+
...
|
|
155
|
+
ULTRATHINK
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Ref: `commands/mustard/feature/SKILL.md`, `commands/mustard/bugfix/SKILL.md`
|
|
159
|
+
|
|
160
|
+
## P12. Foundation Skill YAML Frontmatter
|
|
161
|
+
|
|
162
|
+
Foundation skills use YAML frontmatter with `name`, `description`, and optional `disable-model-invocation`:
|
|
163
|
+
|
|
164
|
+
```yaml
|
|
165
|
+
---
|
|
166
|
+
name: skill-name
|
|
167
|
+
description: "What it does. When to use it."
|
|
168
|
+
disable-model-invocation: true
|
|
169
|
+
---
|
|
170
|
+
<!-- mustard:generated -->
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Ref: `skills/commit-workflow/SKILL.md`, `skills/pipeline-execution/SKILL.md`
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<!-- mustard:generated at:2026-03-25T00:00:00.000Z role:general -->
|
|
2
|
+
# Recipes: Templates
|
|
3
|
+
|
|
4
|
+
> Implementation recipes for common tasks in the templates subproject.
|
|
5
|
+
|
|
6
|
+
## Recipe: New Hook
|
|
7
|
+
|
|
8
|
+
### Steps
|
|
9
|
+
1. Create `hooks/{hook-name}.js` following stdin/stdout protocol → `patterns.md` P1
|
|
10
|
+
2. Implement logic with fail-open error handling → `patterns.md` P4
|
|
11
|
+
3. Choose response format: PreToolUse (`permissionDecision`) or PostToolUse (`decision`) → `patterns.md` P2, P3
|
|
12
|
+
4. Register in `settings.json` under correct lifecycle event with matcher and timeout
|
|
13
|
+
5. Add test cases in `hooks/__tests__/hooks.test.js`
|
|
14
|
+
6. Run tests: `node --test hooks/__tests__/hooks.test.js`
|
|
15
|
+
|
|
16
|
+
### Reference module: bash-safety.js (PreToolUse) | guard-verify.js (PostToolUse)
|
|
17
|
+
### Reference files: `hooks/bash-safety.js`, `hooks/guard-verify.js`, `settings.json`, `hooks/__tests__/hooks.test.js`
|
|
18
|
+
|
|
19
|
+
### Task splits
|
|
20
|
+
- **HookImpl** (steps 1-3): Patterns: `patterns.md` P1-P4 | Depends on: none
|
|
21
|
+
- **HookWiring** (steps 4-6): Patterns: `guards.md` Settings | Depends on: HookImpl
|
|
22
|
+
|
|
23
|
+
### File hierarchy
|
|
24
|
+
| Level | Component | Depends on |
|
|
25
|
+
|-------|-----------|-----------|
|
|
26
|
+
| 1 | `hooks/{name}.js` | -- |
|
|
27
|
+
| 2 | `settings.json` (registration) | hooks/{name}.js |
|
|
28
|
+
| 3 | `hooks/__tests__/hooks.test.js` | hooks/{name}.js |
|
|
29
|
+
| 4 | test run | all |
|
|
30
|
+
|
|
31
|
+
## Recipe: New Slash Command
|
|
32
|
+
|
|
33
|
+
### Steps
|
|
34
|
+
1. Create `commands/mustard/{command-name}/SKILL.md` with trigger, description, procedure, rules → `patterns.md` P11
|
|
35
|
+
2. Include `ULTRATHINK` at the end
|
|
36
|
+
3. Verify command follows delegation pattern (no direct code implementation)
|
|
37
|
+
|
|
38
|
+
### Reference module: feature/SKILL.md (complex) | status/SKILL.md (simple)
|
|
39
|
+
### Reference files: `commands/mustard/feature/SKILL.md`, `commands/mustard/status/SKILL.md`
|
|
40
|
+
|
|
41
|
+
### Task splits
|
|
42
|
+
- **CommandDef** (steps 1-3): Patterns: `patterns.md` P11 | Depends on: none
|
|
43
|
+
|
|
44
|
+
### File hierarchy
|
|
45
|
+
| Level | Component | Depends on |
|
|
46
|
+
|-------|-----------|-----------|
|
|
47
|
+
| 1 | `commands/mustard/{name}/SKILL.md` | -- |
|
|
48
|
+
|
|
49
|
+
## Recipe: New Foundation Skill
|
|
50
|
+
|
|
51
|
+
### Steps
|
|
52
|
+
1. Create `skills/{skill-name}/SKILL.md` with YAML frontmatter → `patterns.md` P12
|
|
53
|
+
2. Write pushy description with casual trigger phrases → `guards.md` Skills
|
|
54
|
+
3. Add `<!-- mustard:generated -->` after closing `---`
|
|
55
|
+
4. Create `skills/{skill-name}/references/examples.md` with real code examples
|
|
56
|
+
5. Keep SKILL.md under 500 lines
|
|
57
|
+
|
|
58
|
+
### Reference module: commit-workflow (simple) | design-craft (with references)
|
|
59
|
+
### Reference files: `skills/commit-workflow/SKILL.md`, `skills/design-craft/SKILL.md`
|
|
60
|
+
|
|
61
|
+
### Task splits
|
|
62
|
+
- **SkillDef** (steps 1-5): Patterns: `patterns.md` P12, `guards.md` Skills | Depends on: none
|
|
63
|
+
|
|
64
|
+
### File hierarchy
|
|
65
|
+
| Level | Component | Depends on |
|
|
66
|
+
|-------|-----------|-----------|
|
|
67
|
+
| 1 | `skills/{name}/SKILL.md` | -- |
|
|
68
|
+
| 2 | `skills/{name}/references/examples.md` | SKILL.md |
|
|
69
|
+
|
|
70
|
+
## Recipe: New Sync Script
|
|
71
|
+
|
|
72
|
+
### Steps
|
|
73
|
+
1. Create `scripts/{script-name}.js` with shebang and JSDoc header
|
|
74
|
+
2. Use only Node.js built-ins (fs, path, child_process, crypto)
|
|
75
|
+
3. Read ROOT from `path.resolve(__dirname, '..', '..')` → `patterns.md` P8
|
|
76
|
+
4. Handle missing files/dirs gracefully with try/catch
|
|
77
|
+
5. Output JSON to stdout for consumption by other tools
|
|
78
|
+
6. Test manually: `node scripts/{script-name}.js`
|
|
79
|
+
|
|
80
|
+
### Reference module: sync-detect.js (complex) | sync-registry.js (medium)
|
|
81
|
+
### Reference files: `scripts/sync-detect.js`, `scripts/sync-registry.js`
|
|
82
|
+
|
|
83
|
+
### Task splits
|
|
84
|
+
- **ScriptImpl** (steps 1-5): Patterns: `patterns.md` P7, P8 | Depends on: none
|
|
85
|
+
- **ScriptTest** (step 6): Depends on: ScriptImpl
|
|
86
|
+
|
|
87
|
+
### File hierarchy
|
|
88
|
+
| Level | Component | Depends on |
|
|
89
|
+
|-------|-----------|-----------|
|
|
90
|
+
| 1 | `scripts/{name}.js` | -- |
|
|
91
|
+
| 2 | manual test | scripts/{name}.js |
|