@dujavi/ai-md 0.5.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 +47 -107
- package/bin/ai-md.js +344 -186
- 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/skeleton.js +117 -0
- package/lib/status.js +110 -35
- package/package.json +4 -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,72 @@
|
|
|
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
|
|
71
|
-
|
|
72
|
-
# Or step by step
|
|
73
|
-
ai-md config set --remote https://github.com/<you>/.ai-md.git --dir ~/.ai-md
|
|
74
|
-
ai-md install
|
|
75
|
-
ai-md script ensure-tools
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Precedence: `--remote` / `--dir` flags > `AI_MD_*` env > `~/.config/ai-md/config.json` > defaults (`~/.ai-md`, package default remote).
|
|
36
|
+
# A) No private remote yet
|
|
37
|
+
ai-md init
|
|
79
38
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
ai-md # status (AXI)
|
|
84
|
-
ai-md setup --remote <url> --script <name>
|
|
85
|
-
ai-md config | config set --remote <url> --dir ~/.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
|
|
39
|
+
# B) Existing private git repo
|
|
40
|
+
ai-md setup --remote https://github.com/<you>/.ai-md.git
|
|
96
41
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
ai-md
|
|
100
|
-
ai-md
|
|
42
|
+
ai-md pull
|
|
43
|
+
# edit shared/ or agents/<id>/ only
|
|
44
|
+
ai-md build
|
|
45
|
+
ai-md push -m "why"
|
|
101
46
|
```
|
|
102
47
|
|
|
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.
|
|
48
|
+
## Commands
|
|
106
49
|
|
|
107
|
-
|
|
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 |
|
|
108
59
|
|
|
109
|
-
|
|
60
|
+
Flags: `--agents cursor,claude`, `--force-link`, `--force` (discard dirty dist), `--dry-run`, `--json`.
|
|
110
61
|
|
|
111
|
-
|
|
112
|
-
{ "dir": "/home/you/.ai-md", "remote": "https://github.com/you/.ai-md.git" }
|
|
113
|
-
```
|
|
62
|
+
## Platforms
|
|
114
63
|
|
|
115
|
-
|
|
64
|
+
| OS | Default `linkMode` |
|
|
65
|
+
|----|-------------------|
|
|
66
|
+
| Linux / macOS / WSL | `symlink` |
|
|
67
|
+
| Windows | `junction` (fallback symlink → `copy`) |
|
|
116
68
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
```text
|
|
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
|
-
```
|
|
69
|
+
Run `ai-md` in the **same** environment as the IDE/CLI (Windows Cursor → Windows Node). WSL home ≠ Windows `%USERPROFILE%`.
|
|
130
70
|
|
|
131
|
-
##
|
|
71
|
+
## Edit policy
|
|
132
72
|
|
|
133
|
-
|
|
73
|
+
Never edit live harness dirs or `dist/`. See seeded `shared/rules/edit-source-not-dist.mdc` and skill `ai-md-config`.
|