agent-composer 0.1.1 → 0.1.3

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.
@@ -72,6 +72,29 @@
72
72
  "items": { "type": "string" },
73
73
  "minItems": 1,
74
74
  "description": "argv array for CLIProvider, e.g. [\"agy\",\"--dangerously-skip-permissions\",\"-p\"]. Passed to child_process.execFile — NEVER shell-interpolated."
75
+ },
76
+ "maxTokens": {
77
+ "type": "integer",
78
+ "minimum": 1,
79
+ "description": "Per-role override for the provider's default max output tokens. When `thinking.budgetTokens` is set this must be greater than it. Added 2026-05-25 for v0.1.3."
80
+ },
81
+ "thinking": {
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": ["type"],
85
+ "description": "Extended-thinking knob for Anthropic-compat providers (GLM glm-5.1, glm-4.6+, Claude). Ignored by other providers. Added 2026-05-25 for v0.1.3.",
86
+ "properties": {
87
+ "type": {
88
+ "type": "string",
89
+ "enum": ["enabled", "disabled"],
90
+ "description": "enabled: include the `thinking` block on every call. disabled: explicitly opt out."
91
+ },
92
+ "budgetTokens": {
93
+ "type": "integer",
94
+ "minimum": 1024,
95
+ "description": "Max tokens the model may spend on internal reasoning. Required when type=enabled. Anthropic SDK minimum is 1024."
96
+ }
97
+ }
75
98
  }
76
99
  }
77
100
  }
@@ -26,6 +26,10 @@ export interface GlobalInitOptions {
26
26
  verbose?: boolean;
27
27
  defaultBaseUrl?: string;
28
28
  defaultAuthToken?: string;
29
+ /** Skip plugin asset install (default: false — assets ARE installed). */
30
+ skipPluginAssets?: boolean;
31
+ /** Override the plugin source directory (tests inject). */
32
+ pluginSourceDir?: string;
29
33
  }
