autoresearch
Autonomous goal-directed iteration loop: modify, verify, keep/discard against a metric or a checkable success predicate, with…
Use this standalone skill to build or update a project architecture knowledge base (docs/architecture.md) for multi-end monorepos or any repo with a shared layer, from code evidence, or to check existing rules for staleness, or to write back a newly confirmed convention in one
$ npx -y skills add leo-kuang-ai/spec-first --skill spec-project-rules --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/spec-project-rulesContext preview
The summary Claude sees to decide when to auto-load this skill.
Use this standalone skill to build or update a project architecture knowledge base (docs/architecture.md) for multi-end monorepos or any repo with a shared layer, from code evidence, or to check existing rules for staleness, or to write back a newly confirmed convention in one
name: spec-project-rules description: "Use this standalone skill to build or update a project architecture knowledge base (docs/architecture.md) for multi-end monorepos or any repo with a shared layer, from code evidence, or to check existing rules for staleness, or to write back a newly confirmed convention in one sentence. Do not use for mining coding style only (spec-rule-miner), capturing solved-problem learnings (spec-compound), reviewing diffs (spec-code-review), or writing lint/formatter config."
把多端 monorepo 中 AI 每次会话都要重新猜的边界知识——归属、依赖方向、复用契约、高价值隐式约定——写成有证据的、会被装载的持久资产(`docs/architecture.md` 单文件),让 AGENTS.md/CLAUDE.md 指向它。
一级产物是架构边界知识;编码约定是二级产物,只收影响 AI 生成正确性的高信号规则。
1. **锁定 target_repo**,确定 scope(用户语言按此映射):
2. **确定性预计算**:运行 `scripts/extract-deps.cjs <repoRoot>` 获取依赖图/模块清单/churn。布局不受支持(npm workspaces 与 Gradle 均无)时脚本 exit 2 并输出确定性抽样清单(`sampling.modules[].sample_files`:模块=顶级源码目录,代表文件=入口优先+churn top,每模块 ≤8 且下限 2,总预算约 60——目录极多时可超出,以 payload `sampled_file_count` 为准)——按清单取证,不自创抽样;closeout 披露抽样比例(sampled/total)、无依赖图事实与被跳过目录(payload `skipped_dirs`)。 3. **按规模分流**:
4. **过滤读取范围**:跳过依赖、构建产物、generated 代码、二进制。 5. **按 [Mining Method](references/mining-method.md) 取证**:架构类别优先,编码约定收窄。 6. **过准入三问**,合成条目(一行格式,见 Knowledge Format)。 7. **Preview → 写入 → AGENTS.md 内嵌 → closeout**。知识库写入后,按 [Knowledge Format](references/knowledge-format.md) 筛选标准提取 top 5-10 条内嵌规则写入 AGENTS.md/CLAUDE.md managed block。首次嵌入须交互确认;headless 环境跳过并记录 `agents_embed_skipped`。closeout 必含:scope、确认环节记录(`headless_default_write` / `agents_embed_skipped` 如触发)、limitations;大仓批次另按分批节披露覆盖模块与继续命令。
单会话装不下大仓是常态。执行方式是**骨架先行、分批增量合入**——每批结束即把该批条目 preview 后合入知识库,天然可断点续跑(中断后从下一批继续,已合入内容不丢)。
**第 1 批 — 骨架**:
**第 2..N 批 — 模块群**:
**合入纪律**:
**成本口径**:目标是"有界读取"(每批只读该群代表文件),不是精确 token 预算。实测锚点:20,750 文件 Gradle 仓单次全量会话耗 14.7M tokens / 740s(2026-08-29 hszq-app 实测);分批把每批输入约束在代表文件清单内。
把 AI coding 会话变成可信、由项目拥有的变更。 spec-first 是面向 Claude Code、Codex、Kiro、Qoder、Cursor、OpenCode、ZCode 与 Pi 的仓库原生 AI Coding Harness。它把想法、需求、计划、代码、审查和知识连接成可检查的工程闭环。
Autonomous goal-directed iteration loop: modify, verify, keep/discard against a metric or a checkable success predicate, with…
Audit mobile App PRD/Figma/local-source consistency across page routes, KMP/Clean Architecture, components, analytics, i18n,…
Explore vague or ambitious ideas into a right-sized requirements-only unified plan. Use when the user wants to brainstorm, think…
Structured code review for bugs, regressions, tests, and standards. Report-only by default; apply fixes only when the current…
Internal landing helper for public workflows that already hold explicit commit and landing authorization; commits scoped changes,…
Internal commit helper for public workflows that already hold explicit commit authorization; creates scoped, value-communicating…