Agent skill

Architecture Refiner

by techygarg in techygarg/lattice

Facilitate a structured conversation to define architecture principles for a repository.

MITAuto-check passedDevelopment

Install Architecture Refiner

skills CLI
$ npx skills add techygarg/lattice --skill architecture-refiner -a claude-code

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

GitHub CLI
$ gh skill install techygarg/lattice architecture-refiner --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/techygarg/lattice.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/architecture-refiner .claude/skills/architecture-refiner && 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
architecture-refiner
GitHub stars
198
Token cost
~3.7k tokens
SKILL.md length
1,867 words
Files
3 (incl. assets)
Skills in repo
33
Repo updated
First seen
Licence
MIT

At a glance

Facilitate a structured conversation to define architecture principles for a repository.

  • Works in 4 steps: Clean Architecture (default) — layers… → Hexagonal / Ports & Adapters — core… → Modular Monolith — vertical slices, each… → …
  • Setting up a new project
  • SKILL.md covers Step 0: Style Selection, What This Produces, Before You Begin and Choosing the Mode, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Architecture Refiner is an agent skill from techygarg/lattice. Facilitate a structured conversation to define architecture principles for a repository. Supports multiple architecture styles: clean architecture (default), hexagonal / ports & adapters, modular monolith, or custom. Produces a formal architecture document that the corresponding atom will use. Use when setting up a new project, defining architecture standards, or when the user says 'setup architecture', 'define layers', 'architecture principles', 'help me define my architecture', 'hexagonal architecture'…

Its SKILL.md is about 3.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including assets (for example `assets/template-clean-arch.md` and `assets/template-generic.md`).

It sits in Development, covering Design patterns. The repository describes itself as: Install engineering discipline into any AI coding assistant. Composable skills for design, implementation, review, and team standards. Better process, not just better prompts. The licence is MIT.

When your agent uses it

  • Setting up a new project
  • Defining architecture standards
  • The user says setup architecture
  • Architecture principles

Example prompts

  • “setup architecture”
  • “define layers”
  • “architecture principles”
  • “/architecture-refiner”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Clean Architecture (default) — layers (Domain, Application, Interface, Infrastructure), dependency inversion, command/query separation
  2. Hexagonal / Ports & Adapters — core domain surrounded by ports, adapters on the outside
  3. Modular Monolith — vertical slices, each module owns its own layers
  4. Custom / Define from scratch — you describe the layers and rules"

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    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 yaml).

    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

Architecture Refiner loads about 3.7k tokens when it runs. Until then it costs about 152 tokens; SKILL.md has 1,867 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~152
When it runs · the whole SKILL.md, loaded when a task matches
~3.7k

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 passed

The automated check found no risky patterns in SKILL.md.

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 techygarg/lattice at commit 4d6c35f, republished under its MIT licence (© techygarg). 1,867 words, ~3,704 tokens.

Download SKILL.mdSave it as .claude/skills/architecture-refiner/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
architecture-refiner
description
Facilitate a structured conversation to define architecture principles for a repository. Supports multiple architecture styles: clean architecture (default), hexagonal / ports & adapters, modular monolith, or custom. Produces a formal architecture document that the corresponding atom will use. Use when setting up a new project, defining architecture standards, or when the user says 'setup architecture', 'define layers', 'architecture principles', 'help me define my architecture', 'hexagonal architecture', 'modular monolith', 'ports and adapters', or 'define my architecture style'.

Architecture Refiner

Step 0: Style Selection

Before anything else, ask the user which architecture style their team uses:

"What architecture style does your team use?

  1. Clean Architecture (default) — layers (Domain, Application, Interface, Infrastructure), dependency inversion, command/query separation
  2. Hexagonal / Ports & Adapters — core domain surrounded by ports, adapters on the outside
  3. Modular Monolith — vertical slices, each module owns its own layers
  4. Custom / Define from scratch — you describe the layers and rules"

Branching:

  • Option 1 → proceed to the clean architecture flow below (existing interview). Template: ./assets/template-clean-arch.md. Output: .lattice/standards/architecture.md. Config key: paths.architecture. No architecture_mode key needed (defaults to clean).
  • Options 2–4 → proceed to the generic architecture flow. Template: ./assets/template-generic.md. Output: .lattice/standards/architecture.md. Config key: paths.architecture. Additionally, set architecture_mode: custom in .lattice/config.yaml.

