architecture-quality

在 Web 应用、API 与服务扩展时保持架构可读性的实践指南。重点包括划分功能/领域边界、明确状态所有权、强制依赖方向、精简适配器层与验证文件结构。适用于启动或扩展 Web 后端、前端、API 或多页面产品,或在架构审查中发现“上帝文件”、跨功能导入、循环依赖或过度框架依赖时。非针对单文件脚本、一次性验证代码或纯本地命名变更。

仓库最近推送
GitHub Stars
218
Forks
33
Issues / PRs
5

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "architecture-quality":https://skillpi.com/zh/skills/deepskill-7cd60246bda23bb38c44ae82743e0045b4004ee733c8fc2d1bc42a3b7b541c2e。安装前核对上游来源和版本:https://github.com/AnastasiyaW/codex-claude-code-config。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

在 Web 应用、API 与服务扩展时保持架构可读性的实践指南。重点包括划分功能/领域边界、明确状态所有权、强制依赖方向、精简适配器层与验证文件结构。适用于启动或扩展 Web 后端、前端、API 或多页面产品,或在架构审查中发现“上帝文件”、跨功能导入、循环依赖或过度框架依赖时。非针对单文件脚本、一次性验证代码或纯本地命名变更。

0 下载

介绍来源: third_party · AnastasiyaW · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: architecture-quality
description: >
  Keep web applications, APIs and services readable as they grow: choose feature or
  domain seams, assign state ownership, enforce dependency direction, keep adapters
  thin, and verify file shape. Use when starting or extending a web app, backend,
  frontend, API or multi-page product; when a change makes a module hard to read;
  when architecture review finds a god file, cross-feature imports, a circular
  dependency or a framework-heavy domain. Load architecture-first first for a new
  system, and refactoring-safely for an existing oversized module. Do not use for a
  one-file script, throwaway spike or a purely local naming change.

Architecture quality — readable by construction

This skill turns the architecture decision into a small, repeatable delivery contract. It complements architecture-first; it does not add layers for their own sake.

Working contract

Before a non-trivial web or service change, record these five facts in ARCHITECTURE.md or docs/architecture/README.md:

  1. Feature/domain modules — name them by reason to change, not by a generic utils, helpers or services bucket.
  2. Ownership — each mutable state, database table boundary and external side effect has one owner.
  3. Dependency direction — policy/domain code is independent of the web framework, ORM, queue and filesystem; adapters point inward through small ports.
  4. Vertical slice — prove one user-visible path from entry point to state and test before multiplying layers or pages.
  5. Verification boundary — list the architecture checks and the test command that must remain green after the change.

If the project is a small script or a single-module experiment, state that scope and skip the document. A missing document is a finding only once the project has enough shape to need one, not a reason to create ceremony around a toy.

Web application shape

  • Keep routes/controllers thin: parse input, call a use-case or feature API, map the result and return. Do not put business policy, SQL and provider retries in a route.
  • Keep domain/use-case code framework-free where practical. Inject ports for storage, clocks, queues and providers; keep concrete adapters at the edge.
  • Organize user-facing behavior by feature or bounded context. A page may compose features, but one feature must not reach into another feature's private state.
  • Give each page a stable route-level composition boundary. Shared UI primitives are visual primitives, not a second business-logic layer.
  • Treat a utils or common import that keeps growing as a boundary question. Move code to the module that owns its reason to change; do not create a universal bag.
  • Prefer a modular monolith until an independently deployable or scalable boundary is proven. A microservice split is not a substitute for a missing internal boundary.

Shape checks

Run the repository audit before broadening a new app and after a structural change:

python scripts/architecture_audit.py --root .

The audit is intentionally conservative. It reports, rather than invents, findings:

  • a sizeable application with no ARCHITECTURE.md or architecture directory;
  • a source file crossing the calibrated shape thresholds;
  • an explicitly declared project marker without a readable architecture anchor.

The live module-shape-advisor.py hook repeats the file-shape check after Write|Edit|MultiEdit in both Codex and Claude. It is advisory: acknowledge the finding, split at an ownership boundary, or record why the file is intentionally large. CLAUDE_ALLOW_BIG_MODULES=1 is an explicit, reviewable escape hatch, not a default.

For dependency rules, use the tool native to the stack when the project has earned it:

  • Python: import-linter contracts for allowed import direction;
  • JavaScript/TypeScript: dependency-cruiser for cycles, orphans and forbidden folder edges;
  • Java: ArchUnit architecture tests alongside unit tests;
  • C/C++: compiler/include tooling plus explicit CMake target boundaries; do not infer a domain architecture from a raw include graph alone.

