dotai-cli 0.4.0__tar.gz → 0.6.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 (85) hide show
  1. dotai_cli-0.6.0/CHANGELOG.md +34 -0
  2. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/PKG-INFO +216 -154
  3. dotai_cli-0.6.0/PRODUCT.md +93 -0
  4. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/README.md +214 -151
  5. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/pyproject.toml +2 -3
  6. dotai_cli-0.6.0/src/dotai/__init__.py +3 -0
  7. dotai_cli-0.6.0/src/dotai/agents.py +156 -0
  8. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/cli/__init__.py +25 -11
  9. dotai_cli-0.6.0/src/dotai/cli/agents_cmd.py +108 -0
  10. dotai_cli-0.6.0/src/dotai/cli/insights_cmd.py +85 -0
  11. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/cli/prefs_cmd.py +5 -3
  12. dotai_cli-0.6.0/src/dotai/cli/roles_cmd.py +30 -0
  13. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/cli/rules_cmd.py +44 -42
  14. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/cli/skills_cmd.py +5 -129
  15. dotai_cli-0.6.0/src/dotai/cli/sync_cmd.py +201 -0
  16. dotai_cli-0.6.0/src/dotai/context.py +378 -0
  17. dotai_cli-0.6.0/src/dotai/insights.py +194 -0
  18. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/models.py +0 -113
  19. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/roles.py +1 -25
  20. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/rules.py +60 -25
  21. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/skills/learn.md +10 -9
  22. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/skills.py +1 -33
  23. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/store.py +2 -22
  24. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/sync.py +216 -57
  25. dotai_cli-0.6.0/tests/test_agents.py +110 -0
  26. dotai_cli-0.6.0/tests/test_context.py +185 -0
  27. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/tests/test_import_agent.py +26 -0
  28. dotai_cli-0.6.0/tests/test_insights.py +73 -0
  29. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/tests/test_models.py +0 -52
  30. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/tests/test_store.py +1 -31
  31. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/tests/test_sync.py +126 -0
  32. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/uv.lock +1 -30
  33. dotai_cli-0.4.0/src/dotai/__init__.py +0 -3
  34. dotai_cli-0.4.0/src/dotai/cli/roles_cmd.py +0 -62
  35. dotai_cli-0.4.0/src/dotai/cli/sync_cmd.py +0 -211
  36. dotai_cli-0.4.0/src/dotai/cli/watch_cmd.py +0 -106
  37. dotai_cli-0.4.0/src/dotai/indexer.py +0 -201
  38. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/.github/workflows/ci.yml +0 -0
  39. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/.github/workflows/publish.yml +0 -0
  40. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/.gitignore +0 -0
  41. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/LICENSE +0 -0
  42. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/rdc.yaml +0 -0
  43. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/__main__.py +0 -0
  44. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/cli/__main__.py +0 -0
  45. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/converter.py +0 -0
  46. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/import_agent.py +0 -0
  47. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/maintenance.py +0 -0
  48. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/preferences.py +0 -0
  49. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/roles/architect.md +0 -0
  50. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/roles/debugger.md +0 -0
  51. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/roles/founder.md +0 -0
  52. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/roles/mentor.md +0 -0
  53. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/roles/product-manager.md +0 -0
  54. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/roles/qa.md +0 -0
  55. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/roles/reviewer.md +0 -0
  56. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/roles/security.md +0 -0
  57. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/roles/ship.md +0 -0
  58. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/roles/writer.md +0 -0
  59. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/skills/careful.md +0 -0
  60. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/skills/commit-helper.md +0 -0
  61. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/skills/compress.md +0 -0
  62. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/skills/context-dump.md +0 -0
  63. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/skills/investigate.md +0 -0
  64. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/skills/parallel-work.md +0 -0
  65. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/skills/plan.md +0 -0
  66. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/skills/review.md +0 -0
  67. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/skills/scaffold.md +0 -0
  68. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/skills/ship.md +0 -0
  69. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/skills/techdebt.md +0 -0
  70. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/seed/skills/verify.md +0 -0
  71. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/tools/__init__.py +0 -0
  72. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/tools/base.py +0 -0
  73. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/tools/registry.py +0 -0
  74. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/utils.py +0 -0
  75. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/src/dotai/vet.py +0 -0
  76. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/tests/__init__.py +0 -0
  77. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/tests/conftest.py +0 -0
  78. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/tests/test_converter.py +0 -0
  79. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/tests/test_maintenance.py +0 -0
  80. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/tests/test_preferences.py +0 -0
  81. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/tests/test_roles.py +0 -0
  82. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/tests/test_rules.py +0 -0
  83. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/tests/test_skills.py +0 -0
  84. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/tests/test_utils.py +0 -0
  85. {dotai_cli-0.4.0 → dotai_cli-0.6.0}/tests/test_vet.py +0 -0
