/sdd:enrich [SPEC-XXXX or spec-name] [--branch-prefix <prefix>] [--dry-run] [--module <name>]from sdd
Retroactively adds branch naming and PR convention sections to existing issue bodies. Useful when a user wants to add developer workflow conventions to existing issues.
Ships in sdd. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Harness portability. This skill runs on any agent harness that loads Agent Skills — Claude Code, Codex CLI, OpenCode, Crush. Tool names used below (
AskUserQuestion,Task,TeamCreate,SendMessage,TaskCreate,ToolSearch,mcp__*,${CLAUDE_PLUGIN_ROOT}) denote capabilities, not hard requirements: map each to your harness's equivalent or use the documented fallback per${CLAUDE_PLUGIN_ROOT}/references/harness-compat.md. References toCLAUDE.mdmean the project memory file (CLAUDE.md,AGENTS.md, orCRUSH.md) per harness-compat § "Project Memory File". A citation of the formshared-patterns.md § "Section"names one##heading in that file — load only that section (see its "How to Read This File" note), never the whole file. Invocation and arguments. Where your harness has no command layer (Crush, Codex CLI, OpenCode) this skill is reached from itsdescription, not a slash command: the/sdd:{name}form below is Claude Code namespacing.$ARGUMENTSmeans whatever arrived with the invocation: take the target and any--flagsfrom the request that triggered this skill, and when neither is present follow this skill's documented no-argument path instead of reporting missing arguments (harness-compat § "Invocation and Arguments").
You are retroactively adding ### Branch and ### PR Convention sections to existing tracker issues that were created by /sdd:plan (or manually) for a given spec. The canonical templates for these sections live in ${CLAUDE_PLUGIN_ROOT}/references/issue-authoring.md § Enrichment Sections (which references shared-patterns.md for the underlying Branch Naming Conventions and PR Close Keywords). This skill is purely additive — it never replaces existing content.
Resolve artifact paths: Follow the Artifact Path Resolution pattern from ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Artifact Path Resolution" to determine the spec directory. If $ARGUMENTS contains --module <name>, resolve paths relative to that module. The resolved spec directory is {spec-dir}.
Parse arguments: Extract from $ARGUMENTS:
SPEC-0007) or capability directory name--branch-prefix <prefix>: Custom branch prefix instead of the default prefixes. Default: feature.--dry-run: Preview what would be added without modifying any issues. Default: off.--module <name>: Resolve artifact paths relative to the named module. Default: none.If no spec identifier is provided, list available specs by globbing {spec-dir}/*/spec.md, read the title from each, and use AskUserQuestion to ask which spec to enrich.
Resolve spec: Follow the plugin's ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Spec Resolution" (which uses {spec-dir} from the Artifact Path Resolution pattern).
Read spec: Read {spec-dir}/{capability-name}/spec.md to get the spec number and understand the requirements. Validate spec pairing per ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Spec Pairing Validation".
Detect tracker: Follow the "Tracker Detection" flow in the plugin's ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Tracker Detection". If no tracker is found, error — enrichment requires a tracker.
Read branch/PR config from CLAUDE.md: Follow the "Config Resolution" pattern in the plugin's ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Config Resolution". Read the ### SDD Configuration section from CLAUDE.md, specifically the #### Branch Conventions and #### PR Conventions subsections:
#### Branch Conventions
- **Enabled**: true
- **Prefix**: feature
- **Epic Prefix**: epic
- **Slug Max Length**: 50
#### PR Conventions
- **Enabled**: true
- **Close Keyword**: Closes
- **Ref Keyword**: Part of
- **Include Spec Reference**: true
Enabled under Branch Conventions is false, skip ### Branch sections entirelyEnabled under PR Conventions is false, skip ### PR Convention sections entirelyPrefix from Branch Conventions as the default task prefix (overridden by --branch-prefix)Epic Prefix from Branch Conventions for epic issues (default: epic)Slug Max Length from Branch Conventions for slug truncation (default: 50)Close Keyword from PR Conventions if set; otherwise use tracker-specific defaultsRef Keyword from PR Conventions for epic/spec references (default: "Part of")Find existing issues: Search the tracker for issues referencing the spec number.
gh issue list --search "SPEC-XXXX" --json number,title,body,labels --limit 100tea api --login {login} 'repos/{owner}/{repo}/issues?q=SPEC-XXXX&type=issues&state=all&limit=50' (see ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Gitea Access")glab issue list -R {owner}/{repo} --search "SPEC-XXXX" --all --output json --per-page 100 (see ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "GitLab Access"). Write the enriched body back with glab issue update {n} -R {owner}/{repo} --description-file {file} — a file, not --description, so a multi-line body survives the shell.bd list or similar to find tasks referencing the specFor each issue:
a. Read the current issue body (via tracker API or CLI).
b. Check if a ### Branch section already exists in the body. If yes, skip adding it (idempotent).
c. Check if a ### PR Convention section already exists in the body. If yes, skip adding it (idempotent).
d. Determine the slug from the issue title:
Slug Max Length from CLAUDE.md Branch Conventions)e. Determine if the issue is an epic:
epic label → epicf. If ### Branch section is missing and branches.enabled is not false, append:
### Branch
`{prefix}/{issue-number}-{slug}`
Where {prefix} is:
epic (or CLAUDE.md Branch Conventions > Epic Prefix or --branch-prefix)feature (or CLAUDE.md Branch Conventions > Prefix or --branch-prefix)g. If ### PR Convention section is missing and pr_conventions.enabled is not false, append:
### PR Convention
{close-keyword} #{issue-number}
{ref-keyword} #{epic-number} (SPEC-XXXX)
Tracker-specific close keywords: see the plugin's ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "PR Close Keywords".
Split-host: when the tracker's host differs from the code host's git remote (see that section's "Split-Host"), the first line is Tracker: {tracker-owner}/{tracker-repo}#{issue-number} instead of the close keyword — a bare keyword would resolve against the code host's own numbering on merge.
h. Auto-create labels (Governing: SPEC-0011 REQ "Auto-Create Labels"): When applying labels like epic or story during enrichment, use the try-then-create pattern (see ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Try-Then-Create Label Pattern").
h1. Size label: If the issue has no size/* label (and #### Sizing > Enabled is not false), add exactly one per ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Size Labels". Never change a size that is already set — enrichment is additive; re-sizing is /sdd:triage's job. Show the proposed size in --dry-run output.
i. Update the issue body with the appended sections using the tracker API or CLI.
--dry-run mode: If --dry-run is set, show what sections would be added to which issues but don't modify anything:
Report results: Provide a summary:
### Branch, how many got ### PR ConventionBefore iterating issues, sync the {repo}-issues qmd collection from the tracker so the local cache reflects current issue state. This is Tier 4 of the freshness model: always sync at consumer entry, subject to a 5-minute deduplication window.
.sdd/issues/_meta.json (per ${CLAUDE_PLUGIN_ROOT}/references/tracker-sync.md § "Cursor Management"). If last_sync is within the last 5 minutes, skip the sync and proceed silently.${CLAUDE_PLUGIN_ROOT}/references/tracker-sync.md § "Per-Tracker Sync" with the cursor.{tracker} from _meta.json for incremental fetch. Print a one-line note: "Syncing N issues from {tracker}…".${CLAUDE_PLUGIN_ROOT}/references/tracker-sync.md § "Failure Modes and Degradation" — emit a one-line warning and proceed with live tracker queries (the pre-v5 path) for this run. Do NOT block; enrichment is the user's primary intent.After all issue body updates complete (step 7.i), trigger a narrow re-sync of the {repo}-issues collection so the qmd index reflects the appended ### Branch and ### PR Convention sections. Use the canonical update pattern from ${CLAUDE_PLUGIN_ROOT}/references/qmd-helpers.md § "Update Patterns" → "Narrow update".
qmd update per the qmd-helpers pattern.{repo}-issues — run /sdd:index update manually") but report the enrichment itself as successful.This skill reads the Branch Conventions and PR Conventions subsections of the ### SDD Configuration section in CLAUDE.md. See the plugin's ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Config Resolution" for the canonical format and defaults, and § "Branch Naming Conventions" and "PR Close Keywords" for conventions.
### Branch or ### PR Convention sections (idempotent)ToolSearch); where it cannot, assume them absent and take the tracker CLI path (gh / glab / tea) (harness-compat § Capability Map)${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Config Resolution" to read configuration from CLAUDE.md${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Try-Then-Create Label Pattern") for all label applications — never fail on missing labels (Governing: SPEC-0011 REQ "Auto-Create Labels")--review support (utility skill).sdd/issues/ before iterating issues, subject to the 5-minute dedup window. On sync failure, fall back to live tracker queries with a one-line warning (NEVER block) (Governing: ADR-0026, SPEC-0019 REQ "Tier 4 Always-Sync Issues for Sprint Skills"){repo}-issues after enrichment per Step 10 — best-effort, silent on success, one-line warning on failure (Governing: ADR-0026, SPEC-0019 REQ "Tier 1 Mutation-Aware Updates")size/* label to any processed issue that lacks one, per ${CLAUDE_PLUGIN_ROOT}/references/shared-patterns.md § "Size Labels", and MUST NOT change an existing sizeWhat SKILL.md sets; muted values are Claude Code's defaults
22 skills in this plugin
/adrCreate a new Architecture Decision Record (ADR) using MADR format. Use when the user wants to document an architectural decision, says "create an ADR", "we need an ADR for", or discusses a decision that should be recorded./auditComprehensive audit of design artifact alignment across the project. Use when the user says "audit the architecture", "full drift report", or wants a thorough review of spec compliance and ADR adherence./checkQuick-check code against ADRs and specs for drift. Use when the user says "check for drift", "does this match the spec", or wants a fast alignment check on a specific file or directory./discoverDiscover implicit architectural decisions and spec-worthy subsystems in an existing codebase. Use when the user says "discover architecture", "what decisions exist in this code", "bootstrap ADRs", or wants to reverse-engineer design artifacts from code./docsGenerate a documentation site from your ADRs and specs. Use when the user says "generate docs", "create a docs site", or wants to publish their architecture decisions./graphBuild and query the SDD artifact graph. Use when the user wants to validate frontmatter edges, find impact/ancestors/chain for an ADR or spec, detect orphans or cycles, or backfill edges from prose. Currently supports validate / impact / ancestors / chain / orphans / cycles, with workspace-mode aggregation; backfill lands in Story 7.npx claudepluginhub joestump/claude-plugin-sdd --plugin sddOther plugins' skills for the same job