Do not install all four. Pick one boundary mechanism, commit its rules, and run it in the same CI lane as the tests that prove the behavior.

Review questions

  • Can a new feature be changed without editing an unrelated feature's internals?
  • Does a route, page or controller own policy that belongs inside a use-case/domain?
  • Is state ownership named, or are modules reaching into shared mutable objects?
  • Are imports crossing a documented boundary? If yes, is the exception recorded with a reason and expiry?
  • Is the file becoming large because one change is crossing multiple reasons to change? If yes, split the seam before adding more behavior.
  • Did the change update the architecture document and the focused architecture/test evidence together?

Gotchas

  • Folders are not boundaries. Moving files without changing imports or ownership only makes the same coupling harder to see.
  • Thin controllers can still hide a fat service. Inspect the next boundary; a generic ApplicationService is often a god module with a nicer name.
  • A metric is a signal, not a verdict. Generated code, migrations and large declarative tables need explicit exemptions; production logic needs an explanation before an exemption.
  • Microservices can multiply unreadability. Network boundaries add failure, deployment and observability costs; prove the module boundary first.

Troubleshooting

Symptom Likely cause Action
The audit reports a missing architecture anchor An app marker and several source files exist, but the boundary is implicit Write the small module/ownership/dependency map before adding more features
module-shape-advisor reports a large file Local edits accumulated in one ownership boundary Add characterization tests, split one named slice, then rerun the audit
A cycle appears Two modules own part of the same concept or one imports an implementation detail Move the concept behind an inner port or extract a genuinely shared concept
Every change touches many folders Layer-first layout scatters a feature across technical layers Recut the next slice by feature; migrate incrementally with tests
The guard is noisy on generated code The file is outside the built-in exemption list Add a narrow, documented project exemption; do not silence the whole hook

版本历史

  1. v2026.10.24 GitHub ↗
    原版更新说明

    Three ideas from this month's agent-harness news, adopted as checks rather than prompts. ## New - **Output legibility** — [`docs/output-legibility.md`](https://github.com/AnastasiyaW/codex-claude-code-config/blob/main/docs/output-legibility.md). Karpathy's readability ladder (STE-style text, diagram, HTML, video), plus the two ASD-STE100 rules that need no licensed dictionary: one concept keeps one term, and sentences stay short. - **`scripts/term_drift_check.py`** — checks agent output against a project glossary. It flags synonyms of your terms (`stem*` covers inflection, so it works in Russian too) and overlong sentences, and skips code, URLs and HTML comments. Exit `0` clean, `1` findings, `2` not checked. It ships with a self-test whose must-fail controls catch six deliberate breaks of the logic. - **Bounded harness-improvement pilot** — [`docs/harness-improvement-pilot.md`](https://github.com/AnastasiyaW/codex-claude-code-config/blob/main/docs/harness-improvement-pilot.md). The method behind Google Research's Harness², without the auto-patcher: a frozen suite with a held-out case, one change per candidate, strict improvement and no safety regression. - **Dead-code sweep** — a new reference in the `refactoring-safely` skill, after OpenAI's GPT-6 maintenance guide. It covers a read-only audit with production evidence and one small draft PR per removal, and keeps killswitches and safeguards out of scope. ## Changed - `rules/quality-code.md`: when you change code, update or delete the comment next to it in the same commit. Research suggests a wrong or stale comment misleads a model more than a missing one. - `CLAUDE.md`: new Harness² and Output Legibility sections. Full changelog: [`UPDATES.md`](https://github.com/AnastasiyaW/codex-claude-code-config/blob/main/UPDATES.md) · PRs #18, #19

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值92/100

亮点

  • 提供架构治理的完整方法论,涵盖模块边界、状态所有权、依赖方向等核心要素
  • 配套审计脚本与检查机制,具备实际落地能力
  • 适用于中大型项目架构演进,具有高频刚需价值
触发精准95/100

亮点

  • 适用场景描述清晰,边界明确,覆盖多种技术栈和项目类型
  • 明确列出不适用场景,避免误用
结构规范93/100

亮点

  • 文档结构完整,章节划分清晰,逻辑严谨
  • 提供具体示例和工具链建议,可操作性强
  • frontmatter 完整,符合规范
执行可靠78/100

待提升项

  • 引用文件缺失 原报告严重程度:重大

    SKILL.md 中提到了 scripts/architecture_audit.py 和 module-shape-advisor.py 两个脚本文件,但未在传入内容中提供

    改进建议:请补充这两个脚本文件的完整内容,或明确说明其为外部依赖并提供获取方式

亮点

  • 提供了具体的审计命令和工具链建议,执行路径清晰
  • 覆盖了主要异常场景并有豁免机制
证据可验 (前四项均值)90/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。