The rest of this document describes the clean architecture flow (Option 1). For the generic flow (Options 2–4), read ./assets/template-generic.md and follow its <!-- INTERVIEW GUIDANCE: --> comments. The facilitation approach, conversation style, output assembly, and document quality checks below apply to both flows — substitute the appropriate template, output path, and config key.

What This Produces

For clean architecture (Option 1):

  • Output: .lattice/standards/architecture.md (or custom path from .lattice/config.yaml → paths.architecture)
  • Two modes:
    • Overlay (mode: overlay): A slim document containing only sections that differ from the defaults. The architecture atom reads its embedded clean-architecture defaults first, then applies this document's sections on top. This is the expected common case.
    • Override (mode: override): A comprehensive standalone document that fully replaces the atom's embedded defaults. For teams that want to define clean architecture from scratch.
  • Default mode: Overlay -- produces only what the user wants to change
  • Config key: paths.architecture in .lattice/config.yaml
  • Template: Read ./assets/template-clean-arch.md for the full document structure, default content, and interview guidance comments

For other styles (Options 2–4):

  • Output: .lattice/standards/architecture.md (or custom path from .lattice/config.yaml → paths.architecture)
  • Mode: Always override — there are no embedded defaults to overlay onto for non-clean-architecture styles
  • Config key: paths.architecture in .lattice/config.yaml
  • Additional config: Sets architecture_mode: custom in .lattice/config.yaml
  • Template: Read ./assets/template-generic.md for the document structure and interview guidance comments

Before You Begin

Check for existing documents

Before starting the interview, check whether a custom document already exists:

  1. Read .lattice/config.yaml — check paths.architecture.
  2. If the relevant path exists (based on the style selected in Step 0), read that file. Ask the user:
    • "You already have a custom architecture document. Would you like to revise it (update specific sections), start fresh (new interview), or add to it (add new sections)?"
    • Revise: Load the existing document, walk through only the sections the user wants to change, and update in place.
    • Start fresh: Proceed with the full interview flow below.
    • Add to it: Skip to the "New Sections" part of the interview.
  3. If no config or no existing document, proceed with the full interview flow.
Scan the repository

Look for signals that inform the conversation:

  • Directory structure: Does src/ (or equivalent) already have layers? What are they named?
  • Existing patterns: Are there existing controllers, services, repositories, providers? What naming conventions are in use?
  • DI patterns: Is there a DI container, manual injection, or framework-provided injection?
  • Architecture docs: Any existing architecture documentation (ADRs, README sections)?
  • Framework: What framework is in use? (NestJS, Spring, Django, etc.) This affects naming conventions and common patterns.

Share relevant findings with the user at the start: "I noticed your project already has [X structure]. I'll use that as context."

If the project is new with no code, proceed with pure defaults as the starting point.

Choosing the Mode

The first decision in the conversation. Present the three options:

"How would you like to define your architecture principles?

  1. Customize specific sections (overlay) — Keep the defaults and change only what differs for your project. This produces a slim document. Most teams choose this.
  2. Define everything from scratch (override) — Walk through all sections and produce a comprehensive standalone document.
  3. Add project-specific sections only (overlay with additions) — Keep all defaults as-is and add new sections for your team's specific rules.

The defaults cover standard clean architecture well. Option 1 is recommended unless your architecture is fundamentally different."

Map the choice:

  • Options 1 and 3 → mode: overlay
  • Option 2 → mode: override

Facilitation Approach

Conversation style
  • One section at a time. Do not dump all questions at once. Walk through the template sequentially.
  • Defaults-first. For each section, briefly summarize the default, then ask if it matches. Do not read the entire default verbatim -- summarize the key points and ask.
  • Record decisions, not discussion. The output document reads as a specification, not meeting notes. "We discussed X and decided Y" is wrong. "Y" is right.
  • Probe, don't interrogate. Use the probing questions in the template guidance comments as follow-ups when the user's answer is ambiguous, not as a checklist.
For overlay mode

