locales/zh-CN/skills/ai-friendly-architecture/SKILL.md
设计 AI 友善架构,包含明确模式、分层文档和语义边界。 使用时机:为 AI 协作规划项目结构、优化代码库以利 AI 分析、设置 AI 上下文。 关键字:architecture, AI-friendly, context, modules, documentation layers, .ai-context.yaml, 架构, AI 友善, 上下文.
npx skillsauth add asiaostrich/universal-dev-standards locales/zh-CN/skills/ai-friendly-architectureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
语言: English | 简体中文
版本: 1.0.0 最后更新: 2026-01-25 适用范围: Claude Code Skills
核心标准: 本技能实现 AI 友善架构。完整方法论文档请参阅核心标准。
本技能协助设计项目架构,通过明确模式、分层文档和语义边界,最大化 AI 协作效能。
| 原则 | 描述 | 效益 | |------|------|------| | 明确优于隐含 | 明确记录行为 | AI 无需猜测即可理解 | | 分层上下文 | 多层级文档 | 依任务提供适当细节 | | 语义边界 | 清晰的模块边界 | 独立分析 | | 可发现结构 | 自我说明的结构 | 快速定位 |
| 层级 | Token 预算 | 内容 | |------|------------|------| | L1: 快速参考 | < 500 | 单行说明、API 签名、入口点 | | L2: 详细 | < 5,000 | 完整 API 文档、使用示例 | | L3: 示例 | 无限制 | 完整实现、边界案例 |
project/
├── .ai-context.yaml # AI 上下文配置
├── docs/
│ ├── QUICK-REF.md # 第 1 层文档
│ └── ARCHITECTURE.md # 第 2 层文档
├── src/
│ └── auth/
│ ├── index.ts # 入口点与模块头部
│ ├── QUICK-REF.md # 模块快速参考
│ └── README.md # 模块文档
└── CLAUDE.md # AI 指令文件
/**
* ═══════════════════════════════════════════════════════════
* 模块: [模块名称]
* ═══════════════════════════════════════════════════════════
*
* 目的: [单句描述]
*
* 依赖:
* - [dep1]: [原因]
* - [dep2]: [原因]
*
* 导出:
* - [function1](params): [描述]
* - [function2](params): [描述]
*
* 配置:
* - [CONFIG_VAR]: [描述]
*
* ═══════════════════════════════════════════════════════════
*/
完整标准请参阅:
AI 助手可使用 YAML 格式文件以减少 Token 使用:
ai/standards/ai-friendly-architecture.ai.yaml# .ai-context.yaml - AI 上下文配置
version: 1.0.0
project:
name: my-project
type: web-app # web-app | library | cli | api | monorepo
primary-language: typescript
modules:
- name: auth
path: src/auth/
entry: index.ts
description: 验证与授权
dependencies: [database, crypto]
priority: high
- name: api
path: src/api/
entry: routes.ts
description: REST API 端点
dependencies: [auth, database]
priority: high
analysis-hints:
entry-points:
- src/main.ts
- src/index.ts
ignore-patterns:
- node_modules
- dist
- "*.test.ts"
architecture-type: layered
documentation:
quick-ref: docs/QUICK-REF.md
detailed: docs/ARCHITECTURE.md
examples: docs/examples/
| 优先级 | 内容类型 | 原因 | |--------|----------|------| | 1 | 入口点 | 应用程序结构 | | 2 | .ai-context.yaml | 模块地图和依赖 | | 3 | QUICK-REF 文件 | 快速 API 理解 | | 4 | 修改的文件 | 与任务直接相关 | | 5 | 依赖链 | 变更的上下文 |
| 反模式 | 问题 | 解决方案 | |--------|------|----------| | 魔术字符串 | AI 无法追踪常量 | 带文档的类型常量 | | 隐式路由 | 隐藏行为 | 明确路由映射 | | 全局状态 | 不可预测的依赖 | 依赖注入 | | 循环依赖 | 上下文混乱 | 层级式依赖 | | 单体文件 | 上下文溢出 | 专注的模块 |
.ai-context.yaml 含模块清单QUICK-REF.md.ai-context.yaml 配置QUICK-REF.md本技能支持项目特定配置。
.ai-context.yamlQUICK-REF.md 文件若未找到配置:
.ai-context.yaml 模板QUICK-REF.md| 版本 | 日期 | 变更 | |------|------|------| | 1.0.0 | 2026-01-25 | 初始发布 |
本技能以 CC BY 4.0 授权发布。
来源: universal-dev-standards
After /ai-friendly-architecture completes, the AI assistant should suggest:
AI 友善架構指南已掌握。建議下一步 / AI-friendly architecture guide understood. Suggested next steps:
- 執行
/sdd將 AI 友善架構設計納入正式規格 ⭐ Recommended / 推薦 — 確保架構決策有規格追蹤 / Ensure architecture decisions are tracked in specs- 建立
.ai-context.yaml和QUICK-REF.md— 立即實作 AI 友善結構 / Implement AI-friendly structure immediately- 執行
/ai-instructions更新 CLAUDE.md 以反映架構配置 — 讓 AI 指令檔案與架構保持同步 / Keep AI instruction files in sync with architecture
| Version | Date | Changes | |---------|------|---------| | 1.0.0 | 2026-01-25 | Initial release |
This skill is released under CC BY 4.0.
Source: universal-dev-standards
development
[UDS] 扫描代码库的调试残留与代码质量问题;可自动修正安全模式。 Use when: before committing, during PR review, or periodic codebase cleanup. Keywords: sweep, debug cleanup, console.log, debugger, TODO, ts-any, code quality, 扫描, 清理.
tools
[UDS] 从规格衍生 BDD 场景、TDD 骨架或 ATDD 表格
development
[UDS] 识别重复流程并以正确的开发深度构建 Skill
tools
[UDS] AI 辅助 git push 安全层:质量门禁 + 协作护栏。 Use when: pushing commits, force pushing, pushing to protected branches, pushing feature branches. Keywords: git push, force push, protected branch, quality gate, push receipt, PR automation, 推送, 保护分支, 质量门禁.