cowork-flow 0.0.20 → 0.0.21

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 (70) hide show
  1. package/README.md +65 -20
  2. package/package.json +1 -1
  3. package/src/cli.js +109 -2
  4. package/src/commands/init.js +61 -4
  5. package/src/commands/sync.js +10 -1
  6. package/src/lib/copy-template.js +38 -7
  7. package/src/lib/platforms.js +73 -0
  8. package/template/.agent/skills/brainstorming/SKILL.md +13 -9
  9. package/template/.agent/skills/finish-work/SKILL.md +3 -3
  10. package/template/.agent/skills/meta/SKILL.md +1 -1
  11. package/template/.agent/skills/start/SKILL.md +35 -16
  12. package/template/.agent/skills/writing-plans/SKILL.md +1 -1
  13. package/template/.claude/agents/cowork-check.md +41 -0
  14. package/template/.claude/agents/cowork-implement.md +40 -0
  15. package/template/.claude/agents/cowork-research.md +40 -0
  16. package/template/.claude/commands/cowork-check.md +27 -0
  17. package/template/.claude/commands/cowork-implement.md +27 -0
  18. package/template/.claude/commands/cowork-research.md +27 -0
  19. package/template/.claude/hooks/inject-workflow-state.py +298 -0
  20. package/template/.claude/settings.json +24 -0
  21. package/template/.claude/skills/before-dev/SKILL.md +31 -0
  22. package/template/.claude/skills/brainstorming/SKILL.md +32 -0
  23. package/template/.claude/skills/break-loop/SKILL.md +26 -0
  24. package/template/.claude/skills/check/SKILL.md +29 -0
  25. package/template/.claude/skills/continue/SKILL.md +29 -0
  26. package/template/.claude/skills/finish-work/SKILL.md +32 -0
  27. package/template/.claude/skills/meta/SKILL.md +30 -0
  28. package/template/.claude/skills/python-design/SKILL.md +27 -0
  29. package/template/.claude/skills/start/SKILL.md +78 -0
  30. package/template/.claude/skills/update-spec/SKILL.md +39 -0
  31. package/template/.claude/skills/writing-plans/SKILL.md +70 -0
  32. package/template/.codex/agents/cowork-check.toml +17 -22
  33. package/template/.codex/agents/cowork-implement.toml +18 -23
  34. package/template/.codex/agents/cowork-research.toml +14 -19
  35. package/template/.codex/agents/default.toml +27 -0
  36. package/template/.codex/agents/explorer.toml +28 -0
  37. package/template/.codex/agents/worker.toml +29 -0
  38. package/template/.codex/hooks/inject-workflow-state.py +161 -108
  39. package/template/.cowork-flow/.version +1 -1
  40. package/template/.cowork-flow/adapters/claude-code/adapter.yaml +35 -0
  41. package/template/.cowork-flow/adapters/codex/adapter.yaml +35 -0
  42. package/template/.cowork-flow/adapters/opencode/adapter.yaml +33 -0
  43. package/template/.cowork-flow/config.yaml +4 -6
  44. package/template/.cowork-flow/scripts/add_session.py +20 -7
  45. package/template/.cowork-flow/scripts/common/active_task.py +212 -1
  46. package/template/.cowork-flow/scripts/common/config.py +0 -17
  47. package/template/.cowork-flow/scripts/common/entry_classifier.py +122 -0
  48. package/template/.cowork-flow/scripts/common/execution_context.py +10 -17
  49. package/template/.cowork-flow/scripts/common/readiness.py +249 -0
  50. package/template/.cowork-flow/scripts/doctor.py +418 -40
  51. package/template/.cowork-flow/scripts/project_context.py +230 -0
  52. package/template/.cowork-flow/scripts/run.py +3 -0
  53. package/template/.cowork-flow/scripts/subagent.py +152 -238
  54. package/template/.cowork-flow/scripts/task.py +330 -17
  55. package/template/.cowork-flow/spec/adapter.schema.json +132 -0
  56. package/template/.cowork-flow/spec/capabilities.md +34 -0
  57. package/template/.cowork-flow/spec/entry-contract.md +45 -0
  58. package/template/.cowork-flow/spec/registry.json +54 -0
  59. package/template/.cowork-flow/spec/subagent-dispatch.md +77 -0
  60. package/template/.cowork-flow/spec/workflow-state-templates.md +66 -0
  61. package/template/.cowork-flow/workflow.md +158 -203
  62. package/template/.opencode/agents/cowork-check.md +46 -0
  63. package/template/.opencode/agents/cowork-implement.md +45 -0
  64. package/template/.opencode/agents/cowork-research.md +46 -0
  65. package/template/.opencode/commands/cowork-check.md +26 -0
  66. package/template/.opencode/commands/cowork-implement.md +26 -0
  67. package/template/.opencode/commands/cowork-research.md +26 -0
  68. package/template/.opencode/plugins/cowork-flow.js +317 -0
  69. package/template/CLAUDE.md +5 -0
  70. package/template/.agent/skills/entry-boundary/SKILL.md +0 -81
