skills/ds-spec-reviewer/SKILL.md
Internal skill used by ds-brainstorm at Phase 1 exit gate. Dispatches a reviewer subagent to verify SPEC.md completeness before planning. NOT user-facing.
npx skillsauth add edwinhu/workflows ds-spec-reviewerInstall 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.
Purpose: Catch spec gaps BEFORE they survive into data profiling, planning, and implementation.
After Phase 1 (brainstorm) writes .planning/SPEC.md and before Phase 2 (ds-plan) begins.
Phase 1: Brainstorm -> SPEC.md written
-> [THIS SKILL] Dispatch spec reviewer subagent
-> Issues found? Fix SPEC.md -> re-dispatch reviewer
-> Approved? -> Phase 2: ds-plan
<EXTREMELY-IMPORTANT>
## The Iron Law of Spec Review
NO PLANNING WITHOUT REVIEWED SPEC. This is not negotiable.
A bad spec that survives into planning means:
Catching a spec gap NOW costs 1 minute. Catching it during implementation costs hours. </EXTREMELY-IMPORTANT>
Use this Task invocation to dispatch the spec reviewer:
Agent(
subagent_type="general-purpose",
description="Review DS spec document",
allowed_tools=["Read", "Glob", "Grep", "Bash(read-only)"],
prompt="""
You are a data science spec document reviewer. Verify this spec is complete and ready for data profiling and analysis planning.
**Tool Restrictions:** The spec reviewer is READ-ONLY. It reads `.planning/SPEC.md`, evaluates against checklist, returns verdict. It MUST NOT use Write or Edit.
**Spec to review:** .planning/SPEC.md
Read the spec file, then evaluate against ALL categories below.
## What to Check
| Category | What to Look For |
|----------|------------------|
| Completeness | TODOs, placeholders, "TBD", incomplete sections, empty fields |
| Data Sources | All data sources identified with location, format, and time period |
| Sample Period & Coverage | ONE canonical window declared (not scattered across prose); named sub-windows each mapped to consuming task(s); every windowed source has a Required-vs-Actual coverage row (Actual may be "TBD — profiled in ds-plan", but Required must be filled = union of consuming tasks' sub-windows) |
| Analysis Objectives | Clear, specific questions the analysis will answer |
| Output Format | Expected deliverables specified (report, dashboard, model, tables) |
| Success Criteria | Measurable, specific, with clear pass/fail (not vague) |
| Reproducibility | Replication strategy documented if replicating existing work |
| Constraints | Timeline, methodology requirements, computational limits documented |
| Consistency | Internal contradictions, conflicting requirements |
| YAGNI | Unrequested analyses, over-engineering, scope creep |
## CRITICAL - Look Especially Hard For:
- Any TODO markers or placeholder text
- Sections saying "to be defined later" or "will spec when data is explored"
- Sections noticeably less detailed than others
- Data sources listed without location or format
- Sample period scattered across prose (a "measured" range here, a "scope" year there) with NO single canonical window — or a per-source coverage row whose Required window omits a task that will read the source (the reuse-truncation trap)
- Analysis objectives that are vague ("explore the data", "find patterns")
- Success criteria that are unmeasurable ("good model", "interesting results")
- Missing replication/reproducibility strategy when replicating existing work
- Missing constraints section
- Output format unspecified (who consumes the results and how?)
## Output Format
## Spec Review
**Status:** APPROVED | ISSUES_FOUND
**Issues (if any):**
- [Section]: [specific issue] - [why it matters for planning]
**Recommendations (advisory - don't block approval):**
- [suggestions for improvement that aren't blocking]
""")
1. Write the structural gate sentinel (ds-plan refuses to start without it — a PreToolUse phase-gate-guard.py hook checks this file):
Write(".planning/SPEC_REVIEWED.md", """---
status: APPROVED
reviewed: spec
date: [ISO 8601]
---
Spec reviewed and APPROVED by ds-spec-reviewer. ds-plan may proceed.
""")
2. Proceed immediately to Phase 2 (ds-plan). Discover and load:
Read ${CLAUDE_SKILL_DIR}/../../skills/ds-plan/SKILL.md and follow its instructions.
Write(".planning/SPEC_REVIEWED.md", "---\nstatus: ISSUES_FOUND\nreviewed: spec\n---\nSpec has open issues; ds-plan is gated.").planning/SPEC.mdEscalate to user:
"Spec reviewer has flagged issues 5 times. Remaining issues:
[list issues]
Should I: (A) Fix these, (B) Proceed with known gaps, (C) Rethink the spec?"
Checkpoint type: human-verify (spec completeness is machine-verifiable)
1. IDENTIFY: `.planning/SPEC.md` exists
2. DISPATCH: Send to reviewer subagent
3. READ: Reviewer returns APPROVED or ISSUES_FOUND
4. VERIFY: If ISSUES_FOUND, fix and re-dispatch (max 5)
5. CLAIM: On APPROVED, write `.planning/SPEC_REVIEWED.md` (`status: APPROVED`), THEN proceed to ds-plan
**This gate is hook-enforced, not advisory:** ds-plan declares a PreToolUse `phase-gate-guard.py` hook that blocks Write/Edit/Agent until `.planning/SPEC_REVIEWED.md` exists with `status: APPROVED`. A user who invokes `/ds-plan` directly without a reviewed spec is structurally blocked.
development
Build the meeting-level proxy-voting × ownership panel on the WRDS SGE grid — ISS N-PX fund votes reduced to (item × block) direction cells, joined to institutional and mutual-fund ownership. Use when working with risk.voteanalysis_npx, N-PX fund-level votes, ISS→CRSP fund linking, index/passive/active voting blocks, or a proxy-voting panel that needs ownership attached.
development
Use when "CRSP CIZ", "CRSP v2", "CRSP flat file format 2.0", "crsp.dsf_v2 / msf_v2", "StkDlySecurityData", "StkMthSecurityData", "StkSecurityInfoHist", "stocknames_v2", "DlyRet / MthRet / DlyPrc / MthPrc", "SHRCD or EXCHCD equivalent in new CRSP", "SIZ to CIZ migration", "CRSP data after 2024", "CRSP delisting returns", "CRSP cumulative adjustment factors", "CRSP index INDNO / INDFAM", or any CRSP stock/index query where the legacy SIZ column names no longer exist.
development
Use when linking or deduping datasets by entity name rather than a shared key — 'fuzzy match', 'fuzzy name matching', 'entity resolution', 'record linkage', 'match company/person names', 'dedupe entity names', 'name-based join', 'bridge identifiers' (CIK ↔ permno ↔ gvkey ↔ wficn ↔ EIN ↔ personid), or any use of char n-gram TF-IDF, cosine similarity on names, `sparse_dot_topn`, or RapidFuzz at scale.
development
Use when building a publication-quality table in Python — 'regression table', 'results table', 'summary statistics table', 'etable', 'coefplot', 'great_tables', 'GT', 'gt table', 'format a table for the paper', 'export table to LaTeX/HTML', significance stars, spanners, or column formatting for a table headed into a paper, slide deck, or notebook.