dotai-cli 0.2.0__tar.gz → 0.3.0__tar.gz

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.
Files changed (71) hide show
  1. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/.gitignore +1 -0
  2. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/PKG-INFO +160 -20
  3. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/README.md +158 -18
  4. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/pyproject.toml +3 -2
  5. dotai_cli-0.3.0/rdc.yaml +8 -0
  6. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/__init__.py +1 -1
  7. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/cli/__init__.py +9 -2
  8. dotai_cli-0.3.0/src/dotai/cli/prefs_cmd.py +364 -0
  9. dotai_cli-0.3.0/src/dotai/cli/rules_cmd.py +417 -0
  10. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/cli/skills_cmd.py +149 -13
  11. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/cli/sync_cmd.py +26 -5
  12. dotai_cli-0.3.0/src/dotai/import_agent.py +269 -0
  13. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/models.py +58 -0
  14. dotai_cli-0.3.0/src/dotai/preferences.py +575 -0
  15. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/rules.py +227 -27
  16. dotai_cli-0.3.0/src/dotai/seed/skills/learn.md +53 -0
  17. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/sync.py +133 -49
  18. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/vet.py +48 -0
  19. dotai_cli-0.3.0/tests/test_import_agent.py +188 -0
  20. dotai_cli-0.3.0/tests/test_preferences.py +184 -0
  21. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/tests/test_vet.py +43 -1
  22. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/uv.lock +172 -144
  23. dotai_cli-0.2.0/src/dotai/cli/rules_cmd.py +0 -202
  24. dotai_cli-0.2.0/src/dotai/seed/skills/learn.md +0 -37
  25. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/.github/workflows/ci.yml +0 -0
  26. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/.github/workflows/publish.yml +0 -0
  27. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/LICENSE +0 -0
  28. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/__main__.py +0 -0
  29. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/cli/__main__.py +0 -0
  30. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/cli/roles_cmd.py +0 -0
  31. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/cli/watch_cmd.py +0 -0
  32. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/converter.py +0 -0
  33. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/indexer.py +0 -0
  34. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/roles.py +0 -0
  35. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/roles/architect.md +0 -0
  36. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/roles/debugger.md +0 -0
  37. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/roles/founder.md +0 -0
  38. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/roles/mentor.md +0 -0
  39. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/roles/product-manager.md +0 -0
  40. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/roles/qa.md +0 -0
  41. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/roles/reviewer.md +0 -0
  42. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/roles/security.md +0 -0
  43. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/roles/ship.md +0 -0
  44. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/roles/writer.md +0 -0
  45. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/skills/careful.md +0 -0
  46. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/skills/commit-helper.md +0 -0
  47. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/skills/context-dump.md +0 -0
  48. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/skills/investigate.md +0 -0
  49. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/skills/parallel-work.md +0 -0
  50. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/skills/plan.md +0 -0
  51. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/skills/review.md +0 -0
  52. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/skills/scaffold.md +0 -0
  53. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/skills/ship.md +0 -0
  54. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/skills/techdebt.md +0 -0
  55. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/seed/skills/verify.md +0 -0
  56. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/skills.py +0 -0
  57. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/store.py +0 -0
  58. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/tools/__init__.py +0 -0
  59. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/tools/base.py +0 -0
  60. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/tools/registry.py +0 -0
  61. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/src/dotai/utils.py +0 -0
  62. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/tests/__init__.py +0 -0
  63. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/tests/conftest.py +0 -0
  64. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/tests/test_converter.py +0 -0
  65. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/tests/test_models.py +0 -0
  66. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/tests/test_roles.py +0 -0
  67. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/tests/test_rules.py +0 -0
  68. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/tests/test_skills.py +0 -0
  69. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/tests/test_store.py +0 -0
  70. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/tests/test_sync.py +0 -0
  71. {dotai_cli-0.2.0 → dotai_cli-0.3.0}/tests/test_utils.py +0 -0
@@ -9,6 +9,7 @@ build/
9
9
 
10
10
  # dotai sync outputs (generated per-user, run `dotai sync` to regenerate)
11
11
  .claude/skills/
12
+ CLAUDE.md
12
13
  .cursorrules
13
14
  AGENTS.md
14
15
  GEMINI.md
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dotai-cli
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Universal AI context for any coding agent. Roles, skills, and rules in ~/.ai/
5
5
  Project-URL: Homepage, https://github.com/dawalama/dotai
6
6
  Project-URL: Repository, https://github.com/dawalama/dotai
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.12
18
18
  Classifier: Programming Language :: Python :: 3.13
19
19
  Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
20
20
  Requires-Python: >=3.11
21
- Requires-Dist: ai-skill-audit>=0.4.0
21
+ Requires-Dist: ai-skill-audit>=0.5.1
22
22
  Requires-Dist: pydantic>=2.0
