init

A setup and upgrade workflow for cc-code, a structured development workspace for managing project requirements and work stages.

In plain words
What is it for?
Initializing a new project, taking over an existing codebase, or migrating an older cc-code workspace without deleting files.
Why use it?
It detects whether a project is new, already set up, or using an older layout, then prepares or upgrades the needed files.

Skill for Claude CodeCodex

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 skills/weiyi88/cc-code/init
Any agent
npx skills add weiyi88/cc-code --skill init
Clone the repo
git clone --depth 1 https://github.com/weiyi88/cc-code

Made for: Claude Code, Codex.

Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,537 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00087 $0.06537
Opus 5 $0.00044 $0.03268
Sonnet 5 $0.00017 $0.01307
Haiku 4.5 $0.00009 $0.00654

Measured yesterday against content hash 86946e6d2b30, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

skills/init/SKILL.md · 290 lines

How it starts

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

/cc-code:init — 项目场域初始化 / 版本升级

执行 cc-code 工作流的入场协议。同时负责把旧版场域升级到当前插件规范。

第 1 步:三轨判定

扫描当前工作区,由 .cc_code/.cc_code_version 版本戳分流:

探测条件 轨道 行为
active/Agent.md,且存在 src/ / package.json / go.mod 等旧代码或根目录已有 CLAUDE.md Track A 旧项目接管 扫描技术栈+断层,与用户多轮补 PRD,预填 project.md;执行第 2A 步分拆旧 CLAUDE.md
active/Agent.md,全空目录 Track B 新项目 直接搭场域 + 盖版本戳,切 PM 角色等待需求
active/Agent.md,且版本戳 == 插件版本 Track C 已最新 跳过脚手架,搬散落物 + ⭐跑 D4 骨架格式体检(0.9.0 起),再进第 3 步
active/Agent.md,但版本戳缺失或更旧 Track D ⭐升级迁移 脚本做 D1 归档 + D2 清点,AI 按第 2C 步做 D3~D7

⭐ 版本戳是升级的唯一判据。戳未盖 = 迁移未完成,下次 init 仍判 Track D,不会把半成品误认为已完成。

⚠️ Track C 也必须体检(0.9.0 修正):0.8.0 及以前 Track C「仅搬散落物」,零格式体检。一旦某文件盖戳时格式没归位,之后每次 init 都判 Track C 跳过检查 → 旧格式永久留存,永无自愈机会。 Track C 体检为轻量版:只检 D4 骨架清单,发现缺失即报主人并给归位建议,不自动改写(已最新的项目不该被 init 悄悄动内容)。

第 2 步:执行脚手架

bash "$CLAUDE_PLUGIN_ROOT/scripts/init.sh" "$(pwd)"

脚本按三轨自动分流。Track B/A 生成 active/ backup/ docs/{plans,qa}/ images/ scripts/ references/ + 8 个 active 模板骨架(按 L0~L4 分层:Agent status / prd / ux / project data api / gates)+ references/INDEX.md 索引 + 根目录 CLAUDE.md 入口引导 + .cc_code/README.md 使用手册(每次 init 无条件刷新到最新版)+ 版本戳。Track C 搬散落物 + 刷新手册 + AI 跑 D4 轻量骨架体检。Track D 见第 2C 步(脚本 D2 阶段自动补建缺失的 references/)。

子命令(供 AI 在升级阶段调用):

命令 用途
bash init.sh --relocate <相对路径...> 冗余归位:mvbackup/YYYY-MM/superseded/零删除,且拒绝归位规范 8 文件
bash init.sh --stamp 盖版本戳。仅在 D5 校验门全过后才允许调用

散落物迁移采用**「默认不动」判定链**(任一命中即跳过):① 保护白名单 → ② git 已追踪(最强判据:人 commit 过 = 不是垃圾)→ ③ 被 package.json/CI/Dockerfile/源码引用 → 三关全过才做正向识别(名字像临时物/过程报告才搬)→ ④ 都不匹配则原地保留并记入 backup/YYYY-MM/needs_review.md 交人工判断。搬走的记入 migration_manifest.md。同时把 .cc_code/backup/ 追加进根 .gitignore

⚠️ 判定链宁可漏搬也绝不误杀 —— setup.py / manage.py / conftest.py / AGENTS.md / build.sh / logo.png 这类项目基建必须原地不动。

CLAUDE.md 处理(init.sh 自动完成,机械活):

Read the full file on GitHub · 290 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. yesterday First seen · 290 lines · 87 tokens per session scan A 86946e6d2b30

Subscribe to this mod's changes

init is a skill published in the GitHub repository weiyi88/cc-code (5 stars, last pushed 6d ago), licensed MIT. It adds 87 tokens to every session and 6,537 once invoked, about $0.0004 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-31.