Architect
Treat architecture as the traceable assignment of identity, behavior, authority,
persistence, lifecycle, and process ownership to clisbot's existing systems.
Start from one concrete user flow, prove what the repository executes, and add
the smallest coherent extension only when the current owner chain cannot express
the job.
Select one mode
State the selected mode and scope before acting. Do not blend modes silently.
- Use
ask for architecture questions, feature exploration, or “how should this
work?”. Answer from evidence without editing product code or creating a
persistent planning artifact. Default to ask when no stronger signal exists.
- Use
plan when the user asks for a plan, proposal, roadmap, design audit, or
migration approach. Create or update the appropriate research, feature, audit,
or task artifact; do not create an accepted decision or edit product code.
- Use
decide when the user accepts a proposal, asks to ratify a decision, or
requests implementation of an architecture-affecting change. Record each
material decision in its repository-level or feature-level decision owner and
update canonical architecture when meaning changes. Implement only when the
user requests implementation.
- Use
auto when the user delegates the outcome and asks Codex to decide and
build without architecture checkpoints. Internally run plan -> decide ->
implement for each material decision, then verify and update artifacts
truthfully. Ask only for unresolved scope, authority, destructive action, or an
external blocker.
If current contracts and decisions already settle the matter, reuse them. Do not
create another decision record merely to restate an existing rule. If no material
architecture decision exists, use the normal implementation loop without
artifact inflation and say why.
Load only the evidence the task needs
- Always read architecture-routing.md.
- For runtime, session, runner, persistence, credentials, lifecycle, detached
process, monitor, HTTP listener, or CLI work, also read
runtime-persistence-routing.md.
- Before creating or updating a plan, decision, feature, or task artifact, read
artifact-format.md.
- Read the selected canonical documents and executable owners completely enough
to establish the owner chain. Use
rg to locate moved owners rather than
trusting cached paths.
Ground the current architecture
- Read repository instructions and establish the dirty-tree boundary. Preserve
unrelated user work.
- Start from the visible user job. Describe the shortest end-to-end flow from
inbound surface or operator action to routing, session ownership, runner
execution, persistence, and visible result.
- Use architecture documents as the stable implementation contract. Guides
describe operator behavior; feature docs describe stable feature intent;
research, audits, and tasks are supporting evidence unless promoted.
- Trace executable code and focused tests across the smallest complete owner
chain. Never infer implemented flexibility from prose, a type, a parseable
config shape, or a registry entry alone.
- Label conclusions
CURRENT, TARGET, GAP, or HISTORICAL.
- For every material value or payload, identify source, canonical owner,
identity, scope, lifetime, persistence, authority, consumers, failure, and
cleanup behavior.
- Treat foreground runtime, monitor, HTTP listener, detached worker, runner
subprocess, and one-shot CLI as separate processes unless code proves
otherwise.
- Search existing decisions, feature contracts, tests, gates, and sibling
mechanisms before proposing a new owner or store.
Build the architecture map
Produce the smallest map that lets a reader answer:
- What does the user do and what visible outcome changes?
- Which system owns durable identity and configuration?
- Which system owns live run truth, queueing, session continuity, and cleanup?
- How do channel-native identities map into canonical surfaces and sessions?
- Which runner capability or backend quirk determines behavior?
- Which values are config, secrets, canonical state, projections, diagnostics,
or transient runtime state?
- Which OS process reads or mutates each value, and how are writes coordinated?
- What happens on retry, cancellation, restart, duplicate delivery, and partial
channel failure?
- What is already reusable, what is a bounded gap, and what must not be
generalized from the first consumer?
Use a diagram or table only when it materially clarifies multiple mappings or a
stateful sequence. Explain the concrete flow before naming abstractions.
Choose the smallest correct change
Apply this reuse order:
- Reuse the current canonical owner and contract unchanged.
- Connect an existing contract, registry, capability, service, or lifecycle
seam that is present but not wired to this consumer.
- Extend the nearest owner with one typed capability while preserving identity,
lifecycle, process, and persistence boundaries.
- Add a new concept only when current owners have a different meaning, scope,
lifecycle, authority, retention, or reason to change.
Reject duplicated config mutation paths, parallel session or queue owners,
runner-specific behavior in agents, channel UX in runner code, product concepts
in src/infra, transient runtime state in durable contracts, and one-off JSON
stores without the persistence-store gate. Backend-facing resources stay
resource-oriented and revision-aware.
Create or extend a shared abstraction when the product direction identifies a
definite future consumer and the shared contract is already clear. Do not
generalize around speculative consumers or syntax alone.
Ask mode
- Lead with the architectural conclusion.
- Walk the current user flow and exact owner chain.
- Explain current flexibility and hard boundaries from code and tests.
- Separate proposed extension from current behavior.
- Pressure-test the primary case plus one materially different consumer when
recommending a shared abstraction.
- End with the smallest recommendation, gaps, and implementation implications.
Plan mode
Create one routed artifact using the artifact reference. Include:
- concrete current flow and executable proof;
- owner, identity, lifecycle, authority, process, and persistence map;
- contract-versus-code gap ledger;
- consumer pressure tests for shared mechanisms;
- options, trade-offs, recommendation, non-goals, and open decisions;
- exact contracts, code owners, stores, migration, tests, rollout, and rollback;
- implementation order and measurable Definition of Done.
Keep every open decision explicit. A plan is proposed, not accepted or shipped.
Decide mode
- Locate the supporting plan or reconstruct the focused evidence when no
persistent plan is warranted.
- Resolve every decision required for the accepted scope without inferring
consent for a broader outcome.
- Reuse an existing decision when it already owns the issue. Otherwise create
one dated repository-level or feature-level decision record.
- Update the smallest canonical architecture or feature owner when meaning
changes, preserving and cross-linking superseded history.
- Keep acceptance and implementation status distinct.
- If implementation was requested, follow the repository task and verification
workflow. Claim implementation only after code, migration, tests, docs, and
operator surfaces prove it.
Auto mode
- Reconstruct the user outcome and current architecture.
- Reuse current accepted decisions where possible.
- Plan and ratify each new material decision before depending on it in code.
- Implement one owner chain at a time.
- Verify proportionally and inspect the resulting user or operator flow rather
than accepting compilation alone.
- Update feature, task, decision, and architecture status to match reality.
Auto mode removes routine checkpoints, not safety, authority, or evidence.
Finish every mode
Report the mode, scope, current proof, owner chain, current versus target result,
artifacts changed, verification, open decisions, and remaining gaps. A run
succeeds when another reader can reproduce why the owner is correct and
distinguish what works now from what is accepted or merely planned.
1---2name: architect3description: Answer, plan, ratify, or autonomously implement clisbot architecture work from repository evidence. Use when a request may change channel, agent, session, runner, auth, configuration, control, persistence, process, API, UI, integration, ownership, lifecycle, or contract boundaries; when the user asks how clisbot currently works or should work; or when an architectural proposal must be planned, accepted, or implemented. Supports ask, plan, decide, and auto modes.4---56# Architect78Treat architecture as the traceable assignment of identity, behavior, authority,9persistence, lifecycle, and process ownership to clisbot's existing systems.10Start from one concrete user flow, prove what the repository executes, and add11the smallest coherent extension only when the current owner chain cannot express12the job.1314## Select one mode1516State the selected mode and scope before acting. Do not blend modes silently.1718- Use `ask` for architecture questions, feature exploration, or “how should this19 work?”. Answer from evidence without editing product code or creating a20 persistent planning artifact. Default to `ask` when no stronger signal exists.21- Use `plan` when the user asks for a plan, proposal, roadmap, design audit, or22 migration approach. Create or update the appropriate research, feature, audit,23 or task artifact; do not create an accepted decision or edit product code.24- Use `decide` when the user accepts a proposal, asks to ratify a decision, or25 requests implementation of an architecture-affecting change. Record each26 material decision in its repository-level or feature-level decision owner and27 update canonical architecture when meaning changes. Implement only when the28 user requests implementation.29- Use `auto` when the user delegates the outcome and asks Codex to decide and30 build without architecture checkpoints. Internally run plan -> decide ->31 implement for each material decision, then verify and update artifacts32 truthfully. Ask only for unresolved scope, authority, destructive action, or an33 external blocker.3435If current contracts and decisions already settle the matter, reuse them. Do not36create another decision record merely to restate an existing rule. If no material37architecture decision exists, use the normal implementation loop without38artifact inflation and say why.3940## Load only the evidence the task needs4142- Always read [architecture-routing.md](references/architecture-routing.md).43- For runtime, session, runner, persistence, credentials, lifecycle, detached44 process, monitor, HTTP listener, or CLI work, also read45 [runtime-persistence-routing.md](references/runtime-persistence-routing.md).46- Before creating or updating a plan, decision, feature, or task artifact, read47 [artifact-format.md](references/artifact-format.md).48- Read the selected canonical documents and executable owners completely enough49 to establish the owner chain. Use `rg` to locate moved owners rather than50 trusting cached paths.5152## Ground the current architecture53541. Read repository instructions and establish the dirty-tree boundary. Preserve55 unrelated user work.562. Start from the visible user job. Describe the shortest end-to-end flow from57 inbound surface or operator action to routing, session ownership, runner58 execution, persistence, and visible result.593. Use architecture documents as the stable implementation contract. Guides60 describe operator behavior; feature docs describe stable feature intent;61 research, audits, and tasks are supporting evidence unless promoted.624. Trace executable code and focused tests across the smallest complete owner63 chain. Never infer implemented flexibility from prose, a type, a parseable64 config shape, or a registry entry alone.655. Label conclusions `CURRENT`, `TARGET`, `GAP`, or `HISTORICAL`.666. For every material value or payload, identify source, canonical owner,67 identity, scope, lifetime, persistence, authority, consumers, failure, and68 cleanup behavior.697. Treat foreground runtime, monitor, HTTP listener, detached worker, runner70 subprocess, and one-shot CLI as separate processes unless code proves71 otherwise.728. Search existing decisions, feature contracts, tests, gates, and sibling73 mechanisms before proposing a new owner or store.7475## Build the architecture map7677Produce the smallest map that lets a reader answer:7879- What does the user do and what visible outcome changes?80- Which system owns durable identity and configuration?81- Which system owns live run truth, queueing, session continuity, and cleanup?82- How do channel-native identities map into canonical surfaces and sessions?83- Which runner capability or backend quirk determines behavior?84- Which values are config, secrets, canonical state, projections, diagnostics,85 or transient runtime state?86- Which OS process reads or mutates each value, and how are writes coordinated?87- What happens on retry, cancellation, restart, duplicate delivery, and partial88 channel failure?89- What is already reusable, what is a bounded gap, and what must not be90 generalized from the first consumer?9192Use a diagram or table only when it materially clarifies multiple mappings or a93stateful sequence. Explain the concrete flow before naming abstractions.9495## Choose the smallest correct change9697Apply this reuse order:98991. Reuse the current canonical owner and contract unchanged.1002. Connect an existing contract, registry, capability, service, or lifecycle101 seam that is present but not wired to this consumer.1023. Extend the nearest owner with one typed capability while preserving identity,103 lifecycle, process, and persistence boundaries.1044. Add a new concept only when current owners have a different meaning, scope,105 lifecycle, authority, retention, or reason to change.106107Reject duplicated config mutation paths, parallel session or queue owners,108runner-specific behavior in agents, channel UX in runner code, product concepts109in `src/infra`, transient runtime state in durable contracts, and one-off JSON110stores without the persistence-store gate. Backend-facing resources stay111resource-oriented and revision-aware.112113Create or extend a shared abstraction when the product direction identifies a114definite future consumer and the shared contract is already clear. Do not115generalize around speculative consumers or syntax alone.116117## Ask mode1181191. Lead with the architectural conclusion.1202. Walk the current user flow and exact owner chain.1213. Explain current flexibility and hard boundaries from code and tests.1224. Separate proposed extension from current behavior.1235. Pressure-test the primary case plus one materially different consumer when124 recommending a shared abstraction.1256. End with the smallest recommendation, gaps, and implementation implications.126127## Plan mode128129Create one routed artifact using the artifact reference. Include:130131- concrete current flow and executable proof;132- owner, identity, lifecycle, authority, process, and persistence map;133- contract-versus-code gap ledger;134- consumer pressure tests for shared mechanisms;135- options, trade-offs, recommendation, non-goals, and open decisions;136- exact contracts, code owners, stores, migration, tests, rollout, and rollback;137- implementation order and measurable Definition of Done.138139Keep every open decision explicit. A plan is proposed, not accepted or shipped.140141## Decide mode1421431. Locate the supporting plan or reconstruct the focused evidence when no144 persistent plan is warranted.1452. Resolve every decision required for the accepted scope without inferring146 consent for a broader outcome.1473. Reuse an existing decision when it already owns the issue. Otherwise create148 one dated repository-level or feature-level decision record.1494. Update the smallest canonical architecture or feature owner when meaning150 changes, preserving and cross-linking superseded history.1515. Keep acceptance and implementation status distinct.1526. If implementation was requested, follow the repository task and verification153 workflow. Claim implementation only after code, migration, tests, docs, and154 operator surfaces prove it.155156## Auto mode1571581. Reconstruct the user outcome and current architecture.1592. Reuse current accepted decisions where possible.1603. Plan and ratify each new material decision before depending on it in code.1614. Implement one owner chain at a time.1625. Verify proportionally and inspect the resulting user or operator flow rather163 than accepting compilation alone.1646. Update feature, task, decision, and architecture status to match reality.165166Auto mode removes routine checkpoints, not safety, authority, or evidence.167168## Finish every mode169170Report the mode, scope, current proof, owner chain, current versus target result,171artifacts changed, verification, open decisions, and remaining gaps. A run172succeeds when another reader can reproduce why the owner is correct and173distinguish what works now from what is accepted or merely planned.