skills/dev/SKILL.md
This skill should be used when the user asks to 'start a feature', 'build a feature', 'implement a feature', 'develop', or 'new feature'.
npx skillsauth add edwinhu/workflows devInstall 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.
Announce: "I'm using dev (Phase 1) to gather requirements."
Iteration topology: one-shot (conversational Q&A — no fan-out)
BEFORE creating any new state, check for a previous session handoff.
Check if .planning/HANDOFF.md exists:
test -f .planning/HANDOFF.md && echo "HANDOFF_EXISTS" || echo "NO_HANDOFF"
If HANDOFF_EXISTS:
.planning/HANDOFF.mdPrevious session handoff detected:
- Phase: [phase_name from frontmatter]
- Task: [task] of [total_tasks]
- Status: [status]
- Last updated: [last_updated]
- Next action: [from "Next Action" section]
AskUserQuestion(questions=[{
"question": "A handoff from a previous session was found. How would you like to proceed?",
"header": "Session Handoff Detected",
"options": [
{"label": "Resume from handoff", "description": "Continue where the previous session left off"},
{"label": "Start fresh", "description": "Discard the handoff and begin a new workflow from scratch"}
],
"multiSelect": false
}])
If "Resume from handoff":
.planning/ACTIVE_WORKFLOW.md to get the recorded phase.planning/SPEC.md and .planning/PLAN.md if they exist${CLAUDE_SKILL_DIR}/../../skills/dev-[phase_name]/SKILL.md
.planning/HANDOFF.md after successfully resuming (it has been consumed)If "Start fresh":
.planning/HANDOFF.mdPhase 1 Phase 2 Phase 3 Phase 4 Phase 5 Phase 5.5 Phase 6 Phase 7
brainstorm → explore → clarify → design → implement → validate → review → verify
(SPEC.md) (key files) (resolved) (PLAN.md) (tests pass) (gaps filled) (>=80%) (fresh evidence)
│ │ │ │ │ │ │ │
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
GATE: GATE: GATE: GATE: GATE: GATE: GATE: GATE:
Questions All files Ambiguities User All tasks Goals met No issues Fresh run
asked + read by resolved + approved + pass tests vs tasks >= 80% confirms
SPEC.md main chat SPEC.md PLAN.md + spec completed confidence all claims
written updated written match
Every gate is mandatory. Skipping a gate means the next phase operates on bad inputs.
Create .planning/ACTIVE_WORKFLOW.md to track workflow state:
---
workflow: dev
phase: 1
phase_name: brainstorm
started: [current timestamp]
project_root: [current directory]
active_skill: ../../skills/dev/SKILL.md # relative to this skill's base directory
spec: .planning/SPEC.md
plan: .planning/PLAN.md
---
This enables session persistence - returning to the project will reload the current phase.
Also create .planning/STATE.md to track workflow state:
---
workflow: dev
phase: 1
phase_name: brainstorm
status: in_progress
started: [timestamp]
---
# Dev Workflow State
## Current Position
Phase: 1 (brainstorm)
Status: In progress
## Decisions
(none yet)
## Blockers
(none)
Refine vague ideas into clear requirements through Socratic questioning. NO exploration, NO approaches - just questions and requirements.
<EXTREMELY-IMPORTANT> ## The Iron Law of BrainstormingASK QUESTIONS BEFORE ANYTHING ELSE. This is not negotiable.
Before exploring codebase, before proposing approaches, follow these requirements:
Approaches come later (in /dev-design) after exploring the codebase.
If YOU catch YOURSELF about to explore the codebase before asking questions, STOP. </EXTREMELY-IMPORTANT>
After writing .planning/SPEC.md and completing brainstorm, immediately invoke the next phase:
Invoke the explore phase:
Read ${CLAUDE_SKILL_DIR}/../../skills/dev-explore/SKILL.md and follow its instructions.
DO NOT:
The workflow phases are SEQUENTIAL. Complete brainstorm → immediately start explore.
| DO | DON'T | |----|-------| | Ask clarifying questions | Explore codebase | | Understand requirements | Spawn explore agents | | Define success criteria | Look at existing code | | Write draft SPEC.md | Propose approaches (that's design) | | Identify unknowns | Create implementation tasks |
Brainstorm answers: WHAT do we need and WHY Explore answers: WHERE is the code (next phase) Design answers: HOW to build it (after exploration)
Use AskUserQuestion immediately with these principles:
Example questions to ask:
After understanding what to build, immediately ask:
AskUserQuestion(questions=[{
"question": "How will we verify this works automatically?",
"header": "Testing",
"options": [
{"label": "Unit tests (pytest/jest/etc.)", "description": "Test functions/methods in isolation"},
{"label": "Integration tests", "description": "Test component interactions"},
{"label": "E2E automation (Playwright/ydotool)", "description": "Simulate real user interactions"},
{"label": "API tests", "description": "Test HTTP endpoints directly"}
],
"multiSelect": true
}])
If user says "manual testing only" → This is a BLOCKER, not a workaround.
| User Says | Your Response | |-----------|---------------| | "Manual testing" | "That's not acceptable for /dev workflow. What's blocking automated tests?" | | "No test infrastructure" | "Let's add one. What framework fits this codebase?" | | "Too hard to test" | "What specifically is hard? Let's solve that first." | | "Just this once" | "No exceptions. TDD is the workflow, not optional." |
Why this matters: If you don't ask about testing NOW, you'll rationalize skipping it later. </EXTREMELY-IMPORTANT>
After user chooses testing approach, ask:
AskUserQuestion(questions=[{
"question": "Describe the user workflow this test must replicate:",
"header": "User Workflow",
"options": [
{"label": "UI interaction sequence", "description": "e.g., 'click button → see modal → submit form'"},
{"label": "API call sequence", "description": "e.g., 'POST /login → receive token → GET /profile'"},
{"label": "CLI command sequence", "description": "e.g., 'run command → see output → verify file created'"},
{"label": "Other (describe in chat)", "description": "Custom workflow"}
],
"multiSelect": false
}])
Then ask for specifics:
AskUserQuestion(questions=[{
"question": "What specific skill/tool should we use for testing?",
"header": "Test Tool",
"options": [
{"label": "dev-test-electron", "description": "Electron apps with Chrome DevTools Protocol"},
{"label": "dev-test-playwright", "description": "Web apps with Playwright MCP"},
{"label": "dev-test-hammerspoon", "description": "macOS native apps"},
{"label": "dev-test-linux", "description": "Linux desktop apps (ydotool/xdotool)"},
{"label": "Standard unit tests", "description": "pytest/jest/etc. for pure functions"}
],
"multiSelect": false
}])
Why this matters: If you don't define what a REAL test looks like NOW, you'll write FAKE tests later that:
Read the shared enforcement for REAL vs FAKE test definitions:
!cat ${CLAUDE_SKILL_DIR}/../../references/constraints/dev-common-constraints.md
See constraints C2 (Real Test Enforcement) and the protocol mismatch table. A test that doesn't replicate the user's actual workflow is a FAKE test.
Document in SPEC.md:
After understanding requirements AND testing strategy, define measurable success criteria:
Write the initial spec to .planning/SPEC.md:
# Spec: [Feature Name]
> **For Claude:** After writing this spec, discover and read the explore phase skill via cache lookup for `skills/dev-explore/SKILL.md`.
## Problem
[What problem this solves]
## Requirements
Assign each requirement a unique ID using `CATEGORY-NN` format (e.g., `AUTH-01`, `UI-02`, `DATA-03`). Categories come from natural groupings.
| ID | Requirement | Scope |
|----|-------------|-------|
| [CAT-01] | [Requirement 1] | v1 |
| [CAT-02] | [Requirement 2] | v1 |
Scope: `v1` = must complete, `v2` = nice to have, `out-of-scope` = explicitly excluded.
## Success Criteria
- [ ] [CAT-01] [Criterion derived from requirement]
- [ ] [CAT-02] [Criterion derived from requirement]
## Constraints
- [Any limitations or boundaries]
## Testing Strategy (MANDATORY - USER APPROVED)
> **For Claude:** Discover and read the test skill via cache lookup for `skills/dev-test/SKILL.md` for automation options.
>
> **⚠️ NO IMPLEMENTATION WITHOUT TESTS. If this section is empty, STOP.**
- **User's chosen approach:** [From AskUserQuestion in Phase 1: unit/integration/E2E/API]
- **Framework:** [pytest / playwright / jest / etc.]
- **Command:** [e.g., `pytest tests/ -v`]
- **Testing skill to use:** [dev-test-electron / dev-test-playwright / etc.]
### REAL Test Definition (MANDATORY)
> **⚠️ A test that doesn't replicate user workflow is a FAKE test. Define REAL tests NOW.**
| Field | Value |
|-------|-------|
| **User workflow to replicate** | [e.g., "highlight text → click Claude panel → see '⧉ X lines selected'"] |
| **Code paths that must be exercised** | [e.g., "WebSocket connection, not HTTP"] |
| **What user actually sees/verifies** | [e.g., "Status bar shows selection count"] |
| **Protocol/transport** | [e.g., "WebSocket" or "HTTP" or "IPC"] |
### First Failing Test
- **Test name:** [e.g., `test_selection_shows_in_claude_panel`]
- **What it tests:** [Specific behavior]
- **How it replicates user workflow:** [Step by step]
- **Expected failure message:** [What RED looks like]
### The Iron Law of REAL Tests
**If the test doesn't do what the user does, it's a FAKE test.** See `references/constraints/dev-common-constraints.md` (C2) and `references/constraints/real-test-enforcement.md` for the full REAL vs FAKE detection tables and protocol mismatch examples.
### No Test Infrastructure? That's a BLOCKER.
If the project has no tests, your first task is to ADD test infrastructure, not skip testing.
| Situation | Response |
|-----------|----------|
| "Project has no tests" | Add test framework as Task 0 |
| "Hard to test (DOM/UI/etc)" | Use E2E tools: Playwright, ydotool, screenshot comparison |
| "No time for tests" | TDD saves time. No shortcuts. |
| "User said manual testing" | Push back. Ask what's blocking automation. |
## Open Questions
- [Questions to resolve during exploration]
Note: No "Chosen Approach" yet - that comes after exploration and design phases.
Brainstorm complete when:
.planning/SPEC.md written (draft)Checkpoint type: human-verify (auto-advanceable — SPEC.md content is machine-verifiable)
Before transitioning to dev-explore, ALL checks must pass:
1. IDENTIFY: `.planning/SPEC.md` exists
2. RUN: `Read(".planning/SPEC.md")`
3. READ: Verify it contains: Problem Statement, Success Criteria, Scope sections
4. VERIFY: User has confirmed the objectives (explicit approval, not assumed)
5. CLAIM: Only proceed to dev-explore if ALL checks pass
If any check fails, do NOT proceed. Fix the gap before transitioning.
If a gate check fails:
| Failure | Action | |---------|--------| | SPEC.md missing required sections | Delete SPEC.md, re-run brainstorm with focus on missing sections | | User hasn't confirmed objectives | Ask user to confirm before proceeding — do NOT assume approval | | Testing strategy empty | Re-ask testing questions (Step 2) — this is a BLOCKER | | Success criteria vague or missing | Re-ask requirements questions — do NOT proceed with weak criteria |
Do NOT patch a broken SPEC.md. Delete it and restart brainstorm with the gap identified. Partial fixes to wrong-foundation work create worse outcomes than restarting.
After fixing, re-run ALL gate checks (not just the one that failed).
Phase summary (append to LEARNINGS.md):
## Phase: Brainstorm
---
phase: brainstorm
status: completed
implements: [] # brainstorm DEFINES requirement IDs; it implements none yet
requires: []
provides: [SPEC.md, ACTIVE_WORKFLOW.md]
affects: [.planning/SPEC.md, .planning/ACTIVE_WORKFLOW.md]
requirements-count: N
success-criteria-count: M
---
One-liner: must be substantive — e.g. "Defined 7 requirements (AUTH-01..04, DATA-01..03) and 4 success criteria for JWT refresh-rotation." Not "brainstorm complete."
REQUIRED SUB-SKILL: After completing brainstorm, dispatch the spec reviewer before exploring:
Spec Review Gate (MANDATORY):
Read ${CLAUDE_SKILL_DIR}/../../skills/dev-spec-reviewer/SKILL.md and follow its instructions.
Follow the spec reviewer's instructions:
On APPROVED, write the spec-review marker (the reviewer is read-only and cannot write it — main chat does, mirroring PLAN_REVIEWED.md). This is the structural gate dev-explore checks:
cat > .planning/SPEC_REVIEWED.md << 'EOF'
---
status: APPROVED
reviewed_date: [today]
reviewer: dev-spec-reviewer
---
SPEC.md approved by dev-spec-reviewer. Exploration may begin.
EOF
After spec review APPROVED and SPEC_REVIEWED.md written, start explore phase - Phase 2:
Read ${CLAUDE_SKILL_DIR}/../../skills/dev-explore/SKILL.md and follow its instructions.
tools
Use when "query Dewey Data", "deweydata.io", "SafeGraph places/patterns/spend", "Advan foot traffic", "POI / points of interest", "mobility data", "dataplor", "Veraset", "PassBy", "crypto/Bitcoin ATM locations", or any pull from the Dewey Data academic marketplace (UVA/NYU Platform Subscription) via the deweypy/deweydatapy client, DuckDB, or the Dewey MCP server.
development
Use when submitting jobs to UVA HPC (Rivanna/Afton), writing Slurm scripts (sbatch/srun/squeue), converting SGE to Slurm, running compute on any Slurm-managed cluster, or building WRDS data pipelines with polars on HPC. Triggers: 'submit to HPC', 'sbatch', 'squeue', 'slurm job', 'run on Rivanna', 'run on Afton', 'HPC array job', 'convert SGE to Slurm', 'polars on HPC', 'WRDS from HPC'.
testing
Internal skill for literature review and source materialization. Called after brainstorm, before setup. NOT user-facing.
development
This skill should be used when the user asks to "add paper", "paperpile add", "fetch PDF for", "find and add", "search paperpile", "find in paperpile", "paperpile search", "label paper", "trash paper", "download paper", "paperpile index", "edit paper metadata", "update paper title", "fix paper author", "paperpile edit", "find PDF online", "search google for PDF", "resolve PDF", "fetch PDF for citation", "get full-text for DOI", "resolve cite to PDF", or any request to manage their Paperpile library or resolve a citation to a local PDF.