spec-init

spec-init is a command for Claude Code from qinye6/pi-ccg. It costs 18 tokens per session (1,115 once invoked), scanned B, a copy of spec-init, MIT.

A setup command that prepares the OpenSpec specification environment and checks whether its command-line tool and connected AI-model tools are available. OpenSpec organizes development work into structured proposals and tasks.

In plain words
What is it for?
Use it to detect the operating system, install or verify the OpenSpec command-line tool, and confirm that the required tools are ready.
Why use it?
It finds missing dependencies before development starts and stops when a setup step fails. It also adapts its checks to the operating system and avoids overwriting existing configuration without confirmation.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: reads .claude/ paths.

Good fit Use it to detect the operating system, install or verify the OpenSpec command-line tool, and confirm that the required tools are ready.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/qinye6/pi-ccg/spec-init
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/qinye6/pi-ccg

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spec-init

README.md
[![agentmods](https://agentmods.dev/badge/commands/qinye6/pi-ccg/spec-init/github.svg)](https://agentmods.dev/commands/qinye6/pi-ccg/spec-init)
Your own site
<a href="https://agentmods.dev/commands/qinye6/pi-ccg/spec-init"><img src="https://agentmods.dev/badge/commands/qinye6/pi-ccg/spec-init/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for spec-init

Your own site · 80×15
<a href="https://agentmods.dev/commands/qinye6/pi-ccg/spec-init"><img src="https://agentmods.dev/badge/commands/qinye6/pi-ccg/spec-init.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,115 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.01115
Opus 5.5 $0.00007 $0.00446
Sonnet 5.5 $0.00004 $0.00223
Haiku 4.5 $0.00002 $0.00112

Measured 1mo ago against content hash 84674b4d50cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

spec-init scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Enumerates other installed skillsmediumAgent snooping

Other skills' SKILL.md files reveal prompts, capabilities and secrets that should be invisible to peers.

ls -la openspec/ .claude/skills/openspec-* 2>/dev/null || echo "Not initialized"
Origin

This is a copy

100% identical to spec-init — 4 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

templates/commands/spec-init.md · 102 lines

What it actually says

Core Philosophy

  • OPSX provides the specification framework; CCG adds multi-model collaboration.
  • This phase ensures all tools are ready before any development work begins.
  • Fail fast: detect missing dependencies early rather than mid-workflow.

Guardrails

  • Detect OS (Linux/macOS/Windows) and adapt commands accordingly.
  • Do not proceed to next step until current step completes successfully.
  • Provide clear, actionable error messages when a step fails.
  • Respect user's existing configurations; avoid overwriting without confirmation.

Steps

  1. Detect Operating System

    • Identify OS using uname -s (Unix) or environment variables (Windows).
    • Inform user which OS was detected.
  2. Check and Install OpenSpec (OPSX)

    • IMPORTANT: OpenSpec CLI command is openspec, NOT opsx
    • Verify if OpenSpec is available:
      npx @fission-ai/openspec --version
      
    • If not found, install globally:
      npm install -g @fission-ai/openspec@latest
      
    • After installation, verify again:
      openspec --version
      
    • If openspec command not found after global install, use npx:
      npx @fission-ai/openspec --version
      
    • Note: Always use openspec (not opsx) for CLI commands.
  3. Initialize OPSX for Current Project

    • 重要:所有命令必须在当前工作目录下执行,禁止 cd 到其他路径。如不确定当前目录,先执行 pwd 确认。
    • Check if already initialized:
      ls -la openspec/ .claude/skills/openspec-* 2>/dev/null || echo "Not initialized"
      
    • If not initialized, run interactive setup (v1.2+ auto-detects AI tools):
      npx @fission-ai/openspec init
      
    • Profile Selection (v1.2+):
      • core profile (default): 4 essential workflows (propose, explore, apply, archive)
      • custom profile: Pick any subset of workflows
      • To change profile later: openspec config profile
    • Verify initialization:
      • Check openspec/ directory exists
      • Check .claude/skills/ contains openspec-* skills
      • Check .claude/commands/opsx/ contains OPSX commands
    • Report any errors with remediation steps.
  4. Validate Multi-Model MCP Tools

    • Check codeagent-wrapper availability: ~/.claude/bin/codeagent-wrapper --version
    • 工作目录:{{WORKDIR}} 必须通过 Bash 执行 pwd(Unix)或 cd(Windows CMD)获取当前工作目录的绝对路径,禁止从 $HOME 或环境变量推断。如果用户通过 /add-dir 添加了多个工作区,先确定任务相关的工作区。
    • Test {{BACKEND_PRIMARY}} backend:
      echo "echo test" | ~/.claude/bin/codeagent-wrapper --backend {{BACKEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}{{GROK_MODEL_FLAG}}- "{{WORKDIR}}"
      
    • Test {{FRONTEND_PRIMARY}} backend:
      echo "echo test" | ~/.claude/bin/codeagent-wrapper --backend {{FRONTEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}{{GROK_MODEL_FLAG}}- "{{WORKDIR}}"
      
    • For each unavailable tool, display warning with installation instructions.
  5. Summary Report Display status table:

    Component                 Status
    ─────────────────────────────────
    OpenSpec (OPSX) CLI       ✓/✗
    Project initialized       ✓/✗
    OPSX Skills               ✓/✗
    codeagent-wrapper         ✓/✗
    {{BACKEND_PRIMARY}} backend             ✓/✗
    {{FRONTEND_PRIMARY}} backend            ✓/✗
    

    Next Steps (Use CCG Encapsulated Commands)

    1. Start Research: /ccg:spec-research "description"
    2. Plan & Design: /ccg:spec-plan
    3. Implement: /ccg:spec-impl (Includes auto-review & archive)

    Standalone Tools (Available Anytime)

    • Code Review: /ccg:spec-review (Independent dual-model review)

Reference

  • OpenSpec (OPSX) CLI: npx @fission-ai/openspec --help
  • Profile Management: openspec config profile
  • CCG Workflow: npx ccg-workflow
  • 后端/前端模型 MCP: Bundled with codeagent-wrapper
  • Node.js >= 18.x required for OpenSpec
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 102 lines · 18 tokens per session scan B 84674b4d50cb

Subscribe to this mod's changes

spec-init is a command published in the GitHub repository qinye6/pi-ccg (5 stars, last pushed 2mo ago), licensed MIT. It adds 18 tokens to every session and 1,115 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 1 finding (enumerates other installed skills). It is 100% identical to spec-init, differing in 4 lines, and is treated as a copy.