@@ -0,0 +1,34 @@
1
+ # Changelog
2
+
3
+ ## 0.6.0 — 2026-07-17
4
+
5
+ ### Added
6
+
7
+ - `dotai learn --directive` for proactive engineering standards, taste, and
8
+ guardrails without requiring a prior mistake.
9
+ - `dotai insights` for deterministic local delivery evidence: resolution health,
10
+ selection counts, last use, rule-summary exposure, and unused knowledge.
11
+ - Bounded metadata-only receipt history, retaining the latest 500 resolutions
12
+ per agent.
13
+ - `PRODUCT.md` defining dotai as portable engineering judgment for coding agents.
14
+
15
+ ### Changed
16
+
17
+ - Repositioned the CLI and documentation around developer-controlled engineering
18
+ judgment rather than universal context.
19
+ - `dotai sync` now has one repository-safe behavior: local context outside the
20
+ worktree.
21
+ - `dotai primer` now always emits the compact bootstrap.
22
+ - `dotai search` reads live knowledge instead of a cached index.
23
+ - `dotai install` is the single entry point for supported external skill formats.
24
+
25
+ ### Removed
26
+
27
+ - Commands: `watch`, `detach`, `index`, `tree`, `prompt`, `role`, `convert`, and
28
+ `import-plugin`.
29
+ - Shared/full/agent-specific sync controls and primer session overlays.
30
+ - Freeform `dotai learn --append-md` capture.
31
+ - The cached knowledge-tree model and `watchdog` dependency.
32
+
33
+ This release intentionally breaks pre-1.0 CLI compatibility to keep one clear,
34
+ local-first product path.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dotai-cli
3
- Version: 0.4.0
4
- Summary: Universal AI context for any coding agent. Roles, skills, and rules in ~/.ai/
3
+ Version: 0.6.0
4
+ Summary: Portable engineering judgment for coding agents
5
5
  Project-URL: Homepage, https://github.com/dawalama/dotai
6
6
  Project-URL: Repository, https://github.com/dawalama/dotai
7
7
  Project-URL: Issues, https://github.com/dawalama/dotai/issues
@@ -22,69 +22,89 @@ 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
25
- Requires-Dist: watchdog>=4.0
26
25
  Provides-Extra: dev
27
26
  Requires-Dist: pytest>=8.0; extra == 'dev'
28
27
  Description-Content-Type: text/markdown
29
28
 
30
29
  # dotai
31
30
 
32
- **Your coding agents should remember what you taught them.**
31
+ **Portable engineering judgment for coding agents.**
33
32
 
34
- dotai gives Claude, Cursor, Gemini, Codex, and other coding agents one shared memory for how you build software. Keep your rules, workflows, and engineering taste in `~/.ai/`; sync them into any project with one command.
33
+ dotai teaches Claude, Cursor, Gemini, Codex, and other coding agents how you build software. Keep your standards, workflows, guardrails, and engineering taste in `~/.ai/`; dotai applies only the judgment each task needs without taking ownership of team files.
35
34
 
36
35
  ```text
37
- ┌─ CLAUDE.md + native slash commands
38
- ~/.ai/ ── dotai sync ───┼─ .cursorrules
39
- ├─ GEMINI.md
40
- └─ AGENTS.md
36
+ ~/.ai/ ── dotai context ── relevant rules + skill + role + preferences
37
+ │
38
+ └──── dotai sync ────── local context cache (outside Git repositories)
41
39
  ```
42
40
 
43
- No server. No account. No proprietary memory layer. Just portable Markdown that you own.
41
+ Teach it once. Apply it when relevant. Know what influenced the agent. No server, account, or proprietary memory layer—just portable Markdown that you own.
44
42
 
45
- ## Stop reteaching every agent
43
+ ## The short version
46
44
 
47
- You tell one agent “never call `useEffect` directly.” Next week, a different agent does exactly that. Your review checklist lives in one tool, your deployment workflow in another, and the correction you made yesterday disappears with the chat.
45
+ | You want to… | Use |
46
+ |---|---|
47
+ | Teach agents a standard, taste, or guardrail | `dotai learn --directive` |
48
+ | Use dotai automatically in Claude Code | `dotai agent setup claude --apply` |
49
+ | See what Claude actually loaded | `dotai agent last claude` |
50
+ | Resolve context manually or from automation | `dotai context` |
51
+ | Prepare a safe per-repository cache | `dotai sync` |
48
52
 