30
34
  /**
31
35
  * User-level (global) bootstrap. Writes composer.config.json and .env.json
package/dist/cli/init.js CHANGED
@@ -13,6 +13,7 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
13
13
  import { homedir } from "node:os";
14
14
  import { join, resolve } from "node:path";
15
15
  import { globalConfigDir } from "../config/paths.js";
16
+ import { installPluginAssets } from "./install-plugin.js";
16
17
  const DEFAULT_COMPOSER_CONFIG = {
17
18
  roles: {
18
19
  researcher: { provider: "cli", cli: ["agy", "--dangerously-skip-permissions", "-p"] },
@@ -86,6 +87,15 @@ export function runGlobalInit(opts = {}) {
86
87
  steps.push(writeGlobalEnvJson(dir, opts.defaultBaseUrl ?? DEFAULT_BASE_URL, opts.defaultAuthToken ?? DEFAULT_AUTH_TOKEN_PLACEHOLDER));
87
88
  steps.push(ensureDir(claudeHome, "~/.claude directory"));
88
89
  steps.push(wireGlobalMcpServer(claudeHome));
90
+ // Wave 4 0.1.2: drop plugin assets at user-level so the orchestrator
91
+ // skill + subagents + /evolve + boundary hook auto-load in every project.
92
+ if (!opts.skipPluginAssets) {
93
+ const pluginSteps = installPluginAssets({
94
+ claudeHome,
95
+ pluginSourceDir: opts.pluginSourceDir,
96
+ });
97
+ steps.push(...pluginSteps);
98
+ }
89
99
  for (const s of steps) {
90
100
  const tag = s.status === "created" ? "+" : s.status === "updated" ? "~" : "=";
91
101
  log(` ${tag} ${s.name}${s.path ? ` (${s.path})` : ""}${s.reason ? ` — ${s.reason}` : ""}`);
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,yEAAyE;AACzE,yBAAyB;AACzB,qEAAqE;AACrE,yCAAyC;AACzC,qCAAqC;AACrC,yDAAyD;AACzD,EAAE;AACF,4EAA4E;AAC5E,gFAAgF;AAEhF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAyBrD,MAAM,uBAAuB,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O,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,2BAA2B,EAAE,CAAC;AACzG,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { InitStep } from "./init.js";
2
+ /**
3
+ * Resolve the plugin source directory shipped with this package.
4
+ * dist/cli/install-plugin.js (3 levels up) → package root → plugin/composer-mastermind/
5
+ */
6
+ export declare function defaultPluginSourceDir(): string;
7
+ export interface InstallPluginOptions {
8
+ /** Claude Code user home (defaults to $HOME/.claude). Tests inject a tmpdir. */
9
+ claudeHome: string;
10
+ /** Plugin source directory (defaults to defaultPluginSourceDir()). Tests inject. */
11
+ pluginSourceDir?: string;
12
+ }
13
+ /**
14
+ * Copy plugin assets into Claude Code user-level directories so they
15
+ * auto-load in every project. Idempotent — never overwrites a present file.
16
+ *
17
+ * Layout written:
18
+ * <claudeHome>/skills/composer-mastermind/SKILL.md
19
+ * <claudeHome>/agents/{coder,researcher,reviewer}.md
20
+ * <claudeHome>/commands/evolve.md
21
+ * <claudeHome>/hooks/composer-boundary_guard.sh
22
+ * <claudeHome>/settings.json — patched with PreToolUse entry
23
+ */
24
+ export declare function installPluginAssets(opts: InstallPluginOptions): InitStep[];
@@ -0,0 +1,124 @@
1
+ // Wave 4 0.1.2 — user-level plugin asset install.
2
+ //
3
+ // Drops composer-mastermind assets (SKILL.md, subagents, /evolve command,
4
+ // boundary_guard hook) into the user's ~/.claude/ tree so Claude Code
5
+ // auto-discovers them in every project. Companion to runGlobalInit().
6
+ //
7
+ // Source assets ship in the npm tarball under plugin/composer-mastermind/
8
+ // (added to package.json files whitelist in 0.1.2).
9
+ import { existsSync, mkdirSync, copyFileSync, chmodSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
10
+ import { dirname, join, resolve } from "node:path";
11
+ import { fileURLToPath } from "node:url";
12
+ /**
13
+ * Resolve the plugin source directory shipped with this package.
14
+ * dist/cli/install-plugin.js (3 levels up) → package root → plugin/composer-mastermind/
15
+ */
16
+ export function defaultPluginSourceDir() {
17
+ const here = dirname(fileURLToPath(import.meta.url));
18
+ return resolve(here, "..", "..", "plugin", "composer-mastermind");
19
+ }
20
+ /**
21
+ * Copy plugin assets into Claude Code user-level directories so they
22
+ * auto-load in every project. Idempotent — never overwrites a present file.
23
+ *
24
+ * Layout written:
25
+ * <claudeHome>/skills/composer-mastermind/SKILL.md
26
+ * <claudeHome>/agents/{coder,researcher,reviewer}.md
27
+ * <claudeHome>/commands/evolve.md
28
+ * <claudeHome>/hooks/composer-boundary_guard.sh
29
+ * <claudeHome>/settings.json — patched with PreToolUse entry
30
+ */
31
+ export function installPluginAssets(opts) {
32
+ const src = opts.pluginSourceDir ?? defaultPluginSourceDir();
33
+ const claudeHome = opts.claudeHome;
34
+ const steps = [];
35
+ steps.push(copyOne(join(src, "skills/composer-mastermind/SKILL.md"), join(claudeHome, "skills/composer-mastermind/SKILL.md"), "composer-mastermind SKILL.md"));
36
+ const agentsSrc = join(src, "agents");
37
+ if (existsSync(agentsSrc)) {
38
+ for (const file of readdirSync(agentsSrc).sort()) {
39
+ if (!file.endsWith(".md"))
40
+ continue;
41
+ steps.push(copyOne(join(agentsSrc, file), join(claudeHome, "agents", file), `agent ${file}`));
42
+ }
43
+ }
44
+ const commandsSrc = join(src, "commands");
45
+ if (existsSync(commandsSrc)) {
46
+ for (const file of readdirSync(commandsSrc).sort()) {
47
+ if (!file.endsWith(".md"))
48
+ continue;
49
+ steps.push(copyOne(join(commandsSrc, file), join(claudeHome, "commands", file), `command /${file.replace(/\.md$/, "")}`));
50
+ }
51
+ }
52
+ // Boundary hook — copy script + register in settings.json
53
+ const hookSrc = join(src, "hooks", "boundary_guard.sh");
54
+ const hookDest = join(claudeHome, "hooks", "composer-boundary_guard.sh");
55
+ steps.push(copyOne(hookSrc, hookDest, "composer boundary_guard.sh hook script", { exec: true }));
56
+ steps.push(wireBoundaryHook(claudeHome, hookDest));
57
+ return steps;
58
+ }
59
+ function copyOne(srcPath, destPath, label, opts = {}) {
60
+ if (!existsSync(srcPath)) {
61
+ return { name: label, status: "skipped", reason: `source missing: ${srcPath}` };
62
+ }
63
+ if (existsSync(destPath)) {
64
+ return { name: label, status: "skipped", path: destPath, reason: "already present; not overwritten" };
65
+ }
66
+ mkdirSync(dirname(destPath), { recursive: true });
67
+ copyFileSync(srcPath, destPath);
68
+ if (opts.exec)
69
+ chmodSync(destPath, 0o755);
70
+ return { name: label, status: "created", path: destPath };
71
+ }
72
+ /**
73
+ * Patch <claudeHome>/settings.json hooks.PreToolUse with a composer
74
+ * boundary entry. Skip if an entry already references composer-boundary_guard.
75
+ */
76
+ function wireBoundaryHook(claudeHome, hookScriptPath) {
77
+ const settingsPath = join(claudeHome, "settings.json");
78
+ const matcher = "Bash|Edit|Write|NotebookEdit";
79
+ const entry = {
80
+ matcher,
81
+ hooks: [{ type: "command", command: hookScriptPath }],
82
+ };
83
+ let current;
84
+ if (existsSync(settingsPath)) {
85
+ try {
86
+ current = JSON.parse(readFileSync(settingsPath, "utf8"));
87
+ }
88
+ catch {
89
+ return {
90
+ name: "~/.claude/settings.json boundary hook",
91
+ status: "skipped",
92
+ path: settingsPath,
93
+ reason: "settings.json not valid JSON; refusing to patch",
94
+ };
95
+ }
96
+ }
97
+ else {
98
+ mkdirSync(dirname(settingsPath), { recursive: true });
99
+ current = {};
100
+ }
101
+ const hooks = current["hooks"] ?? {};
102
+ const preToolUse = hooks["PreToolUse"] ?? [];
103
+ // Idempotency: skip if any existing PreToolUse entry already references our script.
104
+ const alreadyWired = preToolUse.some((e) => e.hooks?.some((h) => h.command === hookScriptPath));
105
+ if (alreadyWired) {
106
+ return {
107
+ name: "~/.claude/settings.json boundary hook",
108
+ status: "skipped",
109
+ path: settingsPath,
110
+ reason: "composer-boundary_guard already registered",
111
+ };
112
+ }
113
+ const nextPreToolUse = [...preToolUse, entry];
114
+ const nextHooks = { ...hooks, PreToolUse: nextPreToolUse };
115
+ const next = { ...current, hooks: nextHooks };
116
+ writeFileSync(settingsPath, JSON.stringify(next, null, 2) + "\n", "utf8");
117
+ return {
118
+ name: "~/.claude/settings.json boundary hook",
119
+ status: "updated",
120
+ path: settingsPath,
121
+ reason: `appended PreToolUse entry → ${hookScriptPath}`,
122
+ };
123
+ }
124
+ //# sourceMappingURL=install-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-plugin.js","sourceRoot":"","sources":["../../src/cli/install-plugin.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,0EAA0E;AAC1E,sEAAsE;AACtE,sEAAsE;AACtE,EAAE;AACF,0EAA0E;AAC1E,oDAAoD;AAEpD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC;;;GAGG;AACH,MAAM,UAAU,sBAAsB;IACpC,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACrD,OAAO,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC;AACpE,CAAC;AASD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAA0B;IAC5D,MAAM,GAAG,GAAG,IAAI,CAAC,eAAe,IAAI,sBAAsB,EAAE,CAAC;IAC7D,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACnC,MAAM,KAAK,GAAe,EAAE,CAAC;IAE7B,KAAK,CAAC,IAAI,CAAC,OAAO,CAChB,IAAI,CAAC,GAAG,EAAE,qCAAqC,CAAC,EAChD,IAAI,CAAC,UAAU,EAAE,qCAAqC,CAAC,EACvD,8BA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AAK,EAAE,SAAS,EAAE,CAAC;IAC9C,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1E,OAAO;QACL,IAAI,EAAE,uCAAuC;QAC7C,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,+BAA+B,cAAc,EAAE;KACxD,CAAC;AACJ,CAAC"}
@@ -6,6 +6,13 @@ export declare const ProviderIdSchema: z.ZodEnum<{
6
6
  mock: "mock";
7
7
  }>;
8
8
  export type ProviderIdParsed = z.infer<typeof ProviderIdSchema>;
9
+ export declare const ThinkingConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10
+ type: z.ZodLiteral<"enabled">;
11
+ budgetTokens: z.ZodNumber;
12
+ }, z.core.$strict>, z.ZodObject<{
13
+ type: z.ZodLiteral<"disabled">;
14
+ }, z.core.$strict>], "type">;
15
+ export type ThinkingConfig = z.infer<typeof ThinkingConfigSchema>;
9
16
  export declare const RoleConfigSchema: z.ZodObject<{
10
17
  provider: z.ZodEnum<{
11
18
  anthropic: "anthropic";
@@ -17,6 +24,13 @@ export declare const RoleConfigSchema: z.ZodObject<{
17
24
  baseUrl: z.ZodOptional<z.ZodURL>;
18
25
  model: z.ZodOptional<z.ZodString>;
19
26
  cli: z.ZodOptional<z.ZodArray<z.ZodString>>;
27
+ maxTokens: z.ZodOptional<z.ZodNumber>;
28
+ thinking: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
29
+ type: z.ZodLiteral<"enabled">;
30
+ budgetTokens: z.ZodNumber;
31
+ }, z.core.$strict>, z.ZodObject<{
32
+ type: z.ZodLiteral<"disabled">;
33
+ }, z.core.$strict>], "type">>;
20
34
  }, z.core.$strict>;
