本文へ移動
cccskills
無料GitHub で公開

openspec-generate-specs

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.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md6.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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

  1. Gather project context

    Collect information from all available sources. Prioritize breadth over depth — skim first, then deep-dive into relevant areas.

    a. Project documentation:

    • Read AGENTS.md (or CONTRIBUTING.md, README.md) for architecture overview, conventions, and design decisions
    • Read docs/ directory for feature specs, design docs, BDD features (.feature files)
    • Read openspec/config.yaml for project context and rules

    b. Codebase structure:

    • Scan src/ directory tree to understand module organization
    • Read key files (entry points, type definitions, core modules) to understand capabilities
    • Identify the main functional areas / capabilities the system provides

    c. GitHub issues and PRs (if available):

    • Use GitHub MCP tools to fetch recent open/closed issues for requirements context
    • Use GitHub MCP tools to fetch recent merged PRs for implemented features
    • Extract requirement-like information (feature requests, bug fixes, design decisions)

    d. Existing specs (if any):

    • Read openspec/specs/ to understand what's already documented
    • Identify gaps between existing specs and actual implementation
  2. Identify 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).

  3. Check existing specs

    For each selected capability:

    • If openspec/specs/<capability>/spec.md already exists, read it
    • Use AskUserQuestion tool to ask: "Spec for <capability> already exists. Overwrite, merge, or skip?"
      • Overwrite: Replace entirely with newly generated spec
      • Merge: Add missing requirements/scenarios to existing spec, preserve existing content
      • Skip: Leave as-is
  4. 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:

    • Use RFC 2119 keywords (SHALL, SHOULD, MAY) for requirement strength
    • Derive requirements from actual code behavior, not aspirational features
    • Include scenarios that reflect real code paths (check tests for scenario ideas)
    • Reference source files in requirement descriptions when helpful (e.g., "Implemented in src/core/workspace-manager.ts")
    • Keep requirements atomic — one concern per requirement
    • Group related scenarios under their parent requirement
  5. 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.

  6. Validate output

    Run validation if available:

    openspec validate --specs --json
    

    If validation fails, fix issues and re-validate.

  7. 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:

  1. Actual code behavior (ground truth)
  2. Test assertions (verified behavior)
  3. BDD feature files / design docs (intended behavior)
  4. GitHub issues/PRs (discussed behavior)
  5. README / AGENTS.md (described behavior)

Guardrails

  • Always confirm capability list with user before generating
  • Never fabricate requirements not supported by code or documentation
  • If a capability area is ambiguous, ask for clarification
  • Preserve existing spec content when merging (only add, don't remove unless user confirms)
  • Each spec file must have at least a Purpose section and one requirement
  • Use consistent formatting across all generated spec files

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Add SLSA build-provenance attestations to existing GitHub Actions workflows. Use when the user wants to add artifact attestations, build provenance, or SLSA attestations to Docker container image builds in GitHub Actions CI/CD pipelines.

日本語の概要は準備中です。原文の説明を表示しています。

jim60105/copilot-prompt212026年10月9日 更新

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

日本語の概要は準備中です。原文の説明を表示しています。

jim60105/copilot-prompt212026年10月9日 更新

Guideline for designing, implementing, and verifying secure APIs following OWASP API Security Top 10 (2023) best practices. Use when the user wants to: (1) review API code or design for security vulnerabilities, (2) design a secure REST, GraphQL, or gRPC API architecture, (3) implement API authentication and authorization (OAuth2, JWT, API keys, mTLS), (4) configure rate limiting, input validation, or CORS, (5) audit API endpoints for BOLA, BFLA, or mass assignment vulnerabilities, (6) create API security checklists or verification plans, (7) fix API security bugs or harden existing APIs, (8) set up API security testing (OWASP ZAP, Schemathesis, Burp Suite), or (9) handle any API security concern including SSRF prevention, resource consumption limits, business flow protection, API inventory management, and secure third-party API consumption.

日本語の概要は準備中です。原文の説明を表示しています。

jim60105/copilot-prompt212026年10月9日 更新

Write, review, and optionally test Bash and Zsh shell scripts following project coding standards. Use for ANY shell scripting task: (1) creating a new Bash or Zsh script, (2) editing, fixing, or reviewing an existing .sh, .bash, or .zsh file, (3) adding error handling, dependency checks, or cleanup traps to shell scripts, (4) implementing API integration or file processing in shell, (5) writing or fixing ShellSpec tests (spec/*_spec.sh), or (6) deciding whether a script should be written in Bash or Zsh. Defaults to Bash; Zsh-specific guidance lives in a reference file that is loaded only when writing Zsh.

日本語の概要は準備中です。原文の説明を表示しています。

jim60105/copilot-prompt212026年10月9日 更新

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

日本語の概要は準備中です。原文の説明を表示しています。

jim60105/copilot-prompt212026年10月9日 更新

Create, run, and maintain API test collections using Bruno (OpenCollection YAML format and legacy Bru format). Use when the user wants to: (1) create a Bruno API test collection from scratch or from OpenAPI/Swagger specs, (2) write API request files with tests and assertions, (3) run API tests using bru CLI, (4) generate test reports (HTML, JUnit, JSON), (5) set up CI/CD pipelines (GitHub Actions) for automated API testing, (6) debug or fix failing Bruno API tests, (7) add environment configurations for API testing, (8) chain API requests with data extraction, or (9) work with any .yml/.bru Bruno collection files. Triggers on mentions of 'Bruno', 'bru CLI', 'API testing collection', 'OpenCollection', or requests to automate API testing with file-based collections.

日本語の概要は準備中です。原文の説明を表示しています。

jim60105/copilot-prompt212026年10月9日 更新

jim60105 のスキルをすべて見る

このスキルの問題を報告する