Command Palette

Search for a command to run...

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

document-linking

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

Unified ID system for PRDs, ADRs, PRPs, and GitHub issues with bidirectional links. Use when linking docs, finding orphans, auto-assigning IDs, or validating…

laurigatesот laurigates★ 61 звезда на GitHub

Об этом скилле

Document Linking

Provides a unified ID system connecting PRDs, ADRs, PRPs, work-orders, GitHub issues, commits, and PRs. IDs are project-scoped, auto-generated on first access, and maintained bidirectionally.

When to Use This Skill

Use this skill when... Use blueprint-sync-ids instead when...
You need bidirectional links between PRD/ADR/PRP/issue at runtime You're doing a one-shot bulk ID assignment for docs missing IDs
You're auto-assigning an ID on first document access You want a --dry-run preview of bulk ID changes
You want to validate broken cross-document references Use blueprint-adr-validate instead for ADR-only relationship checks
You need to find orphan docs/issues across the project Use document-detection instead when capturing a brand-new doc

ID Format

Document Type Format Example Notes
PRD PRD-NNN PRD-001 3-digit, zero-padded
ADR ADR-NNNN ADR-0003 4-digit (matches existing convention)
PRP PRP-NNN PRP-007 3-digit, zero-padded
Work-Order WO-NNN WO-042 3-digit, matches work-order number

Frontmatter Schema

All blueprint documents should include these fields:

---
id: PRD-001                    # Unique identifier (auto-generated if missing)
relates-to:                    # Cross-document references (optional)
  - ADR-0003
  - PRP-002
github-issues:                 # Linked GitHub issues (optional)
  - 42
  - 87
implements:                    # For PRPs: source PRD (optional)
  - PRD-001
# ... existing fields (created, modified, status, etc.)
---

ID Registry (manifest.json)

IDs are tracked in docs/blueprint/manifest.json:

{
  "id_registry": {
    "last_prd": 3,
    "last_prp": 7,
    "documents": {
      "PRD-001": {
        "path": "docs/prds/user-authentication.md",
        "github_issues": [42, 87],
        "title": "User Authentication"
      },
      "ADR-0003": {
        "path": "docs/adrs/0003-database-choice.md",
        "github_issues": [],
        "title": "Database Choice"
      },
      "PRP-002": {
        "path": "docs/prps/oauth-integration.md",
        "github_issues": [45],
        "implements": ["PRD-001"],
        "title": "OAuth Integration"
      }
    },
    "github_issues": {
      "42": ["PRD-001", "PRP-002"],
      "45": ["PRP-002"],
      "87": ["PRD-001"]
    }
  }
}

Auto-ID Generation

When Triggered

IDs are automatically generated when:

  1. Creating documents - /blueprint:derive-plans, /blueprint:prp-create
  2. Accessing documents without IDs - Any command reading PRD/ADR/PRP files
  3. Batch sync - /blueprint:sync-ids assigns IDs to all documents

Generation Algorithm

PRD, PRP and TRP ids come from one helper: max(id_registry.last_<kind>, highest id of that kind on disk) + 1. The counter alone can hand out an id a pulled or merged document already carries, because such a document may reach neither the write-time hook nor the session-start sweep first.

# Next PRD / PRP / TRP id, e.g. PRD-004
bash "${CLAUDE_SKILL_DIR}/../../scripts/blueprint-next-id.sh" --kind PRD
bash "${CLAUDE_SKILL_DIR}/../../scripts/blueprint-next-id.sh" --kind PRP
bash "${CLAUDE_SKILL_DIR}/../../scripts/blueprint-next-id.sh" --kind TRP

# ADR IDs use existing 4-digit number from filename
get_adr_id() {
  local filename="$1"
  local num=$(basename "$filename" | grep -oE '^[0-9]{4}')
  printf "ADR-%s" "$num"
}

Auto-Assignment on Access

When reading a document without an ID:

  1. Check frontmatter for existing id field
  2. If missing: Generate next available ID
  3. Update document frontmatter with new ID
  4. Update manifest ID registry
  5. Continue with original operation
# Check if document has ID
ensure_document_id() {
  local file="$1"
  local type="$2"  # PRD, ADR, PRP

  # Extract existing ID from frontmatter
  local existing_id=$(head -50 "$file" | grep -m1 "^id:" | sed 's/^id::space:*//')

  if [ -z "$existing_id" ]; then
    # Generate and assign new ID
    case "$type" in
      # Run as its own command (a $(…) capture voids the script's grant):
      #   bash "${CLAUDE_SKILL_DIR}/../../scripts/blueprint-next-id.sh" --kind PRD
      # then use the ID it prints as new_id.
      PRD|PRP) new_id="<ID printed by blueprint-next-id.sh>" ;;
      ADR) new_id=$(get_adr_id "$file") ;;
    esac

    # Insert ID into frontmatter (after first ---)
    # Update manifest registry
    # Return new ID
  fi

  echo "${existing_id:-$new_id}"
}

GitHub Integration

Issue Title Format

When creating GitHub issues from documents:

[PRD-001] User authentication feature
[PRP-002] Implement OAuth integration
[WO-042] Add JWT token generation

Issue Body Format

## Related Documents
- PRD-001: User Authentication
- ADR-0003: Database Choice

## Traceability
- **Implements**: PRD-001
- **Related ADRs**: ADR-00
Полный SKILL.md на GitHub

Установить document-linking в Claude Code и Claude Desktop

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

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

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

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

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

Read
Write
Edit
Grep
Glob
Bash(bash ${CLAUDE_SKILL_DIR}/../../scripts/blueprint-next-id.sh *)
Bash(jq *)
Bash(gh issue list *)
Bash(gh issue view *)
Bash(grep *)
Bash(printf *)
TodoWrite

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

references/orphan-and-duplicate-detection.mdreferences/traceability-queries.md

FAQ

Что делает скилл document-linking?

Unified ID system for PRDs, ADRs, PRPs, and GitHub issues with bidirectional links. Use when linking docs, finding orphans, auto-assigning IDs, or validating cross-doc references.

Как установить скилл document-linking?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл document-linking запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить document-linking с