doc-sync-tool
Original:🇨🇳 Chinese
Translated
7 scripts
Automatically sync Agents.md, claude.md and gemini.md files in the project to maintain content consistency. Supports automatic monitoring and manual triggering.
21installs
Added on
NPX Install
npx skill4agent add littleben/awesomeagentskills doc-sync-toolTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Doc Sync Tool
Feature Description
This tool is used to automatically sync AI Agent configuration documents in the project, ensuring that the content of the three files , and remains consistent.
Agents.mdclaude.mdgemini.mdCore Features
- Auto Discovery: Recursively scan all folders in the current directory to find these three documents
- Intelligent Sync: When any one of the documents is found, automatically create/update the other two
- File Monitoring: Real-time monitoring of file changes, automatically sync the latest content
- Manual Trigger: Supports manual execution of sync via command line
Usage Scenarios
- Share the same project configuration among multiple AI Agents
- Automatically keep work instructions consistent across different AIs
- Avoid the hassle of manually maintaining multiple identical documents
Usage Methods
Install Dependencies
bash
cd /Users/ben/Downloads/go\ to\ wild/auto-website-system/_skills/doc-sync-tool
pnpm installManual Sync (One-time Execution)
bash
# Execute in the project root directory
node /Users/ben/Downloads/go\ to\ wild/auto-website-system/_skills/doc-sync-tool/sync.js
# Or use npm script
pnpm run syncAuto Monitoring (Continuous Run)
bash
# Start the file monitoring service
node /Users/ben/Downloads/go\ to\ wild/auto-website-system/_skills/doc-sync-tool/watch.js
# Or use npm script
pnpm run watchRun in Background (Recommended)
bash
# Run in background using PM2
pm2 start /Users/ben/Downloads/go\ to\ wild/auto-website-system/_skills/doc-sync-tool/watch.js --name doc-sync
# Check status
pm2 status
# Stop service
pm2 stop doc-syncWorking Principle
- Scanning Phase: Recursively traverse the specified directory to find ,
Agents.md,claude.mdfilesgemini.md - Grouping Phase: Group these three files in the same folder into one group
- Sync Phase:
- If a group has only one file, copy its content to create the other two
- If a group has multiple files, select the most recently modified one as the source and sync to other files
- Monitoring Phase (watch mode): Continuously monitor file changes and trigger sync
Configuration Options
You can modify the following configurations in :
sync.jsjavascript
const CONFIG = {
targetFiles: ['Agents.md', 'claude.md', 'gemini.md'], // Target file list
scanPath: process.cwd(), // Scan path (current directory by default)
excludeDirs: ['node_modules', '.git', '.next', 'dist'] // Excluded directories
};Notes
- The tool will automatically skip directories such as ,
node_modules,.git,.nextdist - The original format and content of the files will be preserved during sync
- It is recommended to use in a Git repository for easy tracking of file changes
- The monitoring mode runs continuously, it is recommended to use PM2 to manage the process
Troubleshooting
Permission Issues
bash
chmod +x sync.js watch.jsNode.js Version Requirement
Node.js 14+ is required
Dependency Installation Failure
bash
rm -rf node_modules package-lock.json
pnpm install