49
- dotai turns those corrections into durable, reusable context:
53
+ The default is personal and repository-safe. Team instructions stay authoritative.
50
54
 
51
- - **Rules are hard constraints.** Capture coding standards and scope them by project or file pattern.
55
+ ## Make every agent work like yours
56
+
57
+ You prefer derived state over synchronization effects. You reproduce bugs before fixing them. You never allow credentials in logs. These are different kinds of judgment, but they all shape how you build software—and they should not disappear when you change agents.
58
+
59
+ dotai turns that judgment into durable, reusable instructions:
60
+
61
+ - **Rules codify decisions.** Capture standards, architectural taste, safety boundaries, and compliance requirements; scope them by project or file pattern.
52
62
  - **Skills are repeatable workflows.** Plan, investigate, review, verify, and ship the same way every time.
53
63
  - **Roles change how the agent thinks.** Review as a security engineer; plan as a product manager.
54
64
  - **Preference packs carry your taste.** Share softer choices without weakening hard rules.
55
- - **Sync speaks each agent's language.** Generate the bootstrap file that Claude, Cursor, Gemini, or Codex already understands.
65
+ - **Adapters fit normal workflows.** Configure an agent once, then ask naturally while dotai resolves context behind the scenes.
56
66
 
57
- The useful part is the feedback loop:
67
+ Rules can be proactive or learned from a correction:
58
68
 
59
69
  ```text
60
- agent makes a mistake → capture the correction → sync → every agent learns it
70
+ teach a standard ───────────────┐
71
+ ├─→ approve → resolve when relevant → verify what loaded
72
+ correct an agent → keep lesson ┘
61
73
  ```
62
74
 
75
+ dotai is deliberately not an autonomous history of every conversation. It is the small, developer-approved part of memory important enough to be explicit, portable, scoped, and auditable.
76
+
63
77
  ## See it in action
64
78
 
65
79
  ```bash
66
80
  # Set up your global knowledge base
67
81
  dotai init
68
82
 
69
- # Teach every agent a correction you never want to repeat
70
- dotai learn "no-print-debugging" \
71
- --issue "Debug output was left in production code" \
72
- --correction "Use structured logging and remove temporary debug output" \
73
- --globs "*.py"
83
+ # Teach every agent an engineering preference
84
+ dotai learn "no-useeffect" \
85
+ --directive "Never call useEffect directly; prefer declarative alternatives" \
86
+ --globs "*.tsx,*.ts" \
87
+ --tags "react,taste"
74
88
 
75
- # Bring that knowledge into a project
89
+ # Prepare that knowledge for the current project
76
90
  cd ~/my-project
77
91
  dotai sync
78
92
  ```
79
93
 
80
- Now the rule is available to every supported agent, alongside reusable commands such as:
94
+ For automatic delivery in Claude Code, configure the user-level adapter once:
95
+
96
+ ```bash
97
+ dotai agent setup claude
98
+ dotai agent setup claude --apply
99
+ ```
100
+
101
+ Then ask naturally. dotai routes unambiguous workflows and expands matching file-scoped rules:
81
102
 
82
103
  ```text
83
- /run_plan as product-manager
84
- /run_investigate as debugger
85
- /run_review as security-engineer
86
- /run_verify
87
- /run_ship
104
+ Plan this feature as a product manager.
105
+ Investigate this failure.
106
+ Review the authentication changes.
107
+ Verify the pending changes.
88
108
  ```
89
109
 
90
110
  ## Installation
@@ -121,32 +141,133 @@ dotai roles
121
141
  dotai skills
122
142
  dotai rules
123
143
 
124
- # Sync agent bootstrap files into a project
144
+ # Prepare agent context for a project
125
145
  cd ~/my-project
126
146
  dotai sync
