sync-readme
npx machina-cli add skill yu-iskw/coding-agent-fabric/sync-readme --openclawsync-readme
Use this skill to keep the technical documentation (README.md and CONTRIBUTING.md) up-to-date with the codebase.
When to Use
- After adding or renaming packages in the monorepo.
- After adding or modifying root scripts in
package.json. - After adding or changing CLI commands or subcommands.
- After significant architectural changes or package relationship updates.
Workflow
-
Analyze Project State: Directly observe the project to gather the necessary information:
- Layout: List directories in
packages/andpackages/plugins/to see the monorepo structure. - Scripts: Read the root
package.jsonto see available scripts. - Commands: Read CLI command definitions in
packages/cli/src/commands/to identify commands and subcommands.
- Layout: List directories in
-
Locate Sync Markers: Find the following markers in the documentation files:
<!-- SYNC:LAYOUT -->...<!-- /SYNC:LAYOUT --><!-- SYNC:SCRIPTS -->...<!-- /SYNC:SCRIPTS --><!-- SYNC:COMMANDS -->...<!-- /SYNC:COMMANDS --><!-- SYNC:ARCHITECTURE -->...<!-- /SYNC:ARCHITECTURE -->
-
Update Content: Update the content between the markers based on your observations:
- Layout ->
SYNC:LAYOUT(usually inCONTRIBUTING.md): List packages and their descriptions from their respectivepackage.jsonfiles. - Scripts ->
SYNC:SCRIPTS(usually inCONTRIBUTING.md): Format scripts from the rootpackage.jsonas a bulleted list. - Commands ->
SYNC:COMMANDS(usually inREADME.md): Format CLI commands as markdown headings with bash examples. - Architecture ->
SYNC:ARCHITECTURE(usually inCONTRIBUTING.md): Review and update the Mermaid diagram if package relationships or key components have changed.
- Layout ->
-
Preserve Formatting: Ensure that you keep the markers themselves and only update the content between them. Use appropriate markdown blocks (code blocks, lists) that match the existing documentation style.
References
- See references/mapping.md for detailed mapping between metadata and doc sections.
Source
git clone https://github.com/yu-iskw/coding-agent-fabric/blob/main/.claude/skills/sync-readme/SKILL.mdView on GitHub Overview
sync-readme automates documentation alignment by reflecting the current codebase in README.md and CONTRIBUTING.md. It reads the monorepo layout (packages/ and packages/plugins/), root scripts from package.json, and CLI command definitions, then updates the corresponding sections to match reality.
How This Skill Works
It analyzes the project state by inspecting the layout, the root package.json scripts, and the CLI command definitions under packages/cli/src/commands/. It then locates the markers <!-- SYNC:LAYOUT -->, <!-- SYNC:SCRIPTS -->, <!-- SYNC:COMMANDS -->, and <!-- SYNC:ARCHITECTURE --> in README.md and CONTRIBUTING.md, and replaces only the content between those markers while preserving formatting and the markers themselves.
When to Use It
- After adding or renaming packages in the monorepo.
- After adding or modifying root scripts in package.json.
- After adding or changing CLI commands or subcommands.
- After significant architectural changes or package relationship updates.
- Before creating a PR or release to ensure docs match the current codebase.
Quick Start
- Step 1: Analyze Project State: Inspect packages/, packages/plugins/, and root package.json to gather current state.
- Step 2: Locate Sync Markers: Find the markers <!-- SYNC:LAYOUT -->, <!-- SYNC:SCRIPTS -->, <!-- SYNC:COMMANDS -->, <!-- SYNC:ARCHITECTURE --> in the docs.
- Step 3: Update Content: Replace the content between the markers with up-to-date information, preserving formatting and markers.
Best Practices
- Always locate and preserve the four markers and avoid touching surrounding text.
- Generate each section from the actual codebase data (layout, scripts, commands, architecture).
- Match the existing documentation style (markdown blocks, headings, and lists).
- Preview changes locally to verify formatting and readability.
- Include a quick diff or CI gate to catch drift when code changes.
Example Use Cases
- A new package is added under packages/foo; run sync-readme to update the LAYOUT section with foo's name and description.
- A root script is renamed in package.json; SCRIPTS section updates accordingly.
- A new CLI command is introduced in packages/cli/src/commands; COMMANDS section updates with the command and a sample usage.
- Major architecture refactor changes package relationships; ARCHITECTURE diagram refreshed.
- PR to fix docs; run sync-readme to align docs before merge.