@@ -0,0 +1,24 @@
1
+ {
2
+ "hooks": {
3
+ "UserPromptSubmit": [
4
+ {
5
+ "hooks": [
6
+ {
7
+ "type": "command",
8
+ "command": ".cowork-flow/run python .claude/hooks/inject-workflow-state.py"
9
+ }
10
+ ]
11
+ }
12
+ ],
13
+ "SessionStart": [
14
+ {
15
+ "hooks": [
16
+ {
17
+ "type": "command",
18
+ "command": ".cowork-flow/run python .claude/hooks/inject-workflow-state.py"
19
+ }
20
+ ]
21
+ }
22
+ ]
23
+ }
24
+ }
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: before-dev
3
+ description: Use before writing code in a cowork-flow project to load project-specific guidelines, active task context, and verification expectations.
4
+ ---
5
+
6
+ # Before Dev
7
+
8
+ Use this immediately before code edits.
9
+
10
+ ## Read
11
+
12
+ 1. `AGENTS.md`
13
+ 2. `.cowork-flow/workflow.md`
14
+ 3. Active task `prd.md`
15
+ 4. Active task `implement.jsonl`
16
+ 5. Relevant `.cowork-flow/spec/*/index.md`
17
+ 6. Any exact files named by the task, plan, or user
18
+
19
+ Do not bulk-load unrelated tasks, archived sessions, or every spec file.
20
+
21
+ ## Confirm
22
+
23
+ State briefly:
24
+
25
+ - Assumptions.
26
+ - Success criteria.
27
+ - Files or modules likely to change.
28
+ - Verification command you expect to run.
29
+ - Whether fixed agents or inline work are appropriate.
30
+
31
+ If the task is a bounded subagent prompt, do not convert it into main-session planning.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: brainstorming
3
+ description: Use when requirements are unclear, a requested change has multiple valid approaches, or the user wants to shape an idea before implementation.
4
+ ---
5
+
6
+ # Brainstorming
7
+
8
+ Use this skill as the active clarification gate for new requirements. Turn an idea into a clear change request before PRD, planning, fixed-agent dispatch, or code changes begin.
9
+
10
+ ## Flow
11
+
12
+ 1. Read only the context needed to understand the project area: `AGENTS.md`, `.cowork-flow/workflow.md`, and relevant spec indexes.
13
+ 2. State the goal, non-goals, assumptions, scope boundary, success criteria, and the smallest useful scope.
14
+ 3. Ask one high-value question only when the answer cannot be inferred safely; otherwise proceed with explicit assumptions.
15
+ 4. Present 2-3 viable approaches when trade-offs matter, with a concrete recommended direction.
16
+ 5. Do not write PRD, planning, or fixed-agent dispatch input until the direction and acceptance criteria are clear.
17
+ 6. For L1/L2 work, create or update the change/task artifacts required by `.cowork-flow/workflow.md` after the clarification output is stable.
18
+ 7. Hand off to `writing-plans` when the requested behavior and acceptance criteria are clear.
19
+
20
+ ## Output
21
+
22
+ Keep the result practical:
23
+
24
+ - Goal.
25
+ - Non-goals.
26
+ - Key assumptions.
27
+ - Scope boundary, including in-scope and out-of-scope work.
28
+ - Recommended direction and rejected alternatives.
29
+ - Acceptance criteria.
30
+ - Open questions, risks, or blockers, with their impact on the next step.
31
+
32
+ Do not implement during brainstorming unless the user explicitly changes the request to a direct edit.
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: break-loop
3
+ description: Use after fixing a bug or repeated failed attempts to identify the root cause, prevention mechanism, and durable knowledge capture.
4
+ ---
5
+
6
+ # Break Loop
7
+
8
+ Use this after the immediate fix is understood. The goal is to prevent the same class of bug from returning.
9
+
10
+ ## Analysis
11
+
12
+ 1. Root cause: identify whether the issue was missing spec, unclear contract, incomplete propagation, test gap, or hidden assumption.
13
+ 2. Failed attempts: if fixes failed, explain what each attempt misunderstood.
14
+ 3. Blast radius: search for similar contracts, call sites, scripts, templates, and tests.
15
+ 4. Prevention: decide whether the durable fix belongs in code, tests, specs, workflow, or tooling.
16
+ 5. Capture: update `.cowork-flow/spec/` or workflow docs when future agents need the lesson.
17
+
18
+ ## Output
19
+
20
+ Report:
21
+
22
+ - Root cause.
23
+ - Why the final fix works.
24
+ - Similar areas checked.
25
+ - Prevention added or intentionally skipped.
26
+ - Verification command and result.
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: check
3
+ description: Use after code or workflow changes to verify quality, spec compliance, tests, cross-layer contracts, and template/root consistency before finish-work.
4
+ ---
5
+
6
+ # Check
7
+
8
+ Use this after implementation and before `finish-work`.
9
+
10
+ ## Steps
11
+
12
+ 1. Read active task PRD, plan, and `check.jsonl`.
13
+ 2. Review `git diff --name-only` and `git diff`.
14
+ 3. Check contracts across caller/callee, command output, persisted state, templates, and docs.
15
+ 4. Confirm `.cowork-flow/spec/` is updated or explicitly unchanged.
16
+ 5. Review test intent: reject shallow tests that do not fail for meaningful behavior breaks.
17
+ 6. Run focused tests that would fail if the changed behavior broke.
18
+ 7. Run broader validation when the change touches shared runtime, templates, packaging, or public workflow.
19
+
20
+ ## Report
21
+
22
+ Return:
23
+
24
+ - Issues found and fixes made.
25
+ - Files reviewed.
26
+ - Commands run and results.
27
+ - Remaining risks.
28
+
29
+ Do not claim success from intent. Use command output and reviewed diffs as evidence.
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: continue
3
+ description: Use when resuming an in-progress cowork-flow task after interruption, context compression, or a new session.
4
+ ---
5
+
6
+ # Continue
7
+
8
+ Use this to recover the next actionable step without rereading the whole repository.
9
+
10
+ ## Steps
11
+
12
+ 1. Run `.cowork-flow/run resume` or `.\.cowork-flow\run.cmd resume` on Windows.
13
+ 2. Run `.cowork-flow/run task current`.
14
+ 3. Read the active task `prd.md`.
15
+ 4. Read the current plan only if the task references one.
16
+ 5. Read the relevant JSONL index for the current phase: `implement.jsonl`, `check.jsonl`, or `debug.jsonl`.
17
+ 6. Inspect `git status --short` and any changed files relevant to the task.
18
+
19
+ ## Output
20
+
21
+ State:
22
+
23
+ - Active task and phase.
24
+ - Completed work.
25
+ - Next step.
26
+ - Blockers.
27
+ - Verification still required.
28
+
29
+ Avoid broad archive/history scans unless the active task explicitly depends on them.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: finish-work
3
+ description: Use when implementation and verification are complete and cowork-flow work needs final scope review, commit/archive/session recording, or handoff.
4
+ ---
5
+
6
+ # Finish Work
7
+
8
+ Use this in the main session after implementation and `check` are complete.
9
+
10
+ ## Gate
11
+
12
+ Before claiming completion, verify:
13
+
14
+ - Active task exists, or the work was explicitly read-only/no-task.
15
+ - `check` or equivalent final review ran.
16
+ - `git diff` was reviewed for scope.
17
+ - Relevant tests, build, lint, or focused validation ran.
18
+ - `.cowork-flow/spec/` was updated when the change created durable knowledge.
19
+ - Plan checkboxes and task status match reality.
20
+ - No unrelated dirty files are staged.
21
+
22
+ ## Sequence
23
+
24
+ 1. Run `git status --short`.
25
+ 2. Run `git diff --check`.
26
+ 3. Run focused tests and then broader project verification when appropriate.
27
+ 4. Update the plan/task status.
28
+ 5. Archive completed task/change artifacts when requested or required by workflow.
29
+ 6. Record the session with `.cowork-flow/run add-session --commit "-"` unless a prior commit hash is intentionally being recorded.
30
+ 7. If commit policy allows, stage only expected files and commit once.
31
+
32
+ If the user asks not to commit, stop before staging and report the verified state.
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: meta
3
+ description: Use when modifying cowork-flow itself .cowork-flow runtime, template files, .codex hooks/agents, .agent skills, workflow docs, or generated project structure.
4
+ ---
5
+
6
+ # Meta
7
+
8
+ Use this for changes to the cowork-flow operating model.
9
+
10
+ ## Scope
11
+
12
+ Meta changes often touch both:
13
+
14
+ - Root project files used by this repository.
15
+ - `template/` files installed into downstream projects.
16
+
17
+ Keep those copies aligned unless there is a documented reason not to.
18
+
19
+ ## Rules
20
+
21
+ - Prefer the current fixed-agent model: main session coordinates through the active Host Adapter, child agents execute bounded tasks with fresh context.
22
+ - Do not add compatibility fallback paths for removed workflow models unless the user explicitly asks.
23
+ - Delete stale skills, prompts, tests, and docs when their behavior is no longer valid.
24
+ - Update tests that guard template contents, packaging, hooks, and task context generation.
25
+ - Keep reusable skills generic; put project-specific lessons in `.cowork-flow/spec/`, `workflow.md`, or `AGENTS.md`.
26
+ - Check Windows command paths and UTF-8 behavior when editing runtime scripts.
27
+
28
+ ## Verification
29
+
30
+ Run focused tests for the changed subsystem, then `npm run test:all` when template/runtime behavior changed.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: python-design
3
+ description: Use when writing, reviewing, or refactoring Python CLI/runtime scripts in cowork-flow.
4
+ ---
5
+
6
+ # Python Design
7
+
8
+ Use this for `.cowork-flow/scripts/**/*.py` and other Python utilities.
9
+
10
+ ## Guidelines
11
+
12
+ - Keep command parsing thin; move reusable behavior into named functions.
13
+ - Use `pathlib.Path` for filesystem paths.
14
+ - Separate pure decisions from filesystem mutation so tests can cover decisions directly.
15
+ - Prefer explicit data structures over stringly-typed control flow.
16
+ - Handle UTF-8 deliberately on Windows.
17
+ - Catch narrow exceptions; let unexpected failures surface with useful messages.
18
+ - Keep root and `template/` runtime copies aligned.
19
+
20
+ ## Tests
21
+
22
+ For behavior changes, add or update tests that prove:
23
+
24
+ - Command arguments are parsed correctly.
25
+ - Files are created, updated, or protected as intended.
26
+ - Error output is specific enough to diagnose the failure.
27
+ - Windows entrypoints remain valid when relevant.
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: start
3
+ description: Use when starting or resuming main-session work in a cowork-flow project, after context compression, or before repository changes.
4
+ ---
5
+
6
+ # Start
7
+
8
+ This skill is for the main session only. Formal subagents are accepted only after runtime context binding is recorded and must not load this startup flow.
9
+ Main repository changes follow `Plan -> Implement -> Check -> Finish`.
10
+ Before loading state, classify only whether the current request is a
11
+ main-session request, read-only question, command-only wrapper, or unclear
12
+ input. Do not infer subagent identity from prompt shape. If a child has
13
+ `cowork_runtime_context_id`, hook/plugin binding may run early; otherwise the
14
+ child must run the explicit shim bind before formal work.
15
+
16
+ ## Load State
17
+
18
+ 1. Read `AGENTS.md`.
19
+ 2. Read `.cowork-flow/workflow.md`.
20
+ 3. Read `.cowork-flow/config.yaml` for Codex dispatch hints and lifecycle hooks.
21
+ 4. Run `.cowork-flow/run resume` or `.\.cowork-flow\run.cmd resume` on Windows.
22
+ 5. Read the active task PRD and JSONL indexes only when a task is active.
23
+ 6. Read relevant `.cowork-flow/spec/*/index.md` files before code changes.
24
+
25
+ Report active task, workflow state, blockers, and the next phase.
26
+
27
+ ## Route
28
+
29
+ Route in stages. Before state is loaded, true question-only requests may bypass
30
+ Load State. Repository-changing main-session requests load state first. After
31
+ state is loaded, apply the requirement clarification gate from
32
+ `.cowork-flow/workflow.md`, then route to the next workflow phase; clear
33
+ multi-step implementation uses `writing-plans` before fixed-agent dispatch.
34
+
35
+ New requirements that are unclear, boundary-unclear, multi-approach, behavior-changing, or missing acceptance criteria use `brainstorming` before PRD, planning, or fixed-agent dispatch. Small repository changes proceed directly only when the goal, scope boundary, and acceptance criteria are already clear.
36
+
37
+ - Question-only work: answer directly.
38
+ - Small repository change with clear goal/scope/acceptance: classify by `.cowork-flow/workflow.md`, create/start a task if required, then proceed.
39
+ - Unclear, boundary-unclear, behavior-changing, or multi-approach work: use `brainstorming`.
40
+ - Multi-step implementation: use `writing-plans`, then dispatch fixed agents where appropriate.
41
+ - Before coding: use `before-dev`.
42
+ - After implementation: use `check`, then `finish-work`.
43
+
44
+ ## Parallel Route
45
+
46
+ - Use parallel sessions for independent tasks.
47
+ - Use a separate `git worktree` when independent sessions may write files.
48
+ - Inside one task, dispatch parallel agents only for low-conflict slices with clear ownership.
49
+ - After parallel slices finish, run final integrated verification before Check/Finish.
50
+
51
+ ## Fixed Agents
52
+
53
+ The main session owns coordination:
54
+
55
+ - Research: dispatch `cowork-research` through the active Host Adapter.
56
+ - Implementation: dispatch `cowork-implement` through the active Host Adapter.
57
+ - Verification: dispatch `cowork-check` through the active Host Adapter.
58
+
59
+ Every formal dispatch uses runtime-context dispatch:
60
+
61
+ ```text
62
+ cowork_runtime_context_id: <runtime_context_id>
63
+ cowork_host_context_key: <host_context_key>
64
+ ```
65
+
66
+ Before spawning a formal child, create a runtime context with
67
+ `.cowork-flow/run subagent init` and pass the returned prompt transport through
68
+ the active Host Adapter. The child's first step is
69
+ `.cowork-flow/run subagent bind <runtime_context_id> <host_context_key>`; if a
70
+ hook/plugin already bound the same key, this command is idempotent. The parent
71
+ must verify `status=bound` and `bound_context_key=<host_context_key>` before
72
+ accepting output. If binding is missing, closed, invalid, or mismatched, the
73
+ child fails closed and must not run start/resume/task activation/archive/commit
74
+ or coordinate other agents.
75
+
76
+ After dispatch, use adapter wait/list/cancel primitives, review the output,
77
+ verify deliverables, and close the runtime context with
78
+ `.cowork-flow/run subagent close <runtime_context_id>`.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: update-spec
3
+ description: Use when implementation lessons, contracts, conventions, or gotchas should be captured in .cowork-flow/spec.
4
+ ---
5
+
6
+ # Update Spec
7
+
8
+ Use this when a change teaches something future agents need to know.
9
+
10
+ ## Decide Whether To Update
11
+
12
+ Update specs when you learned:
13
+
14
+ - A command, API, file, payload, or state contract.
15
+ - A validation rule or error behavior.
16
+ - A project convention.
17
+ - A repeated failure mode or non-obvious gotcha.
18
+ - A design decision future changes must preserve.
19
+
20
+ Skip one-off implementation details that do not guide future work.
21
+
22
+ ## Choose Location
23
+
24
+ - `backend/` or `frontend/`: implementation contracts, signatures, examples, validation behavior, test points.
25
+ - `guides/`: short thinking checklists and pointers to deeper specs.
26
+ - `.cowork-flow/workflow.md`: process rules, phase gates, or task routing behavior.
27
+ - `AGENTS.md`: project-level collaboration rules.
28
+
29
+ ## Write
30
+
31
+ Keep each update concrete:
32
+
33
+ - State the trigger and scope.
34
+ - Show the contract or command shape.
35
+ - Include good/bad cases when useful.
36
+ - State tests or checks that protect the behavior.
37
+ - Update the matching `index.md` when adding a new topic.
38
+
39
+ Before finishing, check for duplicate guidance and remove stale wording.
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: writing-plans
3
+ description: Use when requirements are clear enough to turn into an executable multi-step cowork-flow implementation plan.
4
+ ---
5
+
6
+ # Writing Plans
7
+
8
+ Create a plan that another agent can execute without guessing.
9
+
10
+ ## Inputs
11
+
12
+ Before writing a plan, confirm the request has an executable scope, acceptance criteria, and intended behavior. If those are missing, ask for clarification.
13
+
14
+ Read:
15
+
16
+ - Active task PRD.
17
+ - Relevant change spec/design files.
18
+ - Relevant `.cowork-flow/spec/` indexes and target specs.
19
+ - Files that define the contracts being changed.
20
+
21
+ ## Plan Shape
22
+
23
+ Save plans to `.cowork-flow/plans/YYYY-MM-DD-<slug>.md` unless the user asks for another path.
24
+
25
+ Start with:
26
+
27
+ ```markdown
28
+ # <Feature> Implementation Plan
29
+
30
+ > For formal fixed-agent work: create a runtime context with `.cowork-flow/run subagent init`, pass `cowork_runtime_context_id: <runtime_context_id>` through the active Host Adapter, then dispatch `cowork-implement` or `cowork-check`. Close the runtime context after verification.
31
+
32
+ **Goal:** <one sentence>
33
+ **Architecture:** <2-3 sentences>
34
+ **Verification:** <commands or checks>
35
+ ```
36
+
37
+ ## Task Rules
38
+
39
+ - Each task names exact files to create, modify, or test.
40
+ - Each step is small enough to execute and verify independently.
41
+ - Include commands and expected results.
42
+ - Include a failing test before implementation when behavior can be tested.
43
+ - Do not add shallow tests just to satisfy process. Avoid tests that only assert existence, mirror implementation details, count mocks without behavior, or snapshot empty structure.
44
+ - For complex problems, test depth first: cover invariants, cross-layer contracts, state transitions, error boundaries, and real regression paths before narrow unit cases.
45
+ - Avoid placeholders such as TODO, TBD, "handle edge cases", or "write tests".
46
+ - Keep root/template parity explicit when both copies exist.
47
+
48
+ ## Parallel Work
49
+
50
+ Execution strategy guide:
51
+
52
+ - Use serial work when slices share files, shared helpers, tests, or one behavior chain.
53
+ - Use parallel low-conflict slices only when file ownership is clean and each slice has independent verification.
54
+ - Use worktree parallel when independent tasks may touch package metadata, generated assets, build outputs, or broad config.
55
+
56
+ - Do not require the user to predeclare parallel execution; evaluate parallel feasibility while writing the plan.
57
+ - Every plan must state the execution strategy: serial work, or explicit parallel low-conflict slices.
58
+ - Parallel work items belong in the plan only when they are independent low-conflict slices.
59
+ - Each parallel item must name file ownership, dependencies, expected outputs, and verification commands.
60
+ - Use separate sessions, and use a separate `git worktree` when independent tasks may write overlapping project areas.
61
+ - After parallel items finish, include one final integrated verification step before Check/Finish.
62
+
63
+ ## Self-Review
64
+
65
+ Before handoff:
66
+
67
+ 1. Confirm every PRD acceptance criterion maps to a plan step.
68
+ 2. Search the plan for placeholders.
69
+ 3. Check names, paths, command syntax, and expected outputs.
70
+ 4. Record remaining risks or blockers.
@@ -1,39 +1,34 @@
1
1
  name = "cowork-check"
