Skip to content

Commit 7c9dbb8

Browse files
committed
refactor(ce-work-beta): move config to .compound-engineering/config.local.toml
Migrates delegation settings from .claude/compound-engineering.local.md (YAML frontmatter) to .compound-engineering/config.local.toml (plain TOML). The new path is platform-agnostic and aligns with the planned config storage redesign. TOML is a better fit for flat key-value config — supports comments, no whitespace traps, no implicit type coercion.
1 parent b3e2630 commit 7c9dbb8

5 files changed

Lines changed: 32 additions & 34 deletions

File tree

plugins/compound-engineering/compound-engineering.local.example.md

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Compound Engineering — local config
2+
# Copy to .compound-engineering/config.local.toml in your project root.
3+
# All settings are optional. Invalid values fall through to defaults.
4+
5+
# work_delegate = "codex" # "codex" | false (default: false)
6+
# work_delegate_consent = true # true | false (default: false)
7+
# work_delegate_sandbox = "yolo" # "yolo" | "full-auto" (default: "yolo")
8+
# work_delegate_decision = "auto" # "auto" | "ask" (default: "auto")
9+
# work_delegate_model = "gpt-5.4" # any valid codex model (default: "gpt-5.4")
10+
# work_delegate_effort = "high" # "minimal" | "low" | "medium" | "high" | "xhigh" (default: "high")

plugins/compound-engineering/skills/ce-work-beta/SKILL.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Parse `$ARGUMENTS` for the following optional tokens. Strip each recognized toke
2626
| Token | Example | Effect |
2727
|-------|---------|--------|
2828
| `delegate:codex` | `delegate:codex` | Activate Codex delegation mode for plan execution |
29-
| `delegate:local` | `delegate:local` | Deactivate delegation even if enabled in local.md |
29+
| `delegate:local` | `delegate:local` | Deactivate delegation even if enabled in config |
3030

3131
All tokens are optional. When absent, fall back to the resolution chain below.
3232

@@ -39,25 +39,25 @@ All tokens are optional. When absent, fall back to the resolution chain below.
3939
After extracting tokens from arguments, resolve the delegation state using this precedence chain:
4040

4141
1. **Argument flag** -- `delegate:codex` or `delegate:local` from the current invocation (highest priority)
42-
2. **local.md setting** -- Read `.claude/compound-engineering.local.md` and extract `work_delegate` from YAML frontmatter. Value `codex` activates delegation; `false` deactivates.
42+
2. **Config file** -- Read `.compound-engineering/config.local.toml` in the repo root. Extract `work_delegate` from the TOML keys. Value `"codex"` activates delegation; `false` deactivates.
4343
3. **Hard default** -- `false` (delegation off)
4444

45-
To read local.md: open the file, extract content between the opening and closing `---` delimiters (YAML frontmatter), and interpret the keys. If the file is missing, empty, has malformed frontmatter, or any setting has an unrecognized value, fall through to the hard default for that setting.
45+
To read the config file: open `.compound-engineering/config.local.toml` and parse it as TOML. If the file is missing, empty, malformed, or any setting has an unrecognized value, fall through to the hard default for that setting.
4646

47-
Also read from local.md when present:
47+
Also read from the config file when present:
4848
- `work_delegate_consent` -- `true` or default `false`
49-
- `work_delegate_sandbox` -- `yolo` (default) or `full-auto`
50-
- `work_delegate_decision` -- `auto` (default) or `ask`
51-
- `work_delegate_model` -- Codex model to use (default `gpt-5.4`). Passthrough — any valid model name accepted.
52-
- `work_delegate_effort` -- `minimal`, `low`, `medium`, `high` (default), or `xhigh`
49+
- `work_delegate_sandbox` -- `"yolo"` (default) or `"full-auto"`
50+
- `work_delegate_decision` -- `"auto"` (default) or `"ask"`
51+
- `work_delegate_model` -- Codex model to use (default `"gpt-5.4"`). Passthrough — any valid model name accepted.
52+
- `work_delegate_effort` -- `"minimal"`, `"low"`, `"medium"`, `"high"` (default), or `"xhigh"`
5353

