From bc1bec303f0d962002dbaec0f4153bf28a2f6816 Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Sun, 2 Aug 2026 18:43:24 -0700 Subject: [PATCH 1/2] Add instruction-fidelity guardrail across prompts Introduce a universal instruction-fidelity guardrail and wire it into every PromptKit template and manifest entry. Strengthen bootstrap and generated prompt formats so ambiguity escalation, approval gates, and instruction priority remain explicit, including non-condensable handling for agent instructions. Add CI enforcement with tests/validate-instruction-fidelity.py and update contributor documentation to reflect the new validation flow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Alan Jowett --- .github/copilot-instructions.md | 12 +- .github/workflows/validate-manifest.yml | 16 ++ CATALOG.md | 6 +- CONTRIBUTING.md | 4 +- README.md | 1 + bootstrap.md | 30 ++++ docs/architecture.md | 18 +- docs/contributing-components.md | 11 +- docs/faq.md | 2 + formats/agent-instructions.md | 23 ++- formats/copilot-prompt-file.md | 8 + manifest.yaml | 167 +++++++++--------- protocols/guardrails/instruction-fidelity.md | 80 +++++++++ templates/analyze-protocol-conflicts.md | 1 + templates/audit-code-compliance.md | 1 + templates/audit-coverage-gaps.md | 1 + templates/audit-implementation-alignment.md | 1 + templates/audit-integration-compliance.md | 1 + templates/audit-interface-contract.md | 1 + templates/audit-library-consistency.md | 1 + templates/audit-library-health.md | 1 + templates/audit-link-budget.md | 1 + templates/audit-spec-alignment.md | 1 + templates/audit-spec-invariants.md | 1 + templates/audit-test-compliance.md | 1 + templates/audit-traceability.md | 1 + templates/author-agent-instructions.md | 10 +- templates/author-architecture-spec.md | 1 + templates/author-design-doc.md | 1 + templates/author-implementation-prompt.md | 1 + templates/author-interface-contract.md | 1 + templates/author-known-conditions-registry.md | 1 + templates/author-north-star.md | 1 + templates/author-pipeline.md | 1 + templates/author-presentation.md | 1 + templates/author-protocol-validation.md | 1 + templates/author-release.md | 1 + templates/author-requirements-doc.md | 1 + templates/author-rfc.md | 1 + templates/author-session-handoff.md | 1 + templates/author-test-prompt.md | 1 + templates/author-validation-plan.md | 1 + templates/author-workflow-prompts.md | 1 + templates/classify-findings.md | 1 + templates/collaborate-requirements-change.md | 1 + templates/decompose-prompt.md | 1 + templates/design-pcb-layout.md | 1 + templates/design-schematic.md | 1 + templates/diff-specifications.md | 1 + templates/discover-tests-for-changes.md | 1 + templates/emit-manufacturing-artifacts.md | 1 + templates/engineering-workflow.md | 1 + templates/enhance-prompt.md | 1 + templates/evaluate-prompt-portability.md | 1 + templates/evolve-protocol.md | 1 + templates/exhaustive-bug-hunt.md | 1 + templates/extend-library.md | 1 + templates/extract-invariants.md | 1 + templates/extract-rfc-requirements.md | 1 + templates/find-and-fix-bugs.md | 1 + templates/fix-compiler-warnings.md | 1 + templates/generate-commit-message.md | 1 + templates/generate-implementation-changes.md | 1 + templates/generate-spec-changes.md | 1 + templates/hardware-design-workflow.md | 1 + templates/interactive-design.md | 1 + templates/investigate-bug.md | 1 + templates/investigate-security.md | 1 + templates/investigate-trace.md | 1 + templates/lint-prompt.md | 1 + templates/maintenance-workflow.md | 1 + templates/plan-implementation.md | 1 + templates/profile-session.md | 1 + templates/reconcile-requirements.md | 1 + templates/reconstruct-behavior.md | 1 + templates/respond-to-pr-comments.md | 1 + templates/reverse-engineer-requirements.md | 1 + templates/review-bom.md | 1 + templates/review-code.md | 1 + templates/review-cpp-code.md | 1 + templates/review-enclosure.md | 1 + templates/review-infrastructure.md | 1 + templates/review-layout.md | 1 + templates/review-pull-request.md | 1 + templates/review-schematic.md | 1 + templates/revise-for-readability.md | 1 + templates/root-cause-ci-failure.md | 1 + templates/scaffold-test-project.md | 1 + templates/spec-extraction-workflow.md | 1 + templates/triage-issues.md | 1 + templates/triage-pull-requests.md | 1 + templates/validate-budget.md | 1 + templates/validate-simulation.md | 1 + tests/validate-instruction-fidelity.py | 153 ++++++++++++++++ 94 files changed, 517 insertions(+), 103 deletions(-) create mode 100644 protocols/guardrails/instruction-fidelity.md create mode 100644 tests/validate-instruction-fidelity.py diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 8a596ec..27884ad 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -92,18 +92,20 @@ adding or modifying any component: 1. Update the component's YAML frontmatter 2. Update `manifest.yaml` to match -3. The CI check (`tests/validate-manifest.py`) validates that every - template's `protocols` list in the manifest matches its frontmatter +3. The CI checks (`tests/validate-manifest.py` and + `tests/validate-instruction-fidelity.py`) validate manifest/template + protocol sync and universal guardrail coverage ## CI ```bash -# Validate manifest ↔ template protocol sync (the only CI check) +# Validate manifest ↔ template protocol sync and universal guardrails python tests/validate-manifest.py +python tests/validate-instruction-fidelity.py ``` -Triggered on push/PR when `manifest.yaml`, `templates/**`, or -`tests/validate-manifest.py` change. +Triggered on push/PR when `manifest.yaml`, component files, or the +validation scripts change. ## Testing diff --git a/.github/workflows/validate-manifest.yml b/.github/workflows/validate-manifest.yml index 5238026..c677c4c 100644 --- a/.github/workflows/validate-manifest.yml +++ b/.github/workflows/validate-manifest.yml @@ -13,6 +13,7 @@ on: - 'taxonomies/**' - 'templates/**' - 'tests/validate-manifest.py' + - 'tests/validate-instruction-fidelity.py' - 'tests/validate-graph-integrity.py' - 'cli/**' pull_request: @@ -24,6 +25,7 @@ on: - 'taxonomies/**' - 'templates/**' - 'tests/validate-manifest.py' + - 'tests/validate-instruction-fidelity.py' - 'tests/validate-graph-integrity.py' - 'cli/**' @@ -59,6 +61,20 @@ jobs: - name: Validate graph integrity run: python tests/validate-graph-integrity.py + validate-instruction-fidelity: + name: Check instruction-fidelity coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Validate instruction-fidelity coverage + run: python tests/validate-instruction-fidelity.py + cli-smoke-test: name: CLI smoke test (launch path) runs-on: ubuntu-latest diff --git a/CATALOG.md b/CATALOG.md index e9b4bef..05f943f 100644 --- a/CATALOG.md +++ b/CATALOG.md @@ -10,7 +10,7 @@ | Layer | Count | Description | |-------|-------|-------------| | Personas | 15 | Domain expert identities | -| Protocols | 56 | Guardrails (5), Analysis (18), Reasoning (33) | +| Protocols | 57 | Guardrails (6), Analysis (18), Reasoning (33) | | Formats | 24 | Output structure definitions | | Taxonomies | 5 | Classification schemes | | Templates | 71 | Task orchestration prompts | @@ -159,11 +159,12 @@ ## Protocols -### guardrails (5) +### guardrails (6) | Protocol | Language | Used by | Description | |----------|----------|---------|-------------| | `anti-hallucination` | — | `author-requirements-doc`, `author-architecture-spec`, `interactive-design`, `author-north-star`, `author-design-doc`, `author-validation-plan`, `reverse-engineer-requirements`, `audit-traceability`, `audit-code-compliance`, `audit-test-compliance`, `audit-integration-compliance`, `audit-spec-invariants`, `diff-specifications`, `author-interface-contract`, `audit-interface-contract`, `validate-budget`, `extract-rfc-requirements`, `reconcile-requirements`, `extract-invariants`, `author-rfc`, `author-presentation`, `author-implementation-prompt`, `author-test-prompt`, `author-workflow-prompts`, `investigate-bug`, `find-and-fix-bugs`, `fix-compiler-warnings`, `investigate-security`, `profile-session`, `classify-findings`, `review-code`, `review-cpp-code`, `exhaustive-bug-hunt`, `reconstruct-behavior`, `review-schematic`, `validate-simulation`, `review-bom`, `review-layout`, `audit-link-budget`, `review-enclosure`, `design-schematic`, `design-pcb-layout`, `emit-manufacturing-artifacts`, `hardware-design-workflow`, `discover-tests-for-changes`, `scaffold-test-project`, `plan-implementation`, `author-agent-instructions`, `extend-library`, `decompose-prompt`, `audit-library-consistency`, `audit-library-health`, `author-pipeline`, `triage-issues`, `triage-pull-requests`, `root-cause-ci-failure`, `author-release`, `review-infrastructure`, `generate-commit-message`, `evolve-protocol`, `analyze-protocol-conflicts`, `author-protocol-validation`, `engineering-workflow`, `collaborate-requirements-change`, `generate-spec-changes`, `generate-implementation-changes`, `audit-spec-alignment`, `audit-implementation-alignment`, `spec-extraction-workflow`, `maintenance-workflow` | Prevents fabrication. Enforces epistemic labeling (KNOWN/INFERRED/ASSUMED), uncertainty disclosure, and source attribution. Apply to all tasks. | +| `instruction-fidelity` | — | All templates | Universal execution contract. Requires the model to follow user intent, constraints, ambiguity-escalation rules, and approval gates as written instead of silently reinterpreting the task. | | `self-verification` | — | `author-requirements-doc`, `author-architecture-spec`, `interactive-design`, `author-north-star`, `author-design-doc`, `author-validation-plan`, `reverse-engineer-requirements`, `audit-traceability`, `audit-code-compliance`, `audit-test-compliance`, `audit-integration-compliance`, `audit-spec-invariants`, `diff-specifications`, `author-interface-contract`, `audit-interface-contract`, `validate-budget`, `extract-rfc-requirements`, `reconcile-requirements`, `extract-invariants`, `author-rfc`, `author-presentation`, `author-implementation-prompt`, `author-test-prompt`, `author-workflow-prompts`, `investigate-bug`, `find-and-fix-bugs`, `fix-compiler-warnings`, `investigate-security`, `profile-session`, `classify-findings`, `review-code`, `review-cpp-code`, `exhaustive-bug-hunt`, `reconstruct-behavior`, `review-schematic`, `validate-simulation`, `review-bom`, `review-layout`, `audit-link-budget`, `review-enclosure`, `design-schematic`, `design-pcb-layout`, `emit-manufacturing-artifacts`, `hardware-design-workflow`, `discover-tests-for-changes`, `scaffold-test-project`, `plan-implementation`, `author-agent-instructions`, `extend-library`, `decompose-prompt`, `audit-library-consistency`, `audit-library-health`, `author-pipeline`, `triage-issues`, `triage-pull-requests`, `root-cause-ci-failure`, `author-release`, `review-infrastructure`, `generate-commit-message`, `evolve-protocol`, `analyze-protocol-conflicts`, `author-protocol-validation`, `engineering-workflow`, `collaborate-requirements-change`, `generate-spec-changes`, `generate-implementation-changes`, `audit-spec-alignment`, `audit-implementation-alignment`, `spec-extraction-workflow`, `maintenance-workflow` | Quality gate requiring the LLM to verify its own output before finalizing. Sampling checks, citation audits, coverage confirmation, consistency checks. | | `operational-constraints` | — | `reverse-engineer-requirements`, `audit-code-compliance`, `audit-test-compliance`, `audit-integration-compliance`, `author-presentation`, `investigate-bug`, `find-and-fix-bugs`, `fix-compiler-warnings`, `investigate-security`, `review-code`, `review-cpp-code`, `reconstruct-behavior`, `discover-tests-for-changes`, `audit-library-health`, `engineering-workflow`, `generate-implementation-changes`, `audit-implementation-alignment`, `spec-extraction-workflow`, `maintenance-workflow` | Governs how the LLM scopes work, uses tools, manages context, and prefers deterministic analysis. Prevents over-ingestion and ensures reproducibility. | | `minimal-edit-discipline` | — | `find-and-fix-bugs`, `fix-compiler-warnings` | Constrains code modifications to be minimal, type-preserving, encoding-safe, and verifiable. Prevents collateral damage from automated fixes, refactoring, and code generation. | @@ -446,4 +447,3 @@ Domain-agnostic incremental engineering workflow with human-in-the-loop review. - **`triage-report`** → `discover-tests-for-changes`, `triage-issues`, `triage-pull-requests` - **`validation-plan`** → `author-validation-plan`, `author-test-prompt` - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 012eb14..fe012cb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -117,9 +117,9 @@ NOT mean "can optionally be added to". Use the following values: | Value | Meaning | |-------|---------| -| `all` | Every template should apply this protocol (reserved for cross-cutting guardrails such as `anti-hallucination`). | +| `all` | Every template should apply this protocol (reserved for cross-cutting guardrails such as `anti-hallucination` and `instruction-fidelity`). | | `[]` *(empty list)* | This protocol is intended for standalone / manual composition and is not automatically included by any template. Document this in the protocol file itself. | -| `[template-a, template-b]` | These specific templates always include this protocol in their `protocols:` frontmatter. Keep this list in sync with the template definitions and their `protocols` entries in `manifest.yaml`. The CI check (`tests/validate-manifest.py`) currently validates only that `manifest.yaml` and template `protocols:` frontmatter match; it does not enforce `applicable_to` bidirectionally. | +| `[template-a, template-b]` | These specific templates always include this protocol in their `protocols:` frontmatter. Keep this list in sync with the template definitions and their `protocols` entries in `manifest.yaml`. The CI checks (`tests/validate-manifest.py` and `tests/validate-instruction-fidelity.py`) validate manifest/frontmatter sync and required universal guardrails, but they do not enforce `applicable_to` bidirectionally. | **Optional protocols** — protocols a template can optionally include via `additional_protocols` in an assembled prompt — should NOT be listed in diff --git a/README.md b/README.md index 9699731..f515479 100644 --- a/README.md +++ b/README.md @@ -412,6 +412,7 @@ personas, analysis protocols, and task templates. | Name | Description | |------|-------------| | `anti-hallucination` | Prevents fabrication, enforces epistemic labeling | +| `instruction-fidelity` | Follow user intent and prompt constraints as written; ask on material ambiguity | | `self-verification` | Quality gate — LLM verifies its own output before finalizing | | `operational-constraints` | Scoping, tool usage, deterministic analysis, reproducibility | | `minimal-edit-discipline` | Minimal, type-preserving, encoding-safe code modifications | diff --git a/bootstrap.md b/bootstrap.md index 9b62fed..312168d 100644 --- a/bootstrap.md +++ b/bootstrap.md @@ -25,6 +25,25 @@ You are the **composition engine** for PromptKit. Your job is to: 3. Assemble them into a complete, ready-to-use prompt. 4. Present the assembled prompt to the user for review and customization. +## Instruction Fidelity Contract + +These rules govern the entire bootstrap workflow and every prompt you +assemble from this repository: + +1. **Follow the user's requested outcome literally.** Do NOT substitute a + nearby task, a broader audit, a narrower artifact, or a "better" + interpretation than what the user asked for. +2. **Treat constraints and non-goals as binding.** Output mode, scope, + exclusions, approval gates, and required artifact types are not optional. +3. **Escalate material ambiguity instead of improvising.** If unresolved + ambiguity would change template choice, output mode, scope, non-goals, + implementation approach, or deliverable structure, STOP and ask. +4. **Obey phase ordering and wait states exactly as written.** Do NOT skip, + merge, reorder, or condense away steps, gates, or STOP / WAIT rules. +5. **Self-check compliance before finalizing.** Verify that every active + MUST / MUST NOT and approval gate remains satisfied in the assembled + prompt or generated instruction file. + ## How to Begin 1. **Read the manifest** at `manifest.yaml` to discover all available components. @@ -168,6 +187,10 @@ You are the **composition engine** for PromptKit. Your job is to: not edit template or component body text to store these notes. Skip this check for trivial inputs (file paths, yes/no, platform selections). + If the ambiguity would change template selection, output mode, + deliverable structure, scope boundaries, or non-goals, do NOT proceed + with prompt assembly until it is resolved or explicitly preserved as + an `[OPEN QUESTION]` in a mode that allows unresolved branches. 7. **Ask for the target project directory.** The output files must be written to the **user's project**, not to the PromptKit repository. Ask the user for the path to their target project root. Suggest a sensible default @@ -219,6 +242,10 @@ known-safe patterns, checklists, and operational guidance — MUST be preserved **exactly as written** in the source file (apart from the parameter values you substitute). +This preservation requirement explicitly includes instruction-priority +rules, ambiguity-escalation rules, approval gates, and STOP / WAIT +directives. Do NOT paraphrase or compress them. + **Do NOT summarize, abbreviate, or condense** component content when assembling raw prompts. If a protocol has 8 phases with detailed sub-steps, all 8 phases and all sub-steps must appear in the assembled output. If a @@ -273,6 +300,9 @@ skill file: - Opens with `` - Contains condensed persona or protocol directives (condensation applies **only** to this output mode, never to raw prompt output) +- Preserves the `instruction-fidelity` execution contract verbatim in the + root / global instruction file. Do NOT condense, paraphrase, or merge + away its priority rules, ambiguity rules, or approval-gate language. - Uses second-person directives throughout ("You are…", "When you encounter…") - Does **NOT** include PromptKit section headers (`# Identity`, `# Reasoning Protocols`, etc.) - Is self-contained and independently coherent diff --git a/docs/architecture.md b/docs/architecture.md index 61be523..6864ec9 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -214,8 +214,9 @@ When adding or modifying any component: 1. Update the component's YAML frontmatter 2. Update `manifest.yaml` to match -3. CI (`tests/validate-manifest.py`) validates that every template's - `protocols` list in the manifest matches its frontmatter +3. CI validates both manifest/template protocol sync + (`tests/validate-manifest.py`) and universal instruction-fidelity + coverage (`tests/validate-instruction-fidelity.py`) ## The Assembly Engine @@ -316,13 +317,15 @@ See [Pipeline Guide](pipeline-guide.md) for a detailed walkthrough. ## CI -The only automated CI check is `tests/validate-manifest.py`, triggered on -push/PR when `manifest.yaml`, `templates/**`, or the test script change. It -validates that every template's `protocols` list in the manifest matches its -frontmatter. +The prompt-library validation workflow runs `tests/validate-manifest.py` +and `tests/validate-instruction-fidelity.py` on push/PR when PromptKit +components or validation scripts change. These checks validate manifest ↔ +template protocol sync and enforce the universal instruction-fidelity +guardrail across templates and critical formats. ```bash python tests/validate-manifest.py +python tests/validate-instruction-fidelity.py ``` ## File Layout @@ -345,7 +348,8 @@ promptkit/ │ ├── lib/manifest.js # Manifest parser │ └── lib/launch.js # LLM CLI launcher ├── tests/ -│ ├── validate-manifest.py # CI check +│ ├── validate-manifest.py # Manifest ↔ template protocol sync +│ ├── validate-instruction-fidelity.py # Universal guardrail coverage │ ├── references/ # Hand-crafted reference prompts │ └── generated/ # PromptKit-generated prompts (gitignored) └── docs/ # Documentation and presentations diff --git a/docs/contributing-components.md b/docs/contributing-components.md index 3c3c8fe..53920a8 100644 --- a/docs/contributing-components.md +++ b/docs/contributing-components.md @@ -277,14 +277,16 @@ protocols: [anti-hallucination, my-protocol] These must correspond. CI validates this. -### Step 4: Run the CI check +### Step 4: Run the CI checks ```bash python tests/validate-manifest.py +python tests/validate-instruction-fidelity.py ``` This verifies that every template's protocol list in the manifest matches -its frontmatter. +its frontmatter and that the universal instruction-fidelity guardrail is +present where required. ## Quality Checklist Before Submitting @@ -298,6 +300,7 @@ its frontmatter. structured rules (guardrails) - [ ] Templates have Non-Goals and Quality Checklist sections - [ ] `python tests/validate-manifest.py` passes +- [ ] `python tests/validate-instruction-fidelity.py` passes - [ ] Assembled prompt produces coherent output when tested ## Example: Adding a New Template @@ -317,7 +320,9 @@ Here's a concrete example of adding a `review-api` template: format: investigation-report ``` -3. **Run** `python tests/validate-manifest.py` to verify sync. +3. **Run** `python tests/validate-manifest.py` and + `python tests/validate-instruction-fidelity.py` to verify sync and + universal guardrail coverage. 4. **Test** with `npx promptkit assemble review-api -p …` to verify the assembled prompt is coherent. diff --git a/docs/faq.md b/docs/faq.md index 837d9f0..64b1043 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -175,6 +175,7 @@ Separate Markdown files make components independently: protocols, and format 2. Add an entry to `manifest.yaml` 3. Run `python tests/validate-manifest.py` +4. Run `python tests/validate-instruction-fidelity.py` 4. Submit a PR See [Contributing Components](contributing-components.md) for full details. @@ -215,3 +216,4 @@ Check that: 1. The component file exists at the path specified in `manifest.yaml` 2. The template's frontmatter references the correct component names 3. `python tests/validate-manifest.py` passes +4. `python tests/validate-instruction-fidelity.py` passes diff --git a/formats/agent-instructions.md b/formats/agent-instructions.md index 719053b..38b52fb 100644 --- a/formats/agent-instructions.md +++ b/formats/agent-instructions.md @@ -47,7 +47,7 @@ recommended decomposition is: | Skill file | Contents | `applyTo` example | |------------|----------|-------------------| -| `.instructions.md` | Condensed persona identity and guardrail protocols (anti-hallucination, self-verification) | `**` | +| `.instructions.md` | Condensed persona identity and guardrail protocols (anti-hallucination, instruction-fidelity, self-verification) | `**` | | `.instructions.md` | A single analysis protocol's checks and phases | Language-specific glob (e.g., `**/*.c`) | | `.instructions.md` | A single reasoning protocol | `**` or task-specific glob | @@ -81,11 +81,28 @@ applyTo: '' - Write in **second person** ("You are…", "When you encounter…"). - Condense protocol phases into standing directives — preserve all specific checks but omit meta-commentary about protocol structure. +- Preserve the `instruction-fidelity` execution contract verbatim in a + dedicated section titled `## Instruction Fidelity Contract`. Its + priority rules, ambiguity handling, phase discipline, forbidden + behaviors, and compliance check are **non-condensable**. - Do NOT include PromptKit-internal headers (`# Identity`, `# Reasoning Protocols`, `# Output Format`, etc.). - Each skill file must be **self-contained** — it should make sense when loaded independently by the agent runtime. +## Non-Condensable Execution Contract + +If the assembled content includes the `instruction-fidelity` guardrail, +the output file MUST copy that contract as a verbatim operating section. +You may adapt surrounding headings to the target platform, but you MUST +NOT paraphrase, compress, merge away, or partially restate the contract's: + +- instruction priority order +- ambiguity escalation rule +- phase / gate discipline +- forbidden-behavior list +- pre-finalization compliance check + ### 3. File Content — Custom Agent (`.github/agents/*.agent.md`) When the user requests a **custom agent** (a specialized persona with @@ -131,6 +148,8 @@ tools: ['', ''] - Write in **second person** ("You are…", "Your task is to…"). - Include the condensed PromptKit persona as the agent's identity. - Include protocol directives as the agent's operating instructions. +- If `instruction-fidelity` is present, include its `## Instruction + Fidelity Contract` section verbatim. - Each agent file must be self-contained — it is loaded as the agent's complete system prompt. @@ -185,6 +204,8 @@ description: '' - Write in **second person** directed at the agent. - Include clear instructions for what the skill does, what inputs it expects, and what outputs it produces. +- If `instruction-fidelity` is present, include its `## Instruction + Fidelity Contract` section verbatim near the top of the skill. - If the skill requires tool access (file editing, shell commands), document this clearly so the user understands what permissions are needed. diff --git a/formats/copilot-prompt-file.md b/formats/copilot-prompt-file.md index 45394f0..5b1f44f 100644 --- a/formats/copilot-prompt-file.md +++ b/formats/copilot-prompt-file.md @@ -26,6 +26,11 @@ example from the source components MUST appear in the output. The only transformations allowed are structural repackaging (section headings, frontmatter, variable syntax) — never content removal. +Instruction-fidelity content is part of the non-negotiable execution +contract. If the assembled prompt includes instruction-priority rules, +ambiguity-escalation rules, approval gates, or STOP / WAIT directives, +they MUST remain verbatim and keep the same normative force. + Do NOT produce raw PromptKit output with assembly headers (`# Identity`, `# Reasoning Protocols`, etc.). Repackage into natural headings that read coherently as a standalone prompt file. @@ -202,6 +207,9 @@ A numbered checklist of steps to activate the prompt file: at the agent ("You are…", "When you encounter…") - Preserve ALL numbered phases, specific checks, known-safe patterns, examples, and checklists from protocol sources +- Preserve the `instruction-fidelity` contract verbatim when present. + Do NOT paraphrase or soften its ambiguity, phase-ordering, or + approval-gate rules. - Every major section listed in the body structure MUST be present, except for the following allowed omissions: - If the template declares `format: null` or omits the format, omit diff --git a/manifest.yaml b/manifest.yaml index 05095b1..279a266 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -130,6 +130,13 @@ protocols: Prevents fabrication. Enforces epistemic labeling (KNOWN/INFERRED/ASSUMED), uncertainty disclosure, and source attribution. Apply to all tasks. + - name: instruction-fidelity + path: protocols/guardrails/instruction-fidelity.md + description: > + Universal execution contract. Requires strict adherence to user + intent, prompt constraints, approval gates, and ambiguity escalation + instead of silent reinterpretation. + - name: self-verification path: protocols/guardrails/self-verification.md description: > @@ -1105,7 +1112,7 @@ templates: Single-shot generation. For complex/ambiguous projects, use interactive-design instead. persona: software-architect - protocols: [anti-hallucination, self-verification, requirements-elicitation] + protocols: [anti-hallucination, instruction-fidelity, self-verification, requirements-elicitation] format: requirements-doc pipeline_position: 1 @@ -1117,7 +1124,7 @@ templates: or system. Covers protocol/system description, network and software architecture, interfaces, and architectural implications. persona: software-architect - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: architecture-spec - name: interactive-design @@ -1127,7 +1134,7 @@ templates: and challenge before generating. Phase 2: generate when told. Phase 3: iterative refinement. Use for complex or ambiguous projects. persona: configurable - protocols: [anti-hallucination, self-verification, requirements-elicitation, iterative-refinement] + protocols: [anti-hallucination, instruction-fidelity, self-verification, requirements-elicitation, iterative-refinement] format: requirements-doc - name: author-north-star @@ -1137,7 +1144,7 @@ templates: document. Evidence-grounded, section-by-section drafting with user review. Use for strategic direction documents. persona: software-architect - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: north-star-document - name: author-design-doc @@ -1145,7 +1152,7 @@ templates: description: > Generate a design document that addresses a requirements document. persona: software-architect - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: design-doc pipeline_position: 2 requires: requirements-document @@ -1155,7 +1162,7 @@ templates: description: > Generate a validation plan covering all requirements. persona: systems-engineer - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: validation-plan pipeline_position: 3 requires: requirements-document @@ -1167,7 +1174,7 @@ templates: source code. Analyzes implementation to extract behavioral contracts, API specifications, and invariants. persona: reverse-engineer - protocols: [anti-hallucination, self-verification, operational-constraints, requirements-from-implementation] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, requirements-from-implementation] format: requirements-doc - name: audit-traceability @@ -1177,7 +1184,7 @@ templates: specification drift. Cross-checks traceability, assumption consistency, constraint propagation, and coverage completeness. persona: specification-analyst - protocols: [anti-hallucination, self-verification, traceability-audit] + protocols: [anti-hallucination, instruction-fidelity, self-verification, traceability-audit] taxonomies: [specification-drift] format: investigation-report pipeline_position: 4 @@ -1190,7 +1197,7 @@ templates: conditions that agents should not re-investigate. Prevents repeated wasted effort on solved or pre-existing problems. persona: systems-engineer - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] - name: audit-code-compliance path: templates/audit-code-compliance.md @@ -1199,7 +1206,7 @@ templates: Detects unimplemented requirements, undocumented behavior, and constraint violations. persona: specification-analyst - protocols: [anti-hallucination, self-verification, operational-constraints, code-compliance-audit] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, code-compliance-audit] taxonomies: [specification-drift] format: investigation-report requires: requirements-document @@ -1211,7 +1218,7 @@ templates: document. Detects unimplemented test cases, missing acceptance criterion assertions, and assertion mismatches. persona: specification-analyst - protocols: [anti-hallucination, self-verification, operational-constraints, test-compliance-audit] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, test-compliance-audit] taxonomies: [specification-drift] format: investigation-report requires: [requirements-document, validation-plan] @@ -1224,7 +1231,7 @@ templates: discovery signal for missing validation and undocumented behavior. persona: specification-analyst - protocols: [anti-hallucination, self-verification, operational-constraints, coverage-gap-analysis] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, coverage-gap-analysis] taxonomies: [specification-drift] format: investigation-report requires: [requirements-document, validation-plan] @@ -1237,7 +1244,7 @@ templates: integration flows, interface contract mismatches, and untested integration paths. persona: specification-analyst - protocols: [anti-hallucination, self-verification, operational-constraints, integration-audit] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, integration-audit] taxonomies: [specification-drift] format: investigation-report requires: requirements-document @@ -1250,7 +1257,7 @@ templates: that could lead to invariant violations in any conforming implementation. persona: configurable - protocols: [anti-hallucination, self-verification, spec-invariant-audit] + protocols: [anti-hallucination, instruction-fidelity, self-verification, spec-invariant-audit] format: investigation-report - name: diff-specifications @@ -1261,7 +1268,7 @@ templates: Modified, Clarified) and backward-compatibility impact. Produce migration guidance for implementers. persona: specification-analyst - protocols: [anti-hallucination, self-verification, spec-evolution-diff] + protocols: [anti-hallucination, instruction-fidelity, self-verification, spec-evolution-diff] format: investigation-report - name: author-interface-contract @@ -1272,7 +1279,7 @@ templates: Produces per-resource-per-state guarantee and obligation matrices with invariants and failure modes. persona: systems-engineer - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: interface-contract requires: requirements-document @@ -1284,7 +1291,7 @@ templates: Checks matrix coverage, traceability, enforceability, and failure mode completeness. persona: specification-analyst - protocols: [anti-hallucination, self-verification, interface-contract-audit] + protocols: [anti-hallucination, instruction-fidelity, self-verification, interface-contract-audit] format: investigation-report requires: interface-contract @@ -1297,7 +1304,7 @@ templates: verifies arithmetic, computes margins, and performs sensitivity analysis. persona: specification-analyst - protocols: [anti-hallucination, self-verification, quantitative-constraint-validation] + protocols: [anti-hallucination, instruction-fidelity, self-verification, quantitative-constraint-validation] format: investigation-report - name: lint-prompt @@ -1308,7 +1315,7 @@ templates: behavior. Produces a determinism assessment report with per-section scoring and concrete rewrite suggestions. persona: specification-analyst - protocols: [anti-hallucination, self-verification, prompt-determinism-analysis] + protocols: [anti-hallucination, instruction-fidelity, self-verification, prompt-determinism-analysis] format: investigation-report - name: evaluate-prompt-portability @@ -1320,7 +1327,7 @@ templates: cross-model consensus analysis, and produces a portability report with hardening recommendations. persona: specification-analyst - protocols: [anti-hallucination, self-verification, prompt-portability-evaluation] + protocols: [anti-hallucination, instruction-fidelity, self-verification, prompt-portability-evaluation] format: portability-report - name: revise-for-readability @@ -1332,7 +1339,7 @@ templates: plain-language rules, re-measure, and produce a readability revision report. persona: plain-language-editor - protocols: [anti-hallucination, self-verification, readability-gate, readability-revision-workflow] + protocols: [anti-hallucination, instruction-fidelity, self-verification, readability-gate, readability-revision-workflow] format: readability-revision-report standards: @@ -1343,7 +1350,7 @@ templates: Normalizes normative language, state machines, message formats, and cross-RFC dependencies into a requirements document. persona: specification-analyst - protocols: [anti-hallucination, self-verification, rfc-extraction] + protocols: [anti-hallucination, instruction-fidelity, self-verification, rfc-extraction] format: requirements-doc - name: reconcile-requirements @@ -1353,7 +1360,7 @@ templates: (RFCs, implementations, specifications) into a unified spec. Classifies requirements by cross-source compatibility. persona: specification-analyst - protocols: [anti-hallucination, self-verification, requirements-reconciliation] + protocols: [anti-hallucination, instruction-fidelity, self-verification, requirements-reconciliation] format: requirements-doc - name: extract-invariants @@ -1364,7 +1371,7 @@ templates: source code. Produces a dense, filtered subset of a full requirements extraction. persona: specification-analyst - protocols: [anti-hallucination, self-verification, invariant-extraction] + protocols: [anti-hallucination, instruction-fidelity, self-verification, invariant-extraction] format: requirements-doc - name: author-rfc @@ -1374,7 +1381,7 @@ templates: vocabulary. Produces structurally valid xml2rfc XML from a project description, protocol design, or requirements document. persona: protocol-architect - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: rfc-document presentations: @@ -1388,7 +1395,7 @@ templates: presentation kit with slides, speaker notes, timeline, and optional demo plan and PDF export. persona: configurable - protocols: [anti-hallucination, self-verification, operational-constraints, presentation-design] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, presentation-design] format: presentation-kit code-generation: @@ -1399,7 +1406,7 @@ templates: spec-compliant implementation code. Pairs with audit-code-compliance for a generate/verify loop. persona: implementation-engineer - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: requirements-doc requires: requirements-document @@ -1410,7 +1417,7 @@ templates: spec-compliant test code. Pairs with audit-test-compliance for a generate/verify loop. persona: test-engineer - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: validation-plan requires: [requirements-document, validation-plan] @@ -1422,7 +1429,7 @@ templates: Designed for external orchestrators — PromptKit produces the prompts, not the runtime. persona: workflow-arbiter - protocols: [anti-hallucination, self-verification, workflow-arbitration] + protocols: [anti-hallucination, instruction-fidelity, self-verification, workflow-arbitration] format: multi-artifact requires: requirements-document @@ -1433,7 +1440,7 @@ templates: Investigate a bug from a problem description. Apply root cause analysis and produce an investigation report. persona: systems-engineer - protocols: [anti-hallucination, self-verification, operational-constraints, root-cause-analysis] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, root-cause-analysis] taxonomies: [stack-lifetime-hazards] format: investigation-report @@ -1446,7 +1453,7 @@ templates: analysis, energy-vs-metric divergence, and cross-process amplification detection. persona: systems-engineer - protocols: [anti-hallucination, self-verification, operational-constraints, root-cause-analysis] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, root-cause-analysis] format: investigation-report - name: find-and-fix-bugs @@ -1456,7 +1463,7 @@ templates: of bugs, apply fixes, build to verify, iterate on errors, and produce a findings report. persona: systems-engineer - protocols: [anti-hallucination, self-verification, operational-constraints, minimal-edit-discipline] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, minimal-edit-discipline] format: investigation-report - name: fix-compiler-warnings @@ -1466,7 +1473,7 @@ templates: warnings from SARIF or compiler output, apply rule-specific fix patterns, build-verify each fix, and discover new patterns. persona: systems-engineer - protocols: [anti-hallucination, self-verification, operational-constraints, minimal-edit-discipline, compiler-diagnostics-cpp] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, minimal-edit-discipline, compiler-diagnostics-cpp] format: structured-findings - name: investigate-security @@ -1477,7 +1484,7 @@ templates: exhaustive path tracing selectively to parser/decoder functions that handle untrusted structured input. persona: security-auditor - protocols: [anti-hallucination, self-verification, operational-constraints, adversarial-falsification, security-vulnerability, exhaustive-path-tracing] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, adversarial-falsification, security-vulnerability, exhaustive-path-tracing] taxonomies: [stack-lifetime-hazards] format: investigation-report @@ -1488,7 +1495,7 @@ templates: inefficiencies and structural waste. Maps execution back to PromptKit components and produces optimization recommendations. persona: specification-analyst - protocols: [anti-hallucination, self-verification, session-profiling] + protocols: [anti-hallucination, instruction-fidelity, self-verification, session-profiling] format: investigation-report - name: classify-findings @@ -1498,7 +1505,7 @@ templates: Three-way classification (Exact Match / Variant / New Pattern) with justification, confidence analysis, and catalog update proposals. persona: systems-engineer - protocols: [anti-hallucination, self-verification, finding-classification] + protocols: [anti-hallucination, instruction-fidelity, self-verification, finding-classification] format: structured-findings code-analysis: @@ -1508,7 +1515,7 @@ templates: Thorough code review for correctness, safety, security, and maintainability. Supports additional analysis protocols. persona: systems-engineer - protocols: [anti-hallucination, self-verification, operational-constraints] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints] taxonomies: [stack-lifetime-hazards] format: investigation-report @@ -1519,7 +1526,7 @@ templates: research-validated best practices and memory safety analysis. Optionally applies Win32 API or performance-critical C patterns. persona: systems-engineer - protocols: [anti-hallucination, self-verification, operational-constraints, cpp-best-practices, memory-safety-c] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, cpp-best-practices, memory-safety-c] taxonomies: [cpp-review-patterns] format: investigation-report @@ -1531,7 +1538,7 @@ templates: falsification discipline. Optionally applies kernel-specific analysis for OS code. persona: systems-engineer - protocols: [anti-hallucination, self-verification, adversarial-falsification, exhaustive-path-tracing] + protocols: [anti-hallucination, instruction-fidelity, self-verification, adversarial-falsification, exhaustive-path-tracing] taxonomies: [kernel-defect-categories] format: exhaustive-review-report @@ -1543,7 +1550,7 @@ templates: (post inline review comments via GitHub API). Language-agnostic by default with optional language-specific focus. persona: systems-engineer - protocols: [anti-hallucination, self-verification, operational-constraints, human-voice-fidelity] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, human-voice-fidelity] format: investigation-report - name: respond-to-pr-comments @@ -1555,7 +1562,7 @@ templates: thread status via the platform's API). Auto-detects platform from the PR URL. Detects contradictory feedback across reviewers. persona: systems-engineer - protocols: [anti-hallucination, self-verification, operational-constraints, human-voice-fidelity] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, human-voice-fidelity] format: pr-comment-responses - name: reconstruct-behavior @@ -1566,7 +1573,7 @@ templates: implicit invariants from code, schematics, netlists, configurations, firmware images, or protocol captures. persona: reverse-engineer - protocols: [anti-hallucination, self-verification, operational-constraints, invariant-extraction] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, invariant-extraction] format: behavioral-model - name: review-schematic @@ -1577,7 +1584,7 @@ templates: bus integrity, protection circuits, power sequencing, passive components, and completeness. persona: electrical-engineer - protocols: [anti-hallucination, self-verification, schematic-compliance-audit] + protocols: [anti-hallucination, instruction-fidelity, self-verification, schematic-compliance-audit] format: investigation-report - name: validate-simulation @@ -1588,7 +1595,7 @@ templates: extracts results, checks compliance, assesses corner-case coverage, and evaluates model validity. persona: electrical-engineer - protocols: [anti-hallucination, self-verification, simulation-validation] + protocols: [anti-hallucination, instruction-fidelity, self-verification, simulation-validation] format: investigation-report - name: review-bom @@ -1599,7 +1606,7 @@ templates: package matches, cost compliance, sourcing risks, and completeness. persona: electrical-engineer - protocols: [anti-hallucination, self-verification, bom-consistency] + protocols: [anti-hallucination, instruction-fidelity, self-verification, bom-consistency] format: investigation-report - name: review-layout @@ -1610,7 +1617,7 @@ templates: plane integrity, component placement, thermal design, and manufacturing constraints. persona: electrical-engineer - protocols: [anti-hallucination, self-verification, layout-design-review] + protocols: [anti-hallucination, instruction-fidelity, self-verification, layout-design-review] format: investigation-report - name: audit-link-budget @@ -1620,7 +1627,7 @@ templates: model validity, receiver chain, margin adequacy, regulatory compliance, and sensitivity to environmental assumptions. persona: rf-engineer - protocols: [anti-hallucination, self-verification, link-budget-audit] + protocols: [anti-hallucination, instruction-fidelity, self-verification, link-budget-audit] format: investigation-report - name: review-enclosure @@ -1631,7 +1638,7 @@ templates: compatibility, sensor access, manufacturing feasibility, and mounting provisions. persona: mechanical-engineer - protocols: [anti-hallucination, self-verification, enclosure-design-review] + protocols: [anti-hallucination, instruction-fidelity, self-verification, enclosure-design-review] format: investigation-report hardware-design: @@ -1642,7 +1649,7 @@ templates: project requirements through component selection to a complete KiCad schematic with adversarial audits at each gate. persona: electrical-engineer - protocols: [anti-hallucination, self-verification, component-selection, component-selection-audit, schematic-design, schematic-compliance-audit] + protocols: [anti-hallucination, instruction-fidelity, self-verification, component-selection, component-selection-audit, schematic-design, schematic-compliance-audit] - name: design-pcb-layout path: templates/design-pcb-layout.md @@ -1651,7 +1658,7 @@ templates: schematic through placement, automated routing, and DRC validation with layout-to-schematic feedback loop. persona: electrical-engineer - protocols: [anti-hallucination, self-verification, pcb-layout-design, layout-design-review] + protocols: [anti-hallucination, instruction-fidelity, self-verification, pcb-layout-design, layout-design-review] - name: emit-manufacturing-artifacts path: templates/emit-manufacturing-artifacts.md @@ -1661,7 +1668,7 @@ templates: assembly drawings with fab-specific formatting for JLCPCB and PCBWay. persona: electrical-engineer - protocols: [anti-hallucination, self-verification, manufacturing-artifact-generation] + protocols: [anti-hallucination, instruction-fidelity, self-verification, manufacturing-artifact-generation] - name: hardware-design-workflow path: templates/hardware-design-workflow.md @@ -1671,7 +1678,7 @@ templates: component selection, schematic, PCB layout, and manufacturing with adversarial audits and user review at every gate. persona: electrical-engineer - protocols: [anti-hallucination, self-verification, requirements-elicitation, component-selection, component-selection-audit, schematic-design, schematic-compliance-audit, pcb-layout-design, layout-design-review, manufacturing-artifact-generation] + protocols: [anti-hallucination, instruction-fidelity, self-verification, requirements-elicitation, component-selection, component-selection-audit, schematic-design, schematic-compliance-audit, pcb-layout-design, layout-design-review, manufacturing-artifact-generation] testing: - name: discover-tests-for-changes @@ -1681,7 +1688,7 @@ templates: discover relevant tests. Finds test files near changed code, checks test configuration, and recommends execution strategy. persona: test-engineer - protocols: [anti-hallucination, self-verification, operational-constraints] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints] format: triage-report - name: scaffold-test-project @@ -1691,7 +1698,7 @@ templates: class boilerplate, and test runner setup for a given framework and language. persona: test-engineer - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: implementation-plan planning: @@ -1703,7 +1710,7 @@ templates: modes: "implementation" (new feature/project) and "refactoring" (safe, incremental transformation of existing code). persona: software-architect - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: implementation-plan agent-authoring: @@ -1716,7 +1723,7 @@ templates: .github/agents/*.agent.md, or .github/skills/*/SKILL.md. Also supports Claude Code (CLAUDE.md) and Cursor (.cursorrules). persona: promptkit-contributor - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: agent-instructions - name: author-session-handoff @@ -1727,7 +1734,7 @@ templates: prioritized plan for the next session. Interactive workflow that gathers state and produces a handoff file. persona: systems-engineer - protocols: [anti-hallucination, self-verification, session-handoff] + protocols: [anti-hallucination, instruction-fidelity, self-verification, session-handoff] - name: enhance-prompt path: templates/enhance-prompt.md @@ -1739,7 +1746,7 @@ templates: library, and proposes prioritized, category-classified enhancements. Supports document mode (plan) or action mode (apply in place). persona: promptkit-contributor - protocols: [anti-hallucination, self-verification, prompt-enhancement] + protocols: [anti-hallucination, instruction-fidelity, self-verification, prompt-enhancement] taxonomies: [enhancement-categories] format: enhancement-report @@ -1750,7 +1757,7 @@ templates: Guide a contributor through designing and building new PromptKit components. Interactive workflow producing PR-ready files. persona: promptkit-contributor - protocols: [anti-hallucination, self-verification, promptkit-design] + protocols: [anti-hallucination, instruction-fidelity, self-verification, promptkit-design] format: promptkit-pull-request - name: decompose-prompt @@ -1760,7 +1767,7 @@ templates: layers. Maps segments to existing components, flags improvements, and generates PR-ready files for novel components. persona: promptkit-contributor - protocols: [anti-hallucination, self-verification, prompt-decomposition] + protocols: [anti-hallucination, instruction-fidelity, self-verification, prompt-decomposition] format: promptkit-pull-request - name: audit-library-consistency @@ -1771,7 +1778,7 @@ templates: duplication, template near-duplicates, terminology drift, and stale cross-references. persona: specification-analyst - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: investigation-report - name: audit-library-health @@ -1783,7 +1790,7 @@ templates: and language determinism analysis. Produces a unified investigation report with PR-ready remediation recommendations. persona: specification-analyst - protocols: [anti-hallucination, self-verification, operational-constraints, corpus-safety-audit, prompt-determinism-analysis] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, corpus-safety-audit, prompt-determinism-analysis] format: investigation-report devops: @@ -1793,7 +1800,7 @@ templates: Generate a production-ready CI/CD pipeline for a given application and target platform. Supports GitHub Actions, Azure DevOps, GitLab CI. persona: devops-engineer - protocols: [anti-hallucination, self-verification, devops-platform-analysis] + protocols: [anti-hallucination, instruction-fidelity, self-verification, devops-platform-analysis] format: pipeline-spec - name: triage-issues @@ -1802,7 +1809,7 @@ templates: Triage and prioritize open issues or work items. Classify by priority and effort, identify patterns, recommend a workflow. persona: devops-engineer - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: triage-report - name: triage-pull-requests @@ -1811,7 +1818,7 @@ templates: Triage open pull requests to identify which need review, are stale, have conflicts, or are ready to merge. Prioritize review effort. persona: devops-engineer - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: triage-report - name: root-cause-ci-failure @@ -1820,7 +1827,7 @@ templates: Investigate a failing CI/CD pipeline run. Analyze logs, pipeline configuration, and platform behavior. Produce an investigation report. persona: devops-engineer - protocols: [anti-hallucination, self-verification, root-cause-analysis, devops-platform-analysis] + protocols: [anti-hallucination, instruction-fidelity, self-verification, root-cause-analysis, devops-platform-analysis] format: investigation-report - name: author-release @@ -1829,7 +1836,7 @@ templates: Generate structured release notes from commits, PRs, and issues between two versions. Changelog, breaking changes, upgrade instructions. persona: devops-engineer - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] format: release-notes - name: review-infrastructure @@ -1838,7 +1845,7 @@ templates: Review infrastructure-as-code (Terraform, Bicep, ARM, Pulumi, CloudFormation) for correctness, security, and best practices. persona: devops-engineer - protocols: [anti-hallucination, self-verification, security-vulnerability] + protocols: [anti-hallucination, instruction-fidelity, self-verification, security-vulnerability] format: investigation-report - name: generate-commit-message @@ -1848,7 +1855,7 @@ templates: Analyzes diffs to produce a Problem/Solution or Conventional Commits format message with file change summaries. persona: software-architect - protocols: [anti-hallucination, self-verification] + protocols: [anti-hallucination, instruction-fidelity, self-verification] protocol-engineering: - name: evolve-protocol @@ -1858,7 +1865,7 @@ templates: specification, works with the user to design modifications, traces impact, verifies consistency, and produces a protocol delta document. persona: protocol-architect - protocols: [anti-hallucination, self-verification, protocol-evolution] + protocols: [anti-hallucination, instruction-fidelity, self-verification, protocol-evolution] taxonomies: [protocol-change-categories] format: protocol-delta @@ -1869,7 +1876,7 @@ templates: incompatible assumptions, and interoperability hazards. Produces an investigation report with resolution recommendations. persona: protocol-architect - protocols: [anti-hallucination, self-verification, protocol-conflict-analysis] + protocols: [anti-hallucination, instruction-fidelity, self-verification, protocol-conflict-analysis] format: investigation-report - name: author-protocol-validation @@ -1879,7 +1886,7 @@ templates: Produces a test blueprint covering state machine coverage, message format conformance, error handling, and interoperability scenarios. persona: protocol-architect - protocols: [anti-hallucination, self-verification, protocol-validation-design] + protocols: [anti-hallucination, instruction-fidelity, self-verification, protocol-validation-design] format: protocol-validation-spec engineering-workflow: @@ -1891,7 +1898,7 @@ templates: specification changes, implementation changes, adversarial audits, and deliverable creation. Domain-agnostic. persona: configurable - protocols: [anti-hallucination, self-verification, adversarial-falsification, operational-constraints, requirements-elicitation, iterative-refinement, change-propagation, traceability-audit, code-compliance-audit, test-compliance-audit] + protocols: [anti-hallucination, instruction-fidelity, self-verification, adversarial-falsification, operational-constraints, requirements-elicitation, iterative-refinement, change-propagation, traceability-audit, code-compliance-audit, test-compliance-audit] taxonomies: [specification-drift] - name: collaborate-requirements-change @@ -1901,7 +1908,7 @@ templates: Work with the user to understand, refine, and produce a structured requirements patch. Domain-agnostic. persona: configurable - protocols: [anti-hallucination, self-verification, requirements-elicitation, iterative-refinement] + protocols: [anti-hallucination, instruction-fidelity, self-verification, requirements-elicitation, iterative-refinement] format: structured-patch - name: generate-spec-changes @@ -1911,7 +1918,7 @@ templates: requirements patch. Propagates each requirement change to design sections and validation entries. Domain-agnostic. persona: configurable - protocols: [anti-hallucination, self-verification, change-propagation] + protocols: [anti-hallucination, instruction-fidelity, self-verification, change-propagation] format: structured-patch - name: generate-implementation-changes @@ -1921,7 +1928,7 @@ templates: specification patch. Propagates design and validation changes to implementation artifacts. Domain-agnostic. persona: configurable - protocols: [anti-hallucination, self-verification, operational-constraints, change-propagation] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, change-propagation] format: structured-patch - name: audit-spec-alignment @@ -1931,7 +1938,7 @@ templates: Verifies requirements, design, and validation changes faithfully represent what the user asked for. Domain-agnostic. persona: specification-analyst - protocols: [anti-hallucination, self-verification, adversarial-falsification, traceability-audit] + protocols: [anti-hallucination, instruction-fidelity, self-verification, adversarial-falsification, traceability-audit] taxonomies: [specification-drift] format: investigation-report @@ -1942,7 +1949,7 @@ templates: deltas. Verifies implementation and verification changes correctly realize the specification changes. Domain-agnostic. persona: specification-analyst - protocols: [anti-hallucination, self-verification, adversarial-falsification, operational-constraints, code-compliance-audit, test-compliance-audit] + protocols: [anti-hallucination, instruction-fidelity, self-verification, adversarial-falsification, operational-constraints, code-compliance-audit, test-compliance-audit] taxonomies: [specification-drift] format: investigation-report @@ -1955,7 +1962,7 @@ templates: consistency, and produces PR-ready spec files. Domain-agnostic complement to engineering-workflow. persona: configurable - protocols: [anti-hallucination, self-verification, operational-constraints, adversarial-falsification, requirements-from-implementation, requirements-elicitation, iterative-refinement, traceability-audit] + protocols: [anti-hallucination, instruction-fidelity, self-verification, operational-constraints, adversarial-falsification, requirements-from-implementation, requirements-elicitation, iterative-refinement, traceability-audit] taxonomies: [specification-drift] - name: maintenance-workflow @@ -1967,7 +1974,7 @@ templates: restores alignment. Domain-agnostic — completes the engineering lifecycle triad. persona: configurable - protocols: [anti-hallucination, self-verification, adversarial-falsification, operational-constraints, traceability-audit, code-compliance-audit, test-compliance-audit, change-propagation, iterative-refinement] + protocols: [anti-hallucination, instruction-fidelity, self-verification, adversarial-falsification, operational-constraints, traceability-audit, code-compliance-audit, test-compliance-audit, change-propagation, iterative-refinement] taxonomies: [specification-drift] pipelines: diff --git a/protocols/guardrails/instruction-fidelity.md b/protocols/guardrails/instruction-fidelity.md new file mode 100644 index 0000000..e53057f --- /dev/null +++ b/protocols/guardrails/instruction-fidelity.md @@ -0,0 +1,80 @@ + + + +--- +name: instruction-fidelity +type: guardrail +description: > + Universal execution contract requiring the LLM to follow the user's + requested outcome and the prompt's constraints as written, ask when + material ambiguity remains, and resist substituting a preferred task. +applicable_to: all +--- + +# Protocol: Instruction Fidelity + +This protocol MUST be applied to every task. It defines the execution +contract that keeps the model aligned with the user's requested outcome, +the prompt's explicit constraints, and the workflow's approval gates. + +## Rules + +### 1. Follow the Requested Outcome Literally + +- Treat the user's stated goal, constraints, non-goals, deliverable + shape, and approval requirements as binding instructions. +- Do NOT substitute a nearby task that seems better, cleaner, broader, + or easier than what the user asked for. +- Do NOT silently narrow scope, broaden scope, or convert the task into + a different artifact type. + +### 2. Instruction Priority and Conflict Handling + +- Within the prompt artifact, apply this priority order: + 1. User-stated goal, constraints, and non-goals + 2. Explicit phase gates, stop rules, and approval requirements + 3. Guardrail protocols with MUST / MUST NOT language + 4. Format and packaging rules + 5. Examples and illustrative text +- Never use an example to override normative language such as MUST, + MUST NOT, REQUIRED, STOP, WAIT, or DO NOT. +- If two instructions conflict and the priority order does not resolve + the conflict, stop and surface the conflict explicitly instead of + improvising a compromise. + +### 3. Ambiguity Handling + +- If two or more reasonable interpretations would materially change the + template selection, output mode, scope, non-goals, implementation + approach, or deliverable structure, do NOT choose one silently. +- Ask a targeted clarifying question that resolves the ambiguity. +- If the workflow does not permit a question, or the user explicitly + says to keep the choice flexible, record the unresolved point as + `[OPEN QUESTION]` and keep the affected alternatives visible. Do NOT + collapse multiple viable interpretations into one preferred answer. + +### 4. Phase and Gate Discipline + +- Execute ordered steps and phases in the sequence stated by the prompt. +- Do NOT skip, merge, condense away, or reorder phases unless the prompt + explicitly authorizes that change. +- When the prompt says to STOP, WAIT, request approval, or hold at a + gate, obey that instruction literally. + +### 5. Forbidden Behaviors + +- Do NOT invent missing user intent to make the task feel more complete. +- Do NOT resolve ambiguity by following your own preferences. +- Do NOT omit stated non-goals, exclusions, or safety boundaries. +- Do NOT condense away approval gates, stop rules, or MUST / MUST NOT + constraints when repackaging prompts into other formats. + +### 6. Compliance Check Before Finalizing + +Before finalizing any output, perform this check: + +- Enumerate the binding instructions currently in scope. +- Confirm that the output satisfies each instruction, or explicitly + identify any unresolved blocker. +- If any binding instruction is unsatisfied, revise the output or stop + and report the blocker. Do NOT present it as complete. diff --git a/templates/analyze-protocol-conflicts.md b/templates/analyze-protocol-conflicts.md index fc4dea6..a7450b0 100644 --- a/templates/analyze-protocol-conflicts.md +++ b/templates/analyze-protocol-conflicts.md @@ -11,6 +11,7 @@ description: > persona: protocol-architect protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/protocol-conflict-analysis format: investigation-report diff --git a/templates/audit-code-compliance.md b/templates/audit-code-compliance.md index 9f6e9a9..8d2f2d6 100644 --- a/templates/audit-code-compliance.md +++ b/templates/audit-code-compliance.md @@ -11,6 +11,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - reasoning/code-compliance-audit diff --git a/templates/audit-coverage-gaps.md b/templates/audit-coverage-gaps.md index 2751b12..81a9b43 100644 --- a/templates/audit-coverage-gaps.md +++ b/templates/audit-coverage-gaps.md @@ -10,6 +10,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - reasoning/coverage-gap-analysis diff --git a/templates/audit-implementation-alignment.md b/templates/audit-implementation-alignment.md index 7d4f230..1c0081d 100644 --- a/templates/audit-implementation-alignment.md +++ b/templates/audit-implementation-alignment.md @@ -11,6 +11,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/adversarial-falsification - guardrails/operational-constraints diff --git a/templates/audit-integration-compliance.md b/templates/audit-integration-compliance.md index 5742fc1..a773c8d 100644 --- a/templates/audit-integration-compliance.md +++ b/templates/audit-integration-compliance.md @@ -11,6 +11,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - reasoning/integration-audit diff --git a/templates/audit-interface-contract.md b/templates/audit-interface-contract.md index 241ce57..e513053 100644 --- a/templates/audit-interface-contract.md +++ b/templates/audit-interface-contract.md @@ -11,6 +11,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/interface-contract-audit format: investigation-report diff --git a/templates/audit-library-consistency.md b/templates/audit-library-consistency.md index cf1e4c5..8a84d63 100644 --- a/templates/audit-library-consistency.md +++ b/templates/audit-library-consistency.md @@ -14,6 +14,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: investigation-report params: diff --git a/templates/audit-library-health.md b/templates/audit-library-health.md index 8189a7a..ff37a8e 100644 --- a/templates/audit-library-health.md +++ b/templates/audit-library-health.md @@ -14,6 +14,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - reasoning/corpus-safety-audit diff --git a/templates/audit-link-budget.md b/templates/audit-link-budget.md index e787aa1..3058d92 100644 --- a/templates/audit-link-budget.md +++ b/templates/audit-link-budget.md @@ -10,6 +10,7 @@ description: > persona: rf-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - analysis/link-budget-audit format: investigation-report diff --git a/templates/audit-spec-alignment.md b/templates/audit-spec-alignment.md index 1df41b5..b737014 100644 --- a/templates/audit-spec-alignment.md +++ b/templates/audit-spec-alignment.md @@ -11,6 +11,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/adversarial-falsification - reasoning/traceability-audit diff --git a/templates/audit-spec-invariants.md b/templates/audit-spec-invariants.md index 1b54203..9a135bd 100644 --- a/templates/audit-spec-invariants.md +++ b/templates/audit-spec-invariants.md @@ -12,6 +12,7 @@ description: > persona: configurable protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/spec-invariant-audit format: investigation-report diff --git a/templates/audit-test-compliance.md b/templates/audit-test-compliance.md index 5956de0..5fa3581 100644 --- a/templates/audit-test-compliance.md +++ b/templates/audit-test-compliance.md @@ -11,6 +11,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - reasoning/test-compliance-audit diff --git a/templates/audit-traceability.md b/templates/audit-traceability.md index 715a47f..3253503 100644 --- a/templates/audit-traceability.md +++ b/templates/audit-traceability.md @@ -11,6 +11,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/traceability-audit taxonomies: diff --git a/templates/author-agent-instructions.md b/templates/author-agent-instructions.md index 161552e..01e2af8 100644 --- a/templates/author-agent-instructions.md +++ b/templates/author-agent-instructions.md @@ -13,6 +13,7 @@ description: > persona: promptkit-contributor protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: agent-instructions params: @@ -97,8 +98,8 @@ normative unless the user requests an alternative in Step 1): 1. **Persona + guardrails skill** — One file containing: - Condensed persona identity (3–8 sentences) - - All guardrail protocols (anti-hallucination, self-verification, - operational-constraints) + - All guardrail protocols (anti-hallucination, instruction-fidelity, + self-verification, operational-constraints) - `applyTo: '**'` (applies to all files) - Filename: `.instructions.md` @@ -185,6 +186,11 @@ Transform the loaded components into agent instruction prose: - Omit meta-commentary about the protocol's structure - Rewrite in second person ("When you encounter X, always Y") - If multiple protocols overlap, merge the redundant parts + - **Exception for `instruction-fidelity`**: preserve its execution + contract verbatim under a dedicated `## Instruction Fidelity + Contract` section. Do NOT merge away its priority order, ambiguity + escalation rule, phase/gate discipline, forbidden behaviors, or + compliance check. - **Exception for multi-phase workflows**: If the source template defines a multi-phase pipeline (multiple sequential phases where each phase's output feeds the next), do NOT condense away the diff --git a/templates/author-architecture-spec.md b/templates/author-architecture-spec.md index 604e0c2..4cc3015 100644 --- a/templates/author-architecture-spec.md +++ b/templates/author-architecture-spec.md @@ -13,6 +13,7 @@ description: > persona: software-architect protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: architecture-spec params: diff --git a/templates/author-design-doc.md b/templates/author-design-doc.md index 7fc2429..196d6be 100644 --- a/templates/author-design-doc.md +++ b/templates/author-design-doc.md @@ -9,6 +9,7 @@ description: > persona: software-architect protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: design-doc params: diff --git a/templates/author-implementation-prompt.md b/templates/author-implementation-prompt.md index 0c9f889..a2d9db2 100644 --- a/templates/author-implementation-prompt.md +++ b/templates/author-implementation-prompt.md @@ -11,6 +11,7 @@ description: > persona: implementation-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: requirements-doc params: diff --git a/templates/author-interface-contract.md b/templates/author-interface-contract.md index 0bd0e7b..ee7fa5a 100644 --- a/templates/author-interface-contract.md +++ b/templates/author-interface-contract.md @@ -12,6 +12,7 @@ description: > persona: systems-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: interface-contract params: diff --git a/templates/author-known-conditions-registry.md b/templates/author-known-conditions-registry.md index 6ad0d0a..240d213 100644 --- a/templates/author-known-conditions-registry.md +++ b/templates/author-known-conditions-registry.md @@ -10,6 +10,7 @@ description: > persona: systems-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: null params: diff --git a/templates/author-north-star.md b/templates/author-north-star.md index 31cd031..e2cdfef 100644 --- a/templates/author-north-star.md +++ b/templates/author-north-star.md @@ -12,6 +12,7 @@ description: > persona: software-architect protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: north-star-document params: diff --git a/templates/author-pipeline.md b/templates/author-pipeline.md index 6ca22b8..3747f7d 100644 --- a/templates/author-pipeline.md +++ b/templates/author-pipeline.md @@ -10,6 +10,7 @@ description: > persona: devops-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/devops-platform-analysis format: pipeline-spec diff --git a/templates/author-presentation.md b/templates/author-presentation.md index 7f30570..0b255e7 100644 --- a/templates/author-presentation.md +++ b/templates/author-presentation.md @@ -14,6 +14,7 @@ description: > persona: "{{persona}}" protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - reasoning/presentation-design diff --git a/templates/author-protocol-validation.md b/templates/author-protocol-validation.md index 9a328ab..e992797 100644 --- a/templates/author-protocol-validation.md +++ b/templates/author-protocol-validation.md @@ -12,6 +12,7 @@ description: > persona: protocol-architect protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/protocol-validation-design format: protocol-validation-spec diff --git a/templates/author-release.md b/templates/author-release.md index 8a744ce..deb80ba 100644 --- a/templates/author-release.md +++ b/templates/author-release.md @@ -10,6 +10,7 @@ description: > persona: devops-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: release-notes params: diff --git a/templates/author-requirements-doc.md b/templates/author-requirements-doc.md index 5415447..c0763f4 100644 --- a/templates/author-requirements-doc.md +++ b/templates/author-requirements-doc.md @@ -9,6 +9,7 @@ description: > persona: software-architect protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/requirements-elicitation format: requirements-doc diff --git a/templates/author-rfc.md b/templates/author-rfc.md index 17808b4..6a379de 100644 --- a/templates/author-rfc.md +++ b/templates/author-rfc.md @@ -11,6 +11,7 @@ description: > persona: protocol-architect protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: rfc-document params: diff --git a/templates/author-session-handoff.md b/templates/author-session-handoff.md index df5cf1a..4358287 100644 --- a/templates/author-session-handoff.md +++ b/templates/author-session-handoff.md @@ -12,6 +12,7 @@ description: > persona: systems-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/session-handoff format: null diff --git a/templates/author-test-prompt.md b/templates/author-test-prompt.md index d3e3152..8d1036c 100644 --- a/templates/author-test-prompt.md +++ b/templates/author-test-prompt.md @@ -11,6 +11,7 @@ description: > persona: test-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: validation-plan params: diff --git a/templates/author-validation-plan.md b/templates/author-validation-plan.md index b0ca418..4b92927 100644 --- a/templates/author-validation-plan.md +++ b/templates/author-validation-plan.md @@ -9,6 +9,7 @@ description: > persona: systems-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: validation-plan params: diff --git a/templates/author-workflow-prompts.md b/templates/author-workflow-prompts.md index c0a5f28..6d2a1a6 100644 --- a/templates/author-workflow-prompts.md +++ b/templates/author-workflow-prompts.md @@ -11,6 +11,7 @@ description: > persona: workflow-arbiter protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/workflow-arbitration format: multi-artifact diff --git a/templates/classify-findings.md b/templates/classify-findings.md index 9fe2f57..6c6d4e0 100644 --- a/templates/classify-findings.md +++ b/templates/classify-findings.md @@ -11,6 +11,7 @@ description: > persona: systems-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/finding-classification format: structured-findings diff --git a/templates/collaborate-requirements-change.md b/templates/collaborate-requirements-change.md index 6cff908..53faf17 100644 --- a/templates/collaborate-requirements-change.md +++ b/templates/collaborate-requirements-change.md @@ -13,6 +13,7 @@ description: > persona: "{{persona}}" protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/requirements-elicitation - reasoning/iterative-refinement diff --git a/templates/decompose-prompt.md b/templates/decompose-prompt.md index 4d31002..9122098 100644 --- a/templates/decompose-prompt.md +++ b/templates/decompose-prompt.md @@ -13,6 +13,7 @@ description: > persona: promptkit-contributor protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/prompt-decomposition format: promptkit-pull-request diff --git a/templates/design-pcb-layout.md b/templates/design-pcb-layout.md index c9322c3..ec3206b 100644 --- a/templates/design-pcb-layout.md +++ b/templates/design-pcb-layout.md @@ -14,6 +14,7 @@ description: > persona: electrical-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/pcb-layout-design - analysis/layout-design-review diff --git a/templates/design-schematic.md b/templates/design-schematic.md index d052b86..16e3fca 100644 --- a/templates/design-schematic.md +++ b/templates/design-schematic.md @@ -13,6 +13,7 @@ description: > persona: electrical-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/component-selection - analysis/component-selection-audit diff --git a/templates/diff-specifications.md b/templates/diff-specifications.md index 2fa1e67..86cb402 100644 --- a/templates/diff-specifications.md +++ b/templates/diff-specifications.md @@ -11,6 +11,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/spec-evolution-diff format: investigation-report diff --git a/templates/discover-tests-for-changes.md b/templates/discover-tests-for-changes.md index d9fb925..c90cf30 100644 --- a/templates/discover-tests-for-changes.md +++ b/templates/discover-tests-for-changes.md @@ -10,6 +10,7 @@ description: > persona: test-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints format: triage-report diff --git a/templates/emit-manufacturing-artifacts.md b/templates/emit-manufacturing-artifacts.md index 32f320f..86ab70d 100644 --- a/templates/emit-manufacturing-artifacts.md +++ b/templates/emit-manufacturing-artifacts.md @@ -13,6 +13,7 @@ description: > persona: electrical-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/manufacturing-artifact-generation format: null diff --git a/templates/engineering-workflow.md b/templates/engineering-workflow.md index 44cfa4b..86bc567 100644 --- a/templates/engineering-workflow.md +++ b/templates/engineering-workflow.md @@ -13,6 +13,7 @@ description: > persona: "{{persona}}" protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/adversarial-falsification - guardrails/operational-constraints diff --git a/templates/enhance-prompt.md b/templates/enhance-prompt.md index d57809a..213951c 100644 --- a/templates/enhance-prompt.md +++ b/templates/enhance-prompt.md @@ -15,6 +15,7 @@ description: > persona: promptkit-contributor protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/prompt-enhancement taxonomies: diff --git a/templates/evaluate-prompt-portability.md b/templates/evaluate-prompt-portability.md index 8c09370..7cdf742 100644 --- a/templates/evaluate-prompt-portability.md +++ b/templates/evaluate-prompt-portability.md @@ -13,6 +13,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/prompt-portability-evaluation format: portability-report diff --git a/templates/evolve-protocol.md b/templates/evolve-protocol.md index f8331a7..f0c4b91 100644 --- a/templates/evolve-protocol.md +++ b/templates/evolve-protocol.md @@ -13,6 +13,7 @@ description: > persona: protocol-architect protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/protocol-evolution taxonomies: [protocol-change-categories] diff --git a/templates/exhaustive-bug-hunt.md b/templates/exhaustive-bug-hunt.md index 8432197..e683e91 100644 --- a/templates/exhaustive-bug-hunt.md +++ b/templates/exhaustive-bug-hunt.md @@ -11,6 +11,7 @@ description: > persona: systems-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/adversarial-falsification - reasoning/exhaustive-path-tracing diff --git a/templates/extend-library.md b/templates/extend-library.md index 42ba7fa..d80fe1e 100644 --- a/templates/extend-library.md +++ b/templates/extend-library.md @@ -12,6 +12,7 @@ description: > persona: promptkit-contributor protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/promptkit-design format: promptkit-pull-request diff --git a/templates/extract-invariants.md b/templates/extract-invariants.md index 0a335e6..5325da0 100644 --- a/templates/extract-invariants.md +++ b/templates/extract-invariants.md @@ -11,6 +11,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/invariant-extraction format: requirements-doc diff --git a/templates/extract-rfc-requirements.md b/templates/extract-rfc-requirements.md index 4d49215..0e97288 100644 --- a/templates/extract-rfc-requirements.md +++ b/templates/extract-rfc-requirements.md @@ -11,6 +11,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/rfc-extraction format: requirements-doc diff --git a/templates/find-and-fix-bugs.md b/templates/find-and-fix-bugs.md index 54b81ca..bad69fb 100644 --- a/templates/find-and-fix-bugs.md +++ b/templates/find-and-fix-bugs.md @@ -11,6 +11,7 @@ description: > persona: systems-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - guardrails/minimal-edit-discipline diff --git a/templates/fix-compiler-warnings.md b/templates/fix-compiler-warnings.md index 85b4b2f..70bfec5 100644 --- a/templates/fix-compiler-warnings.md +++ b/templates/fix-compiler-warnings.md @@ -11,6 +11,7 @@ description: > persona: systems-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - guardrails/minimal-edit-discipline diff --git a/templates/generate-commit-message.md b/templates/generate-commit-message.md index 9432d90..2b1820a 100644 --- a/templates/generate-commit-message.md +++ b/templates/generate-commit-message.md @@ -10,6 +10,7 @@ description: > persona: software-architect protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: null params: diff --git a/templates/generate-implementation-changes.md b/templates/generate-implementation-changes.md index b4e372f..99dc909 100644 --- a/templates/generate-implementation-changes.md +++ b/templates/generate-implementation-changes.md @@ -12,6 +12,7 @@ description: > persona: "{{persona}}" protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - reasoning/change-propagation diff --git a/templates/generate-spec-changes.md b/templates/generate-spec-changes.md index fb3fe56..ffa3283 100644 --- a/templates/generate-spec-changes.md +++ b/templates/generate-spec-changes.md @@ -11,6 +11,7 @@ description: > persona: "{{persona}}" protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/change-propagation format: structured-patch diff --git a/templates/hardware-design-workflow.md b/templates/hardware-design-workflow.md index 1354712..3c3b358 100644 --- a/templates/hardware-design-workflow.md +++ b/templates/hardware-design-workflow.md @@ -14,6 +14,7 @@ description: > persona: electrical-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/requirements-elicitation - reasoning/component-selection diff --git a/templates/interactive-design.md b/templates/interactive-design.md index e168910..3dabfb9 100644 --- a/templates/interactive-design.md +++ b/templates/interactive-design.md @@ -14,6 +14,7 @@ description: > persona: "{{persona}}" protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/requirements-elicitation - reasoning/iterative-refinement diff --git a/templates/investigate-bug.md b/templates/investigate-bug.md index acafde2..e4b622a 100644 --- a/templates/investigate-bug.md +++ b/templates/investigate-bug.md @@ -10,6 +10,7 @@ description: > persona: systems-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - reasoning/root-cause-analysis diff --git a/templates/investigate-security.md b/templates/investigate-security.md index b36e079..aeb642a 100644 --- a/templates/investigate-security.md +++ b/templates/investigate-security.md @@ -10,6 +10,7 @@ description: > persona: security-auditor protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - guardrails/adversarial-falsification diff --git a/templates/investigate-trace.md b/templates/investigate-trace.md index f3492f9..3e454e2 100644 --- a/templates/investigate-trace.md +++ b/templates/investigate-trace.md @@ -11,6 +11,7 @@ description: > persona: systems-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - reasoning/root-cause-analysis diff --git a/templates/lint-prompt.md b/templates/lint-prompt.md index 8bd7fb8..af814b7 100644 --- a/templates/lint-prompt.md +++ b/templates/lint-prompt.md @@ -11,6 +11,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - analysis/prompt-determinism-analysis format: investigation-report diff --git a/templates/maintenance-workflow.md b/templates/maintenance-workflow.md index 9adbb30..78687cf 100644 --- a/templates/maintenance-workflow.md +++ b/templates/maintenance-workflow.md @@ -14,6 +14,7 @@ description: > persona: "{{persona}}" protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/adversarial-falsification - guardrails/operational-constraints diff --git a/templates/plan-implementation.md b/templates/plan-implementation.md index 2c99c2b..6083be2 100644 --- a/templates/plan-implementation.md +++ b/templates/plan-implementation.md @@ -11,6 +11,7 @@ description: > persona: software-architect protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: implementation-plan params: diff --git a/templates/profile-session.md b/templates/profile-session.md index 5b5b5a8..f9c77b1 100644 --- a/templates/profile-session.md +++ b/templates/profile-session.md @@ -12,6 +12,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/session-profiling format: investigation-report diff --git a/templates/reconcile-requirements.md b/templates/reconcile-requirements.md index dd63116..c338788 100644 --- a/templates/reconcile-requirements.md +++ b/templates/reconcile-requirements.md @@ -12,6 +12,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/requirements-reconciliation format: requirements-doc diff --git a/templates/reconstruct-behavior.md b/templates/reconstruct-behavior.md index 73c96d8..f4b617f 100644 --- a/templates/reconstruct-behavior.md +++ b/templates/reconstruct-behavior.md @@ -12,6 +12,7 @@ description: > persona: reverse-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - reasoning/invariant-extraction diff --git a/templates/respond-to-pr-comments.md b/templates/respond-to-pr-comments.md index 427cbe9..c3a12c8 100644 --- a/templates/respond-to-pr-comments.md +++ b/templates/respond-to-pr-comments.md @@ -12,6 +12,7 @@ description: > persona: systems-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - guardrails/human-voice-fidelity diff --git a/templates/reverse-engineer-requirements.md b/templates/reverse-engineer-requirements.md index 12a60d9..6d3c057 100644 --- a/templates/reverse-engineer-requirements.md +++ b/templates/reverse-engineer-requirements.md @@ -11,6 +11,7 @@ description: > persona: reverse-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - reasoning/requirements-from-implementation diff --git a/templates/review-bom.md b/templates/review-bom.md index 59f075a..57ccc6d 100644 --- a/templates/review-bom.md +++ b/templates/review-bom.md @@ -10,6 +10,7 @@ description: > persona: electrical-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - analysis/bom-consistency format: investigation-report diff --git a/templates/review-code.md b/templates/review-code.md index cade684..06bcaaa 100644 --- a/templates/review-code.md +++ b/templates/review-code.md @@ -10,6 +10,7 @@ description: > persona: systems-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints taxonomies: diff --git a/templates/review-cpp-code.md b/templates/review-cpp-code.md index c638855..0b53b06 100644 --- a/templates/review-cpp-code.md +++ b/templates/review-cpp-code.md @@ -11,6 +11,7 @@ description: > persona: systems-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - analysis/cpp-best-practices diff --git a/templates/review-enclosure.md b/templates/review-enclosure.md index d25e01b..0b525fa 100644 --- a/templates/review-enclosure.md +++ b/templates/review-enclosure.md @@ -11,6 +11,7 @@ description: > persona: mechanical-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - analysis/enclosure-design-review format: investigation-report diff --git a/templates/review-infrastructure.md b/templates/review-infrastructure.md index c63335f..24b9c77 100644 --- a/templates/review-infrastructure.md +++ b/templates/review-infrastructure.md @@ -10,6 +10,7 @@ description: > persona: devops-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - analysis/security-vulnerability format: investigation-report diff --git a/templates/review-layout.md b/templates/review-layout.md index b210c22..6bf2ebd 100644 --- a/templates/review-layout.md +++ b/templates/review-layout.md @@ -11,6 +11,7 @@ description: > persona: electrical-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - analysis/layout-design-review format: investigation-report diff --git a/templates/review-pull-request.md b/templates/review-pull-request.md index a313242..8c4fba2 100644 --- a/templates/review-pull-request.md +++ b/templates/review-pull-request.md @@ -11,6 +11,7 @@ description: > persona: systems-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - guardrails/human-voice-fidelity diff --git a/templates/review-schematic.md b/templates/review-schematic.md index bd712f6..9f13bd1 100644 --- a/templates/review-schematic.md +++ b/templates/review-schematic.md @@ -11,6 +11,7 @@ description: > persona: electrical-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - analysis/schematic-compliance-audit format: investigation-report diff --git a/templates/revise-for-readability.md b/templates/revise-for-readability.md index 1972120..f9aacf8 100644 --- a/templates/revise-for-readability.md +++ b/templates/revise-for-readability.md @@ -11,6 +11,7 @@ description: > persona: plain-language-editor protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/readability-gate - reasoning/readability-revision-workflow diff --git a/templates/root-cause-ci-failure.md b/templates/root-cause-ci-failure.md index 28dded5..0656f16 100644 --- a/templates/root-cause-ci-failure.md +++ b/templates/root-cause-ci-failure.md @@ -10,6 +10,7 @@ description: > persona: devops-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/root-cause-analysis - reasoning/devops-platform-analysis diff --git a/templates/scaffold-test-project.md b/templates/scaffold-test-project.md index b8d862a..ccc4acf 100644 --- a/templates/scaffold-test-project.md +++ b/templates/scaffold-test-project.md @@ -11,6 +11,7 @@ description: > persona: test-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: implementation-plan params: diff --git a/templates/spec-extraction-workflow.md b/templates/spec-extraction-workflow.md index 3a2f1b1..66ddb20 100644 --- a/templates/spec-extraction-workflow.md +++ b/templates/spec-extraction-workflow.md @@ -13,6 +13,7 @@ description: > persona: "{{persona}}" protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - guardrails/operational-constraints - guardrails/adversarial-falsification diff --git a/templates/triage-issues.md b/templates/triage-issues.md index 748716d..9a8181f 100644 --- a/templates/triage-issues.md +++ b/templates/triage-issues.md @@ -10,6 +10,7 @@ description: > persona: devops-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: triage-report params: diff --git a/templates/triage-pull-requests.md b/templates/triage-pull-requests.md index 238212c..b67ca72 100644 --- a/templates/triage-pull-requests.md +++ b/templates/triage-pull-requests.md @@ -9,6 +9,7 @@ description: > persona: devops-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification format: triage-report params: diff --git a/templates/validate-budget.md b/templates/validate-budget.md index 84c146c..8151a09 100644 --- a/templates/validate-budget.md +++ b/templates/validate-budget.md @@ -12,6 +12,7 @@ description: > persona: specification-analyst protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - reasoning/quantitative-constraint-validation format: investigation-report diff --git a/templates/validate-simulation.md b/templates/validate-simulation.md index 4588e62..5ca3e2a 100644 --- a/templates/validate-simulation.md +++ b/templates/validate-simulation.md @@ -11,6 +11,7 @@ description: > persona: electrical-engineer protocols: - guardrails/anti-hallucination + - guardrails/instruction-fidelity - guardrails/self-verification - analysis/simulation-validation format: investigation-report diff --git a/tests/validate-instruction-fidelity.py b/tests/validate-instruction-fidelity.py new file mode 100644 index 0000000..5274bc6 --- /dev/null +++ b/tests/validate-instruction-fidelity.py @@ -0,0 +1,153 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: MIT +# Copyright (c) PromptKit Contributors + +"""Validate universal instruction-fidelity coverage. + +This script enforces the repository-wide execution contract: + +1. Every template must include `guardrails/instruction-fidelity` in its + YAML frontmatter. +2. Every template entry in `manifest.yaml` must include the short-name + protocol `instruction-fidelity`. +3. Critical assembly / packaging files must retain explicit markers that + preserve instruction-fidelity semantics during bootstrap and output + generation. +""" + +from __future__ import annotations + +import re +import sys +from pathlib import Path + + +def parse_yaml_frontmatter(text: str) -> dict[str, object] | None: + match = re.search(r"^---\s*\n(.*?)\n---", text, re.DOTALL | re.MULTILINE) + if not match: + return None + + block = match.group(1) + protocols: list[str] = [] + in_protocols = False + + for line in block.splitlines(): + stripped = line.strip() + if stripped.startswith("protocols:"): + in_protocols = True + inline = re.search(r"\[(.+)]", stripped) + if inline: + protocols = [p.strip().strip("'\"") for p in inline.group(1).split(",")] + in_protocols = False + continue + if in_protocols: + if stripped.startswith("- "): + protocols.append(stripped[2:].strip().strip("'\"")) + else: + in_protocols = False + + return {"protocols": protocols} + + +def parse_manifest_templates(manifest_text: str) -> dict[str, list[str]]: + templates: dict[str, list[str]] = {} + current_name: str | None = None + + for line in manifest_text.splitlines(): + stripped = line.strip() + name_match = re.match(r"^-\s*name:\s*(.+)", stripped) + if name_match: + current_name = name_match.group(1).strip().strip("'\"") + continue + if current_name and stripped.startswith("path:"): + path_val = stripped.split(":", 1)[1].strip().strip("'\"") + if not path_val.startswith("templates/"): + current_name = None + continue + if current_name and stripped.startswith("protocols:"): + inline = re.search(r"\[(.+)]", stripped) + if inline: + templates[current_name] = [ + p.strip().strip("'\"") for p in inline.group(1).split(",") + ] + current_name = None + + return templates + + +def validate(repo_root: Path) -> list[str]: + errors: list[str] = [] + manifest_path = repo_root / "manifest.yaml" + templates_dir = repo_root / "templates" + + manifest_text = manifest_path.read_text(encoding="utf-8") + manifest_templates = parse_manifest_templates(manifest_text) + + if "name: instruction-fidelity" not in manifest_text: + errors.append("manifest.yaml: guardrails section is missing instruction-fidelity") + + for tmpl_file in sorted(templates_dir.glob("*.md")): + text = tmpl_file.read_text(encoding="utf-8") + fm = parse_yaml_frontmatter(text) + if fm is None: + errors.append(f"{tmpl_file.name}: no YAML frontmatter found") + continue + + protocols = fm["protocols"] + if "guardrails/instruction-fidelity" not in protocols: + errors.append( + f"{tmpl_file.name}: missing guardrails/instruction-fidelity in frontmatter" + ) + + name_match = re.search(r"^name:\s*(.+)", text.split("---")[1], re.MULTILINE) + tmpl_name = name_match.group(1).strip().strip("'\"") if name_match else tmpl_file.stem + + manifest_protocols = manifest_templates.get(tmpl_name) + if manifest_protocols is None: + errors.append(f"{tmpl_name}: missing from manifest.yaml") + continue + if "instruction-fidelity" not in manifest_protocols: + errors.append( + f"{tmpl_name}: manifest protocols missing instruction-fidelity" + ) + + critical_markers = { + "bootstrap.md": [ + "## Instruction Fidelity Contract", + "If the ambiguity would change template selection, output mode,", + ], + "formats/agent-instructions.md": [ + "## Non-Condensable Execution Contract", + "## Instruction Fidelity Contract", + ], + "formats/copilot-prompt-file.md": [ + "Instruction-fidelity content is part of the non-negotiable execution", + "Preserve the `instruction-fidelity` contract verbatim when present.", + ], + } + + for rel_path, markers in critical_markers.items(): + content = (repo_root / rel_path).read_text(encoding="utf-8") + for marker in markers: + if marker not in content: + errors.append(f"{rel_path}: missing marker: {marker}") + + return errors + + +def main() -> int: + repo_root = Path(sys.argv[1]) if len(sys.argv) > 1 else Path(__file__).resolve().parent.parent + errors = validate(repo_root) + + if errors: + print(f"FAIL: instruction-fidelity validation failed ({len(errors)} error(s)):\n") + for err in errors: + print(f" - {err}") + return 1 + + print("OK: instruction-fidelity coverage is present across templates and critical formats.") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) From 34032821ceb7dfdd30f4303aa3ac91451918815a Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Sun, 2 Aug 2026 19:14:07 -0700 Subject: [PATCH 2/2] Fix FAQ numbering in contribution steps Address review feedback on PR #266 by renumbering the final step in docs/faq.md after adding the instruction-fidelity validation step. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Alan Jowett --- docs/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faq.md b/docs/faq.md index 64b1043..4e80fab 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -176,7 +176,7 @@ Separate Markdown files make components independently: 2. Add an entry to `manifest.yaml` 3. Run `python tests/validate-manifest.py` 4. Run `python tests/validate-instruction-fidelity.py` -4. Submit a PR +5. Submit a PR See [Contributing Components](contributing-components.md) for full details.