speckit-baseline
Generate feature specifications by analyzing existing source code.
What this skill does
# Spec Kit Baseline Skill
## When to Use
- You need a spec for existing or legacy code.
- You want to document a feature before refactoring.
- You inherited a codebase without written requirements.
## Inputs
- A target path, file list, or glob pattern describing the code to analyze.
- Repo context with `.specify/` scripts and templates.
If the target is missing or ambiguous, ask a focused question before continuing.
## Goal
Generate a technology-agnostic spec for existing code, then create the feature branch/spec file using the standard Spec Kit templates.
## Workflow
1. **Parse target input**: Identify files, directories, or patterns to analyze.
- Accept file paths, glob patterns, or directory paths.
- If empty: stop and ask for a concrete target.
2. **Discover and read source files**:
- Expand globs to a file list.
- Read file contents for analysis.
- Identify primary language(s) and frameworks.
- Map key file relationships and dependencies.
3. **Analyze code structure**:
- Identify entry points and public interfaces.
- Extract function/method signatures and behaviors.
- Find data models and entities.
- Detect API endpoints and routes.
- Identify user-facing functionality.
4. **Generate a short name** (2-4 words) from the analyzed code:
- Use action-noun format (e.g., "user-auth", "payment-processing").
- Base on primary functionality discovered.
- Preserve technical terms where meaningful.
5. **Create the feature branch and spec file**:
- Find the highest existing feature number for this short name (branches/specs).
- Run `.specify/scripts/bash/create-new-feature.sh --json` with the calculated number and short name.
- Read BRANCH_NAME, FEATURE_DIR, and SPEC_FILE paths from the script JSON output.
- For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
6. **Load the spec template** from `.specify/templates/spec-template.md`.
7. **Draft the specification** using the template structure:
- **User Stories**: Infer from user-facing code paths and interactions.
- **Acceptance Scenarios**: Derive from validation logic, error handling, and tests.
- **Functional Requirements**: Extract from business rules and constraints.
- **Key Entities**: Identify from data models and schemas.
- **Success Criteria**: Infer from metrics, logging, or performance-related code.
- **Assumptions**: Document inferences made during analysis.
8. **Abstract implementation details**:
- Convert technical patterns to user-focused requirements.
- Remove framework-specific terminology.
- Focus on WHAT the code does, not HOW it does it.
9. **Create spec quality checklist** at `FEATURE_DIR/checklists/requirements.md`.
10. **Report completion** with:
- Branch name and spec file path.
- Summary of analyzed files.
- Key features discovered.
- Areas needing clarification or review.
## Outputs
- `specs/<feature>/spec.md`
- `specs/<feature>/checklists/requirements.md`
## Key rules
- Focus on extracting WHAT and WHY from HOW.
- Abstract away implementation details in the generated spec.
- Document assumptions made during code analysis.
- Flag areas where code behavior is unclear.
- Preserve discovered business rules and constraints.
- Use `[NEEDS CLARIFICATION]` for ambiguous code sections (max 3).
- Generated specs should be validated by someone who knows the feature.
## Examples
**Code Pattern → Spec Requirement**:
- `if (user.role === 'admin')` → "System MUST restrict action to administrator users"
- `password.length >= 8` → "Passwords MUST be at least 8 characters"
- `cache.set(key, value, 3600)` → "System MUST cache results for improved performance"
- `try { ... } catch (e) { notify(e) }` → "System MUST notify users when errors occur"
**Code Pattern → User Story**:
- Login endpoint with OAuth → "As a user, I can sign in using my social account"
- Shopping cart logic → "As a customer, I can add items to my cart for later purchase"
- Report generation → "As an analyst, I can generate reports on system activity"
## Next Steps
After generating spec.md:
- **Clarify** with domain experts using speckit-clarify.
- **Plan** modernization/refactoring with speckit-plan.
- **Compare** the generated spec with actual requirements to identify gaps.
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.