spec-init

spec-init is a command for coding agents from fengshao1227/ccg-workflow. It costs 18 tokens per session (1,139 once invoked), scanned B, original, MIT.

An environment setup command for OpenSpec, a specification framework, and its multi-model collaboration tools. It checks the operating system and makes sure the required command-line tools are available.

In plain words
What is it for?
Use it to check or install OpenSpec, verify its command-line interface, and confirm that the required model-connection tools are ready on Linux, macOS, or Windows.
Why use it?
It catches missing dependencies before development starts, so setup problems do not appear halfway through the work. It also avoids changing existing configuration without confirmation.

Command

Part of the ccg plugin — 58 skills, 12 commands, 7 agents shipped together

About the project

CCG is a command-line workflow engine that coordinates Claude, Codex, Gemini, and other models as specialized collaborators on coding tasks. It is used to analyze requests, choose a strategy, delegate work to model-specific roles, and combine their results. The catalogue entries provide the skills, commands, agents, and plugin that implement this workflow.

fengshao1227/ccg-workflow · 5,872 stars · on GitHub

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.

agentmods
npx agentmods add commands/fengshao1227/ccg-workflow/spec-init
Clone the repo
git clone --depth 1 https://github.com/fengshao1227/ccg-workflow

Or install ccg, the plugin that ships this one along with the rest of its 58 skills, 12 commands, 7 agents.

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/fengshao1227/ccg-workflow/spec-init.svg)](https://agentmods.dev/commands/fengshao1227/ccg-workflow/spec-init)
Your own site
<a href="https://agentmods.dev/commands/fengshao1227/ccg-workflow/spec-init"><img src="https://agentmods.dev/badge/commands/fengshao1227/ccg-workflow/spec-init.svg" alt="Measured on agentmods" 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,139 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found 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 $0.00018 $0.01139
Opus 5 $0.00009 $0.00570
Sonnet 5 $0.00004 $0.00228
Haiku 4.5 $0.00002 $0.00114

Measured 5d ago against content hash 289603e22130, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 5d 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

Copies of this mod

1 near-identical copy found in the catalogue:

  • spec-init — 100% identical, 4 lines differ
templates/commands/spec-init.md · 102 lines

How it starts

The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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}}{{KIMI_MODEL_FLAG}}{{OPENCODE_MODEL_FLAG}}- "{{WORKDIR}}"
      
    • Test {{FRONTEND_PRIMARY}} backend:
      echo "echo test" | ~/.claude/bin/codeagent-wrapper --backend {{FRONTEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}{{GROK_MODEL_FLAG}}{{KIMI_MODEL_FLAG}}{{OPENCODE_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

Read the full file on GitHub · 102 lines

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. 5d ago First seen · 102 lines · 18 tokens per session scan B 289603e22130

Subscribe to this mod's changes

spec-init is a command published in the GitHub repository fengshao1227/ccg-workflow (5,872 stars, last pushed yesterday), licensed MIT. It adds 18 tokens to every session and 1,139 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (enumerates other installed skills). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.