agentleFS
sponge-b0bsponge-b0b/Polaris/.agents/skills/wiki-sync/SKILL.md

wiki-sync

Skill4 starsChanged 3 months agoApache-2.0View on GitHub

Maintain the Living Entity Wiki around specific source-code, authoritative-document, ADR, and entity-topology changes.

7 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use almagest, almagest-onboard and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • nathanadaySkill

    almagest

    Orient in the Almagest vault, say what waits for the user, do the work a request asks in a linked repository, and route any other request to the skill that owns it. Use for /almagest, what is going on, status, what waits for me, where do I work on X, work on X, fix this, implement, build, note this, remember to, publish my journal, what is in my journals, and any request when the right skill is not clear. Keeping part of this conversation is wiki-save; files to learn from are wiki-ingest.

    Also in 3 projects that use this

  • nathanadaySkill

    almagest-onboard

    Make a new Almagest vault: ask its name, its folder, and how freely to tag, then link its first repositories. Use for set up almagest, new vault, start a vault here, onboard, make this folder a vault. Linking a repository to a vault that exists is repo-link.

    Also in 3 projects that use this

  • justvinhhereSkill

    wiki-review

    Use when the user runs /review, says "show pending changes", "what's uncommitted", or wants an audit of uncommitted wiki edits before they land in history. Narrates uncommitted changes, flags structural issues scoped to those changes, and commits them with a conventional subject. Fully automatic.

    Also in 3 projects that use this

  • MicrosoftSkill

    wiki-query

    Use when an operation issue asks you to answer a question from the LLM Wiki — `operationType: "query"` and a question in the issue body. Answer with citations to wiki pages and raw sources, and offer to file durable synthesis back into `wiki/synthesis/` so the work compounds instead of disappearing into a chat thread.

    Also in 4 projects that use this

  • +8 more from nathanaday

The file

Show its rules and text

We split this skill into the rules it gives an agent