127
147
  ```
128
148
 
129
- 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.
149
+ `dotai sync` always writes personal context under `~/.config/dotai/contexts/` and leaves team-owned files such as `CLAUDE.md`, `AGENTS.md`, and `.claude/skills/` untouched. Existing repository instructions are copied into the local context as the authoritative layer; personal dotai rules and preferences are explicitly supplemental.
150
+
151
+ Local context storage does not, by itself, make an agent load the context. Until an agent adapter is configured, use `dotai primer --path .` to print a compact bootstrap for pasting or piping into your agent.
152
+
153
+ dotai uses progressive disclosure to keep prompts small. Synced context contains rule summaries and role/skill catalogs. Expand only what a task needs:
154
+
155
+ ```bash
156
+ # Expand rules matching the affected files
157
+ dotai context --path . --files src/api.py,tests/test_api.py
158
+
159
+ # Expand security-tagged rules and an active CLI preference pack
160
+ dotai context --path . --context security --domain cli
161
+
162
+ # Load one complete skill and its declared role
163
+ dotai context --path . --skill run_review
164
+ ```
165
+
166
+ Selection is deterministic: file globs, explicit context tags, active preference domains, and named skills or roles. dotai does not guess from semantic similarity. Every expanded item includes the reason it was selected.
167
+
168
+ ### Automatic delivery with Claude Code
169
+
170
+ The resolver is infrastructure; you should not have to type `dotai context`
171
+ during normal work. Install dotai's user-level Claude adapter once:
172
+
173
+ ```bash
174
+ # Preview the user-memory change
175
+ dotai agent setup claude
176
+
177
+ # Back up existing memory and install it
178
+ dotai agent setup claude --apply
179
+
180
+ # Confirm activation
181
+ dotai agent status claude
182
+
183
+ # See the most recent context Claude actually resolved
184
+ dotai agent last claude
185
+ ```
186
+
187
+ The adapter adds a small marker-managed block to `~/.claude/CLAUDE.md`, which
188
+ Claude Code loads as user memory across projects. It tells Claude to resolve
189
+ dotai context for substantial development work, after affected files are known,
190
+ and to avoid repeated calls when the task has not changed. Repository and
191
+ organization instructions remain authoritative.
192
+
193
+ For file-sensitive workflows such as review, debugging, verification, scaffolding,
194
+ maintenance, and release work, a resolution without `--files` is explicitly
195
+ marked provisional. Claude must resolve again after discovering the affected
196
+ files. `dotai agent last claude` reports whether the latest resolution is
197
+ `provisional` or `complete`.
198
+
199
+ The adapter does not modify repositories, install a persistent process, or use
200
+ MCP. Existing personal Claude instructions are preserved. To remove only
201
+ dotai's block:
202
+
203
+ ```bash
204
+ dotai agent remove claude
205
+ dotai agent remove claude --apply
206
+ ```
207
+
208
+ Setup and removal preview by default. Applied changes back up the prior Claude
209
+ memory under `~/.config/dotai/backups/agents/claude/`.
210
+
211
+ `dotai agent last claude` reads a local receipt written only when the Claude
212
+ adapter invokes the resolver. It reports selection metadata and reasons, but
213
+ never stores source contents, expanded prompts, credentials, or telemetry.
214
+
215
+ ### Understanding what dotai delivered
216
+
217
+ `dotai insights` aggregates local resolution receipts so you can see whether
218
+ your engineering judgment is actually being selected:
219
+
220
+ ```bash
221
+ dotai insights
222
+ dotai insights --agent claude
223
+ dotai insights --project my-app
224
+ dotai insights --json
225
+ ```
226
+
227
+ The report shows complete versus provisional resolutions, selection counts,
228
+ last-selected timestamps, universal rule-summary exposure, and enabled items
229
+ that have never been selected in the current window. Selection proves delivery,
230
+ not compliance: dotai cannot claim that an agent followed an instruction merely
231
+ because it received it.
232
+
233
+ History contains metadata only and is stored under
234
+ `~/.config/dotai/receipts/history/`. It never includes expanded bodies, prompts,
235
+ source contents, or credentials. History is bounded to the latest 500 receipts
236
+ per agent and never leaves the machine.
237
+
238
+ If no receipt appears, refresh the adapter and start a new Claude Code session:
239
+
240
+ ```bash
241
+ dotai agent setup claude --apply
242
+ dotai agent status claude
243
+ ```
244
+
245
+ Setup pins the dotai executable used to install the adapter, avoiding an older
246
+ `dotai` elsewhere on `PATH`. Receipt persistence is best-effort: if its local
247
+ directory is unavailable, Claude still receives resolved context and dotai emits
248
+ a warning instead of blocking the task.
130
249
 
131
250
  ## Usage
132
251
 
133
252
  ### Daily workflow
134
253
 
135
254
  ```bash
136
- # Start of day: sync your knowledge into the project you're working on
255
+ # Start of day: refresh local context for the project you're working on
137
256
  cd ~/my-project
138
257
  dotai sync
139
258
 
