architecture-guardian

Enforces layering and file-size rules when writing Tauri, React, and Rust code.

3|Updated Jun 23, 2026
One-click install
npx skills add https://github.com/Tlahey/git-manager --skill architecture-guardian-tlahey
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: architecture-guardian
Source: https://github.com/Tlahey/git-manager/tree/main/.claude/skills/architecture-guardian
Command: npx skills add https://github.com/Tlahey/git-manager --skill architecture-guardian-tlahey

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Large codebases accumulate god-files, bypassed service layers, and duplicated logic that erode maintainability. This Skill prevents those anti-patterns in the git-manager repo by enforcing documented architecture invariants (R1/R2/R3) whenever you add or edit Tauri commands, React components, hooks, Zustand stores, or API files. ## Core Features & Use Cases - Layering enforcement: Ensures every operation goes through the service/API layer — no direct invoke() or lib/tauri.ts calls from components, hooks, or stores, and thin Tauri commands that delegate to services/. - File-size and complexity discipline: Treats ~300 lines as the signal to split a component, hook, or function into feature-scoped files with their own colocated tests. - Safe retrofit method (R3): Provides a test-mapped, incremental extraction workflow for unwinding existing god-files, including barrel re-exports for multi-domain aggregator splits. - Use Case: Before adding a new #[tauri::command] or editing a 400-line React component, activate this Skill to check the layering rules and decide whether to extract logic into a hook or service first. ## Quick Start Ask the assistant to review your planned changes to a Tauri command or React component against the repo's architecture rules before writing the code.

Frequently Asked Questions about architecture-guardian

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I split a large React component into smaller hooks?▼

Map each extraction to an existing test first, then move pure useMemo-derived state before effect-driven hooks, one concern per commit. Give each extracted hook its own colocated Vitest test rather than relying on the parent component's coverage.

How should Tauri commands call backend logic in Rust?▼

Keep Tauri command functions thin: deserialize input, delegate to a service module, map errors, and serialize output. Business logic like diff generation or commit-graph layout belongs in the services directory, not in git2 calls inside the command.

Can I call invoke() directly from a React component or hook?▼

No. All operations must go through the api/*.api.ts layer so cross-cutting concerns like the event bus and undo/redo history stay hooked in. Direct invoke() or lib/tauri.ts calls silently drop side effects like clearing the redo stack.

When should a file be split for being too large?▼

Treat roughly 300 lines as the point to look for a seam, but read the file first since line count alone does not prove disorder. Deep nesting, multiple concerns, or mixed rendering and logic justify a split even below that threshold.

How do I split a large multi-domain API aggregator file?▼

Split exports into domain files and turn the original file into a barrel re-export so existing import sites keep working. Migrate call sites gradually instead of a big-bang rename, and move matching test blocks into colocated test files in the same commit.