anchored-peripheral-spec

Generate source-anchored peripheral driver specs with file:line citations verified against pinned commits.

2|Updated May 13, 2026
One-click install
npx skills add https://github.com/curtisgalloway/public-skills --skill anchored-peripheral-spec-curtisgalloway
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: anchored-peripheral-spec
Source: https://github.com/curtisgalloway/public-skills/tree/main/plugins/driver-porting/skills/anchored-peripheral-spec
Command: npx skills add https://github.com/curtisgalloway/public-skills --skill anchored-peripheral-spec-curtisgalloway

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Driver specs written from source code quickly become unverifiable: nobody can check whether a claim matches the code, and the spec silently goes stale when the code moves. This Skill produces implementation specs where every source-derived fact carries a file:line anchor at a pinned commit, so reviewers can check the spec against the tree and drift is mechanically detectable. ## Core Features & Use Cases - Anchored spec authoring: Defines an anchor grammar ([src:], [tgt:], [doc:]) plus hardware-vs-driver labels ([hw-required], [driver-choice], [as-implemented]) and a required 12-section spec structure covering register maps, init sequences, interrupts, DMA, and target-OS integration. - Mechanical verification: Ships anchor_check.py to resolve anchors at the pinned commit, render claim-by-claim review sheets, and detect or rewrite drift when the pin moves; inventory_check.py cross-checks the spec against register headers and device-tree nodes for omissions, value mismatches, and contradictions. - Orchestrated workflow: Provides fill-in templates for fan-out spec-drafting subagents and an independent verifier subagent that re-derives claims blind and recomputes counts and negative claims. - Use Case: You own a 2,400-line Ethernet MAC driver and need a spec another engineer can implement from. The Skill fans out investigators over the source, drafts a spec where every register offset and init step cites its defining lines, then verifies it mechanically and with an independent reviewer before landing it in docs/. ## Quick Start Ask the agent to produce a source-anchored implementation spec for a peripheral from your driver source tree, pinned at a specific commit, using the anchored-peripheral-spec skill.

Frequently Asked Questions about anchored-peripheral-spec

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a driver spec that stays verifiable against the source code?▼

Anchor every source-derived fact with a [src: path:L1-L2 (symbol)] tag at a pinned commit, then run anchor_check.py to resolve each anchor against the tree. When the code moves, anchor_check.py --drift reports which anchors moved, changed, or vanished.

When should I use anchored-peripheral-spec instead of cleanroom-spec?▼

Use anchored-peripheral-spec only when the source license permits deriving from it: your own tree, your organization's, or a compatibly licensed one. For encumbered source such as GPL, NDA, or third-party code, use cleanroom-spec, which enforces a wall this skill deliberately lacks.

How do I check a driver spec for missing registers or wrong values?▼

Run inventory_check.py with the spec, the source repo, and the register headers. It extracts every #define, bit-field, and enum from the headers at the pin and reports names the spec omits, values that mismatch the header, and names the spec pairs with two different values.

Does the anchor checker work with device-tree information?▼

Yes. inventory_check.py accepts --dt and --dt-node to inventory a device-tree node's compatible strings, *-names entries, GIC SPI numbers, reg base addresses, phandles, and boolean properties, reporting each one the spec never mentions.

What happens to spec anchors when the source code changes?▼

Run anchor_check.py --drift <new-rev> before re-pinning. Anchors whose cited text merely moved get updated line numbers with --rewrite; anchors whose text changed gain a [stale:] marker that fails every later check until a person re-verifies the claim.

What are the limitations of source-anchored specs?▼

A [src:] anchor proves what the driver does, not what the silicon requires, so claims need labels like [hw-required] or [as-implemented] and datasheet [doc:] citations. Also, anchors written for lines the author never read are a fabrication the checker cannot catch.