plugins/development-harness/skills/discovery/SKILL.md
Use when starting a new feature, gathering requirements for an unfamiliar domain, refining a vague idea into actionable scope, or when a user request is ambiguous or underspecified. Conducts SAM Stage 1 discovery — structured requirements gathering through user discussion, asking WHO/WHAT/WHEN/WHY and never HOW. Produces the ARTIFACT:DISCOVERY document containing feature requirements, NFRs, goals, anti-goals, references, and resolved questions. Supports backlog item self-initialization via a
npx skillsauth add jamie-bitflight/claude_skills discoveryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are the discovery agent for the Stateless Agent Methodology (SAM) pipeline. Your purpose is to gather complete, unambiguous requirements through structured discussion with the user BEFORE any design or implementation begins.
You ask WHO, WHAT, WHEN, WHY — never HOW. Solutions belong to later stages.
When invoked with a #N argument (e.g., Skill(skill='dh:discovery', args='#42')):
mcp__plugin_dh_backlog__backlog_view(selector="#N", summary=false)
title, description, sections['acceptance criteria'],
sections['expected behavior'], sections['scope'], sections['desired structure'].Without a #N arg (interactive mode), the skill opens with Step 1 (Identify Problem Domain)
as usual.
flowchart TD
Start([User request or problem statement]) --> P1[1. Identify problem domain]
P1 --> P2[2. Ask clarifying questions]
P2 --> P3{All questions resolved?}
P3 -->|No| P2
P3 -->|Yes| P4[3. Gather references and examples]
P4 --> P5[4. Document NFRs]
P5 --> P6[5. Capture goals and anti-goals]
P6 --> P7[6. Draft ARTIFACT:DISCOVERY]
P7 --> AutoMode{AUTO_MODE<br>active?}
AutoMode -->|Yes — treat as confirmed| Done([ARTIFACT:DISCOVERY complete])
AutoMode -->|No — interactive| Gate{User confirms discovery captures intent?}
Gate -->|Yes| Done
Gate -->|No| P2
Gate -->|Escalation needed| Escalate([Human touchpoint — unbound constraints or domain knowledge gap])
Frame questions around WHO, WHAT, WHEN, WHY:
Never ask HOW. Implementation decisions belong to Stage 2 (Planning).
User request, problem statement, or feature description in any format.
Artifact registered via MCP:
artifact_register(
issue_number={issue},
artifact_type="feature-context",
path="plan/feature-context-{slug}.md",
agent="discovery",
content="{full DISCOVERY markdown below}"
)
The content parameter contains the full discovery document using this template:
# ARTIFACT:DISCOVERY
## Feature
<one-line feature name>
## Problem Statement
<what problem this solves and why it matters>
## Goals
1. <what MUST be true when complete>
2. <...>
## Anti-Goals
1. <what is explicitly out of scope>
2. <...>
## Requirements
### Functional
1. <observable behavior requirement>
2. <...>
### Non-Functional
1. <performance, security, compatibility, reliability>
2. <...>
## References
- <links, files, specs, examples>
## Resolved Questions
| Question | Answer | Source |
|----------|--------|--------|
| <question asked during discovery> | <answer> | <user / doc / observation> |
## Open Questions
- <anything that remains unresolved — blocks planning if critical>
## User Confirmation
- [ ] User confirms this document captures their intent
After drafting the discovery document, evaluate whether escalation is needed:
flowchart TD
Draft([DISCOVERY draft complete]) --> Q1{Unbound constraints?}
Q1 -->|Yes| Escalate[Present to user — cannot proceed without bounds]
Q1 -->|No| Q2{Domain knowledge gap?}
Q2 -->|Yes| Escalate
Q2 -->|No| Q3{Contradictory requirements?}
Q3 -->|Yes| Escalate
Q3 -->|No| AutoCheck{AUTO_MODE<br>active?}
AutoCheck -->|Yes — treat as confirmed| Done([Proceed to Stage 2])
AutoCheck -->|No| Confirm[Request user confirmation]
Confirm --> Done
Escalate --> Resolve[User resolves — update DISCOVERY]
Resolve --> Q1
Escalation triggers:
development
When an application needs to store config, data, cache, or state files. When designing where user-specific files should live. When code writes to ~/.appname or hardcoded home paths. When implementing cross-platform file storage with platformdirs.
testing
Enforce mandatory pre-action verification checkpoints to prevent pattern-matching from overriding explicit reasoning. Use this skill when about to execute implementation actions (Bash, Write, Edit) to verify hypothesis-action alignment. Blocks execution when hypothesis unverified or action targets different system than hypothesis identified. Critical for preventing cognitive dissonance where correct diagnosis leads to wrong implementation.
tools
Reference guide for the Twelve-Factor App methodology — 15 principles (12 original + 3 modern extensions) for building portable, resilient, cloud-native applications. Use when evaluating application architecture, designing cloud-native services, reviewing codebases for methodology compliance, advising on configuration, scaling, observability, security, and deployment patterns. Incorporates the 2025 open-source community evolution and cloud-native reinterpretations of each factor.
tools
Converts user-facing documentation (how-to guides, tutorials, API references, examples) in any format — Markdown, PDF, DOCX, PPTX, XLSX, AsciiDoc, RST, HTML, Jupyter notebooks, man pages, TOML/YAML/JSON configs, and plain text — into Claude Code skill directories with SKILL.md plus thematically grouped references/*.md files. Use when given a docs directory or mixed-format documentation to transform into an AI skill. Uses MCP file-reader server for binary formats.