AgentSkillsCN

initializing-openspec

在项目目录中初始化 OpenSpec。适用于启动新项目,或为现有项目引入 OpenSpec 时使用。

SKILL.md
--- frontmatter
name: initializing-openspec
description: Initializes OpenSpec in a project directory. Use when starting a new project or adding OpenSpec to an existing one.

Initializing OpenSpec

Purpose

Standardizes the initialization of OpenSpec in a project to ensure proper configuration and tool integration.

1. Safety & Verification

Before initialization:

  1. Check Help: Run cd docs && npx @fission-ai/openspec@latest init --help to verify the latest initialization options.
  2. Verify Context: Ensure you are in the intended project root.

2. Common Workflows

Workflow: Basic Initialization

  1. Run cd docs && npx @fission-ai/openspec@latest init.
  2. Follow interactive prompts (if applicable) or provide flags for non-interactive use.

Workflow: Non-Interactive Tool Setup

  1. Specify AI tools and target directory so OpenSpec lives under docs: npx @fission-ai/openspec@latest init ./docs --tools cursor,claude
  2. Use --force to auto-cleanup legacy files if necessary.

3. Error Handling

  • If command not found occurs: Ensure Node.js is installed and use npx.
  • If permission errors occur: Check file system permissions in the target directory.

4. Examples

Example: Initialize with Cursor and Claude

Command: npx @fission-ai/openspec@latest init ./docs --tools cursor,claude Expected Output: OpenSpec structure at docs/openspec/ and tool config. Run other OpenSpec CLI commands from the docs/ directory (or use pnpm openspec -- from repo root).