A step-by-step guide to running your first architecture design session with Architor.
- Node.js 18+ — nodejs.org
- Claude Code —
npm install -g @anthropic-ai/claude-code - Python 3 — Required for enforcement hooks
- git — Required for project tracking
Verify everything is installed:
npx arch-agent verifycd your-project
npx arch-agent init --name "My Project"This creates three things:
.arch/— State machine, scripts, and working files.claude/— Commands, skills, and hook configurationCLAUDE.md— Agent identity and rules
Write or paste your Product Requirements Document into .arch/prd.md. This is the input the agent will analyze.
A good PRD includes:
- What the system does (functional requirements)
- How well it must do it (non-functional requirements: latency, uptime, throughput)
- Who uses it (user types, expected scale)
- What it integrates with (external systems, APIs, databases)
Don't worry if your PRD is incomplete — the agent will find the gaps.
Fill in .arch/org-context.md with your team's reality:
- Team size and experience
- Existing tech stack
- Budget and timeline constraints
- Compliance requirements
If you skip this, the agent will interview you in Phase 1 (15 questions, takes ~10 minutes).
claudeType /help to see all available commands.
If you already have an architecture document and want to iterate on it rather than starting from scratch:
cd your-project
npx arch-agent import path/to/your-architecture.md --name "My Project"This scaffolds the project (same as init) and copies your document to .arch/existing-architecture.md. Imported projects get 5 reopens (vs 2) for more iteration room.
claudeType /import-architecture. The agent will:
- Parse your document into sections
- Present each section for adversarial review
- Progress through all 4 phases using the extracted content
The agent presents extracted content from your document. For each phase:
- Accept (
/accept) phases that look correct - Refine (
/refine [feedback]) phases that need changes - Challenge — push back on decisions that seem outdated
$ npx arch-agent import docs/architecture-v2.md --name "Payment Platform v3"
$ claude
You: /import-architecture
Agent: [parses document, presents Phase 1 evaluation of extracted requirements]
Agent: "Your document lists 12 functional requirements. I found 3 critical gaps: ..."
You: /accept
Agent: [presents Phase 2A — reviews extracted microservices pattern]
Agent: "Your document chose microservices for a 6-person team. Have you considered..."
You: /refine We've grown to 15 engineers since this was written
Agent: [updates pattern analysis with new team context]
You: /accept
[... continues through all phases ...]
/analyze-prd
What happens:
- If
org-context.mdis empty, the agent offers a discovery interview (3 blocks of 5 questions about scale, team, and constraints) - The agent reads your PRD and produces a structured analysis:
- Extracted functional requirements (FR-001, FR-002...)
- Non-functional requirements (found or flagged as missing)
- Gaps rated by severity (Critical / Important / Minor)
- Risk assessment across 5 dimensions
- Overall quality rating
What you do:
- Answer the agent's questions about gaps
- Push back if something is wrong or missing
- Use
/refineto request changes to the analysis - When satisfied:
/accept
Example interaction:
You: /analyze-prd
Agent: [reads PRD, produces analysis, asks 5 pointed questions about gaps]
You: /refine The latency requirement is 200ms p99, not p50. Also add the HIPAA compliance constraint.
Agent: [updates analysis with corrections]
You: /accept
Agent: Phase 1 accepted. Run /propose-methodology to begin Phase 2.
/propose-methodology
What happens: The agent proposes an architecture pattern (e.g., modular monolith, microservices, serverless) with:
- Rationale tied to your specific requirements and team
- Trade-offs — what this approach sacrifices
- At least 2 alternatives with pros/cons
What you do:
- Evaluate the pattern against your team's reality
- Use
/alternativeto see a different approach - Use
/refineto adjust the proposal - When satisfied:
/accept
/propose-methodology
(The command auto-routes to the next sub-phase.)
What happens: The agent maps all system components:
- Component names and responsibilities
- Dependencies between components
- Integration points
- High-level technology suggestions
What you do:
- Check for missing components or unnecessary ones
- Validate that all integrations are accounted for
/refineor/accept
/propose-methodology
What happens: The agent proposes system-wide decisions in 5 areas:
| Area | Example Decisions |
|---|---|
| Auth | JWT with RS256, Keycloak as IdP, RBAC model |
| Observability | Structured JSON logs, OpenTelemetry traces, Prometheus metrics |
| Deployment | Docker containers, Kubernetes, GitLab CI/CD |
| Error Handling | Retry with exponential backoff, circuit breakers on external calls |
| Data Management | Each service owns its data, eventual consistency between services |
Why this matters: These decisions constrain every component in Phase 3. Without them, each component would make different choices, leading to inconsistency.
What you do:
- Review each area for feasibility
- Ensure your team can actually operate these choices
/refineor/accept
/design-component api-gateway
(After accepting one component, the agent auto-advances to the next.)
What happens (per component):
- Detailed design with specific technology + version
- Integration points: inputs, outputs, protocols, data formats
- API contracts
- Failure modes and recovery strategies
- Operational concerns: monitoring, alerting, scaling
- Compliance check against Phase 2C cross-cutting decisions
What you do:
- Validate the technology choice against your team's skills
- Check that integration points match adjacent components
- Ensure failure modes are realistic, not just happy-path
- For critical components, run
/review-component [name]for an adversarial review /accepteach component
Example interaction:
You: /design-component auth-service
Agent: [detailed design with Keycloak, OAuth2 flows, token management, failure modes]
You: /refine We need to support SAML for enterprise SSO, not just OAuth2
Agent: [updates design to include SAML alongside OAuth2]
You: /accept
Agent: auth-service accepted (3/8 components). Starting api-gateway...
/generate-docs
What happens:
- Validation — The agent traces critical user journeys through all components, checking integration points and cross-cutting compliance
- Risk register — Probability x impact scoring for all identified risks
- Document generation — Comprehensive architecture document consolidating all decisions
What you do:
- Review the validation findings (fix critical issues with
/reopenif needed) - Review the generated document in
output/architecture-document.md /acceptto complete the process
| Command | When to Use |
|---|---|
/analyze-prd |
Start Phase 1 — evaluate your PRD |
/propose-methodology |
Start/continue Phase 2 — auto-routes to 2A, 2B, or 2C |
/design-component [name] |
Phase 3 — design a specific component |
/generate-docs |
Phase 4 — validate and generate final document |
| Command | When to Use |
|---|---|
/accept |
Accept the current proposal and advance |
/refine [feedback] |
Request specific changes to current proposal |
/alternative [request] |
Request a completely different approach |
/reopen [target] [reason] |
Go back to fix a previous decision (max 2 per project) |
| Command | When to Use |
|---|---|
/status |
See current progress across all phases |
/decision-log |
View all recorded decisions |
/review-component [name] |
Launch adversarial review of a component |
/help |
See available commands for current phase |
Sometimes you realize a Phase 2 decision was wrong after seeing its effects in Phase 3. The /reopen command lets you go back:
/reopen phase 2c "After designing the auth-service, we need to switch from session-based to token-based auth"
Rules:
- Maximum 2 reopens per project (prevents design thrashing)
- You must provide a justification (logged as a decision)
- Reopening cascades: downstream phases are un-accepted
- Reopen 2A → un-accepts 2A, 2B, 2C, and all Phase 3 components become
needs-review - Reopen 2C → un-accepts 2C only, Phase 3 components become
needs-review - Reopen a component → that component goes back to
in_progress, dependents becomeneeds-review
- Reopen 2A → un-accepts 2A, 2B, 2C, and all Phase 3 components become
Use reopens sparingly. The cascading cost is intentional — it makes you think carefully before going back.
- Write a real PRD, not bullet points. The agent's analysis quality is proportional to your PRD quality.
- Fill in org-context.md if you know your constraints. The interview is useful for discovery, but direct input is faster if you already know the answers.
- Use a capable model. Architecture decisions require nuanced reasoning. Opus produces significantly better results than Haiku.
- Push back on the agent. It's designed to be challenged. If a recommendation feels wrong, say so and explain why.
- Use
/refineliberally. Iteration is cheap. Acceptance is permanent (unless you spend a reopen). - Run
/statusoften. It shows exactly where you are and what's next. - Use
/review-componenton critical components. The adversarial review catches things the standard design flow misses.
- Agent seems confused about state: Run
/statusto force a state re-read, or/clearto reset conversation context (file state is preserved). - Hook blocks a valid operation: Check
.arch/state.jsonto understand why. The error message from the hook explains the violation. - Need to start over:
npx arch-agent resetbacks up your state and resets to a clean slate (preserves your PRD and org-context).
Here's a realistic session from start to finish:
$ cd my-payment-platform
$ npx arch-agent init --name "Payment Platform"
$ claude
You: /analyze-prd
Agent: [reads PRD, notices org-context is empty, offers interview]
You: A (accept interview)
Agent: [15 questions across Scale, Team, Constraints]
You: [answers questions]
Agent: [derives complexity tier: Growth, generates org-context.md]
Agent: [produces PRD analysis with 3 critical gaps, 5 important gaps]
You: /refine Add that we also need PCI-DSS compliance for card data
Agent: [updates analysis]
You: /accept
You: /propose-methodology
Agent: [proposes modular monolith with rationale: 8-person team, PCI scope reduction]
You: /accept
You: /propose-methodology
Agent: [maps 6 components: API Gateway, Payment Engine, Card Vault, Notification Service, Admin Dashboard, Audit Logger]
You: /refine Split Audit Logger into Audit Service and Compliance Reporter
Agent: [updates to 7 components]
You: /accept
You: /propose-methodology
Agent: [cross-cutting: mTLS for service auth, structured JSON logging, Kubernetes deployment, retry with circuit breakers, PCI-compliant data isolation]
You: /accept
You: /design-component api-gateway
Agent: [detailed design: Kong Gateway 3.x, rate limiting, JWT validation]
You: /accept
Agent: Starting payment-engine...
[... continues through all 7 components ...]
You: /generate-docs
Agent: [validates end-to-end, builds risk register, generates 13-section document]
You: /accept
Done! Architecture document: output/architecture-document.md
After initialization, your project contains:
your-project/
├── CLAUDE.md # Agent identity + phase rules
├── .arch/
│ ├── state.json # State machine (don't edit manually)
│ ├── prd.md # Your PRD (edit this)
│ ├── org-context.md # Your constraints (edit this)
│ ├── decisions.md # Auto-generated decision log
│ ├── scripts/
│ │ ├── validate-transition.py # Hard enforcement hook
│ │ └── log-decision.py # Auto-logging hook
│ ├── components/ # Phase 3 component designs
│ └── reviews/ # Adversarial review findings
├── .claude/
│ ├── settings.json # Hook configuration
│ ├── commands/ # 14 slash commands
│ └── skills/ # 4 auto-activating skills
└── output/
└── architecture-document.md # Phase 4 final deliverable
Files you edit: prd.md, org-context.md
Files the agent generates: everything in components/, reviews/, decisions.md, output/
Files you never touch: state.json, scripts/, settings.json