chapter-sync

Incrementally syncs canonical chapter files from an editing repository into a publishing platform folder.

1|Updated May 26, 2026
One-click install
npx skills add https://github.com/nimdvir/dima-publishing --skill chapter-sync-nimdvir
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: chapter-sync
Source: https://github.com/nimdvir/dima-publishing/tree/main/.agents/skills/chapter-sync
Command: npx skills add https://github.com/nimdvir/dima-publishing --skill chapter-sync-nimdvir

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Keeping published chapter content in sync with an upstream editing repository is error-prone: files get copied manually, outdated dated versions linger, and edits made directly on the platform side can be silently overwritten. This Skill automates a safe, incremental, one-directional sync of chapter section files and lab questions into the publishing platform. ## Core Features & Use Cases - Incremental file sync: Copies only newer or missing files, deletes superseded dated versions, and regenerates index.md so each chapter folder stays flat and current. - Conflict detection: Uses a per-chapter .sync-manifest.json with SHA-256 hashes to detect destination-side edits before overwriting, offering overwrite, keep, or diff choices. - Safety guardrails: Never syncs lab answer files, flags exposure risks, supports --dry-run previews, --force repair, and --all batch mode, and only offers the heavy bookData regeneration with explicit approval. - Use Case: After finishing edits to chapter 4 in the BITM330 editing repository, run the sync to copy the updated main section and lab questions into the platform, regenerate index.md, and get prompted to rebuild bookData.ts. ## Quick Start Sync chapter 3 from the editing repository into the platform by asking to run chapter-sync with chapter number 03, optionally adding --dry-run to preview changes first.

Frequently Asked Questions about chapter-sync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync chapter files from an editing repository to a publishing platform?▼

Run chapter-sync with a chapter number, short prefix, or full folder name such as "03" or "ch04-databases". It copies only newer or missing section files, deletes superseded dated versions, regenerates index.md, and asks for confirmation before writing.

How do I preview file sync changes before copying anything?▼

Use the --dry-run flag to get a read-only comparison report showing which sections are CURRENT, NEEDS SYNC, NEW, or CONFLICT. Nothing is copied, deleted, or written, including the manifest, until you rerun without the flag.

What happens if a published chapter file was edited directly on the platform?▼

The sync detects this as a CONFLICT by comparing the destination file's SHA-256 hash against the manifest. It will not overwrite silently; you choose to overwrite, keep the target version, or view a diff, unless --force is set.

Does chapter sync copy lab answer files to the platform?▼

No, lab answers are never copied under any circumstance. Only the latest lab-NN-questions file is synced, and any *-answers-* file found in the destination is flagged as an exposure risk with a recommendation to delete it.

Can I sync all chapters at once instead of one by one?▼

Yes, the --all flag processes every chapter folder that has a matching source, printing a one-line status per chapter and a final summary. Chapters with conflicts are held for individual resolution before any overwrite.

Does the sync rebuild the platform's bookData automatically?▼

No, running generateBookData.ts is always optional and never automatic. After a sync that changed files, the skill lists changed chapters and offers to run npm run generate only with your explicit approval.