ai-friendly-architecture
Skill4 starsChanged 30 days agoMITView on GitHub
Design AI-friendly architecture with explicit patterns, layered documentation, and semantic boundaries. Use when: structuring projects for AI collaboration, optimizing codebase for AI analysis, setting up AI context. Not for: writing the instruction files — use /ai-instruction-standards; language-conventional directory layout — use /project-structure-guide. Keywords: architecture, AI-friendly, context, modules, documentation layers, .ai-context.yaml.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- AsiaOstrich/universal-dev-standardsword for word, first seen Nov 4, 2026
Other versions1 project uses a version of this.
Word for word · 1
- AsiaOstrich/universal-dev-standards★ 84100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository55 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ac-coverageSkill
- adrSkill
- ai-collaboration-standardsSkill
- ai-instruction-standardsSkill
- api-designSkill
- atddSkill
- auditSkill
- bddSkill
- brainstormSkill
- changelogSkill
- checkinSkill
- ci-cdSkill
- code-reviewSkill
- commitSkill
- contract-testSkill
- databaseSkill
- deploySkill
- methodologySkill
- dev-workflowSkill
- docgenSkill
- documentation-guideSkill
- durableSkill
- e2eSkill
- error-code-guideSkill
- git-workflow-guideSkill
- incidentSkill
- journey-test-assistantSkill
- knowledge-graphSkill
- logging-guideSkill
- metricsSkill
- migrateSkill
- observabilitySkill
- orchestrateSkill
- planSkill
- prSkill
- discoverSkill
- project-structure-guideSkill
- pushSkill
- refactorSkill
- releaseSkill
- requirementSkill
- retrospectiveSkill
- reverseSkill
- runbookSkill
- securitySkill
- scanSkill
- skill-builderSkill
- sloSkill
- spec-deriveSkill
- sddSkill
- sweepSkill
- tddSkill
- coverageSkill
- testing-guideSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 193
Check for existing .ai-context.yaml
- Very specific: line 194
Check for QUICK-REF.md files
- Distinctive: line 195
If not found, suggest creating AI-friendly structure
- Distinctive: line 199
If no configuration found:
- Very specific: line 203
Create QUICK-REF.md in project root
- Very specific: line 209
After /ai-friendly-architecture completes, the AI assistant should suggest:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AI-Friendly Architecture Guide
Language: English | 繁體中文
Version: 1.0.0 Last Updated: 2026-01-25 Applicability: Claude Code Skills
Core Standard: This skill implements AI-Friendly Architecture. For comprehensive methodology documentation, refer to the core standard.
AI Skills Hierarchy | AI 技能層級
This skill is part of a three-layer AI collaboration system:
| Layer | Skill | Question it Answers | 回答的問題 |
| Behavior (Immediate) | /ai-collaboration | "How should AI respond accurately?" | 「AI 如何準確回應?」 |
| Configuration (Session) | /ai-instruction-standards | "What to write in CLAUDE.md?" | 「CLAUDE.md 該寫什麼?」 |
| Architecture (Long-term) | /ai-friendly-architecture (this) | "How to structure code for AI?" | 「如何讓專案對 AI 友善?」 |
Purpose
This skill helps design project architecture that maximizes AI collaboration effectiveness through explicit patterns, layered documentation, and semantic boundaries.
Quick Reference
Core Principles
| Principle | Description | Benefit |
| Explicit Over Implicit | Document behavior explicitly | AI understands without guessing |
| Layered Context | Multi-level documentation | Appropriate detail per task |
| Semantic Boundaries | Clear module boundaries | Independent analysis |
| Discoverable Structure | Self-documenting structure | Quick orientation |
Context Layers
| Layer | Token Budget | Content |
| L1: Quick Ref | < 500 | One-liners, API signatures, entry points |
| L2: Detailed | < 5,000 | Full API docs, usage examples |
| L3: Examples | Unlimited | Complete implementations, edge cases |
Recommended Structure
project/
├── .ai-context.yaml # AI context configuration
├── docs/
│ ├── QUICK-REF.md # Level 1 documentation
│ └── ARCHITECTURE.md # Level 2 documentation
├── src/
│ └── auth/
│ ├── index.ts # Entry point with module header
│ ├── QUICK-REF.md # Module quick reference
│ └── README.md # Module documentation
└── CLAUDE.md # AI instruction fileModule Header Template
/**
* ═══════════════════════════════════════════════════════════
* MODULE: [Module Name]
* ═══════════════════════════════════════════════════════════
*
* PURPOSE: [One-sentence description]
*
* DEPENDENCIES:
* - [dep1]: [reason]
* - [dep2]: [reason]
*
* EXPORTS:
* - [function1](params): [description]
* - [function2](params): [description]
*
* CONFIGURATION:
* - [CONFIG_VAR]: [description]
*
* ═══════════════════════════════════════════════════════════
*/Detailed Guidelines
For complete standards, see:
- AI-Friendly Architecture Standards
AI-Optimized Format (Token-Efficient)
For AI assistants, use the YAML format file for reduced token usage:
- Base standard:
ai/standards/ai-friendly-architecture.ai.yaml
.ai-context.yaml Configuration
# .ai-context.yaml - AI Context Configuration
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: Authentication and authorization
dependencies: [database, crypto]
priority: high
- name: api
path: src/api/
entry: routes.ts
description: REST API endpoints
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/Context Priority Guidelines
| Priority | Content Type | Reason |
| 1 | Entry points | Application structure |
| 2 | .ai-context.yaml | Module map and dependencies |
| 3 | QUICK-REF files | Rapid API understanding |
| 4 | Modified files | Direct task relevance |
| 5 | Dependency chain | Context for changes |
Anti-Patterns to Avoid
| Anti-Pattern | Problem | Solution |
| Magic strings | AI can't trace constants | Typed constants with docs |
| Implicit routing | Hidden behavior | Explicit route mappings |
| Global state | Unpredictable deps | Dependency injection |
| Circular deps | Context confusion | Hierarchical dependencies |
| Monolithic files | Context overflow | Focused modules |
Implementation Checklist
Quick Start (< 1 hour)
- Create
.ai-context.yamlwith module list - Add
QUICK-REF.mdto project root - Document entry points in README
- Add module headers to main files
Standard Implementation (< 1 day)
- Complete
.ai-context.yamlconfiguration - Add
QUICK-REF.mdto each major module - Document all public APIs with type info
- Add section dividers to large files
Configuration Detection
This skill supports project-specific configuration.
Detection Order
- Check for existing
.ai-context.yaml - Check for
QUICK-REF.mdfiles - If not found, suggest creating AI-friendly structure
First-Time Setup
If no configuration found:
- Suggest: "This project hasn't been configured for AI collaboration. Would you like to set up an AI-friendly structure?"
- Create
.ai-context.yamltemplate - Create
QUICK-REF.mdin project root
Next Steps Guidance | 下一步引導
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-instruction-standards更新 CLAUDE.md 以反映架構配置 — 讓 AI 指令檔案與架構保持同步 / Keep AI instruction files in sync with architecture
Related Standards
- AI-Friendly Architecture - Core architecture standard
- Project Structure - Directory organization
- Documentation Structure - Documentation layering
- Anti-Hallucination - AI accuracy standards
Version History
| Version | Date | Changes |
| 1.0.0 | 2026-01-25 | Initial release |
License
This skill is released under CC BY 4.0.
Source: universal-dev-standards
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

