Implementation workflow for coding tasks. Iterates Linear issues by priority per project. Spawns Codex for TDD-style implementation, runs full gate, Claude review, fix loop, and ships on main. Use when the user says "build", "implement", "fix", or references a task to work on.
This skill processes one project at a time. The caller (cron prompt or user) chooses the target project and invokes this skill. The skill iterates that project's actionable issues by priority until the project is clear or blocked.
Workflow per issue: Fetch Issue -> Build (TDD) -> Full Gate -> Review -> Evaluate Findings -> Fix -> Ship -> Next Issue.
The Linear issue is the source of truth for what to build. Preserve and pass the issue description, acceptance criteria, implementation notes, and relevant comments to Codex. The orchestrator may add workflow constraints around the issue text, but must not replace the issue instructions with a loose summary.
OpenClaw supervises. Codex does all repo work: git inspection, formatting, linting, tests, full gates, code edits, commits, and pushes.
/Users/sujshe/.openclaw/workspace/dev-sessions/state/night-build-blocked.json/Users/sujshe/.openclaw/workspace/dev-sessions/memory/YYYY-MM-DD-night.md/Users/sujshe/.openclaw/workspace/PROJECTS.yamlOpenClaw orchestrates via the exec tool and invokes the Codex and Claude CLIs
directly. No ACP subagents, no announce-timeout. Each run is bounded by the
exec tool's per-call timeoutSec.
Prompts are passed via heredoc on stdin — no prompt files to maintain, no shell
escaping, no ARG_MAX concerns, safe for any content (code snippets, JSON
blobs, quotes, $, backticks). The quoted <<'EOF' delimiter prevents shell
expansion inside the prompt.
Verify CLI flags once against your installed versions —
codex exec --help and claude --help. The skill assumes:
codex execcodex exec resume --last (fallback if --last is not
supported: capture the session id printed by the initial run, then use
codex exec resume <session-id>).claude -pclaude -p --continue (fallback: claude -p --resume <session-id>).exec(
cwd="<repo>",
timeoutSec=1800,
command="""
codex exec \
--dangerously-bypass-approvals-and-sandbox \
<<'CODEX_EOF'
<builder prompt>
CODEX_EOF
"""
)
exec(
cwd="<repo>",
timeoutSec=1800,
command="""
codex exec resume --last \
--dangerously-bypass-approvals-and-sandbox \
<<'CODEX_EOF'
<next task prompt>
CODEX_EOF
"""
)
exec(
cwd="<repo>",
timeoutSec=1200,
command="""
claude -p \
--dangerously-skip-permissions \
<<'CLAUDE_EOF'
<reviewer prompt>
CLAUDE_EOF
"""
)
exec(
cwd="<repo>",
timeoutSec=1200,
command="""
claude -p --continue \
--dangerously-skip-permissions \
<<'CLAUDE_EOF'
Continue the review you started. Finish it in one run.
CLAUDE_EOF
"""
)
The CLI exits non-zero on failure. The orchestrator parses stdout for the
structured output contract — CHANGED_FILES / VERIFICATION / SUMMARY or
FAILED_NO_CHANGES for Codex; OUTCOME / FINDINGS / SUMMARY for Claude.
No separate status-polling step is needed — process exit is the completion
signal.
The caller provides the target project. This skill fetches and processes its issues.
clear.The repo state check is done by Codex inside the CLI run, not by OpenClaw. Before changing files, Codex must run and report:
git branch --show-current
git status --short
git log --oneline -5
main). Do not create
night/, feature/, or dev branches.pnpm-lock.yaml, package-lock.json, Cargo.lock, etc.) are
not blockers. Stage and include them if they result from dependency changes.If the repo is unsafe to continue, Codex must stop without editing and return
FAILED_NO_CHANGES: <exact blocker>.
Run the Codex CLI for the project. For the first issue in a project use
codex exec (new session). For follow-up issues in the same project, use
codex exec resume --last so Codex retains codebase context from the previous
issue. Capture any session id printed by the CLI — it's the fallback if
--last is not supported or the most-recent-session pointer gets lost.
Session continuation is scoped to the current project only. When the
caller moves to a different project, start a fresh codex exec (new session)
in the new repo. Do not carry a session from one project's repo into another.
When continuing a session for a follow-up issue, instruct Codex to run
/compact before starting any new work to free up context from the previous
issue.
If continuation fails (the CLI reports no session to resume, or the prior
session id is invalid), fall back to a fresh codex exec call and instruct
Codex to read the repo's AGENTS.md and explore the codebase structure before
making any changes.
Before spawning Codex, prepare a concrete brief:
CLAUDE.md (or AGENTS.md / .agents/) for conventions
and commands. Codex auto-reads AGENTS.md and .agents/ from the repo root,
so do not repeat their content in the builder prompt.docs/ directory. Include the path in the builder prompt if found.PROJECTS.yaml).The Linear issue contains the implementation instructions. Pass them to Codex verbatim with this structure:
You are the Codex builder for <issue-id>: <issue-title>.
Repo: <cwd>
Branch: stay on the repo default branch. Do not create or switch branches.
Do not commit or push yet — you will be told to ship after review passes.
## Task
<issue description, acceptance criteria, implementation notes, and relevant
Linear comments pasted verbatim>
## References
<design doc or implementation plan path, if available>
<relevant interfaces/types/stubs from the codebase, if they exist>
## Approach
First, run the repo state check:
- git branch --show-current
- git status --short
- git log --oneline -5
If the repo is on the wrong branch or dirty with unrelated/ambiguous work, stop
without editing and return FAILED_NO_CHANGES with the exact blocker.
Before writing any code, read the repo's AGENTS.md (or CLAUDE.md) and explore
the codebase to understand the existing architecture, module boundaries, and
how similar features are wired together. Understand where your changes need to
integrate before you start implementing.
Deliver a complete, integrated feature — not just isolated code. Wire your
implementation into the rest of the system: update callers, register routes,
add exports, connect config, and update any entry points so the feature is
actually reachable and functional without manual follow-up.
Prefer tests first: write or update the failing test that proves the requested
behavior, then implement until the tests pass. If the repo already has a test
pattern, follow it. If tests-first is not practical, explain why in the final
summary and still add appropriate coverage before finishing.
## Gate
Run before finishing. Include formatting, linting, tests, and any full gate
configured for this project:
<gate commands from project config>
## Output
End with exactly one of:
CHANGED_FILES:
- <path>
SUMMARY:
<what you did>
VERIFICATION:
- <command>: <pass/fail and key output>
- git status --short: <output>
- git diff --name-only: <output>