66 rules. 0 are common, 48 are distinctive, and 18 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 48

    Distinctive

    This author's own choices. Worth a look.

  • 18

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never modify authoritative sources merely to make them agree with the wiki.

    line 19
  2. Distinctive:

    Search before reading. Locate the relevant claim, citation, symbol, or call site, then read the smallest useful surrounding range.

    line 26
  3. Distinctive:

    Do not reread unchanged authority already established in the current workflow unless new evidence creates ambiguity or contradiction.

    line 27
  4. Very specific:

    Do not read wiki/log.md until a durable wiki mutation requires a log entry or its history is specifically needed.

    line 29
  5. Distinctive:

    before and after a substantive source-code change.

    line 38
  6. Very specific:

    after substantive creation, editing, or reclassification involving docs/current/ or docs/proposed/.

    line 39
  7. Very specific:

    after an ADR is created, substantively edited while proposed, or changes status through $to-adr-doc.

    line 40
  8. Distinctive:

    when entity topology or Boundary Rationale changes.

    line 41
  9. Distinctive:

    If applicable authoritative sources materially disagree, surface:

    line 58
  10. Distinctive:

    Update an entity only when durable knowledge changed, such as:

    line 75
  11. Distinctive:

    Do not update merely because code was touched, moved, refactored, or an implementation technique succeeded.

    line 84
  12. Distinctive:

    Prefer executable architecture/static checks for stable mechanically enforceable subsets.

    line 104
  13. Very specific:

    If movement changes a Routing Anchor in wiki/index.md, update it afterward.

    line 116
  14. Distinctive:

    When unsure, run the audit.

    line 118
  15. Very specific:

    Start from caller-provided Architecture context when available, then confirm against wiki/index.md.

    line 122
  16. Very specific:

    If ownership is ambiguous, cross-boundary, or unmatched, use targeted repository evidence such as $codegraph or $codebase-memory-mcp rather …

    line 135
  17. Distinctive:

    Do not reconstruct a dependency graph.

    line 137
  18. Distinctive:

    check the intended change against applicable Strict Invariants.

    line 144
  19. Distinctive:

    check materially similar Rejected Approaches.

    line 145
  20. Distinctive:

    If a Strict Invariant would be violated, stop and report:

    line 147
  21. Distinctive:

    Do not silently override it.

    line 154
  22. Distinctive:

    If a Rejected Approach still applies, stop and surface it.

    line 156
  23. Distinctive:

    If satisfaction is unclear, require owner judgment.

    line 166
  24. Distinctive:

    Start from the implementation diff.

    line 170
  25. Distinctive:

    remove the pending Planned entry.

    line 194
  26. Distinctive:

    create/update the resulting Strict Invariant citing the accepted ADR.

    line 195
  27. Distinctive:

    Do not change ADR status.

    line 197
  28. Distinctive:

    If realization is partial or unclear, leave it Planned.

    line 199
  29. Distinctive:

    Create a durable Rejected Approach only when:

    line 205
  30. Very specific:

    Use Reconsider when: only for a genuine condition-dependent rejection.

    line 221
  31. Distinctive:

    create a qualifying Rejected Approach when appropriate.

    line 238
  32. Distinctive:

    update Planned if future direction changed.

    line 239
  33. Distinctive:

    If no active entity clearly covers the affected boundary, do not force-fit it.

    line 244
  34. Very specific:

    Search wiki/index.md by scope first.

    line 246
  35. Very specific:

    If no entity fits, load wiki/_schema.md and apply its Entity Boundary rules.

    line 248
  36. Distinctive:

    If promotion clearly qualifies:

    line 250
  37. Distinctive:

    use an existing Category when appropriate.

    line 253
  38. Distinctive:

    add coarse Routing Anchors when applicable.

    line 258
  39. Distinctive:

    If promotion fails, do not create an entity.

    line 261
  40. Distinctive:

    If unclear, surface the ambiguity.

    line 263
  41. Distinctive:

    search for existing inline citations to the changed document.

    line 273
  42. Distinctive:

    When a document changes class, evaluate affected claims under its new authority.

    line 281
  43. Distinctive:

    If only the path changes and semantic authority does not, update citation paths without rewriting otherwise-valid claims.

    line 290
  44. Very specific:

    Do not recreate linked_docs.

    line 292
  45. Very specific:

    Check affected claims for [source-conflict].

    line 310
  46. Distinctive:

    if already implemented, verify realization and represent the invariant.

    line 321
  47. Distinctive:

    Remove Planned content sourced only from the rejected proposal.

    line 326
  48. Distinctive:

    Add a Rejected Approach only when the rejection carries durable repeat-prevention knowledge.

    line 328
  49. Distinctive:

    Do not keep an invariant active solely because implementation still reflects retired authority.

    line 340
  50. Very specific:

    After bootstrap, $wiki-sync owns active entity topology.

    line 344
  51. Distinctive:

    Do not rename historical ADRs merely because an entity ID changes.

    line 362
  52. Distinctive:

    Do not duplicate claims for symmetry.

    line 368
  53. Very specific:

    Do not hide [source-conflict].

    line 374
  54. Distinctive:

    Remove the entity page, index entry, and explicit links.

    line 378
  55. Distinctive:

    Do not create tombstones.

    line 380
  56. Very specific:

    Use provenance required by wiki/_template.md.

    line 390
  57. Distinctive:

    When durable knowledge changes:

    line 394
  58. Very specific:

    keep entity pages and wiki/index.md consistent.

    line 396
  59. Distinctive:

    avoid mechanically derivable structure.

    line 398
  60. Very specific:

    If $wiki-sync runs inside a parent committing workflow such as $implement-ticket, include its wiki changes in the parent commit.

    line 404
  61. Distinctive:

    If no durable knowledge changed:

    line 406
  62. Very specific:

    do not edit wiki/log.md;

    line 408
  63. Distinctive:

    do not create a wiki-only commit.

    line 409
  64. Distinctive:

    Do not manufacture certainty.

    line 416
  65. Very specific:

    create new non-ADR documents — use $to-doc.

    line 437
  66. Distinctive:

    Before deciding mutation vs no-op, build a working Affected Knowledge Routing Record from the current change and authoritative routing …

    line 450

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Wiki Sync

$wiki-sync maintains the derived Living Entity Wiki around a specific change.

It is not a whole-wiki audit. The $wiki-lint skill owns the separate repository-wide audit and is not invoked as part of $wiki-sync.

authoritative architecture + implementation evidence
                    ↓
               wiki/entities/

