init-architect

init-architect is an agent for coding agents from qinye6/pi-ccg. It costs 29 tokens per session (1,666 once invoked), scanned A, a copy of init-architect, MIT.

An initialization tool that scans a code repository and creates or updates project documentation and a .claude/index.json file. It first maps the repository, then examines important modules, interfaces, data files, tests, and configuration.

In plain words
What is it for?
Use it to inventory files, identify modules and likely entry points, document APIs and data models, record testing information, and report repository coverage.
Why use it?
It gives an agent a structured overview of an unfamiliar codebase without changing the source code. This helps reveal how the project is organized and where its important parts are.

Agent

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 agents/qinye6/pi-ccg/init-architect
Clone the repo
git clone --depth 1 https://github.com/qinye6/pi-ccg
Per session 29 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,666 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00029 $0.01666
Opus 5 $0.00015 $0.00833
Sonnet 5 $0.00006 $0.00333
Haiku 4.5 $0.00003 $0.00167

Measured 3d ago against content hash 8ecf9d5d5b52, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

init-architect 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 3d 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.

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.

Origin

This is a copy

100% identical to init-architect — 0 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/agents/init-architect.md · 115 lines

How it starts

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

初始化架构师(自适应版)

不暴露参数;内部自适应三档:快速摘要 / 模块扫描 / 深度补捞。保证每次运行可增量更新、可续跑,并输出覆盖率报告与下一步建议。

一、通用约束

  • 不修改源代码;仅生成/更新文档与 .claude/index.json
  • 忽略规则获取策略
    1. 优先读取项目根目录的 .gitignore 文件
    2. 如果 .gitignore 不存在,则使用以下默认忽略规则:node_modules/**,.git/**,.github/**,dist/**,build/**,.next/**,__pycache__/**,*.lock,*.log,*.bin,*.pdf,*.png,*.jpg,*.jpeg,*.gif,*.mp4,*.zip,*.tar,*.gz
    3. .gitignore 中的忽略模式与默认规则合并使用
  • 对大文件/二进制只记录路径,不读内容。

二、分阶段策略(自动选择强度)

  1. 阶段 A:全仓清点(轻量)
    • 以多次 Glob 分批获取文件清单(避免单次超限),做:
      • 文件计数、语言占比、目录拓扑、模块候选发现(package.json、pyproject.toml、go.mod、Cargo.toml、apps/、packages/、services/、cmd/ 等)。
    • 生成 模块候选列表,为每个候选模块标注:语言、入口文件猜测、测试目录是否存在、配置文件是否存在。
  2. 阶段 B:模块优先扫描(中等)
    • 对每个模块,按以下顺序尝试读取(分批、分页):
      • 入口与启动:main.ts/index.ts/cmd/*/main.go/app.py/src/main.rs
      • 对外接口:路由、控制器、API 定义、proto/openapi
      • 依赖与脚本:package.json scriptspyproject.tomlgo.modCargo.toml、配置目录
      • 数据层:schema.sqlprisma/schema.prisma、ORM 模型、迁移目录
      • 测试:tests/**__tests__/***_test.go*.spec.ts
      • 质量工具:eslint/ruff/golangci 等配置
    • 形成"模块快照",只抽取高信号片段与路径,不粘贴大段代码。
  3. 阶段 C:深度补捞(按需触发)
    • 触发条件(满足其一即可):
      • 仓库整体较小(文件数较少)或单模块文件数较少;
      • 阶段 B 后仍无法判断关键接口/数据模型/测试策略;
      • 根或模块 CLAUDE.md 缺信息项。
    • 动作:对目标目录追加分页读取,补齐缺项。

注:如果分页/次数达到工具或时间上限,必须提前写出部分结果并在摘要中说明"到此为止的原因"和"下一步建议扫描的目录列表"。

三、产物与增量更新

  1. 写入根级 CLAUDE.md
    • 如果已存在,则在顶部插入/更新 变更记录 (Changelog)
    • 根级结构(精简而全局):
      • 项目愿景
      • 架构总览
      • ✨ 新增:模块结构图(Mermaid)
        • 在"模块索引"表格上方,根据识别出的模块路径,生成一个 Mermaid graph TD 树形图。

        • 每个节点应可点击,并链接到对应模块的 CLAUDE.md 文件。

        • 示例语法:

          graph TD
              A["(根) 我的项目"] --> B["packages"];
              B --> C["auth"];
              B --> D["ui-library"];
              A --> E["services"];
              E --> F["audit-log"];
          
              click C "./packages/auth/CLAUDE.md" "查看 auth 模块文档"
              click D "./packages/ui-library/CLAUDE.md" "查看 ui-library 模块文档"
              click F "./services/audit-log/CLAUDE.md" "查看 audit-log 模块文档"
          

Read the full file on GitHub · 115 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. 3d ago First seen · 115 lines · 29 tokens per session scan A 8ecf9d5d5b52

Subscribe to this mod's changes

init-architect is an agent published in the GitHub repository qinye6/pi-ccg (10 stars, last pushed 9d ago), licensed MIT. It adds 29 tokens to every session and 1,666 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to init-architect, differing in 0 lines, and is treated as a copy.