If a valid map.json already exists and nothing changed, CLI reuses the map (timestamp only). Skip node_modules, build, logs, and scan.exclude_dirs.
If CLI is unavailable, generate the same files yourself by scanning (still skip ignore dirs; isolate per-file read failures). If the repo is Vue (vue/nuxt in package.json deps): include .vue files; draw Browser → Vue Router → Page → Component → API (not API Gateway); layer by pages/views, components, composables/stores, api. Non-Vue repos keep the existing heuristics.
Review diagrams: fix wrong edges, rename nodes, add missing externals. Prefer editing the .mmd files then refreshing the Mermaid blocks in overview.md.
Optional charter compare: mark out-of-scope services or missing in-scope capabilities in architecture/findings.md (with confidence) only if charter is approved.
Default: write only under .pm/architecture/. If the user asks to land diagrams in the application tree, show the draft and wait for confirm.
Closing:_closing.md 完整档;只列已生成的架构文件。中文摘要。
Done When
map.json has path-based key_files and non-empty module paths; layer.mmd exists
Diagrams reflect this repo (not generic placeholders)
Ignore dirs were skipped; no secrets in diagram labels or findings
Shared Workflow (all /pm-* commands)
Follow this order when the command mutates .pm/ state:
Read .pm/config/project.yaml and .pm/config/local.yaml (if missing and command is not init → recommend /pm-init).
If .pm/ metadata is valid, load it; do not force a full-repo rescan. On-demand incremental scan using sources + extra_scan_roots + --path + conversation paste (highest priority for /pm-fix). Prefer .pm/architecture/map.json and the document index before walking the tree.
Desensitize evidence → .pm/evidence/scans/{command}-{timestamp}.json (secrets → ***). Never persist raw secrets.
Optional charter compare only when charter.status == approved (attach confidence). Draft PRD/charter MUST NOT be used as the baseline.
Incremental merge into module findings.md / todo.md; sync authoritative state/todo.md.
Refresh state/overview.md with all open/in_progress blocking+high todos (no 3-item cap). Medium/low: counts only unless --verbose.
Append audit to .pm/state/audit.jsonl (command, time, input/output summary; include reasoning when the step was AI-produced).
Output risk summary + recommended next step (≤20 lines). Never auto-write source/SQL/cloud or land generated docs/rules without explicit user confirmation.
Closing:_closing.md 完整档。
Design baseline: docs/prd.md + 宪章。
1---2name: pm-arch3description: PM Manager /pm-arch4---56---7description: Scan project structure and generate Mermaid architecture diagrams + flowcharts under .pm/architecture/.8handoffs:9 - label: Status10 agent: pm.status11 prompt: Summarize after architecture scan12 send: true13---1415## User Input1617```text18$ARGUMENTS19```2021## Outline22231. Require `.pm/` initialized; else recommend `/pm-init`.242. 若已有 `map.json`,先读它。定位文件用 **`pm map <关键词>`**,禁止无过滤全库递归。253. Run **`pm arch`** from the project root (preferred). This writes:26 - `.pm/architecture/map.json` — 导航地图(modules / key_files / capabilities / hotspots / lookup)27 - `.pm/architecture/tree.md` — 带注解目录树28 - `.pm/architecture/overview.md` — 中文总览 + Mermaid29 - `.pm/architecture/layer.mmd` — 分层架构30 - `.pm/architecture/system-context.mmd` / `service-dependencies.mmd` / `request-flow.mmd` / `deploy-flow.mmd`31 - `.pm/architecture/scan.json`324. If a valid `map.json` already exists and nothing changed, CLI reuses the map (timestamp only). Skip `node_modules`, build, logs, and `scan.exclude_dirs`.334. If CLI is unavailable, generate the same files yourself by scanning (still skip ignore dirs; isolate per-file read failures). **If the repo is Vue** (`vue`/`nuxt` in package.json deps): include `.vue` files; draw Browser → Vue Router → Page → Component → API (not API Gateway); layer by pages/views, components, composables/stores, api. Non-Vue repos keep the existing heuristics.345. Review diagrams: fix wrong edges, rename nodes, add missing externals. Prefer editing the `.mmd` files then refreshing the Mermaid blocks in `overview.md`.356. Optional charter compare: mark out-of-scope services or missing in-scope capabilities in `architecture/findings.md` (with confidence) **only if charter is approved**.367. Default: write only under `.pm/architecture/`. If the user asks to land diagrams in the application tree, show the draft and **wait for confirm**.378. **Closing:** `_closing.md` 完整档;只列已生成的架构文件。中文摘要。3839## Done When4041- [ ] `map.json` has path-based `key_files` and non-empty module paths; `layer.mmd` exists42- [ ] Diagrams reflect this repo (not generic placeholders)43- [ ] Ignore dirs were skipped; no secrets in diagram labels or findings444546## Shared Workflow (all /pm-* commands)4748Follow this order when the command mutates `.pm/` state:49501. Read `.pm/config/project.yaml` and `.pm/config/local.yaml` (if missing and command is not init → recommend `/pm-init`).512. If `.pm/` metadata is valid, load it; do **not** force a full-repo rescan. On-demand **incremental** scan using `sources` + `extra_scan_roots` + `--path` + **conversation paste** (highest priority for `/pm-fix`). Prefer `.pm/architecture/map.json` and the document index before walking the tree.523. Desensitize evidence → `.pm/evidence/scans/{command}-{timestamp}.json` (secrets → `***`). Never persist raw secrets.534. Optional charter compare only when `charter.status == approved` (attach `confidence`). Draft PRD/charter MUST NOT be used as the baseline.545. Incremental merge into module `findings.md` / `todo.md`; sync authoritative `state/todo.md`.556. Refresh `state/overview.md` with **all** open/in_progress blocking+high todos (no 3-item cap). Medium/low: counts only unless `--verbose`.567. Append audit to `.pm/state/audit.jsonl` (command, time, input/output summary; include reasoning when the step was AI-produced).578. Output risk summary + recommended next step (≤20 lines). Never auto-write source/SQL/cloud or land generated docs/rules without explicit user confirmation.589. **Closing:** `_closing.md` 完整档。5960Design baseline: `docs/prd.md` + 宪章。
Run npx skillmds@latest add wei63w/pm-arch in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
PM Manager /pm-arch It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
wei63w (@wei63w) published this skill. Their other Agent Skills are listed on their SkillMD profile.