23
23
  Requires-Dist: rich>=13.0
24
24
  Requires-Dist: typer>=0.9
@@ -48,7 +48,8 @@ Your knowledge about how to write code, review it, ship it, and debug it gets sc
48
48
 
49
49
  - **Roles** — Cognitive modes that shift how the AI thinks (reviewer, architect, founder, QA, etc.)
50
50
  - **Skills** — Reusable workflows with steps, inputs, gotchas, and role references
51
- - **Rules** — Structured coding standards with per-project toggles and file-pattern scoping
51
+ - **Rules** — Structured coding standards with per-project toggles and file-pattern scoping (hard constraints)
52
+ - **Preference packs** — Soft, borrowable taste (CLI stack, design micro-style); never override hard rules
52
53
  - **Agent sync** — Generate `CLAUDE.md`, `.cursorrules`, `GEMINI.md`, or `AGENTS.md` from your `~/.ai/`
53
54
  - **Native slash commands** — For Claude Code, skills become real `/run_*` commands automatically
54
55
 
@@ -91,7 +92,7 @@ cd ~/my-project
91
92
  dotai sync
92
93
  ```
93
94
 
94
- This generates agent config files in your project root — `CLAUDE.md`, `.cursorrules`, `GEMINI.md`, and `AGENTS.md` — each with your complete knowledge context inline. For Claude Code, it also generates `.claude/skills/` entries so your skills appear as native slash commands.
95
+ This generates agent config files in your project root — `CLAUDE.md`, `.cursorrules`, `GEMINI.md`, and `AGENTS.md`. Structured rules and freeform conventions are included in full; roles and skills are included as a compact catalog by default. For Claude Code, sync also generates `.claude/skills/` entries so skills appear as native slash commands. Use `dotai sync --full` when an agent needs every role and skill definition inline.
95
96
 
96
97
  ## Usage
97
98
 
@@ -143,23 +144,122 @@ dotai skills --category deployment
143
144
 
144
145
  ### Recording what you learn
145
146
 
147
+ `dotai learn` creates a **structured rule file** in `~/.ai/rules/` by default (not a freeform journal scrap).
148
+
146
149
  ```bash
147
- # Something went wrong — record it so the AI never repeats it
150
+ # Preview the rule without writing
148
151
  dotai learn "auth-header" \
149
152
  --issue "Forgot Bearer prefix on API token" \
150
- --correction "Always prepend 'Bearer ' to auth tokens"
153
+ --correction "Always prepend 'Bearer ' to auth tokens" \
154
+ --dry-run
151
155
 
152
- # Or let the agent do it — /run_learn reviews the session and proposes a rule
153
- > /run_learn
156
+ # Save structured rule + resync agent configs
157
+ dotai learn "auth-header" \
158
+ -i "Forgot Bearer prefix on API token" \
159
+ -c "Always prepend 'Bearer ' to auth tokens" \
160
+ --sync
154
161
 
155
162
  # Import a detailed rule from a file
156
163
  dotai learn "no-useEffect" --from-file react-rules.md --globs "*.tsx,*.ts"
157
164
 
165
+ # Freeform journal entry in rules.md (opt-in)
166
+ dotai learn "note" -i "..." -c "..." --append-md
167
+
168
+ # Or let the agent do it — /run_learn reviews the session and proposes a rule
169
+ > /run_learn
170
+
158
171
  # Disable a rule for one legacy project
159
172
  dotai toggle no-useeffect --off --project legacy-app