140
- # Or leave it running — auto-resyncs when you edit ~/.ai/ files
141
- dotai watch
142
-
143
- # Now open your editor — Claude Code, Cursor, Gemini, etc.
144
- # Your roles, skills, and rules are already loaded.
259
+ # Print the context for an agent that does not yet have a dotai adapter
260
+ dotai primer --path .
145
261
  ```
146
262
 
263
+ With the Claude adapter installed, daily use is simpler: open Claude Code and
264
+ ask for the work normally. Claude invokes the pinned dotai executable, resolves
265
+ the workflow, and resolves again with affected files when file-scoped rules may
266
+ apply. Use `dotai agent last claude` whenever you want to verify delivery.
267
+
147
268
  ### Using skills in Claude Code
148
269
 
149
- After `dotai sync`, skills appear as native slash commands:
270
+ Natural-language routing is recommended with the personal adapter:
150
271
 
151
272
  ```
152
273
  > /run_plan # Plan before coding
@@ -164,31 +285,32 @@ After `dotai sync`, skills appear as native slash commands:
164
285
 
165
286
  ### Using skills outside Claude Code
166
287
 
167
- Assemble a skill prompt and pipe it into any tool:
288
+ Resolve a skill and its role through the same context engine used by adapters:
168
289
 
169
290
  ```bash
170
- # Copy a skill prompt to clipboard
171
- dotai prompt review --role paranoid-reviewer | pbcopy
172
-
173
- # Save to a file
174
- dotai prompt ship > /tmp/ship-prompt.md
291
+ dotai context --path . --skill run_review --role paranoid-reviewer
175
292
 
176
293
  # List skills filtered by category
177
294
  dotai skills --category deployment
178
295
  ```
179
296
 
180
- ### Recording what you learn
297
+ ### Teaching your engineering judgment
181
298
 
182
- `dotai learn` creates a **structured rule file** in `~/.ai/rules/` by default (not a freeform journal scrap).
299
+ `dotai learn` creates a **structured rule file** in `~/.ai/rules/` by default. Use a directive for a standard you already hold; use an issue and correction when an agent interaction teaches you something new.
183
300
 
184
301
  ```bash
302
+ # Proactively encode engineering taste or a guardrail
303
+ dotai learn "no-useeffect" \
304
+ --directive "Never call useEffect directly; prefer declarative alternatives" \
305
+ --globs "*.tsx,*.ts"
306
+
185
307
  # Preview the rule without writing
186
308
  dotai learn "auth-header" \
187
309
  --issue "Forgot Bearer prefix on API token" \
188
310
  --correction "Always prepend 'Bearer ' to auth tokens" \
189
311
  --dry-run
190
312
 
191
- # Save structured rule + resync agent configs
313
+ # Save a structured rule and refresh local context
192
314
  dotai learn "auth-header" \
193
315
  -i "Forgot Bearer prefix on API token" \
194
316
  -c "Always prepend 'Bearer ' to auth tokens" \
@@ -197,11 +319,8 @@ dotai learn "auth-header" \
197
319
  # Import a detailed rule from a file
198
320
  dotai learn "no-useEffect" --from-file react-rules.md --globs "*.tsx,*.ts"
199
321
 
200
- # Freeform journal entry in rules.md (opt-in)
201
- dotai learn "note" -i "..." -c "..." --append-md
202
-
203
- # Or let the agent do it — /run_learn reviews the session and proposes a rule
204
- > /run_learn
322
+ # Or ask an adapted agent naturally
323
+ > Capture what we learned as a rule.
205
324
 
206
325
  # Disable a rule for one legacy project
207
326
  dotai toggle no-useeffect --off --project legacy-app
@@ -210,7 +329,7 @@ dotai toggle no-useeffect --off --project legacy-app
210
329
  dotai rules --check
211
330
  ```
212
331
 
213
- The feedback loop: **vibe-code → agent makes mistake → `/run_learn` → structured rule → `dotai sync` → agent never repeats it.**
332
+ The loop: **teach or correct → review the structured rule → dotai resolves it for the next matching task → inspect what loaded.**
214
333
 
215
334
  ### Keeping rules healthy
216
335
 
@@ -234,14 +353,14 @@ The report includes stable finding codes, evidence, suggested actions, an estima
234
353
  # Inspect candidates
235
354
  dotai compress
236
355
 
237
- # Ask the current coding agent to draft, diff, and review changes
238
- > /run_compress
356
+ # Ask an adapted coding agent to use the compression workflow
357
+ > Compress and audit my dotai rules.
239
358
 
240
359
  # Low-level application boundary for an approved versioned proposal
241
360
  dotai compress apply proposal.json
