@soleri/cli 9.5.0 → 9.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/dist/commands/create.js +3 -6
- package/dist/commands/create.js.map +1 -1
- package/dist/prompts/create-wizard.js +1 -1
- package/dist/prompts/create-wizard.js.map +1 -1
- package/dist/utils/checks.js +6 -1
- package/dist/utils/checks.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/flock-guard.test.ts +14 -7
- package/src/__tests__/hooks-convert.test.ts +5 -3
- package/src/commands/create.ts +3 -7
- package/src/prompts/create-wizard.ts +1 -1
- package/src/utils/checks.ts +6 -1
- package/src/hook-packs/converter/template.test.ts +0 -133
- package/src/prompts/playbook.ts +0 -487
package/dist/commands/create.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { readFileSync, existsSync } from 'node:fs';
|
|
2
|
-
import { resolve
|
|
3
|
-
import { homedir } from 'node:os';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
4
3
|
import * as p from '@clack/prompts';
|
|
5
4
|
import { previewScaffold, scaffold, AgentConfigSchema, SETUP_TARGETS, scaffoldFileTree, } from '@soleri/forge/lib';
|
|
6
5
|
import { runCreateWizard } from '../prompts/create-wizard.js';
|
|
7
6
|
import { listPacks } from '../hook-packs/registry.js';
|
|
8
7
|
import { installPack } from '../hook-packs/installer.js';
|
|
9
|
-
/** Default parent directory for new agents: ~/.soleri/ */
|
|
10
|
-
const SOLERI_HOME = process.env.SOLERI_HOME ?? join(homedir(), '.soleri');
|
|
11
8
|
function parseSetupTarget(value) {
|
|
12
9
|
if (!value)
|
|
13
10
|
return undefined;
|
|
@@ -27,7 +24,7 @@ export function registerCreate(program) {
|
|
|
27
24
|
.option('-c, --config <path>', 'Path to JSON config file (skip interactive prompts)')
|
|
28
25
|
.option('--setup-target <target>', `Setup target: ${SETUP_TARGETS.join(', ')} (default: claude)`)
|
|
29
26
|
.option('-y, --yes', 'Skip confirmation prompts (use with --config for fully non-interactive)')
|
|
30
|
-
.option('--dir <path>', `Parent directory for the agent (default:
|
|
27
|
+
.option('--dir <path>', `Parent directory for the agent (default: current directory)`)
|
|
31
28
|
.option('--filetree', 'Create a file-tree agent (v7 — no TypeScript, no build step)')
|
|
32
29
|
.option('--legacy', 'Create a legacy TypeScript agent (v6 — requires npm install + build)')
|
|
33
30
|
.description('Create a new Soleri agent')
|
|
@@ -118,7 +115,7 @@ export function registerCreate(program) {
|
|
|
118
115
|
version: dp.version,
|
|
119
116
|
})),
|
|
120
117
|
};
|
|
121
|
-
const outputDir = opts?.dir ? resolve(opts.dir) : (config.outputDir ??
|
|
118
|
+
const outputDir = opts?.dir ? resolve(opts.dir) : (config.outputDir ?? process.cwd());
|
|
122
119
|
const nonInteractive = !!(opts?.yes || opts?.config);
|
|
123
120
|
if (!nonInteractive) {
|
|
124
121
|
p.log.info(`Will create file-tree agent "${config.name}" in ${outputDir}/${config.id}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EACL,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,aAAa,EAEb,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,WAAW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AC,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,QAAQ,+BAA+B,CAAC,CAAC;oBACpE,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YACvC,CAAC;YAED,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACnB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;YAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CACF,CAAC;AACN,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* from usage, not configured upfront.
|
|
7
7
|
*/
|
|
8
8
|
import * as p from '@clack/prompts';
|
|
9
|
-
import { ITALIAN_CRAFTSPERSON } from '@soleri/core';
|
|
9
|
+
import { ITALIAN_CRAFTSPERSON } from '@soleri/core/personas';
|
|
10
10
|
/** Slugify a display name into a kebab-case ID. */
|
|
11
11
|
function slugify(name) {
|
|
12
12
|
return name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-wizard.js","sourceRoot":"","sources":["../../src/prompts/create-wizard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"create-wizard.js","sourceRoot":"","sources":["../../src/prompts/create-wizard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM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AI,EAAE,2BAA2B,CAAC;IAE7F,UAAU;IACV,CAAC,CAAC,IAAI,CACJ;QACE,SAAS,IAAI,CAAC,IAAI,EAAE,EAAE;QACtB,OAAO,EAAE,EAAE;QACX,YAAY,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,QAAQ,EAAE;QAC7E,EAAE;QACF,gDAAgD;QAChD,+DAA+D;KAChE,CAAC,IAAI,CAAC,IAAI,CAAC,EACZ,eAAe,CAChB,CAAC;IAEF,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,OAAO,CAAC;QAC9B,OAAO,EAAE,oBAAoB;QAC7B,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;IAEH,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAEjD,OAAO;QACL,EAAE;QACF,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;QACjB,IAAI,EAAE,2DAA2D;QACjE,WAAW,EACT,gHAAgH;QAClH,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,QAAQ;QACR,OAAO;KACY,CAAC;AACxB,CAAC"}
|
package/dist/utils/checks.js
CHANGED
|
@@ -16,7 +16,11 @@ export function checkNodeVersion() {
|
|
|
16
16
|
}
|
|
17
17
|
export function checkNpm() {
|
|
18
18
|
try {
|
|
19
|
-
|
|
19
|
+
// shell: true is needed on Windows where npm is installed as npm.cmd
|
|
20
|
+
const version = execFileSync('npm', ['--version'], {
|
|
21
|
+
encoding: 'utf-8',
|
|
22
|
+
shell: process.platform === 'win32',
|
|
23
|
+
}).trim();
|
|
20
24
|
return { status: 'pass', label: 'npm', detail: `v${version}` };
|
|
21
25
|
}
|
|
22
26
|
catch {
|
|
@@ -28,6 +32,7 @@ function checkTsx() {
|
|
|
28
32
|
const version = execFileSync('npx', ['tsx', '--version'], {
|
|
29
33
|
encoding: 'utf-8',
|
|
30
34
|
timeout: 10_000,
|
|
35
|
+
shell: process.platform === 'win32',
|
|
31
36
|
}).trim();
|
|
32
37
|
return { status: 'pass', label: 'tsx', detail: `v${version}` };
|
|
33
38
|
}
|
package/dist/utils/checks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checks.js","sourceRoot":"","sources":["../../src/utils/checks.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAQ9D,MAAM,UAAU,gBAAgB;IAC9B,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7D,IAAI,KAAK,IAAI,EAAE,EAAE,CAAC;QAChB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;IACnF,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,kBAAkB,EAAE,CAAC;AACnG,CAAC;AAED,MAAM,UAAU,QAAQ;IACtB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE,
|
|
1
|
+
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:crypto';
|
|
|
6
6
|
import { tmpdir } from 'node:os';
|
|
7
7
|
|
|
8
8
|
const SCRIPTS_DIR = join(__dirname, '..', 'hook-packs', 'flock-guard', 'scripts');
|
|
9
|
-
|
|
10
|
-
const
|
|
9
|
+
// Normalize to forward slashes for use in shell commands on Windows (Git Bash)
|
|
10
|
+
const PRE_SCRIPT = join(SCRIPTS_DIR, 'flock-guard-pre.sh').replace(/\\/g, '/');
|
|
11
|
+
const POST_SCRIPT = join(SCRIPTS_DIR, 'flock-guard-post.sh').replace(/\\/g, '/');
|
|
11
12
|
|
|
12
13
|
// The scripts use `git rev-parse --show-toplevel` which resolves to the repo root.
|
|
13
14
|
// Compute the same hash the scripts will produce.
|
|
@@ -18,8 +19,10 @@ const PROJECT_ROOT = execSync('git rev-parse --show-toplevel', {
|
|
|
18
19
|
const PROJECT_HASH = execSync(`printf '%s' '${PROJECT_ROOT}' | shasum | cut -c1-8`, {
|
|
19
20
|
encoding: 'utf-8',
|
|
20
21
|
}).trim();
|
|
21
|
-
// Scripts use ${TMPDIR:-${TEMP:-/tmp}} — match that resolution for the test environment
|
|
22
|
-
|
|
22
|
+
// Scripts use ${TMPDIR:-${TEMP:-/tmp}} — match that resolution for the test environment.
|
|
23
|
+
// Normalize backslashes to forward slashes so Node.js paths match POSIX shell paths on Windows.
|
|
24
|
+
const TMP_BASE = (process.env.TMPDIR || process.env.TEMP || tmpdir()).replace(/\\/g, '/');
|
|
25
|
+
const LOCK_DIR = `${TMP_BASE}/soleri-guard-${PROJECT_HASH}.lock`;
|
|
23
26
|
|
|
24
27
|
function makePayload(command: string): string {
|
|
25
28
|
return JSON.stringify({ tool_name: 'Bash', tool_input: { command } });
|
|
@@ -36,7 +39,7 @@ function runPre(
|
|
|
36
39
|
encoding: 'utf-8',
|
|
37
40
|
stdio: 'pipe',
|
|
38
41
|
cwd: PROJECT_ROOT,
|
|
39
|
-
env: { ...process.env, ...env },
|
|
42
|
+
env: { ...process.env, TMPDIR: TMP_BASE, ...env },
|
|
40
43
|
},
|
|
41
44
|
);
|
|
42
45
|
return { stdout, exitCode: 0 };
|
|
@@ -56,7 +59,7 @@ function runPost(
|
|
|
56
59
|
encoding: 'utf-8',
|
|
57
60
|
stdio: 'pipe',
|
|
58
61
|
cwd: PROJECT_ROOT,
|
|
59
|
-
env: { ...process.env, ...env },
|
|
62
|
+
env: { ...process.env, TMPDIR: TMP_BASE, ...env },
|
|
60
63
|
},
|
|
61
64
|
);
|
|
62
65
|
return { stdout, exitCode: 0 };
|
|
@@ -76,7 +79,11 @@ function cleanLock(): void {
|
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
81
|
|
|
79
|
-
|
|
82
|
+
// flock-guard uses POSIX shell scripts (sh, mkdir, jq, shasum, grep -qE) that
|
|
83
|
+
// are incompatible with Windows even under Git Bash due to path separator issues.
|
|
84
|
+
const isWindows = process.platform === 'win32';
|
|
85
|
+
|
|
86
|
+
describe.skipIf(isWindows)('flock-guard hook pack', () => {
|
|
80
87
|
afterEach(() => {
|
|
81
88
|
cleanLock();
|
|
82
89
|
});
|
|
@@ -302,9 +302,11 @@ describe('hooks convert', () => {
|
|
|
302
302
|
expect(scriptContent).toContain('#!/bin/sh');
|
|
303
303
|
expect(scriptContent).toContain('test-pack');
|
|
304
304
|
|
|
305
|
-
// Verify script is executable
|
|
306
|
-
|
|
307
|
-
|
|
305
|
+
// Verify script is executable (Unix only — Windows does not support POSIX permissions)
|
|
306
|
+
if (process.platform !== 'win32') {
|
|
307
|
+
const stat = statSync(join(scriptsDir, `${config.name}.sh`));
|
|
308
|
+
expect(stat.mode & 0o755).toBe(0o755);
|
|
309
|
+
}
|
|
308
310
|
});
|
|
309
311
|
|
|
310
312
|
it('should create correct project directory structure with --project flag', () => {
|
package/src/commands/create.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { readFileSync, existsSync } from 'node:fs';
|
|
2
|
-
import { resolve
|
|
3
|
-
import { homedir } from 'node:os';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
4
3
|
import type { Command } from 'commander';
|
|
5
4
|
import * as p from '@clack/prompts';
|
|
6
5
|
import {
|
|
@@ -15,9 +14,6 @@ import { runCreateWizard } from '../prompts/create-wizard.js';
|
|
|
15
14
|
import { listPacks } from '../hook-packs/registry.js';
|
|
16
15
|
import { installPack } from '../hook-packs/installer.js';
|
|
17
16
|
|
|
18
|
-
/** Default parent directory for new agents: ~/.soleri/ */
|
|
19
|
-
const SOLERI_HOME = process.env.SOLERI_HOME ?? join(homedir(), '.soleri');
|
|
20
|
-
|
|
21
17
|
function parseSetupTarget(value?: string): SetupTarget | undefined {
|
|
22
18
|
if (!value) return undefined;
|
|
23
19
|
if ((SETUP_TARGETS as readonly string[]).includes(value)) {
|
|
@@ -41,7 +37,7 @@ export function registerCreate(program: Command): void {
|
|
|
41
37
|
`Setup target: ${SETUP_TARGETS.join(', ')} (default: claude)`,
|
|
42
38
|
)
|
|
43
39
|
.option('-y, --yes', 'Skip confirmation prompts (use with --config for fully non-interactive)')
|
|
44
|
-
.option('--dir <path>', `Parent directory for the agent (default:
|
|
40
|
+
.option('--dir <path>', `Parent directory for the agent (default: current directory)`)
|
|
45
41
|
.option('--filetree', 'Create a file-tree agent (v7 — no TypeScript, no build step)')
|
|
46
42
|
.option('--legacy', 'Create a legacy TypeScript agent (v6 — requires npm install + build)')
|
|
47
43
|
.description('Create a new Soleri agent')
|
|
@@ -154,7 +150,7 @@ export function registerCreate(program: Command): void {
|
|
|
154
150
|
})),
|
|
155
151
|
};
|
|
156
152
|
|
|
157
|
-
const outputDir = opts?.dir ? resolve(opts.dir) : (config.outputDir ??
|
|
153
|
+
const outputDir = opts?.dir ? resolve(opts.dir) : (config.outputDir ?? process.cwd());
|
|
158
154
|
const nonInteractive = !!(opts?.yes || opts?.config);
|
|
159
155
|
|
|
160
156
|
if (!nonInteractive) {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as p from '@clack/prompts';
|
|
9
9
|
import type { AgentConfigInput } from '@soleri/forge/lib';
|
|
10
|
-
import { ITALIAN_CRAFTSPERSON } from '@soleri/core';
|
|
10
|
+
import { ITALIAN_CRAFTSPERSON } from '@soleri/core/personas';
|
|
11
11
|
|
|
12
12
|
/** Slugify a display name into a kebab-case ID. */
|
|
13
13
|
function slugify(name: string): string {
|
package/src/utils/checks.ts
CHANGED
|
@@ -24,7 +24,11 @@ export function checkNodeVersion(): CheckResult {
|
|
|
24
24
|
|
|
25
25
|
export function checkNpm(): CheckResult {
|
|
26
26
|
try {
|
|
27
|
-
|
|
27
|
+
// shell: true is needed on Windows where npm is installed as npm.cmd
|
|
28
|
+
const version = execFileSync('npm', ['--version'], {
|
|
29
|
+
encoding: 'utf-8',
|
|
30
|
+
shell: process.platform === 'win32',
|
|
31
|
+
}).trim();
|
|
28
32
|
return { status: 'pass', label: 'npm', detail: `v${version}` };
|
|
29
33
|
} catch {
|
|
30
34
|
return { status: 'fail', label: 'npm', detail: 'not found' };
|
|
@@ -36,6 +40,7 @@ function checkTsx(): CheckResult {
|
|
|
36
40
|
const version = execFileSync('npx', ['tsx', '--version'], {
|
|
37
41
|
encoding: 'utf-8',
|
|
38
42
|
timeout: 10_000,
|
|
43
|
+
shell: process.platform === 'win32',
|
|
39
44
|
}).trim();
|
|
40
45
|
return { status: 'pass', label: 'tsx', detail: `v${version}` };
|
|
41
46
|
} catch {
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { generateHookScript, generateManifest, HOOK_EVENTS, ACTION_LEVELS } from './template.js';
|
|
3
|
-
import type { HookConversionConfig } from './template.js';
|
|
4
|
-
|
|
5
|
-
describe('generateHookScript', () => {
|
|
6
|
-
const baseConfig: HookConversionConfig = {
|
|
7
|
-
name: 'test-hook',
|
|
8
|
-
event: 'PreToolUse',
|
|
9
|
-
toolMatcher: 'Write|Edit',
|
|
10
|
-
filePatterns: ['**/marketing/**'],
|
|
11
|
-
action: 'remind',
|
|
12
|
-
message: 'Check brand guidelines before editing marketing files',
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
it('should generate a valid POSIX shell script', () => {
|
|
16
|
-
const script = generateHookScript(baseConfig);
|
|
17
|
-
expect(script).toContain('#!/bin/sh');
|
|
18
|
-
expect(script).toContain('set -eu');
|
|
19
|
-
expect(script).toContain('INPUT=$(cat)');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should include tool matcher for PreToolUse', () => {
|
|
23
|
-
const script = generateHookScript(baseConfig);
|
|
24
|
-
expect(script).toContain('TOOL_NAME=');
|
|
25
|
-
expect(script).toContain('Write|Edit');
|
|
26
|
-
expect(script).toContain('case "$TOOL_NAME" in');
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('should include file pattern matching', () => {
|
|
30
|
-
const script = generateHookScript(baseConfig);
|
|
31
|
-
expect(script).toContain('FILE_PATH=');
|
|
32
|
-
expect(script).toContain('MATCHED=false');
|
|
33
|
-
expect(script).toContain('marketing');
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('should output remind action by default', () => {
|
|
37
|
-
const script = generateHookScript(baseConfig);
|
|
38
|
-
expect(script).toContain('REMINDER:');
|
|
39
|
-
expect(script).toContain('continue: true');
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it('should output warn action', () => {
|
|
43
|
-
const script = generateHookScript({ ...baseConfig, action: 'warn' });
|
|
44
|
-
expect(script).toContain('WARNING:');
|
|
45
|
-
expect(script).toContain('continue: true');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('should output block action', () => {
|
|
49
|
-
const script = generateHookScript({ ...baseConfig, action: 'block' });
|
|
50
|
-
expect(script).toContain('BLOCKED:');
|
|
51
|
-
expect(script).toContain('continue: false');
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('should skip tool matcher for non-tool events', () => {
|
|
55
|
-
const script = generateHookScript({ ...baseConfig, event: 'PreCompact' });
|
|
56
|
-
expect(script).not.toContain('TOOL_NAME');
|
|
57
|
-
expect(script).not.toContain('case');
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('should skip file pattern matching when no patterns', () => {
|
|
61
|
-
const script = generateHookScript({ ...baseConfig, filePatterns: undefined });
|
|
62
|
-
expect(script).not.toContain('FILE_PATH');
|
|
63
|
-
expect(script).not.toContain('MATCHED');
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('should generate scripts for all 5 hook events', () => {
|
|
67
|
-
for (const event of HOOK_EVENTS) {
|
|
68
|
-
const script = generateHookScript({ ...baseConfig, event });
|
|
69
|
-
expect(script).toContain(`# Event: ${event}`);
|
|
70
|
-
expect(script).toContain('#!/bin/sh');
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('should escape single quotes in messages', () => {
|
|
75
|
-
const script = generateHookScript({ ...baseConfig, message: "Don't forget the guidelines" });
|
|
76
|
-
// Should not have unbalanced quotes
|
|
77
|
-
expect(script).toContain('forget');
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
describe('generateManifest', () => {
|
|
82
|
-
const config: HookConversionConfig = {
|
|
83
|
-
name: 'my-hook',
|
|
84
|
-
event: 'PreToolUse',
|
|
85
|
-
toolMatcher: 'Write',
|
|
86
|
-
action: 'remind',
|
|
87
|
-
message: 'Test message',
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
it('should generate valid manifest with required fields', () => {
|
|
91
|
-
const manifest = generateManifest(config);
|
|
92
|
-
expect(manifest.name).toBe('my-hook');
|
|
93
|
-
expect(manifest.version).toBe('1.0.0');
|
|
94
|
-
expect(manifest.hooks).toEqual([]);
|
|
95
|
-
expect(manifest.scripts).toHaveLength(1);
|
|
96
|
-
expect(manifest.lifecycleHooks).toHaveLength(1);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('should set script name and file correctly', () => {
|
|
100
|
-
const manifest = generateManifest(config);
|
|
101
|
-
expect(manifest.scripts![0].name).toBe('my-hook');
|
|
102
|
-
expect(manifest.scripts![0].file).toBe('my-hook.sh');
|
|
103
|
-
expect(manifest.scripts![0].targetDir).toBe('hooks');
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it('should set lifecycle hook event and command', () => {
|
|
107
|
-
const manifest = generateManifest(config);
|
|
108
|
-
const lc = manifest.lifecycleHooks![0];
|
|
109
|
-
expect(lc.event).toBe('PreToolUse');
|
|
110
|
-
expect(lc.command).toBe('sh ~/.claude/hooks/my-hook.sh');
|
|
111
|
-
expect(lc.type).toBe('command');
|
|
112
|
-
expect(lc.timeout).toBe(10);
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
it('should use description from config or fallback to message', () => {
|
|
116
|
-
expect(generateManifest(config).description).toBe('Test message');
|
|
117
|
-
expect(generateManifest({ ...config, description: 'Custom desc' }).description).toBe(
|
|
118
|
-
'Custom desc',
|
|
119
|
-
);
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
it('should include actionLevel', () => {
|
|
123
|
-
expect(generateManifest(config).actionLevel).toBe('remind');
|
|
124
|
-
expect(generateManifest({ ...config, action: 'block' }).actionLevel).toBe('block');
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
it('should generate manifests for all action levels', () => {
|
|
128
|
-
for (const action of ACTION_LEVELS) {
|
|
129
|
-
const manifest = generateManifest({ ...config, action });
|
|
130
|
-
expect(manifest.actionLevel).toBe(action);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
});
|
package/src/prompts/playbook.ts
DELETED
|
@@ -1,487 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Playbook data for the guided wizard.
|
|
3
|
-
* Provides curated options with self-explanatory hints,
|
|
4
|
-
* organized by category. Each list also supports a "custom" escape hatch
|
|
5
|
-
* with examples and anti-examples so the user is never staring at a blank cursor.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// ─── Domains ────────────────────────────────────────────────
|
|
9
|
-
|
|
10
|
-
interface DomainOption {
|
|
11
|
-
value: string;
|
|
12
|
-
label: string;
|
|
13
|
-
hint: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const DOMAIN_OPTIONS: DomainOption[] = [
|
|
17
|
-
{
|
|
18
|
-
value: 'security',
|
|
19
|
-
label: 'security',
|
|
20
|
-
hint: 'Vulnerability scanning, threat modeling, secrets detection',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
value: 'code-review',
|
|
24
|
-
label: 'code-review',
|
|
25
|
-
hint: 'Pattern enforcement, anti-pattern detection, PR review',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
value: 'testing',
|
|
29
|
-
label: 'testing',
|
|
30
|
-
hint: 'Test generation, coverage analysis, mutation testing',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
value: 'api-design',
|
|
34
|
-
label: 'api-design',
|
|
35
|
-
hint: 'REST/GraphQL contracts, versioning, error handling',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
value: 'performance',
|
|
39
|
-
label: 'performance',
|
|
40
|
-
hint: 'Budgets, profiling, bundle size, query optimization',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
value: 'accessibility',
|
|
44
|
-
label: 'accessibility',
|
|
45
|
-
hint: 'WCAG compliance, screen readers, keyboard navigation',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
value: 'architecture',
|
|
49
|
-
label: 'architecture',
|
|
50
|
-
hint: 'System design, boundaries, dependency management',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
value: 'database',
|
|
54
|
-
label: 'database',
|
|
55
|
-
hint: 'Schema design, migrations, indexing, query tuning',
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
value: 'documentation',
|
|
59
|
-
label: 'documentation',
|
|
60
|
-
hint: 'API docs, READMEs, changelogs, code comments',
|
|
61
|
-
},
|
|
62
|
-
{ value: 'devops', label: 'devops', hint: 'CI/CD pipelines, infrastructure as code, deployment' },
|
|
63
|
-
{
|
|
64
|
-
value: 'developer-experience',
|
|
65
|
-
label: 'developer-experience',
|
|
66
|
-
hint: 'Developer tooling, onboarding, and ergonomics',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
value: 'design-tokens',
|
|
70
|
-
label: 'design-tokens',
|
|
71
|
-
hint: 'Semantic tokens, color systems, spacing scales, typography',
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
value: 'frontend',
|
|
75
|
-
label: 'frontend',
|
|
76
|
-
hint: 'Component patterns, state management, rendering, bundling',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
value: 'ux-design',
|
|
80
|
-
label: 'ux-design',
|
|
81
|
-
hint: 'User flows, conversion, onboarding, forms, navigation',
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
value: 'knowledge-management',
|
|
85
|
-
label: 'knowledge-management',
|
|
86
|
-
hint: 'Vault curation, pattern lifecycle, cross-project learning',
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
value: 'governance',
|
|
90
|
-
label: 'governance',
|
|
91
|
-
hint: 'Approval gates, policy enforcement, audit trails',
|
|
92
|
-
},
|
|
93
|
-
];
|
|
94
|
-
|
|
95
|
-
export const CUSTOM_DOMAIN_GUIDANCE = {
|
|
96
|
-
instruction: 'Define a custom domain (kebab-case)',
|
|
97
|
-
examples: [
|
|
98
|
-
'graphql-federation — Schema stitching, subgraph validation, entity resolution',
|
|
99
|
-
'data-pipeline — ETL jobs, stream processing, data quality checks',
|
|
100
|
-
'mobile-ux — Touch targets, gesture handling, responsive layouts',
|
|
101
|
-
],
|
|
102
|
-
antiExamples: [
|
|
103
|
-
'stuff — too vague, what kind of stuff?',
|
|
104
|
-
'MyDomain — must be kebab-case, not camelCase',
|
|
105
|
-
],
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
// ─── Principles ─────────────────────────────────────────────
|
|
109
|
-
|
|
110
|
-
interface PrincipleCategory {
|
|
111
|
-
label: string;
|
|
112
|
-
options: PrincipleOption[];
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
interface PrincipleOption {
|
|
116
|
-
value: string;
|
|
117
|
-
label: string;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export const PRINCIPLE_CATEGORIES: PrincipleCategory[] = [
|
|
121
|
-
{
|
|
122
|
-
label: 'Quality',
|
|
123
|
-
options: [
|
|
124
|
-
{ value: 'Simplicity over cleverness', label: 'Simplicity over cleverness' },
|
|
125
|
-
{ value: 'Convention over configuration', label: 'Convention over configuration' },
|
|
126
|
-
{ value: 'Test everything that can break', label: 'Test everything that can break' },
|
|
127
|
-
{ value: 'Respect existing patterns', label: 'Respect existing patterns' },
|
|
128
|
-
{ value: 'Progressive enhancement', label: 'Progressive enhancement' },
|
|
129
|
-
],
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
label: 'Safety',
|
|
133
|
-
options: [
|
|
134
|
-
{ value: 'Security first', label: 'Security first' },
|
|
135
|
-
{ value: 'Fail closed, not open', label: 'Fail closed, not open' },
|
|
136
|
-
{ value: 'Zero trust by default', label: 'Zero trust by default' },
|
|
137
|
-
{ value: 'Least privilege always', label: 'Least privilege always' },
|
|
138
|
-
{ value: 'Defense in depth', label: 'Defense in depth' },
|
|
139
|
-
],
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
label: 'Developer Experience',
|
|
143
|
-
options: [
|
|
144
|
-
{ value: 'Actionable feedback only', label: 'Actionable feedback only' },
|
|
145
|
-
{ value: 'Explain the why, not just the what', label: 'Explain the why, not just the what' },
|
|
146
|
-
{
|
|
147
|
-
value: 'Every comment includes a fix suggestion',
|
|
148
|
-
label: 'Every comment includes a fix suggestion',
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
value: 'Design for the consumer, not the implementer',
|
|
152
|
-
label: 'Design for the consumer, not the implementer',
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
label: 'Reliability',
|
|
158
|
-
options: [
|
|
159
|
-
{
|
|
160
|
-
value: 'Graceful degradation over hard failures',
|
|
161
|
-
label: 'Graceful degradation over hard failures',
|
|
162
|
-
},
|
|
163
|
-
{ value: 'Automate everything repeatable', label: 'Automate everything repeatable' },
|
|
164
|
-
{
|
|
165
|
-
value: 'Observability built in from day one',
|
|
166
|
-
label: 'Observability built in from day one',
|
|
167
|
-
},
|
|
168
|
-
{ value: 'Every migration must be reversible', label: 'Every migration must be reversible' },
|
|
169
|
-
],
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
label: 'Code Review',
|
|
173
|
-
options: [
|
|
174
|
-
{ value: 'Readable over clever', label: 'Readable over clever' },
|
|
175
|
-
{ value: 'Small PR scope', label: 'Small PR scope' },
|
|
176
|
-
],
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
label: 'API Design',
|
|
180
|
-
options: [
|
|
181
|
-
{ value: 'Backward compatibility by default', label: 'Backward compatibility by default' },
|
|
182
|
-
{ value: 'Consumer-driven contracts', label: 'Consumer-driven contracts' },
|
|
183
|
-
],
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
label: 'Testing',
|
|
187
|
-
options: [
|
|
188
|
-
{ value: 'Deterministic tests only', label: 'Deterministic tests only' },
|
|
189
|
-
{ value: 'Test at boundaries, not internals', label: 'Test at boundaries, not internals' },
|
|
190
|
-
],
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
label: 'Operations',
|
|
194
|
-
options: [
|
|
195
|
-
{ value: 'Infrastructure as code', label: 'Infrastructure as code' },
|
|
196
|
-
{ value: 'Blast radius awareness', label: 'Blast radius awareness' },
|
|
197
|
-
],
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
label: 'Data',
|
|
201
|
-
options: [
|
|
202
|
-
{
|
|
203
|
-
value: 'Schema evolution over breaking changes',
|
|
204
|
-
label: 'Schema evolution over breaking changes',
|
|
205
|
-
},
|
|
206
|
-
{ value: 'Query performance first', label: 'Query performance first' },
|
|
207
|
-
],
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
label: 'Accessibility',
|
|
211
|
-
options: [
|
|
212
|
-
{ value: 'WCAG compliance is non-negotiable', label: 'WCAG compliance is non-negotiable' },
|
|
213
|
-
{ value: 'Semantic HTML before ARIA', label: 'Semantic HTML before ARIA' },
|
|
214
|
-
{
|
|
215
|
-
value: 'Keyboard navigation for every interaction',
|
|
216
|
-
label: 'Keyboard navigation for every interaction',
|
|
217
|
-
},
|
|
218
|
-
],
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
label: 'Documentation',
|
|
222
|
-
options: [
|
|
223
|
-
{ value: 'Clarity over completeness', label: 'Clarity over completeness' },
|
|
224
|
-
{ value: 'Every concept needs an example', label: 'Every concept needs an example' },
|
|
225
|
-
{
|
|
226
|
-
value: 'Docs rot faster than code — keep current',
|
|
227
|
-
label: 'Docs rot faster than code — keep current',
|
|
228
|
-
},
|
|
229
|
-
],
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
label: 'Design Systems',
|
|
233
|
-
options: [
|
|
234
|
-
{ value: 'Semantic tokens over primitives', label: 'Semantic tokens over primitives' },
|
|
235
|
-
{
|
|
236
|
-
value: 'Component variant enum over boolean props',
|
|
237
|
-
label: 'Component variant enum over boolean props',
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
value: 'Atomic design classification for component hierarchy',
|
|
241
|
-
label: 'Atomic design classification for component hierarchy',
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
value: 'Token enforcement: blocked then forbidden then preferred',
|
|
245
|
-
label: 'Token enforcement: blocked then forbidden then preferred',
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
value: 'Respect existing design system patterns',
|
|
249
|
-
label: 'Respect existing design system patterns',
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
value: 'Every component needs accessibility baseline',
|
|
253
|
-
label: 'Every component needs accessibility baseline',
|
|
254
|
-
},
|
|
255
|
-
],
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
label: 'Frontend Engineering',
|
|
259
|
-
options: [
|
|
260
|
-
{
|
|
261
|
-
value: 'Stack-aware implementation over generic advice',
|
|
262
|
-
label: 'Stack-aware implementation over generic advice',
|
|
263
|
-
},
|
|
264
|
-
{ value: 'UX patterns inform code structure', label: 'UX patterns inform code structure' },
|
|
265
|
-
{
|
|
266
|
-
value: 'Performance budget before feature scope',
|
|
267
|
-
label: 'Performance budget before feature scope',
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
value: 'Accessible by default, not bolted on after',
|
|
271
|
-
label: 'Accessible by default, not bolted on after',
|
|
272
|
-
},
|
|
273
|
-
],
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
label: 'UX Intelligence',
|
|
277
|
-
options: [
|
|
278
|
-
{
|
|
279
|
-
value: 'User behavior drives design decisions',
|
|
280
|
-
label: 'User behavior drives design decisions',
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
value: 'Accessibility is not a feature, it is a baseline',
|
|
284
|
-
label: 'Accessibility is not a feature, it is a baseline',
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
value: 'Measure conversion impact of every UX change',
|
|
288
|
-
label: 'Measure conversion impact of every UX change',
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
value: 'Progressive disclosure over information overload',
|
|
292
|
-
label: 'Progressive disclosure over information overload',
|
|
293
|
-
},
|
|
294
|
-
],
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
label: 'Knowledge Management',
|
|
298
|
-
options: [
|
|
299
|
-
{
|
|
300
|
-
value: 'Knowledge-gather before execute, always',
|
|
301
|
-
label: 'Knowledge-gather before execute, always',
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
value: 'Vault is the single source of truth',
|
|
305
|
-
label: 'Vault is the single source of truth',
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
value: 'Capture lessons at the moment of discovery',
|
|
309
|
-
label: 'Capture lessons at the moment of discovery',
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
value: 'Cross-project patterns beat project-local fixes',
|
|
313
|
-
label: 'Cross-project patterns beat project-local fixes',
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
value: 'Domain vocabulary must be explicit and extensible',
|
|
317
|
-
label: 'Domain vocabulary must be explicit and extensible',
|
|
318
|
-
},
|
|
319
|
-
],
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
label: 'Governance',
|
|
323
|
-
options: [
|
|
324
|
-
{
|
|
325
|
-
value: 'Two-gate approval: plan then execute, never skip',
|
|
326
|
-
label: 'Two-gate approval: plan then execute, never skip',
|
|
327
|
-
},
|
|
328
|
-
{
|
|
329
|
-
value: 'Protocol enforcement via checkpoint gates',
|
|
330
|
-
label: 'Protocol enforcement via checkpoint gates',
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
value: 'Data-driven architecture: logic in config, not code',
|
|
334
|
-
label: 'Data-driven architecture: logic in config, not code',
|
|
335
|
-
},
|
|
336
|
-
],
|
|
337
|
-
},
|
|
338
|
-
];
|
|
339
|
-
|
|
340
|
-
export const CUSTOM_PRINCIPLE_GUIDANCE = {
|
|
341
|
-
instruction: 'Write a custom principle',
|
|
342
|
-
examples: [
|
|
343
|
-
'Never suggest any in production without a feature flag',
|
|
344
|
-
'Prefer composition over inheritance',
|
|
345
|
-
'Every public API must have a deprecation path before removal',
|
|
346
|
-
],
|
|
347
|
-
antiExamples: [
|
|
348
|
-
'Write good code — too vague, what does "good" mean?',
|
|
349
|
-
'Follow best practices — which ones? Be specific.',
|
|
350
|
-
],
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
// ─── Skills ─────────────────────────────────────────────────
|
|
354
|
-
|
|
355
|
-
/** Core skills — always included, never shown in picker. */
|
|
356
|
-
export const CORE_SKILLS = [
|
|
357
|
-
'brainstorming',
|
|
358
|
-
'systematic-debugging',
|
|
359
|
-
'verification-before-completion',
|
|
360
|
-
'health-check',
|
|
361
|
-
'context-resume',
|
|
362
|
-
'writing-plans',
|
|
363
|
-
'executing-plans',
|
|
364
|
-
] as const;
|
|
365
|
-
|
|
366
|
-
interface SkillCategory {
|
|
367
|
-
label: string;
|
|
368
|
-
options: SkillOption[];
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
interface SkillOption {
|
|
372
|
-
value: string;
|
|
373
|
-
label: string;
|
|
374
|
-
hint: string;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
export const SKILL_CATEGORIES: SkillCategory[] = [
|
|
378
|
-
{
|
|
379
|
-
label: 'Knowledge & Learning',
|
|
380
|
-
options: [
|
|
381
|
-
{
|
|
382
|
-
value: 'vault-navigator',
|
|
383
|
-
label: 'vault-navigator',
|
|
384
|
-
hint: 'Deep-dive vault search and exploration',
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
value: 'vault-capture',
|
|
388
|
-
label: 'vault-capture',
|
|
389
|
-
hint: 'Persist lessons learned to the knowledge vault',
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
value: 'knowledge-harvest',
|
|
393
|
-
label: 'knowledge-harvest',
|
|
394
|
-
hint: 'Extract patterns from completed work',
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
value: 'brain-debrief',
|
|
398
|
-
label: 'brain-debrief',
|
|
399
|
-
hint: 'Post-task intelligence summary and debriefing',
|
|
400
|
-
},
|
|
401
|
-
],
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
label: 'Code Quality',
|
|
405
|
-
options: [
|
|
406
|
-
{
|
|
407
|
-
value: 'code-patrol',
|
|
408
|
-
label: 'code-patrol',
|
|
409
|
-
hint: 'Scan for anti-patterns and code violations',
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
value: 'test-driven-development',
|
|
413
|
-
label: 'test-driven-development',
|
|
414
|
-
hint: 'TDD workflow: red, green, refactor',
|
|
415
|
-
},
|
|
416
|
-
{
|
|
417
|
-
value: 'fix-and-learn',
|
|
418
|
-
label: 'fix-and-learn',
|
|
419
|
-
hint: 'Fix bugs and capture the lesson for next time',
|
|
420
|
-
},
|
|
421
|
-
],
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
label: 'Team & Process',
|
|
425
|
-
options: [
|
|
426
|
-
{
|
|
427
|
-
value: 'retrospective',
|
|
428
|
-
label: 'retrospective',
|
|
429
|
-
hint: 'End-of-session retrospective and reflection',
|
|
430
|
-
},
|
|
431
|
-
{
|
|
432
|
-
value: 'second-opinion',
|
|
433
|
-
label: 'second-opinion',
|
|
434
|
-
hint: 'Get a fresh perspective on tough decisions',
|
|
435
|
-
},
|
|
436
|
-
{
|
|
437
|
-
value: 'onboard-me',
|
|
438
|
-
label: 'onboard-me',
|
|
439
|
-
hint: 'Guided codebase onboarding for new team members',
|
|
440
|
-
},
|
|
441
|
-
],
|
|
442
|
-
},
|
|
443
|
-
];
|
|
444
|
-
|
|
445
|
-
/** Flat list of all optional skill values. */
|
|
446
|
-
export const ALL_OPTIONAL_SKILLS = SKILL_CATEGORIES.flatMap((c) => c.options.map((o) => o.value));
|
|
447
|
-
|
|
448
|
-
// ─── Tones ──────────────────────────────────────────────────
|
|
449
|
-
|
|
450
|
-
interface ToneOption {
|
|
451
|
-
value: 'precise' | 'mentor' | 'pragmatic';
|
|
452
|
-
label: string;
|
|
453
|
-
hint: string;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
export const TONE_OPTIONS: ToneOption[] = [
|
|
457
|
-
{ value: 'precise', label: 'Precise', hint: 'Direct, factual, minimal commentary' },
|
|
458
|
-
{ value: 'mentor', label: 'Mentor', hint: 'Educational, explains the "why" behind suggestions' },
|
|
459
|
-
{ value: 'pragmatic', label: 'Pragmatic', hint: 'Balanced, focuses on actionable outcomes' },
|
|
460
|
-
];
|
|
461
|
-
|
|
462
|
-
// ─── Custom field guidance (role, description, greeting) ────
|
|
463
|
-
|
|
464
|
-
export const CUSTOM_ROLE_GUIDANCE = {
|
|
465
|
-
instruction: 'Describe what your agent does (one sentence)',
|
|
466
|
-
examples: [
|
|
467
|
-
'Enforces accessibility standards across React components',
|
|
468
|
-
'Generates and maintains API documentation from code',
|
|
469
|
-
'Monitors performance budgets and flags regressions',
|
|
470
|
-
],
|
|
471
|
-
};
|
|
472
|
-
|
|
473
|
-
export const CUSTOM_DESCRIPTION_GUIDANCE = {
|
|
474
|
-
instruction: 'Describe your agent in detail (10-500 characters)',
|
|
475
|
-
examples: [
|
|
476
|
-
'This agent validates GraphQL schemas against federation rules, checks for breaking changes, and ensures consistent naming conventions across subgraphs.',
|
|
477
|
-
],
|
|
478
|
-
};
|
|
479
|
-
|
|
480
|
-
export const CUSTOM_GREETING_GUIDANCE = {
|
|
481
|
-
instruction: 'Write a custom greeting (first thing users see)',
|
|
482
|
-
examples: [
|
|
483
|
-
"Hello! I'm your design system guardian. Let's build something beautiful.",
|
|
484
|
-
'Ready to review. Drop a PR link or describe the issue.',
|
|
485
|
-
"Hey! Let's make sure your APIs are rock solid.",
|
|
486
|
-
],
|
|
487
|
-
};
|