loadouts 0.1.11

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 (261) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +108 -0
  3. package/bundled/loadouts/loadouts.yaml +5 -0
  4. package/bundled/skills/loadout-usage/SKILL.md +110 -0
  5. package/dist/builtins/index.d.ts +14 -0
  6. package/dist/builtins/index.d.ts.map +1 -0
  7. package/dist/builtins/index.js +58 -0
  8. package/dist/builtins/index.js.map +1 -0
  9. package/dist/builtins/kinds/extension.d.ts +3 -0
  10. package/dist/builtins/kinds/extension.d.ts.map +1 -0
  11. package/dist/builtins/kinds/extension.js +9 -0
  12. package/dist/builtins/kinds/extension.js.map +1 -0
  13. package/dist/builtins/kinds/instruction.d.ts +3 -0
  14. package/dist/builtins/kinds/instruction.d.ts.map +1 -0
  15. package/dist/builtins/kinds/instruction.js +8 -0
  16. package/dist/builtins/kinds/instruction.js.map +1 -0
  17. package/dist/builtins/kinds/prompt.d.ts +3 -0
  18. package/dist/builtins/kinds/prompt.d.ts.map +1 -0
  19. package/dist/builtins/kinds/prompt.js +8 -0
  20. package/dist/builtins/kinds/prompt.js.map +1 -0
  21. package/dist/builtins/kinds/rule.d.ts +3 -0
  22. package/dist/builtins/kinds/rule.d.ts.map +1 -0
  23. package/dist/builtins/kinds/rule.js +10 -0
  24. package/dist/builtins/kinds/rule.js.map +1 -0
  25. package/dist/builtins/kinds/skill.d.ts +3 -0
  26. package/dist/builtins/kinds/skill.d.ts.map +1 -0
  27. package/dist/builtins/kinds/skill.js +8 -0
  28. package/dist/builtins/kinds/skill.js.map +1 -0
  29. package/dist/builtins/kinds/theme.d.ts +3 -0
  30. package/dist/builtins/kinds/theme.d.ts.map +1 -0
  31. package/dist/builtins/kinds/theme.js +8 -0
  32. package/dist/builtins/kinds/theme.js.map +1 -0
  33. package/dist/builtins/tools/claude-code.d.ts +3 -0
  34. package/dist/builtins/tools/claude-code.d.ts.map +1 -0
  35. package/dist/builtins/tools/claude-code.js +30 -0
  36. package/dist/builtins/tools/claude-code.js.map +1 -0
  37. package/dist/builtins/tools/codex.d.ts +3 -0
  38. package/dist/builtins/tools/codex.d.ts.map +1 -0
  39. package/dist/builtins/tools/codex.js +17 -0
  40. package/dist/builtins/tools/codex.js.map +1 -0
  41. package/dist/builtins/tools/cursor.d.ts +3 -0
  42. package/dist/builtins/tools/cursor.d.ts.map +1 -0
  43. package/dist/builtins/tools/cursor.js +22 -0
  44. package/dist/builtins/tools/cursor.js.map +1 -0
  45. package/dist/builtins/tools/opencode.d.ts +3 -0
  46. package/dist/builtins/tools/opencode.d.ts.map +1 -0
  47. package/dist/builtins/tools/opencode.js +45 -0
  48. package/dist/builtins/tools/opencode.js.map +1 -0
  49. package/dist/builtins/tools/pi.d.ts +3 -0
  50. package/dist/builtins/tools/pi.d.ts.map +1 -0
  51. package/dist/builtins/tools/pi.js +22 -0
  52. package/dist/builtins/tools/pi.js.map +1 -0
  53. package/dist/cli/commands/activate.d.ts +12 -0
  54. package/dist/cli/commands/activate.d.ts.map +1 -0
  55. package/dist/cli/commands/activate.js +70 -0
  56. package/dist/cli/commands/activate.js.map +1 -0
  57. package/dist/cli/commands/check.d.ts +12 -0
  58. package/dist/cli/commands/check.d.ts.map +1 -0
  59. package/dist/cli/commands/check.js +152 -0
  60. package/dist/cli/commands/check.js.map +1 -0
  61. package/dist/cli/commands/clear.d.ts +12 -0
  62. package/dist/cli/commands/clear.d.ts.map +1 -0
  63. package/dist/cli/commands/clear.js +25 -0
  64. package/dist/cli/commands/clear.js.map +1 -0
  65. package/dist/cli/commands/create.d.ts +11 -0
  66. package/dist/cli/commands/create.d.ts.map +1 -0
  67. package/dist/cli/commands/create.js +113 -0
  68. package/dist/cli/commands/create.js.map +1 -0
  69. package/dist/cli/commands/deactivate.d.ts +12 -0
  70. package/dist/cli/commands/deactivate.d.ts.map +1 -0
  71. package/dist/cli/commands/deactivate.js +67 -0
  72. package/dist/cli/commands/deactivate.js.map +1 -0
  73. package/dist/cli/commands/diff.d.ts +16 -0
  74. package/dist/cli/commands/diff.d.ts.map +1 -0
  75. package/dist/cli/commands/diff.js +144 -0
  76. package/dist/cli/commands/diff.js.map +1 -0
  77. package/dist/cli/commands/docs.d.ts +12 -0
  78. package/dist/cli/commands/docs.d.ts.map +1 -0
  79. package/dist/cli/commands/docs.js +115 -0
  80. package/dist/cli/commands/docs.js.map +1 -0
  81. package/dist/cli/commands/edit.d.ts +11 -0
  82. package/dist/cli/commands/edit.d.ts.map +1 -0
  83. package/dist/cli/commands/edit.js +71 -0
  84. package/dist/cli/commands/edit.js.map +1 -0
  85. package/dist/cli/commands/fallback.d.ts +9 -0
  86. package/dist/cli/commands/fallback.d.ts.map +1 -0
  87. package/dist/cli/commands/fallback.js +35 -0
  88. package/dist/cli/commands/fallback.js.map +1 -0
  89. package/dist/cli/commands/info.d.ts +23 -0
  90. package/dist/cli/commands/info.d.ts.map +1 -0
  91. package/dist/cli/commands/info.js +314 -0
  92. package/dist/cli/commands/info.js.map +1 -0
  93. package/dist/cli/commands/init.d.ts +18 -0
  94. package/dist/cli/commands/init.d.ts.map +1 -0
  95. package/dist/cli/commands/init.js +255 -0
  96. package/dist/cli/commands/init.js.map +1 -0
  97. package/dist/cli/commands/install.d.ts +27 -0
  98. package/dist/cli/commands/install.d.ts.map +1 -0
  99. package/dist/cli/commands/install.js +586 -0
  100. package/dist/cli/commands/install.js.map +1 -0
  101. package/dist/cli/commands/instructions.d.ts +8 -0
  102. package/dist/cli/commands/instructions.d.ts.map +1 -0
  103. package/dist/cli/commands/instructions.js +218 -0
  104. package/dist/cli/commands/instructions.js.map +1 -0
  105. package/dist/cli/commands/kinds.d.ts +6 -0
  106. package/dist/cli/commands/kinds.d.ts.map +1 -0
  107. package/dist/cli/commands/kinds.js +59 -0
  108. package/dist/cli/commands/kinds.js.map +1 -0
  109. package/dist/cli/commands/list.d.ts +12 -0
  110. package/dist/cli/commands/list.d.ts.map +1 -0
  111. package/dist/cli/commands/list.js +182 -0
  112. package/dist/cli/commands/list.js.map +1 -0
  113. package/dist/cli/commands/policy.d.ts +28 -0
  114. package/dist/cli/commands/policy.d.ts.map +1 -0
  115. package/dist/cli/commands/policy.js +50 -0
  116. package/dist/cli/commands/policy.js.map +1 -0
  117. package/dist/cli/commands/remove.d.ts +24 -0
  118. package/dist/cli/commands/remove.d.ts.map +1 -0
  119. package/dist/cli/commands/remove.js +64 -0
  120. package/dist/cli/commands/remove.js.map +1 -0
  121. package/dist/cli/commands/render-engine.d.ts +36 -0
  122. package/dist/cli/commands/render-engine.d.ts.map +1 -0
  123. package/dist/cli/commands/render-engine.js +177 -0
  124. package/dist/cli/commands/render-engine.js.map +1 -0
  125. package/dist/cli/commands/rule.d.ts +11 -0
  126. package/dist/cli/commands/rule.d.ts.map +1 -0
  127. package/dist/cli/commands/rule.js +302 -0
  128. package/dist/cli/commands/rule.js.map +1 -0
  129. package/dist/cli/commands/sanitize.d.ts +14 -0
  130. package/dist/cli/commands/sanitize.d.ts.map +1 -0
  131. package/dist/cli/commands/sanitize.js +62 -0
  132. package/dist/cli/commands/sanitize.js.map +1 -0
  133. package/dist/cli/commands/skill.d.ts +11 -0
  134. package/dist/cli/commands/skill.d.ts.map +1 -0
  135. package/dist/cli/commands/skill.js +380 -0
  136. package/dist/cli/commands/skill.js.map +1 -0
  137. package/dist/cli/commands/status.d.ts +26 -0
  138. package/dist/cli/commands/status.d.ts.map +1 -0
  139. package/dist/cli/commands/status.js +454 -0
  140. package/dist/cli/commands/status.js.map +1 -0
  141. package/dist/cli/commands/sync.d.ts +14 -0
  142. package/dist/cli/commands/sync.d.ts.map +1 -0
  143. package/dist/cli/commands/sync.js +53 -0
  144. package/dist/cli/commands/sync.js.map +1 -0
  145. package/dist/cli/commands/update.d.ts +3 -0
  146. package/dist/cli/commands/update.d.ts.map +1 -0
  147. package/dist/cli/commands/update.js +48 -0
  148. package/dist/cli/commands/update.js.map +1 -0
  149. package/dist/cli/index.d.ts +11 -0
  150. package/dist/cli/index.d.ts.map +1 -0
  151. package/dist/cli/index.js +134 -0
  152. package/dist/cli/index.js.map +1 -0
  153. package/dist/core/config.d.ts +64 -0
  154. package/dist/core/config.d.ts.map +1 -0
  155. package/dist/core/config.js +166 -0
  156. package/dist/core/config.js.map +1 -0
  157. package/dist/core/discovery.d.ts +50 -0
  158. package/dist/core/discovery.d.ts.map +1 -0
  159. package/dist/core/discovery.js +249 -0
  160. package/dist/core/discovery.js.map +1 -0
  161. package/dist/core/fallback.d.ts +23 -0
  162. package/dist/core/fallback.d.ts.map +1 -0
  163. package/dist/core/fallback.js +119 -0
  164. package/dist/core/fallback.js.map +1 -0
  165. package/dist/core/import-discovery.d.ts +56 -0
  166. package/dist/core/import-discovery.d.ts.map +1 -0
  167. package/dist/core/import-discovery.js +304 -0
  168. package/dist/core/import-discovery.js.map +1 -0
  169. package/dist/core/kindLoader.d.ts +119 -0
  170. package/dist/core/kindLoader.d.ts.map +1 -0
  171. package/dist/core/kindLoader.js +141 -0
  172. package/dist/core/kindLoader.js.map +1 -0
  173. package/dist/core/manifest.d.ts +39 -0
  174. package/dist/core/manifest.d.ts.map +1 -0
  175. package/dist/core/manifest.js +167 -0
  176. package/dist/core/manifest.js.map +1 -0
  177. package/dist/core/plugin.d.ts +22 -0
  178. package/dist/core/plugin.d.ts.map +1 -0
  179. package/dist/core/plugin.js +20 -0
  180. package/dist/core/plugin.js.map +1 -0
  181. package/dist/core/registry.d.ts +115 -0
  182. package/dist/core/registry.d.ts.map +1 -0
  183. package/dist/core/registry.js +105 -0
  184. package/dist/core/registry.js.map +1 -0
  185. package/dist/core/render.d.ts +64 -0
  186. package/dist/core/render.d.ts.map +1 -0
  187. package/dist/core/render.js +457 -0
  188. package/dist/core/render.js.map +1 -0
  189. package/dist/core/resolve.d.ts +39 -0
  190. package/dist/core/resolve.d.ts.map +1 -0
  191. package/dist/core/resolve.js +128 -0
  192. package/dist/core/resolve.js.map +1 -0
  193. package/dist/core/schema.d.ts +308 -0
  194. package/dist/core/schema.d.ts.map +1 -0
  195. package/dist/core/schema.js +81 -0
  196. package/dist/core/schema.js.map +1 -0
  197. package/dist/core/scope.d.ts +74 -0
  198. package/dist/core/scope.d.ts.map +1 -0
  199. package/dist/core/scope.js +176 -0
  200. package/dist/core/scope.js.map +1 -0
  201. package/dist/core/template.d.ts +32 -0
  202. package/dist/core/template.d.ts.map +1 -0
  203. package/dist/core/template.js +32 -0
  204. package/dist/core/template.js.map +1 -0
  205. package/dist/core/tokens.d.ts +33 -0
  206. package/dist/core/tokens.d.ts.map +1 -0
  207. package/dist/core/tokens.js +97 -0
  208. package/dist/core/tokens.js.map +1 -0
  209. package/dist/core/types.d.ts +103 -0
  210. package/dist/core/types.d.ts.map +1 -0
  211. package/dist/core/types.js +10 -0
  212. package/dist/core/types.js.map +1 -0
  213. package/dist/index.d.ts +12 -0
  214. package/dist/index.d.ts.map +1 -0
  215. package/dist/index.js +24 -0
  216. package/dist/index.js.map +1 -0
  217. package/dist/lib/artifact-paths.d.ts +39 -0
  218. package/dist/lib/artifact-paths.d.ts.map +1 -0
  219. package/dist/lib/artifact-paths.js +83 -0
  220. package/dist/lib/artifact-paths.js.map +1 -0
  221. package/dist/lib/artifact-table.d.ts +126 -0
  222. package/dist/lib/artifact-table.d.ts.map +1 -0
  223. package/dist/lib/artifact-table.js +263 -0
  224. package/dist/lib/artifact-table.js.map +1 -0
  225. package/dist/lib/editor.d.ts +17 -0
  226. package/dist/lib/editor.d.ts.map +1 -0
  227. package/dist/lib/editor.js +33 -0
  228. package/dist/lib/editor.js.map +1 -0
  229. package/dist/lib/fs.d.ts +87 -0
  230. package/dist/lib/fs.d.ts.map +1 -0
  231. package/dist/lib/fs.js +229 -0
  232. package/dist/lib/fs.js.map +1 -0
  233. package/dist/lib/git.d.ts +13 -0
  234. package/dist/lib/git.d.ts.map +1 -0
  235. package/dist/lib/git.js +28 -0
  236. package/dist/lib/git.js.map +1 -0
  237. package/dist/lib/gitignore.d.ts +26 -0
  238. package/dist/lib/gitignore.d.ts.map +1 -0
  239. package/dist/lib/gitignore.js +97 -0
  240. package/dist/lib/gitignore.js.map +1 -0
  241. package/dist/lib/loadout-column.d.ts +66 -0
  242. package/dist/lib/loadout-column.d.ts.map +1 -0
  243. package/dist/lib/loadout-column.js +66 -0
  244. package/dist/lib/loadout-column.js.map +1 -0
  245. package/dist/lib/output.d.ts +15 -0
  246. package/dist/lib/output.d.ts.map +1 -0
  247. package/dist/lib/output.js +32 -0
  248. package/dist/lib/output.js.map +1 -0
  249. package/dist/lib/scope-indicators.d.ts +60 -0
  250. package/dist/lib/scope-indicators.d.ts.map +1 -0
  251. package/dist/lib/scope-indicators.js +110 -0
  252. package/dist/lib/scope-indicators.js.map +1 -0
  253. package/docs/authoring.md +182 -0
  254. package/docs/commands.md +192 -0
  255. package/docs/concepts.md +114 -0
  256. package/docs/index.md +60 -0
  257. package/docs/quickstart.md +100 -0
  258. package/docs/troubleshooting.md +147 -0
  259. package/docs/visual-language.md +251 -0
  260. package/docs/workflows.md +184 -0
  261. package/package.json +54 -0