2
- description = "Cowork-flow checker that reviews active task changes and fixes in-scope issues."
2
+ description = "Cowork-flow checker for runtime-context bound review tasks."
3
3
  sandbox_mode = "workspace-write"
4
4
 
5
5
  developer_instructions = """
6
6
  You are the `cowork-check` subagent.
7
7
 
8
- The dispatch message SHOULD include this lightweight envelope:
9
- COWORK_DISPATCH_V1
10
- dispatch_id: <dispatch-id>
11
- task_dir: .cowork-flow/tasks/<task>
12
- agent_type: cowork-check
13
- role: check
14
- context_file: <context-file>
15
- ack_token: <ack-token>
16
- COWORK_DISPATCH_END
8
+ Formal `cowork-check` work requires runtime-context dispatch. The prompt or
9
+ host metadata must provide:
17
10
 
18
- If the envelope agent_type is not `cowork-check`, report needs_context and do not execute it. If agent_type is missing, legacy role `cowork-check` is accepted. If role names another fixed agent, report needs_context and do not execute it.
11
+ cowork_runtime_context_id: <runtime_context_id>
12
+ cowork_host_context_key: <host_context_key>
19
13
 
20
- When the envelope is present, it wins over bootstrap, AGENTS.md, and no-task context. First return only:
21
- COWORK_ACK <dispatch_id> <ack_token>
14
+ The hook may bind that id to `.cowork-flow/.runtime/subagents/<runtime_context_id>.json`
15
+ before workflow state is injected. The first child step must still run:
22
16
 
23
- Do not execute the task until the coordinator sends:
24
- EXECUTE <dispatch_id>
17
+ ./.cowork-flow/run subagent bind <runtime_context_id> <host_context_key>
25
18
 
26
- If a follow-up has a missing or mismatched dispatch_id, report needs_context and do not execute it.
19
+ On Windows, use:
27
20
 
28
- Legacy dispatch without an envelope MUST start with:
29
- Active task: .cowork-flow/tasks/<task>
21
+ .\\.cowork-flow\\run.cmd subagent bind <runtime_context_id> <host_context_key>
30
22
 
31
- If the message contains neither the envelope nor that line, stop and ask for the active task path.
23
+ If the explicit bind fails, or if the bound runtime context is missing, closed,
24
+ invalid, or names another agent type, report needs_context and do not execute
25
+ the task.
32
26
 
33
27
  Load context before checking:
34
- 1. Read `<task>/prd.md`.
35
- 2. Read `<task>/check.jsonl`.
36
- 3. Read `git diff`.
28
+ 1. Read the task directory from the bound runtime context.
29
+ 2. Read `<task>/prd.md`.
30
+ 3. Read `<task>/check.jsonl`.
31
+ 4. Read `git diff`.
37
32
 
38
33
  Rules:
39
34
  - Fix issues directly when they are clearly in scope.
@@ -1,40 +1,35 @@
1
1
  name = "cowork-implement"
2
- description = "Cowork-flow implementer that self-loads task context from Active task."
2
+ description = "Cowork-flow implementer for runtime-context bound implementation tasks."
3
3
  sandbox_mode = "workspace-write"
4
4
 
5
5
  developer_instructions = """
