‹ 首页

architecture

@techygarg · 收录于 1 周前

Enforce architectural rules when generating or modifying code. Defaults to clean architecture; supports any architecture style via the architecture-refiner. Validates layer responsibilities, dependency direction, and structural constraints using the loaded architecture rules. Use when generating code, reviewing architecture, creating new files, or when the user mentions 'architecture', 'layers', 'structure', 'dependency rules', 'hexagonal architecture', 'ports and adapters', 'modular monolith', or 'onion architecture'. Also use when reviewing generated code for structural compliance.

适合你,如果需要在编码时确保代码遵循架构规则

/ 下载安装
architecture.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add techygarg/lattice/architecture
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- techygarg/lattice/architecture
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify techygarg/lattice/architecture
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
159GitHub stars
待重算上下文体积
镜像托管

怎么用

技能原文 SKILL.md作者撰写 · MIT · e5a5a73

Architecture

Config Resolution

Step 1 — Determine mode:

  1. Read .lattice/config.yaml in repo root
  2. Check architecture_mode key
  3. If architecture_mode: customcustom mode
  4. If absent, or other value → clean architecture mode (default)

Step 2 — Load enforce rule:

  • Clean architecture mode → Read ./references/clean-architecture.md for enforce instruction (Self-Validation Checklist, Anti-Pattern Scan, Ambiguity Signals, structural principles)
  • Custom mode → Read ./references/custom-architecture.md for enforce instruction

Step 3 — Load architecture content:

  • Clean architecture mode:
  • Check paths.architecture in .lattice/config.yaml for custom doc
  • If found, read doc and check YAML frontmatter for mode:
  • mode: overlay: Read ./references/clean-architecture-defaults.md first, then apply custom doc section on top. Section match by heading — custom section replace matching default, new section append.
  • mode: override: Custom doc take full precedence. Must be comprehensive.
  • If no custom doc → read ./references/clean-architecture-defaults.md
  • Custom mode:
  • Check paths.architecture in .lattice/config.yaml for team architecture doc
  • If found → read it. Sole reference — no default.
  • If not found → surface: "No architecture document found. Run /architecture-refiner and select your architecture style to define your team's standards."

Step 4 — Language adaptation:

If paths.language_idioms exist in config, read "Dependency Management" section and adapt dependency direction enforcement to language idioms (e.g., Go interface-at-consumer, Java DI containers, Rust trait bounds). Language idioms take precedence over pseudocode defaults.

Enforcement

STOP after generate each component. Read Self-Validation Checklist and Anti-Pattern Scan from loaded enforce rule (clean-architecture.md or custom-architecture.md) and apply.

Project-specific checks: If architecture content doc (loaded in Step 3) contains a Validation Checklist section (§6), apply those checks as additional project-specific validation after the enforce rule checklist.

按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。