@sofatutor/agent-bridge 0.13.1 → 0.15.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/README.md +78 -186
- package/dist/index.mjs +871 -484
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,231 +1,123 @@
|
|
|
1
1
|
# Agent Bridge
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Sync AI agent skills, agents, prompts and instructions from a shared repo into your project's tool folders (`.github/`, `.cursor/`, `.claude/`, …).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
One source of truth. Every project. Every tool.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- **Convention over configuration** — features are discovered from the filesystem automatically. No manifests, no mapping files — just organize by domain and feature type.
|
|
10
|
-
- **Tool-agnostic, tool-aware** — syncs to all configured tools by default, while the `<tool>--` prefix convention lets you target features to specific tools (VS Code, Cursor, Claude Code, or custom tools) when needed.
|
|
11
|
-
- **Extensible** — not limited to skills, agents, prompts, or instructions. Any new feature type that tools introduce is automatically supported — just add a folder to your source.
|
|
12
|
-
- **Multiple sources** — pull from any combination of Git repositories (HTTPS/SSH) and local paths. Mix company-wide standards with team-specific or project-specific sources.
|
|
13
|
-
- **Multi-domain organization** — structure features by domain (`backend`, `frontend`, `shared`, or your own) so each project pulls only what it needs.
|
|
14
|
-
- **Non-destructive** — previously defined skills, agents, prompts, and other tool files are **never** touched, modified, or deleted.
|
|
15
|
-
|
|
16
|
-
## Prerequisites
|
|
17
|
-
|
|
18
|
-
- Git (optional — needed only for remote sources)
|
|
19
|
-
- Node.js ≥ 18
|
|
20
|
-
|
|
21
|
-
## Installation
|
|
7
|
+
## Quick start
|
|
22
8
|
|
|
23
9
|
```bash
|
|
24
|
-
|
|
10
|
+
npx @sofatutor/agent-bridge init
|
|
25
11
|
```
|
|
26
12
|
|
|
27
|
-
|
|
13
|
+
That's it. The wizard walks you through three questions:
|
|
28
14
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
15
|
+
1. **Tools** — VS Code, Cursor, Claude, Pi, or a custom folder.
|
|
16
|
+
2. **Sources** — a Git URL (or local path) that holds your shared skills, e.g. `https://github.com/sofatutor/ai-hub.git`.
|
|
17
|
+
3. **What to sync** — a tree of every domain in each source. Tick a domain to take all of it, or open it and tick single skills, agents or files.
|
|
18
|
+
|
|
19
|
+
It saves `.agent-bridge/config.yml`, offers to install git hooks, and syncs immediately.
|
|
32
20
|
|
|
33
|
-
|
|
21
|
+
Then commit the config:
|
|
34
22
|
|
|
35
23
|
```bash
|
|
36
|
-
|
|
24
|
+
git add .agent-bridge/config.yml && git commit -m "chore: add agent-bridge config"
|
|
37
25
|
```
|
|
38
26
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
### 1. Initialize
|
|
27
|
+
Pull the latest features any time:
|
|
42
28
|
|
|
43
29
|
```bash
|
|
44
|
-
agent-bridge
|
|
30
|
+
npx @sofatutor/agent-bridge sync
|
|
45
31
|
```
|
|
46
32
|
|
|
47
|
-
|
|
48
|
-
1. Ask which domains to use (e.g. `backend`, `frontend`, `shared`).
|
|
49
|
-
2. Ask which tools to configure — choose from well-known presets (VS Code, Cursor, Claude) or add custom tools.
|
|
50
|
-
3. Ask for sources — Git repos (HTTPS/SSH) or local paths, with optional branch.
|
|
51
|
-
4. Generate `.agent-bridge/config.yml`.
|
|
52
|
-
5. Clone any remote sources.
|
|
53
|
-
6. Create `.agent-bridge/.gitignore` (ignores cloned repos, keeps config).
|
|
54
|
-
7. Optionally install git hooks to auto-sync on checkout/merge.
|
|
55
|
-
|
|
56
|
-
#### Non-Interactive Mode
|
|
57
|
-
|
|
58
|
-
Pass `--tools` and `--source` to skip all prompts:
|
|
33
|
+
### Install for keeps
|
|
59
34
|
|
|
60
35
|
```bash
|
|
61
|
-
agent-bridge
|
|
62
|
-
|
|
63
|
-
--source https://github.com/org/repo.git#main
|
|
36
|
+
npm install -g @sofatutor/agent-bridge # global
|
|
37
|
+
npm install --save-dev @sofatutor/agent-bridge # per project
|
|
64
38
|
```
|
|
65
39
|
|
|
66
|
-
|
|
40
|
+
### Scripted setup (CI, postinstall)
|
|
67
41
|
|
|
68
42
|
```bash
|
|
69
43
|
agent-bridge init \
|
|
70
|
-
--
|
|
71
|
-
--
|
|
72
|
-
--
|
|
73
|
-
--source /local/path \
|
|
44
|
+
--tools cursor,vscode,claude \
|
|
45
|
+
--source https://github.com/sofatutor/ai-hub.git#main \
|
|
46
|
+
--domains sofatutor-shared,sofatutor-main \
|
|
74
47
|
--hooks
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
| Option | Description |
|
|
78
|
-
| ------------------- | ---------------------------------------------------------------------------------------- |
|
|
79
|
-
| `--tools <list>` | Comma-separated tool names (`cursor`, `vscode`, `claude`) or `name:folder` pairs |
|
|
80
|
-
| `-s, --source <url>`| Source URL or path (repeatable). Append `#branch` for a specific branch |
|
|
81
|
-
| `--domains <list>` | Comma-separated domain list (default: `backend,frontend,shared`) |
|
|
82
|
-
| `--hooks` | Auto-install git hooks without prompting |
|
|
83
|
-
|
|
84
|
-
After init, commit `.agent-bridge/config.yml` to your repo.
|
|
85
|
-
|
|
86
|
-
### 2. Sync
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
48
|
agent-bridge sync
|
|
90
49
|
```
|
|
91
50
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
Run this whenever:
|
|
95
|
-
- A source repository has new or changed features.
|
|
96
|
-
- You add, rename, or remove sources in `config.yml`.
|
|
97
|
-
- You change tool or domain configuration.
|
|
51
|
+
Omit `--domains` to take every domain in the source.
|
|
98
52
|
|
|
99
|
-
|
|
53
|
+
## What you get
|
|
100
54
|
|
|
101
|
-
```bash
|
|
102
|
-
agent-bridge update
|
|
103
55
|
```
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
### 4. Opt Out
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
agent-bridge opt-out
|
|
56
|
+
my-project/
|
|
57
|
+
├── .agent-bridge/config.yml ← the only file you commit
|
|
58
|
+
├── .github/skills/code-review/ ← synced (VS Code)
|
|
59
|
+
├── .cursor/skills/code-review/ ← synced (Cursor)
|
|
60
|
+
└── .claude/skills/code-review/ ← synced (Claude)
|
|
113
61
|
```
|
|
114
62
|
|
|
115
|
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
1. Check if `agent-bridge` is available globally
|
|
151
|
-
2. Fall back to `npx @sofatutor/agent-bridge` if not
|
|
152
|
-
3. Run update and sync silently in the background
|
|
153
|
-
|
|
154
|
-
### Skipping Existing Hooks
|
|
155
|
-
|
|
156
|
-
If you already have custom `post-checkout` or `post-merge` hooks, Agent Bridge will skip them to avoid conflicts. You can manually integrate Agent Bridge into your existing hooks by adding:
|
|
157
|
-
|
|
158
|
-
```sh
|
|
159
|
-
# At the end of your existing hook
|
|
160
|
-
(
|
|
161
|
-
sleep 1
|
|
162
|
-
agent-bridge update && agent-bridge sync
|
|
163
|
-
) >/dev/null 2>&1 &
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Removing Hooks
|
|
167
|
-
|
|
168
|
-
Agent Bridge marks its hooks with a special comment.
|
|
169
|
-
|
|
170
|
-
Recommended: run `agent-bridge opt-out` to remove Agent Bridge-managed hooks and state.
|
|
171
|
-
|
|
172
|
-
Manual alternative: delete the hook files:
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
rm .git/hooks/post-checkout .git/hooks/post-merge
|
|
63
|
+
- **Convention over configuration** — a source is just folders: `<domain>/<feature-type>/<feature>/`. No manifests.
|
|
64
|
+
- **Pick what you need** — whole domains, or individual skills, agents and files per domain.
|
|
65
|
+
- **Tool-aware** — `cursor--rules/` goes to Cursor only; everything else goes to every tool.
|
|
66
|
+
- **Non-destructive** — Agent Bridge only ever touches files it created. Your own skills are safe.
|
|
67
|
+
- **Stays fresh** — `sync` fetches sources and reconciles; git hooks can do it for you after checkout/merge.
|
|
68
|
+
|
|
69
|
+
## Commands
|
|
70
|
+
|
|
71
|
+
| Command | What it does |
|
|
72
|
+
| ----------------------- | -------------------------------------------------------------- |
|
|
73
|
+
| `agent-bridge init` | Interactive setup (or scripted with `--tools`/`--source`) |
|
|
74
|
+
| `agent-bridge sync` | Fetch sources and sync features into your tool folders |
|
|
75
|
+
| `agent-bridge opt-out` | Remove everything Agent Bridge created from this repo |
|
|
76
|
+
|
|
77
|
+
All commands accept `--cwd <path>`.
|
|
78
|
+
|
|
79
|
+
> `agent-bridge update` was merged into `sync` in 0.14. The old command still works and simply runs `sync`.
|
|
80
|
+
|
|
81
|
+
## Config at a glance
|
|
82
|
+
|
|
83
|
+
```yaml
|
|
84
|
+
tools:
|
|
85
|
+
- name: claude
|
|
86
|
+
folder: .claude
|
|
87
|
+
sources:
|
|
88
|
+
- name: ai-hub
|
|
89
|
+
source: https://github.com/sofatutor/ai-hub.git
|
|
90
|
+
branch: main
|
|
91
|
+
domains:
|
|
92
|
+
- name: sofatutor-shared # everything in this domain
|
|
93
|
+
- name: sofatutor-main # only these bits
|
|
94
|
+
include:
|
|
95
|
+
- skills/preview
|
|
96
|
+
- vscode--agents
|
|
97
|
+
- AGENTS.md
|
|
176
98
|
```
|
|
177
99
|
|
|
178
|
-
|
|
100
|
+
Full reference: [Configuration](docs/Configuration.md).
|
|
179
101
|
|
|
180
|
-
##
|
|
102
|
+
## Docs
|
|
181
103
|
|
|
182
|
-
|
|
|
183
|
-
|
|
|
184
|
-
|
|
|
185
|
-
|
|
|
186
|
-
|
|
|
187
|
-
|
|
|
104
|
+
| Page | Read it when… |
|
|
105
|
+
| ------------------------------------------- | ---------------------------------------------------- |
|
|
106
|
+
| [Configuration](docs/Configuration.md) | you want to edit `config.yml` by hand |
|
|
107
|
+
| [Conventions](docs/Conventions.md) | you're authoring a source repo (like `ai-hub`) |
|
|
108
|
+
| [CLI Reference](docs/CLI-Reference.md) | you need every flag, plus git hooks and opt-out |
|
|
109
|
+
| [Sync Strategy](docs/Sync-Strategy.md) | you wonder what sync touches and what it never does |
|
|
110
|
+
| [Upgrading](docs/Upgrading.md) | you're coming from 0.13 or earlier |
|
|
111
|
+
| [Troubleshooting](docs/Troubleshooting.md) | something's off |
|
|
188
112
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
| Option | Description |
|
|
192
|
-
| -------------- | ---------------------------------------------------------------------------------------- |
|
|
193
|
-
| `--cwd <path>` | Override the working directory. Defaults to the Git root, or `cwd` if not in a Git repo. |
|
|
194
|
-
|
|
195
|
-
Examples:
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
# Run sync for a specific project in a monorepo
|
|
199
|
-
agent-bridge sync --cwd ./packages/api
|
|
200
|
-
|
|
201
|
-
# Point at a project outside the current directory
|
|
202
|
-
agent-bridge sync --cwd /path/to/my-project
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
## Documentation
|
|
206
|
-
|
|
207
|
-
- [Configuration](docs/configuration.md) — config file reference, fields, source types
|
|
208
|
-
- [Conventions](docs/conventions.md) — source directory structure, tool-prefix routing, authoring features
|
|
209
|
-
- [Sync Strategy](docs/sync-strategy.md) — marker files, project structure after sync, cleanup behavior
|
|
210
|
-
|
|
211
|
-
## Troubleshooting
|
|
212
|
-
|
|
213
|
-
| Symptom | Fix |
|
|
214
|
-
| ---------------------------- | -------------------------------------------------------------------- |
|
|
215
|
-
| `config.yml not found` | Run `agent-bridge init` from the repo root |
|
|
216
|
-
| Source clone failed | Check the Git URL and your SSH/HTTPS credentials |
|
|
217
|
-
| Duplicate feature name error | Rename one of the conflicting features across sources |
|
|
218
|
-
| Local source path not found | Verify the path in `config.yml` is correct relative to the repo root |
|
|
219
|
-
| Path conflict error | A non-managed folder exists at the destination — rename or remove it |
|
|
220
|
-
| Git hooks not installed | Run `agent-bridge init` from inside a Git repository |
|
|
221
|
-
| Hooks skipped (existing) | Existing non-Agent-Bridge hooks are preserved; integrate manually |
|
|
222
|
-
| Remove Agent Bridge from repo| Run `agent-bridge opt-out` |
|
|
113
|
+
The same pages are published to the [GitHub wiki](https://github.com/sofatutor/agent-bridge/wiki).
|
|
223
114
|
|
|
224
115
|
## Development
|
|
225
116
|
|
|
226
117
|
```bash
|
|
227
118
|
npm install
|
|
228
|
-
npm run
|
|
229
|
-
npm
|
|
230
|
-
npm run test:watch # Watch mode
|
|
119
|
+
npm run check # typecheck + tests
|
|
120
|
+
npm run build # bundle the CLI into dist/
|
|
231
121
|
```
|
|
122
|
+
|
|
123
|
+
Requires Node ≥ 18 and Git (for remote sources).
|