173
+
174
+ # Audit rule quality (duplicates, empty bodies)
175
+ dotai rules --check
176
+ ```
177
+
178
+ The feedback loop: **vibe-code → agent makes mistake → `/run_learn` → structured rule → `dotai sync` → agent never repeats it.**
179
+
180
+ ### Migrating existing agent files
181
+
182
+ Already have a `CLAUDE.md`, `.cursorrules`, or `AGENTS.md`? Import user-authored content into `~/.ai/`:
183
+
184
+ ```bash
185
+ # Preview
186
+ dotai import-agent CLAUDE.md --dry-run
187
+
188
+ # Append into project .ai/rules.md (default)
189
+ dotai import-agent CLAUDE.md
190
+
191
+ # One structured rule
192
+ dotai import-agent .cursorrules --mode rule --name project-conventions
193
+
194
+ # One rule per ## section
195
+ dotai import-agent AGENTS.md --mode sections --dry-run
196
+
197
+ # Scan a project directory for known agent files
198
+ dotai import-agent . --mode rules_md
199
+ ```
200
+
201
+ dotai strips its own managed marker sections so you don't re-import generated primers. Directory imports combine all discovered agent files into one update, and structured-rule imports choose a new suffixed filename rather than overwrite an existing rule. Preview unfamiliar files with `--dry-run` before importing.
202
+
203
+ ### Preference packs (taste) — borrowable soft style
204
+
205
+ Hard rules are law. **Preference packs** are soft taste: CLI stack, design micro-details, export style — things that are too granular or fluid for hard rules. You can author them, pull someone else's, and activate them per project.
206
+
207
+ **Precedence:** hard rules → freeform `rules.md` → active preference packs → model default.
208
+
209
+ ```bash
210
+ # Create a pack
211
+ dotai prefs new "CLI Conventions" --domain cli
212
+ # Edit ~/.ai/preferences/cli-conventions.md, then activate:
213
+ dotai prefs use cli-conventions
214
+ dotai sync
215
+
216
+ # Borrow / pull someone else's taste (local file or git repo)
217
+ dotai prefs pull ./design-eng-taste.md --name design-eng --domain design
218
+ dotai prefs pull https://github.com/org/taste-packs -n cli
219
+ dotai prefs use design-eng
220
+
221
+ # Session overlay without changing active list
222
+ dotai sync --with-prefs design-eng,cli
223
+ dotai primer --with-prefs design-eng
224
+
225
+ # List / show / deactivate
226
+ dotai prefs
227
+ dotai prefs show cli-conventions
228
+ dotai prefs unuse design-eng
229
+
230
+ # Project operations stay inside that project; global removal is explicit
231
+ dotai prefs use cli-conventions --project my-app
232
+ dotai prefs remove cli-conventions --global
160
233
  ```
161
234
 
162
- The feedback loop: **vibe-code → agent makes mistake → `/run_learn` → rule created → next sync → agent never repeats it.** Your agent gets smarter every session.
235
+ Preference lookup and removal are scope-safe: a project command cannot mutate a pack owned by another registered project. Removing a pack also removes it from the activation list for the pack's owning scope.
236
+
237
+ Example pack (`~/.ai/preferences/cli.md`):
238
+
239
+ ```markdown
240
+ ---
241
+ name: CLI Conventions
242
+ id: cli
243
+ description: How I build CLIs
244
+ domain: cli
245
+ tags: typescript, commander
246
+ ---
247
+
248
+ ## Soft preferences
249
+
250
+ Hard rules always take precedence if they conflict.
251
+
252
+ ### Stack
253
+ - TypeScript + tsup
254
+ - Commander.js
255
+ - Vitest
256
+ - pnpm (npm link for local bins)
257
+
258
+ ### Style
259
+ - Lowercase `-v` for version
260
+ - Start version at `0.0.1`
261
+ - Commands live under `commands/`
262
+ ```
163
263
 
164
264
  ### Searching your knowledge
165
265
 
@@ -193,8 +293,11 @@ dotai init ~/other-project
193
293
  ```
194
294
  ~/.ai/ # Global (cross-project)
195
295
  ├── rules.md # Inline rules, conventions, and lessons learned
196
- ├── rules/ # Structured rules (individual files)
296
+ ├── rules/ # Structured rules (hard constraints)
197
297
  │ └── no-useeffect.md # Example: ban useEffect in React
298
+ ├── preferences/ # Soft taste packs (borrowable style priors)
299
+ │ └── cli.md # Example: CLI stack / micro-style
300
+ ├── preferences-active.json # Which preference packs are active
198
301
  ├── roles/ # Cognitive modes
199
302
  │ ├── reviewer.md # Paranoid staff engineer
200
303
  │ ├── architect.md # Systems thinker
@@ -404,12 +507,18 @@ All useEffect usage must be replaced with declarative patterns...
404
507
  # List active rules
405
508
  dotai rules
406
509
 
510
+ # Audit duplicates / empty bodies
511
+ dotai rules --check
512
+
407
513
  # Import a rule from an external file
408
514
  dotai learn "no-useEffect" --from-file react-rule.md --globs "*.tsx,*.ts"
409
515
 
410
- # Record an inline learning
516
+ # Record a learning as a structured rule (default)
411
517
  dotai learn "auth-header" --issue "Forgot Bearer prefix" --correction "Always prepend Bearer to tokens"
412
518
 
519
+ # Preview first
520
+ dotai learn "auth-header" -i "..." -c "..." --dry-run
521
+
413
522
  # Disable a rule globally
414
523
  dotai toggle no-useeffect --off
415
524
 
@@ -420,11 +529,20 @@ dotai toggle no-useeffect --off --project my-legacy-app
420
529
  dotai toggle no-useeffect --on
