-
Notifications
You must be signed in to change notification settings - Fork 2
Sync Flow
type: concept up: "Template-vs-Derived-Projects" extends: "Template-vs-Derived-Projects" tags: [sync, maintenance]
How template improvements propagate from the template repository to existing derived projects.
scripts/update-from-template.sh and scripts/check-template-version.sh both maintain the same five arrays, byte-for-byte aligned with each other. Together they define what gets synced into derived projects, what gets re-substituted after sync, and what is deliberately not synced. The arrays as currently in main:
Eight files that ship to every derived project regardless of overlay:
llm-wiki.mdwiki/init-wiki.shwiki/agents/README.mdwiki/agents/discipline-gates.mdwiki/agents/verification-gate.mdscripts/update-from-template.shscripts/check-template-version.sh.gitignore
Synced only if the derived project has .claude/ or wiki/agents/claude-code/:
-
.claude/commands/wiki-experiment.md,wiki-source.md,wiki-lint.md -
.claude/skills/wiki-experiment.md,wiki-source.md,wiki-lint.md wiki/agents/claude-code/setup.shwiki/agents/claude-code/README.mdwiki/agents/claude-code/templates/claude-md-snippet.mdwiki/agents/claude-code/templates/memory-seed.mdwiki/agents/claude-code/templates/session-start-hook.sh
Synced only if the derived project has .cursor/ or wiki/agents/cursor/:
-
.cursor/rules/wiki-as-memory.mdc,wiki-experiment.mdc,wiki-source.mdc,wiki-lint.mdc wiki/agents/cursor/setup.shwiki/agents/cursor/README.md
Listed for documentation only; the sync logic does not iterate over this array:
-
scripts/instantiate.sh(self-deletes after a successful instantiation) -
CLAUDE.md.templateandREADME.md.template(consumed and removed byinstantiate.sh; the derived project owns itsCLAUDE.mdandREADME.mddirectly thereafter) .claude/settings.json.template.cursorrules.template
The wiki-* slash commands, skills, and cursor rules all ship with literal {{REPO_NAME}} tokens that must be substituted by the derived project's $REPO_NAME after pulling from template/main:
-
.claude/commands/wiki-experiment.md,wiki-source.md,wiki-lint.md -
.claude/skills/wiki-experiment.md,wiki-source.md,wiki-lint.md -
.cursor/rules/wiki-as-memory.mdc,wiki-experiment.mdc,wiki-source.mdc,wiki-lint.mdc
scripts/kg/ does not exist in the template repo on main; the Knowledge-Graph-Pipeline page that describes it is aspirational (see Implementation-Status). When and if the pipeline ships, its files will be added to ALWAYS_FILES in both sync scripts; until then there is nothing to sync.
Adding a new template file requires adding its path to the appropriate array in both sync scripts. Forgetting this is silent: derived projects simply never receive the file, while the per-overlay procedures that reference it find a dead reference. PR #1 hit this for both discipline-gates.md and verification-gate.md; Priscila caught it as review point 3 and the fix landed before merge. See Lesson-Parallel-File-Drift.
scripts/check-template-version.sh compares a derived project's last-synced template commit against the template's current main. The .llm-wiki-template-log.md file in the derived project records sync history. Keeping this file in git gives a permanent trail; the template's .gitignore makes it commit-or-not at the project's discretion.
update-from-template.sh runs in the derived project's main repo, not the wiki sub-repo. It does not push; the derived project decides when and whether to publish the sync as a commit.
- Template-vs-Derived-Projects
- Agent-Overlays
- Lesson-Parallel-File-Drift
-
Implementation-Status: why
scripts/kg/*.shis no longer listed here - Wiki-Corrections-Log: receipt for the 2026-05-31 rewrite of this contract section