This should be fast. Many sections will be "keep as-is."

  1. Present each section's default briefly (a 2-3 sentence summary, not full content).
  2. Ask: "Does this match your project, or would you like to change it?"
  3. If the user says it matches → skip it (section will NOT appear in the output).
  4. If the user wants changes → dive into that section, discuss the specifics, record the changes.
  5. At the end, ask: "Any sections you'd like to add that aren't in the defaults?" (e.g., naming conventions, framework-specific rules).
  6. Only sections the user changed or added appear in the output document.
For override mode

This is thorough. Every section gets attention and appears in the output.

  1. Walk through every section in full detail.
  2. User confirms, modifies, or replaces each section.
  3. All sections appear in the output -- defaults for unchanged ones, user's version for changed ones.
Common scenarios
  • "I agree with everything" → No custom document needed. Tell the user: "The embedded defaults are already active and match your preferences. No custom document is needed — the architecture atom will use the clean-architecture defaults automatically."
  • "I agree except one section" → Overlay mode, interview that one section only.
  • "We use CQRS" → Overlay §3.2 + §4 (they are coupled — CQRS changes the service pattern which changes both flows).
  • "We don't use Providers" → Overlay §3.4 + §4.2 + §4.3 + §6 (Provider removal ripples through query flow and validation).
  • "We have extra layers" → Overlay §1 + §2 + §3 (new layers need responsibilities, dependency placement, and per-layer rules).

Section-by-Section Interview Guide

Read ./assets/template-clean-arch.md (for clean architecture) or ./assets/template-generic.md (for other styles) and follow the <!-- INTERVIEW GUIDANCE: --> comments for each section. Those comments contain the specific questions to ask, probing questions, and what is customizable vs fixed.

Cross-section dependency table

Decisions in early sections affect later sections. When a user changes an early section, flag the dependent sections:

Decision inAffectsHow
§1 — Layer namesAll sectionsNames must be consistent everywhere
§1 — Extra layers§2 (diagram), §3 (per-layer rules)New layers need dependency placement and rules
§3.2 — Service pattern (unified vs CQRS)§4.1, §4.2CQRS uses separate handlers instead of unified service
§3.4 — Provider pattern (yes/no)§4.2, §4.3, §6No Provider → reads go through Repository; comparison table and checklist change

When a dependency is triggered, inform the user: "Since you changed [X], we should also review [Y] — it's affected by that decision."

Show full SKILL.md (714 more words)Show less
Overlay-specific section flow

For each of the 6 default sections:

  1. Summarize the section's key points in 2-3 sentences.
  2. Ask: "Does this match your project?"
  3. Yes → Move to the next section. This section will not appear in the output.
  4. No → Dive into the section details using the template guidance. Produce the user's version.
  5. After all 6 sections, ask about new sections.
Override-specific section flow

For each of the 6 default sections:

  1. Present the section's full content.
  2. Ask: "Does this work as-is, or would you like to modify it?"
  3. As-is → Include the default content in the output unchanged.
  4. Modify → Discuss changes, produce the modified version.
  5. After all 6 sections, ask about new sections.
  6. All sections go in the output.

Output Assembly

For overlay mode
  1. YAML frontmatter: mode: overlay
  2. Overlay preamble text (from template)
  3. Table of contents listing only the included sections
  4. Only the sections the user changed or added
  5. Each section must be self-contained — it is a complete replacement of that section in defaults. Do not write diffs or partial sections.
  6. Section headings must match clean-architecture-defaults.md exactly (the atom matches sections by heading)
  7. New sections (§7+) are included after the default sections
  8. Footer with project name, date, mode
For override mode
  1. YAML frontmatter: mode: override
  2. Override preamble text (from template)
  3. Full table of contents (all 6+ sections)
  4. All sections: defaults for unchanged, user's version for changed, new sections at the end
  5. Footer with project name, date, mode
For both modes

Strip all <!-- INTERVIEW GUIDANCE: --> comments from the output. The final document is a clean specification.

Determine output path:

  1. If .lattice/config.yaml exists and has paths.architecture, use that path.
  2. Otherwise, default to .lattice/standards/architecture.md.

This is the same for all styles — both clean architecture customizations and other styles write to paths.architecture.