6
6
  You are the `cowork-implement` subagent.
7
7
 
8
- The dispatch message SHOULD include this lightweight envelope:
9
- COWORK_DISPATCH_V1
10
- dispatch_id: <dispatch-id>
11
- task_dir: .cowork-flow/tasks/<task>
12
- agent_type: cowork-implement
13
- role: implement
14
- context_file: <context-file>
15
- ack_token: <ack-token>
16
- COWORK_DISPATCH_END
8
+ Formal `cowork-implement` work requires runtime-context dispatch. The prompt or
9
+ host metadata must provide:
17
10
 
18
- If the envelope agent_type is not `cowork-implement`, report needs_context and do not execute it. If agent_type is missing, legacy role `cowork-implement` is accepted. If role names another fixed agent, report needs_context and do not execute it.
11
+ cowork_runtime_context_id: <runtime_context_id>
12
+ cowork_host_context_key: <host_context_key>
19
13
 
20
- When the envelope is present, it wins over bootstrap, AGENTS.md, and no-task context. First return only:
21
- COWORK_ACK <dispatch_id> <ack_token>
14
+ The hook may bind that id to `.cowork-flow/.runtime/subagents/<runtime_context_id>.json`
15
+ before workflow state is injected. The first child step must still run:
22
16
 
23
- Do not execute the task until the coordinator sends:
24
- EXECUTE <dispatch_id>
17
+ ./.cowork-flow/run subagent bind <runtime_context_id> <host_context_key>
25
18
 
