taskchef 7.1.0 → 7.2.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskchef",
3
- "version": "7.1.0",
3
+ "version": "7.2.0",
4
4
  "description": "Dispatch work from a data-only workspace to visible Codex project tasks.",
5
5
  "author": {
6
6
  "name": "Favo Yang",
@@ -31,6 +31,7 @@
31
31
  "defaultPrompt": [
32
32
  "$taskchef-bootstrap Set up TaskChef in this folder.",
33
33
  "$taskchef-delegate Dispatch this request to the right project.",
34
+ "$taskchef-executor Execute this delegated TaskChef assignment.",
34
35
  "$taskchef-report Report on work in the TaskChef task history."
35
36
  ],
36
37
  "brandColor": "#D97706",
package/README.md CHANGED
@@ -31,7 +31,7 @@ codex plugin add taskchef@favoyang-plugins
31
31
  npm install --global taskchef
32
32
  ```
33
33
 
34
- The plugin provides three skills and a local MCP server. The npm installation
34
+ The plugin provides four skills and a local MCP server. The npm installation
35
35
  puts the `taskchef` CLI on `PATH`. TaskChef installs no hooks, schedules,
36
36
  daemons, or background identity search.
37
37
 
@@ -86,9 +86,20 @@ $taskchef-delegate In payments, add structured logs for failed retries and test
86
86
  ```
87
87
 
88
88
  TaskChef prepares a UUID and marker, persists the task before native creation,
89
- creates the executor, and returns its task link. The executor reads its own
90
- `CODEX_THREAD_ID` and self-links before substantive work. Independent
91
- outcomes may become separate executors; dependent work should stay together.
89
+ creates the executor, and returns its task link. New executor instructions keep
90
+ the assignment visible immediately after the marker and end with an explicit
91
+ `$taskchef-executor` invocation. That skill reads the executor's own
92
+ `CODEX_THREAD_ID`, self-links, and reports lifecycle state. Independent outcomes
93
+ may become separate executors; dependent work should stay together.
94
+
95
+ For example, TaskChef generates this shape:
96
+
97
+ ```text
98
+ <!-- taskchef_id=c0f010ff-84f2-4838-a69d-0ff1f5d721d7 -->
99
+ Fix duplicate charges after a retry and add a regression test.
100
+
101
+ Use $taskchef-executor to execute and report this delegated TaskChef assignment.
102
+ ```
92
103
 
93
104
  ## Work with and report executors
94
105
 
@@ -105,6 +116,11 @@ the last concise semantic result. A follow-up therefore appears as `working`
105
116
  immediately without erasing the previous outcome. TaskChef does not store the
106
117
  transcript or a lifecycle event log.
107
118
 
119
+ Delegated tasks created by earlier TaskChef versions remain compatible: their
120
+ inline executor protocol still parses, self-links, and may use the deprecated
121
+ `report_result` alias. The v7 inline-paragraph named exports remain as deprecated
122
+ historical snapshots, but new delegations use the executor skill and `report_state`.
123
+
108
124
  ## View and report tasks
109
125
 
110
126
  Ask the dispatcher for an on-demand report:
@@ -70,7 +70,7 @@ responsibility until an outcome is landed, transferred, or safely preserved.
70
70
  | Dimension | TaskChef 7 | FirstMate at `038d0f7` |
71
71
  | --- | --- | --- |
72
72
  | Primary goal | Put multi-project work into the right visible Codex task and make it findable later. | Let one person direct a supervised crew across projects through one liaison. |
73
- | Product form | Codex plugin: three skills, local MCP server, data CLI, and loopback dashboard. | Cloneable agent distribution: instructions, internal skills, scripts, policies, and private on-disk state. |
73
+ | Product form | Codex plugin: four skills, local MCP server, data CLI, and loopback dashboard. | Cloneable agent distribution: instructions, internal skills, scripts, policies, and private on-disk state. |
74
74
  | Runtime | Native Codex desktop tasks are the executors and live source of truth. | Harness-driven workers in tmux by default, with documented alternative session backends; Codex can be a harness, but Codex desktop is not a runtime backend. |
75
75
  | Coordinator lifetime | Dispatcher returns immediately and does not supervise. | First mate remains active and uses watcher/guard mechanisms to supervise meaningful events. |
76
76
  | Project isolation | Delegates to the configured Codex project; isolation follows native Codex/project behavior. | Ship and scout workers require separate Treehouse- or backend-managed worktrees. |
@@ -215,7 +215,7 @@ harness adapter.
215
215
  | --- | --- | --- |
216
216
  | Codex | Built around native Codex projects, tasks, thread reads, and desktop deep links. | Codex is one verified harness; desktop tasks are not its worker runtime. |
217
217
  | GitHub | Configured repository URLs aid routing; delivery remains the executor project's concern. | GitHub CLI, PR state, and configured delivery modes are part of supervised shipping workflows. |
218
- | Skills | Three plugin skills with narrow bootstrap, delegate, and report responsibilities. | Internal firstmate-only skills plus standalone public skills; AGENTS.md routes conditional procedures. |
218
+ | Skills | Four plugin skills with narrow bootstrap, delegate, executor, and report responsibilities. | Internal firstmate-only skills plus standalone public skills; AGENTS.md routes conditional procedures. |
219
219
  | MCP | Four primary local TaskChef tools plus one deprecated compatibility alias own deterministic identity and state writes. | FirstMate describes itself as an agent distribution rather than an MCP product; deterministic behavior lives largely in scripts. |
220
220
  | Runtime extensions | Extend plugin skills/MCP/CLI/dashboard or compose native Codex capabilities. | Add or verify harness adapters, session backends, dispatch profiles, operational scripts, and optional integrations. |
221
221
 
package/docs/spec.md CHANGED
@@ -18,7 +18,7 @@ is dated research, not contract.
18
18
  | **Delegated task** | One independently useful outcome represented by one TaskChef task UUID and snapshot. |
19
19
  | **Executor** | The native Codex task created to own and perform one delegated task. |
20
20
  | **Task record** | One complete JSON object in `tasks.jsonl`; it contains immutable intent/project fields and mutable identity/result fields. |
21
- | **Marker** | The exact first instruction line `<!-- taskchef_id=<lowercase full UUID> -->`, followed by a blank line. |
21
+ | **Marker** | The exact first instruction line `<!-- taskchef_id=<lowercase full UUID> -->`; new instructions begin the assignment on the next line. |
22
22
  | **Record-before-create** | Persisting a link-pending task before asking Codex to create its executor. |
23
23
  | **Self-linking** | The executor's one-way registration of its own canonical Codex UUIDv7 from `CODEX_THREAD_ID`. |
24
24
  | **Link-pending** | A working task whose `threadId` is null and `updatedBy` is `dispatcher`. |
@@ -26,7 +26,7 @@ is dated research, not contract.
26
26
  | **Last semantic result** | The most recent `completed`, `needs_input`, or `failed` outcome, preserved separately while a newer turn is working. |
27
27
  | **Current turn ID** | The canonical Codex UUIDv7 returned by an exact native read of the linked executor for the turn being reported. |
28
28
  | **Dashboard** | The loopback, read-only UI derived from validated workspace snapshots and bounded native actions. |
29
- | **Skill** | One packaged agent procedure: `taskchef-bootstrap`, `taskchef-delegate`, or `taskchef-report`. |
29
+ | **Skill** | One packaged agent procedure: `taskchef-bootstrap`, `taskchef-delegate`, `taskchef-executor`, or `taskchef-report`. |
30
30
 
31
31
  ## Components and ownership
32
32
 
@@ -34,6 +34,9 @@ is dated research, not contract.
34
34
  diagnostics. It MUST NOT dispatch or report unless separately requested.
35
35
  - `taskchef-delegate` MUST own routing and record-before-create delegation.
36
36
  It MUST return after creation and MUST NOT poll, supervise, or infer identity.
37
+ - `taskchef-executor` MUST own executor assignment ownership, self-linking,
38
+ exact thread/turn identity, per-turn state reporting, failure behavior,
39
+ privacy, and idempotency. It MUST NOT dispatch the owned assignment again.
37
40
  - `taskchef-report` MUST own on-demand reporting. It MUST NOT poll or persist
38
41
  inferred state.
39
42
  - The MCP server MUST expose four primary lifecycle tools plus the deprecated
@@ -99,8 +102,10 @@ fields MUST NOT change after recording.
99
102
 
100
103
  1. The dispatcher MUST call `prepare_dispatch` once per outcome.
101
104
  2. It MUST choose exactly one configured project and exact native-project path.
102
- 3. It MUST build the instruction from the returned marker, a blank line, the
103
- packaged executor contract paragraphs, and the user's outcome.
105
+ 3. It MUST build the instruction with the returned marker as line 1, the user's
106
+ outcome beginning on line 2, and exactly one concise explicit
107
+ `$taskchef-executor` invocation at the end after one blank line. It MUST NOT
108
+ inline the executor protocol into a new instruction.
104
109
  4. It MUST call `record_task` with `threadId: null` before native creation.
105
110
  5. It MUST create exactly one native Codex executor and return immediately.
106
111
  6. The executor MUST read its own `CODEX_THREAD_ID` and call `link_task`
@@ -117,6 +122,11 @@ If native creation fails after recording, the dispatcher MUST call
117
122
  A link failure MUST remain visible and retryable; the executor MUST report it
118
123
  visibly and MUST NOT continue substantive work.
119
124
 
125
+ Previously recorded instructions with the former blank line and inline
126
+ executor protocol MUST remain marker-readable and executable. Their
127
+ `report_result` calls MUST remain supported by the deprecated alias. New
128
+ instructions MUST use the explicit executor skill contract above.
129
+
120
130
  `needs_input` MUST mean a semantic user decision or missing fact. A native
121
131
  approval prompt MUST remain live Codex state and MUST NOT be stored as
122
132
  `needs_input`.
@@ -166,7 +176,7 @@ new preparation values, though it writes no state.
166
176
  | `id` | Non-empty string; MUST equal the instruction marker. |
167
177
  | `project` | Non-empty configured project path. |
168
178
  | `title` | Non-empty string. |
169
- | `instruction` | Non-empty string beginning with the exact marker and blank line. |
179
+ | `instruction` | Non-empty string beginning with the exact marker and at least one following instruction line. |
170
180
  | `threadId` | Literal null. |
171
181
 
172
182
  **Structured output:** `{ task: Task }`.
package/docs/workflows.md CHANGED
@@ -11,10 +11,11 @@ research.
11
11
  | Surface | Responsibility |
12
12
  | --- | --- |
13
13
  | `skills/taskchef-delegate/SKILL.md` | Split, route, record-before-create, create, return. |
14
+ | `skills/taskchef-executor/SKILL.md` | Own, self-link, execute, and report every executor turn. |
14
15
  | `skills/taskchef-bootstrap/SKILL.md` | Initialize current workspace and configure projects. |
15
16
  | `skills/taskchef-report/SKILL.md` | Select cached tasks and perform bounded live checks. |
16
17
  | `src/mcp.js` | Four primary lifecycle tools, one deprecated alias, and MCP annotations. |
17
- | `src/delegation.js` | UUID marker, executor contract paragraphs, and creation-failure handling. |
18
+ | `src/delegation.js` | UUID marker, concise executor-skill invocation shape, and creation-failure handling. |
18
19
  | `src/workspace.js` | Current schemas, validation, locking, atomic JSONL writes, linking, and result freshness. |
19
20
  | `src/cli.js` | Administration, inspection, diagnostics, and dashboard startup. |
20
21
  | `src/dashboard.js` | Validated snapshots, SSE fan-out, and bounded open actions. |
@@ -55,7 +56,7 @@ sequenceDiagram
55
56
  D->>C: Create executor with marked instruction
56
57
  C-->>D: Created-task reference
57
58
  D-->>U: Return immediately
58
- C->>E: Start executor
59
+ C->>E: Start executor and load $taskchef-executor
59
60
  E->>E: Read own CODEX_THREAD_ID
60
61
  E->>M: link_task(taskId, threadId)
61
62
  M->>W: linkTask()
@@ -67,6 +68,11 @@ Record-before-create makes native creation failure observable. Executor
67
68
  self-linking removes dispatcher-side polling, task search, title matching, and
68
69
  parent/child identity inference.
69
70
 
71
+ The generated task body begins immediately after the first-line marker and
72
+ ends with one explicit `$taskchef-executor` invocation. Older recorded tasks
73
+ whose marker is followed by a blank line and inline protocol remain readable;
74
+ the deprecated `report_result` alias preserves their semantic callbacks.
75
+
70
76
  ## State reporting
71
77
 
72
78
  The executor obtains the turn identity from an exact native read of its own
package/index.js CHANGED
@@ -33,6 +33,7 @@ export {
33
33
  EXECUTOR_LINK_PARAGRAPH,
34
34
  EXECUTOR_RESULT_PARAGRAPH,
35
35
  EXECUTOR_WORKING_PARAGRAPH,
36
+ EXECUTOR_SKILL_INVOCATION,
36
37
  createAndRecordDelegation,
37
38
  isProvisionalThreadId,
38
39
  normalizeCodexThreadId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskchef",
3
- "version": "7.1.0",
3
+ "version": "7.2.0",
4
4
  "description": "A non-blocking interactive dispatcher for visible Codex tasks.",
5
5
  "license": "MIT",
6
6
  "author": "Favo Yang",
@@ -33,6 +33,7 @@
33
33
  "src",
34
34
  "skills/taskchef-bootstrap",
35
35
  "skills/taskchef-delegate",
36
+ "skills/taskchef-executor",
36
37
  "skills/taskchef-report"
37
38
  ],
38
39
  "engines": {
@@ -38,7 +38,7 @@ all deterministic workspace operations.
38
38
  `codex add` or hard-code an application bundle path.
39
39
  3. `workspace init` takes no stdin, creates an empty
40
40
  configuration when missing, creates the one-entry-per-task JSONL log, and
41
- refreshes managed instructions. The installed plugin provides all three
41
+ refreshes managed instructions. The installed plugin provides all four
42
42
  TaskChef skills outside the dispatcher workspace.
43
43
  4. Run `doctor --json` after setup or when the user asks to diagnose the
44
44
  workspace. Doctor is read-only. Rerun `workspace init --json` to repair the
@@ -16,11 +16,9 @@ assignment. Execute it in the current task. Do not re-dispatch it merely
16
16
  because it concerns TaskChef or a configured project. Explicit requests to
17
17
  delegate separate work remain valid.
18
18
 
19
- Use the bundled `prepare_dispatch`, `record_task`, `link_task`, and
20
- `report_state` MCP tools directly. `report_result` is a deprecated compatibility
21
- alias and must not be emitted into new executor instructions. Never fall back to shell writes. If a
22
- required tool is unavailable, stop and report that the TaskChef plugin must be
23
- reloaded or installed.
19
+ Use the bundled `prepare_dispatch`, `record_task`, and `report_state` MCP tools
20
+ directly. Never fall back to shell writes. If a required tool is unavailable,
21
+ stop and report that the TaskChef plugin must be reloaded or installed.
24
22
 
25
23
  ## Boundaries
26
24
 
@@ -43,16 +41,15 @@ reloaded or installed.
43
41
  3. Route against configured project `name`, `description`, and canonical
44
42
  `githubRepos`; use `path` only as checkout identity. Require exactly one
45
43
  match and an exact native-project path. Ask instead of guessing.
46
- 4. Prefix each executor instruction with the preparation's exact marker as the
47
- first line, a blank line, and these required paragraphs before the body:
44
+ 4. Build each executor instruction in this exact shape:
48
45
 
49
- > This task owns the delegated assignment. Execute it in this task; do not re-dispatch it merely because it concerns TaskChef or a configured project. Explicit requests to delegate separate work remain valid.
50
-
51
- > Before any other work, read this executor's own durable Codex thread ID from the current task's CODEX_THREAD_ID environment value and call the TaskChef link_task MCP tool with that thread ID and the marked TaskChef task ID. Never use CODEX_SESSION_ID or the parent or delegator thread ID. If linking fails, CODEX_THREAD_ID is unavailable, or the tool is unavailable, report the failure visibly and retry on a later turn; do not guess an identity or continue substantive work while the task is link-pending.
52
-
53
- > After a successful initial link, and at the start of every follow-up turn before substantive work, read this exact Codex thread natively to obtain the current turn ID and call TaskChef report_state with the marked task ID, the self-linked thread ID, that current turn ID, status working, and summary omitted or null. link_task remains the first TaskChef action on the initial turn; do not report working before identity is linked. Never reuse a prior turn ID after a follow-up.
54
-
55
- > Before ending, read this exact Codex thread again and call TaskChef report_state for the same current working turn with status completed, needs_input, or failed and a concise summary. Use needs_input only for a semantic decision or information the user must provide; a native approval prompt is live Codex state, not a TaskChef result. Do not include secrets, transcripts, or raw command output.
46
+ - Keep the preparation's exact marker as the first line.
47
+ - Begin the actual assignment on the second line, with no blank line after
48
+ the marker.
49
+ - End the instruction after one blank line with exactly:
50
+ `Use $taskchef-executor to execute and report this delegated TaskChef assignment.`
51
+ - Do not inline executor ownership, identity, linking, or result-reporting
52
+ protocol. The explicitly invoked executor skill owns those mechanics.
56
53
 
57
54
  5. Before creating each executor, call `record_task` exactly once with `id`,
58
55
  `project`, `title`, the exact marked `instruction`, and `threadId: null`.
@@ -63,23 +60,3 @@ reloaded or installed.
63
60
  when creation returns a durable ID; the child must self-link.
64
61
  8. If creation fails after recording, call `report_state` with `failed`, null
65
62
  thread/turn IDs, and a bounded summary before returning the failure.
66
-
67
- ## Executor contract
68
-
69
- The executor must make `link_task(taskId, threadId)` its first TaskChef action.
70
- It obtains its own durable ID from the current task's `CODEX_THREAD_ID`, never
71
- from the delegation's `sourceThreadId`, `CODEX_SESSION_ID`, inherited session
72
- metadata, title matching, or a parent task.
73
- Identical retries are safe. A rejected link, unavailable tool, or interrupted
74
- initial turn leaves the record visibly link-pending and retryable; the executor
75
- must not guess or do substantive work first.
76
-
77
- After linking on the initial turn, and before substantive work on every later
78
- turn, the executor reads the exact thread and calls `report_state` with
79
- `working`, the current turn ID, and no summary. Before ending that same turn it
80
- reports a semantic state with the same turn ID and a summary. A follow-up must
81
- use the new turn ID. `needs_input` is only for a real user decision, not live
82
- approval UI.
83
-
84
- The filesystem watcher surfaces `link_task` and `report_state` writes to the
85
- dashboard. The linked child ID drives the exact Codex deep link.
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: taskchef-executor
3
+ description: "Execute an assignment whose first instruction line is an exact TaskChef task marker, including executor ownership, self-linking, per-turn lifecycle reporting, identity safety, and final semantic state. Use when explicitly invoked by a delegated TaskChef instruction or when resuming that same executor task. Do not use to dispatch work or report on other TaskChef tasks."
4
+ ---
5
+
6
+ # TaskChef Executor
7
+
8
+ Own and execute the delegated assignment in the current Codex task. Do not
9
+ re-dispatch it merely because it concerns TaskChef or a configured project.
10
+ Explicit requests to delegate separate work remain valid.
11
+
12
+ The instruction's exact first line is
13
+ `<!-- taskchef_id=<full UUID> -->`. Treat that UUID as the TaskChef task ID.
14
+ The assignment is the remaining instruction body; the final explicit skill
15
+ invocation is lifecycle scaffolding, not part of the requested deliverable.
16
+
17
+ ## Start every execution turn
18
+
19
+ Complete this lifecycle setup before substantive assignment work:
20
+
21
+ 1. Read this task's own durable Codex thread ID from `CODEX_THREAD_ID`. Never
22
+ use `CODEX_SESSION_ID`, `sourceThreadId`, a parent or delegator ID,
23
+ inherited metadata, title matching, recent-task search, transcripts, or a
24
+ provisional client ID.
25
+ 2. On the initial turn, call TaskChef `link_task` with the marked task ID and
26
+ that exact thread ID as the first TaskChef action. An identical retry is
27
+ idempotent. On a follow-up, retry the same link only when the prior link
28
+ cannot be established from the task context.
29
+ 3. Read this exact Codex thread natively and obtain the current turn ID. Do not
30
+ infer it or reuse an earlier turn ID.
31
+ 4. Call TaskChef `report_state` with the marked task ID, self-linked thread ID,
32
+ current turn ID, `status: working`, and an omitted or null summary.
33
+
34
+ If `CODEX_THREAD_ID`, exact native thread reading, or a required TaskChef tool
35
+ is unavailable, or if linking or the working-state report fails, report the
36
+ failure visibly and stop before substantive work. Retry on a later turn. Never
37
+ guess identity or bypass a link-pending state.
38
+
39
+ ## Finish every execution turn
40
+
41
+ Before ending, read this exact Codex thread again and call `report_state` for
42
+ the current turn with one semantic status and a concise summary:
43
+
44
+ - `completed` only when the assignment is genuinely complete.
45
+ - `needs_input` only when a semantic decision or missing information must come
46
+ from the user.
47
+ - `failed` when the requested outcome cannot be completed or safely resumed.
48
+
49
+ A live native approval prompt is Codex state, not semantic `needs_input`; leave
50
+ the approval live instead of storing it as a TaskChef result. Never invent or
51
+ reuse a turn ID after a follow-up. If a final-report response is lost, an
52
+ identical retry is safe only while the same turn remains current. On a later
53
+ turn, run the start lifecycle with its new current turn ID and report that
54
+ turn's actual outcome. Say reporting failures visibly instead of claiming a
55
+ tracked outcome.
56
+
57
+ Summaries must omit secrets, transcripts, raw command output, hidden reasoning,
58
+ and unnecessary personal data. Identical lifecycle retries are safe; never
59
+ replace a same-turn report with different content or let an older turn
60
+ overwrite newer state.
61
+
62
+ ## Compatibility
63
+
64
+ Existing delegated tasks may include the former inline ownership, linking, and
65
+ `report_result` paragraphs. Continue executing those tasks here without
66
+ re-dispatching. Prefer `report_state` when available. If an older installed
67
+ TaskChef exposes only `report_result`, follow its inline protocol; after an
68
+ upgrade, the deprecated `report_result` alias remains available for exact
69
+ legacy retries.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "TaskChef Executor"
3
+ short_description: "Run and report a delegated TaskChef assignment."
4
+ default_prompt: "Use $taskchef-executor to execute and report this delegated TaskChef assignment."
package/src/delegation.js CHANGED
@@ -1,9 +1,14 @@
1
1
  import { randomUUID } from "node:crypto";
2
2
 
3
+ /** @deprecated Historical v7 inline-prompt snapshot. New delegations use taskchef-executor. */
3
4
  export const EXECUTOR_OWNERSHIP_PARAGRAPH = "This task owns the delegated assignment. Execute it in this task; do not re-dispatch it merely because it concerns TaskChef or a configured project. Explicit requests to delegate separate work remain valid.";
5
+ /** @deprecated Historical v7 inline-prompt snapshot. New delegations use taskchef-executor. */
4
6
  export const EXECUTOR_LINK_PARAGRAPH = "Before any other work, read this executor's own durable Codex thread ID from the current task's CODEX_THREAD_ID environment value and call the TaskChef link_task MCP tool with that thread ID and the marked TaskChef task ID. Never use CODEX_SESSION_ID or the parent or delegator thread ID. If linking fails, CODEX_THREAD_ID is unavailable, or the tool is unavailable, report the failure visibly and retry on a later turn; do not guess an identity or continue substantive work while the task is link-pending.";
7
+ /** @deprecated Historical v7 inline-prompt snapshot. New delegations use taskchef-executor. */
5
8
  export const EXECUTOR_WORKING_PARAGRAPH = "After a successful initial link, and at the start of every follow-up turn before substantive work, read this exact Codex thread natively to obtain the current turn ID and call TaskChef report_state with the marked task ID, the self-linked thread ID, that current turn ID, status working, and summary omitted or null. link_task remains the first TaskChef action on the initial turn; do not report working before identity is linked. Never reuse a prior turn ID after a follow-up.";
9
+ /** @deprecated Historical v7 inline-prompt snapshot. New delegations use taskchef-executor. */
6
10
  export const EXECUTOR_RESULT_PARAGRAPH = "Before ending, read this exact Codex thread again and call TaskChef report_state for the same current working turn with status completed, needs_input, or failed and a concise summary. Use needs_input only for a semantic decision or information the user must provide; a native approval prompt is live Codex state, not a TaskChef result. Do not include secrets, transcripts, or raw command output.";
11
+ export const EXECUTOR_SKILL_INVOCATION = "Use $taskchef-executor to execute and report this delegated TaskChef assignment.";
7
12
 
8
13
  const UUID_SOURCE = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
9
14
  const UUID_PATTERN = new RegExp(`^${UUID_SOURCE}$`);
@@ -87,17 +92,23 @@ export function parseTaskChefMarker(instruction) {
87
92
  const firstLine = instruction.split(/\r?\n/, 1)[0];
88
93
  const currentMatch = firstLine.match(TASKCHEF_MARKER_PATTERN);
89
94
  if (currentMatch === null) return null;
90
- const prefix = instruction.match(/^([^\r\n]*)(\r?\n)\2/);
91
- return prefix === null ? null : currentMatch[1];
95
+ return /^[^\r\n]*\r?\n[\s\S]+$/.test(instruction) ? currentMatch[1] : null;
92
96
  }
93
97
 
94
98
  export function prepareDelegation(instruction, { taskId = randomUUID() } = {}) {
95
- requireString(instruction, "instruction");
96
- if (parseTaskChefMarker(instruction) !== null) throw new Error("instruction already contains a TaskChef marker");
99
+ const rawBody = requireString(instruction, "instruction");
100
+ if (/^[^\S\r\n]*(?:\r\n|\r|\n)/.test(rawBody)) {
101
+ throw new Error("instruction must begin with useful task content on its first line");
102
+ }
103
+ const body = rawBody.replace(/(?:(?:\r\n|\r|\n)[^\S\r\n]*)+$/, "");
104
+ if (parseTaskChefMarker(body) !== null) throw new Error("instruction already contains a TaskChef marker");
105
+ if (/\$taskchef-executor\b/i.test(body)) {
106
+ throw new Error("instruction contains a reserved TaskChef executor skill reference");
107
+ }
97
108
  const id = requireUuid(taskId);
98
109
  return {
99
110
  id,
100
- instruction: `${taskChefMarker(id)}\n\n${EXECUTOR_OWNERSHIP_PARAGRAPH}\n\n${EXECUTOR_LINK_PARAGRAPH}\n\n${EXECUTOR_WORKING_PARAGRAPH}\n\n${EXECUTOR_RESULT_PARAGRAPH}\n\n${instruction}`,
111
+ instruction: `${taskChefMarker(id)}\n${body}\n\n${EXECUTOR_SKILL_INVOCATION}`,
101
112
  };
102
113
  }
103
114
 
package/src/mcp.js CHANGED
@@ -68,7 +68,7 @@ export function createTaskChefMcpServer({
68
68
  { name: "taskchef", version: "1.0.0" },
69
69
  {
70
70
  instructions:
71
- "Prepare with prepare_dispatch, call record_task before creating the Codex task, then create it natively and return immediately. The executor must call link_task first, report_state working at the start of each execution turn, and report_state with a semantic outcome before ending.",
71
+ "Prepare with prepare_dispatch, call record_task before creating the Codex task, then create it natively and return immediately. Follow the active TaskChef skill for role-specific sequencing of the identity and state tools.",
72
72
  },
73
73
  );
74
74