xiaohongshu
xiaohongshu
maintain-architecture-map
Maintain system architecture documentation (ARCHITECTURE_MAP.md) showing module structure, data flows, and entry points. Use this skill when architecture changes, modules are added, or system overview needs updating.
Full skill instructions
Maintain a living architecture document that shows the system's big picture: modules, data flows, entry points, and dependencies.
Keep ARCHITECTURE_MAP.md and related architecture docs synchronized with the actual codebase, providing:
Complementary to maintain-data-structures:
Example:
maintain-data-structures documents: PDPTWInstance has attributes n, order_table, distance_matrixmaintain-architecture-map documents: PDPTWInstance is created in Data layer, consumed by Algorithm layer, visualized by Visualization layerTrigger this skill when:
Identify current module organization:
Reference: references/scanning_scripts.md for automation ideas
Key directories to scan:
vrp_toolkit/
├── problems/ # Problem definitions (PDPTW, VRP, etc.)
├── algorithms/ # Solving algorithms (ALNS, GA, etc.)
├── data/ # Data generation and loading
├── visualization/ # Plotting and visualization
└── utils/ # Common utilities
For each module, extract:
__init__.py docstring or README)__init__.py)__init__.py)Entry points are where users start using the toolkit:
Common entry point types:
Problem creation:
PDPTWInstance(order_table) - Create problem from datagenerate_pdptw_instance(...) - Generate synthetic problemAlgorithm execution:
ALNSSolver.solve(problem) - Solve using ALNSgreedy_insertion_initial_solution(...) - Generate initial solutionData generation:
OrderGenerator.generate() - Generate order dataRealMap(...) - Create synthetic mapVisualization:
PDPTWVisualizer.visualize(solution) - Plot routesDocument in ARCHITECTURE_MAP.md with:
Trace how data moves through the system:
Primary data flow (Problem → Solution):
1. Data Layer: Generate/load data
↓
2. Problem Layer: Create Instance (PDPTWInstance)
↓
3. Algorithm Layer: Solve Instance → Solution (ALNSSolver.solve())
↓
4. Visualization: Visualize Solution (PDPTWVisualizer.visualize())
Secondary data flows:
Reference: Create .claude/docs/data_flows.md for detailed flow diagrams
Map which modules depend on which:
Dependency rules (VRP-Toolkit architecture):
Create dependency graph:
Data ────────┐
↓
Problem ←────┘
↓
Algorithm
↓
Visualization
Reference: Create .claude/docs/module_dependencies.md for full dependency map
Use the template from references/architecture_template.md:
Required sections:
Formatting guidelines:
Create/update .claude/docs/ as needed:
data_flows.md - Detailed data flow diagrams
module_dependencies.md - Dependency graph
extension_guide.md - How to extend the system
# VRP-Toolkit Architecture Map
**Last Updated:** YYYY-MM-DD
**Version:** 0.1.0
## System Overview
[2-3 paragraphs describing the toolkit]
## Three-Layer Architecture
### 1. Problem Layer (vrp_toolkit/problems/)
[Description + key classes]
### 2. Algorithm Layer (vrp_toolkit/algorithms/)
[Description + key classes]
### 3. Data Layer (vrp_toolkit/data/)
[Description + key classes]
### 4. Visualization Layer (vrp_toolkit/visualization/)
[Description + key classes]
## Module Guide
### problems/
**Purpose:** [One sentence]
**Key Exports:**
- `PDPTWInstance` - [Purpose]
- `VRPProblem` - [Purpose]
[Repeat for each module]
## Entry Points
### 1. Create a Problem
```python
from vrp_toolkit.problems.pdptw import PDPTWInstance
instance = PDPTWInstance(order_table=df)
from vrp_toolkit.algorithms.alns import ALNSSolver
solver = ALNSSolver(config)
solution = solver.solve(instance)
[Continue for main workflows]
[ASCII diagram or mermaid]
[Describe VRPProblem, VRPSolution, Solver interfaces]
[How to add new problems/algorithms]
[Cheat sheet table]
Full template: `references/architecture_template.md`
## Automation Helpers
### Script: Scan Module Structure
```python
# scripts/scan_modules.py
from pathlib import Path
import importlib
def scan_module(module_path):
"""Scan a module and extract public API."""
init_file = module_path / "__init__.py"
if not init_file.exists():
return None
# Read __init__.py
content = init_file.read_text()
# Extract __all__ if present
if "__all__" in content:
# Parse __all__ list
pass
# Extract docstring
# Extract classes/functions
return {
'name': module_path.name,
'docstring': '...',
'exports': [...]
}
def scan_all_modules():
"""Scan all vrp_toolkit modules."""
toolkit_path = Path("vrp-toolkit/vrp_toolkit")
modules = []
for module_dir in toolkit_path.iterdir():
if module_dir.is_dir() and not module_dir.name.startswith('_'):
info = scan_module(module_dir)
if info:
modules.append(info)
return modules
Reference: See references/scanning_scripts.md for full scripts
Before marking ARCHITECTURE_MAP.md as up-to-date:
Works with:
Maintains:
.claude/ARCHITECTURE_MAP.md - Main architecture document.claude/docs/data_flows.md - Data flow diagrams.claude/docs/module_dependencies.md - Dependency graphWhen adding a new module (e.g., vrp_toolkit/algorithms/genetic/):
Add entry to "Module Guide" section:
### algorithms/genetic/
**Purpose:** Genetic algorithm solver for VRP problems
**Key Exports:**
- `GeneticSolver` - Main GA solver implementing Solver interface
- `GAConfig` - Configuration for genetic parameters
Update "Entry Points" if new public API:
### 3. Solve with Genetic Algorithm
```python
from vrp_toolkit.algorithms.genetic import GeneticSolver
solver = GeneticSolver(config)
solution = solver.solve(instance)
Update dependency graph if needed
When documenting a new data flow (e.g., "How does configuration work?"):
Create ASCII diagram:
User Input
↓
UI Widgets (Streamlit)
↓
ALNSConfig (dataclass)
↓
ALNSSolver.__init__(config)
↓
ALNS.run() uses config params
Add text explanation
Link from ARCHITECTURE_MAP.md to detailed docs
When architecture changes (e.g., "Split ALNS into solver.py and operators.py"):
references/architecture_template.md - Full ARCHITECTURE_MAP.md templatereferences/scanning_scripts.md - Automation scripts for module scanningmaintain-data-structures/ skill - For detailed data structure docsRemember: ARCHITECTURE_MAP.md is for the big picture. For detailed class/function documentation, use maintain-data-structures skill.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience