Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

spec-linked-docs

БесплатноБез исполняемых скриптовНе проверен

Spec-Linked Documentation (SLD): Language-agnostic discipline for maintaining bidirectional traceability between functional specifications and source-code…

bobmatnycот 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:

  1. Docstring as the annotation site — OFT, StrictDoc, and Doorstop all use code comments. SLD places the reference in Python docstrings (References: SPEC-ID in a NumpyDoc References section), making it visible to autodoc, IDEs, and type checkers.
  2. Zero new runtime dependencies — CI check uses only re, pathlib, and ast (stdlib). OFT requires Java 17; StrictDoc requires its own installation.
  3. 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-01 appears in a docstring; a matching spec section exists in docs/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):

  1. 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.
  2. Design spec IDs to be semantically descriptive (SPEC-HOOKS-PRETOOLUSE-DISPATCH is better than SPEC-001) so that an obviously wrong reference jumps out during review.
  3. 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
Полный SKILL.md на GitHub

Установить spec-linked-docs в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

reference/backfill-workflow.mdreference/documentation-workflow.mdreference/engineer-workflow.mdreference/prior-art-lineage.mdreference/wwl-granularity.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить spec-linked-docs с