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
data-ai
UI/UX design agent for crafting user experiences, visual designs, and game interfaces. Auto-detects the designer role (UX Designer, UI Designer, Game UI Designer) and spawns a role-scoped sub-agent with only the relevant reference files. Triggers on phrases like "user flow", "wireframe", "design system", "design tokens", "accessibility", "WCAG", "UI pattern", "HUD", "game menu", "inventory UI", "minimap". Full per-role triggers in references/roles/.
testing
Create `AGENTS.md` file for a project. Use when the user wants to set up custom instructions, configure AI coding assistant behavior, or create project-specific coding guidelines for AI agents.
development
Generate images via the Stable Diffusion WebUI / Forge HTTP API (AUTOMATIC1111-compatible `/sdapi/v1/*`). Use when the user wants to (1) discover or pick a model / extra module (TE/VAE) / sampler / scheduler / style preset from a running sd-webui server, (2) generate an image with a given prompt (txt2img), (3) check generation progress, (4) cancel/interrupt an in-flight generation, (5) inspect or change a global sd-webui option (e.g. active checkpoint), or (6) test connectivity. This skill talks to a *generic* sd-webui-compatible server (AUTOMATIC1111, Forge, reForge, sd-webui-forge-classic). Do NOT trigger for requests that are purely writing the prompt itself.
testing
Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.