Install
openclaw skills install pre-engineeringPRE Engineering — Initialize a PRE (Plan-Review-Execute) multi-agent collaborative project. TRIGGER when: user wants to initialize a multi-agent collaborative project, mentions PRE system, PRE Engineering, wants to set up collaborative agents, wants to initialize project documents for agent collaboration, asks how to make multiple AI roles collaborate on a project, mentions Plan-Review-Execute, wants to use a collaboration log to drive multi-agent work, wants to create Planner/Executor/Reviewer guide documents, wants to start a PRE collaboration workflow, or expresses multi-agent collaboration intent without explicitly mentioning PRE.
openclaw skills install pre-engineeringGuide the user to describe project requirements, interactively refine them, confirm and output project documents, then provide startup instructions.
The PRE system operates through three agent roles — Planner, Executor, and Reviewer — using the collaboration log as the sole coordination medium, the project goals document as the driving core, and the project code as the decision foundation, enabling autonomous collaboration and continuous operation among agents.
This skill sets up the PRE collaboration framework for the user's project: collects project requirements through interactive Q&A, generates 5 collaboration documents upon confirmation, and provides instructions to launch the three agents. PRE is not a standalone project — it's a framework that adds multi-agent collaboration capabilities to an existing project.
Use 2 steps to interact with the user, minimizing confirmation requests. During collection, proactively help refine requirements — remove duplicates, normalize descriptions, fill in missing technical constraints, automatically infer information.
Single AskUserQuestion collects all: project overview, features, technical constraints, special notes. Auto-scan project directory to infer available information, reducing manual input.
{
"questions": [{
"header": "Project Requirements",
"multiSelect": false,
"options": [
{"label": "Enter manually", "description": "Provide all project information directly (overview, features, constraints, notes)"},
{"label": "Infer from existing docs", "description": "Auto-scan project directory (README, package.json, etc.) and infer information"}
],
"question": "Please provide project information. You can describe separately:\n1. Project name and overview (1-2 sentences)\n2. Features (one per line)\n3. Technical constraints (tech stack, architecture, quality requirements) — or say 'no constraints'\n4. Special notes (third-party integrations, compliance, etc.) — or say 'none'\n\nExample:\nProject: E-commerce backend\nOverview: Build a backend supporting product management, order processing, and user auth\nFeatures: User registration/login, product lists, order management, payment integration\nConstraints: Python + FastAPI, PostgreSQL, RESTful API, ≥80% unit test coverage\nNotes: Payment integrates third-party API, PCI compliance required"
}]
}
Information Inference Rules:
After collection, refine requirements: remove duplicates, normalize descriptions, supplement missing dimensions (user management, error handling, etc.).
Synthesize collected information into a project goals document draft and present to user for final confirmation. Upon confirmation, generate all 5 core documents.
{
"questions": [{
"header": "Confirm & Generate",
"multiSelect": false,
"options": [
{"label": "Confirm, generate all docs", "description": "Satisfied with the project goals document — start generating all 5 project documents"},
{"label": "Needs revision", "description": "Not satisfied with some content — adjust it"}
],
"question": "Here is the project goals document draft generated from your description:\n\n{Project goals draft content}\n\nAre you satisfied with it?"
}]
}
If user selects "Needs revision", ask what to adjust, modify the draft, and re-present until confirmed.
Upon confirmation, write to .pre/project-goals.md in the project directory with the following format:
# Project Goals
## Overview
{Project overview provided by the user}
## Feature Requirements
- {Feature requirements provided by the user, one per line}
## Technical Constraints
- {Technical constraints provided by the user, one per line}
- {If the user selected 'No special constraints', write: The Planner and Executor may choose an appropriate tech stack and architecture based on the project nature}
## Notes
- {Special notes provided by the user, one per line}
- {If the user selected 'No notes', write: No special requirements at this time}
Important: The project goals document does not include "current status" or "priority" fields. Project status is managed by the collaboration log; priority is determined by the Planner. Agents can only read this document — they must not modify it.
Upon confirmation, write to .pre/collaboration-log.md in the project directory, creating the initial entry to drive the Planner to begin the first planning cycle:
# Collaboration Log
## [{current_datetime}] Human — Project Launch
- Initialized project, Planner please begin first planning cycle
- Status: PLN_WAIT
Time format uses [YYYY-MM-DD HH:MM], must execute date +"%Y-%m-%d %H:%M" to get the current system time — never fill in time from memory. Timezone confirmation: During initialization, confirm with the user the timezone to use (e.g., Shanghai UTC+8, Tokyo UTC+9, etc.). After confirmation, all log entries must consistently use that timezone, and the confirmed timezone should be recorded in the project goals document's Notes section.
Upon confirmation, generate three agent guide documents. Each document is generated from the corresponding template file:
references/planner-guide-template.md → fill path placeholders → write to .pre/planner-guide.mdreferences/executor-guide-template.md → fill path placeholders → write to .pre/executor-guide.mdreferences/reviewer-guide-template.md → fill path placeholders → write to .pre/reviewer-guide.mdPlaceholder note:
Templates already use default path values (collaboration-log.md, project-goals.md, ../src). If the user specifies a different code directory, replace all occurrences of ../src in the template with the user-specified path during generation.
Generation steps:
../src with the user-specified path.pre/ subdirectoryFile existence check: Before generating, check whether files with the same name already exist in the project directory. If they exist, prompt the user to choose overwrite or skip — do not auto-overwrite.
After all documents are generated, present the startup instructions to the user:
PRE Engineering initialization complete! The following files have been generated:
.pre/project-goals.md — Project requirements document (only humans can modify).pre/collaboration-log.md — Initial PLN_WAIT entry written.pre/planner-guide.md — Planner role guide document.pre/executor-guide.md — Executor role guide document.pre/reviewer-guide.md — Reviewer role guide documentIMPORTANT: Commit baseline before starting agents
During subsequent reviews, the Reviewer will execute git stash save to stash code changes. If the .pre/ collaboration documents are not committed, stash will sweep them away, causing agents to lose access to their files. You must commit the generated documents as a baseline before starting the three agents:
cd {project_directory_path}
git add .pre/
git commit -m "PRE initialization: collaboration documents baseline"
Startup steps (requires three separate terminals):
Terminal 1 — Planner (recommended: strong reasoning model, e.g. claude-opus-4-6):
cd {project_directory_path}/pre
claude --model claude-opus-4-6
Then enter:
/loop "Read planner-guide.md and follow its instructions as the Planner role. Each cycle starts by reading collaboration-log.md to check the latest status."
Terminal 2 — Executor (recommended: fast coding model, e.g. claude-sonnet-4-6):
cd {project_directory_path}/pre
claude --model claude-sonnet-4-6
Then enter:
/loop "Read executor-guide.md and follow its instructions as the Executor role. Each cycle starts by reading collaboration-log.md to check the latest status."
Terminal 3 — Reviewer (recommended: thorough review model, e.g. claude-opus-4-6):
cd {project_directory_path}/pre
claude --model claude-opus-4-6
Then enter:
/loop "Read reviewer-guide.md and follow its instructions as the Reviewer role. Each cycle starts by reading collaboration-log.md to check the latest status."
IMPORTANT: Record Loop Task Job IDs
After each /loop command is started, Claude returns a job ID (typically UUID format) displayed in the result. Record all three job IDs immediately:
Planner job ID: <copy from planner startup result>
Executor job ID: <copy from executor startup result>
Reviewer job ID: <copy from reviewer startup result>
Suggested save locations:
.runner-ids.txt file in project root, orUsage:
ScheduleCancel <job-id> or provide job ID to cancel that loop/loop command to generate new job IDsSee the "Loop Task Process Management" section in each agent's guide document for details.
Project control methods:
| Control intent | Operation | Agent response |
|---|---|---|
| Adjust direction | Modify feature descriptions or technical constraints in .pre/project-goals.md | Planner adjusts the plan in the next cycle based on the new direction |
| Reduce scope | Delete feature requirements in .pre/project-goals.md | Planner detects no requirements during PLN_WAIT and submits a "no new requirements" declaration |
| Add requirements | Add new items to feature requirements in .pre/project-goals.md | Planner identifies new requirements in the next cycle and proposes them |
| Pause project | Write "currently paused" in the Notes section of .pre/project-goals.md | Planner recognizes the pause marker during PLN_WAIT and does not act |
DONE achievement condition: Planner declares no new requirements → Reviewer confirms all project goals have been delivered → Reviewer writes DONE → Project complete.
The PRE system has a built-in loop prevention mechanism to prevent infinite retry cycles when the Executor keeps getting rejected:
PLN_WAITThe Reviewer is responsible for version management after each review cycle to ensure every delivered version is traceable:
git add <code_dir> && git stash save to save a code snapshot (default src/, .pre/ excluded via .gitignore)VERSIONS.md and execute git commit -m "V{date}-{time} V{version} - [description]"V{date}-{time} V{semantic-version}(e.g., V20260511-2325 V0.0.6)src/) does not exist, create an empty directory