Install
$ agentstack add skill-tikalk-adlc-team-skills-architect-init ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
architect-init
What this skill does
Reverse-engineer architecture from an existing codebase (brownfield) to create Architecture Decision Records (ADRs) documenting discovered decisions, then validate the findings by running /architect-clarify manually.
You act as an Architecture Archaeologist uncovering implicit architectural decisions from code by scanning the codebase for technology choices and patterns, inferring architectural decisions from code structure, documenting discovered patterns as ADRs, and identifying gaps where decisions are unclear.
Output:
- ADRs documenting inferred architectural decisions in
{REPO_ROOT}/.adlc/drafts/adr/ADR-{NNN}.md(individual file format) - Auto-generated index at
{REPO_ROOT}/.adlc/drafts/adr/adr.md - Validate Findings: Run
/architect-clarifyto validate discovered decisions
Key Difference from /architect-specify:
/architect-init(this skill) = Discovers what's already implemented in code/architect-specify= Explores new possibilities for greenfield projects
This skill focuses on current state analysis - what IS, not what SHOULD BE.
When to use
- Brownfield projects: Existing code without architecture docs
- Legacy modernization: Understanding current state before changes
- Team onboarding: Quickly documenting implicit decisions
- Technical debt assessment: Identifying undocumented patterns
When NOT to use
- Greenfield projects: Use
/architect-specifyfor new projects - Architecture exists: If
AD.mdexists, use/architect-clarifyto refine - Feature-level: Feature architecture (if Spec Kit extension is also installed)
Process
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Examples of User Input:
"Django monolith with PostgreSQL, React frontend, AWS deployment""Node.js microservices with MongoDB and RabbitMQ""Legacy Java application, focus on understanding data layer"- Empty input: Scan entire codebase and infer architecture
When users provide context, use it to focus the reverse-engineering effort.
Flags
--adr-heuristic HEURISTIC: ADR generation strategysurprising(default): Skip obvious ecosystem defaults, document only surprising/risky decisionsall: Document all discovered decisionsminimal: Only high-risk decisions
--no-decompose: Disable automatic sub-system detection from code structure (default: auto-detect if multiple modules detected)
Role & Context
You are acting as an Architecture Archaeologist uncovering implicit architectural decisions from code. Your role involves:
- Scanning codebase for technology choices and patterns
- Inferring architectural decisions from code structure
- Documenting discovered patterns as ADRs
- Identifying gaps where decisions are unclear
Brownfield vs Greenfield
| Scenario | Command | Input | Output | |----------|---------|-------|--------| | Brownfield (existing code) | /architect-init | Codebase scan | Inferred ADRs | | Greenfield (new project) | /architect-specify | PRD/requirements | Discussed ADRs |
Rozanski & Woods Alignment
When discovering ADRs from brownfield code, map findings to R&W viewpoints:
| Discovery Area | Primary Viewpoint | What to Look For | |---------------|-------------------|------------------| | Service structure | Functional | Component boundaries, responsibilities | | Database schemas | Information | Data entities, relationships | | Process/thread code | Concurrency | Runtime units, coordination | | Directory structure | Development | Module organization, dependencies | | Deployment configs | Deployment | Infrastructure, environments | | Monitoring/alerting | Operational | Operations support |
Functional-as-Cornerstone for Brownfield: Even in brownfield discovery, the Functional structure is foundational:
- Discover Functional first: Identify components, services, modules
- Map other discoveries: Relate data, deployment, operations to functional elements
- Document dependencies: Note which ADRs affect the Functional view
Priority order for ADR discovery:
- Architecture Style ADRs (monolith/microservices) → Functional cornerstone
- Component/Service ADRs → Functional view
- Database/Data ADRs → Information view
- Infrastructure ADRs → Deployment view
- Communication/Async ADRs → Concurrency view
- Development/CI ADRs → Development view
- Operations ADRs → Operational view
Outline
- Sub-System Detection (Phase 0): Identify sub-systems from code structure (auto-detect)
- Codebase Scan: Analyze project structure and detect technologies (per sub-system if decomposed)
- Documentation Deduplication: Scan existing docs (README, AGENTS.md, {TEAMAIDIRECTIVES}/AGENTS.md if configured, etc.) to avoid repeating
- Pattern Detection: Identify architectural patterns in use
- ADR Generation: Create ADRs for discovered decisions (marked "Discovered"), organized by sub-system
- Gap Analysis: Identify areas where decisions are unclear
- Output: Write ADRs to
{REPO_ROOT}/.adlc/drafts/adr/ADR-{NNN}.md(NO AD.md creation)
- After writing all ADRs, the setup script auto-generates
adr.mdindex
- Validate Findings: Run
/architect-clarifyto validate brownfield findings
Execution Steps
Phase 0: Sub-System Detection (Brownfield)
Objective: Identify sub-systems from existing code structure automatically
When: This phase runs automatically when the codebase is detected as having multiple distinct modules/packages. Use --no-decompose to skip.
Detection Source Reconciliation (CRITICAL): The setup script may report "No distinct sub-systems detected from directory structure" while your AI analysis identifies sub-systems through code patterns (import relationships, technology boundaries, domain logic). When this occurs:
- TRUST your AI analysis over the script output
- ALWAYS execute Step 4 with your identified sub-systems
- NEVER default to monolithic analysis when you've identified sub-systems through ANY method
- The threshold logic applies to ALL detected sub-systems, regardless of detection source
Step 1: Directory Structure Analysis
Analyze the codebase for distinct sub-systems based on directory structure:
| Pattern | Likely Sub-System | |---------|------------------| | src/auth/ | Authentication sub-system | | src/users/ | User management sub-system | | services/payment/ | Payment sub-system | | modules/inventory/ | Inventory sub-system | | apps/api/, apps/web/ | Monorepo with separate apps | | lib/core/, lib/shared/ | Shared libraries (not a sub-system) |
Step 2: Package/Module Detection
Detect sub-systems from package/module structures:
| Pattern | Detection Method | Sub-System Evidence | |---------|------------------|-------------------| | Node.js workspaces | package.json workspaces | Multiple packages = multiple sub-systems | | Python namespaces | __init__.py hierarchy | Multiple top-level packages | | Go modules | go.mod + directories | Multiple directories under cmd/ | | Maven/Gradle | pom.xml modules | Multiple modules in multi-module project | | Docker services | docker-compose services | Each service = sub-system |
Step 3: Database Schema Analysis
If database is accessible, detect sub-systems from schema:
| Pattern | Evidence | |---------|----------| | Table prefixes | auth_, user_, payment_ tables = separate domains | | PostgreSQL schemas | auth., payments. schema separation | | Separate databases | Multiple databases in docker-compose |
Step 4: Sub-System Proposal (Interactive) - MANDATORY if sub-systems identified
Present detected sub-systems to user for confirmation:
## Detected Sub-Systems
I've identified the following sub-systems from your codebase:
| # | Sub-System | Detection Method | Evidence |
|---|------------|-----------------|----------|
| 1 | **auth** | Directory + Module | src/auth/, auth/ package |
| 2 | **users** | Directory | src/users/, services/user/ |
| 3 | **payments** | Directory + Docker | services/payment/, payment service in docker-compose |
| 4 | **inventory** | Directory | src/inventory/, modules/stock/ |
### Questions for Confirmation:
1. **Are these sub-systems correct?** [Y/n]
2. **Should any sub-systems be merged?** (e.g., auth + users → identity)
3. **Should any sub-systems be split?** (e.g., payments → billing + subscriptions)
4. **Any missing sub-systems?** (e.g., analytics, reporting)
**Reply** with:
- `Y` to confirm and proceed
- `n` to disable decomposition (generate monolithic ADRs)
- Specific changes (e.g., "merge 1+2", "split 3", "add Notifications")
CRITICAL: If you have identified ANY sub-systems through ANY method (script detection, AI analysis of code patterns, or user input), you MUST execute this step.
- Do NOT proceed to Phase 1 as "monolithic" if sub-systems exist
- Do NOT ignore sub-systems detected through AI analysis just because the script reported "none detected"
- You MUST get user confirmation when 4+ sub-systems are identified
Failure to follow this step invalidates the entire ADR discovery process.
Step 5: Decomposition Decision
Based on user response:
| Response | Action | |----------|--------| | Y / Enter | Proceed with detected sub-systems | | n | Skip decomposition, generate monolithic ADRs | | Modifications | Adjust sub-systems, then proceed | | Empty/Default | Auto-proceed if ≤3 sub-systems, ask if >3 |
Threshold Logic Enforcement (MANDATORY - applies to ALL detected sub-systems, regardless of source):
| Sub-System Count | Required Action | Can Skip User Confirmation? | |-----------------|-----------------|---------------------------| | 0 | Proceed as monolithic (no decomposition) | Yes | | 1-3 | Show summary, auto-approve allowed | Yes | | 4-6 | MUST show summary and ask user confirmation | NO | | >6 | MUST suggest grouping and MUST ask confirmation | NO |
Enforcement Rules:
- If you identified sub-systems through AI analysis but the script reported "none detected" → Apply threshold logic to YOUR identified sub-systems
- If threshold is 4+ → You MUST NOT proceed without user confirmation
- If you skip this logic → The ADR generation is invalid and may produce incorrect architecture
- Self-check before Phase 1: Did I present Step 4? Did I apply threshold logic? If 4+ sub-systems, did I get confirmation?
Step 6: Output
After confirmation, output structured sub-system data:
{
"decomposition": "enabled",
"subsystems": [
{"id": "auth", "name": "Auth", "detection_method": "directory", "evidence": "src/auth/"},
{"id": "users", "name": "Users", "detection_method": "directory", "evidence": "src/users/"},
{"id": "payments", "name": "Payments", "detection_method": "docker", "evidence": "payment service in docker-compose"}
],
"next_phase": "Codebase Analysis (per sub-system)"
}
If decomposition disabled:
{
"decomposition": "disabled",
"reason": "user_requested",
"next_phase": "Codebase Analysis (monolithic)"
}
Phase 1: Codebase Analysis
Objective: Discover what technologies and patterns are in use
Note: If sub-system decomposition is enabled (Phase 0), analyze each sub-system separately to provide focused insights.
- Run Setup Script:
- Execute
scripts/bash/setup-architect.shto initialize architecture files - Script scans codebase and outputs structured findings
- Pass
--no-decomposeif decomposition was disabled - If decomposed: Script outputs sub-system breakdown for targeted analysis
- Technology Detection (Per Sub-System):
| Indicator | Technology Category | Files to Check | |-----------|---------------------|----------------| | package.json | Node.js ecosystem | Dependencies, scripts | | requirements.txt / pyproject.toml | Python ecosystem | Dependencies | | pom.xml / build.gradle | JVM ecosystem | Dependencies | | Cargo.toml | Rust | Dependencies | | go.mod | Go | Dependencies | | Dockerfile | Containerization | Base images, stages | | docker-compose.yml | Container orchestration | Services, networks | | *.tf / *.tfvars | Terraform/IaC | Infrastructure | | kubernetes/*.yaml | Kubernetes | Deployment configs | | .github/workflows/* | GitHub Actions | CI/CD |
- Framework Detection:
| Pattern | Framework | Evidence | |---------|-----------|----------| | from django imports | Django | Python web | | @SpringBoot | Spring Boot | Java web | | import express | Express.js | Node.js web | | import { Component } | React/Angular/Vue | Frontend | | from fastapi | FastAPI | Python API |
- Database Detection:
| Evidence | Database Type | |----------|---------------| | PostgreSQL connection strings | PostgreSQL | | MongoDB/mongoose imports | MongoDB | | Redis client imports | Redis cache | | ORM migrations | Relational DB | | DynamoDB SDK usage | AWS DynamoDB |
Phase 2: Pattern Recognition
Objective: Identify architectural patterns from code structure
Architecture Style Detection
| Pattern | Evidence | ADR Topic | |---------|----------|-----------| | Monolith | Single deployable, shared database | ADR: System Architecture Style | | Microservices | Multiple services, service discovery | ADR: System Architecture Style | | Modular Monolith | Single deploy, module boundaries | ADR: System Architecture Style | | Event-Driven | Message queue usage, event handlers | ADR: Communication Pattern | | Serverless | Lambda functions, managed services | ADR: Deployment Model |
Code Organization Detection
| Pattern | Evidence | |---------|----------| | Layered | controllers/, services/, repositories/ | | Feature-Based | features/, modules/ per domain | | Clean Architecture | domain/, application/, infrastructure/ | | Hexagonal | ports/, adapters/ |
API Style Detection
| Pattern | Evidence | |---------|----------| | REST | Route decorators, HTTP verbs, resource URLs | | GraphQL | Schema files, resolvers, gql imports | | gRPC | .proto files, gRPC client/server setup | | WebSocket | Socket.io, WebSocket handlers |
Phase 3: Documentation Deduplication
Objective: Scan existing docs to avoid repeating documented information
Scan for:
AGENTS.md- Project context, overview{TEAM_AI_DIRECTIVES}/AGENTS.md- Team-wide agent usage instructions (if configured)README.md- Tech stack, project descriptionCONTRIBUTING.md- Development guidelinesAD.mdordocs/architecture.md- Existing architectureLICENSE- Legal context
Deduplication Rules:
| Finding | Action | |---------|--------| | Tech stack in README | Reference README in ADR, don't duplicate | | Architecture exists | Auto-merge or offer update vs. create new | | Guidelines in CONTRIBUTING | Reference in Development View | | Context in AGENTS.md | Link from Context View | | Team directives AGENTS.md | Reference for team-wide agent instructions |
Process:
- Run
scripts/bash/setup-architect.shwhich callsscan_existing_docs() - Parse findings from JSON output
- For each finding, determine: Skip ADR / Reference existing / Document new
- Report: "X decisions covered by existing docs, Y new ADRs created"
Phase 4: ADR Generation
Objective: Document discovered decisions as ADRs
For each discovered architectural decision:
- Identify the Decision:
- What technology/pattern was chosen?
- What alternatives were available when this was built?
- What forces likely drove this dec
…
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: tikalk
- Source: tikalk/adlc-team-skills
- License: MIT
- Homepage: https://github.com/tikalk/agentic-sdlc-12-factors
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.