21
35
  export type RoleConfig = z.infer<typeof RoleConfigSchema>;
22
36
  export declare const RoleNameSchema: z.ZodEnum<{
@@ -54,6 +68,13 @@ export declare const ComposerConfigSchema: z.ZodObject<{
54
68
  baseUrl: z.ZodOptional<z.ZodURL>;
55
69
  model: z.ZodOptional<z.ZodString>;
56
70
  cli: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
+ maxTokens: z.ZodOptional<z.ZodNumber>;
72
+ thinking: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
73
+ type: z.ZodLiteral<"enabled">;
74
+ budgetTokens: z.ZodNumber;
75
+ }, z.core.$strict>, z.ZodObject<{
76
+ type: z.ZodLiteral<"disabled">;
77
+ }, z.core.$strict>], "type">>;
57
78
  }, z.core.$strict>;
58
79
  coder: z.ZodObject<{
59
80
  provider: z.ZodEnum<{
@@ -66,6 +87,13 @@ export declare const ComposerConfigSchema: z.ZodObject<{
66
87
  baseUrl: z.ZodOptional<z.ZodURL>;
67
88
  model: z.ZodOptional<z.ZodString>;
68
89
  cli: z.ZodOptional<z.ZodArray<z.ZodString>>;
90
+ maxTokens: z.ZodOptional<z.ZodNumber>;
91
+ thinking: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
92
+ type: z.ZodLiteral<"enabled">;
93
+ budgetTokens: z.ZodNumber;
94
+ }, z.core.$strict>, z.ZodObject<{
95
+ type: z.ZodLiteral<"disabled">;
96
+ }, z.core.$strict>], "type">>;
69
97
  }, z.core.$strict>;
70
98
  reviewer: z.ZodObject<{
71
99
  provider: z.ZodEnum<{
@@ -78,6 +106,13 @@ export declare const ComposerConfigSchema: z.ZodObject<{
78
106
  baseUrl: z.ZodOptional<z.ZodURL>;
79
107
  model: z.ZodOptional<z.ZodString>;
80
108
  cli: z.ZodOptional<z.ZodArray<z.ZodString>>;
109
+ maxTokens: z.ZodOptional<z.ZodNumber>;
110
+ thinking: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
111
+ type: z.ZodLiteral<"enabled">;
112
+ budgetTokens: z.ZodNumber;
113
+ }, z.core.$strict>, z.ZodObject<{
114
+ type: z.ZodLiteral<"disabled">;
115
+ }, z.core.$strict>], "type">>;
81
116
  }, z.core.$strict>;
82
117
  }, z.core.$strict>;
83
118
  spendAuthorization: z.ZodOptional<z.ZodObject<{
@@ -7,6 +7,19 @@ export const ProviderIdSchema = z.enum([
7
7
  "cli",
8
8
  "mock",
9
9
  ]);
10
+ export const ThinkingConfigSchema = z.discriminatedUnion("type", [
11
+ z
12
+ .object({
13
+ type: z.literal("enabled"),
14
+ budgetTokens: z.number().int().min(1024),
15
+ })
16
+ .strict(),
17
+ z
18
+ .object({
19
+ type: z.literal("disabled"),
20
+ })
21
+ .strict(),
22
+ ]);
10
23
  export const RoleConfigSchema = z
11
24
  .object({
12
25
  provider: ProviderIdSchema,
@@ -14,6 +27,8 @@ export const RoleConfigSchema = z
14
27
  baseUrl: z.url().optional(),
15
28
  model: z.string().min(1).optional(),
16
29
  cli: z.array(z.string().min(1)).min(1).optional(),
30
+ maxTokens: z.number().int().min(1).optional(),
31
+ thinking: ThinkingConfigSchema.optional(),
17
32
  })
18
33
  .strict();
19
34
  export const RoleNameSchema = z.enum(["researcher", "coder", "reviewer"]);
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,0EAA0E;AAE1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;IACrC,WAAW;IACX,mBAAmB;IACnB,KAAK;IACL,MAAM;CACP,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,QAAQ,EAAE,gBAAgB;IAC1B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACvC,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAC3B,KAAK,E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M,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;AAG1E,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,IAAI,CAAC;IACjD,aAAa;IACb,MAAM;IACN,MAAM;CACP,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC;KACtC,MAAM,CAAC;IACN,IAAI,EAAE,4BAA4B;IAClC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IACrD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;CACnD,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC;KAClC,MAAM,CAAC;IACN,KAAK,EAAE,CAAC;SACL,MAAM,CAAC;QACN,UAAU,EAAE,gBAAgB;QAC5B,KAAK,EAAE,gBAAgB;QACvB,QAAQ,EAAE,gBAAgB;KAC3B,CAAC;SACD,MAAM,EAAE;IACX,kBAAkB,EAAE,wBAAwB,CAAC,QAAQ,EAAE;CACxD,CAAC;KACD,MAAM,EAAE,CAAC"}
@@ -5,6 +5,12 @@ export interface AnthropicLike {
5
5
  create: (params: AnthropicCreateParams) => Promise<AnthropicCreateResult>;
6
6
  };
7
7
  }