242
361
  ```
243
362
 
244
- `/run_compress` reads the JSON plan, drafts shorter complete rules, explains what it preserved and consolidated, shows the full diff in conversation, and asks `Apply this compression? [y/N]`. It then passes only approved changes to dotai. Near-duplicates, generic guidance, and rules that may belong in a preference pack remain suggestions unless the developer explicitly approves a concrete proposal.
363
+ The compression skill reads the JSON plan, drafts shorter complete rules, explains what it preserved and consolidated, shows the full diff in conversation, and asks `Apply this compression? [y/N]`. It then passes only approved changes to dotai. Near-duplicates, generic guidance, and rules that may belong in a preference pack remain suggestions unless the developer explicitly approves a concrete proposal.
245
364
 
246
365
  When no exact duplicates exist, compression says there are no **safe automatic** savings while still listing semantic review candidates and their estimated savings. These estimates are directional—they help prioritize review. The CLI never invents a semantic rewrite or calls an external provider.
247
366
 
@@ -288,10 +407,6 @@ dotai prefs pull ./design-eng-taste.md --name design-eng --domain design
288
407
  dotai prefs pull https://github.com/org/taste-packs -n cli
289
408
  dotai prefs use design-eng
290
409
 
291
- # Session overlay without changing active list
292
- dotai sync --with-prefs design-eng,cli
293
- dotai primer --with-prefs design-eng
294
-
295
410
  # List / show / deactivate
296
411
  dotai prefs
297
412
  dotai prefs show cli-conventions
@@ -443,7 +558,7 @@ All skill triggers use the `run_` prefix to avoid collisions with built-in agent
443
558
  | Scaffold | `/run_scaffold` | Generate boilerplate from patterns |
444
559
  | Verify | `/run_verify` | Run tests, types, lint, build |
445
560
  | Plan | `/run_plan` | Structured planning before coding |
446
- | Learn | `/run_learn` | Capture mistakes as permanent rules |
561
+ | Learn | `/run_learn` | Capture engineering judgment as structured rules |
447
562
 
448
563
  ### Skill Format
449
564
 
@@ -534,7 +649,8 @@ Skills reference roles by ID — when a skill runs, the role's full persona is i
534
649
 
535
650
  ### Composing Skills with Roles
536
651
 
537
- Skills and roles can be composed inline. Pass `as <role>` to run any skill with a specific persona:
652
+ Ask for a perspective naturally through an adapter, or resolve it explicitly
653
+ with `dotai context --skill <skill> --role <role>`.
538
654
 
539
655
  ```
540
656
  /run_plan as product-manager # Scope a feature with acceptance criteria
@@ -546,12 +662,7 @@ Skills and roles can be composed inline. Pass `as <role>` to run any skill with
546
662
  /run_review # Uses the skill's default role, or none
547
663
  ```
548
664
 
549
- From the CLI:
550
-
551
- ```bash
552
- dotai prompt review --role paranoid-reviewer | pbcopy
553
- dotai prompt review --role qa > /tmp/prompt.md
554
- ```
665
+ The resolver expands the role and skill together and records why each was selected.
555
666
 
556
667
  ## Rules
557
668
 
@@ -601,50 +712,36 @@ dotai toggle no-useeffect --off --project my-legacy-app
601
712
  dotai toggle no-useeffect --on
602
713
  ```
603
714
 
604
- 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`.
715
+ Synced local context contains a compact bootstrap: universal rule summaries plus preference, role, and skill catalogs. Use `dotai context` to expand relevant material on demand.
605
716
 
606
717
  ## Agent Sync
607
718
 
608
- `dotai sync` generates tool-specific bootstrap files with:
609
-
610
- - **Full structured rule bodies** (high-value constraints)
611
- - **Freeform `rules.md` conventions** (previously referenced but not inlined)
612
- - **Role and skill catalogs** (names, triggers, descriptions — not every skill novel)
613
- - **Claude Code**: compact pointers + native `.claude/skills/` slash commands
719
+ `dotai sync` prepares repository-safe local context with:
614
720
 
615
- Use `--full` only when you need every role persona and skill definition dumped inline (larger context).
616
-
617
- 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.
721
+ - **Universal structured rule summaries** (always visible)
722
+ - **Pointers to freeform `rules.md` conventions**
723
+ - **Role and skill catalogs** (names, triggers, categories — not full workflows)
724
+ Context is always written outside the worktree. Team instructions take precedence over personal dotai rules and preferences. dotai does not attempt unreliable keyword-based conflict resolution; the generated context tells the agent to ignore conflicting personal guidance and ask when a disagreement is ambiguous.
618
725
 
619
726
  ```bash
