Skip to content
Skills Library
Programming · Review & audit

module-map-reconciler

/module-map-reconciler

Scans the source tree against module-map.yml and docs/modules, writes MM-* findings to .paqad/module-map/drift.json, and routes accepted deltas through src/module-decisions/apply.ts. Use when the user asks to reconcile or refresh the module map, when documentation sync is closing, or when paqad-ai refresh runs.

Repository
paqad-ai ↗
Licence
MIT
Last repository change
12.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
10
Scripts
5
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 12.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 5 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/count-by-code.sh, scripts/filter-by-code.sh, scripts/has-findings.sh, scripts/is-blocked.sh, scripts/reconcile.sh

What it does and when to use it

Scans the source tree against module-map.yml and docs/modules, writes MM-* findings to .paqad/module-map/drift.json, and routes accepted deltas through src/module-decisions/apply.ts. Use when the user asks to reconcile or refresh the module map, when documentation sync is closing, or when paqad-ai refresh runs.

Original author description

Scans the source tree against module-map.yml and docs/modules, writes MM-* findings to .paqad/module-map/drift.json, and routes accepted deltas through src/module-decisions/apply.ts. Use when the user asks to reconcile or refresh the module map, when documentation sync is closing, or when paqad-ai refresh runs.

How it works

  1. What It Does
  2. Use This When
  3. Inputs
  4. Procedure
  5. Output Contract
  6. Escalate / Stop Conditions
  7. Scripts
  8. Assets
  9. Resources
Original SKILL.md headings · 91 lines, 763 words
SKILL.md preview
---
name: module-map-reconciler
description: 'Scans the source tree against module-map.yml and docs/modules, writes MM-* findings to .paqad/module-map/drift.json, and routes accepted deltas through src/module-decisions/apply.ts. Use when the user asks to reconcile or refresh the module map, when documentation sync is closing, or when paqad-ai refresh runs.'
metadata:
  model_tier: medium
  cacheable: 'false'
  output_format: markdown
  paqad-meta: skill.meta.yaml
---

## What It Does

Walks the source tree under `module_health.source_roots` (declared on the active stack pack), compares the files it finds against `module-map.yml`'s declared modules / features and the `docs/modules/<slug>/` tree, and emits findings:

| Code             | Meaning                                                                                                                                  |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `MM-ADD`         | Source files exist under a directory that no module's `sources:` glob matches.                                                           |
| `MM-FEAT-ADD`    | Files under a known module match no declared feature glob.                                                                               |
| `MM-REMOVE`      | Declared module has no matching source files.                                                                                            |
| `MM-RENAME`      | Module's symbol moved (only emitted when the stack pack ships a `public_api_extractor`; otherwise falls back to `MM-REMOVE` + `MM-ADD`). |
| `MM-FEAT-STALE`  | Declared feature has no matching source files.                                                                                           |
| `MM-DOC-ORPHAN`  | `docs/modules/<slug>/` exists with no matching module declaration.                                                                       |
| `MM-DOC-MISSING` | Declared module has no `docs/modules/<slug>/` directory.                                                                                 |
| `MM-MISMATCH`    | A prospective `MD-XXXX` declaration and the actual code paths diverge.                                                                   |

Findings are written to `.paqad/module-map/drift.json` and consumed by:

- `paqad-ai status` (drift badge per module: Phase 4).
- `paqad-ai refresh` (non-zero exit on drift).
- `feature-development.documentation_sync` (stop with `stale_docs: stop` if undeclared modules were touched by the diff).
- `finding-normalizer` (via the `MM-*` code-prefix recognised in `assets/vocabulary.txt`).

## Use This When

- A user prompt matches the priority-225 router rules (`reconcile module map`, `refresh module map`, `update module map`, `check module map`, `module map drift`).
- `feature-development.documentation_sync` is about to close and you need to confirm no undeclared modules were touched.
- `paqad-ai refresh` invokes it to fail fast on drift.

## Inputs

- The active stack pack's `module_health.source_roots`. **Required**: refuses to run with `blocked: source_roots_unknown` when missing. Bundled details in `references/source-roots-contract.md`.
- `module-map.yml` (read-only here; mutations go through `src/module-decisions/apply.ts`).
- `docs/modules/<slug>/` tree for orphan / missing checks.
- Existing `.paqad/decisions/module-decisions/*.yml` for `MM-MISMATCH` cross-referencing.

## Procedure

1. Resolve `source_roots` from the active stack pack. If absent, surface a single Decision Pause packet asking the user to add `module_health.source_roots` to their pack, do **not** guess.
2. Invoke the TS engine via the bundled wrapper:
   ```
   bash scripts/reconcile.sh [project-root]
   ```
   The wrapper shells out to `paqad-ai module-map reconcile --project-root <root>`, producing `.paqad/module-map/drift.json` and a JSON summary on stdout.