26
- If a follow-up has a missing or mismatched dispatch_id, report needs_context and do not execute it.
19
+ On Windows, use:
27
20
 
28
- Legacy dispatch without an envelope MUST start with:
29
- Active task: .cowork-flow/tasks/<task>
21
+ .\\.cowork-flow\\run.cmd subagent bind <runtime_context_id> <host_context_key>
30
22
 
31
- If the message contains neither the envelope nor that line, stop and ask for the active task path.
23
+ If the explicit bind fails, or if the bound runtime context is missing, closed,
24
+ invalid, or names another agent type, report needs_context and do not execute
25
+ the task.
32
26
 
33
27
  Load context before editing:
34
- 1. Read `<task>/prd.md`.
35
- 2. Read `<task>/info.md` if present.
36
- 3. Read `<task>/implement.jsonl`.
37
- 4. Read each JSONL `file` entry.
28
+ 1. Read the task directory from the bound runtime context.
29
+ 2. Read `<task>/prd.md`.
30
+ 3. Read `<task>/info.md` if present.
31
+ 4. Read `<task>/implement.jsonl`.
32
+ 5. Read each JSONL `file` entry.
38
33
 
39
34
  Rules:
40
35
  - MUST NOT spawn, wait for, list, or close other agents.
@@ -1,36 +1,31 @@
1
1
  name = "cowork-research"
