@skillit/client 0.2.0 → 0.3.1

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.
Files changed (77) hide show
  1. package/README.md +40 -0
  2. package/dist/bin.d.ts +2 -1
  3. package/dist/bin.d.ts.map +1 -1
  4. package/dist/bin.js +21 -13
  5. package/dist/bin.js.map +1 -1
  6. package/dist/commands/audit.d.ts +34 -0
  7. package/dist/commands/audit.d.ts.map +1 -0
  8. package/dist/commands/audit.js +139 -0
  9. package/dist/commands/audit.js.map +1 -0
  10. package/dist/commands/gen.d.ts +20 -0
  11. package/dist/commands/gen.d.ts.map +1 -0
  12. package/dist/commands/gen.js +108 -0
  13. package/dist/commands/gen.js.map +1 -0
  14. package/dist/commands/init.d.ts +3 -22
  15. package/dist/commands/init.d.ts.map +1 -1
  16. package/dist/commands/init.js +23 -84
  17. package/dist/commands/init.js.map +1 -1
  18. package/dist/commands/refine.d.ts +34 -2
  19. package/dist/commands/refine.d.ts.map +1 -1
  20. package/dist/commands/refine.js +61 -29
  21. package/dist/commands/refine.js.map +1 -1
  22. package/dist/generate.d.ts +67 -0
  23. package/dist/generate.d.ts.map +1 -0
  24. package/dist/generate.js +55 -0
  25. package/dist/generate.js.map +1 -0
  26. package/dist/mcp-mode.d.ts +22 -0
  27. package/dist/mcp-mode.d.ts.map +1 -0
  28. package/dist/mcp-mode.js +27 -0
  29. package/dist/mcp-mode.js.map +1 -0
  30. package/dist/model/anthropic.d.ts +11 -0
  31. package/dist/model/anthropic.d.ts.map +1 -1
  32. package/dist/model/anthropic.js +16 -2
  33. package/dist/model/anthropic.js.map +1 -1
  34. package/dist/model/cli/adapters.d.ts.map +1 -1
  35. package/dist/model/cli/adapters.js +35 -2
  36. package/dist/model/cli/adapters.js.map +1 -1
  37. package/dist/model/cli/cli-client.d.ts.map +1 -1
  38. package/dist/model/cli/cli-client.js +4 -2
  39. package/dist/model/cli/cli-client.js.map +1 -1
  40. package/dist/program.d.ts +12 -0
  41. package/dist/program.d.ts.map +1 -0
  42. package/dist/program.js +42 -0
  43. package/dist/program.js.map +1 -0
  44. package/dist/typedoc-entry.d.ts +6 -0
  45. package/dist/typedoc-entry.d.ts.map +1 -0
  46. package/dist/typedoc-entry.js +14 -0
  47. package/dist/typedoc-entry.js.map +1 -0
  48. package/package.json +18 -7
  49. package/skills/skillit-bootstrap/SKILL.md +115 -0
  50. package/skills/skillit-bootstrap/references/surface-routing.md +97 -0
  51. package/CHANGELOG.md +0 -32
  52. package/scripts/gen-refine-cli-skill.mjs +0 -48
  53. package/src/__tests__/anthropic-model.test.ts +0 -45
  54. package/src/__tests__/anthropic-prompt.test.ts +0 -102
  55. package/src/__tests__/cli-adapters.test.ts +0 -119
  56. package/src/__tests__/cli-client.test.ts +0 -58
  57. package/src/__tests__/cli-run.test.ts +0 -52
  58. package/src/__tests__/detect-mode.test.ts +0 -114
  59. package/src/__tests__/detect-source.test.ts +0 -158
  60. package/src/__tests__/fixtures/bin-with-program.mjs +0 -6
  61. package/src/__tests__/init.test.ts +0 -218
  62. package/src/__tests__/model-client-factory.test.ts +0 -28
  63. package/src/__tests__/refine-resolve.test.ts +0 -72
  64. package/src/bin.ts +0 -18
  65. package/src/commands/init.ts +0 -207
  66. package/src/commands/refine.ts +0 -261
  67. package/src/detect-mode.ts +0 -94
  68. package/src/detect-source.ts +0 -123
  69. package/src/index.ts +0 -3
  70. package/src/model/anthropic.ts +0 -116
  71. package/src/model/cli/adapters.ts +0 -178
  72. package/src/model/cli/cli-client.ts +0 -52
  73. package/src/model/cli/run.ts +0 -83
  74. package/src/model/model-client-factory.ts +0 -62
  75. package/src/model/models.ts +0 -7
  76. package/tsconfig.build.json +0 -9
  77. package/tsconfig.json +0 -4
