project-spec-extractor
Analyzes a codebase and generates a pure requirements specification (SPEC.md). Use when asked to "extract requirements", "create a spec", "generate a blueprint", or "distill this project".
What this skill does
# Spec Extractor
Extract a pure requirements specification from a codebase — capturing *what* the project does without *how* it's built. The output SPEC.md serves as a portable blueprint: an agent can rebuild the project from scratch, resulting in simpler, cleaner code with the same features.
## Modes
| Mode | Flag | Behavior |
|------|------|----------|
| **Tech-preserving** (default) | *(none)* | Section 6 lists specific stack: languages, frameworks, databases, services by name |
| **Tech-agnostic** | `--tech-agnostic` | Section 6 describes abstract capabilities: "persistent relational storage", "server-side rendering framework" |
## Analysis Workflow
Execute these four phases sequentially. Read the directory tree first, then selectively read representative files — do NOT read every file.
### Phase 1: Project Identity
**Purpose:** Establish what the project IS.
**Read:** README, CLAUDE.md, package manifests (package.json, pyproject.toml, Cargo.toml, go.mod), .env.example, docker-compose.yml, config files.
**Extract:**
- Project name and one-line purpose
- Target users / audience
- Core value proposition
### Phase 2: Feature Discovery
**Purpose:** Discover what the project DOES.
**Read by project type:**
- **API/Web:** Routes, controllers, middleware, pages, components
- **CLI:** Command parsers, subcommands, argument definitions
- **Library:** Public API surface, exported functions/classes
- **Full-stack:** Both API and frontend layers
**Method:** Read directory tree first to understand structure, then read representative files from each functional area. Group features by user-facing domain, not code organization.
### Phase 3: Data & Integrations
**Purpose:** Map data entities and external dependencies.
**Read:** Schema/migration files, ORM models/entities, .env.example for third-party services, auth middleware, API client configurations.
**Extract:**
- Data entities and their relationships (not column-level schema)
- External services and their purpose (database, cache, email, payment, auth providers)
- Which integrations are required vs optional
### Phase 4: Behavioral Verification
**Purpose:** Confirm completeness by cross-referencing against tests.
**Read:** Test file names and descriptions (not test implementation), error types/messages, configuration keys.
**Verify:**
- Every test-described behavior appears in the feature list
- Error scenarios are reflected in acceptance criteria
- All configuration keys are documented
## SPEC.md Output Template
Write the specification using exactly these 9 sections. Scale the document to project complexity: ~1 page for a CLI tool, 3-5 pages for a full-stack app. Omit sections that don't apply (e.g., skip Non-Functional Requirements for simple projects).
```markdown
# SPEC.md — {Project Name}
## 1. Purpose
{1-3 sentences: what the project does, who it's for, why it exists.}
## 2. User-Facing Features
{Group by domain. Describe behaviors only — what users can do, not how it works internally.}
### {Domain Group}
- {Feature behavior description}
- {Feature behavior description}
## 3. User Flows
{Numbered steps from the user's perspective. Primary flows only — trust the rebuilding agent for edge cases.}
### {Flow Name}
1. {User action}
2. {System response}
3. {Next step}
## 4. Data Entities
| Entity | Description | Relationships |
|--------|-------------|---------------|
| {Name} | {What it represents} | {How it relates to other entities} |
## 5. External Integrations
| Service | Purpose | Required |
|---------|---------|----------|
| {Name} | {What it's used for} | Yes/No |
## 6. Technology Constraints
{Tech-preserving: list specific stack by name.}
{Tech-agnostic: describe abstract capabilities needed.}
## 7. Configuration & Environment
| Key | Purpose | Required |
|-----|---------|----------|
| {KEY_NAME} | {What it controls} | Yes/No |
## 8. Non-Functional Requirements
{Only include if relevant. Examples: performance targets, security requirements, accessibility standards.}
## 9. Acceptance Criteria
{Checkbox list of testable pass/fail behaviors. Every feature and integration should have at least one criterion.}
- [ ] {Testable behavior statement}
- [ ] {Testable behavior statement}
```
## Writing Rules
Follow these rules strictly when drafting SPEC.md:
1. **Describe behaviors, not mechanisms** — "Users can reset their password via email" not "The PasswordResetController sends a token using SendGrid"
2. **User-perspective language** — write from what a user sees and does, not what the code does internally
3. **No implementation names** — omit file names, class names, function names, database column names (except in Section 6 when using tech-preserving mode)
4. **Group by domain** — organize features by what they mean to users, not by how code is structured
5. **Scale to project size** — a CLI tool gets a concise 1-page spec; a full-stack app gets 3-5 pages
6. **High-level only** — capture requirements at a level where a competent agent can fill in the details during rebuild
## Self-Review Checklist
Before saving SPEC.md, verify every item:
- [ ] No implementation details leaked (no file names, class names, function names, library names outside Section 6)
- [ ] Every discovered feature from Phase 2 appears in the spec
- [ ] Acceptance criteria cover all features listed in Section 2
- [ ] Acceptance criteria cover all integrations listed in Section 5
- [ ] Section 6 matches selected mode (tech-preserving or tech-agnostic)
- [ ] Document length is proportional to project complexity
## Workflow
1. **Detect project type:**
```bash
uv run shared/detect_project.py --path "$(pwd)"
```
2. **Parse arguments:** Check `$ARGUMENTS` for `--tech-agnostic` flag and optional path
3. **Execute analysis:** Run Phases 1-4 sequentially, reading directory tree first, then selective files
4. **Draft SPEC.md:** Follow the output template, applying writing rules
5. **Self-review:** Walk through the checklist above, fix any violations
6. **Write SPEC.md:** Save to the project root
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.