Write the document:

  1. Create .lattice/standards/ directory (and .lattice/ parent) if it does not exist.
  2. Write the document to the determined path.

Update config:

For clean architecture (Option 1):

  1. If .lattice/config.yaml does not exist, create it with:
    yaml
    paths:
      architecture: .lattice/standards/architecture.md
  2. If .lattice/config.yaml exists but has no paths.architecture, add the key. Preserve all existing content.
  3. If .lattice/config.yaml exists and already has the key, no config change needed.

For other styles (Options 2–4):

  1. If .lattice/config.yaml does not exist, create it with:
    yaml
    paths:
      architecture: .lattice/standards/architecture.md
    architecture_mode: custom
  2. If .lattice/config.yaml exists, add or update:
    • paths.architecture pointing to the output path
    • architecture_mode: custom
    • Preserve all existing content.

Confirm to user:

For clean architecture: "Your architecture document has been written to [PATH] in [overlay|override] mode. The architecture atom will now use it [on top of the clean-architecture defaults | instead of the clean-architecture defaults]."

For other styles: "Your architecture document has been written to [PATH] with architecture_mode: custom. The architecture atom will use it as your project's sole architecture standard."

Document Quality Checks

Before writing the final document, verify:

Overlay mode checks
  • Each included section is self-contained and complete (not a diff or partial section)
  • Section headings match defaults.md exactly (for section matching by the atom)
  • No <!-- INTERVIEW GUIDANCE: --> comments remain
  • Frontmatter has mode: overlay
  • Only changed/added sections are included — unchanged sections are omitted
Override mode checks
  • Every section from the template is present (§1 through §6, plus any new sections)
  • Layer names are consistent throughout all sections
  • Dependency diagram (§2) matches the layer table (§1)
  • Code examples use pseudocode (language-agnostic, same style as defaults.md)
  • Validation checklist (§6) is consistent with the rules defined in §3 and §4
  • No <!-- INTERVIEW GUIDANCE: --> comments remain
  • Frontmatter has mode: override
  • Document is readable as a standalone specification
Generic flow checks (Options 2–4)
  • Document has mode: override in frontmatter
  • Sections §1 through §7 are present (§8 Ambiguity Signals is optional, plus any new sections)
  • Layer names are consistent throughout all sections
  • Dependency diagram (§2) matches the layer table (§1)
  • §6 (Validation Checklist) contains at least 3 concrete, verifiable checks
  • §7 (Anti-Patterns) contains at least 3 anti-patterns with symptom and fix
  • No <!-- INTERVIEW GUIDANCE: --> comments remain
  • Document is readable as a standalone specification
  • Config has architecture_mode: custom set
Both modes (all flows)
  • Frontmatter is valid YAML with correct mode value
  • Document is well-formatted markdown
  • Config file (.lattice/config.yaml) is correctly updated
  • Output path exists and is writable

© techygarg, MIT. 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 2 other files (assets) in skills/architecture-refiner of techygarg/lattice.

  • SKILL.md
  • assets/template-clean-arch.md
  • assets/template-generic.md

Open the folder on GitHubat commit 4d6c35f

Compare with similar skills

Architecture Refiner 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.