2
- description = "Cowork-flow researcher that records findings under the active task."
2
+ description = "Cowork-flow researcher for runtime-context bound research tasks."
3
3
  sandbox_mode = "workspace-write"
4
4
 
5
5
  developer_instructions = """
6
6
  You are the `cowork-research` subagent.
7
7
 
8
- The dispatch message SHOULD include this lightweight envelope:
9
- COWORK_DISPATCH_V1
10
- dispatch_id: <dispatch-id>
11
- task_dir: .cowork-flow/tasks/<task>
12
- agent_type: cowork-research
13
- role: research
14
- context_file: <context-file>
15
- ack_token: <ack-token>
16
- COWORK_DISPATCH_END
8
+ Formal `cowork-research` work requires runtime-context dispatch. The prompt or
9
+ host metadata must provide:
17
10
 
18
- If the envelope agent_type is not `cowork-research`, report needs_context and do not execute it. If agent_type is missing, legacy role `cowork-research` is accepted. If role names another fixed agent, report needs_context and do not execute it.
11
+ cowork_runtime_context_id: <runtime_context_id>
12
+ cowork_host_context_key: <host_context_key>
19
13
 
20
- When the envelope is present, it wins over bootstrap, AGENTS.md, and no-task context. First return only:
21
- COWORK_ACK <dispatch_id> <ack_token>
14
+ The hook may bind that id to `.cowork-flow/.runtime/subagents/<runtime_context_id>.json`
15
+ before workflow state is injected. The first child step must still run:
22
16
 
23
- Do not execute the task until the coordinator sends:
24
- EXECUTE <dispatch_id>
17
+ ./.cowork-flow/run subagent bind <runtime_context_id> <host_context_key>
25
18
 
26
- If a follow-up has a missing or mismatched dispatch_id, report needs_context and do not execute it.
19
+ On Windows, use:
27
20
 
28
- Legacy dispatch without an envelope MUST start with:
29
- Active task: .cowork-flow/tasks/<task>
21
+ .\\.cowork-flow\\run.cmd subagent bind <runtime_context_id> <host_context_key>
30
22
 
31
- If the message contains neither the envelope nor that line, stop and ask for the active task path.
23
+ If the explicit bind fails, or if the bound runtime context is missing, closed,
24
+ invalid, or names another agent type, report needs_context and do not execute
25
+ the task.
32
26
 
33
27
  Rules:
28
+ - Read the task directory from the bound runtime context.
34
29
  - Write only under `<task>/research/`.
35
30
  - Do not modify code, specs, task state, or git.
36
31
  - Persist findings to Markdown files.
@@ -0,0 +1,27 @@
1
+ name = "default"
2
+ description = "Codex default agent hardened against bootstrap hijack. Runs bounded delegated work; must not run project start/resume or create tasks."
3
+ sandbox_mode = "workspace-write"
4
+
5
+ developer_instructions = """
6
+ You are a dispatched default agent. Your task comes from the dispatch message or the bounded brief, not from project bootstrap or start-session skills.
7
+
8
+ If AGENTS.md or .agent/skills/start tells you to start a session, skip that start skill.
9
+ Do not run the project start-session workflow or try to spawn another agent from this prompt.
10
+
11
+ Generic default-agent dispatch is advisory and cannot satisfy formal Implement
12
+ or Check completion. Follow the bounded prompt directly. Project rules are
13
+ constraints only; they are not the task.
14
+
15
+ Rules:
16
+ - MUST NOT spawn, wait for, list, or close other agents.
17
+ - MUST NOT run task start, task finish, task archive, or unscoped resume.
18
+ - MUST NOT commit or push.
19
+ - Keep edits inside requested scope.
20
+ - Report changed files and exact verification commands.
21
+ """
22
+
23
+ [features]
24
+ multi_agent = false
25
+
26
+ [features.multi_agent_v2]
27
+ enabled = false