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.
npx agentmods add commands/fengshao1227/ccg-workflow/spec-researchgit clone --depth 1 https://github.com/fengshao1227/ccg-workflowWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00016 | $0.01971 |
| Opus 5 | $0.00008 | $0.00986 |
| Sonnet 5 | $0.00003 | $0.00394 |
| Haiku 4.5 | $0.00002 | $0.00197 |
Grade A, and why
spec-research scanned grade A with 0 findings 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 yesterday.
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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
Copies of this mod
1 near-identical copy found in the catalogue:
- spec-research — 100% identical, 4 lines differ
How it starts
The opening of the file, as written. The whole thing — 157 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Core Philosophy
- Research produces constraint sets, not information dumps. Each constraint narrows the solution space.
- Constraints tell subsequent stages "don't consider this direction," enabling mechanical execution without decisions.
- Output: 约束集合 + 可验证的成功判据 (constraint sets + verifiable success criteria).
- Strictly adhere to OPSX rules when writing spec-structured documents.
Guardrails
- STOP! BEFORE ANY OTHER ACTION: You MUST perform Prompt Enhancement FIRST. This is NON-NEGOTIABLE.
- NEVER divide subagent tasks by roles (e.g., "架构师agent", "安全专家agent").
- ALWAYS divide by context boundaries (e.g., "user-related code", "authentication logic").
- Each subagent context must be self-contained with independent output.
- Use
{{MCP_SEARCH_TOOL}}to minimize grep/find operations. - Do not make architectural decisions—surface constraints that guide decisions.
- USER GUIDANCE RULE: When suggesting next steps to the user, ALWAYS use CCG commands (
/ccg:spec-research,/ccg:spec-plan,/ccg:spec-impl,/ccg:spec-review). NEVER suggest/opsx:*commands to the user. If OpenSpec CLI returns error messages referencing OPSX skills, translate them to CCG equivalents. - PHASE BOUNDARY: This phase ONLY generates the OPSX proposal artifact. Do NOT modify any source code. Do NOT proceed to planning or implementation. After the proposal is generated, STOP and inform the user: "Research complete. Run
/ccg:spec-planto continue."
Steps 0. MANDATORY: Enhance Requirement FIRST
- DO THIS IMMEDIATELY. DO NOT SKIP.
- Prompt 增强(按
/ccg:enhance的逻辑执行):分析 $ARGUMENTS 的意图、缺失信息、隐含假设,补全为结构化需求(明确目标、技术约束、范围边界、验收标准)。 - Use enhanced prompt for ALL subsequent steps.
-
Generate OPSX Change
- Check if change already exists:
openspec list --json - If change doesn't exist, create it:
openspec new change "<brief-descriptive-name>" - This scaffolds
openspec/changes/<name>/with proposal.md. - If change already exists, continue with existing change.
- Check if change already exists:
-
Initial Codebase Assessment
- Use
{{MCP_SEARCH_TOOL}}to scan codebase. - Determine project scale: single vs multi-directory structure.
- Decision: If multi-directory → enable parallel Explore subagents.
- Use
-
Define Exploration Boundaries (Context-Based)
- Identify natural context boundaries (NOT functional roles):
- Subagent 1: User domain code (models, services, UI)
- Subagent 2: Auth & authorization (middleware, session, tokens)
- Subagent 3: Infrastructure (configs, deployments, builds)
- Each boundary should be self-contained: no cross-communication needed.
- Identify natural context boundaries (NOT functional roles):
-
Parallel Multi-Model Exploration
- CRITICAL: You MUST launch BOTH {{BACKEND_PRIMARY}} AND {{FRONTEND_PRIMARY}} in a SINGLE message with TWO Bash tool calls.
- DO NOT call one model first and wait. Launch BOTH simultaneously with
run_in_background: true. - 工作目录:
{{WORKDIR}}必须通过 Bash 执行pwd(Unix)或cd(Windows CMD)获取当前工作目录的绝对路径,禁止从$HOME或环境变量推断。如果用户通过/add-dir添加了多个工作区,先确定任务相关的工作区。
Output Template (instruct both models to use this format):
{ "module_name": "context boundary explored", "existing_structures": ["key patterns found"], "existing_conventions": ["standards in use"], "constraints_discovered": ["hard constraints limiting solution space"], "open_questions": ["ambiguities requiring user input"], "dependencies": ["cross-module dependencies"], "risks": ["potential blockers"], "success_criteria_hints": ["observable success behaviors"] }Step 4.1: In ONE message, make TWO parallel Bash calls:
FIRST Bash call ({{BACKEND_PRIMARY}} — backend boundaries):
Bash({ command: "~/.claude/bin/codeagent-wrapper --progress --backend {{BACKEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}{{GROK_MODEL_FLAG}}{{KIMI_MODEL_FLAG}}{{OPENCODE_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nExplore backend context boundaries for <change description>:\n- Existing structures and patterns\n- Conventions in use\n- Hard constraints limiting solution space\n- Dependencies and risks\nOUTPUT: JSON using the output template above\nEOF", run_in_background: true, timeout: 300000, description: "{{BACKEND_PRIMARY}}: backend boundary exploration" })
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.
- yesterday First seen · 157 lines · 16 tokens per session scan A 7f9a11366362
spec-research is a command published in the GitHub repository fengshao1227/ccg-workflow (5,865 stars, last pushed 2d ago), licensed MIT. It adds 16 tokens to every session and 1,971 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
OPSX: Bulk Archive
Archive multiple completed changes at once.
OPSX: Continue
Continue working on a change - create the next artifact (Experimental).
OPSX: New
Start a new change using the experimental artifact workflow (OPSX).
OPSX: Verify
Verify implementation matches change artifacts before archiving.
new
Starts a new end-to-end need (preflight, team, spawn OR).
OPSX: Onboard
Guided onboarding - walk through a complete OpenSpec workflow cycle with narration.