Architecture Refiner compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Architecture Refiner this skilltechygarg/lattice198—~3.7kAutomated safety check: PassMIT
Vercel Composition Patternssupabase/supabase111k59 repos~726Automated safety check: PassMIT
Swiftui View RefactorDimillian/Skills4k5 repos~2kAutomated safety check: PassMIT
RTK Rust Design Patternsrtk-ai/rtk83k—~1.9kAutomated safety check: PassApache-2.0
Effect Client WrapperUsefulSoftwareCo/executor4.1k1 repos~1.4kAutomated safety check: PassMIT
Architecture PatternsKartikLabhshetwar/better-shot2.4k2 repos~1.4kAutomated safety check: PassCustom licence

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 59 repos~726 tokens
    DevelopmentAuto-check passed
  • Swiftui View Refactor

    Dimillian/Skills

    Refactor and review SwiftUI view files with strong defaults for small dedicated subviews, MV-over-MVVM data flow, stable view trees, explicit dependency injection, and correct Observation usage.

    4k GitHub starsUsed in 5 repos~2k tokens
    DevelopmentAuto-check passed
  • Describes seven Rust design patterns for the RTK CLI filter modules, with when to use each, RTK examples, and notes on when a pattern is overkill.

    83k GitHub stars~1.9k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Effect Client Wrapper

    UsefulSoftwareCo/executor

    Pattern for wrapping third-party SDK clients (Stripe, Resend, AWS, etc.) with Effect.

    4.1k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Architecture Patterns

    KartikLabhshetwar/better-shot

    Deep dive into software architecture for macOS. An agent skill from KartikLabhshetwar/better-shot.

    2.4k GitHub starsUsed in 2 repos~1.4k tokens
    DevelopmentAuto-check passed
  • GitVersion .NET Development

    GitTools/GitVersion

    Gives repository-specific .NET guidance for GitVersion: build and test commands, central package management, project layout and coding conventions.

    3.1k GitHub stars~1.7k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from techygarg/lattice

All 33 skills in this repo
  • Architecture Compass

    techygarg/lattice

    Architectural thinking partner for an existing repository — scans the codebase, conducts a structured interview, agrees on current architectural state and recommended direction, and produces a…

    198 GitHub stars~4.4k tokensUpdated 3 days ago
    Auto-check passed
  • Lattice Init

    techygarg/lattice

    Guided setup and upgrade-check experience for Lattice projects -- scans the repository, detects existing configuration and outdated conventions, suggests refiners and available upgrades in priority…

    198 GitHub stars~3.3k tokensUpdated 3 days ago
    Auto-check passed
  • Skill Align

    techygarg/lattice

    Audit and fix all Lattice documentation, README, docs/, PROJECT.md, GitHub issue templates, and CLAUDE.md to ensure they are fully aligned with the current skill inventory.

    198 GitHub stars~2k tokensUpdated 3 days ago
    Auto-check passed
  • Skill Validate

    techygarg/lattice

    Validate any Lattice SKILL.md against all tier conventions — atoms, molecules, and refiners.

    198 GitHub stars~1.5k tokensUpdated 3 days ago
    Auto-check passed
  • Clean Code Refiner

    techygarg/lattice

    Facilitate a structured conversation to define clean code principles for a repository.

    198 GitHub stars~3k tokensUpdated 3 days ago
    Auto-check passed
  • Context Anchoring

    techygarg/lattice

    Manage per-feature living documents that capture decisions, constraints, and reasoning across AI sessions during active development.

    198 GitHub stars~2.9k tokensUpdated 3 days ago
    Auto-check passed

Categories

Questions about Architecture Refiner

What does Architecture Refiner do?

Facilitate a structured conversation to define architecture principles for a repository. Architecture Refiner is an agent skill from techygarg/lattice. Facilitate a structured conversation to define architecture principles for a repository.

When should I use Architecture Refiner?

Architecture Refiner fits situations like: setting up a new project; defining architecture standards; the user says setup architecture; architecture principles.

How do I install Architecture Refiner in Claude Code?

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

How do I install Architecture Refiner in Codex?

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

Can I use Architecture Refiner 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 techygarg/lattice --skill architecture-refiner -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/architecture-refiner, .gemini/skills/architecture-refiner, .github/skills/architecture-refiner and .opencode/skills/architecture-refiner in your project.

What does Architecture Refiner need to run?

SKILL.md names no scripts, command-line tools or credentials: Architecture Refiner is instructions for the agent only.

Does Architecture Refiner 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 Architecture Refiner safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Architecture Refiner use?

Architecture Refiner is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Architecture Refiner use?

About 3.7k tokens (SKILL.md is roughly 15k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Architecture Refiner?

Skills that share tags, products or a category with Architecture Refiner: Vercel Composition Patterns (supabase/supabase, 111k stars), Swiftui View Refactor (Dimillian/Skills, 4k stars), RTK Rust Design Patterns (rtk-ai/rtk, 83k stars) and Effect Client Wrapper (UsefulSoftwareCo/executor, 4.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Architecture Refiner?

techygarg (a GitHub user) maintains it in techygarg/lattice, which has 198 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on October 6, 2026.

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