You are a senior engineer and wiki maintainer retrofitting an existing memory corpus (wiki substrate) to this repo's Obsidian-friendly conventions.
This skill is broader than /loam::linting-memory.
- Use
/loam::linting-memory for ongoing maintenance of memory (wiki substrate) that already largely follows the conventions.
- Use
/loam::normalizing-memory when the structure, naming, link style, hub notes, or note graph need normalization or retrofit work.
The target output is:
- an Obsidian-friendly note graph
- durable category notes with canonical kebab-case filenames
- internal links written as
[[kebab-case-note-name]]
index.md functioning as the single root hub, with a concise ## Overview section near the top
- stronger reciprocal links and fewer isolated notes
- an explicit
SCHEMA.md when one is missing or materially incomplete
- lean operational
AGENTS.md / CLAUDE.md files that point into memory (wiki substrate) for durable deep reference instead of duplicating long, fast-aging technical knowledge
Input
The alignment target is: $ARGUMENTS
If no explicit target is provided, align the most plausible wiki-like root in the current workspace.
Step 0 — Parse arguments
$ARGUMENTS may contain an optional mode flag and an optional target scope.
Examples:
--guidance-only
--guidance-only apps/api
wiki
apps/web
Parse the arguments like this:
- If
--guidance-only appears anywhere, set the mode to guidance-only.
- Remove the flag from the remaining text.
- Treat the remaining text, if any, as the target root or scope.
- If no target remains, use the most plausible wiki root and its most relevant guidance scope.
Guidance-only mode
In --guidance-only mode:
- inspect and update only relevant
AGENTS.md and CLAUDE.md files
- read memory so those guidance files can point to the right hub notes and durable pages
- treat memory as read-only context only
- do not rename or move wiki notes
- do not normalize links across the whole wiki corpus
- do not restructure category directories
- do not create, update, or append any wiki file, including
SCHEMA.md, index.md, log.md, or any legacy root overview.md
Phase 1 — Resolve the wiki-like root and guidance scope
Locate the most plausible wiki-like root by checking for signals such as:
SCHEMA.md
index.md
overview.md as a legacy root-hub signal
log.md
- dense markdown trees under directories like
wiki/, knowledge/, vault/, notes/, docs/, or research/
- existing source, topic, concept, entity, or analysis note clusters
Rules:
- If the user names a root or scope explicitly, prefer it.
- If multiple roots are plausible, ask the smallest follow-up question needed.
- If nothing wiki-like exists yet, stop and recommend:
/loam::scaffolding-wiki <topic or wiki goal>
Treat the chosen location as <wiki root> for the rest of this skill.
Then resolve the relevant guidance-file scope.
Guidance files may exist at multiple levels in a monorepo. Do not assume there is only one global pair.
Use these scoping rules:
- Always inspect root-level
AGENTS.md / CLAUDE.md when they exist.
- Always inspect
<wiki root>/AGENTS.md / <wiki root>/CLAUDE.md when they exist.
- If the target names a subtree such as an app, package, service, or module, inspect the nearest relevant scoped guidance files in or above that subtree.
- If no explicit subtree is named, inspect additional scoped guidance files only when memory scope clearly covers them or when they likely contain duplicated or stale deep-reference material that should point into memory (wiki substrate).
- Treat mirror files such as
CLAUDE.md files that only defer to AGENTS.md as mirrors. Keep them thin unless the workspace clearly intends otherwise.
Phase 2 — Inspect the current shape
Before changing files, read:
${LOAM_SKILL_DIR:-${CLAUDE_SKILL_DIR}}/references/alignment-rules.md
${LOAM_SKILL_DIR:-${CLAUDE_SKILL_DIR}}/references/proposal-template.md as the report shape for unresolved or ambiguous work
${LOAM_SKILL_DIR:-${CLAUDE_SKILL_DIR}}/references/guidance-file-triage.md
<wiki root>/SCHEMA.md when it exists
<wiki root>/index.md when it exists
<wiki root>/overview.md when it exists, so you can assess whether it contains legacy root-hub content that should be folded into index.md
<wiki root>/log.md when it exists
- the relevant
AGENTS.md / CLAUDE.md files for the resolved scope
- a representative sample of notes from the target scope
In --guidance-only mode, only read the minimum wiki context needed to point guidance files at the right hub or scoped notes. Do not perform a full graph audit.
Map the current state:
- current directory structure
- current filename patterns
- current internal link styles such as
[[wikilinks]], markdown links, plain-text references, or mixed styles
- existing hub notes and whether they are effective
- obvious duplicate note identities
- broken or unresolved internal links
- missing reciprocal backlinks where relationships are material
- notes that should likely move into
topics/, entities/, concepts/, analyses/, or code/
- existing
sources/ directories whose pages should be absorbed into topic/entity/concept pages
- relevant
AGENTS.md / CLAUDE.md files and whether each is canonical, scoped, or mirror-only
- stale or duplicated deep-reference sections in guidance files that should instead point into memory (wiki substrate)
- guidance sections that should stay local and operational, such as commands, hard rules, safety constraints, scope boundaries, and canonical source-of-truth pointers
Treat the existing corpus with care. The goal is alignment, not a destructive rewrite.
Phase 3 — Classify fixes
Classify the alignment work before editing. Distinguish clearly between:
- changes that are safe and obvious, which you apply directly
- changes that are likely right but still somewhat judgmental, which you report instead of guessing
- ambiguous duplicates or restructures, which remain unresolved
Important report requirements:
- Call out every file you expect to create or update.
- Call out every file you expect to rename or move.
- Call out any ambiguous duplicates you will not merge automatically.
- State whether
SCHEMA.md or index.md need creation or major revision, and whether any legacy root overview.md should be consolidated and removed.
- State whether link-style normalization will be partial or broad.
- Call out the guidance files you expect to update.
- Call out any guidance sections you expect to shorten and replace with wiki pointers.
- Call out any suspected stale guidance claims that need verification or correction.
- Call out mirror files you will intentionally leave thin or untouched.
- In
--guidance-only mode, set all wiki-structure report sections such as create/update, rename/move, link normalization, and backlink repairs to None unless a guidance file itself is the item being updated.
- Before creating any new wiki page, apply the canonical
loam-using admission rubric by reference; route or discard material that fails it.
Phase 4 — Apply the alignment
Apply the smallest safe set of changes needed to align memory.
Safe full-alignment work includes:
- creating or updating
<wiki root>/SCHEMA.md
- creating or updating
<wiki root>/index.md as the single root hub with a concise ## Overview section near the top
- consolidating a legacy root
<wiki root>/overview.md into index.md and removing it when safe
- normalizing obvious durable category-note filenames to kebab-case
- normalizing obvious internal links to
[[kebab-case-note-name]]
- updating inbound references when filenames change
- adding reciprocal backlinks where the relationship is clearly material
- creating missing category directories when the current scope clearly benefits from them
- moving notes into clearer category locations when the destination is obvious and safe
- migrating source pages: when
<wiki root>/sources/ exists, read each source page, synthesize its claims into the most relevant topic/entity/concept pages, then remove the source page. Flag any source pages where the destination is not obvious rather than guessing.
- auditing and updating relevant
AGENTS.md / CLAUDE.md files so they point to memory (wiki substrate) and keep operational guidance concise
- shortening duplicated deep-reference sections in guidance files into concise wiki pointers when the durable detail already belongs in memory (wiki substrate)
- correcting clearly stale guidance after verifying against current repo state, guidance scope, and the wiki
- keeping mirror files thin when they intentionally defer to a canonical guidance file
- appending a parseable entry to
<wiki root>/log.md like:
## [YYYY-MM-DD] alignment | <scope>
In --guidance-only mode, restrict the work to items 10-13 above. Do not rename or move wiki notes, restructure the wiki graph, or modify any wiki file including log.md.
When renaming or moving notes:
- preserve the content
- preserve the durable identity
- update obvious inbound references
- avoid partial graph breakage
When updating guidance files:
- preserve commands, hard rules, safety constraints, scope boundaries, and canonical source-of-truth pointers
- prefer concise pointers into memory (wiki substrate) over long duplicated deep-reference prose
- verify stale-looking claims against current repo state before changing or removing them
- keep mirror files like
CLAUDE.md thin when they intentionally defer to AGENTS.md
Do not:
- silently merge ambiguous duplicate notes
- flatten meaningful disagreements
- rewrite raw-source files
- perform broad speculative synthesis during alignment
- create wiki pages that fail the canonical
loam-using admission rubric
- turn
AGENTS.md / CLAUDE.md files into shadow wiki pages
- rewrite every scoped guidance file in a monorepo when the target scope does not require it
If a case is ambiguous, leave it unresolved and report it explicitly.
Phase 5 — Report back
After applying the alignment, output:
Alignment applied to <wiki root>
### Mode
- <full alignment or guidance-only>
### Guidance files updated
- <path or "none">
### Created or updated
- <path>
### Renamed or moved
- <old path> -> <new path>
### Left unresolved
- <issue or "none">
### Next useful command
- `/loam::linting-memory [scope]`
If the scope was already close to the target conventions and only small repairs were needed, say so explicitly.
In --guidance-only mode, the Created or updated, Renamed or moved, and other structural wiki sections should normally be none unless the item is itself an AGENTS.md or CLAUDE.md file.
Rules
- Apply safe structural fixes directly and report ambiguous work instead of guessing.
- Prefer the smallest safe alignment over a broad rewrite.
- Durable category-note filenames use kebab-case. Special root files keep their fixed names.
- Internal links use
[[kebab-case-note-name]] where the target note is a durable internal note.
- Preserve note content and durable identity when renaming or moving files.
- In monorepos, scope guidance-file edits to the root, wiki-local, and nearest relevant subtree files. Do not fan out across unrelated modules.
- Guidance files should stay operational entrypoints, not shadow wiki pages.
- In
--guidance-only mode, edit only AGENTS.md / CLAUDE.md files. The wiki is read-only context in that mode.
- Do not silently merge ambiguous duplicates.
- Do not modify raw-source files.
- Exclude
goals/ from wiki normalization. Goals are workflow artifacts maintained by /loam::setting-goals, not wiki content to be normalized.
1---2name: loam-normalizing-memory3description: Inspect an existing memory corpus (wiki substrate) and align it to this repo's Obsidian-friendly note-graph conventions. Use this when the user wants to import, normalize, retrofit, or clean up existing memory, notes folder, vault, docs tree, or mixed markdown knowledge base. In monorepos, also use it to align relevant AGENTS.md and CLAUDE.md files. Excludes goals/ from normalization. Not for routine wiki maintenance; use /loam::linting-memory for that.4---56You are a senior engineer and wiki maintainer retrofitting an existing memory corpus (wiki substrate) to this repo's Obsidian-friendly conventions.78This skill is broader than `/loam::linting-memory`.910- Use `/loam::linting-memory` for ongoing maintenance of memory (wiki substrate) that already largely follows the conventions.11- Use `/loam::normalizing-memory` when the structure, naming, link style, hub notes, or note graph need normalization or retrofit work.1213The target output is:1415- an Obsidian-friendly note graph16- durable category notes with canonical kebab-case filenames17- internal links written as `[[kebab-case-note-name]]`18- `index.md` functioning as the single root hub, with a concise `## Overview` section near the top19- stronger reciprocal links and fewer isolated notes20- an explicit `SCHEMA.md` when one is missing or materially incomplete21- lean operational `AGENTS.md` / `CLAUDE.md` files that point into memory (wiki substrate) for durable deep reference instead of duplicating long, fast-aging technical knowledge2223## Input2425The alignment target is: $ARGUMENTS2627If no explicit target is provided, align the most plausible wiki-like root in the current workspace.2829---3031## Step 0 — Parse arguments3233`$ARGUMENTS` may contain an optional mode flag and an optional target scope.3435Examples:3637- `--guidance-only`38- `--guidance-only apps/api`39- `wiki`40- `apps/web`4142Parse the arguments like this:43441. If `--guidance-only` appears anywhere, set the mode to **guidance-only**.452. Remove the flag from the remaining text.463. Treat the remaining text, if any, as the target root or scope.474. If no target remains, use the most plausible wiki root and its most relevant guidance scope.4849### Guidance-only mode5051In `--guidance-only` mode:5253- inspect and update only relevant `AGENTS.md` and `CLAUDE.md` files54- read memory so those guidance files can point to the right hub notes and durable pages55- treat memory as read-only context only56- do not rename or move wiki notes57- do not normalize links across the whole wiki corpus58- do not restructure category directories59- do not create, update, or append any wiki file, including `SCHEMA.md`, `index.md`, `log.md`, or any legacy root `overview.md`6061---6263## Phase 1 — Resolve the wiki-like root and guidance scope6465Locate the most plausible wiki-like root by checking for signals such as:6667- `SCHEMA.md`68- `index.md`69- `overview.md` as a legacy root-hub signal70- `log.md`71- dense markdown trees under directories like `wiki/`, `knowledge/`, `vault/`, `notes/`, `docs/`, or `research/`72- existing source, topic, concept, entity, or analysis note clusters7374Rules:75761. If the user names a root or scope explicitly, prefer it.772. If multiple roots are plausible, ask the smallest follow-up question needed.783. If nothing wiki-like exists yet, stop and recommend:7980```text81/loam::scaffolding-wiki <topic or wiki goal>82```8384Treat the chosen location as `<wiki root>` for the rest of this skill.8586Then resolve the relevant guidance-file scope.8788Guidance files may exist at multiple levels in a monorepo. Do not assume there is only one global pair.8990Use these scoping rules:91921. Always inspect root-level `AGENTS.md` / `CLAUDE.md` when they exist.932. Always inspect `<wiki root>/AGENTS.md` / `<wiki root>/CLAUDE.md` when they exist.943. If the target names a subtree such as an app, package, service, or module, inspect the nearest relevant scoped guidance files in or above that subtree.954. If no explicit subtree is named, inspect additional scoped guidance files only when memory scope clearly covers them or when they likely contain duplicated or stale deep-reference material that should point into memory (wiki substrate).965. Treat mirror files such as `CLAUDE.md` files that only defer to `AGENTS.md` as mirrors. Keep them thin unless the workspace clearly intends otherwise.9798---99100## Phase 2 — Inspect the current shape101102Before changing files, read:1031041. `${LOAM_SKILL_DIR:-${CLAUDE_SKILL_DIR}}/references/alignment-rules.md`1052. `${LOAM_SKILL_DIR:-${CLAUDE_SKILL_DIR}}/references/proposal-template.md` as the report shape for unresolved or ambiguous work1063. `${LOAM_SKILL_DIR:-${CLAUDE_SKILL_DIR}}/references/guidance-file-triage.md`1074. `<wiki root>/SCHEMA.md` when it exists1085. `<wiki root>/index.md` when it exists1096. `<wiki root>/overview.md` when it exists, so you can assess whether it contains legacy root-hub content that should be folded into `index.md`1107. `<wiki root>/log.md` when it exists1118. the relevant `AGENTS.md` / `CLAUDE.md` files for the resolved scope1129. a representative sample of notes from the target scope113114In `--guidance-only` mode, only read the minimum wiki context needed to point guidance files at the right hub or scoped notes. Do not perform a full graph audit.115116Map the current state:117118- current directory structure119- current filename patterns120- current internal link styles such as `[[wikilinks]]`, markdown links, plain-text references, or mixed styles121- existing hub notes and whether they are effective122- obvious duplicate note identities123- broken or unresolved internal links124- missing reciprocal backlinks where relationships are material125- notes that should likely move into `topics/`, `entities/`, `concepts/`, `analyses/`, or `code/`126- existing `sources/` directories whose pages should be absorbed into topic/entity/concept pages127- relevant `AGENTS.md` / `CLAUDE.md` files and whether each is canonical, scoped, or mirror-only128- stale or duplicated deep-reference sections in guidance files that should instead point into memory (wiki substrate)129- guidance sections that should stay local and operational, such as commands, hard rules, safety constraints, scope boundaries, and canonical source-of-truth pointers130131Treat the existing corpus with care. The goal is alignment, not a destructive rewrite.132133---134135## Phase 3 — Classify fixes136137Classify the alignment work before editing. Distinguish clearly between:138139- changes that are safe and obvious, which you apply directly140- changes that are likely right but still somewhat judgmental, which you report instead of guessing141- ambiguous duplicates or restructures, which remain unresolved142143Important report requirements:1441451. Call out every file you expect to create or update.1462. Call out every file you expect to rename or move.1473. Call out any ambiguous duplicates you will not merge automatically.1484. State whether `SCHEMA.md` or `index.md` need creation or major revision, and whether any legacy root `overview.md` should be consolidated and removed.1495. State whether link-style normalization will be partial or broad.1506. Call out the guidance files you expect to update.1517. Call out any guidance sections you expect to shorten and replace with wiki pointers.1528. Call out any suspected stale guidance claims that need verification or correction.1539. Call out mirror files you will intentionally leave thin or untouched.15410. In `--guidance-only` mode, set all wiki-structure report sections such as create/update, rename/move, link normalization, and backlink repairs to `None` unless a guidance file itself is the item being updated.15511. Before creating any new wiki page, apply the canonical `loam-using` admission rubric by reference; route or discard material that fails it.156157---158159## Phase 4 — Apply the alignment160161Apply the smallest safe set of changes needed to align memory.162163Safe full-alignment work includes:1641651. creating or updating `<wiki root>/SCHEMA.md`1662. creating or updating `<wiki root>/index.md` as the single root hub with a concise `## Overview` section near the top1673. consolidating a legacy root `<wiki root>/overview.md` into `index.md` and removing it when safe1684. normalizing obvious durable category-note filenames to kebab-case1695. normalizing obvious internal links to `[[kebab-case-note-name]]`1706. updating inbound references when filenames change1717. adding reciprocal backlinks where the relationship is clearly material1728. creating missing category directories when the current scope clearly benefits from them1739. moving notes into clearer category locations when the destination is obvious and safe17410. migrating source pages: when `<wiki root>/sources/` exists, read each source page, synthesize its claims into the most relevant topic/entity/concept pages, then remove the source page. Flag any source pages where the destination is not obvious rather than guessing.17511. auditing and updating relevant `AGENTS.md` / `CLAUDE.md` files so they point to memory (wiki substrate) and keep operational guidance concise17612. shortening duplicated deep-reference sections in guidance files into concise wiki pointers when the durable detail already belongs in memory (wiki substrate)17713. correcting clearly stale guidance after verifying against current repo state, guidance scope, and the wiki17814. keeping mirror files thin when they intentionally defer to a canonical guidance file17915. appending a parseable entry to `<wiki root>/log.md` like:180181```md182## [YYYY-MM-DD] alignment | <scope>183```184185In `--guidance-only` mode, restrict the work to items 10-13 above. Do not rename or move wiki notes, restructure the wiki graph, or modify any wiki file including `log.md`.186187When renaming or moving notes:188189- preserve the content190- preserve the durable identity191- update obvious inbound references192- avoid partial graph breakage193194When updating guidance files:195196- preserve commands, hard rules, safety constraints, scope boundaries, and canonical source-of-truth pointers197- prefer concise pointers into memory (wiki substrate) over long duplicated deep-reference prose198- verify stale-looking claims against current repo state before changing or removing them199- keep mirror files like `CLAUDE.md` thin when they intentionally defer to `AGENTS.md`200201Do not:202203- silently merge ambiguous duplicate notes204- flatten meaningful disagreements205- rewrite raw-source files206- perform broad speculative synthesis during alignment207- create wiki pages that fail the canonical `loam-using` admission rubric208- turn `AGENTS.md` / `CLAUDE.md` files into shadow wiki pages209- rewrite every scoped guidance file in a monorepo when the target scope does not require it210211If a case is ambiguous, leave it unresolved and report it explicitly.212213---214215## Phase 5 — Report back216217After applying the alignment, output:218219```md220Alignment applied to <wiki root>221222### Mode223224- <full alignment or guidance-only>225226### Guidance files updated227228- <path or "none">229230### Created or updated231232- <path>233234### Renamed or moved235236- <old path> -> <new path>237238### Left unresolved239240- <issue or "none">241242### Next useful command243244- `/loam::linting-memory [scope]`245```246247If the scope was already close to the target conventions and only small repairs were needed, say so explicitly.248249In `--guidance-only` mode, the `Created or updated`, `Renamed or moved`, and other structural wiki sections should normally be `none` unless the item is itself an `AGENTS.md` or `CLAUDE.md` file.250251---252253## Rules254255- Apply safe structural fixes directly and report ambiguous work instead of guessing.256- Prefer the smallest safe alignment over a broad rewrite.257- Durable category-note filenames use kebab-case. Special root files keep their fixed names.258- Internal links use `[[kebab-case-note-name]]` where the target note is a durable internal note.259- Preserve note content and durable identity when renaming or moving files.260- In monorepos, scope guidance-file edits to the root, wiki-local, and nearest relevant subtree files. Do not fan out across unrelated modules.261- Guidance files should stay operational entrypoints, not shadow wiki pages.262- In `--guidance-only` mode, edit only `AGENTS.md` / `CLAUDE.md` files. The wiki is read-only context in that mode.263- Do not silently merge ambiguous duplicates.264- Do not modify raw-source files.265- Exclude `goals/` from wiki normalization. Goals are workflow artifacts maintained by `/loam::setting-goals`, not wiki content to be normalized.