@dujavi/ai-md 0.4.0 → 0.6.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 +54 -42
- package/bin/ai-md.js +497 -249
- package/docs/architecture.html +316 -0
- package/docs/architecture.png +0 -0
- package/lib/build.js +268 -0
- package/lib/commands.js +292 -99
- package/lib/config-paths.js +73 -0
- package/lib/config.js +85 -57
- package/lib/harnesses/index.js +309 -0
- package/lib/link.js +224 -0
- package/lib/rescue.js +95 -0
- package/lib/scripts.js +104 -0
- package/lib/skeleton.js +117 -0
- package/lib/status.js +110 -35
- package/package.json +11 -7
- package/scripts/sync-config.sh +2 -2
- package/skeleton/README.md +3 -0
- package/skeleton/agents/agents/skills/.gitkeep +0 -0
- package/skeleton/agents/claude/rules/.gitkeep +0 -0
- package/skeleton/agents/claude/skills/.gitkeep +0 -0
- package/skeleton/agents/cursor/skills/.gitkeep +0 -0
- package/skeleton/agents/gemini/skills/.gitkeep +0 -0
- package/skeleton/agents/opencode/skills/.gitkeep +0 -0
- package/skeleton/projects/.gitkeep +0 -0
- package/skeleton/scripts/.gitkeep +0 -0
- package/skeleton/shared/rules/edit-source-not-dist.mdc +23 -0
- package/skeleton/shared/rules/personal-config.mdc +49 -0
- package/skeleton/shared/skills/ai-md-config/SKILL.md +51 -0
- package/skeleton/templates/base/rules/.gitkeep +0 -0
- package/skeleton/templates/base/rules/project-context.mdc +8 -0
- package/skeleton/templates/base/skills/.gitkeep +0 -0
- package/scripts/ensure-agent-tools.sh +0 -114
package/README.md
CHANGED
|
@@ -1,61 +1,73 @@
|
|
|
1
|
-
# ai-md
|
|
1
|
+
# @dujavi/ai-md
|
|
2
2
|
|
|
3
3
|
Public **AXI-shaped** CLI for a **private** personal AI config directory (`~/.ai-md`).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|-------|------|---------|
|
|
7
|
-
| **System** | `skills/`, `rules/` | Global base — linked to `~/.cursor/{skills,rules}` |
|
|
8
|
-
| **Templates** | `templates/<type>/` | Project-type starters (`base`, later `forms`, …) |
|
|
9
|
-
| **Projects** | `projects/<name>/` | Per-app overlays (repo `.cursor` → here) |
|
|
5
|
+
Build merges `shared/` + `agents/<harness>/` into `dist/<harness>/`, then links live tool dirs at dist. **Only installed AIs are linked** (detect dirs/binaries); use `--force-link` to override.
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
## Layout (private repo)
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
| Path | Role |
|
|
10
|
+
|------|------|
|
|
11
|
+
| `shared/{rules,skills}` | Cross-harness source |
|
|
12
|
+
| `agents/<id>/` | Harness-specific overlays (win on name conflict) |
|
|
13
|
+
| `dist/<id>/` | Generated (gitignored) — do not edit |
|
|
14
|
+
| `templates/<type>/` | Project starters |
|
|
15
|
+
| `projects/<name>/` | Per-app overlays (repo `.cursor` → here) |
|
|
16
|
+
| `scripts/` | Private machine scripts |
|
|
17
|
+
|
|
18
|
+
## Unique vs shared live roots
|
|
19
|
+
|
|
20
|
+
| Live root | Harnesses | Notes |
|
|
21
|
+
|-----------|-----------|--------|
|
|
22
|
+
| `~/.cursor/{skills,rules}` | **cursor** only | Unique |
|
|
23
|
+
| `~/.claude/{skills,rules}` | **claude** only | Unique |
|
|
24
|
+
| `~/.gemini/skills` | **gemini** only | Unique |
|
|
25
|
+
| `~/.config/opencode/skills` | **opencode** only | Unique |
|
|
26
|
+
| `~/.copilot/skills` | **copilot** (stub) | Unique |
|
|
27
|
+
| `~/.agents/skills` | **agents** (writer); **codex** is an **alias** | Shared — emit once |
|
|
28
|
+
|
|
29
|
+
Cursor / Gemini / OpenCode may *also read* `~/.agents/skills`; enabling `agents` feeds them without a second copy under those tools’ unique roots (unless those harnesses are enabled too, which builds `shared/` into each unique dist).
|
|
30
|
+
|
|
31
|
+
## Quick start
|
|
14
32
|
|
|
15
33
|
```bash
|
|
16
34
|
npm i -g @dujavi/ai-md
|
|
17
|
-
ai-md setup --remote https://github.com/<you>/.ai-md.git --tools
|
|
18
|
-
# persists ~/.config/ai-md/config.json then clones + links (+ optional grok/quota-axi)
|
|
19
|
-
```
|
|
20
35
|
|
|
21
|
-
|
|
36
|
+
# A) No private remote yet
|
|
37
|
+
ai-md init
|
|
22
38
|
|
|
23
|
-
|
|
24
|
-
ai-md
|
|
25
|
-
|
|
26
|
-
ai-md
|
|
39
|
+
# B) Existing private git repo
|
|
40
|
+
ai-md setup --remote https://github.com/<you>/.ai-md.git
|
|
41
|
+
|
|
42
|
+
ai-md pull
|
|
43
|
+
# edit shared/ or agents/<id>/ only
|
|
44
|
+
ai-md build
|
|
45
|
+
ai-md push -m "why"
|
|
27
46
|
```
|
|
28
47
|
|
|
29
|
-
|
|
48
|
+
## Commands
|
|
30
49
|
|
|
31
|
-
|
|
50
|
+
| Command | Purpose |
|
|
51
|
+
|---------|---------|
|
|
52
|
+
| `init` / `seed-skeleton` | Scaffold / merge recommended base rules+skills |
|
|
53
|
+
| `build` | Emit `dist/` |
|
|
54
|
+
| `rescue` | Promote dirty dist → `agents/<id>/` |
|
|
55
|
+
| `install` / `pull` | Git + build + link **installed** harnesses |
|
|
56
|
+
| `doctor --fix` | Rebuild + repair links |
|
|
57
|
+
| `harness list\|show\|set\|enable\|disable` | Register or retarget any agent |
|
|
58
|
+
| `config set --link-mode symlink\|junction\|copy` | Platform link mode |
|
|
32
59
|
|
|
33
|
-
|
|
34
|
-
~/.ai-md/
|
|
35
|
-
skills/ # system — all agents see these
|
|
36
|
-
rules/
|
|
37
|
-
templates/
|
|
38
|
-
base/ # default project starter (customizable stubs only)
|
|
39
|
-
# forms/ … # other use cases
|
|
40
|
-
projects/
|
|
41
|
-
presenter/
|
|
42
|
-
sendfolio/
|
|
43
|
-
```
|
|
60
|
+
Flags: `--agents cursor,claude`, `--force-link`, `--force` (discard dirty dist), `--dry-run`, `--json`.
|
|
44
61
|
|
|
45
|
-
|
|
62
|
+
## Platforms
|
|
46
63
|
|
|
47
|
-
|
|
64
|
+
| OS | Default `linkMode` |
|
|
65
|
+
|----|-------------------|
|
|
66
|
+
| Linux / macOS / WSL | `symlink` |
|
|
67
|
+
| Windows | `junction` (fallback symlink → `copy`) |
|
|
48
68
|
|
|
49
|
-
|
|
50
|
-
ai-md # status
|
|
51
|
-
ai-md init-project --repo ~/app --from base
|
|
52
|
-
ai-md apply-template --project app --from base
|
|
53
|
-
ai-md doctor --fix --agents cursor,claude
|
|
54
|
-
ai-md pull | push -m "why"
|
|
55
|
-
ai-md ensure-tools
|
|
56
|
-
```
|
|
69
|
+
Run `ai-md` in the **same** environment as the IDE/CLI (Windows Cursor → Windows Node). WSL home ≠ Windows `%USERPROFILE%`.
|
|
57
70
|
|
|
58
|
-
##
|
|
71
|
+
## Edit policy
|
|
59
72
|
|
|
60
|
-
|
|
61
|
-
- `AI_MD_CONFIG` — path to machine config JSON (default `~/.config/ai-md/config.json`)
|
|
73
|
+
Never edit live harness dirs or `dist/`. See seeded `shared/rules/edit-source-not-dist.mdc` and skill `ai-md-config`.
|