Turn an OpenClaw agent into an autonomous AI programmer. Two use cases:
- For developers — a programming partner instead of a programming tool.
- For non-developers — a teammate who handles simple coding tasks.
Install OpenClaw on a VPS.
flowchart TD
U([User]) -->|"asks via Discord / Slack"| O[OpenClaw]
O -->|"delegates the task<br/>(openclaw-coder-playbook + alignfirst-coaching skills)"| CC[Claude Code]
CC -->|"does the work<br/>(alignfirst skill)"| FS[(Your codebase)]
OpenClaw runs the conversation and, when there's code to write, hands the task to Claude Code through the openclaw-coder-playbook and alignfirst-coaching skills. Claude Code does the actual work with the alignfirst skill, then returns the result for OpenClaw to relay back to the user.
The playbook is designed for Slack and Discord.
Put your git repositories in ~/projects/.
If your bot needs access to a git platform (GitHub, GitLab), set it up.
Your AI developer is a modern developer. It needs the real Claude Code CLI.
- Install the Claude Code CLI and authenticate it with your account. The
claudecommand must work in the terminal. - Install the
alignfirstskill:
npx skills add https://github.com/paleo/alignfirst --global --yes --agent claude-code --skill alignfirstSkill:
alignfirst— spec/plan/code workflow for coding tasks.
OpenClaw will need these skills: openclaw-coder-playbook, alignfirst-coaching, alignfirst:
npx skills add https://github.com/paleo/alignfirst --global --yes --agent universal \
--skill openclaw-coder-playbook --skill alignfirst-coaching --skill alignfirstSkills:
openclaw-coder-playbook— operating instructions for an OpenClaw AI coder.alignfirst-coaching— teaches the agent to delegate coding tasks to Claude Code.alignfirst— not strictly needed, but it helps the bot understand its coding tool.
Optional alignfirst-coaching environment variables:
export ALIGNFIRST_COACHING_LOG_DIR=path/to/directory # Write input/output logs
export ALIGNFIRST_COACHING_SKIP_PERMISSIONS=1 # Use --dangerously-skip-permissions instead of --permission-mode auto
export ALIGNFIRST_COACHING_UNSET=ANTHROPIC_API_KEY # Unset listed vars (comma-separated) before calling claude, e.g. to force an SSO/plan accountOpenClaw needs a coding tool profile that can still post to chat, and the three skills wired in:
The playbook expects each task to run in its own thread session. With Slack, replyToMode: "all" answers every user message in a new thread. On Discord the agent opens the thread itself, so autoThread stays off; alsoAllow: ["message"] is what lets it do so.
Here is an example of a workspace's AGENTS.md. The only required part is the first section.
Feel free to adapt the other sections. In particular, replace the instructions related to tickets with your own instructions on how to access your Linear, Jira, or GitHub/GitLab issues.
The openclaw-coder-playbook skill is developed against an internal regression-test harness: playbook-test/README.md. Maintainer overview: docs/openclaw-coder.md.
Get started:
# From this `openclaw-coder/` directory
git clone --depth 1 https://github.com/openclaw/openclaw.git .local/openclaw
cd playbook-test
cp .env.local.example .env.local
# Set the API keys in `.env.local` as needed
npm install && npm run env:build
# Run scenarios, e.g. all of them on every channel:
npm run e2e -- --channel all --all
{ "tools": { "profile": "coding", "alsoAllow": ["message"] // let the channel session open threads and post }, "agents": { "defaults": { "skills": ["alignfirst", "alignfirst-coaching", "openclaw-coder-playbook"] } }, "channels": { "slack": { "replyToMode": "all", "thread": { "initialHistoryLimit": 100 } }, "discord": { // Leave `autoThread` off for Discord } } }