Never modify authoritative sources merely to make them agree with the wiki.

Context Economy

Preserve correctness while minimizing rediscovery.

  • Reuse affected entities, governing authorities, source conclusions, and architecture context already established by the parent workflow or an earlier $wiki-sync pass.
  • Search before reading. Locate the relevant claim, citation, symbol, or call site, then read the smallest useful surrounding range. Expand only when relevant behavior is distributed.
  • Do not reread unchanged authority already established in the current workflow unless new evidence creates ambiguity or contradiction.
  • On the post-change pass, start from the implementation diff and reuse the pre-change entity/source set. Expand only when the diff crosses another boundary or introduces new evidence.
  • Do not read wiki/log.md until a durable wiki mutation requires a log entry or its history is specifically needed.
  • Load wiki/_schema.md, wiki/_template.md, unrelated entities, and topology rules only when entity creation/topology is actually in play.

Whole-file reads are exceptional: use them only when relevant knowledge or behavior cannot be understood from targeted regions.

When This Runs

Invoke $wiki-sync:

  1. before and after a substantive source-code change;
  2. after substantive creation, editing, or reclassification involving docs/current/ or docs/proposed/;
  3. after an ADR is created, substantively edited while proposed, or changes status through $to-adr-doc;
  4. when entity topology or Boundary Rationale changes.

These triggers apply inside parent workflows such as $implement-ticket.

Core Rules

Authority

Authority is claim-specific:

  • code, tests, configuration, executable checks → implementation reality;
  • accepted ADRs → active architectural decisions;
  • docs/current/ → current architectural description;
  • entity pages → derived knowledge only.

Resolve only source citations needed for claims that constrain or may change because of the current work.

If applicable authoritative sources materially disagree, surface:

[source-conflict]

Report the conflicting sources and material consequence.

Do not:

  • pick a winner;
  • rewrite the wiki to one side;
  • rewrite authoritative sources to manufacture agreement;
  • continue treating the disputed claim as settled.

Durable Knowledge Only

Update an entity only when durable knowledge changed, such as:

  • Strict Invariant established or changed;
  • accepted implementation-pending decision realized;
  • qualifying Rejected Approach established;
  • Open Question added or resolved;
  • Boundary Rationale changed;
  • entity topology changed.

Do not update merely because code was touched, moved, refactored, or an implementation technique succeeded.

Evidence Strength

Match conclusions to evidence.

Mechanically observable rules may be positively verified when evidence proves them.

For architectural or intent-level claims, absence of contradiction supports:

no contrary implementation evidence found

not:

verified

Prefer executable architecture/static checks for stable mechanically enforceable subsets.

1. Source-Code Changes

Trivial-Diff Exemption

The pre-change pass may be skipped only for:

  • whitespace/formatting-only changes;
  • comment/docstring-only changes with no contractual effect;
  • pure file/symbol movement or rename with no behavioral or contractual change.

If movement changes a Routing Anchor in wiki/index.md, update it afterward.

When unsure, run the audit.

Route the Change

Start from caller-provided Architecture context when available, then confirm against wiki/index.md.

Routing Anchors are coarse hints, not exhaustive ownership declarations.

Load only materially relevant entity pages and inspect applicable:

  • Strict Invariants;
  • Rejected Approaches;
  • Open Questions;
  • Planned entries.

Load another entity only when its knowledge materially affects the change.

If ownership is ambiguous, cross-boundary, or unmatched, use targeted repository evidence such as $codegraph or $codebase-memory-mcp rather than guessing.

Do not reconstruct a dependency graph.

Pre-Change Audit

For every materially relevant entity claim:

  1. confirm required source consistency;
  2. check the intended change against applicable Strict Invariants;
  3. check materially similar Rejected Approaches.

If a Strict Invariant would be violated, stop and report:

  • invariant;
  • causal reasoning;
  • source;
  • concrete conflict.

Do not silently override it.

If a Rejected Approach still applies, stop and surface it.

If it contains:

Reconsider when: ...

and the condition clearly holds, mark it eligible for reconsideration.

If satisfaction is unclear, require owner judgment.

Post-Change Audit

Start from the implementation diff.

