Prompt file imported from diginsight/smartdocs (
.github/prompts/00.09-pe-meta/pe-meta-create-update.prompt.md). Copyright stays with the author.
PE-for-PE Artifact Create/Update
Create new or update existing PE artifacts that serve the PE system. Skips research but enforces full strategic guards — pre-change validation, category compliance, post-change reconciliation.
When to use this vs /pe-con-create-update:
- This prompt → PE infrastructure (pe-* agents/prompts, PE context files, pe-* instructions/skills)
/pe-con-create-update→ domain artifacts (article-writing, documentation, devops)
When to use this vs /pe-meta-design:
- This prompt → requirements are already clear, you know what to build/change
/pe-meta-design→ uncertain requirements, need research and use case challenge
v15.4 alignment. This prompt honors the vision v15.4
apply = plan + executecontract: it materializes a build/change plan (pre-change guard, category compliance, build spec) and then executes it. CREATE runs in fresh mode (no baseline); UPDATE reconciles against the existing artifact (escalate-not-overwrite human-authored decisions).--plan-file <path>(the eighth canonical parameter) sets plan location/identity ONLY and never decides regenerate-vs-trust — see pe-meta-plan-file-contract.md. The model-routing seam keeps plan/reconcile on this prompt's reasoning-grade model while delegated execution (pe-con-builder) carries its own standard-grademodel:.
Phase 0b — Domain coherence
This prompt enforces the Phase 0b domain coherence gate defined in 04.05-pe-meta-invocation-gates.md (upstream authority: current vision document § Domain-coherent batching). The 3-tier metadata-first domain resolution algorithm, seed-vs-deps decision matrix, dispatch table, bundle=… closed set, and bundle=accept consent semantics are specified there and MUST NOT be re-implemented here.
Locally true for this prompt:
- Scope = resolved target. For CREATE: the new file's path determines its domain (Tier 1: declared
domain:in the spec; Tier 2:pe-domain-map.yaml; Tier 3:unknown). For UPDATE: the existing file's declareddomain:is Tier 1. Pre-change guard inputs (dependency closure) extend the in-scope set when--depsis implied. - Gate runs BEFORE Phase 2 (Build). Domain footprint is computed before delegating to pe-con-builder. Multi-domain footprints block (or require
bundle=accept) so a single create/update operation doesn't silently span domains without consent. - Consent token.
bundle=acceptis the only valid token (closed set, case-sensitive). Recorded on the first-lineResolved invocation:log asbundle=accepted-bundle. - Phase 0a CF-05 does NOT apply at this layer. The
<artifact-type>first positional argument carries explicit type intent and is validated against the dispatch table at Phase 0; CF-05 (path/prefix mismatch) is enforced ONLY by per-artifact prompts. --skip domain-coherencerejected. Phase 0b is not skippable; bypass multi-domain gating only viabundle=accept.
Process
Phase 0: Load PE-domain strategic context
- Load vision document —
read_fileon the current vision document in06.00-idea/self-updating-prompt-engineering/(find*-vision.v*.mdwith highest version) - Load 00.00-context-structure-index.md — for Functional Categories and required categories
- Load strategic review criteria —
read_fileon thepe-strategic-reviewfiles from.copilot/context/00.00-prompt-engineering/(see 00.00-context-structure-index.md → Functional Categories) - Load dependency map —
read_fileon thedependency-trackingfiles from.copilot/context/00.00-prompt-engineering/ - Load dispatch table —
read_fileon.github/templates/00.00-prompt-engineering/artifact-type-dispatch.template.md - Determine operation mode: CREATE (file doesn't exist) or UPDATE (file exists)
Phase 1: Pre-change guard (UPDATE mode only)
If updating an existing file:
- Read the target artifact completely
- Read its metadata:
goal:,scope:,boundaries:,rationales: - Compare proposed change against each metadata field:
- Contradicts
goal:? → BLOCK — report to user, ask for override - Contradicts
scope:? → BLOCK — report scope drift - Contradicts
boundaries:? → BLOCK — report boundary violation - Contradicts
rationales:? → ESCALATE — require replacement rationale
- Contradicts
- Check category impact — if this file is listed in STRUCTURE-README Functional Categories, will the change affect category coverage?
- Check dependency blast radius — how many artifacts depend on this file?
If BLOCKED: present the contradiction and ask for user override or revised change description.
Phase 2: Build with PE-strategic constraints
Delegate to @pe-con-builder with PE-domain constraints:
For CREATE:
- All context file references → Level 1.5 (category) pattern
- Metadata contracts → goal, scope, boundaries, rationales, version REQUIRED
- N-1 separation → apply per the N-1 adoption table in
05.06 - Quality bar → exemplary level (boundaries ≥5/2/3, test scenarios ≥3)
- Naming →
pe-namespace prefix
For UPDATE:
- Pass pre-change guard results as constraints
- Preserve existing metadata unless explicitly changing it
- Ensure all new references use Level 1.5 (category) pattern
Phase 3: Double validation
- Structural validation — delegate to
@pe-con-validator - Strategic validation — check against
05.06criteria:- Vision alignment ✅/❌
- Category references ✅/❌
- PE quality bar ✅/❌
- N-1 separation ✅/❌/N/A
- Self-update readiness ✅/❌
If validation fails: hand back to @pe-con-builder (max 3 iterations).
Phase 4: Post-change reconciliation (MANDATORY)
After the artifact is created or updated:
- Metadata reconciliation on the modified file:
version:→ bump (patch for non-breaking, minor for additive, major for breaking)last_updated:→ today's datescope.covers:→ verify topics match contentgoal:→ verify still accurate
- STRUCTURE-README updates (if context file was created/modified):
- Add to File Index if new
- Assign to/update Functional Category
- Update file count
- Dependency map update — if new dependencies were added or removed, note for manual update of
05.01
Report reconciliation summary to user.
Handoff Data Contracts
| Transition | Strategy | Include | Exclude | Max tokens |
|---|---|---|---|---|
| Orchestrator → pe-con-builder | send: true | User request or change spec, PE constraints (L1.5 mandatory, metadata contracts, N-1, quality bar), pre-change guard results (for updates) | Vision document, STRUCTURE-README, strategic criteria full text | ≤1,500 |
| Orchestrator → pe-con-validator | send: true | File path + "validate" | Builder reasoning | ≤200 |
| Orchestrator → pe-meta-validator | send: true | File path + "ecosystem coherence check" + dependency scope | Structural validation details | ≤500 |
Response Management
- Not a PE artifact → "This file is not PE infrastructure. Use
/pe-con-create-updateinstead." - Pre-change guard blocks → "The proposed change contradicts the artifact's [metadata field]: [specific contradiction]. Override? Or revise the change?"
- Category regression detected → "This change would leave the
[category]category with no mapped files. This is blocked by the required_categories contract." - All checks pass → Report success with strategic compliance summary + reconciliation details
Embedded Test Scenarios
| # | Scenario | Expected Behavior |
|---|---|---|
| 1 | Create new PE agent (happy path) | Phase 0 loads strategic context → Phase 2 build with PE constraints → Phase 3 double validate → Phase 4 reconcile metadata + update dependency map |
| 2 | Update existing file — pre-change guard blocks | Phase 1 reads metadata → proposed change contradicts goal → BLOCK → reports contradiction → asks user for override |
| 3 | Category regression detected | Update would remove file from a required category → pre-change guard flags category coverage regression → BLOCK |
| 4 | Non-PE artifact (redirect) | Detects non-PE path → "Use /pe-con-create-update instead" → STOP |