@dujavi/ai-md 0.5.0 → 0.6.1
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 +50 -106
- package/bin/ai-md.js +358 -191
- package/lib/build.js +268 -0
- package/lib/commands.js +421 -99
- package/lib/config-paths.js +73 -0
- package/lib/config.js +124 -67
- package/lib/harnesses/index.js +309 -0
- package/lib/link.js +224 -0
- package/lib/remote.js +116 -0
- package/lib/rescue.js +95 -0
- package/lib/skeleton.js +117 -0
- package/lib/status.js +114 -36
- package/package.json +4 -3
- package/scripts/sync-config.sh +10 -3
- 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/README.md
CHANGED
|
@@ -2,132 +2,76 @@
|
|
|
2
2
|
|
|
3
3
|
Public **AXI-shaped** CLI for a **private** personal AI config directory (`~/.ai-md`).
|
|
4
4
|
|
|
5
|
-
|
|
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.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Layout (private repo)
|
|
8
8
|
|
|
9
|
-
|
|
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 |
|
|
10
17
|
|
|
11
|
-
|
|
12
|
-
|-------|------|---------|
|
|
13
|
-
| **System** | `skills/`, `rules/` | Global base — linked into agent harnesses |
|
|
14
|
-
| **Templates** | `templates/<type>/` | Project-type starters (`base`, later `forms`, …) |
|
|
15
|
-
| **Projects** | `projects/<name>/` | Per-app overlays (repo `.cursor` → here) |
|
|
16
|
-
| **Scripts** | `scripts/<name>` | Private machine scripts via `ai-md script` / `setup --script` |
|
|
18
|
+
## Unique vs shared live roots
|
|
17
19
|
|
|
18
|
-
|
|
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 |
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| Harness | Skills link | Notes |
|
|
23
|
-
|---------|-------------|--------|
|
|
24
|
-
| `cursor` | `~/.cursor/skills` | **Default.** Install also links `~/.cursor/rules` → `~/.ai-md/rules` |
|
|
25
|
-
| `claude` | `~/.claude/skills` | Optional second harness |
|
|
26
|
-
| `agents` | `~/.agents/skills` | Optional agents-skills layout |
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
ai-md doctor --fix --agents cursor,claude
|
|
30
|
-
ai-md install --agents cursor,claude,agents
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Architecture
|
|
34
|
-
|
|
35
|
-
```mermaid
|
|
36
|
-
flowchart TB
|
|
37
|
-
subgraph publicPkg ["@dujavi/ai-md"]
|
|
38
|
-
cli["ai-md CLI"]
|
|
39
|
-
runner["lib/scripts.js"]
|
|
40
|
-
end
|
|
41
|
-
subgraph privateDir ["~/.ai-md"]
|
|
42
|
-
system["skills + rules"]
|
|
43
|
-
templates["templates/"]
|
|
44
|
-
projects["projects/"]
|
|
45
|
-
scripts["scripts/"]
|
|
46
|
-
end
|
|
47
|
-
subgraph harnesses ["Supported harnesses"]
|
|
48
|
-
cursor["cursor ~/.cursor"]
|
|
49
|
-
claude["claude ~/.claude"]
|
|
50
|
-
agents["agents ~/.agents"]
|
|
51
|
-
end
|
|
52
|
-
cli --> system
|
|
53
|
-
cli --> templates
|
|
54
|
-
cli --> projects
|
|
55
|
-
cli --> runner
|
|
56
|
-
runner --> scripts
|
|
57
|
-
system --> cursor
|
|
58
|
-
system --> claude
|
|
59
|
-
system --> agents
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Personal installers (Grok, quota-axi, etc.) are **not** baked into this package. Put them in `~/.ai-md/scripts/` and run with `--script` / `ai-md script`.
|
|
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).
|
|
63
30
|
|
|
64
31
|
## Quick start
|
|
65
32
|
|
|
66
33
|
```bash
|
|
67
34
|
npm i -g @dujavi/ai-md
|
|
68
35
|
|
|
69
|
-
#
|
|
70
|
-
ai-md setup --remote https://github.com/<you>/.ai-md.git
|
|
36
|
+
# A) Existing private git repo (clone/sync first — never skeleton-before-sync)
|
|
37
|
+
ai-md setup --remote https://github.com/<you>/.ai-md.git
|
|
71
38
|
|
|
72
|
-
#
|
|
73
|
-
ai-md
|
|
74
|
-
ai-md install
|
|
75
|
-
ai-md script ensure-tools
|
|
76
|
-
```
|
|
39
|
+
# B) No remote yet → local skeleton only
|
|
40
|
+
ai-md init
|
|
77
41
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
42
|
+
# C) Optional auto-detect: if `gh` (or git github.user) identifies you
|
|
43
|
+
# AND github.com/<user>/.ai-md exists, init/setup use that remote.
|
|
44
|
+
# There is no hardcoded default remote.
|
|
81
45
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
ai-md
|
|
85
|
-
ai-md
|
|
86
|
-
ai-md install [--agents cursor,claude]
|
|
87
|
-
ai-md doctor --fix
|
|
88
|
-
ai-md pull | push -m "why"
|
|
89
|
-
ai-md script <name> [--] [args...] # private ~/.ai-md/scripts/
|
|
90
|
-
ai-md init-project --repo ~/app --from base
|
|
91
|
-
ai-md apply-template --project app --from base
|
|
92
|
-
ai-md link-project --repo ~/app --name app
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Private scripts
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
ai-md script ensure-tools
|
|
99
|
-
ai-md script ensure-tools -- --dry-run
|
|
100
|
-
ai-md setup --remote <url> --script ensure-tools -- --dry-run
|
|
46
|
+
ai-md pull
|
|
47
|
+
# edit shared/ or agents/<id>/ only
|
|
48
|
+
ai-md build
|
|
49
|
+
ai-md push -m "why"
|
|
101
50
|
```
|
|
102
51
|
|
|
103
|
-
|
|
104
|
-
- Args after the script name (or after `--` on `setup` / `install`) are forwarded unchanged.
|
|
105
|
-
- Repeat `--script` on setup/install; the same trailing args apply to each.
|
|
106
|
-
|
|
107
|
-
## Machine config
|
|
52
|
+
## Commands
|
|
108
53
|
|
|
109
|
-
|
|
54
|
+
| Command | Purpose |
|
|
55
|
+
|---------|---------|
|
|
56
|
+
| `init` / `seed-skeleton` | Scaffold / merge recommended base rules+skills |
|
|
57
|
+
| `build` | Emit `dist/` |
|
|
58
|
+
| `rescue` | Promote dirty dist → `agents/<id>/` |
|
|
59
|
+
| `install` / `pull` | Git + build + link **installed** harnesses |
|
|
60
|
+
| `doctor --fix` | Rebuild + repair links |
|
|
61
|
+
| `harness list\|show\|set\|enable\|disable` | Register or retarget any agent |
|
|
62
|
+
| `config set --link-mode symlink\|junction\|copy` | Platform link mode |
|
|
110
63
|
|
|
111
|
-
|
|
112
|
-
{ "dir": "/home/you/.ai-md", "remote": "https://github.com/you/.ai-md.git" }
|
|
113
|
-
```
|
|
64
|
+
Flags: `--agents cursor,claude`, `--force-link`, `--force` (discard dirty dist), `--dry-run`, `--json`.
|
|
114
65
|
|
|
115
|
-
|
|
66
|
+
## Platforms
|
|
116
67
|
|
|
117
|
-
|
|
68
|
+
| OS | Default `linkMode` |
|
|
69
|
+
|----|-------------------|
|
|
70
|
+
| Linux / macOS / WSL | `symlink` |
|
|
71
|
+
| Windows | `junction` (fallback symlink → `copy`) |
|
|
118
72
|
|
|
119
|
-
|
|
120
|
-
~/.ai-md/
|
|
121
|
-
skills/ # system — harnesses see these
|
|
122
|
-
rules/
|
|
123
|
-
scripts/
|
|
124
|
-
ensure-tools.sh # your private tooling
|
|
125
|
-
templates/
|
|
126
|
-
base/
|
|
127
|
-
projects/
|
|
128
|
-
my-app/
|
|
129
|
-
```
|
|
73
|
+
Run `ai-md` in the **same** environment as the IDE/CLI (Windows Cursor → Windows Node). WSL home ≠ Windows `%USERPROFILE%`.
|
|
130
74
|
|
|
131
|
-
##
|
|
75
|
+
## Edit policy
|
|
132
76
|
|
|
133
|
-
|
|
77
|
+
Never edit live harness dirs or `dist/`. See seeded `shared/rules/edit-source-not-dist.mdc` and skill `ai-md-config`.
|