/agent-skills:architecture-patternsfrom agent-skills
Common software architecture patterns, ADR templates, and anti-pattern detection. Supports architectural review, design decisions, and system documentation.
Ships in agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Architectural design + documentation reference. Use when:
Document every significant architectural decision:
# ADR-[NNN]: [Decision Title]
## Status
[Proposed | Accepted | Deprecated | Superseded by ADR-XXX]
## Context
[What is the situation? What forces are at play?]
## Decision
[What is the change being proposed or decided?]
## Consequences
### Positive
- [Benefit 1]
- [Benefit 2]
### Negative
- [Tradeoff 1]
- [Tradeoff 2]
### Neutral
- [Side effect]
## Alternatives Considered
1. [Alternative 1]: [Why rejected]
2. [Alternative 2]: [Why rejected]
## Related
- ADR-XXX: [Related decision]
- [External reference]
| Scenario | ADR Required? |
|---|---|
| New external dependency | Yes |
| New architectural pattern | Yes |
| Technology switch | Yes |
| Module boundary change | Yes |
| Performance tradeoff | Yes |
| Bug fix | No |
| Refactoring (same behavior) | Usually no |
┌─────────────────────────────────┐
│ Presentation │ UI, API endpoints
├─────────────────────────────────┤
│ Application │ Use cases, orchestration
├─────────────────────────────────┤
│ Domain │ Business logic, entities
├─────────────────────────────────┤
│ Infrastructure │ DB, external services
└─────────────────────────────────┘
Rules:
Use when: Enterprise apps, clear separation needed
Purpose: Abstract data access, enable testability
// Interface in domain layer
interface UserRepository {
findById(id: string): Promise<User | null>;
save(user: User): Promise<void>;
}
// Implementation in infrastructure layer
class PostgresUserRepository implements UserRepository {
async findById(id: string): Promise<User | null> {
const row = await db.query('SELECT * FROM users WHERE id = $1', [id]);
return row ? mapToUser(row) : null;
}
}
Use when:
Purpose: Encapsulate business operations
class OrderService {
constructor(
private orderRepo: OrderRepository,
private paymentGateway: PaymentGateway,
private notifier: Notifier
) {}
async placeOrder(cart: Cart, payment: PaymentInfo): Promise<Order> {
const order = Order.fromCart(cart);
await this.paymentGateway.charge(payment, order.total);
await this.orderRepo.save(order);
await this.notifier.sendConfirmation(order);
return order;
}
}
Use when:
┌─────────┐ Event ┌─────────┐
│ Service │───────────► │ Queue │
│ A │ │ │
└─────────┘ └────┬────┘
│
┌──────────────┼──────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Handler │ │ Handler │ │ Handler │
│ 1 │ │ 2 │ │ 3 │
└─────────┘ └─────────┘ └─────────┘
Use when:
Purpose: Invert control, enable testing
// Without DI (hard to test)
class OrderService {
private db = new PostgresDatabase();
}
// With DI (testable)
class OrderService {
constructor(private db: Database) {}
}
// Production
new OrderService(new PostgresDatabase());
// Test
new OrderService(new MockDatabase());
| Anti-Pattern | Detection | Fix |
|---|---|---|
| God Object | Class w/ 20+ methods, 500+ lines | Extract classes |
| Circular Dependencies | A→B→C→A | Introduce interface |
| Big Ball of Mud | No clear structure | Define boundaries |
| Spaghetti Code | Tangled control flow | Refactor, add layers |
| Golden Hammer | Same pattern everywhere | Choose appropriate |
| Anemic Domain | Data classes + procedure classes | Move logic to domain |
| Leaky Abstraction | Implementation details exposed | Hide behind interface |
| Premature Optimization | Complex code for speed | Measure first |
# Find large files (potential God objects)
find . -name "*.ts" -exec wc -l {} \; | sort -rn | head -10
# Find circular dependencies (TypeScript)
npx madge --circular src/
# Find files with many imports
grep -c "^import" src/**/*.ts | sort -t: -k2 -rn | head -10
For AGENTS.md:
Use Mermaid for version-controlled diagrams:
graph TB
subgraph Presentation
API[API Gateway]
UI[Web UI]
end
subgraph Application
Auth[Auth Service]
Orders[Order Service]
end
subgraph Data
DB[(PostgreSQL)]
Cache[(Redis)]
end
UI --> API
API --> Auth
API --> Orders
Orders --> DB
Orders --> Cache
When Architect reconciles architecture docs after implementations, use format in AGENTS.md changelog:
| Date | Change | Rationale | Source |
|------|--------|-----------|--------|
| 2024-12-20 | Added memory retrieval caching layer | Reconciled from Plan-015 implementation | Plan-015-memory-caching |
| 2024-12-18 | Updated API boundary diagram | Implementation added new endpoint | Post-implementation audit |
| 2024-12-15 | Documented Cognee integration pattern | Previously undocumented, discovered during health audit | Health audit |
Reconciliation Entry Format:
Track architectural improvements in Problem Areas section of AGENTS.md:
## Problem Areas / Design Debt Registry
### Active Design Debt
| ID | Area | Current State | Optimal State | Priority | Discovered | Last Reviewed |
|----|------|---------------|---------------|----------|------------|---------------|
| DD-001 | Memory Subsystem | Direct Cognee calls scattered | Unified memory service facade | Medium | 2024-12-15 | 2024-12-20 |
| DD-002 | Error Handling | Inconsistent error types | Typed error hierarchy | Low | 2024-12-18 | 2024-12-18 |
### Resolved Design Debt
| ID | Resolution | Resolved Date | Related Plan |
|----|------------|---------------|--------------|
| DD-000 | Extracted shared utilities | 2024-12-10 | Plan-012 |
Design Debt Entry Fields:
Priority Guidelines:
AGENTS.md as single source of truthAGENTS.md before planningAGENTS.md during plan reviewSee references/diagram-templates.md for diagram examples.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gopalparashar421/agent-skills --plugin agent-skills25 skills in this plugin
/analysis-methodologySystematic approach to converting unknowns to knowns through structured investigation with confidence levels and gap tracking. Use when analyzing bugs, investigating systems, or reducing uncertainty in technical findings./architectMaintains architectural coherence, ADRs, and technical debt visibility. Reviews plans and systems for fit and long-term health. Use for architecture review, ADRs, health audits, or when planner/roadmap needs design authority.
/cavemanUltra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
Other plugins' skills for the same job