Re-evaluate only:

  • materially affected invariants;
  • relevant accepted implementation-pending decisions;
  • newly crossed entity boundaries.

Reuse pre-change routing and source conclusions.

Expand only when the diff introduces new evidence, contradicts prior conclusions, or crosses another boundary.

Realized Accepted Decisions

For a relevant Planned entry marked:

accepted, implementation pending

when implementation now realizes the accepted decision:

  1. verify realization;
  2. re-check [source-conflict];
  3. remove the pending Planned entry;
  4. create/update the resulting Strict Invariant citing the accepted ADR.

Do not change ADR status.

If realization is partial or unclear, leave it Planned.

2. Rejected Approaches and Open Questions

Rejected Approaches

Create a durable Rejected Approach only when:

  • the owner explicitly rejected it for a load-bearing reason;
  • an actual experiment failed for a concrete non-obvious reason; or
  • an authoritative document records the rejection.

Valid provenance includes:

source: docs/...
source: owner-confirmed session decision, undocumented
source: session experiment, undocumented

Unsupported agent judgment is insufficient.

Use Reconsider when: only for a genuine condition-dependent rejection.

Open Questions

A concrete unresolved concern may be preserved with provenance such as:

source: docs/...
source: owner-raised session question, undocumented
source: agent-observed during session, unresolved

Agent-observed entries remain questions, not implied facts.

When resolved:

  • convert to a Strict Invariant if an active constraint resulted;
  • create a qualifying Rejected Approach when appropriate;
  • update Planned if future direction changed;
  • otherwise remove the question.

3. No Matching Entity

If no active entity clearly covers the affected boundary, do not force-fit it.

Search wiki/index.md by scope first.

If no entity fits, load wiki/_schema.md and apply its Entity Boundary rules.

If promotion clearly qualifies:

  • assign a stable Entity ID;
  • use an existing Category when appropriate;
  • require explicit approval for a new top-level Category;
  • create from wiki/_template.md;
  • add to wiki/index.md;
  • set Implementation appropriately;
  • add coarse Routing Anchors when applicable;
  • record Boundary Rationale with required provenance.

If promotion fails, do not create an entity.

If unclear, surface the ambiguity.

4. Non-ADR Document Changes

Classification and movement are owned by $to-doc and $classify-doc.

$wiki-sync owns only the derived wiki consequence.

For substantive changes involving docs/current/ or docs/proposed/:

  1. search for existing inline citations to the changed document;
  2. re-evaluate affected claims;
  3. inspect changed regions for newly introduced entity-level knowledge.

For docs/current/, retain/update/remove affected Strict Invariants according to current authority and implementation evidence.

For docs/proposed/, retain/update/remove affected Planned content according to the proposal.

When a document changes class, evaluate affected claims under its new authority.

Rules:

  • proposed → current does not automatically mean Planned → Strict Invariant;
  • leaving current may invalidate claims sourced only from it;
  • leaving proposed may invalidate Planned content sourced only from it;
  • entering current or proposed may introduce newly eligible claims.

If only the path changes and semantic authority does not, update citation paths without rewriting otherwise-valid claims.

Do not recreate linked_docs.

5. ADR Events

ADR lifecycle is owned by $to-adr-doc.

$wiki-sync owns only the derived wiki consequence.

Inspect only entity claims materially affected by the ADR.

Proposed

A proposed ADR may support Planned content.

On creation or substantive edit, update affected citations and add newly meaningful Planned direction when warranted.

Accepted

Check affected claims for [source-conflict].

Then classify the decision as:

  • immediately effective; or
  • realization-required.

Immediately effective decisions become active Strict Invariants.

For realization-required decisions:

  • if already implemented, verify realization and represent the invariant;
  • otherwise retain accepted, implementation pending under Planned.

Rejected

Remove Planned content sourced only from the rejected proposal.

Add a Rejected Approach only when the rejection carries durable repeat-prevention knowledge.

Deprecated or Superseded

The old ADR is no longer active authority.

For affected claims relying on it:

  • retain only when another active source independently supports them;
  • otherwise remove or replace them;
  • process any successor under its own status.

Do not keep an invariant active solely because implementation still reflects retired authority.

6. Entity Topology

After bootstrap, $wiki-sync owns active entity topology.