8
+ export type ThinkingParam = {
9
+ type: "enabled";
10
+ budget_tokens: number;
11
+ } | {
12
+ type: "disabled";
13
+ };
8
14
  export interface AnthropicCreateParams {
9
15
  model: string;
10
16
  max_tokens: number;
@@ -15,6 +21,7 @@ export interface AnthropicCreateParams {
15
21
  text: string;
16
22
  }>;
17
23
  }>;
24
+ thinking?: ThinkingParam;
18
25
  }
19
26
  export interface AnthropicCreateResult {
20
27
  content: ReadonlyArray<{
@@ -31,6 +38,13 @@ export interface AnthropicCompatibleProviderOptions {
31
38
  apiKey: string;
32
39
  model: string;
33
40
  defaultMaxTokens?: number;
41
+ /** Extended-thinking knob; omit to disable. When type=enabled, budgetTokens is required. */
42
+ thinking?: {
43
+ type: "enabled";
44
+ budgetTokens: number;
45
+ } | {
46
+ type: "disabled";
47
+ };
34
48
  /** Override Anthropic SDK construction. Used by tests. */
35
49
  clientFactory?: (opts: {
36
50
  baseURL: string;
@@ -42,6 +56,7 @@ export declare class AnthropicCompatibleProvider implements IProvider {
42
56
  readonly modelLabel: string;
43
57
  private readonly client;
44
58
  private readonly defaultMaxTokens;
59
+ private readonly thinking?;
45
60
  constructor(opts: AnthropicCompatibleProviderOptions);
46
61
  healthCheck(): Promise<boolean>;
47
62
  execute(input: IProviderExecuteInput): Promise<IProviderExecuteOutput>;
@@ -9,6 +9,7 @@ export class AnthropicCompatibleProvider {
9
9
  modelLabel;
10
10
  client;
11
11
  defaultMaxTokens;
12
+ thinking;
12
13
  constructor(opts) {
13
14
  if (!opts.baseUrl)
14
15
  throw new Error("AnthropicCompatibleProvider: baseUrl required");
@@ -18,6 +19,20 @@ export class AnthropicCompatibleProvider {
18
19
  throw new Error("AnthropicCompatibleProvider: model required");
19
20
  this.modelLabel = opts.model;
20
21
  this.defaultMaxTokens = opts.defaultMaxTokens ?? DEFAULT_MAX_TOKENS;
22
+ if (opts.thinking) {
23
+ if (opts.thinking.type === "enabled") {
24
+ if (typeof opts.thinking.budgetTokens !== "number" || opts.thinking.budgetTokens < 1024) {
25
+ throw new Error("AnthropicCompatibleProvider: thinking.budgetTokens must be >=1024 when type=enabled (Anthropic SDK minimum)");
26
+ }
27
+ if (opts.thinking.budgetTokens >= this.defaultMaxTokens) {
28
+ throw new Error(`AnthropicCompatibleProvider: thinking.budgetTokens (${opts.thinking.budgetTokens}) must be less than max_tokens (${this.defaultMaxTokens}); set role.maxTokens higher`);
29
+ }
30
+ this.thinking = { type: "enabled", budget_tokens: opts.thinking.budgetTokens };
31
+ }
32
+ else {
33
+ this.thinking = { type: "disabled" };
34
+ }
35
+ }
21
36
  const factory = opts.clientFactory ?? DEFAULT_FACTORY;
22
37
  this.client = factory({ baseURL: opts.baseUrl, apiKey: opts.apiKey });
23
38
  }
@@ -32,11 +47,14 @@ export class AnthropicCompatibleProvider {
32
47
  userContent.push({ type: "text", text: `Context:\n${input.context}` });
33
48
  }
34
49
  userContent.push({ type: "text", text: input.prompt });
35
- const msg = await this.client.messages.create({
50
+ const params = {
36
51
  model: this.modelLabel,
37
52
  max_tokens: input.maxTokens ?? this.defaultMaxTokens,
38
53
  messages: [{ role: "user", content: userContent }],
39
- });
54
+ };
55
+ if (this.thinking)
56
+ params.thinking = this.thinking;
57
+ const msg = await this.client.messages.create(params);
40
58
  const text = msg.content
41
59
  .map((b) => (b.type === "text" && typeof b.text === "string" ? b.text : ""))
42
60
  .join("");
@@ -1 +1 @@
1
- {"version":3,"file":"AnthropicCompatibleProvider.js","sourceRoot":"","sources":["../../src/providers/AnthropicCompatibleProvider.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,gEAAgE;AAChE,yEAAyE;AAEzE,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAsC1C,MAAM,eAAe,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAuC,EAAiB,EAAE,CAClG,IAAI,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAA6B,CAAC;AAEjE,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,MAAM,OAAO,2BAA2B;IAC7B,EAAE,GAAe,WAAW,CAAC;IAC7B,UAAU,CAAS;IAEX,MAAM,CAAgB;IACtB,gBAAgB,CAAS;IAE1C,YAAY,IAAwC;QAClD,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACpF,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;QAClF,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,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AC,CAAC;QACzE,CAAC;QACD,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QAEvD,MAAM,MAAM,GAA0B;YACpC,KAAK,EAAE,IAAI,CAAC,UAAU;YACtB,UAAU,EAAE,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,gBAAgB;YACpD,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;SACnD,CAAC;QACF,IAAI,IAAI,CAAC,QAAQ;YAAE,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAEnD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAEtD,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO;aACrB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;aAC3E,IAAI,CAAC,EAAE,CAAC,CAAC;QAEZ,OAAO;YACL,IAAI;YACJ,QAAQ,EAAE,GAAG,CAAC,KAAK,CAAC,YAAY;YAChC,SAAS,EAAE,GAAG,CAAC,KAAK,CAAC,aAAa;SACnC,CAAC;IACJ,CAAC;CACF"}
package/dist/registry.js CHANGED
@@ -60,6 +60,8 @@ export class ProviderRegistry {
60
60
  baseUrl: roleConfig.baseUrl,
61
61
  apiKey,
62
62
  model,
63
+ defaultMaxTokens: roleConfig.maxTokens,
64
+ thinking: roleConfig.thinking,
63
65
  });
64
66
  }
65
67
  case "cli": {
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"m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AK;oBACL,gBAAgB,EAAE,UAAU,CAAC,SAAS;oBACtC,QAAQ,EAAE,UAAU,CAAC,QAAQ;iBAC9B,CAAC,CAAC;YACL,CAAC;YAED,KAAK,KAAK,CAAC,CAAC,CAAC;gBACX,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACnD,MAAM,IAAI,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;gBAC3D,CAAC;gBACD,OAAO,IAAI,WAAW,CAAC;oBACrB,GAAG,EAAE,UAAU,CAAC,GAAG;oBACnB,KAAK,EAAE,UAAU,CAAC,KAAK;iBACxB,CAAC,CAAC;YACL,CAAC;YAED,KAAK,mBAAmB;gBACtB,MAAM,IAAI,2BAA2B,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-composer",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "description": "Multi-agent orchestration MCP server. Claude orchestrates; GLM and agy do the work.",
6
6
  "bin": {
@@ -8,6 +8,7 @@
8
8
  },
9
9
  "files": [
10
10
  "dist/",
11
+ "plugin/",
11
12
  "composer.config.schema.json",
12
13
  "README.md"
13
14
  ],
@@ -0,0 +1,50 @@
1
+ # composer-mastermind
2
+
3
+ > Multi-agent orchestrator plugin for Claude Code. Claude orchestrates; GLM and agy execute.
4
+
5
+ ## What it is
6
+
7
+ Composer-mastermind is a Claude Code plugin that turns the main session into a coordinator. The orchestrator never writes code, runs bash, or edits files directly — instead it dispatches work through three subagents wired to the `agent-composer` MCP server:
8
+
9
+ | Subagent | Tool | Role |
10
+ |---|---|---|
11
+ | `coder` | `mcp__composer__composer_code` | Writes code via GLM (Anthropic-compatible endpoint) |
12
+ | `researcher` | `mcp__composer__composer_research` | Docs lookup + research via `agy` CLI (Gemini) |
13
+ | `reviewer` | `mcp__composer__composer_review` | Code review via `agy` CLI |
14
+
15
+ The orchestrator's allowed-tool surface is enforced by `boundary_guard.sh` — `Edit`, `Write`, `Bash`, `NotebookEdit` are denied; only the three composer MCP tools plus `Read`/`Glob` pass.
16
+
17
+ ## What's inside
18
+
19
+ ```
20
+ composer-mastermind/
21
+ ├── plugin.json # this manifest
22
+ ├── skills/composer-mastermind/SKILL.md # the orchestrator brain
23
+ ├── agents/ # haiku-wrapped subagent defs
24
+ │ ├── coder.md
25
+ │ ├── researcher.md
26
+ │ └── reviewer.md
27
+ ├── commands/
28
+ │ └── evolve.md # /evolve slash command (GEPA loop)
29
+ └── hooks/
30
+ ├── boundary_guard.sh # PreToolUse fail-closed boundary
31
+ └── learn.sh # Stop hook — append user corrections
32
+ ```
33
+
34
+ ## Requires
35
+
36
+ - `agent-composer` (peer; install via `npx agent-composer` or global npm install)
37
+ - A `composer.config.json` + `.env.json` at the consumer project root (run `npx composer-mcp init` to scaffold; see ADR 0002 M0.3)
38
+ - Claude Code ≥4.6
39
+
40
+ ## Self-evolution surface
41
+
42
+ `/evolve --eval-mode real` mutates only the project-local copy of `SKILL.md` (`.claude/skills/composer-mastermind/SKILL.md`), never the plugin install. Plugin updates ship via npm; per-project skill drift is intentional. See ADR 0003 for the full mutation scope contract (S1 diff-path, S2 deny-list, S3 stat gate, S4 human-promote, S5 audit trail).
43
+
44
+ ## Source of truth
45
+
46
+ This is the **frozen v0.1.0 snapshot** of the composer-monorepo's canonical assets. The development instance lives at the upstream repo's `.claude/` tree; releases re-sync via M0.5 (see `scripts/release-sync.mjs`).
47
+
48
+ ## License
49
+
50
+ MIT.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: coder
3
+ description: Use when the orchestrator needs code written, refactored, debugged, or implemented. Delegates the actual coding to the composer_code MCP tool.
4
+ tools: mcp__composer__composer_code, Read, Glob
5
+ model: haiku
6
+ ---
7
+
8
+ You are the Composer **Coder** subagent. Your only job is to call the
9
+ `composer_code` MCP tool with the orchestrator's implementation request
10
+ and return its output.
11
+
12
+ # What you DO
13
+
14
+ - Receive the orchestrator's `{ prompt, context? }` brief.
15
+ - Use `Read` / `Glob` to pin exact file paths, surrounding code, and
16
+ imports into the `prompt` / `context` arguments — the coder provider
17
+ cannot see the repo itself.
18
+ - Call `mcp__composer__composer_code` once.
19
+ - Return the tool output verbatim (usually a diff or code block).
20
+
21
+ # What you DO NOT do
22
+
23
+ - DO NOT write code yourself.
24
+ - DO NOT edit files.
25
+ - DO NOT execute commands.
26
+ - DO NOT call any tool other than `composer_code`, `Read`, or `Glob`.
27
+ - DO NOT critique the returned code — that is the reviewer's job.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: researcher
3
+ description: Use when the orchestrator needs research, documentation lookup, web search, current API shape, or any external context. Delegates the actual research to the composer_research MCP tool.
4
+ tools: mcp__composer__composer_research, Read, Glob
5
+ model: haiku
6
+ ---
7
+
8
+ You are the Composer **Researcher** subagent. Your only job is to call
9
+ the `composer_research` MCP tool with the user's question and return its
10
+ output to the orchestrator.
11
+
12
+ # What you DO
13
+
14
+ - Read the orchestrator's research question.
15
+ - Optionally use `Read` or `Glob` to quote the relevant file path or
16
+ snippet into the `prompt` argument so the research provider has the
17
+ exact context.
18
+ - Call `mcp__composer__composer_research` once with `{ prompt, context? }`.
19
+ - Return the tool output verbatim. Do NOT paraphrase, summarize, or
20
+ augment with your own knowledge.
21
+
22
+ # What you DO NOT do
23
+
24
+ - DO NOT search the web yourself.
25
+ - DO NOT speculate when the tool returns "unknown" — pass that through.
26
+ - DO NOT call any tool other than `composer_research`, `Read`, or `Glob`.
27
+ - DO NOT write, edit, or execute anything.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: reviewer
3
+ description: Use when the orchestrator needs code review, diff critique, or bug-finding on a candidate patch before integration. Delegates the actual review to the composer_review MCP tool.
4
+ tools: mcp__composer__composer_review, Read, Glob
5
+ model: haiku
6
+ ---
7
+
8
+ You are the Composer **Reviewer** subagent. Your only job is to call
9
+ the `composer_review` MCP tool with `{ prompt, diff }` and return its
10
+ findings.
11
+
12
+ # What you DO
13
+
14
+ - Receive the orchestrator's review focus (`prompt`) and the candidate
15
+ patch (`diff`).
16
+ - Use `Read` / `Glob` to load surrounding files when the diff alone is
17
+ insufficient context for the reviewer provider.
18
+ - Call `mcp__composer__composer_review` once.
19
+ - Return the tool output verbatim (a list of findings, severity, line refs).
20
+
21
+ # What you DO NOT do
22
+
23
+ - DO NOT propose fixes — only flag issues.
24
+ - DO NOT edit, write, or execute anything.
25
+ - DO NOT call any tool other than `composer_review`, `Read`, or `Glob`.
26
+ - DO NOT soften or rephrase the reviewer's output — the orchestrator
27
+ needs the raw verdict.
@@ -0,0 +1,62 @@
1
+ # /evolve — autoresearch loop for composer-mastermind
2
+
3
+ Kick off GEPA-lite autoresearch to evolve the orchestrator skill (`.claude/skills/composer-mastermind/SKILL.md`). Runs a synthetic v1 scorer to propose improvements; writes the candidate to `.claude/skills/composer-mastermind/SKILL.candidate.md` for manual review.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ /evolve
9
+ # Defaults: budget $2.00, max 10 rounds.
10
+
11
+ /evolve --budget-usd 1.00 --max-rounds 5
12
+ # Custom spend cap and round limit.
13
+ ```
14
+
15
+ ## What it runs
16
+
17
+ Invokes `./node_modules/.bin/tsx scripts/run-evolve.ts` with parsed CLI arguments. The driver wires real providers (GLM 5.1 for reflection, `agy` CLI for research) and a synthetic scorer into `runEvolve()`.
18
+
19
+ ## Winner
20
+
21
+ If the evolve loop finds an improvement, the candidate is written to:
22
+ ```
23
+ .claude/skills/composer-mastermind/SKILL.candidate.md
24
+ ```
25
+
26
+ Promote manually after review:
27
+ ```bash
28
+ mv .claude/skills/composer-mastermind/SKILL.candidate.md \
29
+ .claude/skills/composer-mastermind/SKILL.md
30
+ ```
31
+
32
+ If no improvement is detected, the file is not written; the original SKILL.md stands.
33
+
34
+ ## Cost
35
+
36
+ Each provider call costs ~$0.025 (GLM reflection). The default $2.00 budget covers ~80 calls. Real spend routes through GLM coder and `agy` CLI per `composer.config.json` spend authorization settings.
37
+
38
+ ## Output
39
+
40
+ The summary prints to stdout:
41
+
42
+ - Round history table: `| round | operator | parentScore | candidateScore | promoted | reason |`
43
+ - `stoppedAt: <plateau|budget|maxRounds>`
44
+ - `postflight: accept=<true|false> reason="..."`
45
+ - `budgetStats: calls=N usd=$X.XXXX`
46
+ - Parent vs. winner score improvement
47
+
48
+ ## Safety
49
+
50
+ - Respects `composer.config.json` `spendAuthorization.maxUsdPerSession`. If `--budget-usd` exceeds the cap, the script exits with an error message and exit code 1 before spending.
51
+ - Loop termination is governed by `runEvolve()` itself: whichever of budget, plateau, or `--max-rounds` hits first. To abort mid-loop, send SIGINT (Ctrl-C); the script exits without writing `SKILL.candidate.md` unless the write step already completed.
52
+ - Task descriptions in `evals/tasks.jsonl` are passed verbatim to the reflection provider — keep that file under version control to retain a clear trust boundary.
53
+ - **SKILL.md edits are safe during a real-mode run.** Each task eval runs in a throwaway `git worktree` at `/tmp/composer-eval-<pid>-<taskId>`. The candidate skill is written only into the worktree copy; the real repo's SKILL.md is never touched during evaluation. You can freely edit SKILL.md in your editor while `/evolve --eval-mode real` is running.
54
+
55
+ ## v1 caveat
56
+
57
+ The v1 scorer is synthetic (heuristic-based):
58
+ - 0.4 points for substring "dispatch" (case-insensitive)
59
+ - 0.2 points for substring "Read" (case-sensitive, the tool name)
60
+ - 0.4 points scaled by character count (peak at 4000 chars, linear falloff to 0 outside 2000–6000)
61
+
62
+ Real eval-against-eval-tasks lands in v2.
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env bash
2
+ # Wave 1 F1.5 — Composer boundary enforcement (PreToolUse hook).
3
+ # Contract per docs/adr/0001-contracts.md §C0.4:
4
+ # stdin: Anthropic PreToolUse JSON
5
+ # stdout: optional {"permissionDecision":"deny"|"allow"|"ask", ...}
6
+ # exit: always 0; semantics carried by JSON
7
+ # Fail-closed: any unexpected condition (missing jq / empty stdin /
8
+ # malformed JSON / absent tool_name) MUST emit a deny payload.
9
+
10
+ set -u
11
+
12
+ emit_deny() {
13
+ local reason="$1"
14
+ jq -nc --arg r "$reason" \
15
+ '{hookEventName:"PreToolUse", permissionDecision:"deny", permissionDecisionReason:$r}' 2>/dev/null \
16
+ || printf '{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"%s"}\n' "$reason"
17
+ exit 0
18
+ }
19
+
20
+ # 1. Dependency: jq is mandatory for safe JSON parsing.
21
+ if ! command -v jq >/dev/null 2>&1; then
22
+ # Cannot use emit_deny (depends on jq); inline fallback.
23
+ printf '{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"boundary_guard: jq missing, failing closed"}\n'
24
+ exit 0
25
+ fi
26
+
27
+ # 2. Read tool-call JSON from stdin.
28
+ INPUT="$(cat || true)"
29
+ if [[ -z "$INPUT" ]]; then
30
+ emit_deny "boundary_guard: empty stdin, failing closed"
31
+ fi
32
+
33
+ # 3. Parse tool_name. jq surfaces parse errors to stderr (suppressed) and
34
+ # returns empty on missing/null — both treated as malformed.
35
+ TOOL="$(jq -r '.tool_name // empty' <<<"$INPUT" 2>/dev/null)"
36
+ if [[ -z "$TOOL" ]]; then
37
+ emit_deny "boundary_guard: malformed JSON or missing tool_name, failing closed"
38
+ fi
39
+
40
+ # 3.5. COMPOSER_DANGEROUSLY_BYPASS_PERMISSIONS (dev-only escape hatch).
41
+ # When env var equals "1" or "true", allow every tool. Stderr-warns on
42
+ # every invocation so the bypass is visible in transcripts. Intended
43
+ # for bootstrap / dev sessions only. NEVER set in CI or runtime.
44
+ # See ADR 0001 amendment (2026-05-23, Wave-3 Step 1).
45
+ BYPASS="${COMPOSER_DANGEROUSLY_BYPASS_PERMISSIONS:-}"
46
+ if [[ "$BYPASS" == "1" || "$BYPASS" == "true" ]]; then
47
+ printf 'WARN boundary_guard: COMPOSER_DANGEROUSLY_BYPASS_PERMISSIONS=%s — boundary disabled, dev mode only\n' "$BYPASS" >&2
48
+ exit 0
49
+ fi
50
+
51
+ # 3.6. STOP_EVOLVE killswitch.
52
+ # If sentinel file exists AND the tool is a composer dispatch, deny.
53
+ # Sentinel path overridable via COMPOSER_STOP_EVOLVE_FILE (tests use
54
+ # a temp file); default "$CLAUDE_PROJECT_DIR/STOP_EVOLVE", falling
55
+ # back to "./STOP_EVOLVE" when CLAUDE_PROJECT_DIR is unset.
56
+ STOP_FILE="${COMPOSER_STOP_EVOLVE_FILE:-${CLAUDE_PROJECT_DIR:-.}/STOP_EVOLVE}"
57
+ if [[ -e "$STOP_FILE" ]] && [[ "$TOOL" == mcp__composer__* ]]; then
58
+ emit_deny "STOP_EVOLVE sentinel present at $STOP_FILE — Composer dispatches paused."
59
+ fi
60
+
61
+ # 4. Block list — native dangerous tools + MCP-prefixed variants.
62
+ case "$TOOL" in
63
+ Bash|Edit|Write|NotebookEdit \
64
+ | mcp__*__write_file | mcp__*__edit_file | mcp__*__bash \
65
+ | mcp__*__write | mcp__*__edit | mcp__*__exec)
66
+ emit_deny "Composer orchestrator forbids direct ${TOOL}. Delegate via Task to researcher / coder / reviewer."
67
+ ;;
68
+ esac
69
+
70
+ # 5. Pass-through. Emit nothing — Anthropic treats absent JSON + exit 0
71
+ # as implicit allow. (Explicit allow JSON is also valid but noisier.)
72
+ exit 0
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env bash
2
+ # Wave 1 F1.11 — passive learning log (T1 self-evolution tier).
3
+ # Runs as a Stop hook. Appends correction-shaped user messages from the
4
+ # current session transcript into .claude/learnings/<month>.md.
5
+ #
6
+ # Fail-safe: any missing dependency, missing transcript, or parse error
7
+ # results in a silent no-op (exit 0). This MUST NOT block session-end.
8
+
9
+ set -u
10
+
11
+ PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
12
+ LEARN_DIR="$PROJECT_DIR/.claude/learnings"
13
+ MONTH="$(date +%Y-%m)"
14
+ OUT="$LEARN_DIR/${MONTH}.md"
15
+
16
+ # Read JSON envelope from stdin (Anthropic Stop hook contract).
17
+ INPUT="$(cat || true)"
18
+ if [[ -z "$INPUT" ]]; then
19
+ exit 0
20
+ fi
21
+
22
+ if ! command -v jq >/dev/null 2>&1; then
23
+ exit 0
24
+ fi
25
+
26
+ TRANSCRIPT_PATH="$(jq -r '.transcript_path // empty' <<<"$INPUT" 2>/dev/null)"
27
+ if [[ -z "$TRANSCRIPT_PATH" || ! -f "$TRANSCRIPT_PATH" ]]; then
28
+ exit 0
29
+ fi
30
+
31
+ mkdir -p "$LEARN_DIR" 2>/dev/null || exit 0
32
+
33
+ # Trigger words for "correction-shaped" user messages.
34
+ # Conservative regex; expand from real data over time.
35
+ TRIGGER='(?i)\b(no|don.t|do not|wrong|stop|actually|instead|never|please don.t)\b'
36
+
37
+ # Anthropic transcripts are JSONL (one event per line). Filter user-role
38
+ # events whose content matches the trigger regex, then append a short
39
+ # bullet per match. Truncate to 240 chars to keep the log scannable.
40
+ {
41
+ printf '\n## Session ended %s\n\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
42
+ jq -r --arg trig "$TRIGGER" '
43
+ select(.role == "user" or .type == "user")
44
+ | (.content // .message // "") as $raw
45
+ | (if ($raw | type) == "array" then ($raw | map(.text // "") | join(" ")) else ($raw | tostring) end) as $text
46
+ | select($text | test($trig))
47
+ | "- " + ($text | gsub("\\s+"; " ") | .[0:240])
48
+ ' "$TRANSCRIPT_PATH" 2>/dev/null
49
+ } >> "$OUT" 2>/dev/null || true
50
+
51
+ exit 0
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "composer-mastermind",
3
+ "version": "0.1.0",
4
+ "description": "Multi-agent orchestrator: Claude as brain, GLM/agy as executors. Dispatches code/research/review work to subagents wired through the @composer-mcp/server MCP server.",
5
+ "claudeCodeVersion": ">=4.6",
6
+ "requires": ["agent-composer"],
7
+ "settings": {
8
+ "PreToolUse": ["bash:hooks/boundary_guard.sh"],
9
+ "Stop": ["bash:hooks/learn.sh"]
10
+ },
11
+ "skills": ["skills/composer-mastermind/SKILL.md"],
12
+ "agents": [
13
+ "agents/coder.md",
14
+ "agents/researcher.md",
15
+ "agents/reviewer.md"
16
+ ],
17
+ "commands": ["commands/evolve.md"],
18
+ "license": "MIT"
19
+ }
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: composer-mastermind
3
+ description: Use when the user asks for code, research, documentation lookup, or code review. Routes the work to the matching subagent (researcher / coder / reviewer) and keeps plan/integration context in the main session. This skill defines an orchestration pattern — it is not a standalone library or external SDK.
4
+ ---
5
+
6
+ # Composer Mastermind
7
+
8
+ You are the **orchestrator**. Your sole job is memory, planning,
9
+ delegation, and integration. Workers (the `researcher`, `coder`, and
10
+ `reviewer` subagents) execute. Your context window is the most expensive
11
+ resource in the entire system — spend it on planning, not on raw worker
12
+ output.
13
+
14
+ > **Note:** This is an orchestration *pattern*, not an external SDK or
15
+ > published framework. There is no library to install, no package to
16
+ > version-check, and no upstream changelog to monitor. All guidance below
17
+ > is about local session behaviour.
18
+
19
+ # Hard prohibitions
20
+
21
+ - **DO NOT** use `Edit`, `Write`, `Bash`, or `NotebookEdit`. If you
22
+ need any of these, delegate to a subagent or ask the user.
23
+ - **DO NOT** call `mcp__composer__composer_research`, `composer_code`,
24
+ or `composer_review` directly from the main session. **ALWAYS**
25
+ dispatch via the `Task` tool to the matching subagent so the worker's
26
+ context window stays isolated and only the summary returns to you.
27
+ - **NEVER** write code in the main session — not even a one-liner. Delegate to `coder`.
28
+ - **NEVER** speculate when a fact is needed. Delegate to `researcher`.
29
+ - **NEVER** integrate a candidate patch without review. Delegate to
30
+ `reviewer` first.
31
+
32
+ # Delegation rules (hard)
33
+
34
+ | If the user (or your plan) needs… | Use the `Task` tool to dispatch to |
35
+ |---|---|
36
+ | Information, docs, web search, current API shape, "what's the X best practice" | `researcher` subagent |
37
+ | Writing new code, refactoring, debugging, fixing a bug | `coder` subagent |
38
+ | Reviewing a candidate patch / diff / implementation | `reviewer` subagent |
39
+ | Anything that mutates state outside the conversation (push, deploy, install) | Escalate to the user. Do not act. |
40
+
41
+ For multi-step requests, dispatch in order: `researcher` → plan →
42
+ `coder` → `reviewer` → integrate. Each `Task` call returns only the
43
+ subagent's summary; you hold the plan across the chain.
44
+
45
+ **Dispatch calibration:** dispatch costs ~1.5k cache tokens for
46
+ skill+agent registry plus one Task roundtrip. The split saves tokens
47
+ when the worker's expected output exceeds inline cost — roughly when
48
+ you'd emit >500 output tokens, or when work touches files you haven't
49
+ pinned. For tiny clarifications / refusals / one-line answers,
50
+ **inline is correct**. Heavy work (multi-file code, real research,
51
+ multi-step refactors) is where dispatch pays. Trust your
52
+ expected-output estimate; if under 5 lines, just answer.
53
+
54
+ # Spend authorization
55
+
56
+ Read `composer.config.json` `spendAuthorization.mode` before any
57
+ dispatch that hits a real-money provider (`anthropic`,
58
+ `openai_compatible`):
59
+
60
+ - `interactive` (default if field omitted): state the budget, show
61
+ the planned call, ask the user `go` before invoking the worker.
62
+ - `auto`: dispatch without asking. Respect `maxUsdPerCall` and
63
+ `maxUsdPerSession` caps; refuse with a short message if either would
64
+ be exceeded.
65
+ - `deny`: refuse all dispatches to priced providers. Tell the user
66
+ the config blocks real spend and suggest flipping to `mock` or
67
+ recording a fixture.
68
+
69
+ CLI providers (`agy`) are billed separately by the user's own auth
70
+ and do not count toward these caps. Mock providers are always free.
71
+
72
+ # Token discipline
73
+
74
+ - You hold context, plans, and integration. Workers hold execution.
75
+ - A worker returning >2k tokens is a smell — re-issue with a tighter
76
+ prompt or break the request into smaller steps.
77
+ - Use `Read` / `Glob` / `Grep` yourself ONLY to pin file paths and line
78
+ numbers into the worker's prompt. Never read a full file into your
79
+ own context.
80
+ - When reporting worker results, quote one key line or give a
81
+ one-sentence outcome — never paste the full worker output back.
82
+
83
+ # Prior learnings
84
+
85
+ @.claude/learnings/index.md