@@ -0,0 +1,182 @@
1
+ # Authoring Artifacts
2
+
3
+ This guide covers creating rules, skills, and instructions. The typical workflow:
4
+
5
+ 1. **Create** an artifact (`loadouts rule add`, `loadouts skill add`, etc.)
6
+ 2. **Include** it in a loadout definition (`loadouts/<name>.yaml`)
7
+ 3. **Sync** to render outputs (`loadouts sync`)
8
+ 4. **Verify** with `loadouts status` or `loadouts info`
9
+
10
+ ---
11
+
12
+ ## Rules
13
+
14
+ Rules are scoped advisory files with YAML frontmatter:
15
+
16
+ ```markdown
17
+ ---
18
+ description: Go coding standards
19
+ paths: ["**/*.go"]
20
+ alwaysApply: false
21
+ ---
22
+
23
+ # Go Standards
24
+
25
+ Use errors.Join() for error wrapping.
26
+ ```
27
+
28
+ **Frontmatter options:**
29
+ - `description` — Brief summary (shown in listings)
30
+ - `paths` — Glob patterns for when to apply (e.g., `["**/*.go", "**/*.mod"]`)
31
+ - `alwaysApply` — If true, applies regardless of file context
32
+
33
+ **Create a rule:**
34
+ ```bash
35
+ loadouts rule add api-standards -d "REST API conventions" -p "**/*_handler.go"
36
+ ```
37
+
38
+ After creating, add `rules/api-standards.md` to your loadout's `include` list.
39
+
40
+ **Import existing:**
41
+ ```bash
42
+ loadouts rule import .cursor/rules/code.mdc --keep
43
+ ```
44
+
45
+ ---
46
+
47
+ ## Skills
48
+
49
+ Skills are directories with a `SKILL.md` and optional supporting files:
50
+
51
+ ```
52
+ skills/debugging/
53
+ ├── SKILL.md # Required: frontmatter + instructions
54
+ ├── references/ # Optional: supporting documents
55
+ │ └── error-codes.md
56
+ └── scripts/ # Optional: executable helpers
57
+ └── analyze.sh
58
+ ```
59
+
60
+ **SKILL.md format:**
61
+ ```markdown
62
+ ---
63
+ name: debugging
64
+ description: Advanced debugging techniques for Python applications.
65
+ ---
66
+
67
+ # Debugging Skill
68
+
69
+ ## When to Use
70
+
71
+ Invoke this skill when debugging Python errors...
72
+
73
+ ## Instructions
74
+
75
+ 1. Identify the error type
76
+ 2. Check the stack trace
77
+ ...
78
+ ```
79
+
80
+ **Required frontmatter:**
81
+ - `name` — Skill identifier
82
+ - `description` — Brief description (this is the "upfront" token cost; full content is lazy-loaded)
83
+
84
+ **Create a skill:**
85
+ ```bash
86
+ loadouts skill add deploy -d "Deployment procedures"
87
+ ```
88
+
89
+ After creating, add `skills/deploy` to your loadout's `include` list.
90
+
91
+ ---
92
+
93
+ ## Instructions
94
+
95
+ Per-loadout instruction files live at `.loadouts/instructions/AGENTS.<loadout>.md`. When activated, they render to `AGENTS.md` (or `CLAUDE.md` for Claude Code, which wraps and references `AGENTS.md`).
96
+
97
+ **Create instructions:**
98
+ ```bash
99
+ loadouts instructions init backend
100
+ loadouts instructions edit backend
101
+ ```
102
+
103
+ **Import existing:**
104
+ ```bash
105
+ loadouts instructions import # Auto-detects AGENTS.md or CLAUDE.md
106
+ loadouts instructions import --loadout backend # Import to specific loadout
107
+ ```
108
+
109
+ After creating or importing, run `loadouts sync` to render.
110
+
111
+ ---
112
+
113
+ ## Loadout Definitions
114
+
115
+ Loadouts are YAML files in `.loadouts/loadouts/`:
116
+
117
+ ```yaml
118
+ name: backend
119
+ description: Backend development configuration
120
+ extends: base
121
+
122
+ tools: # Optional: override defaults
123
+ - claude-code
124
+ - opencode
125
+
126
+ include:
127
+ - rules/go.md # Simple path
128
+ - skills/deploy # Skill directory
129
+ - path: rules/cursor-only.md # With options
130
+ tools: [cursor]
131
+ ```
132
+
133
+ **Per-include tool targeting:**
134
+ ```yaml
135
+ include:
136
+ - rules/general.md # All tools
137
+ - path: rules/cursor-only.md
138
+ tools: [cursor]
139
+ - path: skills/claude-debug
140
+ tools: [claude-code, pi]
141
+ ```
142
+
143
+ ---
144
+
145
+ ## Custom Kinds
146
+
147
+ Define custom artifact types in `.loadouts/kinds/*.yaml`:
148
+
149
+ ```yaml
150
+ # .loadouts/kinds/prompt.yaml
151
+ id: myteam.prompt
152
+ description: Reusable prompt snippets.
153
+
154
+ detect:
155
+ pathPrefix: prompts/ # Match files in .loadouts/prompts/
156
+
157
+ layout: file # One file → one output
158
+
159
+ targets:
160
+ claude-code:
161
+ path: "{base}/prompts/{stem}{ext}"
162
+ cursor:
163
+ path: "{base}/prompts/{stem}.mdc"
164
+ ext: .mdc
165
+ ```
166
+
167
+ **Path templates:** `{base}`, `{stem}`, `{ext}`, `{name}`
168
+
169
+ **Detection:** `pathPrefix` or `pathExact`
170
+
171
+ List all kinds: `loadouts kinds -v`
172
+
173
+ ---
174
+
175
+ ## Token Estimation
176
+
177
+ `loadouts info` shows token estimates:
178
+
179
+ - **Upfront** — Loaded at session start (rules, instructions, skill descriptions)
180
+ - **Lazy** — Loaded on-demand (full skill content)
181
+
182
+ Uses ~4 chars/token approximation. Good for comparing loadouts and catching bloat.
@@ -0,0 +1,192 @@
1
+ # Command Reference
2
+
3
+ ## Active Configuration
4
+
5
+ ### `loadouts activate <names...>`
6
+ Add loadout(s) to the active set and render outputs.
7
+ ```bash
8
+ loadouts activate backend # Single loadout
9
+ loadouts activate base frontend # Multiple loadouts
10
+ loadouts activate ml -g # Global scope
11
+ loadouts activate backend --dry-run # Preview only
12
+ ```
13
+
14
+ ### `loadouts deactivate <names...>`
15
+ Remove loadout(s) from the active set.
16
+ ```bash
17
+ loadouts deactivate backend
18
+ ```
19
+
20
+ ### `loadouts sync`
21
+ Re-render active loadouts from latest definitions. Run after editing rules or skills.
22
+ ```bash
23
+ loadouts sync # All scopes
24
+ loadouts sync -l # Project only
25
+ loadouts sync --dry-run # Preview
26
+ ```
27
+
28
+ ### `loadouts status`
29
+ Show drift status. Detects config drift (definition changed) and output drift (files modified/missing).
30
+ ```bash
31
+ loadouts status
32
+ ```
33
+
34
+ ### `loadouts clear`
35
+ Deactivate all loadouts and remove all outputs.
36
+ ```bash
37
+ loadouts clear # Project scope
38
+ loadouts clear -g # Global scope
39
+ loadouts clear -a # Both scopes
40
+ ```
41
+
42
+ ### `loadouts info [name]`
43
+ Show loadout details including artifacts, tools, and token estimates.
44
+ ```bash
45
+ loadouts info # Active loadout(s)
46
+ loadouts info backend # Specific loadout
47
+ ```
48
+
49
+ ### `loadouts diff [name]`
50
+ Preview what would change if a loadout were applied.
51
+ ```bash
52
+ loadouts diff backend
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Bundle Management
58
+
59
+ ### `loadouts init`
60
+ Initialize a new `.loadouts/` directory. Creates structure, base loadout, and applies it.
61
+ ```bash
62
+ loadouts init # Project
63
+ loadouts init -g # Global
64
+ loadouts init --force # Overwrite existing
65
+ ```
66
+
67
+ ### `loadouts install`
68
+ Discover and import existing tool configurations.
69
+ ```bash
70
+ loadouts install # All configs
71
+ loadouts install --dry-run # Preview
72
+ loadouts install -i # Interactive
73
+ loadouts install --rules # Rules only
74
+ loadouts install --from cursor # From specific tool
75
+ loadouts install --keep # Don't delete originals
76
+ ```
77
+
78
+ ### `loadouts create <name>`
79
+ Create a new loadout definition.
80
+ ```bash
81
+ loadouts create backend # Project loadout
82
+ loadouts create ml -g # Global loadout
83
+ loadouts create api --extends base # Extend another loadout
84
+ loadouts create test -d "Testing" # With description
85
+ ```
86
+
87
+ ### `loadouts edit <name>`
88
+ Open a loadout definition in `$EDITOR`.
89
+ ```bash
90
+ loadouts edit backend
91
+ ```
92
+
93
+ ### `loadouts remove [name]`
94
+ Remove applied loadout outputs.
95
+ ```bash
96
+ loadouts remove # All outputs
97
+ loadouts remove backend # Validate name first
98
+ loadouts remove --dry-run # Preview
99
+ ```
100
+
101
+ ### `loadouts list`
102
+ List available loadouts with item count, description, and inheritance.
103
+ ```bash
104
+ loadouts list # All scopes
105
+ loadouts list -l # Project only
106
+ loadouts list -g # Global only
107
+ ```
108
+
109
+ ### `loadouts check`
110
+ Validate configuration (YAML syntax, file references, circular extends, tool prerequisites).
111
+ ```bash
112
+ loadouts check
113
+ loadouts check -v # Verbose
114
+ ```
115
+
116
+ ---
117
+
118
+ ## Artifact Authoring
119
+
120
+ ### Rules
121
+
122
+ Create scoped advisory files that tools inject based on file context.
123
+
124
+ ```bash
125
+ loadouts rule add my-rule # Create rule
126
+ loadouts rule add go -p "**/*.go" # With path pattern
127
+ loadouts rule add strict --always-apply # Always apply
128
+ loadouts rule list # List rules
129
+ loadouts rule edit my-rule # Edit rule
130
+ loadouts rule remove my-rule # Remove rule
131
+ loadouts rule import ./existing.md # Import file
132
+ ```
133
+
134
+ After creating a rule, add it to your loadout's `include` list and run `loadouts sync`.
135
+
136
+ ### Skills
137
+
138
+ Create on-demand capabilities with instructions and supporting files.
139
+
140
+ ```bash
141
+ loadouts skill add deploy # Create skill
142
+ loadouts skill add debug -g # Global skill
143
+ loadouts skill list # List skills
144
+ loadouts skill edit deploy # Edit skill
145
+ loadouts skill remove deploy # Remove skill
146
+ loadouts skill import ./my-skill # Import directory
147
+ ```
148
+
149
+ After creating a skill, add it to your loadout's `include` list and run `loadouts sync`.
150
+
151
+ ### Instructions
152
+
153
+ Create per-loadout instruction files that render to `AGENTS.md` or `CLAUDE.md`.
154
+
155
+ ```bash
156
+ loadouts instructions init # Create for active loadout
157
+ loadouts instructions init backend # For specific loadout
158
+ loadouts instructions edit # Edit instructions
159
+ loadouts instructions list # List instruction files
160
+ loadouts instructions import # Import existing AGENTS.md
161
+ loadouts instructions import --loadout backend # Import to specific loadout
162
+ ```
163
+
164
+ ### Kinds
165
+ ```bash
166
+ loadouts kinds # List registered kinds
167
+ loadouts kinds -v # With detection rules
168
+ ```
169
+
170
+ ---
171
+
172
+ ## Scope Flags
173
+
174
+ Most state commands (`activate`, `deactivate`, `sync`, `status`, `clear`, `list`, `info`, `check`) support scope flags:
175
+
176
+ | Flag | Description |
177
+ |------|-------------|
178
+ | `-l, --local` | Project scope only |
179
+ | `-g, --global` | Global scope only |
180
+ | `-a, --all` | Both scopes |
181
+
182
+ When omitted, commands auto-detect scope based on context. Use `--dry-run` to preview behavior before destructive operations.
183
+
184
+ ---
185
+
186
+ ## Environment Variables
187
+
188
+ | Variable | Purpose |
189
+ |----------|---------|
190
+ | `EDITOR` | Editor for edit commands |
191
+ | `VISUAL` | Fallback editor |
192
+ | `PAGER` | Pager for docs (default: `less`) |
@@ -0,0 +1,114 @@
1
+ # Core Concepts
2
+
3
+ ## The `.loadouts/` Directory
4
+
5
+ Project configuration lives in `.loadouts/` (global config lives in `~/.config/loadouts/`):
6
+
7
+ ```
8
+ .loadouts/
9
+ ├── loadouts.yaml # Root config (version, defaults)
10
+ ├── loadouts/ # Named configuration bundles
11
+ │ └── base.yaml
12
+ ├── instructions/ # Per-loadout instruction files
13
+ │ └── AGENTS.base.md
14
+ ├── rules/ # Portable rule files
15
+ └── skills/ # Portable skill directories
16
+ ```
17
+
18
+ ## Scopes
19
+
20
+ | Scope | Location | Flag | Purpose |
21
+ |-------|----------|------|---------|
22
+ | **Project** | `./.loadouts/` | `-l` | Project-specific config |
23
+ | **Global** | `~/.config/loadouts/` | `-g` | User-wide config |
24
+
25
+ Most commands auto-detect scope. Use `-l`/`-g` to be explicit, or `-a` for both.
26
+
27
+ ## Active State
28
+
29
+ **Activating** a loadout adds it to the "active set" and renders its artifacts to tool directories. The active set persists in `.loadouts/.state.json` — you don't need to re-activate after restarting your terminal.
30
+
31
+ - `loadouts activate <name>` — Add to active set and render
32
+ - `loadouts deactivate <name>` — Remove from active set and clean up outputs
33
+ - `loadouts sync` — Re-render active loadouts (after editing source files)
34
+ - `loadouts status` — Show what's active and detect drift
35
+
36
+ ## Loadouts
37
+
38
+ A **loadout** is a named bundle of artifacts:
39
+
40
+ ```yaml
41
+ # .loadouts/loadouts/backend.yaml
42
+ name: backend
43
+ description: Backend development configuration
44
+ extends: base
45
+
46
+ include:
47
+ - rules/go.md
48
+ - rules/database.md
49
+ - skills/deploy
50
+ ```
51
+
52
+ **Inheritance:** `extends: base` pulls in the parent's artifacts. Child items take precedence.
53
+
54
+ **Multiple active:** Activate several loadouts together:
55
+
56
+ ```bash
57
+ loadouts activate base backend ml # All three active
58
+ ```
59
+
60
+ When multiple loadouts define the same artifact, later arguments take precedence (`ml` wins over `backend` wins over `base`).
61
+
62
+ **Per-artifact tool targeting:**
63
+
64
+ ```yaml
65
+ include:
66
+ - rules/general.md # All tools
67
+ - path: rules/cursor-only.md
68
+ tools: [cursor] # Cursor only
69
+ ```
70
+
71
+ ## Artifact Kinds
72
+
73
+ | Kind | Layout | Description |
74
+ |------|--------|-------------|
75
+ | `rule` | file | Scoped advisory rules (`.md`) |
76
+ | `skill` | directory | On-demand capabilities with `SKILL.md` |
77
+ | `instruction` | file | Always-on project instructions |
78
+ | `prompt` | file | Slash command templates |
79
+ | `extension` | directory | Runtime code extensions |
80
+ | `theme` | file | UI theme configuration |
81
+
82
+ ## Supported Tools
83
+
84
+ | Tool | Rules | Skills | Instructions |
85
+ |------|-------|--------|--------------|
86
+ | Claude Code | `.claude/rules/*.md` | `.claude/skills/` | `CLAUDE.md` |
87
+ | Cursor | `.cursor/rules/*.mdc` | `.cursor/skills/` | `AGENTS.md` |
88
+ | OpenCode | `.opencode/rules/*.md` | `.opencode/skills/` | `AGENTS.md` |
89
+ | Codex | — | `.agents/skills/` | `AGENTS.md` |
90
+ | Pi | `.pi/rules/*.md` | `.pi/skills/` | `AGENTS.md` |
91
+
92
+ ## Sources (Cross-Project Config)
93
+
94
+ Share configuration across projects:
95
+
96
+ ```yaml
97
+ # packages/api/.loadouts/loadouts.yaml
98
+ version: "1"
99
+ sources:
100
+ - ../.. # Parent monorepo
101
+ - ~/dotfiles # Personal global config
102
+ ```
103
+
104
+ **Resolution order:** Local `.loadouts/` → Sources (in declaration order) → Global `~/.config/loadouts/`.
105
+
106
+ When two sources define a loadout with the same name, the first match wins. If a source path doesn't exist, loadouts warns and continues.
107
+
108
+ ## Output Modes
109
+
110
+ | Mode | Behavior | Use Case |
111
+ |------|----------|----------|
112
+ | `symlink` | Target symlinks to source | Default; edits stay in sync |
113
+ | `copy` | Target is a managed copy | Tools that don't follow symlinks |
114
+ | `generate` | Target is rendered/wrapped | Tool-specific transformations |
package/docs/index.md ADDED
@@ -0,0 +1,60 @@
1
+ # Loadouts
2
+
3
+ **Composable configuration bundles for AI coding agents.**
4
+
5
+ Loadouts organizes your rules, skills, and instructions into named **loadouts** that you can mix and match:
6
+
7
+ - **Task-specific configs** — Activate `backend` for API work, `frontend` for UI work, or both
8
+ - **Team flexibility** — Track all configs in one place; teammates activate what they need
9
+ - **Tool portability** — Write once, apply to Claude Code, Cursor, OpenCode, Codex, and Pi
10
+
11
+ ```bash
12
+ loadouts activate base backend # Backend task
13
+ loadouts activate base frontend # Switch to frontend
14
+ loadouts activate base backend ml # Combine multiple
15
+ ```
16
+
17
+ ## Getting Started
18
+
19
+ ```bash
20
+ npm install -g loadouts # Requires Node.js 18+
21
+ loadouts docs quickstart # Step-by-step setup guide
22
+ ```
23
+
24
+ ## Quick Reference
25
+
26
+ ```bash
27
+ # Setup
28
+ loadouts init # Initialize .loadouts/
29
+ loadouts install # Import existing configs
30
+
31
+ # Daily use
32
+ loadouts activate <name> # Activate loadout(s)
33
+ loadouts deactivate <name> # Deactivate loadout(s)
34
+ loadouts sync # Re-render after edits
35
+ loadouts status # Check for drift (source/output changes)
36
+
37
+ # Authoring
38
+ loadouts rule add <name> # Create a rule
39
+ loadouts skill add <name> # Create a skill
40
+ loadouts instructions init # Create instructions
41
+ loadouts create <name> # Create a loadout
42
+
43
+ # Info
44
+ loadouts list # List available loadouts
45
+ loadouts info [name] # Show loadout details
46
+ loadouts check # Validate configuration
47
+ ```
48
+
49
+ ## Documentation Topics
50
+
51
+ ```bash
52
+ loadouts docs quickstart # Get started in 60 seconds
53
+ loadouts docs concepts # Loadouts, artifacts, scopes, tools
54
+ loadouts docs commands # Full command reference
55
+ loadouts docs authoring # Creating rules, skills, instructions
56
+ loadouts docs workflows # Team setup, git, CI/CD
57
+ loadouts docs troubleshooting # Common issues and solutions
58
+ ```
59
+
60
+ Use `loadouts docs <topic>` to read any section, or `loadouts docs --list` for descriptions.
@@ -0,0 +1,100 @@
1
+ # Quickstart
2
+
3
+ Get loadouts running in under a minute.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g loadouts
9
+ ```
10
+
11
+ Requires Node.js 18+.
12
+
13
+ ## Getting Started
14
+
15
+ The fastest way to start is `loadouts init`, which detects and imports any existing agent configs:
16
+
17
+ ```bash
18
+ loadouts init
19
+ ```
20
+
21
+ This creates `.loadouts/`, scans for existing rules/skills in `.claude/`, `.cursor/`, `.opencode/`, etc., and offers to import them. If you have scattered configs, this is the recommended entry point.
22
+
23
+ **To import explicitly** (or re-import later):
24
+
25
+ ```bash
26
+ loadouts install # Discover and import existing configs
27
+ loadouts install --dry-run # Preview what would be imported
28
+ loadouts install -i # Interactive mode (select what to import)
29
+ ```
30
+
31
+ ## New Project (no existing configs)
32
+
33
+ If you're starting fresh with no existing agent configs:
34
+
35
+ ```bash
36
+ loadouts init # Creates .loadouts/ with a base loadout
37
+ loadouts rule add coding-standards # Create a rule file
38
+ loadouts sync # Render to tool directories
39
+ ```
40
+
41
+ Your rule now appears in `.claude/rules/`, `.cursor/rules/`, and other configured tools.
42
+
43
+ **Verify it worked:**
44
+ ```bash
45
+ loadouts status # Should show "ok" with no drift
46
+ ```
47
+
48
+ ## Existing Project (with scattered configs)
49
+
50
+ Already have rules in `.cursor/rules/` or `.claude/rules/`? The recommended flow:
51
+
52
+ ```bash
53
+ loadouts init # Detects configs and offers to import
54
+ ```
55
+
56
+ If you skipped import during init, or want to import additional configs later:
57
+
58
+ ```bash
59
+ loadouts install # Import existing configs
60
+ loadouts sync # Render unified config
61
+ ```
62
+
63
+ This finds rules/skills across `.claude/`, `.cursor/`, `.opencode/`, etc. and consolidates them into `.loadouts/`.
64
+
65
+ **Verify it worked:**
66
+ ```bash
67
+ loadouts list # Shows your loadouts
68
+ loadouts status # Shows rendered artifacts
69
+ ```
70
+
71
+ ## Task-Specific Loadouts
72
+
73
+ Create separate loadouts for different work contexts:
74
+
75
+ ```bash
76
+ loadouts create backend -e base # New loadout extending base
77
+ loadouts rule add api-standards # Create a rule
78
+ loadouts edit backend # Add rules/api-standards.md to include list
79
+ loadouts activate backend # Apply it
80
+ ```
81
+
82
+ Switch contexts by activating different loadouts:
83
+
84
+ ```bash
85
+ loadouts activate base frontend # Frontend work
86
+ loadouts activate base backend ml # Backend + ML combined
87
+ ```
88
+
89
+ ## How It Works
90
+
91
+ 1. **Source files** live in `.loadouts/` (rules, skills, loadout definitions)
92
+ 2. **Loadouts** bundle artifacts together (`loadouts/base.yaml`)
93
+ 3. **Activating** a loadout renders its artifacts to each tool's expected location
94
+ 4. **Syncing** re-renders after you edit source files
95
+
96
+ ## What's Next
97
+
98
+ - `loadouts docs concepts` — Understand loadouts, scopes, and tools
99
+ - `loadouts docs authoring` — Create rules, skills, instructions
100
+ - `loadouts docs workflows` — Team onboarding, git hooks, CI setup