State-machine based coding-agent orchestration scaffold.
npm install -g crewctl
crewctl init
crewctl doctor
crewctl-mcpFor MCP-capable clients, configure the server command:
{
"mcpServers": {
"crewctl": {
"command": "crewctl-mcp"
}
}
}Use MCP tools when available, and fall back to the crewctl CLI when a runtime only supports shell commands.
crewctl is a lightweight workflow engine for coding agents.
Current focus:
- deterministic workflow first
- machine-readable state
- human-readable handoff artifacts
- role-based pipeline: planner -> implementer -> auditor -> qc
- portable core with runtime adapters; OpenClaw is the first intended adapter
Important: crewctl does not include built-in provider clients yet. There is no OpenAI/Anthropic/OpenRouter endpoint integration in the core code. Provider/model execution is currently expected to come from OpenClaw or another external runtime.
Current phase: deterministic local pipeline with runtime adapter metadata and early OpenClaw handoff support.
Already implemented:
- repo scaffold
.agent/artifact structure- state machine file
- runner CLI
- lock guard for state mutations
- planner / implementer / auditor / QC deterministic executors
- role contract templates and role prompts
- history logging
- retry / block handling
- guarded
agent:complete-roleartifact validation - structured check evidence in
.agent/check-results.json - runtime adapter/status prompt commands with OpenClaw compatibility
- Codex skill draft under
skills/crewctl/ - smoke coverage for happy path, QC recovery, and manual handoff guard
- durable planning docs under
docs/
Not implemented yet:
- real AI workers in code (only external/runtime handoff contract exists)
- rich configured checks for build/lint/typecheck
- full OpenClaw-native orchestration wrapper
.agent/
workstate.json
context.md
plan.md
implementation-report.md
audit.md
qc.json
history.md
src/
runner.mjs
templates/
planner.md
implementer.md
auditor.md
qc.md
prompts/
planner.md
implementer.md
auditor.md
qc.md
examples/
demo-happy-path.md
demo-failure-path.md
skills/
crewctl/
SKILL.md
agents/openai.yaml
tests/
smoke.mjs
crewctl.config.json
README.md
ROADMAP.md
PROMPT_DIAGRAM.md
OPENCLAW_ADAPTER.md
OPENCLAW_WORKFLOW.md
REAL_WORKERS.md
package.jsonFrom this repository:
npm run agent:init
npm run agent:status
npm run agent:next
npm run agent:plan
npm run agent:implement
npm run agent:audit
npm run agent:qc
npm run agent:run-planner
npm run agent:run-implementer
npm run agent:run-auditor
npm run agent:run-qc
npm run agent:new-task -- "Build something"
npm run agent:continue
npm run agent:run
npm run agent:role-prompt
npm run agent:complete-role -- planner pass
npm run agent:runtime-adapter
npm run agent:openclaw-adapter
npm run agent:source-of-truth
npm run agent:checks
npm run skill:install-codex
npm run skill:probe
npm run check
npm run test:smoke
npm run test:mcpnpm install -g crewctl
crewctl init
crewctl doctor
crewctl install-skill codexAfter package install:
crewctl init
crewctl doctor
crewctl status
crewctl runtime-adapter
crewctl install-skill codex
crewctl-mcpworkstate.json= machine-readable workflow state- Markdown / JSON artifacts = human-readable and machine-readable handoff outputs
runner.mjs= deterministic transition helper and local executor entrypoint.agent/run.lock= mutation guard to reduce race conditions- role contracts live in
templates/ - actual AI workers can be plugged in later without changing the core artifact contract
- real worker handoff is documented in
REAL_WORKERS.md - runtime adapter integration is documented in
docs/RUNTIME_ADAPTERS.md - workflow/runtime/check defaults live in
crewctl.config.json - durable planning references live in
docs/SOURCE_OF_TRUTH.md agent:complete-rolevalidates role artifacts before accepting apassresultagent:source-of-truthexposes the current planning/reference anchor for external orchestrators
Initialize crewctl in another repository:
crewctl init --target /path/to/project --objective "Initial crewctl task"Inspect whether a repository is crewctl-ready:
crewctl doctor --target /path/to/projectinit creates .agent/, crewctl.config.json, templates/, and prompts/. It skips existing files unless --force is provided.
Run the MCP server with:
crewctl-mcpThe server exposes crewctl as MCP tools so an orchestrator can avoid shell-command orchestration:
crewctl_doctorcrewctl_initcrewctl_statuscrewctl_runtime_adaptercrewctl_role_promptcrewctl_complete_rolecrewctl_continuecrewctl_checkscrewctl_source_of_truth
Use MCP tools when the runtime supports them. Use the CLI as the fallback command interface.
This repo includes a project-local Codex skill package:
skills/crewctl/
SKILL.md
agents/openai.yaml
scripts/probe.pyInstall it into the local Codex skills directory when you want another Codex thread/project to discover it:
npm run skill:install-codexThe installer copies skills/crewctl to $CODEX_HOME/skills/crewctl, or ~/.codex/skills/crewctl when CODEX_HOME is unset.
When installed as a package or linked globally, the same operation is available without a project-local package.json:
crewctl install-skill codexINIT
-> PLANNING
-> READY_FOR_IMPLEMENT
-> IMPLEMENTING
-> READY_FOR_AUDIT
-> AUDITING
-> READY_FOR_QC
-> QC
-> DONEFailure paths later:
AUDIT_FAILEDQC_FAILEDBLOCKED
Crewctl exposes a runtime-neutral adapter contract through:
npm run agent:runtime-adapterOpenClaw is the first intended real-worker runtime and keeps a compatibility alias:
npm run agent:openclaw-adapterThe intended OpenClaw flow is:
OpenClaw orchestrator
-> npm run agent:role-prompt
-> spawn role subagent
-> worker updates artifact
-> npm run agent:complete-role -- <role> pass/fail
-> crewctl validates required artifact before accepting pass
-> repeat until DONE/BLOCKEDSee:
docs/RUNTIME_ADAPTERS.mdskills/crewctl/SKILL.mdOPENCLAW_WORKFLOW.mdOPENCLAW_ADAPTER.mdprompts/openclaw-orchestrator.mddocs/SOURCE_OF_TRUTH.mddocs/PUBLISHING_CHECKLIST.md
This project can go in two compatible directions:
-
Independent repo/tool
- portable orchestration engine
- usable outside OpenClaw
-
Runtime-integrated tool
- OpenClaw acts as the first orchestrator/adapter
- Codex can integrate through a skill, plugin, or MCP wrapper
- role workers can run as subagents
- same artifact/state contract stays intact
See ROADMAP.md for phased development.