620
- # Generate all (CLAUDE.md + .cursorrules + GEMINI.md + AGENTS.md)
727
+ # Generate outside the repository
621
728
  dotai sync
622
729
 
623
- # Generate for specific agents
624
- dotai sync --agents claude,cursor
625
- dotai sync --agents gemini
626
-
627
- # Legacy-style full dump (roles + skill definitions inline)
628
- dotai sync --full
730
+ # Preview the resolved mode and target without writing
731
+ dotai sync --check
629
732
 
630
733
  # Print primer to stdout (for piping)
631
734
  dotai primer
632
- dotai primer --compact
633
- dotai primer --full
634
- ```
635
-
636
- ### Supported Agents
637
-
638
- | Agent | Output File | Sync Command | Notes |
639
- |-------|-------------|--------------|-------|
640
- | Claude Code | `CLAUDE.md` + `.claude/skills/` | `dotai sync --agents claude` | Marker-based merging + native slash commands |
641
- | Cursor | `.cursorrules` | `dotai sync --agents cursor` | Full rules and preferences; role/skill catalog by default |
642
- | Gemini CLI | `GEMINI.md` | `dotai sync --agents gemini` | Auto-discovered in project root and `~/.gemini/GEMINI.md` |
643
- | Generic | `AGENTS.md` | `dotai sync --agents generic` | Works with Codex, Copilot, and any agent that reads it |
735
+ dotai primer --path .
644
736
 
645
- 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.
737
+ # Resolve task-specific context on demand
738
+ dotai context --path . --files src/app.tsx --context security
739
+ dotai context --path . --skill run_review
740
+ ```
646
741
 
647
- > **Tip:** Run `dotai primer --full | pbcopy` to copy the complete context to your clipboard for pasting into an agent's system prompt.
742
+ Use an agent adapter for automatic delivery. For an agent without an adapter,
743
+ paste or pipe `dotai primer --path .`, then use `dotai context` for task-specific
744
+ expansion.
648
745
 
649
746
  ## Installing Skills
650
747
 
@@ -664,7 +761,8 @@ dotai install ~/my-skills/review
664
761
  dotai install https://github.com/team/skills -p my-project
665
762
  ```
666
763
 
667
- After install, run `dotai sync` to make them available as slash commands in Claude Code, Gemini, etc.
764
+ Installed skills are immediately available to `dotai context` and configured
765
+ agent adapters.
668
766
 
669
767
  Refresh skills that were installed from a tracked source (team conventions repo):
670
768
 
@@ -675,49 +773,17 @@ dotai install --update -s mvp
675
773
 
676
774
  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.
677
775
 
678
- ### Converting Claude-native skills
679
-
680
- If you have a Claude-native `SKILL.md` and want to convert it manually:
681
-
682
- ```bash
683
- # Preview what would be converted
684
- dotai convert /path/to/SKILL.md --dry-run
685
-
686
- # Convert to global skills
687
- dotai convert /path/to/SKILL.md
688
-
689
- # Convert to a specific project
690
- dotai convert /path/to/SKILL.md -p my-project
776
+ ### Installing other skill formats
691
777
 
692
- # Convert to a custom directory
693
- dotai convert /path/to/skill-dir/ -o ~/my-skills/
694
- ```
695
-
696
- The converter maps Claude-native fields (`compatibility`, `license`) to dotai format, auto-generates a `/run_*` trigger, and infers a category from the skill's name and description.
697
-
698
- ### Importing from plugin ecosystems
699
-
700
- dotai can import skills from **Claude plugins**, **Cursor plugins**, and **Gemini extensions** — converting them into universal dotai format so they work across all tools.
778
+ `dotai install` detects dotai skills, Claude-native `SKILL.md` files, Claude
779
+ plugins, Cursor plugins, and Gemini extensions. Supported skills and commands
780
+ are converted automatically:
701
781
 
702
782
  ```bash