421
530
  ```
422
531
 
423
- Rules are included inline in every synced agent file, so agents that can't read external files still get the full rule content.
532
+ Structured rules are included **inline** in every synced agent file. Freeform `rules.md` is included too. Skills/roles stay as catalogs unless you pass `dotai sync --full`.
424
533
 
425
534
  ## Agent Sync
426
535
 
427
- `dotai sync` generates tool-specific bootstrap files with **full inline content** — every rule body, role persona, skill definition, and gotcha is embedded so agents that can't read external files still get everything.
536
+ `dotai sync` generates tool-specific bootstrap files with:
537
+
538
+ - **Full structured rule bodies** (high-value constraints)
539
+ - **Freeform `rules.md` conventions** (previously referenced but not inlined)
540
+ - **Role and skill catalogs** (names, triggers, descriptions — not every skill novel)
541
+ - **Claude Code**: compact pointers + native `.claude/skills/` slash commands
542
+
543
+ Use `--full` only when you need every role persona and skill definition dumped inline (larger context).
544
+
545
+ These files contain machine-specific context and may include absolute paths. Treat them as generated per-user artifacts unless your team intentionally commits shared agent instructions. dotai-managed sections are marker-delimited, so syncing preserves user-authored content outside those markers.
428
546
 
429
547
  ```bash
430
548
  # Generate all (CLAUDE.md + .cursorrules + GEMINI.md + AGENTS.md)
@@ -434,8 +552,13 @@ dotai sync
434
552
  dotai sync --agents claude,cursor
435
553
  dotai sync --agents gemini
436
554
 
555
+ # Legacy-style full dump (roles + skill definitions inline)
556
+ dotai sync --full
557
+
437
558
  # Print primer to stdout (for piping)
438
559
  dotai primer
560
+ dotai primer --compact
561
+ dotai primer --full
439
562
  ```
440
563
 
441
564
  ### Supported Agents
@@ -443,17 +566,17 @@ dotai primer
443
566
  | Agent | Output File | Sync Command | Notes |
444
567
  |-------|-------------|--------------|-------|
445
568
  | Claude Code | `CLAUDE.md` + `.claude/skills/` | `dotai sync --agents claude` | Marker-based merging + native slash commands |
446
- | Cursor | `.cursorrules` | `dotai sync --agents cursor` | Full context inline |
569
+ | Cursor | `.cursorrules` | `dotai sync --agents cursor` | Full rules and preferences; role/skill catalog by default |
447
570
  | Gemini CLI | `GEMINI.md` | `dotai sync --agents gemini` | Auto-discovered in project root and `~/.gemini/GEMINI.md` |
448
571
  | Generic | `AGENTS.md` | `dotai sync --agents generic` | Works with Codex, Copilot, and any agent that reads it |
449
572
 
450
573
  For Claude Code, `dotai sync` also generates `.claude/skills/<trigger>/SKILL.md` files. These register as native slash commands — they appear in autocomplete and work as real `/run_*` commands with role composition support built in.
451
574
 
452
- > **Tip:** Run `dotai primer | pbcopy` to copy the full context to your clipboard for pasting into any agent's system prompt.
575
+ > **Tip:** Run `dotai primer --full | pbcopy` to copy the complete context to your clipboard for pasting into an agent's system prompt.
453
576
 
454
577
  ## Installing Skills
455
578
 
456
- Install skills from git repos or local directories. Claude-native `SKILL.md` files are auto-detected and converted to dotai format with triggers and categories inferred from the content.
579
+ Install skills from git repos or local directories. Claude-native `SKILL.md` files are auto-detected and converted to dotai format with triggers and categories inferred from the content. New installs are security-vetted before use.
457
580
 
458
581
  ```bash
459
582
  # Install from a GitHub repo — auto-detects and converts Claude-native skills
@@ -471,6 +594,15 @@ dotai install https://github.com/team/skills -p my-project
471
594
 
472
595
  After install, run `dotai sync` to make them available as slash commands in Claude Code, Gemini, etc.
473
596
 
597
+ Refresh skills that were installed from a tracked source (team conventions repo):
598
+
599
+ ```bash
600
+ dotai install --update
601
+ dotai install --update -s mvp
602
+ ```
603
+
604
+ Updates are staged and security-vetted before installation. A blocked or declined update leaves the existing skill unchanged. Multi-skill repositories refresh each recorded skill independently. `--skip-vet` is an explicit trust override and should only be used for a source you have reviewed.
605
+
474
606
  ### Converting Claude-native skills
475
607
 
476
608
  If you have a Claude-native `SKILL.md` and want to convert it manually:
@@ -564,13 +696,21 @@ dotai roles # List available roles
564
696
  dotai role <name> # Output a role's full prompt to stdout
565
697
  dotai skills [-c category] # List skills (optionally filter by category)
566
698
  dotai prompt <skill> [--role <role>] # Assemble skill + role prompt for any agent
