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,147 @@
1
+ # Troubleshooting
2
+
3
+ ## Common Issues
4
+
5
+ ### "No .loadouts/ directory found"
6
+
7
+ Run `loadouts init` to create one, or check you're in the right directory.
8
+
9
+ ### "Loadout not found: <name>"
10
+
11
+ The loadout doesn't exist in the current scope. Check available loadouts:
12
+ ```bash
13
+ loadouts list # Project scope
14
+ loadouts list -g # Global scope
15
+ loadouts list -a # Both scopes
16
+ ```
17
+
18
+ ### "Cannot infer artifact kind for path"
19
+
20
+ The file path doesn't match any known kind. Built-in kinds expect:
21
+ - **Rules:** `rules/*.md`
22
+ - **Skills:** `skills/<name>/SKILL.md`
23
+ - **Instructions:** `instructions/AGENTS.*.md`
24
+ - **Prompts:** `prompts/*.md`
25
+
26
+ For custom artifact types, create a `.loadouts/kinds/*.yaml` definition. Run `loadouts kinds -v` to see all registered kinds and their detection rules.
27
+
28
+ ### "Include not found"
29
+
30
+ A file in your loadout's `include` list doesn't exist. Paths are relative to `.loadouts/`.
31
+
32
+ ### Outputs not updating after edits
33
+
34
+ Run `loadouts sync` to regenerate outputs from sources. Then verify with `loadouts status`.
35
+
36
+ If outputs still don't appear, check:
37
+ 1. Is the artifact included in an active loadout? (`loadouts info`)
38
+ 2. Is the loadout activated? (`loadouts status`)
39
+
40
+ ### Symlinks broken after moving project
41
+
42
+ Symlinks use absolute paths. Run `loadouts sync` to recreate them.
43
+
44
+ ### Tool not picking up rules/skills
45
+
46
+ First, verify outputs were rendered:
47
+ ```bash
48
+ loadouts status # Check for drift or missing outputs
49
+ loadouts sync # Re-render if needed
50
+ ```
51
+
52
+ **Cursor:** Rules need `.mdc` extension — loadouts handles this automatically. Restart Cursor if rules don't appear immediately.
53
+
54
+ **OpenCode:** Rules require the `opencode-rules` plugin. Add to `opencode.json`:
55
+ ```json
56
+ { "plugins": ["opencode-rules"] }
57
+ ```
58
+
59
+ **Claude Code:** Verify rules exist in `.claude/rules/`. May require restarting the session.
60
+
61
+ **Codex:** Rules not yet supported; skills and instructions only.
62
+
63
+ ---
64
+
65
+ ## Validation
66
+
67
+ Run validation to catch issues:
68
+ ```bash
69
+ loadouts check -v
70
+ ```
71
+
72
+ Validates:
73
+ - YAML syntax
74
+ - All referenced files exist
75
+ - No circular `extends`
76
+ - Tool prerequisites satisfied
77
+ - No unmanaged file collisions (shadowed files)
78
+
79
+ ### Shadowed file collision
80
+
81
+ A **shadowed file** occurs when loadouts wants to write to a path that already has an unmanaged file. Loadouts never overwrites unmanaged files — it skips them and reports the collision.
82
+
83
+ **To resolve:**
84
+ ```bash
85
+ loadouts rule import .cursor/rules/existing.mdc # Import into loadout
86
+ # OR
87
+ rm .cursor/rules/existing.mdc && loadouts sync # Remove and re-render
88
+ # OR keep the unmanaged file (it takes precedence)
89
+ ```
90
+
91
+ ---
92
+
93
+ ## Debugging
94
+
95
+ ### Preview changes without applying
96
+ ```bash
97
+ loadouts activate backend --dry-run
98
+ loadouts sync --dry-run
99
+ ```
100
+
101
+ ### See what's active
102
+ ```bash
103
+ loadouts status
104
+ loadouts info
105
+ ```
106
+
107
+ ### Check token cost
108
+ ```bash
109
+ loadouts info backend # Shows upfront and lazy tokens
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Removing Loadouts
115
+
116
+ ### From a project
117
+
118
+ **Warning:** These commands delete your loadout configuration. Back up `.loadouts/` first if you want to preserve your rules and skills.
119
+
120
+ ```bash
121
+ loadouts clear # Remove all managed outputs (safe, reversible)
122
+ ```
123
+
124
+ To fully remove loadouts from a project:
125
+ ```bash
126
+ loadouts clear # Remove managed outputs first
127
+ rm -rf .loadouts # Delete source config (irreversible)
128
+ rm CLAUDE.md # Remove generated wrapper if present
129
+ ```
130
+
131
+ ### Global config
132
+
133
+ ```bash
134
+ loadouts clear -g # Remove global managed outputs
135
+ rm -rf ~/.config/loadouts # Delete global config (irreversible)
136
+ ```
137
+
138
+ ---
139
+
140
+ ## Getting Help
141
+
142
+ ```bash
143
+ loadouts --help # Command overview
144
+ loadouts <cmd> --help # Command-specific help
145
+ loadouts docs # Full documentation
146
+ loadouts docs <topic> # Topic-specific docs
147
+ ```
@@ -0,0 +1,251 @@
1
+ # Loadouts CLI Visual Language
2
+
3
+ This document defines the unified visual language for all loadouts CLI output. Follow these patterns when adding or modifying commands to maintain consistency.
4
+
5
+ ## Core Principle
6
+
7
+ **Artifact-first, tool-secondary.**
8
+
9
+ - **Vertical axis (rows)** → Artifacts (what the user cares about)
10
+ - **Horizontal axis (columns)** → Tools (where artifacts go)
11
+ - **Cell content** → Status indicators
12
+
13
+ Users should always be able to:
14
+ 1. Scan rows to see what artifacts are involved
15
+ 2. Scan columns to see which tools are affected
16
+ 3. Read cells to understand what's happening
17
+
18
+ ## Standard Table Format
19
+
20
+ All commands that display artifact information should use this columnar format:
21
+
22
+ ```
23
+ kind artifact claude-code cursor opencode codex pi
24
+ ─────────── ─────────────── ─────────── ────── ──────── ───── ──
25
+ instruction AGENTS ✓ ✓ ✓ ✓ ✓
26
+ skill managing-memory ✓ ✓ ✓ ✓ ✓
27
+ extension tmux-fork.ts — — — — ✓
28
+ ```
29
+
30
+ ### Column Order
31
+ 1. `kind` — artifact kind (instruction, rule, skill, extension, etc.)
32
+ 2. `artifact` — display name (not full path)
33
+ 3. Additional context columns (tokens, mode, action) — optional, command-specific
34
+ 4. Tool columns — one per tool, in canonical order: `claude-code`, `cursor`, `opencode`, `codex`, `pi`
35
+ 5. Status column — optional, for overall row status
36
+
37
+ ### Column Widths
38
+ - `kind`: dynamic, min 4 chars
39
+ - `artifact`: dynamic, max 35 chars (truncate with leading `…`)
40
+ - Tool columns: width of tool name, min 2 chars
41
+ - Token columns: 7 chars, right-aligned
42
+
43
+ ## Status Indicators
44
+
45
+ Use these symbols consistently across all commands:
46
+
47
+ | Symbol | Color | Meaning | Used In |
48
+ |--------|--------|----------------------------|----------------------|
49
+ | `✓` | green | in-sync, ok, applicable | status, info |
50
+ | `+` | green | added, created | activate, sync, diff |
51
+ | `~` | yellow | modified, updated | activate, sync, diff |
52
+ | `-` | red | removed, deleted | activate, sync, diff |
53
+ | `!` | red | missing, error | status |
54
+ | `?` | yellow | shadowed (blocked) | status, activate |
55
+ | `⚡` | yellow | unlinked (symlink broken) | status |
56
+ | `💀` | red | broken (unrecoverable) | status |
57
+ | `—` | dim | not applicable | info, status |
58
+ | `▸` | green | active loadout | list, info |
59
+ | `•` | dim | global scope | info |
60
+ | `◦` | cyan | local/project scope | info |
61
+ | `→` | yellow | external source | info |
62
+
63
+ **Cell semantics:** Use `—` for not-applicable tool cells (never leave cells blank).
64
+
65
+ ### In Table Cells
66
+ - Symbols are left-aligned in their column
67
+ - Pad with spaces to maintain column width
68
+ - Use chalk colors for terminal output
69
+
70
+ ## Command-Specific Formats
71
+
72
+ ### `info` — Show loadout information
73
+
74
+ Displays a unified table of all active loadouts with artifacts grouped by loadout.
75
+ Scope is indicated with subtle symbols after the loadout name.
76
+
77
+ ```
78
+ Active loadouts
79
+ ───────────────
80
+ loadout kind artifact upfront lazy claude-code cursor ...
81
+ ───────── ─────────── ─────────────── ─────── ─────── ─────────── ────── ...
82
+ ▸ base • instruction AGENTS.base.md 968 — ✓ ✓ ...
83
+ skill managing-memory 94 1.4k ✓ ✓ ...
84
+ extension tmux-fork.ts — — ...
85
+ ▸ base ◦ instruction AGENTS.base.md 641 — ✓ ✓ ...
86
+
87
+ Upfront: 1.7k • Lazy: 1.4k • Total: 3.1k tokens
88
+ • global ◦ local →name source
89
+ ```
90
+
91
+ Scope indicators:
92
+ - `•` (dim) — global scope
93
+ - `◦` (cyan) — local/project scope
94
+ - `→name` (yellow) — external source (shows source name)
95
+
96
+ The `▸` marker (green) indicates active loadouts.
97
+ Loadout name only appears on the first row of each group.
98
+ Token columns appear when any artifact has context tokens.
99
+
100
+ ### `status` — Show drift status
101
+
102
+ Unified table matching `info`, with an additional status column showing drift.
103
+
104
+ ```
105
+ Loadout status
106
+ ──────────────
107
+ loadout kind artifact claude-code cursor ... status
108
+ ───────── ─────────── ─────────────── ─────────── ────── ... ────────
109
+ ▸ base ◦ instruction AGENTS.base.md ✓ ✓ ... ok
110
+ ▸ base • instruction AGENTS.base.md ✓ ✓ ... ok
111
+ skill managing-memory ✓ ✓ ... ok
112
+ extension tmux-fork.ts ... ok
113
+
114
+ • global ◦ local
115
+
116
+ ✓ All in sync
117
+ ```
118
+
119
+ Status column shows the worst drift status across all tools for that artifact.
120
+ Drift indicators (worst to best): `💀` broken > `!` missing > `⚡` unlinked > `~` modified > `✓` ok.
121
+
122
+ ### `activate` / `sync` / `deactivate` — Apply changes
123
+ ```
124
+ Activated loadouts: base (global)
125
+ ─────────────────────────────────
126
+ kind artifact claude-code cursor opencode codex pi
127
+ ─────────── ─────────────── ─────────── ────── ──────── ───── ──
128
+ instruction AGENTS + + + + +
129
+ skill managing-memory + + + + +
130
+
131
+ ✓ 8 changes: 5 added, 2 updated, 1 removed
132
+ ```
133
+
134
+ ### `activate --dry-run` — Preview changes
135
+ ```
136
+ Would apply loadouts: base (global)
137
+ ───────────────────────────────────
138
+ kind artifact claude-code cursor opencode codex pi
139
+ ─────────── ─────────────── ─────────── ────── ──────── ───── ──
140
+ instruction AGENTS generate sym sym sym sym
141
+ skill managing-memory sym sym sym sym sym
142
+
143
+ 8 outputs to 5 tools
144
+ ```
145
+
146
+ Mode abbreviations: `sym` = symlink, `generate` = generate, `copy` = copy
147
+
148
+ ### `diff` — Show pending changes
149
+ ```
150
+ Diff: base (global)
151
+ ───────────────────
152
+ kind artifact claude-code cursor opencode codex pi action
153
+ ─────────── ─────────────── ─────────── ────── ──────── ───── ── ──────
154
+ instruction AGENTS + + + + + create
155
+ skill managing-memory ~ ~ ~ ~ ~ update
156
+ rule old-rule - - - - - delete
157
+ ```
158
+
159
+ ### `list` — List available loadouts
160
+
161
+ Shows all available loadouts with scope indicators matching `info`.
162
+
163
+ ```
164
+ Available loadouts
165
+ ──────────────────
166
+ loadout items description
167
+ ──────────────── ───── ──────────────────────────────
168
+ ▸ base * ◦ 1 Base loadout configuration
169
+ ▸ base • 3 Global base configuration
170
+ meta • 11 Meta loadout configuration
171
+
172
+ ▸ active * default
173
+ • global ◦ local →name source
174
+ ```
175
+
176
+ Loadout column format: `▸ name * scope` where:
177
+ - `▸` (green) — active loadout
178
+ - `*` (cyan) — default loadout (project scope only)
179
+ - Scope indicators match `info` (• global, ◦ local, →name source)
180
+
181
+ ## Headings and Separators
182
+
183
+ ### Section Headings
184
+ ```typescript
185
+ heading("Global loadout: base");
186
+ // Output:
187
+ //
188
+ // Global loadout: base
189
+ // ────────────────────
190
+ ```
191
+
192
+ - Blank line before heading
193
+ - Title in bold
194
+ - Separator line matches title length (dim)
195
+
196
+ ### Key-Value Metadata
197
+ ```typescript
198
+ keyValue({
199
+ Description: "My loadout",
200
+ Root: "/path/to/root",
201
+ });
202
+ // Output:
203
+ // Description: My loadout
204
+ // Root: /path/to/root
205
+ ```
206
+
207
+ - 2-space indent
208
+ - Key in dim, followed by colon and space
209
+ - Value in normal color
210
+
211
+ ## Log Messages
212
+
213
+ Use the standard log helpers:
214
+
215
+ ```typescript
216
+ log.success("8 changes applied"); // ✓ 8 changes applied (green)
217
+ log.info("Checking prerequisites"); // ℹ Checking prerequisites (blue)
218
+ log.warn("3 files shadowed"); // ⚠ 3 files shadowed (yellow)
219
+ log.error("Failed to resolve"); // ✗ Failed to resolve (red)
220
+ log.dim("Run 'loadouts sync' to fix"); // (dimmed text)
221
+ ```
222
+
223
+ ## Implementation
224
+
225
+ ### Shared Utilities (`src/lib/artifact-table.ts`)
226
+
227
+ - `getArtifactName()` — extract display name from path
228
+ - `sortArtifacts()` — sort by kind priority, then name
229
+ - `truncatePath()` — truncate with leading ellipsis
230
+ - `getToolColumns()` — calculate tool column specs
231
+ - `calculateColumnWidths()` — dynamic column sizing
232
+ - `renderArtifactTable()` — base table renderer
233
+
234
+ ### Output Helpers (`src/lib/output.ts`)
235
+
236
+ - `heading()` — section heading with separator
237
+ - `keyValue()` — key-value pair list
238
+ - `list()` — bulleted list
239
+ - `log.*` — status messages
240
+
241
+ ## Adding New Commands
242
+
243
+ When adding a new command that displays artifact information:
244
+
245
+ 1. Use the artifact table format with tools as columns
246
+ 2. Use standard status indicators
247
+ 3. Follow the heading/separator patterns
248
+ 4. Use `log.*` for status messages
249
+ 5. Add any new columns between artifact and tool columns
250
+
251
+ When in doubt, look at `info` and `status` as reference implementations.
@@ -0,0 +1,184 @@
1
+ # Workflows
2
+
3
+ ## Git Integration
4
+
5
+ ### What Gets Committed
6
+
7
+ Loadout auto-manages `.gitignore` to exclude only rendered outputs:
8
+
9
+ ```gitignore
10
+ # <loadouts>
11
+ # Auto-generated by loadouts. Do not edit this section.
12
+ .loadouts/.state.json
13
+ .cursor/rules/coding-style.mdc
14
+ .claude/rules/coding-style.md
15
+ # </loadouts>
16
+ ```
17
+
18
+ **Committed:** `.loadouts/` (source), `AGENTS.md` (canonical), `.gitignore`
19
+ **Local only:** Rendered outputs, state file
20
+
21
+ ### Custom Tool Configs
22
+
23
+ Because loadouts ignores specific paths (not whole directories), you can have custom configs alongside managed ones:
24
+
25
+ ```
26
+ .cursor/
27
+ ├── rules/
28
+ │ ├── coding-style.mdc # Managed by loadouts (ignored)
29
+ │ └── my-custom.mdc # Your custom rule (committed)
30
+ └── mcp.json # Tool settings (committed)
31
+ ```
32
+
33
+ ---
34
+
35
+ ## Team Onboarding
36
+
37
+ After cloning a repo with loadouts, team members need to render outputs once. Choose one approach:
38
+
39
+ ### Option 1: Git Hooks (Recommended)
40
+
41
+ Run once after cloning:
42
+ ```bash
43
+ git config core.hooksPath .loadouts/hooks
44
+ ```
45
+
46
+ This auto-syncs on `git checkout` and `git pull`.
47
+
48
+ **Caveats:**
49
+ - Must run from git root (not subprojects)
50
+ - Replaces any existing `core.hooksPath` setting
51
+ - To undo: `git config --unset core.hooksPath`
52
+
53
+ **For JS projects**, automate in `package.json`:
54
+ ```json
55
+ {
56
+ "scripts": {
57
+ "prepare": "git config core.hooksPath .loadouts/hooks 2>/dev/null || true"
58
+ }
59
+ }
60
+ ```
61
+
62
+ ### Option 2: Direnv
63
+
64
+ If using [direnv](https://direnv.net/):
65
+ ```bash
66
+ direnv allow
67
+ ```
68
+
69
+ Auto-syncs when entering the directory. Good for teams already using direnv.
70
+
71
+ ### Option 3: Manual Sync
72
+
73
+ For users without loadouts installed or preferring manual control:
74
+ ```bash
75
+ loadouts sync
76
+ ```
77
+
78
+ Hooks skip gracefully if loadouts isn't installed, so CI and teammates without loadouts won't error.
79
+
80
+ ---
81
+
82
+ ## Monorepo Setup
83
+
84
+ Put shared config at repo root, package-specific in each package:
85
+
86
+ ```
87
+ ~/code/monorepo/
88
+ ├── .loadouts/ # Repo-level
89
+ │ ├── loadouts/base.yaml # Shared base
90
+ │ ├── rules/shared-style.md
91
+ │ └── skills/debugging/
92
+ ├── packages/
93
+ │ └── api/
94
+ │ ├── .loadouts/
95
+ │ │ ├── loadouts.yaml # sources: [../..]
96
+ │ │ └── loadouts/api.yaml # extends: base
97
+ │ └── src/
98
+ ```
99
+
100
+ In `packages/api/.loadouts/loadouts.yaml`:
101
+ ```yaml
102
+ version: "1"
103
+ sources:
104
+ - ../.. # Points to monorepo root
105
+ ```
106
+
107
+ Now `api` loadout can `extends: base` from the parent.
108
+
109
+ ---
110
+
111
+ ## CI/CD
112
+
113
+ Most CI pipelines don't need loadouts — AI tools typically aren't used in CI.
114
+
115
+ **When to use loadouts in CI:**
116
+ - Automated AI code review workflows
117
+ - Validating loadouts configuration on PRs
118
+
119
+ **Example CI step:**
120
+ ```bash
121
+ npm install -g loadouts
122
+ loadouts check -v # Validate config (catches broken references)
123
+ loadouts sync --dry-run # Preview what would be rendered
124
+ ```
125
+
126
+ If your CI step actually needs the rendered outputs:
127
+ ```bash
128
+ loadouts sync # Render outputs
129
+ ```
130
+
131
+ ---
132
+
133
+ ## Common Workflows
134
+
135
+ ### Daily Context Switching
136
+ ```bash
137
+ loadouts activate base backend # Morning: backend work
138
+ loadouts activate base frontend # Afternoon: switch to frontend
139
+ loadouts deactivate frontend # Remove frontend, keep base
140
+ ```
141
+
142
+ ### After Editing Rules/Skills
143
+ ```bash
144
+ # Edit the source file
145
+ $EDITOR .loadouts/rules/my-rule.md
146
+
147
+ # Re-render to all tools
148
+ loadouts sync
149
+
150
+ # Verify the change
151
+ loadouts status
152
+ ```
153
+
154
+ ### Check for Drift
155
+ ```bash
156
+ loadouts status # See what changed
157
+ loadouts sync # Reconcile
158
+ ```
159
+
160
+ ### Adding Global Personal Config
161
+ ```bash
162
+ loadouts init -g
163
+ loadouts rule add -g my-style
164
+ loadouts activate base -g
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Shadowed Files
170
+
171
+ A **shadowed file** is when loadouts wants to write to a path that already has an unmanaged file.
172
+
173
+ Loadout **never overwrites** unmanaged files. It skips and reports in `loadouts status`.
174
+
175
+ **To resolve:**
176
+ ```bash
177
+ # Import the existing file
178
+ loadouts rule import .cursor/rules/existing.mdc
179
+
180
+ # Or remove it manually
181
+ rm .cursor/rules/existing.mdc && loadouts sync
182
+
183
+ # Or keep it (it takes precedence)
184
+ ```
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "loadouts",
3
+ "version": "0.1.11",
4
+ "description": "Composable configuration bundles for AI coding agents",
5
+ "type": "module",
6
+ "bin": {
7
+ "loadouts": "./dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "docs",
12
+ "bundled"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc -p tsconfig.build.json && chmod +x dist/index.js",
16
+ "dev": "tsc --watch",
17
+ "test": "vitest run",
18
+ "test:watch": "vitest",
19
+ "lint": "tsc --noEmit",
20
+ "loadouts": "node dist/index.js"
21
+ },
22
+ "keywords": [
23
+ "ai",
24
+ "agents",
25
+ "cli",
26
+ "configuration",
27
+ "claude",
28
+ "cursor",
29
+ "opencode",
30
+ "codex"
31
+ ],
32
+ "author": "Evatt",
33
+ "license": "Apache-2.0",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/evatths/loadouts.git"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^20.12.0",
40
+ "@types/update-notifier": "^6.0.8",
41
+ "typescript": "^5.4.0",
42
+ "vitest": "^1.5.0"
43
+ },
44
+ "dependencies": {
45
+ "chalk": "^5.3.0",
46
+ "commander": "^12.0.0",
47
+ "update-notifier": "^7.3.1",
48
+ "yaml": "^2.4.0",
49
+ "zod": "^3.23.0"
50
+ },
51
+ "engines": {
52
+ "node": ">=18"
53
+ }
54
+ }