Preqstation
by @sonim1
Delegate PREQSTATION coding tasks to Claude Code, Codex CLI, or Gemini CLI with PTY-safe execution (workdir + background + monitoring). Use when building, re...
clawhub install preqstation-openclawπ About This Skill
name: preqstation description: "Delegate PREQSTATION coding tasks to Claude Code, Codex CLI, or Gemini CLI with PTY-safe execution (workdir + background + monitoring). Use when building, refactoring, or reviewing code in mapped workspaces. NOT for one-line edits or read-only inspection." metadata: {"openclaw":{"requires":{"anyBins":["claude","codex","gemini"]}}}
preqstation
Use this skill for natural-language requests to execute PREQSTATION-related work with local CLI engines.
Trigger / NOT for
Trigger this skill with highest priority when the message contains any of:
/skill preqstationpreqstationpreqDo NOT use this skill for:
~/clawd/ or ~/.openclaw/Quick trigger examples
/skill preqstation: implement the PROJ-1preqstation: plan PROJ-76 using Claude Codepreq: implement PROJ-1Hard rules
1. Always run coding agents with pty:true.
2. Respect the engine the user requested. If unspecified, default to claude.
3. Do not kill sessions only because they are slow; poll/log first.
4. Never launch coding agents in ~/clawd/ or ~/.openclaw/.
5. Treat resolved project path as a primary checkout source only; create a git worktree before launching any coding agent.
6. Never run coding-agent commands in the primary checkout path.
7. PR review must run in a temp clone or git worktree, never in a live primary checkout.
8. Keep execution scoped to resolved worktree only.
9. Worktree branch names must include the resolved project key.
Runtime prerequisites (required)
git must be installed and available on PATH.claude, codex, or gemini.OPENCLAW_WORKTREE_ROOT (optional, default /tmp/openclaw-worktrees)
MEMORY.md project mappings with absolute paths.Execution safety gates (required)
Before running any engine command:
1. Run preflight checks:
- command -v git
- command -v
2. Continue only when execution cwd is a resolved git worktree path for this task.
3. Never run engine commands in primary checkout paths or inside ~/clawd/ / ~/.openclaw/.
4. Use dangerously-* / sandbox-disable flags only for actual coding execution with local trusted CLIs.
5. For planning/read-only requests, do not launch engine commands.
Input interpretation
Parse from user message:
1. engine
claude, codex, or geminiclaude2. task
- (example: PRJ-284)3. project_cwd (required to prepare execution)
project key from MEMORY.mdMEMORY.md project key, use that pathMEMORY.md, then continue executionMEMORY.md, always ask the user before execution (do not guess)4. objective
5. cwd (required to execute)
project_cwdproject_cwd is not a git checkout, ask for a git workspace path before executionMEMORY.md resolution
MEMORY.md from this repository root.Projects table (key | cwd | note).MEMORY.md first, then confirm.PROS-102 -> pros).MEMORY.md update rules
Projects table only.| | | | .note; otherwise use workspace.Missing project mapping flow (required)
When project_cwd cannot be resolved, or exact project key is missing in MEMORY.md:
1. Ask one short question requesting:
MEMORY.md row immediately.
4. Confirm mapping in one short line.
5. Continue the original task using the newly resolved project_cwd, then create task worktree cwd and execute.Branch naming convention (project key based)
Use this format for worktree branches:
codex/
Rules:
must be the resolved project key from MEMORY.md. to lowercase and kebab-case.Worktree-first execution (required default)
After resolving project_cwd and project_key, prepare execution workspace:
1. Build branch name using this skill's convention:
codex/${OPENCLAW_WORKTREE_ROOT:-/tmp/openclaw-worktrees}/ project_cwd before launching engine:
git -C worktree add -b codex/ HEAD git -C worktree add codex/ for prompt rendering and engine execution.Prompt rendering (required template)
Do not forward raw user text directly. Render this template:
In this template, must be the task worktree path (not the primary checkout path).
Task ID:
Project Key:
User Objective:
Execution Requirements:
1) Work only inside .
2) Complete the requested work.
3) After completion, return a short completion summary.
Engine commands (current policy retained)
All engine commands must be launched via bash with PTY and explicit workdir.
Why dangerously-* flags are retained:
Claude Code
bash pty:true workdir: command:"claude --dangerously-skip-permissions ''"
Codex CLI
bash pty:true workdir: command:"codex exec --dangerously-bypass-approvals-and-sandbox ''"
Gemini CLI
bash pty:true workdir: command:"GEMINI_SANDBOX=false gemini -p ''"
Bash execution interface (required)
Use bash with PTY and optional background mode.
Bash parameters
| Parameter | Type | Required | Purpose |
| ------------ | ------- | -------- | ------- |
| command | string | yes | Engine command to run |
| pty | boolean | yes | Must be true for coding-agent CLIs |
| workdir | string | yes | Per-task worktree |
| background | boolean | no | Run asynchronously and return session id |
| timeout | number | no | Hard timeout in seconds |
| elevated | boolean | no | Host execution if policy allows |
Process actions for background sessions
Use these actions as standard controls:
list: list sessionspoll: check running/done statuslog: read incremental outputwrite: send raw stdinsubmit: send stdin + newlinekill: terminate a session only when requiredExecution patterns (workdir + background + pty)
One-shot example
Create a task worktree, then run inside that worktree:git -C worktree add -b codex/ /tmp/openclaw-worktrees/ HEAD
bash pty:true workdir:/tmp/openclaw-worktrees/ command:"codex exec --dangerously-bypass-approvals-and-sandbox ''"
The Pattern: workdir + background + pty For longer tasks, use background mode with PTY:
# Start agent in task worktree (with PTY!)
bash pty:true workdir: background:true command:"codex exec --full-auto 'Build a snake game'"
Returns sessionId for tracking
Monitor progress
process action:log sessionId:XXXCheck if done
process action:poll sessionId:XXXSend input (if agent asks a question)
process action:write sessionId:XXX data:"y"Submit with Enter (like typing "yes" and pressing Enter)
process action:submit sessionId:XXX data:"yes"Kill if needed
process action:kill sessionId:XXX
Why workdir matters: Agent wakes up in a focused directory, doesn't wander off reading unrelated files (like your soul.md π ).
If user input is required mid-run
process action:write sessionId: data:"y"
process action:submit sessionId: data:"yes"
PR review safety pattern (temp dir/worktree only)
Never run PR review in live OpenClaw folders.
# default: git worktree review (project-key based branch naming)
git worktree add -b codex/ /tmp/-review
bash pty:true workdir:/tmp/-review command:"codex review --base "fallback: temp clone review (only when local checkout is unavailable)
REVIEW_DIR=$(mktemp -d)
git clone "$REVIEW_DIR"
cd "$REVIEW_DIR" && gh pr checkout
bash pty:true workdir:"$REVIEW_DIR" command:"codex review --base origin/main"
Issue worktree pattern
git worktree add -b codex/ /tmp/ mainbash pty:true workdir:/tmp/ background:true command:"codex exec --dangerously-bypass-approvals-and-sandbox 'Fix issue #101. Commit after validation.'"
bash pty:true workdir:/tmp/ background:true command:"codex exec --dangerously-bypass-approvals-and-sandbox 'Fix issue #102. Commit after validation.'"
process action:list
process action:log sessionId:
Progress Updates (Critical)
For background runs:
When you spawn coding agents in the background, keep the user in the loop.
This prevents the user from seeing only "Agent failed before reply" and having no idea what happened.
Auto-notify on completion
For long-running jobs, append a completion trigger to the rendered prompt:
When completely finished, run this command:
openclaw system event --text "Done: " --mode now
Example:
bash pty:true workdir: background:true command:"codex exec --dangerously-bypass-approvals-and-sandbox 'When completely finished, run:
openclaw system event --text \"Done: implemented requested PREQSTATION task\" --mode now'"
Output policy
Return only a short completion summary.
Success format:
completed:
Failure format:
failed:
Do not dump raw stdout/stderr unless user explicitly asks.