Code-role is intended to be used as a role-configuration project.
The recommended current setup is:
Code-role project
-> stores workflow protocol files
-> stores role definitions
-> stores role packet outputs
-> hosts one configured conversation per role
Target code project
-> contains the product code being discussed or changed
-> is read by research / architecture / code-context roles only within approved scope
-> is written only by Implementer after explicit approval
Do not run the full workflow by switching roles inside one conversation. Each role should be configured and used as a separate role instance.
A role instance is one configured Codex conversation dedicated to exactly one role.
Examples:
workflow-orchestratorinstanceresearcherinstanceproduct-prdinstancearchitectinstancecode-contextinstanceimplementerinstancetest-evaluatorinstancereviewerinstance
Each instance reads its own ROLE.md and follows only that role's prompt contract.
Each role instance should be configured with:
- the role's
ROLE.md docs/workflow/README.mddocs/workflow/discussion-first-protocol.mddocs/workflow/handoff-protocol.mddocs/workflow/packet-schema.mddocs/workflow/source-map.md- any upstream
handoff.manifest.jsonexplicitly provided for the milestone - the target project path, when that role needs to inspect or modify the product project
The role instance must not infer upstream input from chat memory or by scanning for the newest packet.
Each role instance has one job: produce that role's explicit output.
If the conversation moves away from that output, the role must correct it:
- State that the request is outside the current role's scope.
- Name the role that should handle the request.
- Return to the current role's expected output.
- Clone
Deepleaper/Code-roleinto a local Code-role project. - Bootstrap the target project with
scripts/init_project_workflow.py. - Create one Codex role instance for
workflow-orchestrator. - Paste
code-role/role-instance-prompts/workflow-orchestrator.mdinto that instance. - Create each execution role instance only when Orchestrator routes to it.
- Paste that role's generated prompt from
code-role/role-instance-prompts/. - Let the role read the explicit upstream manifest. If optional
code-role/state-index/roles/<role>.mdexists, it may use that file only as navigation. - Let each role write only its own packet output.
- Let Implementer write target project files only after the packet chain and user confirmation allow implementation.
The generated prompts reduce setup friction. They do not replace role ROLE.md files, packet manifests, or Orchestrator routing.
Use the bootstrap script from the Code-role repository:
python scripts/init_project_workflow.py \
--target "/path/to/Target Project" \
--project-name "Target Project" \
--writeOmit --write to preview the files. The script creates local-only project config, role-instance prompts, and Orchestrator state files. Add --with-state-index only when you want optional navigation files. The script also adds code-role/ to .git/info/exclude when that target file exists. It does not create execution packets, mark readiness, stage files, commit, or push.
See project-bootstrap.md, state-index.md, and git-operation-policy.md.
The target project should be provided as an explicit path in the milestone or role prompt.
Non-Implementer roles may inspect target project files only within source-map and packet-approved scope.
Implementer may modify target project files only when:
- Orchestrator confirms implementation may start
- upstream packets are consumable
- the target project path is explicit
- the approved file scope is explicit
- the user confirms implementation start
Some teams may choose to copy docs/workflow/ into the target code project.
That is allowed, but it is not the only supported model. If embedded in the target project, follow bootstrap.md and decide whether workflow files stay local-only or become a committed repo standard.
For the current Code-role usage model, prefer the separate role-configuration project.