skills/openspec-generate-specs/SKILL.md
Generate comprehensive OpenSpec specifications directly from the current project state. Use when the user wants to create or populate main specs by analyzing existing code, documentation, AGENTS.md, GitHub issues, and pull requests — without going through the change/proposal workflow. Ideal for bootstrapping specs on a project that already has working code but no specs yet, or for refreshing specs to match the current implementation.
npx skillsauth add jim60105/copilot-prompt openspec-generate-specsInstall 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.
Generate OpenSpec main specifications by analyzing the current project's code, documentation, issues, and pull requests.
Unlike openspec-propose (which creates a change with proposal/design/tasks artifacts for future work), this skill writes finished specs directly to openspec/specs/ based on what already exists in the project.
Input: Optionally specify which capabilities or areas to generate specs for. If omitted, analyze the full project and determine capabilities automatically.
Steps
Gather project context
Collect information from all available sources. Prioritize breadth over depth — skim first, then deep-dive into relevant areas.
a. Project documentation:
AGENTS.md (or CONTRIBUTING.md, README.md) for architecture overview, conventions, and design decisionsdocs/ directory for feature specs, design docs, BDD features (.feature files)openspec/config.yaml for project context and rulesb. Codebase structure:
src/ directory tree to understand module organizationc. GitHub issues and PRs (if available):
d. Existing specs (if any):
openspec/specs/ to understand what's already documentedIdentify capabilities
Based on the gathered context, determine the project's main capability areas. Each capability becomes a spec file at openspec/specs/<capability>/spec.md.
Use the AskUserQuestion tool to confirm the identified capabilities before proceeding:
"I've identified these capabilities from the project. Which should I generate specs for?"
Present the list with brief descriptions. Let the user select all or a subset.
Naming convention: Use kebab-case for capability names (e.g., memory-system, platform-abstraction, acp-integration).
Check existing specs
For each selected capability:
openspec/specs/<capability>/spec.md already exists, read it<capability> already exists. Overwrite, merge, or skip?"
Generate specs
For each capability, create a spec file following the OpenSpec spec format.
Use the TodoWrite tool to track progress through capabilities.
Spec file structure (openspec/specs/<capability>/spec.md):
# <Capability Name>
## Purpose
<Brief description of what this capability does and why it exists.>
## Requirements
### Requirement: <Requirement Name>
<The system SHALL/SHOULD/MAY description using RFC 2119 language.>
#### Scenario: <Scenario Name>
- **GIVEN** <precondition>
- **WHEN** <action>
- **THEN** <expected outcome>
#### Scenario: <Another Scenario>
- **GIVEN** <precondition>
- **WHEN** <action>
- **THEN** <expected outcome>
Writing guidelines:
src/core/workspace-manager.ts")Write spec files
For each capability:
mkdir -p openspec/specs/<capability>
Write the spec content to openspec/specs/<capability>/spec.md.
After writing each file, verify it exists and show brief progress.
Validate output
Run validation if available:
openspec validate --specs --json
If validation fails, fix issues and re-validate.
Show summary
Display what was generated:
## Specs Generated
| Capability | Requirements | Scenarios | Status |
|------------|-------------|-----------|--------|
| <name> | N | M | New/Merged/Overwritten |
Total: X capabilities, Y requirements, Z scenarios
Files written to `openspec/specs/`.
Source Priority
When information conflicts across sources, prefer in this order:
Guardrails
development
Diátaxis Documentation Expert. An expert technical writer specializing in creating high-quality software documentation, guided by the principles and structure of the Diátaxis technical documentation authoring framework.
testing
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.
tools
Comprehensive guide for building, configuring, customizing, and deploying Docsify documentation sites. Use when the user wants to (1) initialize a new Docsify site, (2) add or organize Markdown pages, sidebars, navbars, or cover pages, (3) configure `window.$docsify` options, (4) customize themes / CSS variables / fonts, (5) install built-in or third-party Docsify plugins (search, GA, emoji, zoom, copy-code, comments, pagination, tabs, etc.), (6) write a custom Docsify plugin using lifecycle hooks, (7) use Docsify Markdown helpers (callouts, link attributes, image attributes, heading IDs, task lists, embed files with `:include`), (8) deploy to GitHub Pages, GitLab Pages, Netlify, Vercel, Firebase, Docker, Nginx, etc., (9) enable PWA / offline mode, virtual routes, or Vue compatibility, or (10) upgrade a Docsify site from v4 to v5. Triggers on mentions of "docsify", "_sidebar.md", "_navbar.md", "_coverpage.md", "$docsify", or `docsify-cli`.
testing
Writing guidelines for producing high-quality Traditional Chinese (zh-TW) content. Use when writing any kind of content. Including blog posts, notes, technical articles, technical writing, chitchat, social media posts, etc., even when you are just sending a text message. Also use when reviewing or editing existing Chinese content for tone, style, and terminology compliance.