@googlarz/agents-sync 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +366 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +237 -0
- package/dist/cli.js.map +1 -0
- package/dist/config/loader.d.ts +9 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +55 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/schema.d.ts +69 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +33 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/derivers/aider.d.ts +19 -0
- package/dist/derivers/aider.d.ts.map +1 -0
- package/dist/derivers/aider.js +117 -0
- package/dist/derivers/aider.js.map +1 -0
- package/dist/derivers/claude.d.ts +19 -0
- package/dist/derivers/claude.d.ts.map +1 -0
- package/dist/derivers/claude.js +41 -0
- package/dist/derivers/claude.js.map +1 -0
- package/dist/derivers/cline.d.ts +17 -0
- package/dist/derivers/cline.d.ts.map +1 -0
- package/dist/derivers/cline.js +92 -0
- package/dist/derivers/cline.js.map +1 -0
- package/dist/derivers/copilot.d.ts +16 -0
- package/dist/derivers/copilot.d.ts.map +1 -0
- package/dist/derivers/copilot.js +162 -0
- package/dist/derivers/copilot.js.map +1 -0
- package/dist/derivers/cursor.d.ts +16 -0
- package/dist/derivers/cursor.d.ts.map +1 -0
- package/dist/derivers/cursor.js +121 -0
- package/dist/derivers/cursor.js.map +1 -0
- package/dist/derivers/gemini.d.ts +19 -0
- package/dist/derivers/gemini.d.ts.map +1 -0
- package/dist/derivers/gemini.js +33 -0
- package/dist/derivers/gemini.js.map +1 -0
- package/dist/derivers/index.d.ts +33 -0
- package/dist/derivers/index.d.ts.map +1 -0
- package/dist/derivers/index.js +124 -0
- package/dist/derivers/index.js.map +1 -0
- package/dist/derivers/merger.d.ts +36 -0
- package/dist/derivers/merger.d.ts.map +1 -0
- package/dist/derivers/merger.js +83 -0
- package/dist/derivers/merger.js.map +1 -0
- package/dist/derivers/roo.d.ts +18 -0
- package/dist/derivers/roo.d.ts.map +1 -0
- package/dist/derivers/roo.js +92 -0
- package/dist/derivers/roo.js.map +1 -0
- package/dist/derivers/windsurf.d.ts +16 -0
- package/dist/derivers/windsurf.d.ts.map +1 -0
- package/dist/derivers/windsurf.js +91 -0
- package/dist/derivers/windsurf.js.map +1 -0
- package/dist/extractor/extractor.d.ts +4 -0
- package/dist/extractor/extractor.d.ts.map +1 -0
- package/dist/extractor/extractor.js +117 -0
- package/dist/extractor/extractor.js.map +1 -0
- package/dist/extractor/schema.d.ts +187 -0
- package/dist/extractor/schema.d.ts.map +1 -0
- package/dist/extractor/schema.js +44 -0
- package/dist/extractor/schema.js.map +1 -0
- package/dist/generator/agents-md.d.ts +3 -0
- package/dist/generator/agents-md.d.ts.map +1 -0
- package/dist/generator/agents-md.js +127 -0
- package/dist/generator/agents-md.js.map +1 -0
- package/dist/generator/validator.d.ts +7 -0
- package/dist/generator/validator.d.ts.map +1 -0
- package/dist/generator/validator.js +67 -0
- package/dist/generator/validator.js.map +1 -0
- package/dist/lib/claude-client.d.ts +11 -0
- package/dist/lib/claude-client.d.ts.map +1 -0
- package/dist/lib/claude-client.js +74 -0
- package/dist/lib/claude-client.js.map +1 -0
- package/dist/lib/errors.d.ts +10 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +27 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/file-utils.d.ts +7 -0
- package/dist/lib/file-utils.d.ts.map +1 -0
- package/dist/lib/file-utils.js +56 -0
- package/dist/lib/file-utils.js.map +1 -0
- package/dist/lib/token-estimate.d.ts +7 -0
- package/dist/lib/token-estimate.d.ts.map +1 -0
- package/dist/lib/token-estimate.js +15 -0
- package/dist/lib/token-estimate.js.map +1 -0
- package/dist/scanner/codegraph.d.ts +13 -0
- package/dist/scanner/codegraph.d.ts.map +1 -0
- package/dist/scanner/codegraph.js +65 -0
- package/dist/scanner/codegraph.js.map +1 -0
- package/dist/scanner/docs.d.ts +13 -0
- package/dist/scanner/docs.d.ts.map +1 -0
- package/dist/scanner/docs.js +63 -0
- package/dist/scanner/docs.js.map +1 -0
- package/dist/scanner/gotchas.d.ts +8 -0
- package/dist/scanner/gotchas.d.ts.map +1 -0
- package/dist/scanner/gotchas.js +107 -0
- package/dist/scanner/gotchas.js.map +1 -0
- package/dist/scanner/index.d.ts +21 -0
- package/dist/scanner/index.d.ts.map +1 -0
- package/dist/scanner/index.js +87 -0
- package/dist/scanner/index.js.map +1 -0
- package/dist/scanner/manifest.d.ts +13 -0
- package/dist/scanner/manifest.d.ts.map +1 -0
- package/dist/scanner/manifest.js +285 -0
- package/dist/scanner/manifest.js.map +1 -0
- package/dist/scanner/mcp.d.ts +12 -0
- package/dist/scanner/mcp.d.ts.map +1 -0
- package/dist/scanner/mcp.js +96 -0
- package/dist/scanner/mcp.js.map +1 -0
- package/dist/scanner/repomix.d.ts +11 -0
- package/dist/scanner/repomix.d.ts.map +1 -0
- package/dist/scanner/repomix.js +87 -0
- package/dist/scanner/repomix.js.map +1 -0
- package/dist/scanner/skills.d.ts +18 -0
- package/dist/scanner/skills.d.ts.map +1 -0
- package/dist/scanner/skills.js +100 -0
- package/dist/scanner/skills.js.map +1 -0
- package/dist/scanner/source.d.ts +13 -0
- package/dist/scanner/source.d.ts.map +1 -0
- package/dist/scanner/source.js +157 -0
- package/dist/scanner/source.js.map +1 -0
- package/dist/scanner/structure.d.ts +10 -0
- package/dist/scanner/structure.d.ts.map +1 -0
- package/dist/scanner/structure.js +168 -0
- package/dist/scanner/structure.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +212 -0
- package/dist/server.js.map +1 -0
- package/dist/snapshot/drift.d.ts +22 -0
- package/dist/snapshot/drift.d.ts.map +1 -0
- package/dist/snapshot/drift.js +105 -0
- package/dist/snapshot/drift.js.map +1 -0
- package/dist/snapshot/schema.d.ts +94 -0
- package/dist/snapshot/schema.d.ts.map +1 -0
- package/dist/snapshot/schema.js +24 -0
- package/dist/snapshot/schema.js.map +1 -0
- package/dist/snapshot/writer.d.ts +17 -0
- package/dist/snapshot/writer.d.ts.map +1 -0
- package/dist/snapshot/writer.js +44 -0
- package/dist/snapshot/writer.js.map +1 -0
- package/dist/tools/drift.d.ts +15 -0
- package/dist/tools/drift.d.ts.map +1 -0
- package/dist/tools/drift.js +31 -0
- package/dist/tools/drift.js.map +1 -0
- package/dist/tools/export.d.ts +14 -0
- package/dist/tools/export.d.ts.map +1 -0
- package/dist/tools/export.js +53 -0
- package/dist/tools/export.js.map +1 -0
- package/dist/tools/init.d.ts +28 -0
- package/dist/tools/init.d.ts.map +1 -0
- package/dist/tools/init.js +103 -0
- package/dist/tools/init.js.map +1 -0
- package/dist/tools/install-hook.d.ts +15 -0
- package/dist/tools/install-hook.d.ts.map +1 -0
- package/dist/tools/install-hook.js +169 -0
- package/dist/tools/install-hook.js.map +1 -0
- package/dist/tools/lint.d.ts +24 -0
- package/dist/tools/lint.d.ts.map +1 -0
- package/dist/tools/lint.js +213 -0
- package/dist/tools/lint.js.map +1 -0
- package/dist/tools/scan-report.d.ts +14 -0
- package/dist/tools/scan-report.d.ts.map +1 -0
- package/dist/tools/scan-report.js +136 -0
- package/dist/tools/scan-report.js.map +1 -0
- package/dist/tools/status.d.ts +18 -0
- package/dist/tools/status.d.ts.map +1 -0
- package/dist/tools/status.js +38 -0
- package/dist/tools/status.js.map +1 -0
- package/dist/tools/sync.d.ts +22 -0
- package/dist/tools/sync.d.ts.map +1 -0
- package/dist/tools/sync.js +123 -0
- package/dist/tools/sync.js.map +1 -0
- package/dist/tools/validate.d.ts +22 -0
- package/dist/tools/validate.d.ts.map +1 -0
- package/dist/tools/validate.js +97 -0
- package/dist/tools/validate.js.map +1 -0
- package/docs/examples/.clinerules +29 -0
- package/docs/examples/.cursorrules +19 -0
- package/docs/examples/.windsurfrules +14 -0
- package/docs/examples/AGENTS.md +97 -0
- package/docs/examples/CLAUDE.md +88 -0
- package/docs/examples/GEMINI.md +61 -0
- package/docs/examples/copilot-instructions.md +24 -0
- package/docs/github-action.yml +89 -0
- package/package.json +63 -0
- package/scripts/demo.sh +138 -0
- package/skill/SKILL.md +158 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 googlarz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
# agents-sync
|
|
2
|
+
|
|
3
|
+
**Write your AI context once. Stay in sync everywhere.**
|
|
4
|
+
|
|
5
|
+
`agents-sync` reads your codebase, generates a canonical `AGENTS.md`, and automatically derives tool-specific files for every AI coding tool you use — Claude Code, Cursor, GitHub Copilot, and more.
|
|
6
|
+
|
|
7
|
+
One source of truth. No more manually maintaining five config files that are always out of sync.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## The Problem
|
|
12
|
+
|
|
13
|
+
Every AI coding tool expects its own context file:
|
|
14
|
+
|
|
15
|
+
| Tool | File |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Claude Code | `CLAUDE.md` |
|
|
18
|
+
| Cursor | `.cursorrules` |
|
|
19
|
+
| GitHub Copilot | `.github/copilot-instructions.md` |
|
|
20
|
+
| Codex / Amp | `AGENTS.md` |
|
|
21
|
+
| Gemini CLI | `GEMINI.md` |
|
|
22
|
+
| Windsurf | `.windsurfrules` |
|
|
23
|
+
| Cline | `.clinerules` |
|
|
24
|
+
|
|
25
|
+
If you use more than one tool — and most teams do — you're maintaining these manually. They drift. Conventions you updated in `CLAUDE.md` are still wrong in `.cursorrules`. Your new database is still Postgres in Copilot's mind. A new engineer using Cursor gets guidance that contradicts what Claude Code users know.
|
|
26
|
+
|
|
27
|
+
This is [GitHub issue #6235](https://github.com/anthropics/claude-code/issues/6235) — **AGENTS.md portability**, **3,914 upvotes**, the most demanded feature in the Claude Code repo. `agents-sync` solves it.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## How It Works
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
Your codebase
|
|
35
|
+
│
|
|
36
|
+
▼
|
|
37
|
+
[scan] manifests · directory tree · source samples · README · FIXME/HACK comments
|
|
38
|
+
│
|
|
39
|
+
▼
|
|
40
|
+
[extract] Claude API → structured project metadata (stack, conventions, gotchas, boundaries)
|
|
41
|
+
│
|
|
42
|
+
▼
|
|
43
|
+
[generate] canonical AGENTS.md ←─── one source of truth
|
|
44
|
+
│
|
|
45
|
+
├──▶ CLAUDE.md (superset + Claude Code-specific additions)
|
|
46
|
+
├──▶ .cursorrules (directive-style, < 400 words)
|
|
47
|
+
├──▶ .github/copilot-instructions.md (code-level focus, < 300 words)
|
|
48
|
+
├──▶ GEMINI.md (full AGENTS.md + Gemini CLI section)
|
|
49
|
+
├──▶ .windsurfrules (directive-style, < 400 words)
|
|
50
|
+
└──▶ .clinerules (Always/Never sections, < 400 words)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Install
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# No global install needed — use npx
|
|
59
|
+
npx @googlarz/agents-sync --help
|
|
60
|
+
|
|
61
|
+
# Or install globally
|
|
62
|
+
npm install -g @googlarz/agents-sync
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Setup
|
|
68
|
+
|
|
69
|
+
### Claude Code
|
|
70
|
+
|
|
71
|
+
Add to `~/.claude/claude_desktop_config.json` or your project's `.claude/settings.json`:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"mcpServers": {
|
|
76
|
+
"agents-sync": {
|
|
77
|
+
"command": "npx",
|
|
78
|
+
"args": ["@googlarz/agents-sync"],
|
|
79
|
+
"env": {
|
|
80
|
+
"ANTHROPIC_API_KEY": "sk-ant-..."
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Restart Claude Code. Then use the `/agents-sync` skill.
|
|
88
|
+
|
|
89
|
+
### Cursor
|
|
90
|
+
|
|
91
|
+
Add to `.cursor/mcp.json` in your project:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"mcpServers": {
|
|
96
|
+
"agents-sync": {
|
|
97
|
+
"command": "npx",
|
|
98
|
+
"args": ["@googlarz/agents-sync"],
|
|
99
|
+
"env": {
|
|
100
|
+
"ANTHROPIC_API_KEY": "sk-ant-..."
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Usage
|
|
110
|
+
|
|
111
|
+
### First run
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
/agents-sync init
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
✓ AGENTS.md → /your/project/AGENTS.md
|
|
119
|
+
✓ AGENTS.md → /your/project/AGENTS.md
|
|
120
|
+
✓ claude → /your/project/CLAUDE.md
|
|
121
|
+
✓ cursor → /your/project/.cursorrules
|
|
122
|
+
✓ copilot → /your/project/.github/copilot-instructions.md
|
|
123
|
+
✓ gemini → /your/project/GEMINI.md
|
|
124
|
+
✓ windsurf → /your/project/.windsurfrules
|
|
125
|
+
✓ cline → /your/project/.clinerules
|
|
126
|
+
|
|
127
|
+
✓ Snapshot saved to .agents-sync/
|
|
128
|
+
→ Add AGENTS.md to git. Add .agents-sync/ to .gitignore.
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Check for drift
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
/agents-sync drift
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
agents-sync drift report (2026-05-20)
|
|
139
|
+
Last sync: 12 days ago
|
|
140
|
+
|
|
141
|
+
HIGH New dependency detected: drizzle-orm
|
|
142
|
+
(package.json changed — possible architecture shift)
|
|
143
|
+
HIGH New top-level directory: src/workers/
|
|
144
|
+
|
|
145
|
+
MED 3 new files with new naming pattern
|
|
146
|
+
|
|
147
|
+
Recommendation: Re-sync recommended. Run /agents-sync sync.
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Re-sync
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
/agents-sync sync
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
✓ claude → /your/project/CLAUDE.md
|
|
158
|
+
✓ cursor → /your/project/.cursorrules
|
|
159
|
+
✓ copilot → /your/project/.github/copilot-instructions.md
|
|
160
|
+
|
|
161
|
+
2 custom section(s) preserved
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Validate files are in sync
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
/agents-sync validate
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
AGENTS.md (canonical) ✓
|
|
172
|
+
|
|
173
|
+
✓ claude in sync /your/project/CLAUDE.md
|
|
174
|
+
⚠ cursor DRIFTED /your/project/.cursorrules
|
|
175
|
+
File was modified after last sync
|
|
176
|
+
✓ copilot in sync /your/project/.github/copilot-instructions.md
|
|
177
|
+
|
|
178
|
+
Some files are out of sync. Run /agents-sync sync to fix.
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Standalone CLI
|
|
182
|
+
|
|
183
|
+
agents-sync also works as a standalone CLI without an MCP host:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Initialize a project
|
|
187
|
+
npx @googlarz/agents-sync init .
|
|
188
|
+
|
|
189
|
+
# Check drift
|
|
190
|
+
npx @googlarz/agents-sync drift .
|
|
191
|
+
|
|
192
|
+
# Re-sync
|
|
193
|
+
npx @googlarz/agents-sync sync .
|
|
194
|
+
|
|
195
|
+
# Validate all files
|
|
196
|
+
npx @googlarz/agents-sync validate .
|
|
197
|
+
|
|
198
|
+
# Re-derive a single tool file (no Claude API call)
|
|
199
|
+
npx @googlarz/agents-sync export cursor .
|
|
200
|
+
|
|
201
|
+
# CI mode — exit 1 when drift is HIGH
|
|
202
|
+
npx @googlarz/agents-sync drift . --ci
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## GitHub Action
|
|
208
|
+
|
|
209
|
+
Keep context files in sync automatically. Copy [`docs/github-action.yml`](docs/github-action.yml) to `.github/workflows/agents-sync.yml` in your repo, then add `ANTHROPIC_API_KEY` to repository secrets.
|
|
210
|
+
|
|
211
|
+
The workflow:
|
|
212
|
+
- Runs every Monday at 9am UTC
|
|
213
|
+
- Triggers on `package.json` / `pyproject.toml` / `Cargo.toml` / `go.mod` changes
|
|
214
|
+
- Checks drift; when drift is HIGH, re-syncs and opens a PR
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Sample Output
|
|
219
|
+
|
|
220
|
+
### Generated AGENTS.md (abbreviated)
|
|
221
|
+
|
|
222
|
+
```markdown
|
|
223
|
+
# AGENTS.md
|
|
224
|
+
|
|
225
|
+
<!-- Generated by agents-sync v1.0.0 on 2026-05-20 -->
|
|
226
|
+
|
|
227
|
+
## Project Overview
|
|
228
|
+
Acme Dashboard is an internal analytics tool for the sales team, built with
|
|
229
|
+
Next.js 14 App Router, PostgreSQL via Prisma, and NextAuth.
|
|
230
|
+
|
|
231
|
+
## Tech Stack
|
|
232
|
+
- TypeScript / Next.js 14 (App Router)
|
|
233
|
+
- PostgreSQL via Prisma ORM
|
|
234
|
+
- Authentication: NextAuth v4
|
|
235
|
+
- Testing: Vitest (co-located)
|
|
236
|
+
- Deploy: Vercel
|
|
237
|
+
|
|
238
|
+
## Architecture
|
|
239
|
+
- `src/app/` — Next.js pages and layouts (App Router)
|
|
240
|
+
- `src/features/` — feature modules (dashboard, users, reports)
|
|
241
|
+
- `src/lib/` — shared utilities: db singleton, auth config, api client
|
|
242
|
+
- `src/components/` — shared UI components
|
|
243
|
+
|
|
244
|
+
## Conventions
|
|
245
|
+
1. kebab-case filenames throughout
|
|
246
|
+
2. Named exports only — no default exports except Next.js page/layout components
|
|
247
|
+
3. All external input validated with Zod before use
|
|
248
|
+
4. Co-locate tests: `Button.test.tsx` next to `Button.tsx`
|
|
249
|
+
|
|
250
|
+
## Gotchas
|
|
251
|
+
1. Never import `PrismaClient` directly — use `lib/db.ts` singleton. Direct imports
|
|
252
|
+
cause connection pool exhaustion in Vercel's serverless runtime.
|
|
253
|
+
2. All API routes require auth middleware. Check `middleware.ts` before adding routes.
|
|
254
|
+
|
|
255
|
+
## Boundaries
|
|
256
|
+
|
|
257
|
+
### Never
|
|
258
|
+
- Commit `.env` or `.env.local`
|
|
259
|
+
- Instantiate `PrismaClient` outside of `lib/db.ts`
|
|
260
|
+
- Use `any` type — use `unknown` and narrow
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Derived `.cursorrules` (abbreviated)
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
# .cursorrules — managed by agents-sync
|
|
267
|
+
# Language: TypeScript / Next.js 14
|
|
268
|
+
|
|
269
|
+
- Always: use kebab-case filenames
|
|
270
|
+
- Always: named exports only (no default exports except page/layout components)
|
|
271
|
+
- Always: validate external input with Zod
|
|
272
|
+
- Always: co-locate tests (*.test.ts next to source)
|
|
273
|
+
- Never: import PrismaClient directly (use lib/db.ts — pool exhaustion risk)
|
|
274
|
+
- Never: add API routes without auth middleware (check middleware.ts)
|
|
275
|
+
- Never: commit .env or .env.local
|
|
276
|
+
- Never: use `any` type
|
|
277
|
+
- Tests: `npm test`
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Custom Sections
|
|
283
|
+
|
|
284
|
+
Add permanent, sync-safe customizations to any managed file:
|
|
285
|
+
|
|
286
|
+
```markdown
|
|
287
|
+
<!-- AGENTS-SYNC:CUSTOM:START -->
|
|
288
|
+
When working on the payments module, check with @alice before shipping.
|
|
289
|
+
Use staging Stripe keys (in .env.staging) for all local testing.
|
|
290
|
+
<!-- AGENTS-SYNC:CUSTOM:END -->
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
These blocks survive every `/agents-sync sync`. Edit them freely.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Environment Variables
|
|
298
|
+
|
|
299
|
+
| Variable | Required | Description |
|
|
300
|
+
|---|---|---|
|
|
301
|
+
| `ANTHROPIC_API_KEY` | Yes (for init/sync) | Your Anthropic API key |
|
|
302
|
+
| `AGENTS_SYNC_DEBUG=1` | No | Verbose debug output to stderr |
|
|
303
|
+
| `NO_COLOR=1` | No | Disable ANSI color in output |
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## MCP Tools Reference
|
|
308
|
+
|
|
309
|
+
agents-sync exposes 6 MCP tools directly:
|
|
310
|
+
|
|
311
|
+
| Tool | Description |
|
|
312
|
+
|---|---|
|
|
313
|
+
| `agents_sync_init` | Full init: scan, extract, generate, derive, snapshot |
|
|
314
|
+
| `agents_sync_sync` | Re-sync from current codebase state |
|
|
315
|
+
| `agents_sync_drift` | Check what changed since last sync (read-only) |
|
|
316
|
+
| `agents_sync_export` | Re-derive a single tool file |
|
|
317
|
+
| `agents_sync_validate` | Check if all tool files match AGENTS.md |
|
|
318
|
+
| `agents_sync_status` | Show sync status and managed files |
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## Supported Stacks
|
|
323
|
+
|
|
324
|
+
Tested on:
|
|
325
|
+
|
|
326
|
+
- **TypeScript/JavaScript**: Next.js, Express, Fastify, Remix, SvelteKit
|
|
327
|
+
- **Python**: Django, FastAPI, Flask
|
|
328
|
+
- **Rust**: Cargo workspaces, Axum, Actix
|
|
329
|
+
- **Go**: standard modules, Gin, Echo
|
|
330
|
+
- **PHP**: Composer projects, Laravel
|
|
331
|
+
|
|
332
|
+
Language-agnostic analysis — works on any codebase with a manifest file.
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## How Is This Different From [agents-sync on npm]?
|
|
337
|
+
|
|
338
|
+
The existing `agents-sync` package (v0.2.0) is a file watcher that mirrors format changes between static files. It has no AI component.
|
|
339
|
+
|
|
340
|
+
This package **reads and understands your codebase using Claude**, then generates content from scratch — conventions, gotchas, architecture descriptions — specific to your project. It's not a format converter. It's an analyst.
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
## Contributing
|
|
345
|
+
|
|
346
|
+
Issues and PRs welcome. The codebase is straightforward TypeScript:
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
git clone https://github.com/googlarz/agents-sync
|
|
350
|
+
cd agents-sync
|
|
351
|
+
npm install
|
|
352
|
+
npm run dev # watch mode
|
|
353
|
+
npm test # unit tests
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
Integration tests require `ANTHROPIC_API_KEY` and run against real fixtures:
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
npm run test:integration
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## License
|
|
365
|
+
|
|
366
|
+
MIT
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* agents-sync CLI
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* npx @googlarz/agents-sync Start MCP server (default)
|
|
7
|
+
* npx @googlarz/agents-sync init [path] Generate all context files
|
|
8
|
+
* npx @googlarz/agents-sync sync [path] Re-sync after codebase changes
|
|
9
|
+
* npx @googlarz/agents-sync drift [path] Check what changed
|
|
10
|
+
* npx @googlarz/agents-sync validate [path] Check files are in sync
|
|
11
|
+
* npx @googlarz/agents-sync status [path] Show sync status
|
|
12
|
+
* npx @googlarz/agents-sync export <tool> [path] Re-derive a single file
|
|
13
|
+
*/
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
15
|
+
import path from "node:path";
|
|
16
|
+
import fs from "node:fs";
|
|
17
|
+
import process from "node:process";
|
|
18
|
+
import { isAgentsSyncError } from "./lib/errors.js";
|
|
19
|
+
const args = process.argv.slice(2);
|
|
20
|
+
const cwd = process.cwd();
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
// Flags
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
function hasFlag(...flags) {
|
|
25
|
+
return flags.some((f) => args.includes(f));
|
|
26
|
+
}
|
|
27
|
+
function removeFlags(argv) {
|
|
28
|
+
return argv.filter((a) => !a.startsWith("--") && !a.startsWith("-"));
|
|
29
|
+
}
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// --version / --help
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
if (hasFlag("--version", "-v")) {
|
|
34
|
+
const pkgPath = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "package.json");
|
|
35
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
36
|
+
process.stdout.write(`@googlarz/agents-sync v${pkg.version}\n`);
|
|
37
|
+
process.exit(0);
|
|
38
|
+
}
|
|
39
|
+
if (hasFlag("--help", "-h")) {
|
|
40
|
+
process.stdout.write(`
|
|
41
|
+
agents-sync — AI context file generator and syncer
|
|
42
|
+
|
|
43
|
+
USAGE
|
|
44
|
+
agents-sync [command] [path] [options]
|
|
45
|
+
|
|
46
|
+
COMMANDS
|
|
47
|
+
init [path] Analyze codebase, generate all context files
|
|
48
|
+
sync [path] Re-sync after codebase changes
|
|
49
|
+
drift [path] Check what changed since last sync
|
|
50
|
+
validate [path] Check if all files match AGENTS.md
|
|
51
|
+
status [path] Show sync status and managed files
|
|
52
|
+
export <tool> [path] Re-derive a single tool file (no API call)
|
|
53
|
+
Tools: claude, cursor, copilot, gemini, windsurf, cline
|
|
54
|
+
|
|
55
|
+
(no command) Start MCP server (stdio transport)
|
|
56
|
+
|
|
57
|
+
OPTIONS
|
|
58
|
+
--dry-run Preview changes without writing files
|
|
59
|
+
--fast sync only — skip API call if drift is minor
|
|
60
|
+
--ci drift only — exit 1 when drift is HIGH (for CI)
|
|
61
|
+
--tools <list> Comma-separated tools to generate (init/sync)
|
|
62
|
+
e.g. --tools claude,cursor,copilot
|
|
63
|
+
--repomix-output <file> Use repomix XML/text output as source corpus
|
|
64
|
+
(init/sync) instead of filesystem sampling
|
|
65
|
+
--version, -v Print version
|
|
66
|
+
--help, -h Show this help
|
|
67
|
+
|
|
68
|
+
EXAMPLES
|
|
69
|
+
npx @googlarz/agents-sync init .
|
|
70
|
+
npx @googlarz/agents-sync sync . --fast
|
|
71
|
+
npx @googlarz/agents-sync drift . --ci
|
|
72
|
+
npx @googlarz/agents-sync export cursor .
|
|
73
|
+
|
|
74
|
+
SETUP (MCP — Claude Code)
|
|
75
|
+
Add to ~/.claude/claude_desktop_config.json or .claude/settings.json:
|
|
76
|
+
|
|
77
|
+
{
|
|
78
|
+
"mcpServers": {
|
|
79
|
+
"agents-sync": {
|
|
80
|
+
"command": "npx",
|
|
81
|
+
"args": ["@googlarz/agents-sync"],
|
|
82
|
+
"env": { "ANTHROPIC_API_KEY": "sk-ant-..." }
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
ENVIRONMENT
|
|
88
|
+
ANTHROPIC_API_KEY Required for init and sync
|
|
89
|
+
AGENTS_SYNC_DEBUG=1 Verbose debug output to stderr
|
|
90
|
+
NO_COLOR=1 Disable ANSI color
|
|
91
|
+
|
|
92
|
+
`);
|
|
93
|
+
process.exit(0);
|
|
94
|
+
}
|
|
95
|
+
// ---------------------------------------------------------------------------
|
|
96
|
+
// CLI subcommand dispatch
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
const positional = removeFlags(args);
|
|
99
|
+
const subcommand = positional[0];
|
|
100
|
+
const dryRun = hasFlag("--dry-run");
|
|
101
|
+
const fast = hasFlag("--fast");
|
|
102
|
+
const ci = hasFlag("--ci");
|
|
103
|
+
function resolvePath(pos) {
|
|
104
|
+
return pos ? path.resolve(pos) : cwd;
|
|
105
|
+
}
|
|
106
|
+
function getTools() {
|
|
107
|
+
const idx = args.indexOf("--tools");
|
|
108
|
+
if (idx === -1)
|
|
109
|
+
return undefined;
|
|
110
|
+
const val = args[idx + 1];
|
|
111
|
+
return val ? val.split(",").map((t) => t.trim()) : undefined;
|
|
112
|
+
}
|
|
113
|
+
function getFlag(name) {
|
|
114
|
+
const idx = args.indexOf(name);
|
|
115
|
+
if (idx === -1)
|
|
116
|
+
return undefined;
|
|
117
|
+
return args[idx + 1];
|
|
118
|
+
}
|
|
119
|
+
function die(msg) {
|
|
120
|
+
process.stderr.write(`agents-sync error: ${msg}\n`);
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
function printResult(data) {
|
|
124
|
+
process.stdout.write(JSON.stringify(data, null, 2) + "\n");
|
|
125
|
+
}
|
|
126
|
+
async function runCli() {
|
|
127
|
+
switch (subcommand) {
|
|
128
|
+
case "init": {
|
|
129
|
+
const { runInit } = await import("./tools/init.js");
|
|
130
|
+
const projectPath = resolvePath(positional[1]);
|
|
131
|
+
const tools = getTools();
|
|
132
|
+
const repomixOutput = getFlag("--repomix-output");
|
|
133
|
+
const result = await runInit({ projectPath, tools, dryRun, repomixOutput });
|
|
134
|
+
if (result.dryRun) {
|
|
135
|
+
process.stdout.write(`Dry run — no files written.\n`);
|
|
136
|
+
process.stdout.write(`Would generate:\n`);
|
|
137
|
+
process.stdout.write(` AGENTS.md\n`);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
process.stdout.write(`✓ AGENTS.md → ${result.agentsMdPath}\n`);
|
|
141
|
+
for (const f of result.filesWritten) {
|
|
142
|
+
process.stdout.write(`✓ ${f.tool} → ${f.path}\n`);
|
|
143
|
+
}
|
|
144
|
+
if (result.preservedExistingFiles.length > 0) {
|
|
145
|
+
process.stdout.write(`\n⚠ Preserved pre-existing files as custom sections:\n`);
|
|
146
|
+
for (const f of result.preservedExistingFiles) {
|
|
147
|
+
process.stdout.write(` ${f}\n`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
for (const w of result.warnings) {
|
|
152
|
+
process.stdout.write(` → ${w}\n`);
|
|
153
|
+
}
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
case "sync": {
|
|
157
|
+
const { runSync } = await import("./tools/sync.js");
|
|
158
|
+
const projectPath = resolvePath(positional[1]);
|
|
159
|
+
const tools = getTools();
|
|
160
|
+
const repomixOutput = getFlag("--repomix-output");
|
|
161
|
+
const result = await runSync({ projectPath, tools, fast, dryRun, repomixOutput });
|
|
162
|
+
for (const f of result.filesUpdated) {
|
|
163
|
+
process.stdout.write(`✓ ${f.tool} → ${f.path}\n`);
|
|
164
|
+
}
|
|
165
|
+
for (const w of result.warnings) {
|
|
166
|
+
process.stdout.write(` → ${w}\n`);
|
|
167
|
+
}
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
case "drift": {
|
|
171
|
+
const { runDrift } = await import("./tools/drift.js");
|
|
172
|
+
const projectPath = resolvePath(positional[1]);
|
|
173
|
+
const result = await runDrift({ projectPath });
|
|
174
|
+
process.stdout.write(result.report + "\n");
|
|
175
|
+
if (ci && result.highDrift) {
|
|
176
|
+
process.exit(1);
|
|
177
|
+
}
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
case "validate": {
|
|
181
|
+
const { runValidate } = await import("./tools/validate.js");
|
|
182
|
+
const projectPath = resolvePath(positional[1]);
|
|
183
|
+
const result = await runValidate({ projectPath });
|
|
184
|
+
process.stdout.write(result.report + "\n");
|
|
185
|
+
if (!result.allInSync)
|
|
186
|
+
process.exit(1);
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
case "status": {
|
|
190
|
+
const { runStatus } = await import("./tools/status.js");
|
|
191
|
+
const projectPath = resolvePath(positional[1]);
|
|
192
|
+
const result = await runStatus({ projectPath });
|
|
193
|
+
printResult(result);
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
case "export": {
|
|
197
|
+
const { runExport } = await import("./tools/export.js");
|
|
198
|
+
const tool = positional[1];
|
|
199
|
+
const projectPath = resolvePath(positional[2]);
|
|
200
|
+
if (!tool)
|
|
201
|
+
die("export requires a tool name: claude, cursor, copilot, gemini, windsurf, cline");
|
|
202
|
+
const result = await runExport({ projectPath, tool: tool });
|
|
203
|
+
process.stdout.write(result.report + "\n");
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
case undefined:
|
|
207
|
+
case "--mcp": {
|
|
208
|
+
// Default: start MCP server
|
|
209
|
+
await import("./server.js");
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
default:
|
|
213
|
+
die(`unknown command: ${subcommand}. Run --help for usage.`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
runCli().catch((err) => {
|
|
217
|
+
if (isAgentsSyncError(err) && err.code === "MISSING_API_KEY") {
|
|
218
|
+
process.stderr.write([
|
|
219
|
+
"",
|
|
220
|
+
" agents-sync: ANTHROPIC_API_KEY not set",
|
|
221
|
+
"",
|
|
222
|
+
" The init and sync commands call Claude to analyze your codebase.",
|
|
223
|
+
" These commands do NOT need an API key:",
|
|
224
|
+
" agents-sync drift agents-sync validate",
|
|
225
|
+
" agents-sync status agents-sync export",
|
|
226
|
+
"",
|
|
227
|
+
" Get a key at: https://console.anthropic.com/",
|
|
228
|
+
" Then set it: export ANTHROPIC_API_KEY=sk-ant-...",
|
|
229
|
+
"",
|
|
230
|
+
].join("\n"));
|
|
231
|
+
process.exit(1);
|
|
232
|
+
}
|
|
233
|
+
const msg = isAgentsSyncError(err) ? err.format() : err instanceof Error ? err.message : String(err);
|
|
234
|
+
process.stderr.write(`agents-sync error: ${msg}\n`);
|
|
235
|
+
process.exit(1);
|
|
236
|
+
});
|
|
237
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;A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ACF,gDAAgD;YAChD,qDAAqD;YACrD,EAAE;SACH,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACrG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type AgentsSyncConfig } from "./schema.js";
|
|
2
|
+
import type { ProjectMetadata } from "../extractor/schema.js";
|
|
3
|
+
export declare function loadConfig(projectPath: string): Promise<AgentsSyncConfig | null>;
|
|
4
|
+
/**
|
|
5
|
+
* Merge config-defined conventions and boundaries into extracted metadata.
|
|
6
|
+
* Config items are appended after Claude-extracted ones so they survive re-sync.
|
|
7
|
+
*/
|
|
8
|
+
export declare function applyConfig(metadata: ProjectMetadata, config: AgentsSyncConfig | null): ProjectMetadata;
|
|
9
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAGA,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,wBAAsB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CA0BtF;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAE,gBAAgB,GAAG,IAAI,GAAG,eAAe,CAevG"}
|