@@ -1 +1 @@
1
- {"version":3,"file":"adapters.js","sourceRoot":"","sources":["../../../src/model/cli/adapters.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cA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AAM,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAGtD;CACF"}
1
+ {"version":3,"file":"cli-client.d.ts","sourceRoot":"","sources":["../../../src/model/cli/cli-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO5F,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,iEAAiE;AACjE,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,aAAa,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEjE,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,qBAAa,cAAe,YAAW,WAAW;IAK9C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJ1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAS;IAEpC,YACmB,OAAO,EAAE,UAAU,EACpC,OAAO,GAAE,qBAA0B,EAIpC;YAEa,GAAG;IAWX,KAAK,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAK9C;IAEK,MAAM,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAGtD;CACF"}
@@ -1,4 +1,4 @@
1
- import { buildDraftPrompt, buildReviewPrompt, parseReviewVerdict } from '../anthropic.js';
1
+ import { buildDraftPrompt, buildReviewPrompt, extractDraftAnswer, parseReviewVerdict } from '../anthropic.js';
2
2
  import { runCli } from './run.js';
3
3
  /**
4
4
  * A {@link ModelClient} that drives an agent CLI (claude/codex/copilot) instead
@@ -26,7 +26,9 @@ export class CliModelClient {
26
26
  }
27
27
  async draft(req) {
28
28
  const result = await this.run('draft', buildDraftPrompt(req));
29
- return result.trim();
29
+ // The CLI backends are chatty: strip any preamble outside the <answer> tags
30
+ // the drafter was told to use, so only the annotation reaches the JSDoc.
31
+ return extractDraftAnswer(result);
30
32
  }
31
33
  async review(req) {
32
34
  const result = await this.run('review', buildReviewPrompt(req));
@@ -1 +1 @@
1
- {"version":3,"file":"cli-client.js","sourceRoot":"","sources":["../../../src/model/cli/cli-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,MAAM,EAAsB,MAAM,UAAU,CAAC;AAWtD;;;;GAIG;AACH,MAAM,OAAO,cAAc;IAKN,OAAO;IAJT,MAAM,CAAY;IAClB,SAAS,CAAU;IAEpC,YACmB,OAAmB,EACpC,OAAO,GAA0B,EAAE;uBADlB,OAAO;QAGxB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IACrC,CAAC;IAEO,KAAK,CAAC,GAAG,CAAC,IAAwB,EAAE,MAAc;QACxD,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAClD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC;YAC/B,GAAG,EAAE,GAAG,CAAC,GAAG;YACZ,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,GAAG,CAAC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACxD,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAA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/B,GAAG,EAAE,GAAG,CAAC,GAAG;YACZ,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,GAAG,CAAC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACxD,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACvE,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,GAAiB;QAC3B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9D,4EAA4E;QAC5E,yEAAyE;QACzE,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAkB;QAC7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * Builds the `skillit` commander program with all subcommands registered.
4
+ *
5
+ * Exported as a zero-arg factory so the program can be introspected by
6
+ * `@skillit/cli`'s program loader (`--program <file#export>` / auto-discovery
7
+ * probes `buildProgram`) — this is what lets skillit generate a skill for its
8
+ * own CLI. The executable entry ({@link file://./bin.ts}) wraps this with
9
+ * argv parsing and the mcp exit-code contract.
10
+ */
11
+ export declare function buildProgram(): Command;
12
+ //# sourceMappingURL=program.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBpC;;;;;;;;GAQG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAUtC"}
@@ -0,0 +1,42 @@
1
+ // packages/client/src/program.ts
2
+ import { readFileSync } from 'node:fs';
3
+ import { Command } from 'commander';
4
+ import { buildMcpCommand } from '@skillit/mcp';
5
+ import { buildAuditCommand } from './commands/audit.js';
6
+ import { buildGenCommand } from './commands/gen.js';
7
+ import { buildInitCommand } from './commands/init.js';
8
+ import { buildRefineCommand } from './commands/refine.js';
9
+ /**
10
+ * The package version, read from `package.json` at runtime so `skillit
11
+ * --version` stays correct after every release instead of drifting from a
12
+ * hard-coded literal. `../package.json` resolves from the built `dist/` entry
13
+ * to the package root. Falls back to `0.0.0` if the read fails.
14
+ */
15
+ function readPackageVersion() {
16
+ try {
17
+ const raw = readFileSync(new URL('../package.json', import.meta.url), 'utf8');
18
+ return JSON.parse(raw).version ?? '0.0.0';
19
+ }
20
+ catch {
21
+ return '0.0.0';
22
+ }
23
+ }
24
+ /**
25
+ * Builds the `skillit` commander program with all subcommands registered.
26
+ *
27
+ * Exported as a zero-arg factory so the program can be introspected by
28
+ * `@skillit/cli`'s program loader (`--program <file#export>` / auto-discovery
29
+ * probes `buildProgram`) — this is what lets skillit generate a skill for its
30
+ * own CLI. The executable entry ({@link file://./bin.ts}) wraps this with
31
+ * argv parsing and the mcp exit-code contract.
32
+ */
33
+ export function buildProgram() {
34
+ const program = new Command('skillit').description('skillit CLI').version(readPackageVersion());
35
+ program.addCommand(buildRefineCommand());
36
+ program.addCommand(buildInitCommand());
37
+ program.addCommand(buildMcpCommand());
38
+ program.addCommand(buildGenCommand());
39
+ program.addCommand(buildAuditCommand());
40
+ return program;
41
+ }
42
+ //# sourceMappingURL=program.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"program.js","sourceRoot":"","sources":["../src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@
1
+ /** Resolve TypeDoc entry points + tsconfig for a package dir (shared by gen + audit). */
2
+ export declare function resolveTypeDocEntry(cwd: string): {
3
+ entryPoints: string[];
4
+ tsconfig: string;
5
+ };
6
+ //# sourceMappingURL=typedoc-entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typedoc-entry.d.ts","sourceRoot":"","sources":["../src/typedoc-entry.ts"],"names":[],"mappings":"AAIA,yFAAyF;AACzF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAQ5F"}
@@ -0,0 +1,14 @@
1
+ // packages/client/src/typedoc-entry.ts
2
+ import { existsSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ /** Resolve TypeDoc entry points + tsconfig for a package dir (shared by gen + audit). */
5
+ export function resolveTypeDocEntry(cwd) {
6
+ const tsconfig = existsSync(join(cwd, 'tsconfig.json'))
7
+ ? join(cwd, 'tsconfig.json')
8
+ : existsSync(join(cwd, 'tsconfig.build.json'))
9
+ ? join(cwd, 'tsconfig.build.json')
10
+ : join(cwd, 'tsconfig.json'); // default even if absent — TypeDoc will error clearly
11
+ const entryPoints = [join(cwd, 'src', 'index.ts')];
12
+ return { entryPoints, tsconfig };
13
+ }
14
+ //# sourceMappingURL=typedoc-entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typedoc-entry.js","sourceRoot":"","sources":["../src/typedoc-entry.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,yFAAyF;AACzF,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QACrD,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC;QAC5B,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAC;YAC5C,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,qBAAqB,CAAC;YAClC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC,sDAAsD;IACxF,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;IACnD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;AACnC,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,22 @@
1
1
  {
2
2
  "name": "@skillit/client",
3
- "version": "0.2.0",
4
- "description": "Anthropic model client + skillit CLI (refine command)",
3
+ "version": "0.3.1",
4
+ "description": "The skillit CLI — generate, audit, and refine AI-agent skills from a TypeScript codebase, plus the Anthropic model client for the headless refine loop.",
5
5
  "license": "MIT",
6
6
  "author": "Pradeep Mouli",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/pradeepmouli/skillit.git",
10
+ "directory": "packages/client"
11
+ },
7
12
  "bin": {
8
13
  "skillit": "./dist/bin.js"
9
14
  },
15
+ "files": [
16
+ "dist",
17
+ "README.md",
18
+ "skills"
19
+ ],
10
20
  "type": "module",
11
21
  "main": "./dist/index.js",
12
22
  "types": "./dist/index.d.ts",
@@ -17,11 +27,12 @@
17
27
  }
18
28
  },
19
29
  "dependencies": {
20
- "@anthropic-ai/sdk": "^0.100.0",
21
- "commander": "^14.0.3",
22
- "@skillit/mcp": "0.3.0",
23
- "@skillit/core": "1.5.0",
24
- "@skillit/cli": "0.4.0"
30
+ "@anthropic-ai/sdk": "^0.100.1",
31
+ "commander": "^15.0.0",
32
+ "@skillit/cli": "0.5.0",
33
+ "@skillit/core": "2.0.0",
34
+ "@skillit/mcp": "0.4.0",
35
+ "@skillit/typedoc": "1.2.0"
25
36
  },
26
37
  "scripts": {
27
38
  "build": "tsgo -p tsconfig.build.json",
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: skillit-bootstrap
3
+ description: 'Bootstrap an AI-agent skill from a TypeScript codebase by running the deterministic skillit generate/audit loop and enriching repo source (JSDoc, README, config-type properties, MCP tool annotations, examples, package.json) until the skill reaches its grade target. Use for cli, typedoc, config, or mcp (build-mode) projects; never edit SKILL.md/references directly.'
4
+ version: 0.1.0
5
+ toSkills:
6
+ managed: bundled-orchestrator
7
+ ---
8
+
9
+ # skillit-bootstrap
10
+
11
+ Bootstrap a high-quality AI-agent skill from a TypeScript codebase. You run the
12
+ deterministic skillit pipeline, read its machine-readable findings, and enrich
13
+ the **repo source** (JSDoc, README, examples, package.json) until the generated
14
+ skill reaches its grade target. skillit owns the skill output; you own the
15
+ inputs.
16
+
17
+ ## The one hard rule
18
+
19
+ **Never create or edit any `SKILL.md` or `references/*.md` for the target
20
+ project.** Those are pure outputs of `skillit gen` — regenerated every pass. You
21
+ edit only repo _source surfaces_. If you find yourself about to write a
22
+ `SKILL.md`, stop: the fix belongs in the source the skill is generated from.
23
+
24
+ ## When to use
25
+
26
+ - A `cli` (Commander), `typedoc` (TypeScript library), `config` (a TypeScript
27
+ config type), or `mcp` (an MCP server whose TS source you own — "build mode")
28
+ project that needs a generated agent skill, or whose skill scores below its
29
+ grade target.
30
+ - Run after the project is set up with the right `@skillit/*` package (see
31
+ step 1).
32
+ - **Third-party MCP servers you cannot edit** are out of scope here: with no
33
+ editable source, the skill is produced from an overlay ("runtime mode") via
34
+ `skillit refine`. This loop targets the build-mode (own-source) path. See
35
+ `references/surface-routing.md`.
36
+
37
+ ## Inputs
38
+
39
+ ```
40
+ /skillit-bootstrap [--source cli|typedoc|config|mcp] [--program <file#export>]
41
+ [--config-type <file#export>] [--mcp <path>] [--server <name>]
42
+ [--out <dir>] [--grade A|B|C] [--max-iterations <n>]
43
+ [--ground <glob>...]
44
+ ```
45
+
46
+ - `--source` — override detection (`cli`, `typedoc`, `config`, or `mcp`).
47
+ - `--program` — Commander program entry for the cli source (`./dist/cli.js#program`).
48
+ - `--config-type` — config type entry for the config source (`./src/config.ts#MyConfig`).
49
+ - `--mcp` — path to `mcp.json` / MCP config file (mcp source).
50
+ - `--server` — MCP server entry to select when the config lists several (mcp source).
51
+ - `--out` — skill output dir (default `skills`).
52
+ - `--grade` — override the kind-aware target (below).
53
+ - `--max-iterations` — hard cap on enrich/regenerate passes (default 5).
54
+ - `--ground <glob>` — consumer/implementation code you MUST read before writing
55
+ any runtime-behavior pitfall, so your claims reflect real behavior, not guesses.
56
+
57
+ ## The loop
58
+
59
+ 1. **Set up once.** Determine the source kind (honor `--source`, else infer:
60
+ `commander`/`yargs` dep → cli; `@modelcontextprotocol/sdk` dep → mcp;
61
+ otherwise a TS library → typedoc). `config` is never auto-detected — select it
62
+ explicitly with `--config-type <file#export>`. Each kind has its own selector:
63
+ cli → `--program`, config → `--config-type`, mcp → `--mcp` (+ optional
64
+ `--server`); typedoc needs none. If the project has no `@skillit/*` package
65
+ installed yet, run `skillit init --source <kind>` once (it installs + wires
66
+ only; it does not generate).
67
+ 2. **Generate.** Run `skillit gen --source <kind> <selector> [--out …]` (the
68
+ selector is the kind's from step 1). This deterministically produces the skill
69
+ from current source. Never hand-edit its output. (For mcp, `gen` spins up the
70
+ server to introspect it, so the source skill is a function of a deterministic
71
+ server.)
72
+ 3. **Audit.** Run `skillit audit --source <kind> <selector> --json` and read
73
+ the JSON: `estimate.grade`, `estimate.dimensions` (D1–D8), and
74
+ `improvements[]`. Each improvement carries `suggestion`, `dimension`,
75
+ `targets: [{file, name, kind}]`, and (when resolvable) `resolvedLocations[]`
76
+ pointing at the exact file + declaration to edit. **These targets are your
77
+ work queue.**
78
+ 4. **Enrich the source.** For each addressable finding, open the cited source
79
+ file and write the missing content on the named symbol/section/key, choosing
80
+ the surface the suggestion names. The surface → audit-code map and the
81
+ edit-vs-create guidance are in `references/surface-routing.md`. Before writing
82
+ any _runtime-behavior_ pitfall, read the relevant implementation (`--ground`
83
+ globs) — do not invent semantics from a type signature.
84
+ - Prefer the `upsertJsDocTag` / `upsertPropertyJsDocTag` helpers (exported
85
+ from `@skillit/core`) for JSDoc-tag writeback rather than free-hand
86
+ splicing — they handle `*/` escaping and multi-line prefixing.
87
+ - You may also **create** a new parseable artifact when that is the better
88
+ home (a `docs/<guide>.md`, an `examples/<name>.ts`, a missing README
89
+ section) — but only of a type an existing parser already consumes, and
90
+ never a `SKILL.md`.
91
+ 5. **Regenerate + re-audit.** Re-run step 2 then step 3. Compare the new
92
+ `estimate` to the previous pass.
93
+ 6. **Decide convergence** (your judgment, using these signals):
94
+ - **Pass** — `estimate.grade` ≥ the target. Default target is _kind-aware_:
95
+ typedoc/library → **A** (every export is introspectable); cli adapter-model
96
+ → **B**, config → **B**, mcp → **B** — these surfaces structurally cap below
97
+ A (a cli command tree isn't enumerated per-symbol; a config type has no
98
+ functions/params, so per-option routing + one example file is its ceiling;
99
+ mcp reaches **A** only if every tool handler carries full JSDoc). `--grade`
100
+ overrides.
101
+ - **Plateau** — the score did not rise AND every remaining finding targets a
102
+ symbol that genuinely has nothing more to truthfully say. You can _see_ the
103
+ source, so distinguish "legitimately complete" from "stuck re-drafting" —
104
+ stop on the former.
105
+ - **Cap** — never exceed `--max-iterations` (default 5).
106
+ 7. **Report.** Print the final grade, the D1–D8 breakdown, the list of source
107
+ files you enriched, and any remaining findings you judged un-addressable with
108
+ a one-line rationale each. This is the human review surface; the user commits
109
+ the result.
110
+
111
+ ## After convergence
112
+
113
+ Tell the user to review the enriched source diffs and the regenerated skill,
114
+ then commit. Remind them the skill is reproducible: `skillit gen` on the same
115
+ source yields byte-identical output, so the source diff is the real change.
@@ -0,0 +1,97 @@
1
+ # Enrichment surface routing
2
+
3
+ For each audit finding, edit the **source surface** named here — never the
4
+ generated `SKILL.md`. The audit `suggestion` text already names the surface;
5
+ this table is the quick reference. (Source: skillit architecture spec §2.3/§4.)
6
+
7
+ | Audit codes | Enrichment surface (what you edit) | How |
8
+ | ------------------ | ---------------------------------- | -------------------------------------------------------------------------- |
9
+ | F4 | Symbol JSDoc summary | `/** … */` on the function/class/type/enum/variable |
10
+ | E1, E2 | `@param` / `@returns` prose | on parameters and non-void returns |
11
+ | E3 | Interface/type property JSDoc | `/** … */` on each property |
12
+ | W7, W8, W9 | Routing tags | `@useWhen` / `@avoidWhen` / `@never` (render as pitfalls) |
13
+ | W10, W11, W3 | Depth tags | `@remarks` (complex fns), `@category`, `@since`/`@throws`/`@see` |
14
+ | W1, W5 | Module docs | `@packageDocumentation` summary + `@remarks` |
15
+ | E4, W2 | Examples | sibling `*.example.ts` / `examples/*`, or `@example` blocks on key exports |
16
+ | F3, W5, W6, A4 | README sections | Features / Troubleshooting / Quick Start, intro blockquote |
17
+ | F1, F2, E5, W4, A1 | package.json metadata | `description`, `keywords` (≥5, ≥3 domain), `repository` |
18
+
19
+ Use the `upsertJsDocTag` / `upsertPropertyJsDocTag` helpers (exported from
20
+ `@skillit/core`) for tag writeback — they escape `*/` and prefix multi-line
21
+ content correctly. Free-hand JSDoc splicing is error-prone.
22
+
23
+ ## Edit vs. create
24
+
25
+ Editing an existing surface is the common move, but you may **create** a new
26
+ artifact when it is the better home for missing content — e.g.:
27
+
28
+ - a `docs/<guide>.md` page (consumed by skillit's docs scanner → `skill.documents`);
29
+ - an `examples/<name>.ts` or sibling `*.example.ts` (consumed by the examples scanner);
30
+ - a `## Troubleshooting` / `## Features` section a README lacks.
31
+
32
+ Hard constraint: the new artifact must be a type an existing skillit parser
33
+ already consumes — **no new parser**, and never a `SKILL.md`.
34
+
35
+ ## Finite vs. coverage-gated findings (size the work before you start)
36
+
37
+ Audit improvements come in two shapes — tell them apart before deciding how far
38
+ a finding can move the grade:
39
+
40
+ - **Finite / complexity-gated** (e.g. `@remarks` on functions with 3+ params,
41
+ `@category` grouping): the target set is small and enumerable. The
42
+ `targets[]` list **is** the whole job — close it and the dimension moves.
43
+ - **Coverage-gated / all-or-nothing** (the D8 `@param` / `@returns` / property
44
+ JSDoc checks E1/E2/E3): the check fails on the **first** undocumented member
45
+ across the _entire_ public surface, so the points only land at ~100%
46
+ coverage. Here `targets[]` is only a **sample** — closing the listed symbols
47
+ does **not** flip the gate. Before committing, get the true remaining count
48
+ (`audit … --json` issue list, grouped by code) and decide: either do the full
49
+ sweep, or stop and report the gap. Do **not** write filler prose on internal
50
+ helpers just to chase the gate — that is the anti-pattern this skill exists to
51
+ prevent.
52
+
53
+ ## Grounding runtime claims
54
+
55
+ Before writing any pitfall or `@never`/`@avoidWhen` rule that asserts _runtime
56
+ behavior_, read the implementation (the `--ground` globs, or the function body).
57
+ A fluent, well-structured claim that is factually wrong is invisible to the
58
+ deterministic audit — the safeguard is that you actually read the code.
59
+
60
+ ## Per-kind headline surface
61
+
62
+ The table above is kind-independent (any project has README + package.json). The
63
+ _headline judgment_ of the skill lives in a kind-specific surface:
64
+
65
+ - **typedoc** — per-symbol JSDoc on exported functions/classes/types (the richest
66
+ surface; every export is introspectable). Writeback: `upsertJsDocTag`.
67
+ - **cli** — JSDoc on the command's `<Command>Options` interface; `CliRefineSource`
68
+ correlates the option-interface tags onto the command surface. For an
69
+ adapter-model CLI (no static command tree), enrich the stable exported symbols
70
+ together with `@packageDocumentation` instead.
71
+ - **config** — **per-property** JSDoc on the config type's properties:
72
+ `@useWhen`/`@avoidWhen`/`@pitfalls`/`@remarks` on each option, plus a sibling
73
+ `<config>.example.ts` (written only if absent — never clobbered) for the
74
+ example finding. Findings carry a dot-path `configKey`; `resolveTargetLocation`
75
+ returns `{ file, declName, propertyPath }`. Writeback: `upsertPropertyJsDocTag`.
76
+ - **Tag note:** the config surface authors pitfalls as **`@pitfalls`** (what
77
+ `config-extract` reads), NOT `@never` (the typedoc/JSDoc surface's tag — see
78
+ spec §4.2 naming note). On a config option, `@never` is silently ignored.
79
+ `@category` is likewise not scored on config options — don't chase it there.
80
+ - **mcp (build mode)** — JSDoc on the tool-handler symbols **plus**
81
+ `_meta.toSkills.{useWhen,avoidWhen,pitfalls}` annotations in your TS server
82
+ source. `resolveTargetLocation` resolves a tool to its `{ file, declName }`.
83
+ Writeback: `upsertJsDocTag`. (`gen`/`audit --source mcp --mode build`.)
84
+ - **mcp (runtime mode)** — the server source is **not** editable, so the only
85
+ writable surface is the overlay JSON. This is handled by `skillit refine`'s
86
+ overlay path, **not** this loop — there is nothing to enrich in source.
87
+
88
+ ## Scope
89
+
90
+ - **Supported:** `cli` (Commander), `typedoc` (TS library), `config` (a config
91
+ type via `--config-type`), and `mcp` **build mode** (an MCP server whose TS
92
+ source you own, via `--mcp` + optional `--server`).
93
+ - **Runtime mode** (third-party MCP servers, no editable source) is served by
94
+ `skillit refine`'s overlay path, not this loop.
95
+ - Kind-aware grade targets: typedoc → A; cli → B; config → B; mcp → B (A only if
96
+ every tool handler carries full JSDoc). A non-enumerated command tree, a
97
+ function-less config type, and a thinly-annotated tool set each cap below A.
package/CHANGELOG.md DELETED
@@ -1,32 +0,0 @@
1
- # @skillit/client
2
-
3
- ## 0.2.0
4
-
5
- ### Minor Changes
6
-
7
- - [#41](https://github.com/pradeepmouli/skillit/pull/41) [`989f899`](https://github.com/pradeepmouli/skillit/commit/989f899fd506f422d67c808bce8b5302f11986c6) Thanks [@pradeepmouli](https://github.com/pradeepmouli)! - - fix(client): guard msg.content[0] access — throw on empty or non-text response
8
- - fix(typedoc/refine): fix JSDoc closer indentation + use async fs I/O in TypeDocRefineSource
9
- - feat(client): add skillit bin with refine command
10
- - feat(client): add AnthropicModelClient (Sonnet drafter, Opus reviewer)
11
- - feat(client): scaffold @skillit/client package
12
-
13
- - [#53](https://github.com/pradeepmouli/skillit/pull/53) [`95caa9e`](https://github.com/pradeepmouli/skillit/commit/95caa9e1d0ed3e6562470940b857a83bc8e4a37a) Thanks [@pradeepmouli](https://github.com/pradeepmouli)! - `refine` and `init` gain `--model-client api|claude|codex|copilot`: drive the
14
- audit→draft→review loop through an already-authenticated agent CLI instead of
15
- the Anthropic API. Per-CLI adapters (claude maps the drafter/reviewer split to
16
- Sonnet/Opus; codex/copilot use their default model) reuse the existing prompt
17
- builders and verdict parser; `--model-cli-timeout` bounds each call. Default
18
- remains `api`.
19
-
20
- - [#52](https://github.com/pradeepmouli/skillit/pull/52) [`30e9f03`](https://github.com/pradeepmouli/skillit/commit/30e9f03756bb3596e0cf90bb91beb37dd6bb9c18) Thanks [@pradeepmouli](https://github.com/pradeepmouli)! - Multi-source `refine` (CLI), `skillit init`, ast-grep-based JSDoc editing, and guidance injection.
21
- - **core**: new `refine/ast-edit.ts` wrapping `@ast-grep/napi` — `upsertJsDocTag`/`readJsDocTags` replace the regex/offset JSDoc surgery; `insertJsDocTag` reimplemented on top of it. `RefineSource.guidance?()` and `guidance` on draft/review requests; `refineSkill` threads the source's bundled guidance skill into every draft/review. `audit-score` surfaces CLI command annotation gaps as work items.
22
- - **cli**: `CliRefineSource` (extract → bundled `skillit-cli-docs` guidance → JSDoc write-back onto the correlated `*Options` interface); commander program loader (`--program file#export` + `bin` auto-find); `*Options` interface JSDoc reader for loop closure.
23
- - **client**: `refine` is source-aware — `--source cli|mcp|typedoc` with detection from installed `@skillit/*` packages, plus `--program`; `--mcp` no longer globally required. New `skillit init` command: detect project nature → install the matching package → generate the initial skill into top-level `skills/` → refine (CLI path automated; mcp/typedoc print next-step guidance).
24
-
25
- ### Patch Changes
26
-
27
- - [#54](https://github.com/pradeepmouli/skillit/pull/54) [`314f9b0`](https://github.com/pradeepmouli/skillit/commit/314f9b0218304e40d6fa6da628fcb112d2940912) Thanks [@pradeepmouli](https://github.com/pradeepmouli)! - Rebrand `@to-skills` → `@skillit`: package scope, a single `skillit` CLI (MCP commands now mounted as `skillit mcp …`), bundled skill names (`skillit-cli-docs`/`skillit-docs`/`skillit-mcp-docs`), and the `package.json` config key (`skillit.mcp`). No API or behavior changes.
28
-
29
- - Updated dependencies [[`989f899`](https://github.com/pradeepmouli/skillit/commit/989f899fd506f422d67c808bce8b5302f11986c6), [`9699e6f`](https://github.com/pradeepmouli/skillit/commit/9699e6f9896f4153ecdad6b1bbc87ead20e773ef), [`30e9f03`](https://github.com/pradeepmouli/skillit/commit/30e9f03756bb3596e0cf90bb91beb37dd6bb9c18), [`314f9b0`](https://github.com/pradeepmouli/skillit/commit/314f9b0218304e40d6fa6da628fcb112d2940912)]:
30
- - @skillit/cli@0.4.0
31
- - @skillit/core@1.5.0
32
- - @skillit/mcp@0.3.0
@@ -1,48 +0,0 @@
1
- // Dogfood: generate a skill for the `skillit` CLI binary (the `refine` command)
2
- // using @skillit/cli's own commander introspection.
3
- //
4
- // Run via the package script (builds first): pnpm --filter @skillit/client gen-cli-skill
5
- // Or directly, after building @skillit/client: node packages/client/scripts/gen-refine-cli-skill.mjs
6
- import { existsSync } from 'node:fs';
7
- import { fileURLToPath } from 'node:url';
8
- import { dirname, resolve } from 'node:path';
9
- import { Command } from 'commander';
10
- import { extractCliSkill, writeCliSkill } from '@skillit/cli';
11
-
12
- const here = dirname(fileURLToPath(import.meta.url));
13
- const repoRoot = resolve(here, '../../..');
14
-
15
- // This script reads the refine command from build output. `dist/` is not in the
16
- // repo by default, so fail with an actionable message rather than a raw
17
- // ERR_MODULE_NOT_FOUND when it is missing or stale.
18
- const refineDist = resolve(here, '../dist/commands/refine.js');
19
- if (!existsSync(refineDist)) {
20
- console.error(
21
- `Cannot find ${refineDist}.\nBuild @skillit/client first: pnpm --filter @skillit/client build`
22
- );
23
- process.exit(1);
24
- }
25
- const { buildRefineCommand } = await import(refineDist);
26
-
27
- // Reconstruct the same program shape that packages/client/src/bin.ts ships.
28
- const program = new Command('skillit').description('skillit CLI').version('0.1.0');
29
- program.addCommand(buildRefineCommand());
30
-
31
- const skill = await extractCliSkill({
32
- program,
33
- metadata: {
34
- name: 'skillit-refine',
35
- description:
36
- 'Autonomously improve an MCP skill via the skillit audit→draft→review loop (build or runtime mode)',
37
- keywords: ['skillit', 'refine', 'mcp', 'skill-generation', 'cli', 'audit', 'overlay'],
38
- repository: 'https://github.com/pradeepmouli/skillit'
39
- }
40
- });
41
-
42
- writeCliSkill(skill, { outDir: resolve(repoRoot, 'skills') });
43
-
44
- const issues = skill.audit?.issues ?? [];
45
- console.log(`Generated skills/skillit-refine/ — ${issues.length} audit finding(s).`);
46
- for (const i of issues) {
47
- console.log(` [${i.severity ?? '?'}] ${i.code ?? ''} ${i.message ?? ''}`.trimEnd());
48
- }
@@ -1,45 +0,0 @@
1
- // packages/client/src/__tests__/anthropic-model.test.ts
2
- import { describe, it, expect } from 'vitest';
3
- import { parseReviewVerdict } from '../model/anthropic.js';
4
-
5
- describe('parseReviewVerdict', () => {
6
- it('parses accepted verdict', () => {
7
- const text = 'Looks good. {"verdict":"accepted","feedback":""}';
8
- expect(parseReviewVerdict(text)).toEqual({ verdict: 'accepted', feedback: '' });
9
- });
10
-
11
- it('parses revise verdict', () => {
12
- const text = '{"verdict":"revise","feedback":"Be more specific about edge cases"}';
13
- expect(parseReviewVerdict(text)).toEqual({
14
- verdict: 'revise',
15
- feedback: 'Be more specific about edge cases'
16
- });
17
- });
18
-
19
- it('fails open on malformed JSON — returns accepted', () => {
20
- expect(parseReviewVerdict('not json at all')).toEqual({ verdict: 'accepted', feedback: '' });
21
- });
22
-
23
- it('fails open on missing verdict field', () => {
24
- expect(parseReviewVerdict('{"feedback":"ok"}')).toEqual({
25
- verdict: 'accepted',
26
- feedback: 'ok'
27
- });
28
- });
29
-
30
- it('parses revise verdict when feedback contains balanced braces', () => {
31
- const text = '{"verdict":"revise","feedback":"handle {edge-case} and {null} inputs"}';
32
- expect(parseReviewVerdict(text)).toEqual({
33
- verdict: 'revise',
34
- feedback: 'handle {edge-case} and {null} inputs'
35
- });
36
- });
37
-
38
- it('parses revise verdict when feedback contains an unbalanced open brace', () => {
39
- const text = '{"verdict":"revise","feedback":"use {var in templates"}';
40
- expect(parseReviewVerdict(text)).toEqual({
41
- verdict: 'revise',
42
- feedback: 'use {var in templates'
43
- });
44
- });
45
- });