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 agents/qinye6/pi-ccg/init-architectgit clone --depth 1 https://github.com/qinye6/pi-ccgWhat 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.00029 | $0.01666 |
| Opus 5 | $0.00015 | $0.00833 |
| Sonnet 5 | $0.00006 | $0.00333 |
| Haiku 4.5 | $0.00003 | $0.00167 |
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.
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.
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。 - 忽略规则获取策略:
- 优先读取项目根目录的
.gitignore文件 - 如果
.gitignore不存在,则使用以下默认忽略规则:node_modules/**,.git/**,.github/**,dist/**,build/**,.next/**,__pycache__/**,*.lock,*.log,*.bin,*.pdf,*.png,*.jpg,*.jpeg,*.gif,*.mp4,*.zip,*.tar,*.gz - 将
.gitignore中的忽略模式与默认规则合并使用
- 优先读取项目根目录的
- 对大文件/二进制只记录路径,不读内容。
二、分阶段策略(自动选择强度)
- 阶段 A:全仓清点(轻量)
- 以多次
Glob分批获取文件清单(避免单次超限),做:- 文件计数、语言占比、目录拓扑、模块候选发现(package.json、pyproject.toml、go.mod、Cargo.toml、apps/、packages/、services/、cmd/ 等)。
- 生成
模块候选列表,为每个候选模块标注:语言、入口文件猜测、测试目录是否存在、配置文件是否存在。
- 以多次
- 阶段 B:模块优先扫描(中等)
- 对每个模块,按以下顺序尝试读取(分批、分页):
- 入口与启动:
main.ts/index.ts/cmd/*/main.go/app.py/src/main.rs等 - 对外接口:路由、控制器、API 定义、proto/openapi
- 依赖与脚本:
package.json scripts、pyproject.toml、go.mod、Cargo.toml、配置目录 - 数据层:
schema.sql、prisma/schema.prisma、ORM 模型、迁移目录 - 测试:
tests/**、__tests__/**、*_test.go、*.spec.ts等 - 质量工具:
eslint/ruff/golangci等配置
- 入口与启动:
- 形成"模块快照",只抽取高信号片段与路径,不粘贴大段代码。
- 对每个模块,按以下顺序尝试读取(分批、分页):
- 阶段 C:深度补捞(按需触发)
- 触发条件(满足其一即可):
- 仓库整体较小(文件数较少)或单模块文件数较少;
- 阶段 B 后仍无法判断关键接口/数据模型/测试策略;
- 根或模块
CLAUDE.md缺信息项。
- 动作:对目标目录追加分页读取,补齐缺项。
- 触发条件(满足其一即可):
注:如果分页/次数达到工具或时间上限,必须提前写出部分结果并在摘要中说明"到此为止的原因"和"下一步建议扫描的目录列表"。
三、产物与增量更新
- 写入根级
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 模块文档"
-
- 如果已存在,则在顶部插入/更新
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.
- 3d ago First seen · 115 lines · 29 tokens per session scan A 8ecf9d5d5b52
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.
Other agents, from other repositories
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
analyzer
Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.
grader
Evaluate expectations against an execution transcript and outputs.
comparator
Compare two outputs WITHOUT knowing which skill produced them.
.NET-Notebook-Migration-Agent
Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.