567
- dotai sync [path] [--agents ...] # Sync ~/.ai/ into agent config files
568
- dotai primer [--project <name>] # Print full agent context to stdout
569
- dotai rules [-p project] [-a] # List rules (resolved or all)
699
+ dotai sync [path] [--agents ...] [--full] # Sync ~/.ai/ into agent config files
700
+ dotai primer [--project <name>] [--full|--compact] # Print agent context to stdout
701
+ dotai rules [-p project] [-a] [--check] # List rules (or audit quality)
570
702
  dotai toggle <rule-id> --on/--off # Enable/disable rules globally or per-project
703
+ dotai learn "title" -i "..." -c "..." # Create structured rule (default)
704
+ dotai learn "title" -i "..." -c "..." --dry-run|--sync|--force|--append-md
571
705
  dotai learn "title" --from-file <f> # Import structured rule from a file
572
- dotai learn "title" -i "..." -c "..." # Record an inline learning
706
+ dotai import-agent <path> [-m mode] [--dry-run] # Non-destructive agent-file migration
707
+ dotai prefs [list|show|new|pull|use|unuse|remove] # Preference / taste packs
708
+ dotai prefs new "CLI" --domain cli # Create a soft style pack
709
+ dotai prefs pull <path|url> [-n id] # Borrow / install a pack
710
+ dotai prefs use <id> [-p project|--global] # Activate pack in an explicit scope
711
+ dotai sync --with-prefs a,b # Session overlay of preference packs
573
712
  dotai install <source> [-s skill] # Install skills from git repo or local path
713
+ dotai install --update [-s skill] [--skip-vet] # Vetted refresh from recorded sources
574
714
  dotai import-plugin <source> # Import from Claude/Cursor/Gemini plugin
575
715
  dotai remove <skill> [-p project] # Remove an installed skill
576
716
  dotai convert <path> [--dry-run] # Convert Claude-native SKILL.md to dotai format
@@ -19,7 +19,8 @@ Your knowledge about how to write code, review it, ship it, and debug it gets sc
19
19
 
20
20
  - **Roles** — Cognitive modes that shift how the AI thinks (reviewer, architect, founder, QA, etc.)
21
21
  - **Skills** — Reusable workflows with steps, inputs, gotchas, and role references
22
- - **Rules** — Structured coding standards with per-project toggles and file-pattern scoping
22
+ - **Rules** — Structured coding standards with per-project toggles and file-pattern scoping (hard constraints)
23
+ - **Preference packs** — Soft, borrowable taste (CLI stack, design micro-style); never override hard rules
23
24
  - **Agent sync** — Generate `CLAUDE.md`, `.cursorrules`, `GEMINI.md`, or `AGENTS.md` from your `~/.ai/`
24
25
  - **Native slash commands** — For Claude Code, skills become real `/run_*` commands automatically
25
26
 
@@ -62,7 +63,7 @@ cd ~/my-project
62
63
  dotai sync
63
64
  ```
64
65
 
65
- This generates agent config files in your project root — `CLAUDE.md`, `.cursorrules`, `GEMINI.md`, and `AGENTS.md` — each with your complete knowledge context inline. For Claude Code, it also generates `.claude/skills/` entries so your skills appear as native slash commands.
66
+ This generates agent config files in your project root — `CLAUDE.md`, `.cursorrules`, `GEMINI.md`, and `AGENTS.md`. Structured rules and freeform conventions are included in full; roles and skills are included as a compact catalog by default. For Claude Code, sync also generates `.claude/skills/` entries so skills appear as native slash commands. Use `dotai sync --full` when an agent needs every role and skill definition inline.
66
67
 
67
68
  ## Usage
68
69
 
@@ -114,23 +115,122 @@ dotai skills --category deployment
114
115
 
115
116
  ### Recording what you learn
116
117
 
118
+ `dotai learn` creates a **structured rule file** in `~/.ai/rules/` by default (not a freeform journal scrap).
119
+
117
120
  ```bash
118
- # Something went wrong — record it so the AI never repeats it
121
+ # Preview the rule without writing
119
122
  dotai learn "auth-header" \
120
123
  --issue "Forgot Bearer prefix on API token" \
121
- --correction "Always prepend 'Bearer ' to auth tokens"
124
+ --correction "Always prepend 'Bearer ' to auth tokens" \
125
+ --dry-run
122
126
 
123
- # Or let the agent do it — /run_learn reviews the session and proposes a rule
124
- > /run_learn
127
+ # Save structured rule + resync agent configs
128
+ dotai learn "auth-header" \
129
+ -i "Forgot Bearer prefix on API token" \
130
+ -c "Always prepend 'Bearer ' to auth tokens" \
131
+ --sync
125
132
 
126
133
  # Import a detailed rule from a file
127
134
  dotai learn "no-useEffect" --from-file react-rules.md --globs "*.tsx,*.ts"
