Skip to content

feat(validate,prompts): align prompts with spec and enforce §19.4 output module#33

Merged
niclaslindstedt merged 1 commit intomainfrom
claude/review-oss-spec-validation-QZTbK
Apr 18, 2026
Merged

feat(validate,prompts): align prompts with spec and enforce §19.4 output module#33
niclaslindstedt merged 1 commit intomainfrom
claude/review-oss-spec-validation-QZTbK

Conversation

@niclaslindstedt
Copy link
Copy Markdown
Owner

Summary

Closes the drift between OSS_SPEC.md (v2.0.2), src/validate.rs, and the prompts/ 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.
  • Embed the full spec via {{ spec }} and target version via {{ spec_version }} so the fix agent no longer has to oss-spec fetch to know the rules.
  • Document the AI-quality-findings block so the fix agent repairs content defects (§3 README, §4 CONTRIBUTING, §6 SECURITY, §9 Makefile recipes, §15 templates) — not just structural violations. The Rust glue was already wired to pass both; only the prompt hadn't caught up.
  • Echo OSS_SPEC.md v{{ spec_version }} in the preambles of verify-conformance/1_0.md and file-conformance-issues/1_0.md too. Version now comes from a new embedded::oss_spec_version() that parses the YAML front matter.

§19.4 central output module

  • New structural check in validate.rs — every repo with a src/ or lib/ source tree must ship a central output module (e.g. src/output.rs, lib/output.ts, src/output/mod.rs, internal/output/output.go).
  • Matching tests in tests/validate_test.rs covering Rust, Node, directory modules, and the "no source tree → skipped" case.
  • Ship output.* templates for templates/rust/, templates/node/, templates/python/ so generated projects satisfy the new rule. The Rust template now re-exports pub mod output; from lib.rs.tmpl.

New update-prompts maintenance skill

  • .agent/skills/update-prompts/SKILL.md (+ .last-updated) so the maintenance umbrella skill catches prompt drift the same way it catches README, docs, manpage, and website drift.
  • Mirror at templates/_common/.agent/skills/update-prompts/SKILL.md.tmpl so every bootstrapped project inherits it.
  • Registered in maintenance/SKILL.md registry (slot 5) and in both the live AGENTS.md maintenance table and the templates/_common/AGENTS.md.tmpl table.

Documentation sync points

  • New rows in the AGENTS.md sync-points table for §10.3 toolchain minimums (the MIN_TOOLCHAIN_VERSIONS constant in validate.rs) and for LLM prompt sources-of-truth (spec text, validator rule, manifest enum, rendering-context key).

Test plan

  • make fmt-check — clean
  • make lint — zero warnings
  • make test — 55/55 pass, including the bootstrap smoke test and the self-conformance test
  • cargo run -- validate --path . --no-ai — repo conforms to OSS_SPEC.md
  • Manual: trigger an AI-findings cycle on a scratch repo (e.g. empty SECURITY.md) to confirm the fix agent now repairs content, not only structure.

https://claude.ai/code/session_01LBykvkEDYA4GmDwMZrYkTY

@niclaslindstedt niclaslindstedt marked this pull request as ready for review April 18, 2026 13:14
@niclaslindstedt niclaslindstedt force-pushed the claude/review-oss-spec-validation-QZTbK branch 2 times, most recently from 13b750b to d404a8f Compare April 18, 2026 13:33
…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.
@niclaslindstedt niclaslindstedt force-pushed the claude/review-oss-spec-validation-QZTbK branch from d404a8f to 2331347 Compare April 18, 2026 13:38
@niclaslindstedt niclaslindstedt merged commit 2b209e4 into main Apr 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants