skills/refresh-architecture/SKILL.md
Refresh architecture analysis artifacts (docs/architecture-analysis/) from the codebase
npx skillsauth add jankneumann/agentic-coding-tools refresh-architectureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Regenerate, validate, or inspect the docs/architecture-analysis/ artifacts that describe the codebase structure. These artifacts power planning, parallel-zone identification, and cross-layer flow tracing.
$ARGUMENTS - Optional mode selector and flags:
| Argument | Description |
|----------|-------------|
| (empty) | Full pipeline: analyze + compile + validate + views + report |
| --validate | Validate the existing graph (no regeneration) |
| --views | Regenerate views and parallel zones from existing graph |
| --report | Generate Markdown report from existing Layer 2 artifacts |
| --diff <sha> | Compare current graph to a baseline commit |
| --feature <files> | Extract a feature-slice subgraph for the given files |
| --clean | Remove all generated artifacts |
source agent-coordinator/.venv/bin/activate)npm with ts-morph installed (make architecture-setup)agent-coordinator/src, web/, agent-coordinator/database/migrations) should existModes that regenerate, rewrite, or clean docs/architecture-analysis/ artifacts
MUST run in a managed worktree in local CLI execution:
CHANGE_ID="refresh-architecture-<short-slug>"
eval "$(python3 "<skill-base-dir>/../worktree/scripts/worktree.py" setup "$CHANGE_ID")"
cd "$WORKTREE_PATH"
skills/.venv/bin/python skills/shared/checkout_policy.py require-mutation
Pure read-only inspection modes may run from the shared checkout when they do not write files.
The analysis pipeline has 3 layers:
Layer 1: Code Analysis (per-language)
analyze_python.py -> python_analysis.json
analyze_postgres.py -> postgres_analysis.json
analyze_typescript.ts -> ts_analysis.json
Layer 2: Insight Synthesis (from Layer 1 outputs)
graph_builder -> architecture.graph.json
cross_layer_linker -> (updates graph with api_call edges)
db_linker -> (updates graph with db_access edges)
flow_tracer -> cross_layer_flows.json
impact_ranker -> high_impact_nodes.json
summary_builder -> architecture.summary.json
validate_flows -> architecture.diagnostics.json
parallel_zones -> parallel_zones.json
Layer 3: Report Aggregation
generate_views -> views/*.mmd (Mermaid diagrams)
architecture_report -> architecture.report.md
ARGS="$ARGUMENTS"
Determine which mode to run based on the arguments.
--full)Run the complete 3-layer pipeline:
make architecture
This calls "<skill-base-dir>/scripts/refresh_architecture.sh" which runs all layers in sequence. Expect output showing each stage completing.
When to use: After significant code changes, before planning a new feature, or when artifacts are stale/missing.
--validate)make architecture-validate
Runs schema validation and flow validation on the existing graph. Does NOT regenerate — just checks what's there.
When to use: After implementing changes to verify no cross-layer flows were broken. Good for CI checks.
--views)make architecture-views
Regenerates Mermaid diagrams and parallel zones from the existing graph.
When to use: When you need updated diagrams but the graph itself hasn't changed.
--report)make architecture-report
Generates architecture.report.md from all Layer 2 JSON artifacts.
When to use: When you need a human-readable summary of the current architecture state.
--diff <sha>)make architecture-diff BASE_SHA=<sha>
Compares the current architecture graph to a baseline from the given commit SHA. Reports new cycles, new high-impact modules, untested routes, and structural changes.
When to use: Before merging a PR, to understand the architectural impact of the changes.
--feature <files>)make architecture-feature FEATURE="<comma-separated files or glob>"
Extracts a subgraph containing only the nodes and edges relevant to the specified files. Produces a Mermaid diagram and JSON in docs/architecture-analysis/views/.
When to use: To understand the blast radius of changing specific files, or to visualize a feature's dependency footprint.
--clean)make architecture-clean
Removes all generated artifacts. The committed README and schema files are preserved.
When to use: When artifacts are corrupted or you want a fresh start.
After running, report to the user:
architecture.summary.json:
architecture.diagnostics.json:
parallel_zones.json:
If the user asks to commit, stage the docs/architecture-analysis/ directory:
git add docs/architecture-analysis/
Architecture artifacts are designed to be committed to the repo so agents can consult them during planning.
| File | Purpose |
|------|---------|
| docs/architecture-analysis/architecture.graph.json | Canonical graph (nodes, edges, entrypoints) |
| docs/architecture-analysis/architecture.summary.json | Compact summary with stats and flows |
| docs/architecture-analysis/architecture.diagnostics.json | Validation findings |
| docs/architecture-analysis/parallel_zones.json | Independent module groups for safe parallel work |
| docs/architecture-analysis/cross_layer_flows.json | Frontend-to-database flow traces |
| docs/architecture-analysis/high_impact_nodes.json | Nodes with many transitive dependents |
| docs/architecture-analysis/architecture.report.md | Human-readable Markdown report |
| docs/architecture-analysis/views/*.mmd | Mermaid diagrams at multiple zoom levels |
/plan-feature: Run full pipeline to ensure agents have current architecture context/implement-feature: Run --validate after code changes to check for broken flows/validate-feature: Run --diff against the base branch to understand architectural impactmake architecture-validate to catch regressionstesting
Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes.
tools
Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, search vault content, perform vault operations from the command line, or develop and debug Obsidian plugins and themes.
data-ai
Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.
tools
Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian.