Agent skill

Aif Architecture

by unxed in unxed/f4

Generate architecture guidelines for the project. An agent skill from unxed/f4.

BSD-3-ClauseAuto-check: warningsDevelopment

Install Aif Architecture

The automated check flagged lines worth reading first. See the safety section below.

skills CLI
$ npx skills add unxed/f4 --skill aif-architecture -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install unxed/f4 aif-architecture --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/unxed/f4.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/aif-architecture .claude/skills/aif-architecture && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
aif-architecture
GitHub stars
243
Token cost
~3.1k tokens
SKILL.md length
943 words
Files
2 (incl. references)
Skills in repo
36
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Generate architecture guidelines for the project. An agent skill from unxed/f4.

  • Works in 7 steps: Load Config & Project Context → Recommend Architecture → 5: Codebase Alignment Check → …
  • Setting up project architecture
  • SKILL.md covers Workflow and Artifact Ownership
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Aif Architecture is an agent skill from unxed/f4. 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.

Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/architecture.md`).

It sits in Development, covering Software architecture. The repository describes itself as: dual pane like a charm. The licence is BSD-3-Clause.

When your agent uses it

  • Setting up project architecture
  • Asking which architecture
  • After /aif setup

Example prompts

  • “which architecture”
  • “/aif-architecture”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Glob, Grep, Bash(mkdir *), AskUserQuestion, Questions

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Load Config & Project Context
  2. Recommend Architecture
  3. 5: Codebase Alignment Check
  4. Generate the Architecture Artifact
  5. Update DESCRIPTION.md
  6. Update AGENTS.md
  7. Confirm

What it can do on your machine

Read from SKILL.md and the folder at commit 772edc7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Glob
    • Grep
    • Bash(mkdir *)
    • AskUserQuestion
    • Questions

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Aif Architecture loads about 3.1k tokens when it runs, and up to ~15k if it reads all its reference files. Until then it costs about 69 tokens; SKILL.md has 943 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~69
When it runs · the whole SKILL.md, loaded when a task matches
~3.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~15k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: warnings

The automated check found patterns that need a careful read before installing.

  • WarningContains instruction-override wording (e.g. “without asking the user”)SKILL.md:212
    cture). Do not automatically merge them without user consent.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from unxed/f4 at commit 772edc7, republished under its BSD-3-Clause licence (© unxed). 943 words, ~3,102 tokens.

Download SKILL.mdSave it as .claude/skills/aif-architecture/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
aif-architecture
description
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.
allowed-tools
Read, Write, Glob, Grep, Bash(mkdir *), AskUserQuestion, Questions
argument-hint
[microservices|layers|structured|structured-layers|structured-vertical|explicit|explicit-layers|explicit-vertical|explicit-flat] (legacy aliases: clean, ddd…
disable-model-invocation
false

Architecture - Generate Architecture Guidelines

Generate .ai-factory/ARCHITECTURE.md with architecture decisions tailored to the project.

Workflow

Step 0: Load Config & Project Context

FIRST: Read .ai-factory/config.yaml if it exists to resolve:

  • Paths: paths.description and paths.architecture
  • Language: language.ui for prompts and language.artifacts for generated architecture content

When 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:

  • DESCRIPTION.md: .ai-factory/DESCRIPTION.md
  • ARCHITECTURE.md: .ai-factory/ARCHITECTURE.md
  • Language: en (English)

THEN: Read .ai-factory/DESCRIPTION.md (use path from config) if it exists to understand:

  • Tech stack (language, framework, database, ORM)
  • Project size and complexity
  • Core features and requirements
  • Non-functional requirements

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:

  • Treat them as project-level overrides for this skill's general instructions
  • When a skill-context rule conflicts with a general rule written in this SKILL.md, the skill-context rule wins (more specific context takes priority — same principle as nested CLAUDE.md files)
  • When there is no conflict, apply both: general rules from SKILL.md + project rules from skill-context
  • Do NOT ignore skill-context rules even if they seem to contradict this skill's defaults — they exist because the project's experience proved the default insufficient
  • CRITICAL: skill-context rules apply to ALL outputs of this skill — including the ARCHITECTURE.md template. The template in this SKILL.md is a base structure. If a skill-context rule says "architecture doc MUST include X" or "MUST cover section Y" — you MUST augment the template accordingly. Generating ARCHITECTURE.md that violates skill-context rules is a bug.

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.

Step 1: Recommend Architecture

Based on project context, evaluate against the decision matrix and recommend an architecture:

If $ARGUMENTS specifies an architecture (e.g., /aif-architecture explicit):

  • Direct mapping (no suffix needed):
    • layers → Layered Architecture
    • microservices → Microservices
    • structured → Structured Modules (ask variant — see below)
    • explicit → Explicit Architecture (ask variant — see below)
  • Legacy aliases (deprecated, mapped to current patterns — may be removed in future):
    • clean → Explicit Architecture
    • ddd → Explicit Architecture
    • monolith → Structured Modules
    • vertical → Explicit Architecture (Vertical Slice By Entity)
  • With suffix (variant is determined, no need to ask):
    • structured-layers → Structured Modules (Technical Layer)
    • structured-vertical → Structured Modules (Vertical Slices By Entity)
    • explicit-layers → Explicit Architecture (Technical Layer)
    • explicit-vertical → Explicit Architecture (Vertical Slice By Entity)
    • explicit-flat → Explicit Architecture (Flat Vertical Slice - Simplified)
  • Without suffix (ask user to choose variant):
    • If structured is specified without a suffix: ASK the user: "Which folder structure variant do you prefer for Structured Modules? 1. Technical Layer (simpler) or 2. Vertical Slices by Entity (better for large modules)". Wait for their answer before generating the artifact.
    • If explicit is specified without a suffix: ASK the user: "Which folder structure variant do you prefer for Explicit Architecture? 1. Technical Layer or 2. Explicit Architecture (Vertical Slice By Entity) or 3. Explicit Architecture (Flat Vertical Slice - Simplified)". Wait for their answer before generating the artifact.
  • Use the resolved architecture directly, skip the recommendation step and proceed to Step 1.5

If no specific architecture requested:

  • Evaluate the project against the decision matrix (see references/architecture.md)
  • Consider: team size, domain complexity, scale requirements, tech stack
  • Present recommendation via 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:

  • Structured Modules (Technical Layer)
  • Structured Modules (Vertical Slices By Entity)
  • Explicit Architecture (Technical Layer)
  • Explicit Architecture (Vertical Slice By Entity)
  • Explicit Architecture (Flat Vertical Slice - Simplified)
  • Microservices
  • Layered Architecture (See references/architecture.md for detailed descriptions of these patterns to formulate your recommendation).

CRITICAL INSTRUCTION: You MUST read references/architecture.md before generating the ARCHITECTURE.md artifact to ensure correct terminology, dependency directions.

Show full SKILL.md (316 more words)Show less
Step 1.5: Codebase Alignment Check

CRITICAL: Before generating the document, compare the chosen architecture's ideal folder structure (from references/architecture.md) against the actual existing codebase structure.

  • If the project is empty or mostly matches: proceed to Step 2.
  • If there are significant discrepancies: DO NOT silently merge the ideal architecture with the messy reality. You MUST stop and ask the user how to proceed via AskUserQuestion:
The current project structure differs significantly from the ideal [Pattern Name] architecture.
[Briefly list 1-2 major differences]

How should we generate the ARCHITECTURE.md?
1. Adapt the guidelines to fit the existing application structure (document reality).
2. Generate the pure, strict architecture guidelines (requires refactoring the application later to match).

Wait for their decision before proceeding to Step 2.

Step 2: Generate the Architecture Artifact

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:

markdown
# 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]

[If the user chose Option 2 (strict architecture) in Step 1.5, add the following section:]
## Legacy vs New Code Policy
- **New Features:** All new code MUST strictly follow the architecture defined in this document.
- **Legacy Code Modification:** Do NOT automatically refactor unrelated legacy code to fit this architecture. Touch legacy code only when necessary for bug fixes, when tasked with explicit refactoring, or when adapting it to be consumed by new features.
- **Interoperability:** When new code must call legacy code, isolate the interaction using adapters, interfaces, or facades so that legacy patterns do not pollute the new architecture.

[If the user chose Option 1 (adapt to reality) in Step 1.5, add the following lighter section:]
## Code Organization Note
- **New Features:** All new code should follow the architecture defined in this document where practical.
- **Existing Code:** Document the current structure as-is. When modifying existing code, prefer following the architectural conventions in this document, but do not force a rewrite of unrelated code.
- **Interoperability:** When new code must call existing code, prefer clean interfaces but do not refactor purely for structural alignment.

## 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:

  • Adapt ALL examples to the project's language and framework (don't use TypeScript examples for a Go project)
  • Use the project's actual conventions (import paths, naming, etc.)
  • Keep it practical — focus on rules that affect day-to-day development
  • Base the generated folder structure on the user's decision in Step 1.5 (either adapted to reality or strict pure architecture). Do not automatically merge them without user consent.
Step 3: Update DESCRIPTION.md

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.

markdown
## [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]
Step 4: Update AGENTS.md

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:

markdown
| [resolved-architecture-path] | [Localized architecture artifact description in resolved artifacts language] |

Only add if the resolved architecture path is not already present.

Step 5: Confirm

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.]

Artifact Ownership

  • Primary ownership: the resolved architecture artifact path (default: .ai-factory/ARCHITECTURE.md).
  • Respect config overrides: write to the resolved architecture path from config.yaml when provided.
  • Allowed companion updates: architecture pointer in the resolved DESCRIPTION path from config.yaml, architecture row in AGENTS.md context table.
  • Read-only context: roadmap, rules, research, and plan artifacts unless user explicitly requests otherwise.

© unxed, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .agents/skills/aif-architecture of unxed/f4.

  • SKILL.md
  • references/architecture.md

Open the folder on GitHubat commit 772edc7

Compare with similar skills

Aif Architecture next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Aif Architecture compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Aif Architecture this skillunxed/f4243—~3.1kAutomated safety check: WarnBSD-3-Clause
Archify Diagramstt-a1i/archify81k—~2.9kAutomated safety check: PassMIT
Electron Multi-Process ArchitectureiOfficeAI/AionUi33k1 repos~1.8kAutomated safety check: PassApache-2.0
Backend Code Reviewlanggenius/dify158k—~676Automated safety check: PassCustom licence
Dark Architecture Diagram BuilderCocoon-AI/architecture-diagram-generator7.4k1 repos~2.1kAutomated safety check: PassMIT
SVG Diagram GeneratorJimLiu/baoyu-skills27k1 repos~3.1kAutomated safety check: PassMIT

Similar skills

  • Archify Diagrams

    tt-a1i/archify

    Creates interactive architecture, workflow, sequence, data-flow and lifecycle diagrams as standalone HTML with inline SVG, themes and image or video export.

    81k GitHub stars~2.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Tells the agent where new code belongs in an Electron multi-process project and which APIs each process may use, with rules for new bridges, services, agents and workers.

    33k GitHub starsUsed in 1 repo~1.8k tokens
    DevelopmentAuto-check passed
  • Backend Code Review

    langgenius/dify

    Reviews backend code under api/ for concrete, reproducible defects, routes to rule packs for architecture, schema, repositories and SQLAlchemy, and ranks findings from P0 to P3.

    158k GitHub stars~676 tokensUpdated today
    DevelopmentAuto-check passed
  • Dark Architecture Diagram Builder

    Cocoon-AI/architecture-diagram-generator

    Creates dark-themed system, cloud, security and network architecture diagrams as self-contained HTML files with inline SVG and CSS.

    7.4k GitHub starsUsed in 1 repo~2.1k tokens
    DevelopmentAuto-check passed
  • SVG Diagram Generator

    JimLiu/baoyu-skills

    Creates standalone dark-themed SVG diagrams, including architecture, flowchart, sequence, structural, mind map, timeline and state machine types.

    27k GitHub starsUsed in 1 repo~3.1k tokens
    DevelopmentAuto-check passed
  • Senior Architect Toolkit

    maslennikov-ig/claude-code-orchestrator-kit

    Comprehensive software architecture skill for designing scalable, maintainable systems using ReactJS, NextJS, NodeJS, Express, React Native, Swift, Kotlin…

    260 GitHub starsUsed in 8 repos~1.2k tokens
    DevelopmentAuto-check: notes

More from unxed/f4

All 36 skills in this repo
  • Comprehensive documentation guide for Golang projects, covering godoc comments, README, CONTRIBUTING, CHANGELOG, Go Playground, Example tests, API docs, and llms.txt.

    243 GitHub starsUsed in 3 repos~3.5k tokens
    Auto-check passed
  • Golang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments help vs hurt.

    243 GitHub starsUsed in 3 repos~2.5k tokens
    Auto-check passed
  • Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context…

    243 GitHub starsUsed in 2 repos~2.9k tokens
    Auto-check passed
  • Security audit checklist based on OWASP Top 10 and best practices.

    243 GitHub stars~5.4k tokensUpdated today
    Auto-check: notes
  • Go (Golang) naming conventions — covers packages, constructors, structs, interfaces, constants, enums, errors, booleans, receivers, getters/setters, functional options, acronyms, test functions, and…

    243 GitHub starsUsed in 2 repos~3.1k tokens
    Auto-check passed
  • Golang concurrency design — goroutine lifecycle and leak prevention, channels and select, channel ownership and direction, sync.Mutex/RWMutex/sync.Map/sync.Once/atomics, errgroup, singleflight…

    243 GitHub starsUsed in 1 repo~2.4k tokens
    Auto-check passed

Categories

Questions about Aif Architecture

What does Aif Architecture do?

Generate architecture guidelines for the project. An agent skill from unxed/f4. Aif Architecture is an agent skill from unxed/f4. Generate architecture guidelines for the project.

When should I use Aif Architecture?

Aif Architecture fits situations like: setting up project architecture; asking which architecture; after /aif setup.

How do I install Aif Architecture in Claude Code?

Run `npx skills add unxed/f4 --skill aif-architecture -a claude-code`. Or copy the skill folder (.agents/skills/aif-architecture in unxed/f4) into .claude/skills/aif-architecture in your project. Claude Code loads it when a task matches its description.

How do I install Aif Architecture in Codex?

Run `npx skills add unxed/f4 --skill aif-architecture -a codex`. Or copy the skill folder (.agents/skills/aif-architecture in unxed/f4) into .agents/skills/aif-architecture in your project. Codex loads it when a task matches its description.

Can I use Aif Architecture in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add unxed/f4 --skill aif-architecture -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/aif-architecture, .gemini/skills/aif-architecture, .github/skills/aif-architecture and .opencode/skills/aif-architecture in your project.

What does Aif Architecture need to run?

SKILL.md names no scripts, command-line tools or credentials: Aif Architecture is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Glob, Grep, Bash(mkdir *), AskUserQuestion, Questions.

Does Aif Architecture access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Aif Architecture safe to install?

Our automated static check of SKILL.md flagged 1 warning(s): contains instruction-override wording (e.g. “without asking the user”). Read the flagged lines before installing; the check is not a guarantee either way.

What licence does Aif Architecture use?

Aif Architecture is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Aif Architecture use?

About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 12k tokens, read only when the agent opens those files.

What are the alternatives to Aif Architecture?

Skills that share tags, products or a category with Aif Architecture: Archify Diagrams (tt-a1i/archify, 81k stars), Electron Multi-Process Architecture (iOfficeAI/AionUi, 33k stars), Backend Code Review (langgenius/dify, 158k stars) and Dark Architecture Diagram Builder (Cocoon-AI/architecture-diagram-generator, 7.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Aif Architecture?

unxed (a GitHub user) maintains it in unxed/f4, which has 243 GitHub stars. The repository holds 36 skills in this directory. The repository was last updated on October 10, 2026.

Source: unxed/f4 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.