128
135
 
136
+ # Freeform journal entry in rules.md (opt-in)
137
+ dotai learn "note" -i "..." -c "..." --append-md
138
+
139
+ # Or let the agent do it — /run_learn reviews the session and proposes a rule
140
+ > /run_learn
141
+
129
142
  # Disable a rule for one legacy project
130
143
  dotai toggle no-useeffect --off --project legacy-app
144
+
145
+ # Audit rule quality (duplicates, empty bodies)
146
+ dotai rules --check
147
+ ```
148
+
149
+ The feedback loop: **vibe-code → agent makes mistake → `/run_learn` → structured rule → `dotai sync` → agent never repeats it.**
150
+
151
+ ### Migrating existing agent files
152
+
153
+ Already have a `CLAUDE.md`, `.cursorrules`, or `AGENTS.md`? Import user-authored content into `~/.ai/`:
154
+
155
+ ```bash
156
+ # Preview
157
+ dotai import-agent CLAUDE.md --dry-run
158
+
159
+ # Append into project .ai/rules.md (default)
160
+ dotai import-agent CLAUDE.md
161
+
162
+ # One structured rule
163
+ dotai import-agent .cursorrules --mode rule --name project-conventions
164
+
165
+ # One rule per ## section
166
+ dotai import-agent AGENTS.md --mode sections --dry-run
167
+
168
+ # Scan a project directory for known agent files
169
+ dotai import-agent . --mode rules_md
170
+ ```
171
+
172
+ dotai strips its own managed marker sections so you don't re-import generated primers. Directory imports combine all discovered agent files into one update, and structured-rule imports choose a new suffixed filename rather than overwrite an existing rule. Preview unfamiliar files with `--dry-run` before importing.
173
+
174
+ ### Preference packs (taste) — borrowable soft style
175
+
176
+ Hard rules are law. **Preference packs** are soft taste: CLI stack, design micro-details, export style — things that are too granular or fluid for hard rules. You can author them, pull someone else's, and activate them per project.
177
+
178
+ **Precedence:** hard rules → freeform `rules.md` → active preference packs → model default.
179
+
180
+ ```bash
181
+ # Create a pack
182
+ dotai prefs new "CLI Conventions" --domain cli
183
+ # Edit ~/.ai/preferences/cli-conventions.md, then activate:
184
+ dotai prefs use cli-conventions
185
+ dotai sync
186
+
187
+ # Borrow / pull someone else's taste (local file or git repo)
188
+ dotai prefs pull ./design-eng-taste.md --name design-eng --domain design
189
+ dotai prefs pull https://github.com/org/taste-packs -n cli
190
+ dotai prefs use design-eng
191
+
192
+ # Session overlay without changing active list
193
+ dotai sync --with-prefs design-eng,cli
194
+ dotai primer --with-prefs design-eng
195
+
196
+ # List / show / deactivate
197
+ dotai prefs
198
+ dotai prefs show cli-conventions
199
+ dotai prefs unuse design-eng
200
+
201
+ # Project operations stay inside that project; global removal is explicit
202
+ dotai prefs use cli-conventions --project my-app
203
+ dotai prefs remove cli-conventions --global
131
204
  ```
132
205
 
133
- The feedback loop: **vibe-code → agent makes mistake → `/run_learn` → rule created → next sync → agent never repeats it.** Your agent gets smarter every session.
206
+ Preference lookup and removal are scope-safe: a project command cannot mutate a pack owned by another registered project. Removing a pack also removes it from the activation list for the pack's owning scope.
207
+
208
+ Example pack (`~/.ai/preferences/cli.md`):
209
+
210
+ ```markdown
211
+ ---
212
+ name: CLI Conventions
213
+ id: cli
214
+ description: How I build CLIs
215
+ domain: cli
216
+ tags: typescript, commander
217
+ ---
218
+
219
+ ## Soft preferences
220
+
221
+ Hard rules always take precedence if they conflict.
222
+
223
+ ### Stack
224
+ - TypeScript + tsup
225
+ - Commander.js
226
+ - Vitest
227
+ - pnpm (npm link for local bins)
228
+
229
+ ### Style
230
+ - Lowercase `-v` for version
231
+ - Start version at `0.0.1`
232
+ - Commands live under `commands/`
233
+ ```
134
234
 
135
235
  ### Searching your knowledge
136
236
 
@@ -164,8 +264,11 @@ dotai init ~/other-project
164
264
  ```
165
265
  ~/.ai/ # Global (cross-project)
166
266
  ├── rules.md # Inline rules, conventions, and lessons learned
167
- ├── rules/ # Structured rules (individual files)
267
+ ├── rules/ # Structured rules (hard constraints)
168
268
  │ └── no-useeffect.md # Example: ban useEffect in React
