Skip to main content
ClaudeWave
Skill1.3k estrellas del repoactualizado today

tasks

The spec-kitty-spdd-reasons skill drives REASONS Canvas authoring and review for Spec Kitty missions that have opted into Structured-Prompt-Driven Development through charter selection. Use this skill when implementing missions that activated SPDD via charter to generate or update reasons-canvas.md, load mission context from multiple artifact sources, compile per-work-package REASONS summaries, and compare implementation against canvases in review mode. The skill explicitly prevents misuse by warning against treating REASONS as a complete system mirror and escalating rather than silently enforcing when charters have not selected SPDD.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/Priivacy-ai/spec-kitty /tmp/tasks && cp -r /tmp/tasks/kitty-specs/spdd-reasons-doctrine-pack-01KQC4AX/tasks/WP03-spdd-reasons- ~/.claude/skills/tasks
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

WP03-spdd-reasons-skill.md

## ⚡ Do This First: Load Agent Profile

- Run `/ad-hoc-profile-load` with profile `curator-carla` and role `implementer`.
- Profile file: `src/doctrine/agent_profiles/shipped/curator-carla.agent.yaml`.
- After load, restate identity, governance scope, and boundaries before continuing.

# WP03 — `spec-kitty-spdd-reasons` Skill

## Branch Strategy

- **Planning base branch**: `doctrine/spdd-reasons-pack`
- **Merge target**: `doctrine/spdd-reasons-pack`
- **Execution workspace**: allocated by `lanes.json` at `spec-kitty agent action implement WP03 --agent claude --mission spdd-reasons-doctrine-pack-01KQC4AX`. Do not guess the worktree path.

## Objective

Author the agent-facing skill that drives REASONS Canvas authoring and review for missions that opted in to SPDD via charter (FR-010, FR-011, FR-012).

The skill must:
- Detect activation status (call `is_spdd_reasons_active(repo_root)` from WP02 conceptually; the SKILL.md instructs the agent how to use it).
- Load mission context: `spec.md`, `plan.md`, `tasks.md`, WP prompts, charter context, glossary, research, contracts, and relevant code.
- Generate or update `kitty-specs/<mission>/reasons-canvas.md`.
- Compile per-WP REASONS summaries when useful.
- In review mode, compare implementation against the canvas and classify divergences.

The skill must explicitly warn:
- Do NOT use REASONS as a complete system mirror.
- Do NOT overwrite user-authored mission artifacts.
- Escalate (do not silently enforce) if the charter has not selected SPDD/REASONS but the user demands enforcement.

## Context

### Reference skill (mirror this shape exactly)
- `src/doctrine/skills/spec-kitty-charter-doctrine/SKILL.md`

Read it first. Match the YAML frontmatter shape, body section ordering, and "Does NOT handle" framing.

### Spec references
- FR-010, FR-011, FR-012 — see [spec.md](../spec.md).
- [data-model.md §Skill](../data-model.md) — body content.

### Trigger phrases (per FR-010)
- "use SPDD"
- "use REASONS"
- "generate a REASONS canvas"
- "apply structured prompt driven development"
- "make this mission SPDD"

## Subtasks

### T012 — Author `src/doctrine/skills/spec-kitty-spdd-reasons/SKILL.md`

**Path**: `src/doctrine/skills/spec-kitty-spdd-reasons/SKILL.md`

Frontmatter:
```yaml
---
name: spec-kitty-spdd-reasons
description: |
  Drive REASONS Canvas authoring and review for Spec Kitty missions that opted in to
  Structured-Prompt-Driven Development (SPDD) via charter selection.
  Triggers: "use SPDD", "use REASONS", "generate a REASONS canvas",
  "apply structured prompt driven development", "make this mission SPDD".
  Does NOT handle: enforcing SPDD on projects whose charter has not selected the
  doctrine pack (escalate to charter workflow instead). Does NOT mirror code as
  prose; code remains the source of truth for current behavior.
---
```

Body sections (mirror `spec-kitty-charter-doctrine`):

1. **Title** — `# spec-kitty-spdd-reasons`
2. **What this skill does** — bullets for activation detection, context loading, canvas generation/update, WP summary compilation, review-mode comparison.
3. **What this skill does NOT do** — bullets for mirror-the-code, overwrite-without-merge, silent-enforce.
4. **Activation rules**:
   - If active (charter selected SPDD/REASONS): proceed with canvas authoring or review using the seven-section template at `src/doctrine/templates/fragments/reasons-canvas-template.md`.
   - If inactive and user requests ad-hoc canvas generation: proceed but add a "not formally opted in" note to the canvas header.
   - If inactive and user demands enforcement: escalate; suggest running the charter interview to select the doctrine pack.
5. **How to detect activation** — explain that the skill should look at `.kittify/charter/governance.yaml` for paradigm `structured-prompt-driven-development` or related tactics/directive, or call any equivalent tooling exposed by the host.
6. **How to author the canvas** — instruct the agent to:
   - Read mission artifacts (spec, plan, tasks, contracts, research).
   - Map content to the seven sections (Requirements, Entities, Approach, Structure, Operations, Norms, Safeguards).
   - Use links to source artifacts rather than duplicating spec/plan content.
   - Preserve user-authored content; merge rather than overwrite.
   - Append (never rewrite) the Deviations section.
7. **How to review with the canvas** — instruct the reviewer to trace diff to Requirements/Operations, detect uninvented entities/files, verify Norms and Safeguards, and classify divergences per the taxonomy in [data-model.md §Drift classification](../data-model.md).
8. **Charter precedence** — directives from the charter take precedence over canvas content.
9. **Glossary discipline** — when canvas authoring surfaces a term conflict, escalate to the glossary skill.

Aim for ≤200 lines. Concise, agent-friendly Markdown.

### T013 — Add skill discovery test

**Path**: `tests/doctrine/test_spdd_reasons_skill.py`

Test (≤40 lines):

```python
def test_skill_file_exists():
    path = Path("src/doctrine/skills/spec-kitty-spdd-reasons/SKILL.md")
    assert path.exists(), "spec-kitty-spdd-reasons/SKILL.md missing"

def test_skill_frontmatter_has_name_and_description():
    # parse YAML frontmatter; assert name == "spec-kitty-spdd-reasons"
    # and description contains the FR-010 trigger phrases.
    ...

def test_skill_body_mentions_seven_canvas_sections():
    text = path.read_text()
    for section in ("Requirements", "Entities", "Approach", "Structure",
                    "Operations", "Norms", "Safeguards"):
        assert section in text
```

## Definition of Done

- SKILL.md present, schema-correct YAML frontmatter, ≤200 lines body.
- Body mentions all seven canvas sections, all five trigger phrases, the three "does NOT" rules, and the escalation rule.
- New skill discovery test passes.
- `uv run pytest tests/doctrine -q` passes.

## Reviewer guidance

- Check that the skill mirrors the shape of `spec-kitty-charter-doctrine/SK