{"slug":"senior-architect-2","title":"senior-architect","summary":"System architecture decisions with a written rationale: monolith vs microservices, database choice, scaling limits, ADRs, Mermaid diagrams. Load whenever the user asks should we split, which database, will it scale, or wants an ADR.","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-12-02T16:53:24.773214Z","repo":{"url":"https://github.com/beginwithu/agent-skills","stars":11,"forks":2,"license":"MIT","updatedAt":"2026-12-02T16:37:11Z"},"bodyHtml":"<hr>\n<h2>name: senior-architect\ndescription: \"System architecture decisions with a written rationale: monolith vs microservices, database choice, scaling limits, ADRs, Mermaid diagrams. Load whenever the user asks should we split, which database, will it scale, or wants an ADR.\"</h2>\n<h1>Senior Architect</h1>\n<p>Architecture design and analysis tools for making informed technical decisions.</p>\n<h2>Table of Contents</h2>\n<ul>\n<li><a href=\"#quick-start\">Quick Start</a></li>\n<li><a href=\"#tools-overview\">Tools Overview</a>\n<ul>\n<li><a href=\"#1-architecture-diagram-generator\">Architecture Diagram Generator</a></li>\n<li><a href=\"#2-dependency-analyzer\">Dependency Analyzer</a></li>\n<li><a href=\"#3-project-architect\">Project Architect</a></li>\n</ul>\n</li>\n<li><a href=\"#decision-workflows\">Decision Workflows</a>\n<ul>\n<li><a href=\"#database-selection-workflow\">Database Selection</a></li>\n<li><a href=\"#architecture-pattern-selection-workflow\">Architecture Pattern Selection</a></li>\n<li><a href=\"#monolith-vs-microservices-decision\">Monolith vs Microservices</a></li>\n</ul>\n</li>\n<li><a href=\"#reference-documentation\">Reference Documentation</a></li>\n<li><a href=\"#tech-stack-coverage\">Tech Stack Coverage</a></li>\n<li><a href=\"#common-commands\">Common Commands</a></li>\n</ul>\n<hr>\n<h2>Quick Start</h2>\n<pre><code># Generate architecture diagram from project\npython scripts/architecture_diagram_generator.py ./my-project --format mermaid\n\n# Analyze dependencies for issues\npython scripts/dependency_analyzer.py ./my-project --output json\n\n# Get architecture assessment\npython scripts/project_architect.py ./my-project --verbose\n</code></pre>\n<hr>\n<h2>Tools Overview</h2>\n<h3>1. Architecture Diagram Generator</h3>\n<p>Generates architecture diagrams from project structure in multiple formats.</p>\n<p><strong>Solves:</strong> \"I need to visualize my system architecture for documentation or team discussion\"</p>\n<p><strong>Input:</strong> Project directory path\n<strong>Output:</strong> Diagram code (Mermaid, PlantUML, or ASCII)</p>\n<p><strong>Supported diagram types:</strong></p>\n<ul>\n<li><code>component</code> - Shows modules and their relationships</li>\n<li><code>layer</code> - Shows architectural layers (presentation, business, data)</li>\n<li><code>deployment</code> - Shows deployment topology</li>\n</ul>\n<p><strong>Usage:</strong></p>\n<pre><code># Mermaid format (default)\npython scripts/architecture_diagram_generator.py ./project --format mermaid --type component\n\n# PlantUML format\npython scripts/architecture_diagram_generator.py ./project --format plantuml --type layer\n\n# ASCII format (terminal-friendly)\npython scripts/architecture_diagram_generator.py ./project --format ascii\n\n# Save to file\npython scripts/architecture_diagram_generator.py ./project -o architecture.md\n</code></pre>\n<p><strong>Example output (Mermaid):</strong></p>\n<pre>graph TD\n    A[API Gateway] --&gt; B[Auth Service]\n    A --&gt; C[User Service]\n    B --&gt; D[(PostgreSQL)]\n    C --&gt; D\n</pre>\n<hr>\n<h3>2. Dependency Analyzer</h3>\n<p>Analyzes project dependencies for coupling, circular dependencies, and outdated packages.</p>\n<p><strong>Solves:</strong> \"I need to understand my dependency tree and identify potential issues\"</p>\n<p><strong>Input:</strong> Project directory path\n<strong>Output:</strong> Analysis report (JSON or human-readable)</p>\n<p><strong>Analyzes:</strong></p>\n<ul>\n<li>Dependency tree (direct and transitive)</li>\n<li>Circular dependencies between modules</li>\n<li>Coupling score (0-100)</li>\n<li>Outdated packages</li>\n</ul>\n<p><strong>Supported package managers:</strong></p>\n<ul>\n<li>npm/yarn (<code>package.json</code>)</li>\n<li>Python (<code>requirements.txt</code>, <code>pyproject.toml</code>)</li>\n<li>Go (<code>go.mod</code>)</li>\n<li>Rust (<code>Cargo.toml</code>)</li>\n</ul>\n<p><strong>Usage:</strong></p>\n<pre><code># Human-readable report\npython scripts/dependency_analyzer.py ./project\n\n# JSON output for CI/CD integration\npython scripts/dependency_analyzer.py ./project --output json\n\n# Check only for circular dependencies\npython scripts/dependency_analyzer.py ./project --check circular\n\n# Verbose mode with recommendations\npython scripts/dependency_analyzer.py ./project --verbose\n</code></pre>\n<p><strong>Example output:</strong></p>\n<pre><code>Dependency Analysis Report\n==========================\nTotal dependencies: 47 (32 direct, 15 transitive)\nCoupling score: 72/100 (moderate)\n\nIssues found:\n- CIRCULAR: auth → user → permissions → auth\n- OUTDATED: lodash 4.17.15 → 4.17.21 (security)\n\nRecommendations:\n1. Extract shared interface to break circular dependency\n2. Update lodash to fix CVE-2020-8203\n</code></pre>\n<hr>\n<h3>3. Project Architect</h3>\n<p>Analyzes project structure and detects architectural patterns, code smells, and improvement opportunities.</p>\n<p><strong>Solves:</strong> \"I want to understand the current architecture and identify areas for improvement\"</p>\n<p><strong>Input:</strong> Project directory path\n<strong>Output:</strong> Architecture assessment report</p>\n<p><strong>Detects:</strong></p>\n<ul>\n<li>Architectural patterns (MVC, layered, hexagonal, microservices indicators)</li>\n<li>Code organization issues (god classes, mixed concerns)</li>\n<li>Layer violations</li>\n<li>Missing architectural components</li>\n</ul>\n<p><strong>Usage:</strong></p>\n<pre><code># Full assessment\npython scripts/project_architect.py ./project\n\n# Verbose with detailed recommendations\npython scripts/project_architect.py ./project --verbose\n\n# JSON output\npython scripts/project_architect.py ./project --output json\n\n# Check specific aspect\npython scripts/project_architect.py ./project --check layers\n</code></pre>\n<p><strong>Example output:</strong></p>\n<pre><code>Architecture Assessment\n=======================\nDetected pattern: Layered Architecture (confidence: 85%)\n\nStructure analysis:\n  ✓ controllers/  - Presentation layer detected\n  ✓ services/     - Business logic layer detected\n  ✓ repositories/ - Data access layer detected\n  ⚠ models/       - Mixed domain and DTOs\n\nIssues:\n- LARGE FILE: UserService.ts (1,847 lines) - consider splitting\n- MIXED CONCERNS: PaymentController contains business logic\n\nRecommendations:\n1. Split UserService into focused services\n2. Move business logic from controllers to services\n3. Separate domain models from DTOs\n</code></pre>\n<hr>\n<h2>Decision Workflows</h2>\n<h3>Database Selection Workflow</h3>\n<p>Use when choosing a database for a new project or migrating existing data.</p>\n<p><strong>Step 1: Identify data characteristics</strong></p>\n<table>\n<thead>\n<tr>\n<th>Characteristic</th>\n<th>Points to SQL</th>\n<th>Points to NoSQL</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Structured with relationships</td>\n<td>✓</td>\n<td></td>\n</tr>\n<tr>\n<td>ACID transactions required</td>\n<td>✓</td>\n<td></td>\n</tr>\n<tr>\n<td>Flexible/evolving schema</td>\n<td></td>\n<td>✓</td>\n</tr>\n<tr>\n<td>Document-oriented data</td>\n<td></td>\n<td>✓</td>\n</tr>\n<tr>\n<td>Time-series data</td>\n<td></td>\n<td>✓ (specialized)</td>\n</tr>\n</tbody>\n</table>\n<p><strong>Step 2: Evaluate scale requirements</strong></p>\n<ul>\n<li>&lt;1M records, single region → PostgreSQL or MySQL</li>\n<li>1M-100M records, read-heavy → PostgreSQL with read replicas</li>\n<li>\n<blockquote>\n<p>100M records, global distribution → CockroachDB, Spanner, or DynamoDB</p>\n</blockquote>\n</li>\n<li>High write throughput (&gt;10K/sec) → Cassandra or ScyllaDB</li>\n</ul>\n<p><strong>Step 3: Check consistency requirements</strong></p>\n<ul>\n<li>Strong consistency required → SQL or CockroachDB</li>\n<li>Eventual consistency acceptable → DynamoDB, Cassandra, MongoDB</li>\n</ul>\n<p><strong>Step 4: Document decision</strong>\nCreate an ADR (Architecture Decision Record) with:</p>\n<ul>\n<li>Context and requirements</li>\n<li>Options considered</li>\n<li>Decision and rationale</li>\n<li>Trade-offs accepted</li>\n</ul>\n<p><strong>Quick reference:</strong></p>\n<pre><code>PostgreSQL → Default choice for most applications\nMongoDB    → Document store, flexible schema\nRedis      → Caching, sessions, real-time features\nDynamoDB   → Serverless, auto-scaling, AWS-native\nTimescaleDB → Time-series data with SQL interface\n</code></pre>\n<hr>\n<h3>Architecture Pattern Selection Workflow</h3>\n<p>Use when designing a new system or refactoring existing architecture.</p>\n<p><strong>Step 1: Assess team and project size</strong></p>\n<table>\n<thead>\n<tr>\n<th>Team Size</th>\n<th>Recommended Starting Point</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>1-3 developers</td>\n<td>Modular monolith</td>\n</tr>\n<tr>\n<td>4-10 developers</td>\n<td>Modular monolith or service-oriented</td>\n</tr>\n<tr>\n<td>10+ developers</td>\n<td>Consider microservices</td>\n</tr>\n</tbody>\n</table>\n<p><strong>Step 2: Evaluate deployment requirements</strong></p>\n<ul>\n<li>Single deployment unit acceptable → Monolith</li>\n<li>Independent scaling needed → Microservices</li>\n<li>Mixed (some services scale differently) → Hybrid</li>\n</ul>\n<p><strong>Step 3: Consider data boundaries</strong></p>\n<ul>\n<li>Shared database acceptable → Monolith or modular monolith</li>\n<li>Strict data isolation required → Microservices with separate DBs</li>\n<li>Event-driven communication fits → Event-sourcing/CQRS</li>\n</ul>\n<p><strong>Step 4: Match pattern to requirements</strong></p>\n<table>\n<thead>\n<tr>\n<th>Requirement</th>\n<th>Recommended Pattern</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Rapid MVP development</td>\n<td>Modular Monolith</td>\n</tr>\n<tr>\n<td>Independent team deployment</td>\n<td>Microservices</td>\n</tr>\n<tr>\n<td>Complex domain logic</td>\n<td>Domain-Driven Design</td>\n</tr>\n<tr>\n<td>High read/write ratio difference</td>\n<td>CQRS</td>\n</tr>\n<tr>\n<td>Audit trail required</td>\n<td>Event Sourcing</td>\n</tr>\n<tr>\n<td>Third-party integrations</td>\n<td>Hexagonal/Ports &amp; Adapters</td>\n</tr>\n</tbody>\n</table>\n<p>See <code>references/architecture_patterns.md</code> for detailed pattern descriptions.</p>\n<hr>\n<h3>Monolith vs Microservices Decision</h3>\n<p><strong>Choose Monolith when:</strong></p>\n<ul>\n<li><input disabled=\"disabled\" type=\"checkbox\"> Team is small (&lt;10 developers)</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> Domain boundaries are unclear</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> Rapid iteration is priority</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> Operational complexity must be minimized</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> Shared database is acceptable</li>\n</ul>\n<p><strong>Choose Microservices when:</strong></p>\n<ul>\n<li><input disabled=\"disabled\" type=\"checkbox\"> Teams can own services end-to-end</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> Independent deployment is critical</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> Different scaling requirements per component</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> Technology diversity is needed</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> Domain boundaries are well understood</li>\n</ul>\n<p><strong>Hybrid approach:</strong>\nStart with a modular monolith. Extract services only when:</p>\n<ol>\n<li>A module has significantly different scaling needs</li>\n<li>A team needs independent deployment</li>\n<li>Technology constraints require separation</li>\n</ol>\n<hr>\n<h2>Reference Documentation</h2>\n<p>Load these files for detailed information:</p>\n<table>\n<thead>\n<tr>\n<th>File</th>\n<th>Contains</th>\n<th>Load when user asks about</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>references/architecture_patterns.md</code></td>\n<td>9 architecture patterns with trade-offs, code examples, and when to use</td>\n<td>\"which pattern?\", \"microservices vs monolith\", \"event-driven\", \"CQRS\"</td>\n</tr>\n<tr>\n<td><code>references/system_design_workflows.md</code></td>\n<td>6 step-by-step workflows for system design tasks</td>\n<td>\"how to design?\", \"capacity planning\", \"API design\", \"migration\"</td>\n</tr>\n<tr>\n<td><code>references/tech_decision_guide.md</code></td>\n<td>Decision matrices for technology choices</td>\n<td>\"which database?\", \"which framework?\", \"which cloud?\", \"which cache?\"</td>\n</tr>\n</tbody>\n</table>\n<hr>\n<h2>Tech Stack Coverage</h2>\n<p><strong>Languages:</strong> TypeScript, JavaScript, Python, Go, Swift, Kotlin, Rust\n<strong>Frontend:</strong> React, Next.js, Vue, Angular, React Native, Flutter\n<strong>Backend:</strong> Node.js, Express, FastAPI, Go, GraphQL, REST\n<strong>Databases:</strong> PostgreSQL, MySQL, MongoDB, Redis, DynamoDB, Cassandra\n<strong>Infrastructure:</strong> Docker, Kubernetes, Terraform, AWS, GCP, Azure\n<strong>CI/CD:</strong> GitHub Actions, GitLab CI, CircleCI, Jenkins</p>\n<hr>\n<h2>Common Commands</h2>\n<pre><code># Architecture visualization\npython scripts/architecture_diagram_generator.py . --format mermaid\npython scripts/architecture_diagram_generator.py . --format plantuml\npython scripts/architecture_diagram_generator.py . --format ascii\n\n# Dependency analysis\npython scripts/dependency_analyzer.py . --verbose\npython scripts/dependency_analyzer.py . --check circular\npython scripts/dependency_analyzer.py . --output json\n\n# Architecture assessment\npython scripts/project_architect.py . --verbose\npython scripts/project_architect.py . --check layers\npython scripts/project_architect.py . --output json\n</code></pre>\n<hr>\n<h2>Getting Help</h2>\n<ol>\n<li>Run any script with <code>--help</code> for usage information</li>\n<li>Check reference documentation for detailed patterns and workflows</li>\n<li>Use <code>--verbose</code> flag for detailed explanations and recommendations</li>\n</ol>\n","files":[{"path":"LICENSE","sizeBytes":1072,"isText":false},{"path":"references/architecture_patterns.md","sizeBytes":14448,"isText":true},{"path":"references/system_design_workflows.md","sizeBytes":12130,"isText":true},{"path":"references/tech_decision_guide.md","sizeBytes":12405,"isText":true},{"path":"scripts/architecture_diagram_generator.py","sizeBytes":22526,"isText":true},{"path":"scripts/dependency_analyzer.py","sizeBytes":21690,"isText":true},{"path":"scripts/project_architect.py","sizeBytes":28955,"isText":true},{"path":"SKILL.md","sizeBytes":10744,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-12-02T16:55:28.568778Z","sha256":"28F69502BAE809AD4C2D232B8A97641801DF7B78FC8AEB600CC2BD44276C29D8","sizeBytes":36075},"review":null,"source":{"repositoryUrl":"https://github.com/beginwithu/agent-skills","path":"skills/senior-architect","license":"MIT","commit":"a960304c52212f2e845067047f5cefc0c594d787","subtreeSha":"9B202391E11234FFA1A3E70FF6917BDE79E535FF4F25CA7D111DFA95C1658A08","lastSyncedAt":"2026-12-02T16:52:59.20206Z"},"reviewedAt":"2026-12-02T16:59:34.805987Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/beginwithu/agent-skills/tree/main/skills/senior-architect"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install beginwithu-agent-skills@llmmart"},{"target":"git","command":"git clone https://github.com/beginwithu/agent-skills.git"}]}