3. Parse findings. Group by code and module for presentation.
4. For each finding, surface a Decision Pause packet:
   - `MM-ADD` → "New module under `<dir>`. Declare? (extract → inferencer → apply)": pipes through the Attribution Gate.
   - `MM-FEAT-ADD` → "Add feature glob to `<module>`?": collects feature name + glob, then routes to apply.
   - `MM-REMOVE` / `MM-FEAT-STALE` → "Remove declaration?" or "Update glob?".
   - `MM-DOC-ORPHAN` → "Delete `docs/modules/<slug>/` or declare module?"
   - `MM-DOC-MISSING` → "Run `create module documentation` for `<slug>`?".
   - `MM-MISMATCH` → "Apply pending `MD-XXXX` or revise?".
5. Apply accepted deltas through `src/module-decisions/apply.ts`. Never write `module-map.yml` directly.

## Output Contract

- `.paqad/module-map/drift.json` written with the full report (findings + counts + `blocked`).
- A `## Reconciliation Findings` markdown block listing each code, count, and one-line detail.
- A `## Pending User Decisions` block listing each surfaced packet's question and selected option.
- When invoked from `documentation_sync` and any `MM-ADD` / `MM-MISMATCH` finding touches the diff, exit with `stale_docs: stop`.

## Escalate / Stop Conditions

- Hard-fail with the literal status `blocked: source_roots_unknown` when the active stack pack has no `module_health.source_roots`. Print the path to the pack manifest that needs updating; do **not** prompt to "use a default."
- Stop if `module-map.yml` is missing: the reconciler needs declarations to reconcile against. Surface `Reconciler requires module-map.yml; run "create documentation" first.`
- Stop if any `MM-RENAME` is ambiguous (multiple candidates within Levenshtein bound): collect the user's choice.
- Do **not** write `module-map.yml` from this skill. All map mutations go through `src/module-decisions/apply.ts`.

## Scripts

Deterministic plumbing: do **not** re-derive these in the LLM layer.

- `scripts/reconcile.sh [project-root]`: invoke the reconciler; writes `.paqad/module-map/drift.json` and prints a JSON summary.
- `scripts/has-findings.sh [project-root]`: exit 0 if findings exist, 1 if clean, 2 if blocked (`source_roots_unknown`), 3 if drift.json is missing. Prints the count.
- `scripts/is-blocked.sh [project-root]`: exit 1 with the blocked reason on stdout when the reconciler is blocked.
- `scripts/count-by-code.sh [project-root]`: sorted `MM-CODE: N` lines for use in the `## Reconciliation Findings` block.
- `scripts/filter-by-code.sh <MM-CODE> [project-root]`: JSON array of findings for a specific code.

## Assets

- `assets/templates/findings-summary.md`: markdown template for the `## Reconciliation Findings` + `## Pending User Decisions` output blocks.

## Resources

- `references/source-roots-contract.md`: the source_roots requirement.
- `runtime/base/skills/module-map-reconciler/agents/openai.yaml`: agent interface metadata.
- `src/module-map/reconciler.ts`: detection engine.
- `src/module-decisions/apply.ts`: atomic apply path (only writer of `module-map.yml`).
- `runtime/base/skills/documentation-workflow/scripts/list-orphan-module-dirs.sh`: back-compat orphan detector promoted into `MM-DOC-ORPHAN`.
- the Decision Pause Contract (in the framework bootstrap): packet semantics.
Files in this package (10)
  • SKILL.md 7 KB
  • skill.meta.yaml 1 KB
  • agents/openai.yaml 1 KB
  • assets/templates/findings-summary.md 1 KB
  • references/source-roots-contract.md 2 KB
  • scripts/count-by-code.sh 1 KB
  • scripts/filter-by-code.sh 1 KB
  • scripts/has-findings.sh 1 KB
  • scripts/is-blocked.sh 1 KB
  • scripts/reconcile.sh 1 KB

Versions

The database has no other skills named module-map-reconciler.

Database snapshot: 13.11.2026 · package version ce76f329c921 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100module-health-rollup
    Rolls up test-driven module health: parses the stack pack's coverage and test reports, attributes rows to modules through module-map.yml, and writes .paqad/module-health records with blocked_metrics for signals it could not compute. Use when checks finish, when module-health…
  • 100module-health-update
    Whole-project module-health refresh. The agent-facing "update module health" workflow. Runs the test-driven rollup (coverage / tests / change_velocity from the active stack pack's declared reports) and then the session-evidence sync (defect frequency / contract stability /…
  • 90map
    Generate, regenerate or open an interactive HTML flow map of the current repository with FlowLens (API calls, data flow, module dependencies, agent handoffs, with file and line evidence). Use when the user asks to map, visualize or explain how the project's code flows, or to…
  • 100repo-tree
    Where a thing lives in the LangWatch tree and what each top-level folder is for. Use when someone says 'where does this go', 'which package', 'new package', 'is this a module or a package', 'apps vs modules vs packages vs services vs tools', 'what is a generated module list',…
  • 100docs
    Generate or refresh a module's technical documentation from its own code: README, developer/user guides, REST/GraphQL references, and CHANGELOG scaffold covering the @api surface, events, plugins, routes, and DB schema. For modules with `etc/webapi.xml` it also emits OpenAPI…
  • 100architecture
    This skill should be used when the user asks to "map the architecture", "show module dependencies", "analyze coupling", "dependency graph", "how are modules connected", "module boundaries", or mentions keywords related to architectural analysis and dependency mapping.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.