map-project — scan an unknown repo into a durable, verifiable map
The first phase of onboarding. Produce ONE artifact — docs/onboarding/project-map.md
— that every later phase (document-project, run-guide) reads instead of
re-deriving the repo from scratch. It is written to disk, not held in
context: a fresh session after a context reset re-reads it and continues.
The map is agent-facing — write it in English always (like the
journey-log and spec skeletons), regardless of ONBOARDING_LANG. Only the
human-facing READMEs/RUN.md follow the reader's language.
Two-step rule: machine gathers, you interpret
The scanner emits candidates with file:line — it never decides meaning.
You (the agent) open the flagged files and extract the semantics. Never copy a
scanner hit into the map as fact without reading the source line.
Refresh, not re-scan-from-zero
If project-map.md already exists, this is a refresh: re-run the scanner,
diff against the current map, update only the rows that changed, and note removed
/ added modules. Do not discard hand-edited notes in the map — merge over them.
Secrets safety (hard rule)
The scanner's "Sensitive files" section lists paths only and never opens
them. If it flags anything (a real .env, *.pem, id_rsa, keystore, …):
do not read the file, record only its path + that it exists, and warn the
user a secret may be committed. For a public repo, hand off to
scrub-identity before anything is written or pushed. A secret value must never
reach the map, the journey log, or your output.
Procedure
Locate the target. Get the project root (by name or path). Everything
below runs against it, not against this skills repo.
Run the scanner (pick the platform twin; both are multi-platform):
# macOS / Linux / Git-Bash
sh <agent-skills>/skills/map-project/scripts/scan-project.sh <target-root>
# Windows
powershell -NoProfile -File <agent-skills>\skills\map-project\scripts\scan-project.ps1 -Root <target-root>
(<agent-skills> = tools/agent-skills when consumed as a submodule.) It
prints Markdown sections: build system, modules, toolchain, deploy manifests,
service/port candidates, env keys, entry points, existing docs.
Interpret, don't transcribe. For each section, open the real files and
resolve them into facts:
- Modules → for each, its purpose (read its build file + top package),
what it depends on, whether it is a service (has a
main/entrypoint) or a
library.
- Toolchain → the exact required versions (JDK, Node, …), reconciling
build files,
.tool-versions, Dockerfile FROM, and CI — flag any
disagreement, it is a real onboarding trap.
- Services & ports → map each port to the service that owns it; note the
protocol and whether it is internal or exposed.
- Env keys → dedup the names; for each, what it configures and whether it
is a secret (DB creds, tokens, keys). Never read or record a secret
value — record the key name and where it is consumed.
- Deploy manifests → what backing services exist (DB, cache, broker) and
how they are wired (compose service names, k8s Services/namespaces).
Write the map to docs/onboarding/project-map.md using the shape below.
Cite file:line for every non-obvious fact — the map must be auditable.
List the open questions. Anything the scan could not settle (a service
with no obvious purpose, an env key with no template, a version conflict)
goes in an explicit "Unknowns" section — these become questions for the user
or things the run-guide loop will resolve empirically.
Output — docs/onboarding/project-map.md
# Project map — <name>
_scanned <date> · commit <sha>_
## What it is
<2–4 sentences: domain, shape (monolith / multi-module / microservices), stack.>
## Toolchain (required to build)
| Tool | Version | Source of truth |
|---|---|---|
| JDK | 25 | pom.xml:15, Dockerfile FROM, ci.yml:32 |
## Modules
| Module | Kind | Purpose | Key deps | Port |
|---|---|---|---|---|
## Backing services (from deploy manifests)
| Service | Image / kind | Port | Wired via |
|---|---|---|---|
## Environment / config keys
| Key | Configures | Secret? | Consumed at |
|---|---|---|---|
## Entry points
<how each runnable module starts — main class / command.>
## Unknowns / to resolve
- …
Triggering
SHOULD fire: "просканируй и опиши проект"; "map this repo before we document it";
"проиндексируй монорепу". SHOULD NOT fire: "write the README" (that is
document-project, which reads the map this skill produced); "audit the
architecture" (that is architecture-checkup). This skill maps; it does not
write user-facing docs and does not judge quality.
Handing off
The map is the input contract for document-project (turns modules → READMEs)
and run-guide (turns toolchain + services + env into a verified run route).
Keep it current: if a later phase discovers the map was wrong, fix the map too.
1---2name: map-project3description: Use at the START of onboarding or documenting an unfamiliar project — to scan and index it before writing a line of docs. Fires on: "просканируй проект", "проиндексируй репозиторий", "разберись в проекте X", "map the project", "scan the repo", "что это за проект и из чего он состоит". Runs a mechanical scanner, then reads the flagged files to produce a durable project map: modules, build system, toolchain, deploy manifests, services/ports, env keys, entry points — written to docs/onboarding/project-map.md.4---56# map-project — scan an unknown repo into a durable, verifiable map78The first phase of onboarding. Produce ONE artifact — `docs/onboarding/project-map.md`9— that every later phase (`document-project`, `run-guide`) reads instead of10re-deriving the repo from scratch. It is written to **disk**, not held in11context: a fresh session after a context reset re-reads it and continues.1213The map is **agent-facing** — write it in **English** always (like the14journey-log and spec skeletons), regardless of `ONBOARDING_LANG`. Only the15human-facing READMEs/RUN.md follow the reader's language.1617## Two-step rule: machine gathers, you interpret1819The scanner emits **candidates with `file:line`** — it never decides meaning.20You (the agent) open the flagged files and extract the semantics. Never copy a21scanner hit into the map as fact without reading the source line.2223## Refresh, not re-scan-from-zero2425If `project-map.md` already exists, this is a **refresh**: re-run the scanner,26diff against the current map, update only the rows that changed, and note removed27/ added modules. Do not discard hand-edited notes in the map — merge over them.2829## Secrets safety (hard rule)3031The scanner's "Sensitive files" section lists **paths only** and never opens32them. If it flags anything (a real `.env`, `*.pem`, `id_rsa`, keystore, …):33**do not read the file**, record only its path + that it exists, and warn the34user a secret may be committed. For a **public** repo, hand off to35`scrub-identity` before anything is written or pushed. A secret value must never36reach the map, the journey log, or your output.3738## Procedure39401. **Locate the target.** Get the project root (by name or path). Everything41 below runs against it, not against this skills repo.42432. **Run the scanner** (pick the platform twin; both are multi-platform):44 ```45 # macOS / Linux / Git-Bash46 sh <agent-skills>/skills/map-project/scripts/scan-project.sh <target-root>47 # Windows48 powershell -NoProfile -File <agent-skills>\skills\map-project\scripts\scan-project.ps1 -Root <target-root>49 ```50 (`<agent-skills>` = `tools/agent-skills` when consumed as a submodule.) It51 prints Markdown sections: build system, modules, toolchain, deploy manifests,52 service/port candidates, env keys, entry points, existing docs.53543. **Interpret, don't transcribe.** For each section, open the real files and55 resolve them into facts:56 - **Modules** → for each, its purpose (read its build file + top package),57 what it depends on, whether it is a service (has a `main`/entrypoint) or a58 library.59 - **Toolchain** → the exact required versions (JDK, Node, …), reconciling60 build files, `.tool-versions`, Dockerfile `FROM`, and CI — flag any61 disagreement, it is a real onboarding trap.62 - **Services & ports** → map each port to the service that owns it; note the63 protocol and whether it is internal or exposed.64 - **Env keys** → dedup the names; for each, what it configures and whether it65 is a **secret** (DB creds, tokens, keys). **Never read or record a secret66 value** — record the key name and where it is consumed.67 - **Deploy manifests** → what backing services exist (DB, cache, broker) and68 how they are wired (compose service names, k8s Services/namespaces).69704. **Write the map** to `docs/onboarding/project-map.md` using the shape below.71 Cite `file:line` for every non-obvious fact — the map must be auditable.72735. **List the open questions.** Anything the scan could not settle (a service74 with no obvious purpose, an env key with no template, a version conflict)75 goes in an explicit "Unknowns" section — these become questions for the user76 or things the `run-guide` loop will resolve empirically.7778## Output — `docs/onboarding/project-map.md`7980```markdown81# Project map — <name>82_scanned <date> · commit <sha>_8384## What it is85<2–4 sentences: domain, shape (monolith / multi-module / microservices), stack.>8687## Toolchain (required to build)88| Tool | Version | Source of truth |89|---|---|---|90| JDK | 25 | pom.xml:15, Dockerfile FROM, ci.yml:32 |9192## Modules93| Module | Kind | Purpose | Key deps | Port |94|---|---|---|---|---|9596## Backing services (from deploy manifests)97| Service | Image / kind | Port | Wired via |98|---|---|---|---|99100## Environment / config keys101| Key | Configures | Secret? | Consumed at |102|---|---|---|---|103104## Entry points105<how each runnable module starts — main class / command.>106107## Unknowns / to resolve108- …109```110111## Triggering112113SHOULD fire: "просканируй и опиши проект"; "map this repo before we document it";114"проиндексируй монорепу". SHOULD NOT fire: "write the README" (that is115`document-project`, which reads the map this skill produced); "audit the116architecture" (that is `architecture-checkup`). This skill *maps*; it does not117write user-facing docs and does not judge quality.118119## Handing off120121The map is the input contract for `document-project` (turns modules → READMEs)122and `run-guide` (turns toolchain + services + env into a verified run route).123Keep it current: if a later phase discovers the map was wrong, fix the map too.