Skip to content

Commit 385e3de

Browse files
committed
feat: save off possibly working script
1 parent ff4e84c commit 385e3de

5 files changed

Lines changed: 477 additions & 16 deletions

File tree

.claude/settings.local.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(npm install:*)",
5+
"Bash(npm test:*)"
6+
]
7+
}
8+
}

.prototools

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node = "22"
2+
npm = "11"

README.md

Lines changed: 72 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
# sync-agents
22

3-
This is a shell based repository utilizing npm for easy installation and management.
3+
One set of agent rules to rule them all. `sync-agents` keeps your AI coding agent configurations in a single `.agents/` directory and syncs them to agent-specific directories (`.claude/`, `.windsurf/`) via symlinks. This ensures all agents follow the same rules, skills, and workflows without duplicating files.
44

5-
One set of agent rules to rule them all. Sync agents are a set of rules that can be applied to any agent to make it more effective. They are designed to be flexible and adaptable, allowing you to customize them to fit your specific needs.
6-
7-
The goal is to utilize AGENTS.md pointing to .agents as a source of truth for agent rules, skills, worflflows, and best practices. By doing so, we can ensure that all agents are following the same guidelines and standards, which will lead to better performance and more consistent results.
8-
9-
Goal is to sync for .claude, .windsurf, and .codex via utilziing .agents directory as the root source.
5+
AGENTS.md serves as an auto-generated index of everything in `.agents/` and is symlinked to CLAUDE.md for Claude compatibility.
106

117
## Installation
128

13-
`npm install @brickhouse-tech/sync-agents` or
9+
```bash
10+
npm install @brickhouse-tech/sync-agents
11+
```
1412

15-
globally with `npm install -g @brickhouse-tech/sync-agents`
13+
or globally:
1614

17-
## Topology:
15+
```bash
16+
npm install -g @brickhouse-tech/sync-agents
17+
```
1818

19-
AGENTS.md will point to .agents directory, which will contain all the rules, skills, workflows, and best practices for the agents. The structure of the .agents directory will be as follows. The AGENTS.md file will explicitly index the rules, skills, workflows, and best practices for each agent, making it easy to find and apply the relevant information. This structure will allow for easy maintenance and updates to the agents, as all the information will be centralized in one location.
19+
## Topology
20+
21+
`.agents/` is the source of truth. It contains all rules, skills, workflows, and state for your agents:
2022

2123
```
2224
.agents/
@@ -32,21 +34,75 @@ AGENTS.md will point to .agents directory, which will contain all the rules, ski
3234
│ ├── workflow1.md
3335
│ ├── workflow2.md
3436
│ └── ...
35-
|── STATE.md
37+
── STATE.md
3638
```
3739

38-
Syncing is symlinks from .agents to .claude, and .windsurf. This allows for easy updates and maintenance of the agents, as any changes made to the .agents directory will automatically be reflected in the individual agent directories.
40+
Running `sync-agents sync` creates symlinks from `.agents/` subdirectories into `.claude/` and `.windsurf/`. Any changes to `.agents/` are automatically reflected in the target directories because they are symlinks, not copies.
3941

40-
For explcitness the AGENTS.md file will also be symlinked to CLAUDE.md.
42+
AGENTS.md is also symlinked to CLAUDE.md so that Claude reads the index natively.
4143

4244
## STATE.md
4345

44-
This file will contain the current state of the agents and any relevant information about their performance, issues, or updates. It will serve as a central location for tracking the progress and status of the agents, allowing for easy monitoring and management. The STATE.md file will be updated regularly to reflect any changes or developments in the agents, ensuring that all stakeholders have access to the most up-to-date information. This way the Agent can resume work easily after a failure or interruption, as it can refer to the STATE.md file to determine where it left off and what tasks still need to be completed.
46+
`.agents/STATE.md` tracks the current state of your project from the agent's perspective. It serves as a resumption point after failures or interruptions -- the agent can read STATE.md to determine where it left off and what tasks remain. Update it regularly to keep agents in sync with progress.
47+
48+
## Commands
49+
50+
| Command | Description |
51+
|---|---|
52+
| `init` | Initialize the `.agents/` directory structure with `rules/`, `skills/`, `workflows/`, `STATE.md`, and generate `AGENTS.md` |
53+
| `sync` | Create symlinks from `.agents/` into `.claude/` and `.windsurf/`, and symlink `AGENTS.md` to `CLAUDE.md` |
54+
| `status` | Show the current sync status of all targets and symlinks |
55+
| `add <type> <name>` | Add a new rule, skill, or workflow from a template (type is `rule`, `skill`, or `workflow`) |
56+
| `index` | Regenerate `AGENTS.md` by scanning the contents of `.agents/` |
57+
| `clean` | Remove all synced symlinks and empty target directories (does not remove `.agents/`) |
58+
59+
## Options
60+
61+
| Option | Description |
62+
|---|---|
63+
| `-h`, `--help` | Show help message |
64+
| `-v`, `--version` | Show version |
65+
| `-d`, `--dir <path>` | Set project root directory (default: current directory) |
66+
| `--targets <list>` | Comma-separated list of sync targets (default: `claude,windsurf`) |
67+
| `--dry-run` | Show what would be done without making changes |
68+
| `--force` | Overwrite existing files and symlinks |
4569

4670
## Usage
4771

4872
```bash
49-
sync-agents --help
50-
```
73+
# Initialize .agents/ structure in the current project
74+
sync-agents init
75+
76+
# Add a new rule
77+
sync-agents add rule no-eval
78+
79+
# Add a new skill
80+
sync-agents add skill debugging
81+
82+
# Add a new workflow
83+
sync-agents add workflow deploy
84+
85+
# Sync to all targets (.claude/ and .windsurf/)
86+
sync-agents sync
87+
88+
# Sync to a specific target only
89+
sync-agents sync --targets claude
5190

91+
# Preview sync without making changes
92+
sync-agents sync --dry-run
5293

94+
# Force overwrite existing symlinks
95+
sync-agents sync --force
96+
97+
# Check sync status
98+
sync-agents status
99+
100+
# Regenerate the AGENTS.md index
101+
sync-agents index
102+
103+
# Remove all synced symlinks
104+
sync-agents clean
105+
106+
# Work in a different directory
107+
sync-agents sync --dir /path/to/project
108+
```

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"sync-agents": "src/sh/sync-agents.sh"
2121
},
2222
"scripts": {
23+
"test": "npx bats test/"
2324
},
2425
"dependencies": {
2526
},

0 commit comments

Comments
 (0)