feat(validate,prompts): align prompts with spec and enforce §19.4 output module#33
Merged
niclaslindstedt merged 1 commit intomainfrom Apr 18, 2026
Merged
Conversation
13b750b to
d404a8f
Compare
…er + §19.4 output module
## Prompt versioning (§13.5 rewrite, spec v2.0.2 → v2.1.0)
- Rename every prompt from `X_Y.md` to `X_Y_Z.md` (semver). Add required
YAML front matter (`name`, `description`, `version`) to every file.
- Spec now mandates: prompts are immutable once committed. Every change
lands as a new `X_Y_Z.md` file — patch for wording, minor for new
placeholders / scope, major for breaking rewrites. Loaders strip the
front matter before passing the prompt to the model (it is metadata).
- `src/prompts.rs::parse_version` returns `(major, minor, patch)` and
`src/prompts.rs::strip_front_matter` is now wired into `load()`.
- `src/validate.rs` updated to accept the new stem pattern.
## Prompt alignment with OSS_SPEC.md
Instead of editing in place, ship the corrected content as new versions:
- `prompts/fix-conformance/1_1_0.md` — fixes the "§21 checklist"
mis-label (§21 is agent skills; the agent must own §1–§22), embeds
the full spec via `{{ spec }}`, echoes `{{ spec_version }}`, and
documents the AI-findings block so the fix agent repairs content
defects (§3 README, §4 CONTRIBUTING, §6 SECURITY, §9 Makefile,
§15 templates), not just structure.
- `prompts/verify-conformance/1_0_1.md` — adds spec-version preamble.
- `prompts/file-conformance-issues/1_0_1.md` — adds spec-version preamble.
`src/embedded::oss_spec_version()` parses the version field from the
embedded spec's front matter.
## §19.4 central output module
- New structural check in `validate.rs` with 5 tests.
- Ship `output.*` templates for rust / node / python so generated
projects satisfy the new rule; Rust's `lib.rs.tmpl` re-exports
`pub mod output;`.
## `update-prompts` maintenance skill
- New `.agent/skills/update-prompts/` (+ template) so the maintenance
sweep catches prompt drift. Registered in the maintenance registry
(slot 5) and in both AGENTS.md maintenance tables. Skill body
emphasises the "never edit an existing version" rule.
## AGENTS.md sync points
- Merge §10.3 row into main's §10.5 toolchain-pin row (supersedes).
- New row for LLM-prompt sources of truth pointing at the semver /
never-edit rule in §13.5.
d404a8f to
2331347
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the drift between
OSS_SPEC.md(v2.0.2),src/validate.rs, and theprompts/tree surfaced by a full alignment review. Six changes, one PR, all green.Prompt alignment
prompts/fix-conformance/1_0.md: correct the "§21 checklist" mis-label (§21 is agent skills, not the overall checklist) and scope the agent's job to §1–§22.{{ spec }}and target version via{{ spec_version }}so the fix agent no longer has tooss-spec fetchto know the rules.OSS_SPEC.md v{{ spec_version }}in the preambles ofverify-conformance/1_0.mdandfile-conformance-issues/1_0.mdtoo. Version now comes from a newembedded::oss_spec_version()that parses the YAML front matter.§19.4 central output module
validate.rs— every repo with asrc/orlib/source tree must ship a central output module (e.g.src/output.rs,lib/output.ts,src/output/mod.rs,internal/output/output.go).tests/validate_test.rscovering Rust, Node, directory modules, and the "no source tree → skipped" case.output.*templates fortemplates/rust/,templates/node/,templates/python/so generated projects satisfy the new rule. The Rust template now re-exportspub mod output;fromlib.rs.tmpl.New
update-promptsmaintenance skill.agent/skills/update-prompts/SKILL.md(+.last-updated) so themaintenanceumbrella skill catches prompt drift the same way it catches README, docs, manpage, and website drift.templates/_common/.agent/skills/update-prompts/SKILL.md.tmplso every bootstrapped project inherits it.maintenance/SKILL.mdregistry (slot 5) and in both the liveAGENTS.mdmaintenance table and thetemplates/_common/AGENTS.md.tmpltable.Documentation sync points
AGENTS.mdsync-points table for §10.3 toolchain minimums (theMIN_TOOLCHAIN_VERSIONSconstant invalidate.rs) and for LLM prompt sources-of-truth (spec text, validator rule, manifest enum, rendering-context key).Test plan
make fmt-check— cleanmake lint— zero warningsmake test— 55/55 pass, including the bootstrap smoke test and the self-conformance testcargo run -- validate --path . --no-ai— repo conforms to OSS_SPEC.mdhttps://claude.ai/code/session_01LBykvkEDYA4GmDwMZrYkTY