Topology changes include:

  • creation/promotion;
  • rename;
  • split;
  • merge;
  • removal;
  • material scope change;
  • Boundary Rationale change.

Load and apply wiki/_schema.md only when topology is changing.

Rename

Atomically rename the page, update wiki/index.md, and update explicit entity links.

Do not rename historical ADRs merely because an entity ID changes.

Split

Confirm each resulting boundary qualifies, redistribute knowledge by actual scope, update the index, and remove the old entity when it no longer exists.

Do not duplicate claims for symmetry.

Merge

Choose/create the survivor, combine only valid knowledge, deduplicate overlaps, update Boundary Rationale/index, and remove obsolete pages.

Do not hide [source-conflict].

Removal

Remove the entity page, index entry, and explicit links.

Do not create tombstones.

wiki/entities/ contains active entities only.

Boundary Rationale

Change Boundary Rationale only after an explicit boundary/topology decision.

Ordinary file movement or package cleanup is insufficient.

Use provenance required by wiki/_template.md.

7. Wiki Mutation

When durable knowledge changes:

  1. keep entity pages and wiki/index.md consistent;
  2. maintain inline citations and causal reasoning;
  3. avoid mechanically derivable structure;
  4. append one concise semantic entry to wiki/log.md;
  5. land the entity/index/log mutation atomically.

Load wiki/log.md only after determining that a durable mutation is required.

If $wiki-sync runs inside a parent committing workflow such as $implement-ticket, include its wiki changes in the parent commit.

If no durable knowledge changed:

  • do not edit wiki/log.md;
  • do not create a wiki-only commit;
  • report that no entity update was required.

The log records semantic state changes, not tool executions.

Failure and Ambiguity

Do not manufacture certainty.

Surface for owner judgment:

  • [source-conflict];
  • ambiguous entity ownership;
  • unclear promotion;
  • introduction of a new Category;
  • unclear immediate-vs-realization-required ADR acceptance;
  • uncertain implementation realization;
  • uncertain Reconsider when: satisfaction;
  • unresolved material disagreement among relevant entity claims.

Derived wiki content must never conceal ambiguity in its sources.

Out of Scope

$wiki-sync does not:

  • perform initial repository-wide entity bootstrap;
  • classify/move existing non-ADR documents — use $classify-doc;
  • create new non-ADR documents — use $to-doc;
  • own ADR lifecycle — use $to-adr-doc;
  • perform or invoke a full wiki audit — that separate workflow belongs to the $wiki-lint skill;
  • synthesize inferred cross-entity patterns — use $wiki-synthesize;
  • rewrite authoritative docs merely to make the wiki agree;
  • persist derivable dependency graphs, inventories, or call chains.

$wiki-sync maintains derived knowledge around a specific change. The $wiki-lint skill independently checks the whole system.

Transition-Bound Affected Knowledge Routing

For a bounded $wiki-sync invocation, no durable knowledge changed is a semantic disposition and must be supported by an explicit affected-knowledge universe.

Before deciding mutation vs no-op, build a working Affected Knowledge Routing Record from the current change and authoritative routing evidence:

Candidate: WK-<n>
Changed surface/authority: <exact source>
Candidate entity/claim: <exact entity + claim/section>
Routing basis: <routing anchor | inline citation | changed authority | boundary evidence | other direct evidence>
Disposition: <affected | not-affected | unresolved>
Reason/evidence: <why durable knowledge changes or does not>

The candidate universe must include every entity/claim surfaced by applicable Routing Anchors, direct inline citations to changed authoritative documents, and any additional entity boundary directly crossed by the diff/current change. Context-economy rules still apply after this routing universe is established; they may narrow how much text is read, not which surfaced candidates receive a disposition.

no durable knowledge changed is legal only when:

Affected-knowledge candidates: <n>
Missing/unclassified candidates: 0
Unresolved candidates: 0
Affected candidates requiring mutation: 0
Not-affected candidates without reason/evidence: 0
Unresolved source conflicts: 0

When durable knowledge changes, the entity/index/log mutation set must correspond to the affected candidates and remain atomic under the existing Wiki Mutation rules. Do not create wiki edits for candidates explicitly proven not-affected, and do not silently omit an affected candidate because another entity was updated.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.