5454
Store the resolved state for downstream consumption:
5555
- `delegation_active` -- boolean, whether delegation mode is on
56-
- `delegation_source` -- `argument` or `local.md` or `default` -- how delegation was resolved (used by environment guard to decide notification verbosity)
57-
- `sandbox_mode` -- `yolo` or `full-auto` (from local.md or default `yolo`)
58-
- `consent_granted` -- boolean (from local.md `work_delegate_consent`)
59-
- `delegate_model` -- string (from local.md or default `gpt-5.4`)
60-
- `delegate_effort` -- string (from local.md or default `high`)
56+
- `delegation_source` -- `argument` or `config` or `default` -- how delegation was resolved (used by environment guard to decide notification verbosity)
57+
- `sandbox_mode` -- `yolo` or `full-auto` (from config or default `yolo`)
58+
- `consent_granted` -- boolean (from config `work_delegate_consent`)
59+
- `delegate_model` -- string (from config or default `gpt-5.4`)
60+
- `delegate_effort` -- string (from config or default `high`)
6161

6262
---
6363

plugins/compound-engineering/skills/ce-work-beta/references/codex-delegation-workflow.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fi
4949
If `inside_sandbox` is true, delegation would recurse or fail.
5050

5151
- If `delegation_source` is `argument`: emit "Already inside Codex sandbox -- using standard mode." and set `delegation_active` to false.
52-
- If `delegation_source` is `local.md` or `default`: set `delegation_active` to false silently.
52+
- If `delegation_source` is `config` or `default`: set `delegation_active` to false silently.
5353

5454
**2. Availability Check**
5555

@@ -61,7 +61,7 @@ If the Codex CLI is not on PATH: emit "Codex CLI not found -- using standard mod
6161

6262
**3. Consent Flow**
6363

64-
If `consent_granted` is not true (from local.md `work_delegate_consent`):
64+
If `consent_granted` is not true (from config `work_delegate_consent`):
6565

6666
Present a one-time consent warning using the platform's blocking question tool (AskUserQuestion in Claude Code). The consent warning explains:
6767
- Delegation sends implementation units to `codex exec` as a structured prompt
@@ -71,16 +71,16 @@ Present a one-time consent warning using the platform's blocking question tool (
7171
Present the sandbox mode choice: (1) yolo (recommended), (2) full-auto.
7272

7373
On acceptance:
74-
- Write `work_delegate_consent: true` and `work_delegate_sandbox: <chosen-mode>` to `.claude/compound-engineering.local.md` YAML frontmatter
75-
- To write local.md: (1) if file does not exist, create it with YAML frontmatter wrapper; (2) if file exists with valid frontmatter, merge new keys preserving existing keys; (3) if file exists without frontmatter or with malformed frontmatter, prepend a valid frontmatter block and preserve existing body content below the closing `---`
74+
- Write `work_delegate_consent = true` and `work_delegate_sandbox = "<chosen-mode>"` to `.compound-engineering/config.local.toml`
75+
- To write: (1) if file or directory does not exist, create `.compound-engineering/` and write the TOML file; (2) if file exists, merge new keys preserving existing keys
7676
- Update `consent_granted` and `sandbox_mode` in the resolved state
7777

7878
On decline:
7979
- Ask whether to disable delegation entirely for this project
80-
- If yes: write `work_delegate: false` to local.md, set `delegation_active` to false, proceed in standard mode
80+
- If yes: write `work_delegate = false` to `.compound-engineering/config.local.toml`, set `delegation_active` to false, proceed in standard mode
8181
- If no: set `delegation_active` to false for this invocation only, proceed in standard mode
8282

83-
**Headless consent:** If running in a headless or non-interactive context, delegation proceeds only if `work_delegate_consent` is already `true` in local.md. If consent is not recorded, set `delegation_active` to false silently.
83+
**Headless consent:** If running in a headless or non-interactive context, delegation proceeds only if `work_delegate_consent` is already `true` in the config file. If consent is not recorded, set `delegation_active` to false silently.
8484

8585
## Batching
8686

tests/pipeline-review-contract.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe("ce:work-beta codex delegation contract", () => {
109109
// Resolution chain present
110110
expect(content).toContain("### Settings Resolution Chain")
111111
expect(content).toContain("work_delegate")
112-
expect(content).toContain("compound-engineering.local.md")
112+
expect(content).toContain("config.local.toml")
113113
})
114114

115115
test("argument-hint includes delegate:codex for discoverability", async () => {
@@ -213,8 +213,8 @@ describe("ce:work-beta codex delegation contract", () => {
213213
const content = await readRepoFile("plugins/compound-engineering/skills/ce-work-beta/SKILL.md")
214214

215215
expect(content).toContain("work_delegate_decision")
216-
expect(content).toContain("`auto`")
217-
expect(content).toContain("`ask`")
216+
expect(content).toContain('"auto"')
217+
expect(content).toContain('"ask"')
218218
})
219219

220220
test("has frontend design guidance ported from beta", async () => {

0 commit comments

Comments
 (0)