spec-linked-docs
БесплатноБез исполняемых скриптовНе проверенSpec-Linked Documentation (SLD): Language-agnostic discipline for maintaining bidirectional traceability between functional specifications and source-code…
от bobmatnyc★ 160 звёзд на GitHubОб этом скилле
Spec-Linked Documentation (SLD)
Overview
Spec-Linked Documentation (SLD) is a language-agnostic documentation discipline for maintaining bidirectional traceability between functional specifications and source-code docstrings. It is an optional, opt-in convention that projects adopt when they prioritize live, verified specification-to-code linkage.
Core premise: The manual cost of maintaining Requirements Traceability Matrices (RTMs) historically blocked traceability adoption outside regulated industries (80% of practitioners cite cost as the barrier). AI coding agents now make link maintenance atomic and cost-free: when an agent writes or modifies code, it updates the spec ID reference in the docstring as the same action. This removes the friction that historically made RTMs unmaintainable in fast-moving teams.
SLD is not novel. It is a Python-idiomatic, lightweight instantiation of the bidirectional traceability discipline formalized in OpenFastTrace and mandated by regulated industries (DO-178C aviation, ISO 26262 automotive, IEC 62304 medical). The genuine innovation here is placing spec ID references in docstrings (first-class language objects, visible to help(), IDEs, type checkers) rather than in comments, and using zero-dependency pytest rather than external tools.
⚠️ Critical Upfront Disclosures
On Honesty About Prior Art
SLD is not your team's invention. The core idea — stable spec IDs, code annotations, CI bidirectional validation — dates to:
- OpenFastTrace (OFT): 2017–present; production-ready; implements the exact four-status model (COVERED / UNCOVERED / ORPHANED / OUTDATED)
- Doorstop: 2012–present; text-based RTM with Git storage
- StrictDoc: 2018–present; Python-native requirements management with traceability
- Regulated industries: DO-178C (aviation), ISO 26262 (automotive), IEC 62304 (medical) mandate bidirectional RTMs since the 1980s–1990s
What is distinctive about this instantiation:
- Docstring as the annotation site — OFT, StrictDoc, and Doorstop all use code comments. SLD places the reference in Python docstrings (
References: SPEC-IDin a NumpyDocReferencessection), making it visible to autodoc, IDEs, and type checkers. - Zero new runtime dependencies — CI check uses only
re,pathlib, andast(stdlib). OFT requires Java 17; StrictDoc requires its own installation. - Explicit WHAT/WHY/HOW separation as a prose rule — OFT et al. are mechanical enforcement tools; SLD adds a documentation discipline (specs = WHAT + WHY; code = HOW).
You are not pioneering traceability. You are adapting a decades-old discipline to a modern Python workflow, with AI agents as the maintainers. This is good engineering, not invention. Claim it honestly.
On the False-Confidence Risk
The CI check validates that links exist, not that they are correct. Specifically:
- What it checks: The string
SPEC-HOOKS-01appears in a docstring; a matching spec section exists indocs/specs/hooks.md. - What it does NOT check: The function actually implements the requirement named in the spec section.
If an AI coding agent, under time pressure or in a degraded context window, writes References: SPEC-HOOKS-01 under the wrong function (or copies a reference from another function without updating), the CI check passes. The link looks correct. The human reader later inspects the trace and sees coverage — but the coverage is a lie.
Published research on LLM trace link generation (TraceLLM, 2026, Springer Nature): Precision ~0.52 in zero-shot settings; ~0.61 F2-score with few-shot improvement. Roughly half of AI-generated trace links are incorrect.
Mitigation (necessary, not sufficient):
- Pair the CI check with a PR review checklist item: "Verify that spec references in changed docstrings point to the correct spec sections." The check is syntactic; humans provide semantic verification.
- Design spec IDs to be semantically descriptive (
SPEC-HOOKS-PRETOOLUSE-DISPATCHis better thanSPEC-001) so that an obviously wrong reference jumps out during review. - Treat SLD as a first-level verification layer (mechanical link presence), not a substitute for code review (semantic correctness).
This risk exists. It is manageable. It must be disclosed to every engineer and documentation agent who uses this skill.
1. The Convention (SLD v1)
1.1 Specification Files
Location: One spec file per subsystem at docs/specs/{subsystem}.md.
Structure of each spec file:
# {Subsystem Name} Specification
**Status:** Active | Draft | Superseded
**Last reviewed:** YYYY-MM-DD
**Supersedes:** (link to previous spec if applicable)
## Overview
One paragraph: what this subsystem does, why it exists.
---
## {Section Title} {#SPEC-{SUBSYSTEM}-{NN}}
**ID:** SPEC-{SUBSYSTEM}-{NN}~v1
**Status:** Active
Установить spec-linked-docs в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл spec-linked-docs?
Spec-Linked Documentation (SLD): Language-agnostic discipline for maintaining bidirectional traceability between functional specifications and source-code docstrings via stable identifiers and CI validation. Optional/opt-in adoption. Builds on OpenFastTrace and DO-178C Requirements Traceability Matrix traditions.
Как установить скилл spec-linked-docs?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spec-linked-docs запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic