Skip to content
Back to skills

Senior Architect

ASecurity

Makes and records architecture decisions (pattern, database, monolith vs services) as ADRs, backed by coupling and diagram tools. Use when writing an ADR, choosing an architecture or database, or reviewing system structure.

  • 1,271 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added May 29, 2026
ai-agentspythonrustgobashsqldockerawsgcpazuretesting

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add borghei/Claude-Skills --skill senior-architect --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Senior Architect?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Senior Architect
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/borghei-senior-architect/badge)](https://www.skillsdirectory.com/skills/borghei-senior-architect)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: senior-architect
description: >
  Makes and records architecture decisions (pattern, database, monolith vs services) as
  ADRs, backed by coupling and diagram tools. Use when writing an ADR, choosing an
  architecture or database, or reviewing system structure.
license: MIT + Commons Clause
metadata:
  version: 1.2.0
  author: borghei
  category: engineering
  domain: system-design
  updated: 2026-11-08
  tags: [system-design, distributed-systems, architecture, adr, scalability]
---
# Senior Architect

Architecture design and analysis tools for making informed technical decisions: visualize system structure, analyze dependencies and coupling, detect architectural patterns, and run decision workflows for databases, patterns, and monolith-vs-microservices trade-offs.

## Decision Workflow

The value of this skill is the decision and its record; the tools supply evidence.

1. **Frame the decision:** one question (for example "split billing out of the monolith?"), the constraints (team size, deployment cadence, data consistency, budget) and who decides.
2. **Gather evidence from the code:** `dependency_analyzer.py` for coupling and cycles, `project_architect.py` for the current pattern and layer violations, `architecture_diagram_generator.py` for a current-state diagram. Low confidence or `unknown` layers mean the structure does not follow naming conventions; read the code rather than trusting the label.
3. **Run the matching workflow** in [references/decision_workflows.md](references/decision_workflows.md): database selection, pattern selection, or monolith vs microservices. Write down at least two real options and the cost of each.
4. **Write the ADR** (template in the same reference): context, options, decision, consequences, and the signal that would make you revisit it.
5. Done when the ADR is accepted by the people who will own the result, and the evidence it cites can be regenerated by rerunning the tools.

**Not this skill:** cloud-provider service design (see `engineering/aws-solution-architect`, `engineering/azure-cloud-architect`, `engineering/gcp-cloud-architect`), choosing between frameworks or vendors (see `engineering/tech-stack-evaluator`), and backend implementation (see `engineering/senior-backend`).

## Core Capabilities

- **Diagram generation** — produce component, layer, and deployment diagrams in Mermaid, PlantUML, or ASCII from a project directory.
- **Dependency analysis** — detect circular imports (quoting the closing import), score coupling (0-100, internal heuristic), and read the manifest across npm, pip, Poetry, Go modules, and Cargo.
- **Pattern detection** — assess an existing codebase for layered/MVC/hexagonal/clean/microservices patterns, layer violations, god classes, and mixed concerns.
- **Database selection** — match data characteristics, scale, and consistency needs to SQL/NoSQL options with an ADR template.
- **Pattern & topology selection** — choose an architecture pattern by team size, deployment, and data-boundary requirements.
- **Monolith vs microservices** — apply decision checklists and a modular-monolith-first hybrid strategy.

## When to Use

- Designing a new system or refactoring existing architecture.
- Evaluating microservices vs monolith, or choosing a database.
- Writing an ADR, planning for scalability, or reviewing a system design.
- Generating architecture diagrams for documentation or team review.

## Clarify First

Before generating diagrams or an assessment, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.

- **Project root:** the codebase directory to analyze (drives pattern detection, dependency scoring, and diagram contents).
- **Diagram type & format:** component / layer / deployment in Mermaid / PlantUML / ASCII (sets what the generator emits).
- **Architecture decision in question:** e.g. database choice or monolith vs microservices (selects the decision workflow and ADR).

Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.

## Tools Overview

| Tool | Purpose | Command |
|------|---------|---------|
| `architecture_diagram_generator.py` | Component, layer or deployment diagram (Mermaid, PlantUML, ASCII, or JSON) drawn from folders, imports, manifests and deployment files. The deployment diagram shows only what Dockerfile/compose/k8s files and dependencies prove. | `python3 scripts/architecture_diagram_generator.py ./project --format mermaid --type component` |
| `dependency_analyzer.py` | Internal import cycles with the closing import quoted, a coupling heuristic (0-100, needs 3+ modules), and manifest parsing for npm, pip, Poetry, Go and Cargo | `python3 scripts/dependency_analyzer.py ./project --format json --check circular` |
| `project_architect.py` | Name-based pattern detection, layer violations (with file:line and the import), oversized files and classes | `python3 scripts/project_architect.py ./project --check layers` |

All three take the project directory as a positional argument (or `--input`). `dependency_analyzer.py` and `project_architect.py` take `--format text|json` (legacy `--output human|json` and `--json` still work) and `--check`. The diagram tool's `--format` picks the diagram syntax: `mermaid`, `plantuml`, `ascii` (alias `text`) or `json`.

## Exit Codes

| Code | Meaning |
|------|---------|
| 0 | Clean: no cycle, no layer violation, no oversized file or class, coupling at or below 70; or a diagram was produced |
| 1 | Findings: a circular dependency, coupling above 70, a layer violation, a file over 500 lines, a class over ~300 lines, or an unparseable manifest. Each finding quotes the evidence and gives a fix |
| 2 | Unusable input: path missing, not a directory, or a folder with no source files (or no code directories, for the diagram tool). One `BLOCKED:` line on stderr, no traceback |

Detection is name-based: folders called `services/` or `domain/` are read as layers, and folders it cannot place are listed as "not assigned, imports not checked". Confidence and coupling scores are internal heuristics, not industry benchmarks; a low confidence means "no clear pattern", not a defect. The thresholds (500-line file, ~300-line class, coupling 70) are internal heuristics too.

## Quick Start

```bash
# from engineering/senior-architect/ (a small layered Python app with one deliberate back-reference)
python3 scripts/dependency_analyzer.py assets/sample_layered_app            # exit 1: one cycle
python3 scripts/project_architect.py assets/sample_layered_app --format json
python3 scripts/architecture_diagram_generator.py assets/sample_layered_app --format mermaid --type layer
python3 scripts/project_architect.py assets/sound_layered_app               # exit 0: same layout, no back-reference
```

Real output of the first command (exit 1):

```text
Read: 8 source files in 4 modules; package manager: pip (4 direct, 0 dev dependencies)
Coupling: 51/100 (internal heuristic)

Circular dependencies (1):
  controllers -> services -> repositories -> controllers

[WARNING] Circular dependency: controllers -> services -> repositories -> controllers
  Evidence: repositories/order_repository.py:2  `from controllers.order_controller import OrderController`
  Fix: Break the cycle at the closing edge repositories -> controllers (...)

FIX 1 issue(s)
```

`project_architect.py` on the same app reports the same import as a layer violation (infrastructure reaching up into presentation) with the line and a fix. The `sound_layered_app` sample scores 41 on the same coupling heuristic and exits 0; `assets/malformed_project` (documentation only) exits 2.

## Reference Documentation

Load the reference that matches the task — keep this file lean and pull detail on demand:

- **[references/architecture_patterns.md](references/architecture_patterns.md)** — 9 architecture patterns (monolith, modular monolith, microservices, event-driven, CQRS, event sourcing, hexagonal, clean, API gateway) with trade-offs and code examples. Read when asked "which pattern?", "microservices vs monolith", "event-driven", or "CQRS".
- **[references/system_design_workflows.md](references/system_design_workflows.md)** — 6 step-by-step workflows: design interview, capacity planning, API design, database schema design, scalability assessment, migration planning. Read when asked "how to design?", "capacity planning", "API design", or "migration".
- **[references/tech_decision_guide.md](references/tech_decision_guide.md)** — decision frameworks and comparison matrices for database, caching, message queue, auth, frontend framework, cloud provider, and API style. Read when asked "which database/framework/cloud/cache?".
- **[references/decision_workflows.md](references/decision_workflows.md)** — the database-selection, architecture-pattern-selection, and monolith-vs-microservices decision workflows with matrices, checklists, and the ADR template. Read when making a documented architecture decision.
- **[references/tools-and-usage.md](references/tools-and-usage.md)** — detailed per-tool usage, example outputs, full flag tables, common-command catalog, tech-stack coverage, troubleshooting table, and success criteria. Read when running the scripts or interpreting their output.

## Anti-Patterns

**Mistake:** Choosing microservices for a small team or an unclear domain.
**Why it matters:** Service boundaries drawn before the domain is understood get redrawn at the cost of distributed-systems complexity.
**Instead:** Start with a modular monolith with enforced module boundaries, and extract a service when a boundary has proved stable and has its own scaling or release need.

**Mistake:** A decision with no written record.
**Why it matters:** Six months later nobody remembers why, so the decision is relitigated or silently reversed.
**Instead:** Write a short ADR with the options considered and the trigger for revisiting it.

**Mistake:** Treating tool output as the architecture review.
**Why it matters:** Coupling scores and pattern labels are heuristics; they miss runtime coupling such as shared databases and synchronous call chains.
**Instead:** Use the tools to find where to look, then review data ownership and call paths by hand.

## Files

| File | Purpose |
|------|---------|
| `scripts/architecture_diagram_generator.py`, `scripts/dependency_analyzer.py`, `scripts/project_architect.py` | Stdlib CLIs |
| `references/decision_workflows.md` | Decision workflows and the ADR template |
| `assets/sample_layered_app/` | Flawed sample: controllers, services, repositories and models with a repository-to-controller import cycle |
| `assets/sound_layered_app/` | Sound sample: same layout, no back-reference (exit 0) |
| `assets/malformed_project/` | Malformed sample: no source files (exit 2) |
| `assets/contract.json` | Declared runs checked by `scripts/skill_contract_check.py` |
| `references/tools-and-usage.md` | Full flags, example outputs and troubleshooting |

## Scope & Limitations

**Covers:** system-level architecture analysis (pattern detection, layer validation, component diagramming) for existing codebases; technology-agnostic dependency analysis across npm, pip, Poetry, Go modules, and Cargo; architecture decision workflows (database, pattern, monolith-vs-microservices); diagram generation in Mermaid, PlantUML, and ASCII.

**Does NOT cover:**
- Runtime performance profiling or load testing — use `senior-devops` (capacity planning) and `senior-qa` (performance test harnesses).
- Security vulnerability scanning of dependencies — use `senior-security` or `senior-secops` for CVE/SAST/DAST.
- Frontend component architecture and design-system auditing — use `senior-frontend` and `design-auditor`.
- CI/CD pipeline design and deployment orchestration — use `senior-devops` and `release-orchestrator`.

Files in this skill

  • SKILL.md21 KB
  • references/architecture_patterns.md14.1 KB
  • references/system_design_workflows.md11.8 KB
  • references/tech_decision_guide.md12.1 KB
  • scripts/architecture_diagram_generator.py22 KB
  • scripts/dependency_analyzer.py21.2 KB
  • scripts/project_architect.py28.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.