@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 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
- The npm package ships tooling only no personal skills, rules, or secrets. Your content lives in a private git repo you point at with `--remote` (or machine config). Default reads are TOON + `help[]`; use `--json` when you need JSON.
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
- ![Architecture](docs/architecture.png)
7
+ ## Layout (private repo)
8
8
 
9
- ## What it manages
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
- | Layer | Path | Purpose |
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
- ## Supported harnesses
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
- Skill (and for Cursor, rules) link targets via `--agents` (comma-separated):
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
- # First machine: persist config, clone, link, run a private script
70
- ai-md setup --remote https://github.com/<you>/.ai-md.git --script ensure-tools
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
- ## Commands
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
- ```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
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
- - Resolves `$AI_MD_DIR/scripts/<name>` or `<name>.sh` (basename only; no `..` / paths).
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
- ## Machine config
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
- Persisted at `~/.config/ai-md/config.json` (override path with `AI_MD_CONFIG`):
60
+ Flags: `--agents cursor,claude`, `--force-link`, `--force` (discard dirty dist), `--dry-run`, `--json`.
110
61
 
111
- ```json
112
- { "dir": "/home/you/.ai-md", "remote": "https://github.com/you/.ai-md.git" }
113
- ```
62
+ ## Platforms
114
63
 
115
- Env one-shots: `AI_MD_DIR`, `AI_MD_REMOTE`.
64
+ | OS | Default `linkMode` |
65
+ |----|-------------------|
66
+ | Linux / macOS / WSL | `symlink` |
67
+ | Windows | `junction` (fallback symlink → `copy`) |
116
68
 
117
- ## Layout example
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
- ## License
71
+ ## Edit policy
132
72
 
133
- MIT
73
+ Never edit live harness dirs or `dist/`. See seeded `shared/rules/edit-source-not-dist.mdc` and skill `ai-md-config`.