269
+ ├── preferences/ # Soft taste packs (borrowable style priors)
270
+ │ └── cli.md # Example: CLI stack / micro-style
271
+ ├── preferences-active.json # Which preference packs are active
169
272
  ├── roles/ # Cognitive modes
170
273
  │ ├── reviewer.md # Paranoid staff engineer
171
274
  │ ├── architect.md # Systems thinker
@@ -375,12 +478,18 @@ All useEffect usage must be replaced with declarative patterns...
375
478
  # List active rules
376
479
  dotai rules
377
480
 
481
+ # Audit duplicates / empty bodies
482
+ dotai rules --check
483
+
378
484
  # Import a rule from an external file
379
485
  dotai learn "no-useEffect" --from-file react-rule.md --globs "*.tsx,*.ts"
380
486
 
381
- # Record an inline learning
487
+ # Record a learning as a structured rule (default)
382
488
  dotai learn "auth-header" --issue "Forgot Bearer prefix" --correction "Always prepend Bearer to tokens"
383
489
 
490
+ # Preview first
491
+ dotai learn "auth-header" -i "..." -c "..." --dry-run
492
+
384
493
  # Disable a rule globally
385
494
  dotai toggle no-useeffect --off
386
495
 
@@ -391,11 +500,20 @@ dotai toggle no-useeffect --off --project my-legacy-app
391
500
  dotai toggle no-useeffect --on
392
501
  ```
393
502
 
394
- Rules are included inline in every synced agent file, so agents that can't read external files still get the full rule content.
503
+ Structured rules are included **inline** in every synced agent file. Freeform `rules.md` is included too. Skills/roles stay as catalogs unless you pass `dotai sync --full`.
395
504
 
396
505
  ## Agent Sync
397
506
 
398
- `dotai sync` generates tool-specific bootstrap files with **full inline content** — every rule body, role persona, skill definition, and gotcha is embedded so agents that can't read external files still get everything.
507
+ `dotai sync` generates tool-specific bootstrap files with:
508
+
509
+ - **Full structured rule bodies** (high-value constraints)
510
+ - **Freeform `rules.md` conventions** (previously referenced but not inlined)
511
+ - **Role and skill catalogs** (names, triggers, descriptions — not every skill novel)
512
+ - **Claude Code**: compact pointers + native `.claude/skills/` slash commands
513
+
514
+ Use `--full` only when you need every role persona and skill definition dumped inline (larger context).
515
+
516
+ These files contain machine-specific context and may include absolute paths. Treat them as generated per-user artifacts unless your team intentionally commits shared agent instructions. dotai-managed sections are marker-delimited, so syncing preserves user-authored content outside those markers.
399
517
 
400
518
  ```bash
401
519
  # Generate all (CLAUDE.md + .cursorrules + GEMINI.md + AGENTS.md)
@@ -405,8 +523,13 @@ dotai sync
405
523
  dotai sync --agents claude,cursor
406
524
  dotai sync --agents gemini
407
525
 
526
+ # Legacy-style full dump (roles + skill definitions inline)
527
+ dotai sync --full
528
+
408
529
  # Print primer to stdout (for piping)
409
530
  dotai primer
531
+ dotai primer --compact
532
+ dotai primer --full
410
533
  ```
411
534
 
412
535
  ### Supported Agents
@@ -414,17 +537,17 @@ dotai primer
414
537
  | Agent | Output File | Sync Command | Notes |
415
538
  |-------|-------------|--------------|-------|
416
539
  | Claude Code | `CLAUDE.md` + `.claude/skills/` | `dotai sync --agents claude` | Marker-based merging + native slash commands |
417
- | Cursor | `.cursorrules` | `dotai sync --agents cursor` | Full context inline |
540
+ | Cursor | `.cursorrules` | `dotai sync --agents cursor` | Full rules and preferences; role/skill catalog by default |
418
541
  | Gemini CLI | `GEMINI.md` | `dotai sync --agents gemini` | Auto-discovered in project root and `~/.gemini/GEMINI.md` |
419
542
  | Generic | `AGENTS.md` | `dotai sync --agents generic` | Works with Codex, Copilot, and any agent that reads it |
420
543
 
421
544
  For Claude Code, `dotai sync` also generates `.claude/skills/<trigger>/SKILL.md` files. These register as native slash commands — they appear in autocomplete and work as real `/run_*` commands with role composition support built in.
422
545
 
423
- > **Tip:** Run `dotai primer | pbcopy` to copy the full context to your clipboard for pasting into any agent's system prompt.
546
+ > **Tip:** Run `dotai primer --full | pbcopy` to copy the complete context to your clipboard for pasting into an agent's system prompt.
424
547
 
425
548
  ## Installing Skills
426
549
 
427
- Install skills from git repos or local directories. Claude-native `SKILL.md` files are auto-detected and converted to dotai format with triggers and categories inferred from the content.
550
+ Install skills from git repos or local directories. Claude-native `SKILL.md` files are auto-detected and converted to dotai format with triggers and categories inferred from the content. New installs are security-vetted before use.
428
551
 
429
552
  ```bash
