architect
npx machina-cli add skill karim-bhalwani/agent-skills-collection/architect --openclawArchitect Skill - System Design & Specification
Overview
The Architect skill focuses on the "What" and "Where" of a system, rather than the "How." It is used to design robust, scalable, and maintainable software architectures using black-box principles.
Core Principles
- Black Box Interfaces: Modules are defined by what they do, hiding how they do it.
- Replaceable Components: Design modules so they can be rewritten from scratch using only their interface.
- Single Responsibility: One module = one clear purpose.
- Primitive-First Design: Identify core data types (primitives) and design the system around their flow.
- Human-Centric: Optimize designs for cognitive load—one developer should be able to understand any single module.
Workflow
- Understand: Analyze requirements and identify core business logic primitives.
- Define Boundaries: Determine where modules start and end.
- Design Contracts: Define API endpoints, data models, and interface protocols.
- Map Dependencies: Ensure no circular dependencies exist (Dry-run Dependency Map).
- Output Specification: Produce a
spec.mdthat serves as the source of truth for implementation.
Mandatory Output: spec.md Template
Every architectural design must produce or update a specification following this structure:
- Feature Name & Overview: High-level goal and identified primitives.
- File Structure: Proposed directory and file layout.
- Data Models: Table/Object schemas with validation rules.
- API Contracts: Method, Path, Payload, and Response (RFC 7807 for errors).
- Architecture Diagrams: Mermaid diagrams showing component flow.
- Dependency Map: Table identifying module interactions and risks.
- Replaceability Assessment: Confirmation that modules can be reimplemented from their interfaces.
When to Use
- Starting a new feature.
- Major system refactors.
- Defining database schemas or API contracts.
- Identifying and isolating system risks.
Outputs & Deliverables
- Primary Output:
spec.md- Complete technical specification document - Success Criteria: All stakeholders approve the specification before implementation begins
- Quality Gate: Specification passes review by implementer and guardian skills
Standards & Best Practices
Black Box Design
- Define modules by their contracts, not implementations
- Ensure each module has a single, clear responsibility
- Design for replaceability - any module should be rewritable from its interface
Data Flow Architecture
- Identify core business primitives early
- Map data transformations through the system
- Ensure no circular dependencies in the dependency graph
Constraints
- NO implementation code. Snippets for interfaces or data models only.
- NO testing logic.
- NO deployment configs.
Common Pitfalls
- Over-Engineering: Designing for every possible future scenario. Start with the simplest design that solves today's problem; refactor when needs emerge.
- God Modules: Creating one massive module instead of breaking concerns. Single Responsibility is non-negotiable.
- Circular Dependencies: Not catching these during design leads to unmaintainable code. Always verify the dependency graph is acyclic.
- Unclear Module Boundaries: When developers can't explain what a module does in one sentence, the boundary is fuzzy. Refactor immediately.
- Missing API Contracts: Vague interfaces lead to integration errors downstream. Always document input/output types, validation rules, and error responses.
- Ignoring Primitive Selection: Choosing the wrong core data types cascades through the entire design. Validate primitives early.
Integration Points
| Phase | Input From | Output To | Context |
|---|---|---|---|
| Discovery | brainstorming, thinker | This spec | Understand requirements and constraints |
| Specification | Core business logic | implementer, data-modeler | Implement according to spec |
| Validation | N/A | guardian | Review for security and patterns |
| Operations | Deployment requirements | ops-manager | Infrastructure needs based on architecture |
Source
git clone https://github.com/karim-bhalwani/agent-skills-collection/blob/main/skills/architect/SKILL.mdView on GitHub Overview
Architect focuses on the What and Where of a system, not the How. It enables designing robust, scalable software architectures using black-box principles and clear module boundaries. It also emphasizes API contracts, primitive-driven design, and dependency mapping for maintainability.
How This Skill Works
Start by understanding requirements to identify core primitives, then define module boundaries and design contracts. Map dependencies with a dry-run to ensure an acyclic graph, and output a spec.md template that serves as the source of truth for implementation.
When to Use It
- Starting a new feature or service and needing a formal specification.
- Major system refactors where boundaries or contracts will change.
- Defining database schemas or API contracts.
- Identifying and isolating system risks through dependency analysis.
- Reviewing architecture for replaceability and component interchangeability.
Quick Start
- Step 1: Understand requirements and identify core primitives.
- Step 2: Define module boundaries and API contracts.
- Step 3: Generate the spec.md template and attach a dependency map.
Best Practices
- Define modules by contracts, not implementations.
- Ensure each module has a single clear responsibility.
- Design for replaceability so modules can be rewritten from their interfaces.
- Identify core primitives early and model data flow.
- Verify the dependency graph is acyclic and free of circular dependencies.
Example Use Cases
- Draft a spec.md for a microservices platform with clear API contracts.
- Define API contracts for a fintech payments module.
- Map dependencies to remove circular references in a legacy app.
- Refactor a monolith by isolating modules into replaceable components.
- Document data models and interfaces for a data ingestion pipeline.