703
- # Import from a Claude Code plugin
704
- dotai import-plugin /path/to/claude-plugin/
705
- dotai import-plugin https://github.com/user/claude-plugin
706
-
707
- # Import from a Cursor plugin
708
- dotai import-plugin /path/to/cursor-plugin/
709
-
710
- # Import from a Gemini CLI extension
711
- dotai import-plugin /path/to/gemini-extension/
712
-
713
- # Import only a specific skill from a plugin
714
- dotai import-plugin /path/to/plugin/ -s review-code
715
-
716
- # Also convert agents to dotai roles
717
- dotai import-plugin /path/to/plugin/ --include-agents
718
-
719
- # Also convert Cursor .mdc rules to dotai rules
720
- dotai import-plugin /path/to/cursor-plugin/ --include-rules
783
+ dotai install /path/to/SKILL.md
784
+ dotai install /path/to/claude-plugin/
785
+ dotai install /path/to/cursor-plugin/
786
+ dotai install /path/to/gemini-extension/
721
787
  ```
722
788
 
723
789
  Supported plugin formats:
@@ -725,7 +791,7 @@ Supported plugin formats:
725
791
  - **Cursor plugins** — directories with `.cursor-plugin/plugin.json`
726
792
  - **Gemini extensions** — directories with `gemini-extension.json`
727
793
 
728
- The importer discovers skills, commands, agents, and rules within the plugin and converts each to dotai format. Hooks and MCP server configs are noted but not converted (they're tool-specific).
794
+ Hooks and MCP server configurations remain tool-specific and are not installed.
729
795
 
730
796
  ### Removing skills
731
797
 
@@ -765,35 +831,31 @@ dotai new-skill "Deploy" -t /run_deploy -c deployment --folder
765
831
  ```bash
766
832
  dotai init [project-path] # Initialize ~/.ai/ or project .ai/
767
833
  dotai roles # List available roles
768
- dotai role <name> # Output a role's full prompt to stdout
769
834
  dotai skills [-c category] # List skills (optionally filter by category)
770
- dotai prompt <skill> [--role <role>] # Assemble skill + role prompt for any agent
771
- dotai sync [path] [--agents ...] [--full] # Sync ~/.ai/ into agent config files
772
- dotai primer [--project <name>] [--full|--compact] # Print agent context to stdout
835
+ dotai sync [path] [--check] # Refresh safe local context
836
+ dotai agent setup|status|last|remove claude [--apply] # User-level Claude delivery
837
+ dotai insights [--agent name] [-p project] [--json] # Local delivery evidence
838
+ dotai primer [--project <name>|--path <path>] # Compact generic bootstrap
839
+ dotai context --path <path> [--task ...] [--files ...] [--context ...] [--domain ...] [--skill ...]
773
840
  dotai rules [-p project] [-a] [--check] # List rules (or audit quality)
774
841
  dotai audit [-p project] [--json] [--fail-on severity] # Read-only rule audit
775
842
  dotai compress [-p project] [--json] # Plan compression candidates
776
843
  dotai compress apply <proposal.json> [--yes] # Validate, back up, and apply proposals
777
844
  dotai toggle <rule-id> --on/--off # Enable/disable rules globally or per-project
778
- dotai learn "title" -i "..." -c "..." # Create structured rule (default)
779
- dotai learn "title" -i "..." -c "..." --dry-run|--sync|--force|--append-md
845
+ dotai learn "title" --directive "..." # Teach a standard, taste, or guardrail
846
+ dotai learn "title" -i "..." -c "..." # Preserve a correction as a rule
847
+ dotai learn "title" -i "..." -c "..." --dry-run|--sync|--force
780
848
  dotai learn "title" --from-file <f> # Import structured rule from a file
781
849
  dotai import-agent <path> [-m mode] [--dry-run] # Non-destructive agent-file migration
782
850
  dotai prefs [list|show|new|pull|use|unuse|remove] # Preference / taste packs
783
851
  dotai prefs new "CLI" --domain cli # Create a soft style pack
784
852
  dotai prefs pull <path|url> [-n id] # Borrow / install a pack
785
853
  dotai prefs use <id> [-p project|--global] # Activate pack in an explicit scope
786
- dotai sync --with-prefs a,b # Session overlay of preference packs
787
854
  dotai install <source> [-s skill] # Install skills from git repo or local path
788
855
  dotai install --update [-s skill] [--skip-vet] # Vetted refresh from recorded sources
789
- dotai import-plugin <source> # Import from Claude/Cursor/Gemini plugin
790
856
  dotai remove <skill> [-p project] # Remove an installed skill
791
- dotai convert <path> [--dry-run] # Convert Claude-native SKILL.md to dotai format
792
857
  dotai new-skill <name> [-t trigger] # Create a new skill from template
793
- dotai watch [path] [--agents ...] # Auto-resync on ~/.ai/ changes
794
- dotai search "query" [--type t] [--tag] # Search knowledge index
795
- dotai index [--refresh] # Build/show knowledge index
796
- dotai tree # Show knowledge tree
858
+ dotai search "query" [--type t] [--tag] # Search live knowledge
797
859
  ```
798
860
 
799
861
  ## Philosophy