brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
supervisorUse when a user asks to run technical-plan, SDD, coding, implementation, or review work through a visible Supervisor workflow with a coder thread, optional reviewer thread, configurable human approval gates, global role memory, and request state stored under ~/.supervisor.
Independent GitHub snapshot · Automated classification · Original documentation governs
Run technical-plan, SDD, and implementation requests through a visible Supervisor workflow. The supervisor identifies the target project, asks the human to confirm the runtime configuration, creates or reuses a visible coder thread and, by default, a visible reviewer thread, then gates each active unit through coder completion, optional reviewer acceptance, and the configured human approval policy.
By default, do not write runtime state into the target code repository. Store request state and global role memory under ~/.supervisor.
Before starting a supervised request, read:
references/thread-prompts.md for coder/reviewer message templates.references/review-standards.md before asking reviewer threads to review or before interpreting reviewer results. Skip this when review_required=false.Read references/failure-recovery.md only when a notification, memory compliance, reviewer loop, thread tool, or human scope-change problem occurs.
Use scripts for deterministic work:
scripts/init_request.py: derive project_key, render the default config, and create ~/.supervisor/projects/<project-key>/<request-id>/ after human confirmation.scripts/update_status.py: create and update supervisor-state.json.scripts/render_prompt.py: render coder/reviewer/rework/human prompts from templates.scripts/extract_memory_items.py: draft coder/reviewer memory bullets from human feedback.scripts/merge_feedback.py: merge memory bullets into global role memory.Use ~/.supervisor as the default runtime workspace. Allow the user to override this path during startup.
Default layout:
~/.supervisor/
├── config.json
├── registry.json
├── memory/
│ ├── coder-memory.md
│ └── reviewer-memory.md
└── projects/
└── <project-key>/
├── project.json
└── <request-id>/
├── config.json
├── supervisor-state.json
├── document-index.json
├── requirement.md
├── sdd.md
├── technical-docs.md
└── summary.md
Rules:
~/.supervisor/projects/<project-key>/<request-id>/.~/.supervisor/memory/.~/.supervisor/config.json; each request may override them in its own config.json.~/.supervisor is missing or required global memory files are missing, ask the user how to initialize memory before showing the startup config confirmation. coder-memory.md is always required. reviewer-memory.md is required only when review_required=true. The user must choose one method: paste memory content in chat, import existing memory files, or create empty templates.~/.supervisor is not writable in the current environment, ask the user for another workspace path or use /tmp only as a temporary fallback and report the path clearly.Use $supervisor to start this workflow in Codex after the skill is installed.
For other AI tools:
SKILL.md, references, and scripts when the tool supports skill folders.SKILL.md into that tool's rule/instruction format and keep the scripts accessible.~/.supervisor by default, so request state and global memory stay shared across Codex, Cursor, Claude Code, and other agents.projects/<project-key>/<request-id>/ layout across tools so concurrent projects stay isolated.Resolve project_path and project_key before creating coder and optional reviewer threads.
Project path priority:
project_path provided by the user..git, package.json, Podfile, build.gradle, settings.gradle, *.xcodeproj, *.xcworkspace, or pubspec.yaml.project_path.Project key rules:
project_key when the user provides one.project_path, normalized to lowercase letters, digits, and hyphens.~/.supervisor/registry.json, ask the user to confirm a unique key.project_key as the folder name under ~/.supervisor/projects/.Resolve where visible coder and optional reviewer threads should be created before creating them. Do not use the supervisor thread's current working directory or the skill installation directory unless it is explicitly the configured thread project.
Thread project policy:
same_as_project: default. Create coder and optional reviewer threads in the Codex project that matches project_path when possible.custom: create coder and optional reviewer threads in the user-specified thread_project_path or thread_project_id.projectless: create visible threads without binding them to a Codex project, useful for document-only requests or when no matching Codex project exists.Rules:
thread_project_policy, thread_project_path, and thread_project_id in the saved request config.json, but do not show them in the default startup confirmation view.thread_project_policy=same_as_project, set thread_project_path to project_path in config.json.thread_project_policy=custom, require either thread_project_path or thread_project_id before creating threads.thread_project_policy=projectless, leave thread_project_path and thread_project_id empty.thread_project_path differs from project_path, warn that coder/reviewer default workspace may differ from the target codebase and pass the real project_path in the role prompts.list_projects to find the Codex project matching thread_project_id or thread_project_path; if no matching project exists, ask whether to switch to projectless, choose another project, or continue in the current supervisor thread.Example request config written to disk after confirmation:
{
"supervisor_workspace": "~/.supervisor",
"project_path": "/path/to/project",
"project_key": "project-key",
"request_title": "feature request",
"mode": "new",
"request_id": "20260703-project-key-feature-request",
"project_dir": "~/.supervisor/projects/project-key",
"request_dir": "~/.supervisor/projects/project-key/20260703-project-key-feature-request",
"memory_scope": "global",
"agent_language": "same_as_supervisor",
"memory_status": {
"coder_memory_exists": false,
"reviewer_memory_exists": false,
"import_prompt_required": true,
"coder_memory_text_provided": false,
"reviewer_memory_text_provided": false
},
"human_gate_policy": "per_step",
"review_required": true,
"review_max_passes": 2,
"agent_completion_mode": "notify",
"poll_interval_seconds": 30,
"thread_project_policy": "same_as_project",
"thread_project_path": "/path/to/project",
"thread_project_id": "",
"supervisor_scope": "per_project",
"documents": []
}
For human confirmation, use the concise startup view generated by scripts/init_request.py --dry-run --show-options --confirmation-only. Keep config.json as valid JSON; do not insert parenthesized hints into the JSON file itself.
When asking the human to confirm startup config, show the concise confirmation view, not raw JSON. The default startup confirmation view must contain exactly these fields and no others:
supervisor_workspaceproject_pathproject_keyproject_dirrequest_titlehuman_gate_policyreview_requiredreview_max_passesagent_completion_modeOnly human_gate_policy and agent_completion_mode should show parenthesized allowed values.
Prefer:
python3 scripts/init_request.py ... --dry-run --show-options --confirmation-only
Example confirmation view:
supervisor_workspace: "~/.supervisor"
project_path: "/path/to/project"
project_key: "project-key"
project_dir: "~/.supervisor/projects/project-key"
request_title: "feature request"
human_gate_policy: "per_step" (Allowed: per_step, final_only, on_failure_only, none)
review_required: true
review_max_passes: 2
agent_completion_mode: "notify" (Allowed: notify, poll)
Do not create coder or reviewer threads until the user confirms the concise startup view or says to use the defaults.
When showing the default startup confirmation view, show exactly the 9 fields listed above and add parenthesized allowed values only for human_gate_policy and agent_completion_mode. Use this table when the user asks what can be configured or wants to override hidden/default fields. CLI users can also run python3 scripts/init_request.py --help to see supported flags and enum values.
| Field | Allowed values | Default | Notes |
|---|---|---|---|
supervisor_workspace | Any writable path | ~/.supervisor | Runtime workspace outside target repos. |
project_path | Absolute local project path | Inferred or ask user | Target codebase or source project. Do not hardcode a personal path in the skill. |
project_key | Lowercase letters, digits, hyphens | Basename of project_path | Folder key under projects/. |
request_title | Short text | Ask user or infer | Human-readable request name. |
mode | new, adopt | new | Use adopt for half-finished work. |
request_id | Unique folder-safe id | Generated | Request folder name under the project. |
memory_scope | global | global | Role memory is shared across projects. |
agent_language | same_as_supervisor or explicit language name | same_as_supervisor | Coder/reviewer visible threads use the same language as the supervisor/user unless configured otherwise. |
human_gate_policy | per_step, final_only, on_failure_only, none | per_step | Controls when humans approve progress. |
review_required | Boolean | true | Whether to create a reviewer thread and run reviewer gates. When false, skip reviewer memory, review prompts, review statuses, and review_max_passes. |
review_max_passes | Integer >= 1 | 2 | Human intervenes after this many failed review passes. Ignored when review_required=false. |
agent_completion_mode | notify, poll | notify | Active notification or supervisor polling. When review_required=false, this applies only to the coder thread. |
poll_interval_seconds | Integer >= 5 | 30 | Applies only when agent_completion_mode=poll. |
thread_project_policy | same_as_project, custom, projectless | same_as_project | Controls where visible coder and optional reviewer threads are created. |
thread_project_path | Absolute local path or empty | project_path | Required for custom unless thread_project_id is set. |
thread_project_id | Codex project id or empty | Empty | Optional alternative to thread_project_path for custom. |
supervisor_scope | global, per_project, per_request | per_project | Controls intended supervisor-thread reuse. |
documents | Array of local paths or URLs | [] | Requirement, SDD, technical docs, or references. |
Before showing startup config confirmation or writing a new request config, check ~/.supervisor, ~/.supervisor/memory/coder-memory.md, and, when review_required=true, ~/.supervisor/memory/reviewer-memory.md.
If ~/.supervisor does not exist or any required memory file is missing:
coder-memory.md and/or reviewer-memory.md from that chat content. Use scripts/init_request.py --coder-memory-text and/or --reviewer-memory-text for short content, or write the pasted content to a temporary text file and pass --coder-memory-text-file and/or --reviewer-memory-text-file for multiline content.scripts/init_request.py with --coder-memory-source and/or --reviewer-memory-source.--create-empty-memory-templates and create empty global memory files with only headings.config.json; store only status such as created_from_chat, imported, created_empty_template, or exists.User requirement, SDD, and technical documents usually live outside this skill and may live outside the code repository.
Document handling rules:
document-index.json.rg --files using names such as sdd, prd, requirement, 需求, 技术方案, and 开发步骤; show likely candidates and ask for confirmation before treating them as source documents.document-index.json.review_required=true (default), also create one visible reviewer thread. If review_required=false, do not create a reviewer thread. Reuse the same role thread(s) across all technical-plan, SDD, and coding units for that request unless the user asks for new threads.create_thread, send_message_to_thread, read_thread, list_threads, list_projects, and set_thread_title.list_projects before create_thread when the tool requires a project id.thread_project_policy overrides assumptions from the supervisor thread's current directory.Coder - project-key - feature request and Reviewer - project-key - feature request.supervisor-state.json inside the confirmed request directory.CODER_DONE, REVIEW_PASSED, and BLOCKER exactly in English.review_required=false, paste only coder memory.Memory compliance, listing which memory bullets were followed or why a bullet was not applicable. When review_required=false, require this only from coder.agent_completion_mode: notify or poll.agent_completion_mode is notify. Include the supervisor thread id and active notification instructions in coder/reviewer prompts when the mode is notify. When review_required=false, include notification instructions only in coder prompts.notify mode, the supervisor must not run a timed read_thread polling loop. Wait for an active notification in the supervisor thread, then read the role thread once to collect full details if needed.notify mode requires a known supervisor_thread_id and usable thread-send tooling. If the supervisor thread id is unavailable, do not silently fall back to polling. Ask the human to choose one of: provide/confirm the supervisor thread id, switch agent_completion_mode to poll, or continue with explicit manual status checks.agent_completion_mode is poll, do not ask coder/reviewer threads to send separate completion notifications. Read the role thread at the configured poll_interval_seconds until the required terminal status appears.poll_interval_seconds must be at least 5 seconds; default is 30 seconds and applies only when agent_completion_mode=poll.human_gate_policy: per_step, final_only, on_failure_only, or none.review_required: when false, skip reviewer dispatch, reviewer result interpretation, reviewer pass counting, and reviewer memory. A CODER_DONE result becomes the unit's agent acceptance signal before the configured human gate.review_max_passes for each active unit. Memory-compliance correction prompts do not count as substantive reviewer passes unless they request a new review.REVIEW_FAILED as valid only when reviewer reports at least one BLOCKER or REQUIRED finding.project_path, project_key, request title, optional document paths/URLs, and likely SDD/technical-plan needs.~/.supervisor is missing or memory files are missing, ask the user to choose a memory bootstrap method before showing startup config confirmation.scripts/init_request.py --dry-run --show-options --confirmation-only or equivalent reasoning, show exactly the 9 startup fields, include parenthesized allowed values only for human_gate_policy and agent_completion_mode, and wait for confirmation.~/.supervisor/projects/<project-key>/<request-id>/, create missing global memory files according to the already chosen memory bootstrap method, write project.json, and write the request config.json.document-index.json when documents are used.supervisor-state.json with scripts/update_status.py.review_required=true, the reviewer thread for this request. Include relevant global role memory in each role prompt.scripts/render_prompt.py when enough context is available; otherwise use references/thread-prompts.md directly.notify mode, tell the coder to notify the supervisor thread when it emits CODER_DONE or BLOCKED; in poll mode, tell the coder to keep the terminal status in its own thread and read it every poll_interval_seconds.review_required=true, send the active unit, coder result, diff context, verification output, reviewer memory, and review standards to the reviewer thread. Use the configured completion mode: in notify mode, tell the reviewer to notify the supervisor thread when it emits REVIEW_PASSED or REVIEW_FAILED; in poll mode, tell the reviewer to keep the terminal status in its own thread and read it every poll_interval_seconds.review_required=false, do not create or message a reviewer thread. After CODER_DONE, apply the configured human gate directly; if no human gate applies for this unit, mark it DONE and advance.BLOCKER and REQUIRED findings back to coder, then re-review.review_max_passes, stop at REVIEW_LIMIT_REACHED and ask the human whether to apply remaining findings, override, or revise scope.coder-memory.md or reviewer-memory.md until the human confirms the proposed memory changes.summary.md in the request directory and send the supervisor's final summary, including coder and, when present, reviewer thread ids or links.Support both SDD sources:
If a project or request is already halfway done, start in mode=adopt instead of restarting from scratch.
Adoption rules:
~/.supervisor/projects/<project-key>/<request-id>/ and record mode=adopt in config.json.DONE or HUMAN_APPROVED in supervisor-state.json only when there is clear evidence or human confirmation.Use scripts/update_status.py to make recovery explicit:
python3 scripts/update_status.py \
--file ~/.supervisor/projects/<project-key>/<request-id>/supervisor-state.json init \
--title "Request title" \
--project-path "/path/to/project" \
--project-key "<project-key>" \
--request-dir "~/.supervisor/projects/<project-key>/<request-id>" \
--supervisor-thread-id "<id>"
Update each active unit before dispatching, after coder completion, after reviewer completion when review is required, and after human approval when the gate policy requires it.
For technical-plan, SDD, and coding work, the supervisor must maintain a visible unit status list in the supervisor thread:
PENDING: not started.CODING: coder is drafting, decomposing, implementing, or verifying this unit.CODER_DONE: coder says the unit is ready for review.REVIEWING: reviewer is checking this unit. Used only when review_required=true.REVIEW_FAILED: reviewer requires changes. Used only when review_required=true.REVIEW_LIMIT_REACHED: reviewer used the configured pass budget and still requires changes; wait for human direction. Used only when review_required=true.REVIEW_PASSED: reviewer accepts the unit. Used only when review_required=true.HUMAN_REVIEW: waiting for human approval.HUMAN_APPROVED: human approved this unit.DONE: unit is closed and the supervisor may start the next unit.With human_gate_policy=per_step, never work on unit N+1 while unit N is before HUMAN_APPROVED, unless the user explicitly authorizes parallel work.
When the configured human approval point is satisfied and the request produced meaningful feedback:
scripts/extract_memory_items.py to draft candidate bullets and scripts/merge_feedback.py for line-level fuzzy merging. Inspect the result and clean up wording if needed.Example:
python3 scripts/merge_feedback.py \
--file ~/.supervisor/memory/coder-memory.md \
--item "Prefer small, well-scoped changes over broad refactors unless the request requires them."
Use clear status labels when communicating between threads:
CODER_DONE: active unit ready for review.REVIEW_FAILED: reviewer found required changes.REVIEW_PASSED: reviewer accepts the current unit.REVIEW_LIMIT_REACHED: maximum reviewer passes reached; supervisor needs human direction.MEMORY_COMPLIANCE_MISSING: an agent omitted required memory compliance output.HUMAN_CHANGES_REQUESTED: human requested more work.HUMAN_APPROVED: human accepted the current unit.SUPERVISOR_DONE: memory and request summary are complete.~/.supervisor; request folders should live under ~/.supervisor/projects/<project-key>/.review_required=false.thread_project_policy=custom or thread_project_policy=projectless.supervisor_workspace, project_path, project_key, project_dir, request_title, human_gate_policy, review_required, review_max_passes, and agent_completion_mode in the default startup confirmation view.human_gate_policy and agent_completion_mode.agent_completion_mode=poll. Default to active notifications unless the user configures polling.agent_completion_mode=notify as permission to poll every 30 seconds. In notify mode, no timed polling loop is allowed.supervisor_thread_id=<unavailable> and then reading role threads on a timer. Either supply the supervisor thread id, switch to poll with human confirmation, or use explicit manual checks.poll_interval_seconds from config.json.review_max_passes without human direction.review_required=false.~/.supervisor/memory/; missing memory is pasted, imported, or initialized as an empty template.