skills/aif-architecture/SKILL.md
Generate architecture guidelines for the project. Analyzes tech stack from DESCRIPTION.md, recommends an architecture pattern, and creates .ai-factory/ARCHITECTURE.md. Use when setting up project architecture, asking "which architecture", or after /aif setup.
npx skillsauth add lee-to/ai-factory aif-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.
Generate .ai-factory/ARCHITECTURE.md with architecture decisions tailored to the project.
FIRST: Read .ai-factory/config.yaml if it exists to resolve:
paths.description and paths.architecturelanguage.ui for prompts and language.artifacts for generated architecture contentWhen invoked by /aif, assume .ai-factory/config.yaml has already been written for the current setup run and already contains the resolved language.ui / language.artifacts values.
If config.yaml doesn't exist, use defaults:
.ai-factory/DESCRIPTION.md.ai-factory/ARCHITECTURE.mden (English)THEN: Read .ai-factory/DESCRIPTION.md (use path from config) if it exists to understand:
If .ai-factory/DESCRIPTION.md does not exist:
⚠️ No project description found.
Run /aif first to set up project context, or describe your project manually:
- What are you building?
- Tech stack (language, framework, database)?
- Team size?
- Expected scale?
Allow standalone usage — if user provides manual input, use that instead.
Read .ai-factory/skill-context/aif-architecture/SKILL.md — MANDATORY if the file exists.
This file contains project-specific rules accumulated by /aif-evolve from patches,
codebase conventions, and tech-stack analysis. These rules are tailored to the current project.
How to apply skill-context rules:
Enforcement: After generating any output artifact, verify it against all skill-context rules. If any rule is violated — fix the output before presenting it to the user.
Based on project context, evaluate against the decision matrix and recommend an architecture:
If $ARGUMENTS specifies an architecture (e.g., /aif-architecture explicit):
clean -> Explicit Architectureddd -> Explicit Architecturemonolith -> Structured Modulesvertical -> Explicit Architecture (Vertical Slices)structured is specified without a suffix (-layers or -vertical), ASK the user: "Which folder structure variant do you prefer for Structured Modules? 1. By Technical Layer (simpler) or 2. Vertical Slices by Model/Entity (better for large modules)". Wait for their answer before generating the artifact.explicit is specified without a suffix (-layers or -vertical), ASK the user: "Which folder structure variant do you prefer for Explicit Architecture? 1. By Technical Layer or 2. Vertical Slices by Feature". Wait for their answer before generating the artifact.If no specific architecture requested:
references/architecture.md)AskUserQuestion:Based on your project context:
- [reason 1 from project analysis]
- [reason 2 from project analysis]
Which architecture pattern should we use?
1. [Recommended pattern] (Recommended) — [why it fits]
2. [Alternative 1] — [brief reason]
3. [Alternative 2] — [brief reason]
4. [Alternative 3] — [brief reason]
Architecture options:
CRITICAL INSTRUCTION: You MUST read references/architecture.md before generating the ARCHITECTURE.md artifact to ensure correct terminology, dependency directions.
Create the parent directory for the resolved architecture path if needed.
Generate the resolved architecture artifact (default: .ai-factory/ARCHITECTURE.md) with the following structure, adapted to the project's tech stack and language:
# Architecture: [Pattern Name]
## Overview
[1-2 paragraphs: what this architecture is and why it was chosen for THIS project]
## Decision Rationale
- **Project type:** [from DESCRIPTION.md]
- **Tech stack:** [language, framework]
- **Key factor:** [primary reason for this choice]
## Folder Structure
\`\`\`
[folder structure adapted to the project's tech stack]
[use actual framework conventions — e.g., Next.js app/ dir, Laravel app/ dir, Go cmd/ dir]
\`\`\`
## Dependency Rules
[What depends on what. Inner vs outer layers. Module boundaries.]
- ✅ [allowed dependency direction]
- ❌ [forbidden dependency direction]
## Layer/Module Communication
[How layers or modules communicate with each other]
- [pattern 1]
- [pattern 2]
## Key Principles
1. [Principle 1 — adapted to this project]
2. [Principle 2]
3. [Principle 3]
## Code Examples
### [Example 1 title]
\`\`\`[language]
[code example in the project's language/framework]
\`\`\`
### [Example 2 title]
\`\`\`[language]
[code example showing dependency rule]
\`\`\`
## Anti-Patterns
- ❌ [What NOT to do in this architecture]
- ❌ [Common mistake to avoid]
Rules for generation:
If the resolved DESCRIPTION.md path exists, add or update an architecture-pointer section in resolved language.artifacts.
Use the resolved architecture path from config, not the default path literal.
## [Localized heading: Architecture]
[Localized sentence in resolved artifacts language referencing the resolved architecture artifact path for detailed architecture guidelines.]
[Localized label: Pattern]: [chosen pattern name]
If AGENTS.md exists in the project root, add the resolved architecture artifact path to the localized "AI Context Files" table in resolved language.artifacts:
| [resolved-architecture-path] | [Localized architecture artifact description in resolved artifacts language] |
Only add if the resolved architecture path is not already present.
Present the confirmation in resolved language.ui and report the resolved architecture path:
[Localized success heading in `language.ui`]
[Localized pattern label in `language.ui`]: [chosen pattern]
[Localized file label in `language.ui`]: [resolved architecture path]
[Localized key-rules heading in `language.ui`]:
- [rule 1]
- [rule 2]
- [rule 3]
[Localized closing sentence in `language.ui` about workflow skills following these architecture guidelines.]
.ai-factory/ARCHITECTURE.md).config.yaml when provided.config.yaml, architecture row in AGENTS.md context table.data-ai
Archive completed plans and roadmap milestones. Moves finished plans to the archive directory and optionally trims closed milestones from ROADMAP.md. Use when user says "archive plans", "clean up plans", "archive completed", or "trim roadmap".
tools
Set up agent context for a project. Analyzes tech stack, installs relevant skills from skills.sh, generates custom skills, and configures MCP servers. Use when starting new project, setting up AI context, or asking "set up project", "configure AI", "what skills do I need".
development
Verify completed implementation against the plan. Checks that all tasks were fully implemented, nothing was forgotten, code compiles, tests pass, and quality standards are met. Use after "/aif-implement" completes, or when user says "verify", "check work", "did we miss anything".
data-ai
Plan implementation for a feature or task. Two modes — fast (single quick plan) or full (richer plan with optional git branch/worktree flow). Use when user says "plan", "new feature", "start feature", "create tasks".