@zeyue0329/xiaoma-cli 1.17.1-next.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/xmc-skills/1-analysis/xiaoma-project-handover/SKILL.md +99 -0
- package/src/xmc-skills/1-analysis/xiaoma-project-handover/checklist.md +68 -0
- package/src/xmc-skills/1-analysis/xiaoma-project-handover/customize.toml +41 -0
- package/src/xmc-skills/1-analysis/xiaoma-project-handover/steps/step-01-scope-and-orient.md +89 -0
- package/src/xmc-skills/1-analysis/xiaoma-project-handover/steps/step-02-business-flows.md +69 -0
- package/src/xmc-skills/1-analysis/xiaoma-project-handover/steps/step-03-third-party-integrations.md +64 -0
- package/src/xmc-skills/1-analysis/xiaoma-project-handover/steps/step-04-design-and-tradeoffs.md +36 -0
- package/src/xmc-skills/1-analysis/xiaoma-project-handover/steps/step-05-pitfalls-and-legacy.md +42 -0
- package/src/xmc-skills/1-analysis/xiaoma-project-handover/steps/step-06-assemble-handover.md +58 -0
- package/src/xmc-skills/1-analysis/xiaoma-project-handover/templates/handover-template.md +132 -0
- package/src/xmc-skills/module-help.csv +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: xiaoma-project-handover
|
|
3
|
+
description: 'Produce a new-hire handover manual (HANDOVER.md) for an existing/brownfield project: business data-flow main chains (with sequence diagrams), a complete third-party integration inventory (name/purpose/call style/config location/failure-degradation), design highlights & trade-offs (the "why"), and known pitfalls / traps / legacy debt (weird naming, implicit dependencies, temporary hacks, perf & concurrency risks). Use when the user says "项目交接 / 交接文档 / handover", "onboard a new engineer", "梳理这个项目", or asks how the data flows / what third parties are integrated / where the pitfalls are.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Project Handover Workflow
|
|
7
|
+
|
|
8
|
+
**Goal:** Produce a comprehensive, human-readable handover manual (`HANDOVER.md`) that lets a new engineer take over an unfamiliar project — the tribal knowledge that source code and generic docs do not capture.
|
|
9
|
+
|
|
10
|
+
**Your Role:** You are a staff engineer running an offboarding/handover session. You read the real code, trace how business data actually flows, catalog every external dependency, explain *why* the system is built the way it is, and write down the traps so the next person does not step on them. You separate verified facts from inferences, and you cite `file:line` for every claim.
|
|
11
|
+
|
|
12
|
+
## How this differs from `document-project`
|
|
13
|
+
|
|
14
|
+
`document-project` produces AI-context / brownfield-PRD documentation (architecture.md, api-contracts, data-models, index). This skill produces a **human handover manual** focused on the four things a newcomer most needs and code alone cannot tell them: the end-to-end business flow sequence, the third-party integration map (including failure/degradation behavior), the design rationale and trade-offs, and the known pitfalls / legacy debt. If `document-project` output already exists in `{project_knowledge}/`, **reuse it as input** instead of re-deriving the architecture.
|
|
15
|
+
|
|
16
|
+
## Conventions
|
|
17
|
+
|
|
18
|
+
- Bare paths (e.g. `checklist.md`) resolve from the skill root.
|
|
19
|
+
- `{skill-root}` resolves to this skill's installed directory (where `customize.toml` lives).
|
|
20
|
+
- `{project-root}`-prefixed paths resolve from the project working directory.
|
|
21
|
+
- `{skill-name}` resolves to the skill directory's basename.
|
|
22
|
+
|
|
23
|
+
## On Activation
|
|
24
|
+
|
|
25
|
+
### Step 1: Resolve the Workflow Block
|
|
26
|
+
|
|
27
|
+
Run: `node {project-root}/_xiaoma/scripts/resolve_customization.js --skill {skill-root} --key workflow`
|
|
28
|
+
|
|
29
|
+
**If the script fails**, resolve the `workflow` block yourself by reading these three files in base → team → user order and applying the same structural merge rules as the resolver:
|
|
30
|
+
|
|
31
|
+
1. `{skill-root}/customize.toml` — defaults
|
|
32
|
+
2. `{project-root}/_xiaoma/custom/{skill-name}.toml` — team overrides
|
|
33
|
+
3. `{project-root}/_xiaoma/custom/{skill-name}.user.toml` — personal overrides
|
|
34
|
+
|
|
35
|
+
Any missing file is skipped. Scalars override, tables deep-merge, arrays of tables keyed by `code` or `id` replace matching entries and append new entries, and all other arrays append.
|
|
36
|
+
|
|
37
|
+
### Step 2: Execute Prepend Steps
|
|
38
|
+
|
|
39
|
+
Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding.
|
|
40
|
+
|
|
41
|
+
### Step 3: Load Persistent Facts
|
|
42
|
+
|
|
43
|
+
Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. Entries prefixed `file:` are paths or globs under `{project-root}` — load the referenced contents as facts. All other entries are facts verbatim.
|
|
44
|
+
|
|
45
|
+
### Step 4: Load Config
|
|
46
|
+
|
|
47
|
+
Load config from `{project-root}/_xiaoma/xmc/config.yaml` and resolve:
|
|
48
|
+
|
|
49
|
+
- `project_name`, `user_name`, `user_skill_level`
|
|
50
|
+
- `communication_language` — for all chat communication
|
|
51
|
+
- `document_output_language` — for all written artifact content
|
|
52
|
+
- `project_knowledge` — output location AND where prior `document-project` artifacts (index.md, architecture.md, …) may already live
|
|
53
|
+
- `date` as system-generated current datetime
|
|
54
|
+
- CLAUDE.md / `**/project-context.md` / README / CONTRIBUTING / docs/ / ADRs (load summaries if they exist)
|
|
55
|
+
- YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
|
|
56
|
+
- YOU MUST ALWAYS WRITE all artifact and document content in `{document_output_language}`
|
|
57
|
+
- **If `config.yaml` does not exist** (XiaoMa is not installed in the target, or you are documenting a raw source repo — including XiaoMa's own source): do NOT abort. Fall back to caller-provided runtime parameters or sensible defaults (write output under `{project_knowledge}` or a `docs/` folder; communicate in the user's language), and continue.
|
|
58
|
+
|
|
59
|
+
### Step 5: Greet the User
|
|
60
|
+
|
|
61
|
+
Greet `{user_name}` (if you have not already), speaking in `{communication_language}`.
|
|
62
|
+
|
|
63
|
+
### Step 6: Execute Append Steps
|
|
64
|
+
|
|
65
|
+
Execute each entry in `{workflow.activation_steps_append}` in order.
|
|
66
|
+
|
|
67
|
+
Activation is complete. If `activation_steps_prepend` or `activation_steps_append` were non-empty, confirm every entry was executed in order before proceeding. Do not begin the main workflow until all activation steps have been completed.
|
|
68
|
+
|
|
69
|
+
## WORKFLOW ARCHITECTURE
|
|
70
|
+
|
|
71
|
+
This uses **step-file architecture** for disciplined execution:
|
|
72
|
+
|
|
73
|
+
- **Micro-file Design**: Each step is self-contained and followed exactly
|
|
74
|
+
- **Just-In-Time Loading**: Only load the current step file
|
|
75
|
+
- **Sequential Enforcement**: Complete steps in order, no skipping
|
|
76
|
+
- **Write-as-you-go**: Each analysis step writes its section straight into `HANDOVER.md`, then purges the raw findings from context — keep only a one-line summary so long codebases do not exhaust context. (For small/medium codebases you may instead keep findings in context so cross-section references — e.g. a pitfall in §6 citing a flow stage in §3 — stay consistent; the purge is an optimization for large codebases, not a mandate.)
|
|
77
|
+
|
|
78
|
+
### Step Processing Rules
|
|
79
|
+
|
|
80
|
+
1. **READ COMPLETELY**: Read the entire step file before acting
|
|
81
|
+
2. **FOLLOW SEQUENCE**: Execute sections in order
|
|
82
|
+
3. **WAIT FOR INPUT**: Halt at checkpoints and wait for human
|
|
83
|
+
4. **LOAD NEXT**: When directed, read fully and follow the next step file
|
|
84
|
+
|
|
85
|
+
### Critical Rules (NO EXCEPTIONS)
|
|
86
|
+
|
|
87
|
+
- **NEVER** load multiple step files simultaneously
|
|
88
|
+
- **NEVER** modify the project's source code — this workflow is read-only over the codebase; it only writes the handover manual under `{project_knowledge}`
|
|
89
|
+
- **ALWAYS** cite evidence as `file:line` (or `file`) for every concrete claim; mark anything you could not verify as an inference to confirm with the original author
|
|
90
|
+
- **ALWAYS** halt at checkpoints and wait for human input — UNLESS autonomous mode is on (see below)
|
|
91
|
+
- **Autonomous / non-interactive mode**: if the caller sets `autonomous = true`, or the trigger explicitly asks to run without stopping (e.g. "自动跑完", "don't stop to ask"), do NOT halt at any CHECKPOINT. Proceed using the best available default (scope = whole project unless specified; chain shortlist = the top candidates you ranked), and record every assumption you made in the final summary instead of asking.
|
|
92
|
+
|
|
93
|
+
### Optional: parallel deep scans
|
|
94
|
+
|
|
95
|
+
If your runtime supports launching parallel sub-agents (e.g. a Task tool), you MAY delegate the four deep scans (business flows, third-party integrations, design & trade-offs, pitfalls & legacy) to parallel read-only sub-agents to manage context, then merge their structured findings. This is an optimization, not a requirement — if unavailable, run the steps sequentially with write-as-you-go.
|
|
96
|
+
|
|
97
|
+
## FIRST STEP
|
|
98
|
+
|
|
99
|
+
Read fully and follow: `./steps/step-01-scope-and-orient.md`
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Project Handover — Validation Checklist
|
|
2
|
+
|
|
3
|
+
Run this before declaring the handover manual complete. Every box must be checked or explicitly waived with a reason recorded in section 10 (Open Questions).
|
|
4
|
+
|
|
5
|
+
## Coverage of the four required pillars
|
|
6
|
+
|
|
7
|
+
### Business data-flow main chains (section 3)
|
|
8
|
+
|
|
9
|
+
- [ ] At least the 3 most important business main chains are documented (not just one)
|
|
10
|
+
- [ ] Each chain names its trigger (HTTP / MQ / scheduled job / callback) with `file:line`
|
|
11
|
+
- [ ] Each chain has a Mermaid sequence diagram covering entry → service → rules → persistence → external/writeback
|
|
12
|
+
- [ ] Each chain has a stage table (stage / entry / key class·method / input / processing / output·state-change / persistence / failure handling)
|
|
13
|
+
- [ ] Sync vs async hops (MQ / thread pool) are distinguished
|
|
14
|
+
- [ ] Transaction boundaries, idempotency keys, and compensation/rollback are noted where they exist
|
|
15
|
+
- [ ] State machines / status enums are documented where present
|
|
16
|
+
|
|
17
|
+
### Third-party integration inventory (section 4)
|
|
18
|
+
|
|
19
|
+
- [ ] Dependency manifests were scanned (package.json / pom.xml / build.gradle / go.mod / requirements.txt / Gemfile, etc.)
|
|
20
|
+
- [ ] HTTP/RPC clients and middleware (DB, cache, MQ, object storage, config/registry center, search, monitoring) are all included
|
|
21
|
+
- [ ] For EVERY integration: name, purpose, call style, key client class, config location (file:key), auth, and **failure-degradation behavior** are filled — no blanks
|
|
22
|
+
- [ ] Failure handling explicitly states retry / circuit-breaker / fallback / degrade / none for each integration
|
|
23
|
+
- [ ] An "environment & secrets" note tells a new dev what is needed to run locally and where secrets live
|
|
24
|
+
|
|
25
|
+
### Design highlights & trade-offs (section 5)
|
|
26
|
+
|
|
27
|
+
- [ ] Key design decisions / patterns / extension points are listed (not just "uses Spring")
|
|
28
|
+
- [ ] Each entry explains the problem it solves AND why it was chosen AND what was traded off
|
|
29
|
+
- [ ] Each entry is marked as verified (doc/comment/ADR/commit) vs inferred (needs author confirmation)
|
|
30
|
+
|
|
31
|
+
### Known pitfalls & legacy debt (section 6)
|
|
32
|
+
|
|
33
|
+
- [ ] Marker scan was run (TODO / FIXME / HACK / XXX / @Deprecated / workaround / 临时 / 兼容 / 历史 / 慎改 / 坑)
|
|
34
|
+
- [ ] At least the categories present in the code are covered: traps, implicit dependencies, temporary hacks, perf/concurrency, weird naming, legacy
|
|
35
|
+
- [ ] Each pitfall has location, symptom/risk, trigger condition, how-to-avoid, and severity
|
|
36
|
+
|
|
37
|
+
## Newcomer usability
|
|
38
|
+
|
|
39
|
+
- [ ] Section 1 (Orientation) lets a stranger build a mental model and run the project
|
|
40
|
+
- [ ] Section 2 (Module map) answers "to change feature X, which module do I touch?"
|
|
41
|
+
- [ ] Section 7 (Glossary) defines the non-obvious terms / abbreviations / status codes / table names used in the doc
|
|
42
|
+
- [ ] Section 8 (Onboarding checklist) gives concrete first steps including a starter task
|
|
43
|
+
- [ ] Section 9 (Troubleshooting pointers) maps common symptoms to where to look first
|
|
44
|
+
|
|
45
|
+
## Evidence & honesty
|
|
46
|
+
|
|
47
|
+
- [ ] Concrete claims cite `file:line` (or `file`) — not vague generalities
|
|
48
|
+
- [ ] Inferences are clearly flagged with the ⚠️ marker and collected in section 10 (Open Questions)
|
|
49
|
+
- [ ] No fabricated APIs, tables, or integrations — only what exists in the code
|
|
50
|
+
|
|
51
|
+
## Output hygiene
|
|
52
|
+
|
|
53
|
+
- [ ] HANDOVER.md written to `{project_knowledge}/`
|
|
54
|
+
- [ ] No leftover `<!-- FILL` markers remain in the final document
|
|
55
|
+
- [ ] No template comment blocks (the single-chain template, etc.) remain
|
|
56
|
+
- [ ] Mermaid diagrams are syntactically valid (render-checkable) — no raw `<` `>` `{` `}` in diagram message text (they break the parser; use plain words like `applyNo`)
|
|
57
|
+
- [ ] Document is written in `{document_output_language}`
|
|
58
|
+
- [ ] Markdown renders cleanly (tables aligned, code fences closed)
|
|
59
|
+
|
|
60
|
+
## Completion criteria
|
|
61
|
+
|
|
62
|
+
The handover manual is complete when:
|
|
63
|
+
|
|
64
|
+
1. All four required pillars (sections 3–6) are concrete and non-empty
|
|
65
|
+
2. Every integration row has a failure-degradation value
|
|
66
|
+
3. No `<!-- FILL` markers or template scaffolding remain
|
|
67
|
+
4. Inferences are flagged and gathered in Open Questions
|
|
68
|
+
5. The user has reviewed and confirmed the manual is usable for onboarding
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# DO NOT EDIT -- overwritten on every update.
|
|
2
|
+
#
|
|
3
|
+
# Workflow customization surface for xiaoma-project-handover. Mirrors the
|
|
4
|
+
# agent customization shape under the [workflow] namespace.
|
|
5
|
+
|
|
6
|
+
[workflow]
|
|
7
|
+
|
|
8
|
+
# --- Configurable below. Overrides merge per XiaoMa structural rules: ---
|
|
9
|
+
# scalars: override wins • arrays (persistent_facts, activation_steps_*): append
|
|
10
|
+
# arrays-of-tables with `code`/`id`: replace matching items, append new ones.
|
|
11
|
+
|
|
12
|
+
# Steps to run before the standard activation (config load, greet).
|
|
13
|
+
# Overrides append. Use for pre-flight loads, compliance checks, etc.
|
|
14
|
+
|
|
15
|
+
activation_steps_prepend = []
|
|
16
|
+
|
|
17
|
+
# Steps to run after greet but before the workflow begins.
|
|
18
|
+
# Overrides append. Use for context-heavy setup that should happen
|
|
19
|
+
# once the user has been acknowledged.
|
|
20
|
+
|
|
21
|
+
activation_steps_append = []
|
|
22
|
+
|
|
23
|
+
# Persistent facts the workflow keeps in mind for the whole run
|
|
24
|
+
# (handover conventions, in-house terminology, compliance constraints).
|
|
25
|
+
# Distinct from the runtime memory sidecar — these are static context
|
|
26
|
+
# loaded on activation. Overrides append.
|
|
27
|
+
#
|
|
28
|
+
# Each entry is either:
|
|
29
|
+
# - a literal sentence, e.g. "All third-party calls must document their failure-degradation behavior."
|
|
30
|
+
# - a file reference prefixed with `file:`, e.g. "file:{project-root}/docs/glossary.md"
|
|
31
|
+
# (glob patterns are supported; the file's contents are loaded and treated as facts).
|
|
32
|
+
|
|
33
|
+
persistent_facts = [
|
|
34
|
+
"file:{project-root}/**/project-context.md",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
# Scalar: executed when the workflow reaches its terminal stage, after
|
|
38
|
+
# the main output has been delivered. Override wins. Leave empty for
|
|
39
|
+
# no custom post-completion behavior.
|
|
40
|
+
|
|
41
|
+
on_complete = ""
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: '' # set at runtime: "whole-project" | "module:<path>" | "flow:<name>"
|
|
3
|
+
output_dir: '' # set at runtime: resolved {project_knowledge}
|
|
4
|
+
handover_doc: '' # set at runtime: {output_dir}/HANDOVER.md
|
|
5
|
+
git_ref: '' # set at runtime: current commit / "no-vcs"
|
|
6
|
+
priority_flows: '' # set at runtime: business flows the user wants prioritized
|
|
7
|
+
autonomous: false # set true by the caller to auto-proceed at every CHECKPOINT without halting
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
> These frontmatter fields are **in-memory working variables** for this run. There is no file to write them back to — carry their values forward across steps in context. `autonomous` may be set by the caller (or inferred from a "run without stopping" trigger).
|
|
11
|
+
|
|
12
|
+
# Step 1: Scope & Orient
|
|
13
|
+
|
|
14
|
+
## RULES
|
|
15
|
+
|
|
16
|
+
- YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
|
|
17
|
+
- YOU MUST ALWAYS WRITE all artifact content in `{document_output_language}`
|
|
18
|
+
- This whole workflow is **read-only over the project's source code**. You only write the handover manual under `{project_knowledge}`.
|
|
19
|
+
- The prompt that triggered this workflow IS the intent — treat any path / module / flow named in it as the scope, do not re-ask if it is already clear.
|
|
20
|
+
- Cite `file:line` for concrete claims. This step only builds the map; the deep passes come later.
|
|
21
|
+
|
|
22
|
+
## INSTRUCTIONS
|
|
23
|
+
|
|
24
|
+
### 1. Resolve output location and baseline
|
|
25
|
+
|
|
26
|
+
1. Set `{output_dir}` = resolved `{project_knowledge}`. Set `{handover_doc}` = `{output_dir}/HANDOVER.md`.
|
|
27
|
+
2. If `{handover_doc}` already exists, ask the user: **overwrite / start fresh** or **cancel**. Do not silently clobber prior work.
|
|
28
|
+
3. Capture `{git_ref}`: if a Git repo, run `git rev-parse --short HEAD` and `git symbolic-ref --short HEAD` (or note detached HEAD). If no VCS, set `{git_ref}` = `"no-vcs"`.
|
|
29
|
+
|
|
30
|
+
### 2. Determine scope
|
|
31
|
+
|
|
32
|
+
Determine `{scope}` from the triggering prompt and recent conversation. If still ambiguous: when `{autonomous}` is false, HALT and ask the user to pick; when `{autonomous}` is true, default to **whole project** and record the assumption for the final summary. The choices:
|
|
33
|
+
|
|
34
|
+
- **Whole project** — handover for the entire codebase
|
|
35
|
+
- **A module / subsystem / path** — handover scoped to one area (ask for the path)
|
|
36
|
+
- **A specific business flow** — center the handover on one named flow (e.g. "对账", "受理")
|
|
37
|
+
|
|
38
|
+
Also ask (one combined question, skip what the prompt already answered; skip entirely if `{autonomous}` is true):
|
|
39
|
+
|
|
40
|
+
- Any **business flows to prioritize**? (store as `{priority_flows}`) — e.g. 业务受理、规则校验、对账、回写
|
|
41
|
+
- Who is the **audience** — a new team member, or an external/outgoing handover? (tunes how much in-house context to spell out)
|
|
42
|
+
|
|
43
|
+
### 3. Reuse what already exists (do NOT re-derive)
|
|
44
|
+
|
|
45
|
+
Scan for and load *summaries* of prior knowledge so you build on it instead of redoing architecture work:
|
|
46
|
+
|
|
47
|
+
- `document-project` output in `{output_dir}`: `index.md`, `project-overview.md`, `architecture*.md`, `source-tree-analysis.md`, `data-models*.md`, `api-contracts*.md`
|
|
48
|
+
- `README*`, `CONTRIBUTING*`, `docs/`, `ARCHITECTURE*`, ADRs (`docs/adr/`, `doc/decisions/`), `CHANGELOG*`
|
|
49
|
+
- `**/project-context.md`, `CLAUDE.md`, in-repo wikis
|
|
50
|
+
|
|
51
|
+
Keep only a one-paragraph summary of each in context. If `architecture.md` exists, treat its tech-stack/topology as given and move faster.
|
|
52
|
+
|
|
53
|
+
### 4. Orient: build the map (lightweight, no deep tracing yet)
|
|
54
|
+
|
|
55
|
+
Establish the skeleton the later passes will hang off:
|
|
56
|
+
|
|
57
|
+
- **Tech stack:** detect languages, frameworks, ORM/data layer, build tool, runtime, key versions — from manifests (`package.json`, `pom.xml`, `build.gradle`, `go.mod`, `requirements.txt`, `Gemfile`, `*.csproj`) and lockfiles.
|
|
58
|
+
- **How to run:** install / start / build / test commands (from manifests, scripts, README, Makefile, Dockerfile, compose).
|
|
59
|
+
- **Entry points / external-comm surfaces** (these seed Step 2): controllers/routes, RPC/gRPC services, MQ consumers/listeners, scheduled jobs/cron, CLI commands, webhook/callback receivers, event handlers, app bootstrap/main.
|
|
60
|
+
- **Data stores:** primary/replica DBs, cache, message broker, object storage, search — from config + client wiring.
|
|
61
|
+
- **Module responsibility map:** top-level modules/packages/services, each with its responsibility, key directory, exposed surface, and main dependencies. A Mermaid `graph LR` of module dependencies is welcome.
|
|
62
|
+
- **Glossary seed:** start a running list of non-obvious terms / abbreviations / status enums / table names you encounter (carried forward to Step 6).
|
|
63
|
+
|
|
64
|
+
Use glob/grep and read only the files needed to map the above — do NOT exhaustively read source yet.
|
|
65
|
+
|
|
66
|
+
### 5. Create the handover skeleton
|
|
67
|
+
|
|
68
|
+
1. Read `../templates/handover-template.md`.
|
|
69
|
+
2. Substitute the top-matter variables (`{{project_name}}`, `{{date}}`, `{{scope}}`, `{{user_name}}`, `{{git_ref}}`).
|
|
70
|
+
3. Fill **Section 1 (Orientation)** and **Section 2 (Module Responsibility Map)** now, from step 4 above. Write real content in `{document_output_language}`. Keep the template's bilingual section headers as-is — only the body content you author follows `{document_output_language}`.
|
|
71
|
+
4. Leave the `<!-- FILL: ... -->` markers for sections 3–11 in place (later steps fill them).
|
|
72
|
+
5. Write the result to `{handover_doc}`.
|
|
73
|
+
|
|
74
|
+
## CHECKPOINT
|
|
75
|
+
|
|
76
|
+
Present to the user, in `{communication_language}`:
|
|
77
|
+
|
|
78
|
+
- Resolved scope, output path, and code baseline
|
|
79
|
+
- The detected tech stack + how-to-run
|
|
80
|
+
- The module responsibility map (table or list)
|
|
81
|
+
- The list of candidate entry points you will trace in Step 2, and which flows are prioritized
|
|
82
|
+
|
|
83
|
+
If `{autonomous}` is false: HALT and ask the user to confirm or correct the scope, module map, and priority flows before proceeding; incorporate corrections into `{handover_doc}` sections 1–2.
|
|
84
|
+
|
|
85
|
+
If `{autonomous}` is true: skip the HALT — proceed with the detected scope and map, and note any assumptions for the Step 6 summary.
|
|
86
|
+
|
|
87
|
+
## NEXT
|
|
88
|
+
|
|
89
|
+
Read fully and follow `./step-02-business-flows.md`
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
main_chains: '' # set at runtime: the 3-7 prioritized business chains being traced
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Step 2: Business Data-Flow Main Chains
|
|
6
|
+
|
|
7
|
+
Fill **Section 3** of `{handover_doc}`: trace how business data actually moves through the system, end to end.
|
|
8
|
+
|
|
9
|
+
## RULES
|
|
10
|
+
|
|
11
|
+
- YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
|
|
12
|
+
- YOU MUST ALWAYS WRITE all artifact content in `{document_output_language}`
|
|
13
|
+
- Read-only over source code. Cite `file:line` for every entry/stage you describe.
|
|
14
|
+
- Trace what the code **actually does**, not what names suggest. If a hop is async or its target is unclear, say so rather than inventing a clean path.
|
|
15
|
+
|
|
16
|
+
## INSTRUCTIONS
|
|
17
|
+
|
|
18
|
+
### 1. Enumerate and cluster entry points
|
|
19
|
+
|
|
20
|
+
Start from the entry points found in Step 1. Make sure you have covered every kind:
|
|
21
|
+
|
|
22
|
+
- HTTP controllers / routes / REST handlers
|
|
23
|
+
- RPC / gRPC service implementations
|
|
24
|
+
- MQ consumers / listeners / subscribers (Kafka, RocketMQ, RabbitMQ, Pulsar, …)
|
|
25
|
+
- Scheduled jobs / cron / `@Scheduled` / quartz / xxl-job
|
|
26
|
+
- CLI commands, batch jobs
|
|
27
|
+
- Webhook / callback receivers (payment notify, third-party push-back)
|
|
28
|
+
- Event handlers / domain-event listeners / state-machine transitions
|
|
29
|
+
|
|
30
|
+
Cluster them into **business capabilities** (e.g. 受理 / 审核 / 复核 / 回写 / 对账 / 通知 / 退款).
|
|
31
|
+
|
|
32
|
+
### 2. Pick the main chains
|
|
33
|
+
|
|
34
|
+
Select the **3–7 most important end-to-end chains**. Prefer `{priority_flows}` if the user named any. Otherwise rank by: appears in README/docs, central tables touched, volume/criticality implied by naming, breadth of code it pulls in. If unsure which to include and `{autonomous}` is false, HALT and ask the user to confirm the shortlist; if `{autonomous}` is true, auto-select the top-ranked chains and note the choice in the final summary.
|
|
35
|
+
|
|
36
|
+
### 3. Trace each chain end to end
|
|
37
|
+
|
|
38
|
+
For each main chain, follow the call path through the layers:
|
|
39
|
+
|
|
40
|
+
`entry (controller/consumer/job) → application/service → domain logic / rule engine → repository/persistence → external calls → response / callback / writeback`
|
|
41
|
+
|
|
42
|
+
While tracing, capture for each hop:
|
|
43
|
+
|
|
44
|
+
- **Sync vs async** — direct call, vs handed to a thread pool / MQ / scheduled retry. Mark every async boundary explicitly.
|
|
45
|
+
- **Transaction boundaries** — where a DB transaction opens/commits; whether external calls happen inside it (a classic trap).
|
|
46
|
+
- **Idempotency** — idempotency keys, dedup tables, unique constraints.
|
|
47
|
+
- **State changes** — which status field/enum moves from what to what, and where it persists.
|
|
48
|
+
- **Failure path** — what happens on error at each stage: throw / retry / compensate / rollback / dead-letter / manual-review queue.
|
|
49
|
+
- **Branching** — significant conditional routes (e.g. auto-pass vs route-to-human-review).
|
|
50
|
+
|
|
51
|
+
### 4. Write the section
|
|
52
|
+
|
|
53
|
+
For each chain, emit a `### 3.x <chain name>` subsection containing:
|
|
54
|
+
|
|
55
|
+
1. One-line TL;DR + trigger (`file:line`) + sync/async note.
|
|
56
|
+
2. A **Mermaid `sequenceDiagram`** of the main path (participants = the real classes/components via `as` aliases; arrows = the real calls; use `-->>` for returns; mark async hops; `alt/else/end` for the key failure branch). **Diagram text must avoid raw `<`, `>`, `{`, `}`** — they break the Mermaid parser; replace any placeholder like `<id>` with plain words (e.g. `applyNo`). Keep it readable: main path plus the most important failure branch.
|
|
57
|
+
3. A **stage table**: 阶段 | 入口/触发 | 关键类·方法 (file:line) | 输入数据 | 处理/规则 | 产出/状态变更 | 落库(表/缓存) | 失败处理. Add **one row per REAL stage** — do not pad to a fixed set. If a stage you expect (e.g. 人工复核) actually happens **outside this codebase** (e.g. only a consumer of an externally-produced message exists), say so with ⚠️ rather than inventing an internal stage.
|
|
58
|
+
4. State machine / status enum block if the flow has one (`file:line`).
|
|
59
|
+
5. Idempotency / transaction / compensation note.
|
|
60
|
+
|
|
61
|
+
Replace the `<!-- FILL: business-flows -->` marker in `{handover_doc}` with the rendered chains. **Edit the file now** — do not hold the content only in memory.
|
|
62
|
+
|
|
63
|
+
### 5. Purge
|
|
64
|
+
|
|
65
|
+
After writing, drop the raw trace details from working context. Keep only a one-line summary per chain (name + the tables/externals it touches) to carry forward.
|
|
66
|
+
|
|
67
|
+
## NEXT
|
|
68
|
+
|
|
69
|
+
Read fully and follow `./step-03-third-party-integrations.md`
|
package/src/xmc-skills/1-analysis/xiaoma-project-handover/steps/step-03-third-party-integrations.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Step 3: Third-Party Integration Inventory
|
|
2
|
+
|
|
3
|
+
Fill **Section 4** of `{handover_doc}`: an exhaustive map of everything external the system depends on, with special attention to **failure-degradation behavior**.
|
|
4
|
+
|
|
5
|
+
## RULES
|
|
6
|
+
|
|
7
|
+
- YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
|
|
8
|
+
- YOU MUST ALWAYS WRITE all artifact content in `{document_output_language}`
|
|
9
|
+
- Read-only over source code. Only list integrations that actually exist in the code/config — never invent one.
|
|
10
|
+
- "Third party" = external business SDKs, remote HTTP/RPC services, AND middleware that is external from a handover standpoint (DB, cache, MQ, object storage, config/registry center, search, monitoring). Include all of them.
|
|
11
|
+
|
|
12
|
+
## INSTRUCTIONS
|
|
13
|
+
|
|
14
|
+
### 1. Detect — scan these sources
|
|
15
|
+
|
|
16
|
+
**Dependency manifests** (the fastest signal): `package.json`, `pom.xml`, `build.gradle(.kts)`, `go.mod`, `requirements.txt` / `pyproject.toml`, `Gemfile`, `*.csproj`, `composer.json`. Flag any dependency that talks to the outside world.
|
|
17
|
+
|
|
18
|
+
**Common integration categories to look for** (names vary by region/vendor):
|
|
19
|
+
|
|
20
|
+
- 支付/收银 payment, 银行/银联/网银 bank, 发票 invoice
|
|
21
|
+
- 短信 SMS, 邮件 email, 推送 push, IM/客服, 语音/呼叫
|
|
22
|
+
- 对象存储 OSS/COS/S3/MinIO, CDN
|
|
23
|
+
- 实名/认证 KYC, 风控 risk-control, 征信, OCR, 人脸 face, 电子签 e-sign
|
|
24
|
+
- 地图/定位 map, 天气, 翻译
|
|
25
|
+
- 登录/SSO/OAuth, 企业微信/钉钉/飞书, 微信/支付宝开放平台
|
|
26
|
+
- 消息队列 MQ (Kafka/RocketMQ/RabbitMQ/Pulsar), 缓存 Redis/Memcached, 搜索 ES/OpenSearch
|
|
27
|
+
- 数据库 RDBMS/NoSQL, 配置中心 Nacos/Apollo/Consul, 注册中心/服务发现, 网关
|
|
28
|
+
- 监控/APM/链路 (Prometheus/SkyWalking/Sentry/CAT), 日志采集, 大数据/数仓上报
|
|
29
|
+
- LLM/AI 服务, 任意内部"中台"/平台服务
|
|
30
|
+
|
|
31
|
+
**Code-level signals:**
|
|
32
|
+
|
|
33
|
+
- HTTP clients: `RestTemplate`, `WebClient`, `OkHttp`, `HttpClient`, `Feign`/`@FeignClient`, `axios`, `fetch`, `requests`, base URLs, `*Client`/`*Api`/`*Adapter`/`*Connector`/`*Gateway` classes.
|
|
34
|
+
- RPC stubs: gRPC/Dubbo/Thrift service references, `@DubboReference`.
|
|
35
|
+
- SDK init: client/builder construction with appId/appKey/accessKey/endpoint.
|
|
36
|
+
- Connection wiring: datasource/redis/mq/es client configuration beans.
|
|
37
|
+
|
|
38
|
+
**Config signals:** grep config files (`application*.yml|properties`, `*.env`, `.env*`, `appsettings*.json`, `config/*`) and config-center keys for: `url|host|endpoint|appid|app-key|access-key|ak|sk|secret|token|account|merchant|dsn|brokers|bootstrap-servers|nameserver`.
|
|
39
|
+
|
|
40
|
+
### 2. For each integration, fill every column
|
|
41
|
+
|
|
42
|
+
No blanks. Each row must have:
|
|
43
|
+
|
|
44
|
+
- **名称 Name** — the service/vendor/middleware
|
|
45
|
+
- **类别 Category** — payment / sms / mq / cache / db / config-center / monitoring / …
|
|
46
|
+
- **用途 Purpose** — the business scenario it serves (tie back to Step 2 flows where relevant)
|
|
47
|
+
- **调用方式 Call style** — SDK / HTTP / RPC / MQ produce·consume / JDBC / driver
|
|
48
|
+
- **关键客户端 Key client** — the class/module that owns the call (`file`)
|
|
49
|
+
- **配置位置 Config location** — exact file + key(s)
|
|
50
|
+
- **鉴权 Auth** — appId/secret, AK/SK, token, mTLS, none
|
|
51
|
+
- **失败降级 Failure handling** ← the important one: state explicitly whether there is **retry** (how many / backoff), **circuit breaker** (Sentinel/Hystrix/Resilience4j), **fallback / degrade** (default value, cache, skip), **bulkhead/timeout**, **dead-letter / manual-review**, or **none (error propagates)**. If you cannot find any handling, write "无显式降级(异常直接抛出)" — do not leave it implied.
|
|
52
|
+
- **风险备注 Risk** — single point of failure, prod-only, tight coupling, etc.
|
|
53
|
+
|
|
54
|
+
### 3. Environment & secrets note (section 4.1)
|
|
55
|
+
|
|
56
|
+
Summarize what a new dev needs to run the project locally/in test: which integrations are required vs optional, where secrets live (env vars / config center / vault / committed-and-must-rotate), and which third parties offer a sandbox/mock vs are production-only.
|
|
57
|
+
|
|
58
|
+
### 4. Write + purge
|
|
59
|
+
|
|
60
|
+
Replace the `<!-- FILL: third-parties -->` and `<!-- FILL: 4.1 -->` markers in `{handover_doc}` with the inventory table + environment note. **Edit the file now.** Then purge raw findings, keeping only a count + the list of integration names.
|
|
61
|
+
|
|
62
|
+
## NEXT
|
|
63
|
+
|
|
64
|
+
Read fully and follow `./step-04-design-and-tradeoffs.md`
|
package/src/xmc-skills/1-analysis/xiaoma-project-handover/steps/step-04-design-and-tradeoffs.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Step 4: Design Highlights & Trade-offs
|
|
2
|
+
|
|
3
|
+
Fill **Section 5** of `{handover_doc}`: explain *why* the system is built the way it is, so the new owner does not unknowingly undo a deliberate decision.
|
|
4
|
+
|
|
5
|
+
## RULES
|
|
6
|
+
|
|
7
|
+
- YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
|
|
8
|
+
- YOU MUST ALWAYS WRITE all artifact content in `{document_output_language}`
|
|
9
|
+
- Read-only over source code. Cite `file:line` for where each design lives.
|
|
10
|
+
- **Separate verified from inferred.** A rationale stated in a doc/comment/ADR/commit is verified. A rationale you reconstructed from the code shape is an inference — mark it `⚠️ 推断` and add it to Open Questions in Step 6.
|
|
11
|
+
|
|
12
|
+
## INSTRUCTIONS
|
|
13
|
+
|
|
14
|
+
### 1. Gather the rationale signals
|
|
15
|
+
|
|
16
|
+
- **Explicit sources:** ADRs (`docs/adr/`, `doc/decisions/`), design docs, README "design/决策/架构" sections, rich code comments, and `git log` messages on large refactors/feature commits (`git log --oneline -- <path>` on key modules).
|
|
17
|
+
- **Structural signals (infer the "why" from the "what"):** layering & module boundaries, key abstractions and extension points (interfaces, SPI, plugin registries, strategy/factory/template-method/state-machine/observer patterns), async decoupling (MQ, event bus, thread pools), caching strategy, idempotency & dedup design, sharding / partitioning / read-write split, distributed lock, rate limiting / circuit breaking, config-driven behavior & feature flags, consistency choices (eventual vs strong, saga/TCC), API/versioning strategy.
|
|
18
|
+
|
|
19
|
+
### 2. For each highlight / decision, capture
|
|
20
|
+
|
|
21
|
+
- **决策 Decision / 亮点 Highlight** — what it is
|
|
22
|
+
- **位置 Where** — module/class (`file:line`)
|
|
23
|
+
- **解决的问题 Problem** — what pain it addresses
|
|
24
|
+
- **为什么这样设计 Rationale** — the reasoning
|
|
25
|
+
- **取舍/代价 Trade-off** — what was given up (complexity, latency, consistency, cost, coupling), and any alternative that was rejected if you can tell
|
|
26
|
+
- **来源 Source** — `确证` (cite the doc/comment/commit) or `⚠️ 推断`
|
|
27
|
+
|
|
28
|
+
Focus on decisions a newcomer could plausibly break or "simplify" by accident (the non-obvious-on-purpose ones). Skip boilerplate framework defaults that carry no real decision.
|
|
29
|
+
|
|
30
|
+
### 3. Write + purge
|
|
31
|
+
|
|
32
|
+
Replace the `<!-- FILL: design -->` marker in `{handover_doc}` with the table. **Edit the file now.** Collect every `⚠️ 推断` item to carry into Step 6's Open Questions. Then purge raw detail, keeping only the list of decision titles.
|
|
33
|
+
|
|
34
|
+
## NEXT
|
|
35
|
+
|
|
36
|
+
Read fully and follow `./step-05-pitfalls-and-legacy.md`
|
package/src/xmc-skills/1-analysis/xiaoma-project-handover/steps/step-05-pitfalls-and-legacy.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Step 5: Known Pitfalls & Legacy Debt
|
|
2
|
+
|
|
3
|
+
Fill **Section 6** of `{handover_doc}`: the traps a newcomer will step on that nobody writes down.
|
|
4
|
+
|
|
5
|
+
## RULES
|
|
6
|
+
|
|
7
|
+
- YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
|
|
8
|
+
- YOU MUST ALWAYS WRITE all artifact content in `{document_output_language}`
|
|
9
|
+
- Read-only over source code. Cite `file:line` for every pitfall.
|
|
10
|
+
- Prefer concrete, located traps over generic advice. "This loop calls a remote API per row (`Foo.java:88`)" beats "watch out for performance".
|
|
11
|
+
|
|
12
|
+
## INSTRUCTIONS
|
|
13
|
+
|
|
14
|
+
### 1. Run the marker scan
|
|
15
|
+
|
|
16
|
+
Grep the codebase (case-insensitive) for: `TODO`, `FIXME`, `HACK`, `XXX`, `@Deprecated` / `deprecated`, `workaround`, `临时`, `兼容`, `历史`, `先这样` / `暂时`, `不要动` / `慎改` / `勿删`, `坑`, `注意` / `特别注意`, `magic`, `tricky`. Each hit is a lead — read around it and decide if it is handover-worthy.
|
|
17
|
+
|
|
18
|
+
### 2. Hunt each category
|
|
19
|
+
|
|
20
|
+
- **Implicit dependencies (隐式依赖):** order-dependent initialization, global/static mutable state, `ThreadLocal`, reliance on system time / timezone / locale / default charset, hardcoded IDs / paths / enum values, hidden coupling between modules, DB triggers / stored procedures, cross-service shared tables, classpath/bean load order, environment-specific assumptions.
|
|
21
|
+
- **Temporary solutions (临时方案):** hardcoded switches, feature flags left permanently on/off, commented-out code kept "just in case", dual-write / 双写, grayscale/灰度 leftovers, "v2" code paths running beside "v1".
|
|
22
|
+
- **Performance / concurrency risks:** N+1 queries, remote calls inside loops, missing pagination, unbounded caches / collections, non-idempotent retries, race conditions, lock granularity / lock ordering / deadlock risk, thread-pool sizing & rejection policy, large transactions holding locks, slow SQL / missing indexes, sync calls on hot paths.
|
|
23
|
+
- **Weird naming (命名怪异):** misleading names, 拼音 or cryptic abbreviations, status codes / enums whose numeric meaning is non-obvious, table/field names that do not match their actual content, names that contradict behavior.
|
|
24
|
+
- **Legacy debt (历史遗留):** dead code, abandoned modules, outdated/vulnerable dependencies, deprecated APIs still in use, migrations half-done.
|
|
25
|
+
- **Git heat (optional, if VCS):** `git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head` to find churn-hot files, and scan for revert-heavy areas — frequently-changed files often hide fragility worth flagging.
|
|
26
|
+
|
|
27
|
+
### 3. For each pitfall, capture
|
|
28
|
+
|
|
29
|
+
- **类型 Type** — `坑/反直觉` / `隐式依赖` / `临时方案` / `性能/并发` / `命名怪异` / `历史遗留`
|
|
30
|
+
- **位置 Location** — `file:line`
|
|
31
|
+
- **现象/风险 Symptom & risk** — what goes wrong
|
|
32
|
+
- **触发条件 Trigger** — when it bites (high load, specific input, certain order, off-by-timezone, …)
|
|
33
|
+
- **规避/正确做法 How to avoid** — what the newcomer should do instead
|
|
34
|
+
- **严重度 Severity** — 高 / 中 / 低
|
|
35
|
+
|
|
36
|
+
### 4. Write + purge
|
|
37
|
+
|
|
38
|
+
Replace the `<!-- FILL: pitfalls -->` marker in `{handover_doc}` with the table, sorted by severity (高 first). **Edit the file now.** Then purge raw findings, keeping only counts by severity.
|
|
39
|
+
|
|
40
|
+
## NEXT
|
|
41
|
+
|
|
42
|
+
Read fully and follow `./step-06-assemble-handover.md`
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Step 6: Assemble & Validate the Handover Manual
|
|
2
|
+
|
|
3
|
+
Fill the remaining sections, validate, and finalize `{handover_doc}`.
|
|
4
|
+
|
|
5
|
+
## RULES
|
|
6
|
+
|
|
7
|
+
- YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
|
|
8
|
+
- YOU MUST ALWAYS WRITE all artifact content in `{document_output_language}`
|
|
9
|
+
- Read-only over source code.
|
|
10
|
+
|
|
11
|
+
## INSTRUCTIONS
|
|
12
|
+
|
|
13
|
+
### 1. Fill the supporting sections
|
|
14
|
+
|
|
15
|
+
Using context accumulated across Steps 1–5, fill the remaining `<!-- FILL -->` markers in `{handover_doc}`:
|
|
16
|
+
|
|
17
|
+
- **Section 7 — 术语表 / Glossary:** the running glossary seeded in Step 1 plus every non-obvious term, abbreviation, status enum, and key table name used elsewhere in the manual. A newcomer should be able to resolve any jargon in the doc here.
|
|
18
|
+
- **Section 8 — 新人上手清单 / Onboarding Checklist:** concrete, ordered, checkable steps — clone & install & configure, run locally/in test, walk one main chain from Section 3, then a real **starter task** suitable for a newcomer, plus how to find each key module's owner.
|
|
19
|
+
- **Section 9 — 出问题先看哪里 / Troubleshooting Pointers:** common symptoms → first place to look (which log / monitor / table / switch). Pull from the failure paths in Section 3 and the integrations in Section 4.
|
|
20
|
+
- **Section 10 — 待确认问题 / Open Questions:** gather every `⚠️ 推断` item from Steps 2–5, plus information gaps and anything needing the original author/owner to confirm.
|
|
21
|
+
- **Section 11 — 参考资料 / References:** README, architecture docs, ADRs, prior `document-project` output, API docs, monitoring dashboards, wikis, related repos.
|
|
22
|
+
|
|
23
|
+
**Edit the file** to replace each marker.
|
|
24
|
+
|
|
25
|
+
### 2. Validate against the checklist
|
|
26
|
+
|
|
27
|
+
Run `../checklist.md` against `{handover_doc}`. Pay special attention to:
|
|
28
|
+
|
|
29
|
+
- All four required pillars (Sections 3–6) are concrete and non-empty.
|
|
30
|
+
- **Every** integration row in Section 4 has a failure-degradation value (no blanks).
|
|
31
|
+
- No `<!-- FILL` markers and no template scaffolding (the single-chain template comment, etc.) remain anywhere in the file.
|
|
32
|
+
- Concrete claims cite `file:line`; inferences are flagged and live in Open Questions.
|
|
33
|
+
- Mermaid diagrams are syntactically valid.
|
|
34
|
+
|
|
35
|
+
Fix anything that fails before continuing. If a required pillar is genuinely empty because the codebase has nothing of that kind (e.g. zero third parties), state that explicitly in the section rather than leaving a marker.
|
|
36
|
+
|
|
37
|
+
### 3. Final summary
|
|
38
|
+
|
|
39
|
+
Present to the user, in `{communication_language}`:
|
|
40
|
+
|
|
41
|
+
- Path: `{handover_doc}`
|
|
42
|
+
- A short table of contents with one-line status per section (e.g. "业务主链路: 5 条", "三方: 12 个", "已知坑: 8 条(高 2)")
|
|
43
|
+
- The count of Open Questions that need author confirmation
|
|
44
|
+
- Any checklist items that could not be satisfied, and why
|
|
45
|
+
|
|
46
|
+
### 4. Offer next actions
|
|
47
|
+
|
|
48
|
+
If `{autonomous}` is true, skip this offer and finalize directly. Otherwise ask whether the user wants to:
|
|
49
|
+
|
|
50
|
+
1. **Deep-dive** a specific business chain, integration, or module (re-run the relevant pass at higher depth on that target)
|
|
51
|
+
2. **Add** a section the team needs (e.g. release/rollback runbook, on-call guide)
|
|
52
|
+
3. **Finalize** (done)
|
|
53
|
+
|
|
54
|
+
Loop on the user's choice until they finalize.
|
|
55
|
+
|
|
56
|
+
### 5. On complete
|
|
57
|
+
|
|
58
|
+
When finalized, run: `node {project-root}/_xiaoma/scripts/resolve_customization.js --skill {skill-root} --key workflow.on_complete` — if the resolved value is non-empty, follow it as the final terminal instruction before exiting. **If the script fails or `_xiaoma` is absent** (e.g. XiaoMa is not installed in the target), skip this step and treat `on_complete` as empty.
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# {{project_name}} — 项目交接手册 (Project Handover)
|
|
2
|
+
|
|
3
|
+
> 面向新接手工程师的交接文档。目标:读完即可独立定位代码、看懂业务怎么跑、知道接了哪些三方、明白为什么这么设计、避开已知的坑。
|
|
4
|
+
> A handover manual for the engineer taking over. After reading it you should be able to navigate the code, understand how the business actually runs, know every external dependency, understand the design rationale, and avoid the known traps.
|
|
5
|
+
|
|
6
|
+
- **交接范围 / Scope:** {{scope}}
|
|
7
|
+
- **生成日期 / Date:** {{date}}
|
|
8
|
+
- **整理人 / Prepared by:** {{user_name}}
|
|
9
|
+
- **代码基线 / Code baseline:** {{git_ref}}
|
|
10
|
+
- **证据约定 / Evidence:** 每条具体结论尽量标注 `文件:行号`;无法验证的标注「⚠️ 推断,需与原作者确认」。
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 1. 速览 / Orientation
|
|
15
|
+
|
|
16
|
+
<!-- FILL: orientation — 用 5~10 句话让新人建立心智模型:这个系统是做什么的、属于什么类型(Web/后端服务/批处理/网关...)、核心业务名词、技术栈(语言/框架/构建/运行时)、如何本地跑起来(关键命令)、代码入口在哪。给出"如果你只读一处,先读这里"的指引。 -->
|
|
17
|
+
|
|
18
|
+
| 维度 Dimension | 内容 |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| 系统定位 What it is | <!-- FILL --> |
|
|
21
|
+
| 技术栈 Tech stack | <!-- FILL: 语言/框架/ORM/构建工具/运行时 + 版本 --> |
|
|
22
|
+
| 运行方式 How to run | <!-- FILL: 安装/启动/构建/测试 关键命令 --> |
|
|
23
|
+
| 代码入口 Entry points | <!-- FILL: main/启动类/路由注册/消费者注册 file:line --> |
|
|
24
|
+
| 数据存储 Data stores | <!-- FILL: 主库/从库/缓存/消息/对象存储/搜索 --> |
|
|
25
|
+
| 配置位置 Config | <!-- FILL: 配置文件/环境变量/配置中心 路径 --> |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. 关键模块责任地图 / Module Responsibility Map
|
|
30
|
+
|
|
31
|
+
<!-- FILL: module-map — 列出顶层模块/包/服务,每个一行:负责什么、关键目录、对外暴露面(接口/消费者/任务)、依赖了谁。让新人知道"改 X 功能去哪个模块"。可附一张 mermaid 模块依赖图(graph LR)。 -->
|
|
32
|
+
|
|
33
|
+
| 模块 Module | 职责 Responsibility | 关键目录/类 Path | 对外暴露 Surface | 主要依赖 Depends on |
|
|
34
|
+
| --- | --- | --- | --- | --- |
|
|
35
|
+
| <!-- FILL --> | | | | |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 3. 业务数据流转主链路 / Business Data-Flow Main Chains ★
|
|
40
|
+
|
|
41
|
+
> 这是新人最需要、代码最难一眼看清的部分:业务数据从进入系统到落地,到底经过哪些阶段、谁触发、在哪处理、写到哪、失败了怎么办。
|
|
42
|
+
|
|
43
|
+
<!-- FILL: business-flows -->
|
|
44
|
+
|
|
45
|
+
<!-- 结构由 step-02 提供:每条主链路一个 `### 3.x <名称>` 小节 = TL;DR + 触发(file:line) + 同步/异步 + mermaid sequenceDiagram(图内勿用裸 <>/{}) + 阶段表(按真实链路增删行) + 状态机 + 幂等/事务/补偿。填充时把本说明一并删除。 -->
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 4. 三方接入清单 / Third-Party Integration Inventory ★
|
|
50
|
+
|
|
51
|
+
> "三方"包含:外部业务/平台 SDK、HTTP/RPC 远程服务,以及从交接视角同样属于外部依赖的中间件(数据库、缓存、消息队列、对象存储、配置/注册中心、搜索、监控等)。
|
|
52
|
+
|
|
53
|
+
<!-- FILL: third-parties — 穷尽扫描所有外部依赖(见 step-03 的探测目录)。每个依赖一行,必须覆盖:名称、用途、调用方式、关键客户端类、配置位置(文件+key)、鉴权方式、失败降级行为。失败降级是重点:有没有重试/熔断/降级/兜底,还是直接抛? -->
|
|
54
|
+
|
|
55
|
+
| 名称 Name | 类别 Category | 用途/业务场景 Purpose | 调用方式 Call style | 关键客户端 (file) | 配置位置 (文件:key) | 鉴权 Auth | 失败降级 Failure handling | 风险备注 Risk |
|
|
56
|
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
57
|
+
| <!-- FILL --> | | | | | | | | |
|
|
58
|
+
|
|
59
|
+
### 4.1 环境与密钥 / Environment & secrets
|
|
60
|
+
|
|
61
|
+
<!-- FILL: 新人本地/测试环境跑通需要哪些外部依赖与密钥?密钥存放在哪(env / 配置中心 / vault)?哪些三方有沙箱/mock 可用,哪些只有生产? -->
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 5. 设计亮点与权衡 / Design Highlights & Trade-offs ★
|
|
66
|
+
|
|
67
|
+
> 解释"为什么这么设计",让新人不会无意中破坏掉有意为之的设计。
|
|
68
|
+
|
|
69
|
+
<!-- FILL: design — 列出关键设计决策/亮点:用了什么模式/抽象/扩展点(策略/工厂/模板方法/状态机/SPI/异步解耦/缓存/分库分表/幂等/分布式锁/限流...)、解决什么问题、为什么这样选、放弃了什么(代价)。区分"确证"(来自文档/注释/ADR/commit)与"推断"(从代码反推,需确认)。 -->
|
|
70
|
+
|
|
71
|
+
| 亮点/决策 Decision | 位置 Where | 解决的问题 Problem | 为什么这样设计 Rationale | 取舍/代价 Trade-off | 来源 Source(确证/推断) |
|
|
72
|
+
| --- | --- | --- | --- | --- | --- |
|
|
73
|
+
| <!-- FILL --> | | | | | |
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 6. 已知坑与历史遗留 / Known Pitfalls & Legacy Debt ★
|
|
78
|
+
|
|
79
|
+
> 新人最容易踩雷、且没人会主动告诉你的地方:命名怪异、隐式依赖、临时方案、性能/并发风险、历史遗留。
|
|
80
|
+
|
|
81
|
+
<!-- FILL: pitfalls — 见 step-05 的探测手法(标记词/隐式依赖/临时方案/性能并发/命名/git 热点)。每条一行,给出位置、现象/风险、触发条件、规避/正确做法、严重度。 -->
|
|
82
|
+
|
|
83
|
+
| 类型 Type | 位置 (file:line) | 现象/风险 Symptom & risk | 触发条件 Trigger | 规避/正确做法 How to avoid | 严重度 Severity |
|
|
84
|
+
| --- | --- | --- | --- | --- | --- |
|
|
85
|
+
| <!-- FILL --> | | | | | |
|
|
86
|
+
|
|
87
|
+
类型取值:`坑/反直觉` `隐式依赖` `临时方案` `性能/并发` `命名怪异` `历史遗留`。
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 7. 术语表 / Glossary
|
|
92
|
+
|
|
93
|
+
<!-- FILL: glossary — 业务与代码里出现的非显而易见的名词、缩写、拼音、状态码/枚举含义、关键表名释义。让新人看代码不再一头雾水。 -->
|
|
94
|
+
|
|
95
|
+
| 术语 Term | 含义 Meaning | 出现位置 Where |
|
|
96
|
+
| --- | --- | --- |
|
|
97
|
+
| <!-- FILL --> | | |
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 8. 新人上手清单 / Onboarding Checklist
|
|
102
|
+
|
|
103
|
+
<!-- FILL: onboarding -->
|
|
104
|
+
<!-- 渲染为可勾选清单(- [ ] ...):环境搭建 → 跑起来 → 跑通一条主链路 → 一个练手小任务 → 关键负责人/owner。填充时删除本说明。 -->
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 9. 出问题先看哪里 / Troubleshooting Pointers
|
|
109
|
+
|
|
110
|
+
<!-- FILL: troubleshooting — 常见问题/告警 → 先看哪个日志/监控/表/开关。链路出问题时的排查顺序。 -->
|
|
111
|
+
|
|
112
|
+
| 症状 Symptom | 先看哪里 Where to look first |
|
|
113
|
+
| --- | --- |
|
|
114
|
+
| <!-- FILL --> | |
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 10. 待确认问题 / Open Questions
|
|
119
|
+
|
|
120
|
+
<!-- FILL: open-questions -->
|
|
121
|
+
<!-- 渲染为可勾选清单:汇总所有「⚠️ 推断」结论、信息缺口、需找原作者/owner 确认的点。填充时删除本说明。 -->
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 11. 参考资料 / References
|
|
126
|
+
|
|
127
|
+
<!-- FILL: references -->
|
|
128
|
+
<!-- 列表:已有文档(README/架构图/ADR/document-project 产出/接口文档/监控面板/wiki)、相关仓库、关键链接。填充时删除本说明。 -->
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
_Generated using the XiaoMa Method `xiaoma-project-handover` workflow._
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
module,skill,display-name,menu-code,description,action,args,phase,preceded-by,followed-by,required,output-location,outputs
|
|
2
2
|
XiaoMa Method,_meta,,,,,,,,,false,,
|
|
3
3
|
XiaoMa Method,xiaoma-document-project,Document Project,DP,Analyze an existing project to produce useful documentation.,,,anytime,,,false,project-knowledge,*
|
|
4
|
+
XiaoMa Method,xiaoma-project-handover,Project Handover,HO,Analyze an existing project and produce a new-hire handover manual: business data-flow main chains third-party integrations design trade-offs and known pitfalls.,,,anytime,,,false,project-knowledge,handover manual
|
|
4
5
|
XiaoMa Method,xiaoma-generate-project-context,Generate Project Context,GPC,Scan existing codebase to generate a lean LLM-optimized project-context.md. Essential for brownfield projects.,,,anytime,,,false,output_folder,project context
|
|
5
6
|
XiaoMa Method,xiaoma-quick-dev,Quick Dev,QQ,Unified intent-in code-out workflow: clarify plan implement review and present.,,,anytime,,,false,implementation_artifacts,spec and project implementation
|
|
6
7
|
XiaoMa Method,xiaoma-correct-course,Correct Course,CC,Navigate significant changes. May recommend start over update PRD redo architecture sprint planning or correct epics and stories.,,,anytime,,,false,planning_artifacts,change proposal
|