一键导入
build-prompt
Build a governed prompt or skill through the six-stage prompt-writer pipeline with budgeted governance.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Build a governed prompt or skill through the six-stage prompt-writer pipeline with budgeted governance.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Agent-only canonical output templates for rp1 artifacts. Load when producing structured markdown to ensure format consistency and routing metadata.
Ask about rp1 capabilities, discover skills, and get workflow guidance.
Evidence-gated tech debt and bloat detection. Scouts signals, ranks by materiality, validates by refutation, reports up to 5 findings with actions.
Synchronizes user-facing documentation with the current knowledge base through validate -> stale gate -> scan -> approval -> process orchestration.
Orchestrates parallel KB generation using spatial analysis and a map-reduce architecture with incremental and feature-learning modes.
Analyzes systems holistically to provide strategic recommendations balancing cost, quality, performance, complexity, and business objectives with quantified trade-offs.
| name | build-prompt |
| description | Build a governed prompt or skill through the six-stage prompt-writer pipeline with budgeted governance. |
| allowed-tools | Bash(echo *), Bash(rp1 *), Bash(mkdir *), Write, Task |
| metadata | {"category":"prompt","is_workflow":true,"workflow":{"run_policy":"fresh","identity_args":[]},"version":"1.0.0","tags":["core","prompt","orchestration"],"created":"2026-04-21T00:00:00.000Z","author":"cloud-on-prem/rp1","arguments":[{"name":"PROMPT_NAME","type":"string","required":true,"description":"Name for the prompt (kebab-case, used as slug)"},{"name":"DESCRIPTION","type":"string","required":true,"description":"Description of the prompt or skill to create","variadic":true},{"name":"TYPE","type":"enum","required":false,"default":"prompt","description":"Output format: prompt (standalone markdown) or skill (SKILL.md with rp1 frontmatter)","enum_values":["prompt","skill"]},{"name":"EXISTING","type":"string","required":false,"description":"Path to an existing prompt file to improve (original is not modified)"},{"name":"AGENT_TYPE","type":"enum","required":false,"default":"leaf-worker","description":"Constitutional profile for governance primitive filtering","enum_values":["leaf-worker","orchestrator","interactive-skill","kb-investigator"]},{"name":"COMPLEXITY","type":"enum","required":false,"default":"auto","description":"Scaffolding size. auto = classifier picks from heuristics.","enum_values":["auto","simple","standard","complex"]},{"name":"AFK","type":"boolean","required":false,"default":false,"description":"Non-interactive mode","aliases":["afk","no prompts"]}],"sub_agents":["rp1-base:prompt-pipeline-runner"]} |
YOU ARE A PURE ORCHESTRATOR. Spawn the pipeline-runner agent for all prompt creation work. NEVER write prompt content, apply constitutional/epistemic logic, or produce reports yourself. Your only job: spawn agent, parse response, write artifacts, emit events.
Use the pre-resolved projectRoot, kbRoot, and workRoot values from the generated Workflow Bootstrap section.
Output directory:
OUT_DIR = {workRoot}/prompts/{YYYY-MM-DD}-{PROMPT_NAME}/
| Variable | Source |
|---|---|
{YYYY-MM-DD} | Current date, ISO 8601 |
{PROMPT_NAME} | Kebab-case slug from argument |
Output file naming:
| TYPE | Primary artifact | Report |
|---|---|---|
prompt | {PROMPT_NAME}.md | confidence-report.md |
skill | SKILL.md | confidence-report.md |
EXISTING prompt handling: When EXISTING is provided, the path is passed through to the pipeline runner, which loads the file at Stage 0. The original file is never modified. The pipeline stages still execute but apply governance as an improvement overlay on the existing content.
stateDiagram-v2
[*] --> pipeline_start
pipeline_start --> pipeline_complete : agent_done
pipeline_complete --> [*] : done
On each phase transition, report via:
rp1 agent-tools emit \
--workflow build-prompt \
--type status_change \
--run-id {RUN_ID} \
--name "{RUN_NAME}" \
--step {CURRENT_STATE} \
--data '{"status": "running"}'
RUN_ID comes from the generated Workflow Bootstrap sectionRUN_NAME from PROMPT_NAME: "Prompt: {PROMPT_NAME}"State Progression Protocol:
--step with --data '{"status": "running"}' when you enter that state-> [*] transitions): report with --data '{"status": "completed"}' and --close-runEmit entry into pipeline_start:
rp1 agent-tools emit \
--workflow build-prompt \
--type status_change \
--run-id {RUN_ID} \
--step pipeline_start \
--name "Prompt: {PROMPT_NAME}" \
--data '{"status": "running", "prompt_name": "{PROMPT_NAME}", "type": "{TYPE}", "agent_type": "{AGENT_TYPE}"}'
Spawn agent -- do NOT create prompt content yourself:
{% dispatch_agent "rp1-base:prompt-pipeline-runner" %} PROMPT_NAME={PROMPT_NAME}, DESCRIPTION={DESCRIPTION}, AGENT_TYPE={AGENT_TYPE}, COMPLEXITY={COMPLEXITY}, TYPE={TYPE}, EXISTING={EXISTING}, BUDGET=0.15 {% enddispatch_agent %}
When EXISTING is a non-empty path, the runner reads the file at Stage 0. If the path is invalid or the file cannot be read, the runner fails the pipeline -- do NOT retry.
The agent executes the six-stage prompt-writer pipeline (constitutional-checklist -> fallibilist-overlay -> epistemic-stance -> popper-patterns -> confidence-schema -> prompt-validation) and enforces the 15% governance budget in Stage 6.
Parse response: The agent returns exactly 2 fenced artifact blocks:
| # | Artifact | Content |
|---|---|---|
| 1 | Prompt | SKILL.md (TYPE=skill) or standalone markdown (TYPE=prompt) |
| 2 | Confidence report | Per-stage scoring with budget compliance metrics |
Validate: accept only when both artifact blocks are present. If either is missing, retry the agent once. If retry also fails, abort -- do NOT emit partial artifacts.
Create the output directory:
mkdir -p {OUT_DIR}
Resolve REL_DIR as OUT_DIR with the {workRoot}/ prefix stripped (for storageRoot: work_dir registration).
Write artifacts to {OUT_DIR}:
| TYPE | File 1 | File 2 |
|---|---|---|
prompt | {PROMPT_NAME}.md | confidence-report.md |
skill | SKILL.md | confidence-report.md |
Register each artifact:
rp1 agent-tools emit \
--workflow build-prompt \
--type artifact_registered \
--run-id {RUN_ID} \
--step pipeline_start \
--data '{"path": "{REL_DIR}/{primary_artifact_filename}", "prompt_name": "{PROMPT_NAME}", "storageRoot": "work_dir"}'
rp1 agent-tools emit \
--workflow build-prompt \
--type artifact_registered \
--run-id {RUN_ID} \
--step pipeline_start \
--data '{"path": "{REL_DIR}/confidence-report.md", "prompt_name": "{PROMPT_NAME}", "storageRoot": "work_dir"}'
rp1 agent-tools emit \
--workflow build-prompt \
--type status_change \
--run-id {RUN_ID} \
--step pipeline_complete \
--close-run \
--data '{"status": "completed", "prompt_name": "{PROMPT_NAME}"}'
## Build Prompt Complete
**Prompt**: {PROMPT_NAME}
**Type**: {TYPE}
**Agent Type**: {AGENT_TYPE}
**Complexity**: {effective_complexity} ({explicit | auto-detected})
**Output**: `{REL_DIR}/`
**Pipeline**: constitutional-checklist -> fallibilist-overlay -> epistemic-stance -> popper-patterns{% if effective_complexity == "simple" %} (skipped){% endif %} -> confidence-schema -> prompt-validation
**Budget**: {governance_ratio}% governance ({PASS | TRIMMED to comply})
**Artifacts**:
- `{REL_DIR}/{primary_artifact_filename}` -- Governed prompt with budgeted constitutional/epistemic content
- `{REL_DIR}/confidence-report.md` -- Per-stage confidence scoring and budget compliance
**Next Steps**:
- Review the generated prompt in `{REL_DIR}/`
- Move to a `plugins/*/skills/` directory when ready for the build pipeline to ingest it
DO:
prompt-pipeline-runner for all prompt creation work{OUT_DIR} (anchored at workRoot)artifact_registered for each artifact after writingDO NOT:
{% include_shared "anti-loop.md" %}
File-specific constraints: