Prompt file imported from diginsight/tools (
.github/prompts/00.09-pe-meta/pe-meta-instruction-review.prompt.md). Copyright stays with the author.
Instruction Review
v15.4 alignment. This prompt honors the vision v15.4
apply = plan + executecontract: every--mode applyrun first materializes/reconciles a plan, then executes it;--mode planmaterializes the same plan and stops (see § Plan output contract and pe-meta-plan-file-contract.md). The eighth canonical parameter--plan-filesets plan location/identity only; the fresh / reconcile / trust execution modes follow from (baseline-available? × research-runs?), and the § Iteration budget checkpoint (see pe-meta-iteration-budget.md) emits a plan with atrust-mode resume when a run hits the per-cycle change cap. The first-lineResolved invocation:log echoesplan-file=<path-or-none>andspillover=<path-or-none>markers.
Phase 0a CF-05 + Phase 0b — Invocation gates
This prompt enforces the Phase 0a CF-05 artifact-type/path consistency check AND the Phase 0b domain coherence gate defined in 04.05-pe-meta-invocation-gates.md (upstream authority: vision v15 § Domain detection, § Pipeline phases).
Locally true for this prompt:
- CF-05 expected root. Any resolved target path (positional
<file-path>,--scope, or design output target) MUST resolve under.github/instructions/. Paths outside this root are REJECTED before Phase 0b runs; the rejection message MUST suggest the canonical replacement prompt name from the SoT § Per-prompt-class applicability matrix. - Phase 0b scope. Resolved file set = the target path (+ closure under
--deps fullwhen this prompt's argument-hint exposes--deps); degenerate single-file scope is single-domain by construction. - Algorithm. 3-tier metadata-first per the SoT: Tier 1 = each in-scope file's declared
domain:frontmatter; Tier 2 = optionalpe-domain-map.yaml; Tier 3 =unknown. The seed path does NOT constrain consumer domains when--deps fulltraverses the closure. - Gate timing. Runs BEFORE delegating to handoffs declared in this prompt's frontmatter.
- Consent tokens.
bundle=acceptis recognized AND propagated when delegating to the orchestrator so it does not re-prompt;--skip domain-coherenceis REJECTED with CF-05. - When delegated from an orchestrator. Phase 0a CF-05 is verified by the dispatcher and Phase 0b has already run on the single-domain resolved scope — this section's gate is a no-op in that path.
Process
- Parse
--dim,--deps,--scope, and--skipflags - Resolve the applicable-dimension SET from the
05.07-pe-meta-dimension-catalog.mdapplicability matrix for theinstructiontype — this is the<applicable>denominator (the full type-applicable set, NOT the05.08enumerated subset); then load05.08-pe-meta-type-checklists.md→ instruction section for the SUB-CHECKS of those applicable dimensions that declare rows - Audit applyTo pattern — count matched files, flag over-broad patterns
- Check minimization — flag unnecessary examples, prose, or commentary
- Run selected dimensions via
@pe-meta-validator, recordingdim_evidence[](one anchored{dim, status, evidence_ref}per applicable dimension — passes included) per the § Assess-phase evidence coverage contract - If
--deps full: run full dependency-aware review (bounded recursion, default depth 2, scope-filtered) and check for overlap with other instruction files - If
--deps direct: run first-level-only dependency checks (scope-filtered) and check direct overlap risks - Run the independent Coverage Audit (
@pe-meta-validator, Coverage Audit mode) and reconcilepu-evidence/subcheck-coverage/shallow-sweep; apply the evidence-depth hard-fails before any clean health score - Generate severity-ranked report
Phase ordering and option behavior
- Phase ordering: parse inputs first, execute the type-specific workflow second, then validate and report.
- Default mode is
--mode apply— assess and implement non-breaking improvements autonomously. Use--mode planto opt into assessment-only output. --dimselects which dimension groups run; default (omitted) =full— the full05.07type-applicable set.--dimis subtractive: it may NARROW the evaluated set but the default is never a silent subset.--depscontrols dependency traversal:none(per-artifact only),direct(first-level deps),full(bounded recursive). Default:none.--scopefilters which dependency types to focus on during--depstraversal (e.g.,--scope contextfocuses on context file dependencies only). When omitted, traverse all dependency types.--skip research|externalsuppresses external source fetching during review.- Guidance-first behavior is handled through
/pe-meta-adherence. - When
--mode applyis active and findings require multi-file changes, delegate to@pe-con-builder.
Risk Classification
#file:.github/prompt-snippets/pe-meta-risk-classification.md
Assess-phase evidence coverage (entry-point depth parity)
A direct /pe-meta-instruction-review call MUST reach the same evidence depth as the /pe-meta-review orchestrator — depth is a property of the work, not the entry path. This prompt therefore includes the first technique module (engine Assess phase):
#file:.github/prompt-snippets/pe-meta-evidence-coverage.md
dim_evidence[] (MANDATORY). For EVERY applicable dimension — passes included — record one {dim, status, evidence_ref} object with a non-empty, anchored evidence_ref (path:line + verbatim quote). A status: pass with an empty evidence_ref does NOT count as covered. The SET of applicable dimensions is the 05.07 applicability-matrix set for the instruction type (NOT the 05.08 subset); an applicable dimension with no 05.08 rows still requires one anchored evidence_ref. Each dimension's evidence_ref set MUST discharge every sub-check declared for the instruction type in 05.08-pe-meta-type-checklists.md.
Independent Coverage Audit (before any clean health score). Hand the run's outcome log to the existing Validate handoff — @pe-meta-validator in Coverage Audit mode (read-only, separate context) — which independently re-derives pu-evidence/subcheck-coverage/shallow-sweep per the shared evidence-bound coverage contract § Independent audit. Divergence is a hard-fail — reconciled, NOT self-attested.
Evidence-depth hard-fail (single-file, mode-independent). Before emitting the report:
pu-evidence<evidenced> < <applicable>→ hard failure on BOTH--mode planand--mode apply(an evidence-free PASS is indistinguishable from a dimension never exercised).- any dimension
subcheck-coverage <evaluated>/<declared> < 1→ gradedpartial, BLOCKS a clean health score (a declared sub-check never ran). shallow-sweep=suspected→ BLOCKS clean until body-levelevidence_refor an explicit acknowledgment is recorded.
The Layer-A anchor checks (resolvability, literal-containment, distinctness) are Evaluation: hook:.github/hooks/scripts/pe-check-evidence-anchors.ps1 — deterministic, zero-LLM, every PU.
Output contract (coverage + plan-file + spillover markers)
The report MUST open with a first-line Resolved invocation: log echoing the plan-file=, spillover=, and the three evidence-coverage markers:
Resolved invocation: --mode=<plan|apply> … | plan-file=<path-or-none> | spillover=<path-or-none> | pu-evidence=<evidenced>/<applicable> | subcheck-coverage=<fully-covered-dims>/<applicable-dims> | shallow-sweep=<clean|suspected>
-
pu-evidence/subcheck-coverage/shallow-sweep: computed per the § Assess-phase evidence coverage contract above and reconciled with the independent Coverage Audit. Each carries the evidence-depth hard-fail described there. -
--mode plan(assessment-only): emit an actionable plan file at the canonical plan-mode path per pe-meta-plan-file-contract.md and recordplan-file=<path>. When--mode apply, recordplan-file=none. -
--mode applyoverflow: if the per-cycle change cap is hit with validated findings remaining, emit a spillover plan at<run-folder>/<NN>-<kebab-name>-spillover.plan.mdper pe-meta-iteration-budget.md and recordspillover=<path>; otherwise recordspillover=none.