From aria-knowledge
Generates or verifies `STITCH.md` cross-repo binding artifacts linking backend + frontends in a product group. Supports create, verify, diff, and section modes with auto-propose bootstrap for multi-repo projects.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aria-knowledge:stitch <create|verify|diff|section> <group> [section-name] [--append|--out=path|--no-archive]<create|verify|diff|section> <group> [section-name] [--append|--out=path|--no-archive]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate a cross-repo binding artifact (`STITCH.md`) for a product group (backend + one or more frontends). Tables only, not narrative. Drift detection uses CODEMAP endpoint sections by default with explicit opt-in fallback to grep.
Generate a cross-repo binding artifact (STITCH.md) for a product group (backend + one or more frontends). Tables only, not narrative. Drift detection uses CODEMAP endpoint sections by default with explicit opt-in fallback to grep.
Read ~/.claude/aria-knowledge.local.md. Parse YAML frontmatter projects_groups (multi-line YAML block — see CONFIG.md "Skill-only fields" for canonical schema, including the optional stitch_path sub-field and custom-role conventions).
Look up <tag> in projects_list (get project_root) and projects_groups (get role → folder dict).
<tag> missing from projects_list: stop with "unknown project tag: ".<tag> in projects_list but missing from projects_groups and <project_root> has multiple sub-dirs with repo markers: trigger auto-propose bootstrap.<tag> is a single-repo project (no multi-repo sub-dirs detected): load <project_root>/CODEMAP.md only.Auto-propose bootstrap (when projects_groups[<tag>] is missing but <project_root> contains multiple repo-marker sub-directories):
<project_root> one level deep for sub-directories with repo markers:
manage.py + settings.py → backend (Django)composer.json + artisan → backend (Laravel)Gemfile with rails → backend (Rails)package.json with express/fastify/nestjs → backend (Node)next.config.* → web (Next.js)app.json + expo in package.json → mobile (Expo)package.json with react (no next/expo) → web (React SPA)package.json → prompt user for role nameweb, web-admin, etc.).~/.claude/aria-knowledge.local.md.projects_groups[<tag>] entry, preserving existing fields and YAML structure.Resolve each (role, folder) pair to absolute path: <project_root>/<folder>. For each absolute path, read CODEMAP.md if it exists. Read <project_root>/STITCH.md if it exists. Return resolved path map + warnings for any missing CODEMAPs.
For /stitch specifically: the group MUST have multiple sub-repos (at least one backend role + at least one frontend role). If single-repo, stop with "/stitch requires a multi-repo group; use /codemap for single repos".
BACKEND_ROOT = <project_root>/<backend folder> (the one role=backend entry)FRONTEND_ROOTS = list of <project_root>/<folder> for all non-backend rolesSTITCH_FILE = <project_root>/STITCH.md by default. Override: if projects_groups[<tag>] contains a stitch_path field, use that (relative to <project_root>).For create mode, require BACKEND_ROOT/CODEMAP.md and each frontend_root/CODEMAP.md. If any missing, list what's missing and recommend running /codemap create in each affected repo first.
Start from ${CLAUDE_PLUGIN_ROOT}/template/stitch/STITCH.template.md. Fill Group identity with:
git rev-parse HEAD if git availableSTITCH_FILE pathUsing the loaded CODEMAPs, populate:
Only populate cells with information that appears in the loaded CODEMAPs. Leave cells blank rather than inventing.
Precedence (check in order):
User-provided script — check for <workspace_root>/analyze-stitch.sh or <workspace_root>/analyze-stitch.py. If either exists, invoke with JSON stdin:
{"backend_root": "<abs path>", "frontend_roots": ["<abs path>", ...], "group": "<tag>"}
Expect JSON stdout:
{"fe_orphans": [{"call": "...", "file": "..."}, ...], "be_orphans": [{"route": "...", "file": "..."}, ...]}
Label output section: "Drift source: user script (analyze-stitch.)"*.
CODEMAP-based (default expected path) — check both CODEMAPs for required endpoint sections:
## N. URLConf or similar). Parse endpoint rows.method + path tuples, diff the sets. Label: "Drift source: CODEMAPs (sections: , )".Missing CODEMAP endpoint data — prompt user explicitly (do NOT silently fall through):
STITCH drift detection requires endpoint sections in both CODEMAPs.
Currently missing:
- <backend_path>/CODEMAP.md: <missing section name>
- <frontend_path>/CODEMAP.md: <missing section name> (if applicable)
Recommended: run `/codemap section <missing section>` in the affected repo(s) first
(better accuracy, self-improving as you maintain CODEMAPs).
Fallback: proceed with grep-based drift (coarse — catches presence/absence,
misses HTTP methods, dynamic paths, non-REST conventions). Output will be
labeled "Drift source: fallback grep."
Choose: [C]odemap (stop here, regenerate first) / [G]rep fallback (proceed now)
On [G]rep fallback — grep FE for /api/ strings (and api/v1/, apiSlice, fetch( variants), grep backend for route definitions (Django urls.py patterns, or equivalent). Compare normalized sets. Label output: "Drift source: fallback grep — CODEMAPs incomplete; see recommendation above".
On [C]odemap choice — exit /stitch with instruction: "Run /codemap section <name> in , then re-invoke /stitch <mode> <tag>."
Populate STITCH.md section 6 (Drift log):
Overwrite safety (mirrors /distill Step 4):
STITCH_FILE exists and non-empty, first-run notice explains auto-archive.STITCH_FILE to <workspace>/.aria-stitch/archive/STITCH-YYYY-MM-DD-HHMMSS.md, then write fresh.--append — add new dated section below existing (rare for /stitch; section <n> mode usually preferred; warn user)--out=<path> — write to alternate path--no-archive — destructive overwrite, explicit opt-in| Mode | Behavior |
|---|---|
create <group> | Execute Steps 0-5. Write full STITCH_FILE. |
verify <group> | Re-read STITCH_FILE tables; check cited file paths still exist on disk; flag stale rows. No rewrite unless user requests. |
diff <group> | Run drift detection only (Step 4). Print drift summary; do not modify STITCH_FILE. |
section <group> <n> | Rebuild section n in-place in STITCH_FILE. Skips overwrite safety (only that section changes). |
--append is used for create, warn user: "Append on /stitch is rare; section <n> is usually the right mode for incremental updates."npx claudepluginhub mikeprasad/aria-knowledge --plugin aria-knowledgeGenerates or updates a feature-organized CODEMAP.md for any codebase, detecting frameworks and tracing end-to-end flows. Supports create, inventory, update, and section modes.
Coordinates multi-repo swarms, synchronizes packages, and optimizes repository architecture across GitHub organizations. Use when changes span several repos or planning cross-repo work.
Enriches /ctx-architecture artifacts with GitNexus MCP data: verifies blast radius, execution flows, domain clustering, registration sites. Run after base architecture analysis for quantification.