430
553
  # Install from a GitHub repo — auto-detects and converts Claude-native skills
@@ -442,6 +565,15 @@ dotai install https://github.com/team/skills -p my-project
442
565
 
443
566
  After install, run `dotai sync` to make them available as slash commands in Claude Code, Gemini, etc.
444
567
 
568
+ Refresh skills that were installed from a tracked source (team conventions repo):
569
+
570
+ ```bash
571
+ dotai install --update
572
+ dotai install --update -s mvp
573
+ ```
574
+
575
+ Updates are staged and security-vetted before installation. A blocked or declined update leaves the existing skill unchanged. Multi-skill repositories refresh each recorded skill independently. `--skip-vet` is an explicit trust override and should only be used for a source you have reviewed.
576
+
445
577
  ### Converting Claude-native skills
446
578
 
447
579
  If you have a Claude-native `SKILL.md` and want to convert it manually:
@@ -535,13 +667,21 @@ dotai roles # List available roles
535
667
  dotai role <name> # Output a role's full prompt to stdout
536
668
  dotai skills [-c category] # List skills (optionally filter by category)
537
669
  dotai prompt <skill> [--role <role>] # Assemble skill + role prompt for any agent
538
- dotai sync [path] [--agents ...] # Sync ~/.ai/ into agent config files
539
- dotai primer [--project <name>] # Print full agent context to stdout
540
- dotai rules [-p project] [-a] # List rules (resolved or all)
670
+ dotai sync [path] [--agents ...] [--full] # Sync ~/.ai/ into agent config files
671
+ dotai primer [--project <name>] [--full|--compact] # Print agent context to stdout
672
+ dotai rules [-p project] [-a] [--check] # List rules (or audit quality)
541
673
  dotai toggle <rule-id> --on/--off # Enable/disable rules globally or per-project
674
+ dotai learn "title" -i "..." -c "..." # Create structured rule (default)
675
+ dotai learn "title" -i "..." -c "..." --dry-run|--sync|--force|--append-md
542
676
  dotai learn "title" --from-file <f> # Import structured rule from a file
543
- dotai learn "title" -i "..." -c "..." # Record an inline learning
677
+ dotai import-agent <path> [-m mode] [--dry-run] # Non-destructive agent-file migration
678
+ dotai prefs [list|show|new|pull|use|unuse|remove] # Preference / taste packs
679
+ dotai prefs new "CLI" --domain cli # Create a soft style pack
680
+ dotai prefs pull <path|url> [-n id] # Borrow / install a pack
681
+ dotai prefs use <id> [-p project|--global] # Activate pack in an explicit scope
682
+ dotai sync --with-prefs a,b # Session overlay of preference packs
544
683
  dotai install <source> [-s skill] # Install skills from git repo or local path
684
+ dotai install --update [-s skill] [--skip-vet] # Vetted refresh from recorded sources
545
685
  dotai import-plugin <source> # Import from Claude/Cursor/Gemini plugin
546
686
  dotai remove <skill> [-p project] # Remove an installed skill
547
687
  dotai convert <path> [--dry-run] # Convert Claude-native SKILL.md to dotai format
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "dotai-cli"
7
- version = "0.2.0"
7
+ version = "0.3.0"
8
8
  description = "Universal AI context for any coding agent. Roles, skills, and rules in ~/.ai/"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -26,7 +26,7 @@ dependencies = [
26
26
  "typer>=0.9",
27
27
  "rich>=13.0",
28
28
  "watchdog>=4.0",
29
- "ai-skill-audit>=0.4.0",
29
+ "ai-skill-audit>=0.5.1",
30
30
  ]
31
31
 
32
32
  [project.urls]
@@ -45,3 +45,4 @@ packages = ["src/dotai"]
45
45
 
46
46
  [tool.pytest.ini_options]
47
47
  testpaths = ["tests"]
48
+ pythonpath = ["src"]
@@ -0,0 +1,8 @@
1
+ name: dotai
2
+ description: Universal AI context for any coding agent. Defines a universal `~/.ai/`
3
+ directory convention that any tool can consume for roles, skills, and rules.
4
+ type: backend
5
+ stack:
6
+ backend: none
7
+ frontend: none
8
+ features: []
@@ -1,3 +1,3 @@
1
1
  """dotai — Universal AI context for any coding agent."""
2
2
 
3
- __version__ = "0.2.0"
3
+ __version__ = "0.3.0"