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.
- package/LICENSE +201 -0
- package/README.md +108 -0
- package/bundled/loadouts/loadouts.yaml +5 -0
- package/bundled/skills/loadout-usage/SKILL.md +110 -0
- package/dist/builtins/index.d.ts +14 -0
- package/dist/builtins/index.d.ts.map +1 -0
- package/dist/builtins/index.js +58 -0
- package/dist/builtins/index.js.map +1 -0
- package/dist/builtins/kinds/extension.d.ts +3 -0
- package/dist/builtins/kinds/extension.d.ts.map +1 -0
- package/dist/builtins/kinds/extension.js +9 -0
- package/dist/builtins/kinds/extension.js.map +1 -0
- package/dist/builtins/kinds/instruction.d.ts +3 -0
- package/dist/builtins/kinds/instruction.d.ts.map +1 -0
- package/dist/builtins/kinds/instruction.js +8 -0
- package/dist/builtins/kinds/instruction.js.map +1 -0
- package/dist/builtins/kinds/prompt.d.ts +3 -0
- package/dist/builtins/kinds/prompt.d.ts.map +1 -0
- package/dist/builtins/kinds/prompt.js +8 -0
- package/dist/builtins/kinds/prompt.js.map +1 -0
- package/dist/builtins/kinds/rule.d.ts +3 -0
- package/dist/builtins/kinds/rule.d.ts.map +1 -0
- package/dist/builtins/kinds/rule.js +10 -0
- package/dist/builtins/kinds/rule.js.map +1 -0
- package/dist/builtins/kinds/skill.d.ts +3 -0
- package/dist/builtins/kinds/skill.d.ts.map +1 -0
- package/dist/builtins/kinds/skill.js +8 -0
- package/dist/builtins/kinds/skill.js.map +1 -0
- package/dist/builtins/kinds/theme.d.ts +3 -0
- package/dist/builtins/kinds/theme.d.ts.map +1 -0
- package/dist/builtins/kinds/theme.js +8 -0
- package/dist/builtins/kinds/theme.js.map +1 -0
- package/dist/builtins/tools/claude-code.d.ts +3 -0
- package/dist/builtins/tools/claude-code.d.ts.map +1 -0
- package/dist/builtins/tools/claude-code.js +30 -0
- package/dist/builtins/tools/claude-code.js.map +1 -0
- package/dist/builtins/tools/codex.d.ts +3 -0
- package/dist/builtins/tools/codex.d.ts.map +1 -0
- package/dist/builtins/tools/codex.js +17 -0
- package/dist/builtins/tools/codex.js.map +1 -0
- package/dist/builtins/tools/cursor.d.ts +3 -0
- package/dist/builtins/tools/cursor.d.ts.map +1 -0
- package/dist/builtins/tools/cursor.js +22 -0
- package/dist/builtins/tools/cursor.js.map +1 -0
- package/dist/builtins/tools/opencode.d.ts +3 -0
- package/dist/builtins/tools/opencode.d.ts.map +1 -0
- package/dist/builtins/tools/opencode.js +45 -0
- package/dist/builtins/tools/opencode.js.map +1 -0
- package/dist/builtins/tools/pi.d.ts +3 -0
- package/dist/builtins/tools/pi.d.ts.map +1 -0
- package/dist/builtins/tools/pi.js +22 -0
- package/dist/builtins/tools/pi.js.map +1 -0
- package/dist/cli/commands/activate.d.ts +12 -0
- package/dist/cli/commands/activate.d.ts.map +1 -0
- package/dist/cli/commands/activate.js +70 -0
- package/dist/cli/commands/activate.js.map +1 -0
- package/dist/cli/commands/check.d.ts +12 -0
- package/dist/cli/commands/check.d.ts.map +1 -0
- package/dist/cli/commands/check.js +152 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/clear.d.ts +12 -0
- package/dist/cli/commands/clear.d.ts.map +1 -0
- package/dist/cli/commands/clear.js +25 -0
- package/dist/cli/commands/clear.js.map +1 -0
- package/dist/cli/commands/create.d.ts +11 -0
- package/dist/cli/commands/create.d.ts.map +1 -0
- package/dist/cli/commands/create.js +113 -0
- package/dist/cli/commands/create.js.map +1 -0
- package/dist/cli/commands/deactivate.d.ts +12 -0
- package/dist/cli/commands/deactivate.d.ts.map +1 -0
- package/dist/cli/commands/deactivate.js +67 -0
- package/dist/cli/commands/deactivate.js.map +1 -0
- package/dist/cli/commands/diff.d.ts +16 -0
- package/dist/cli/commands/diff.d.ts.map +1 -0
- package/dist/cli/commands/diff.js +144 -0
- package/dist/cli/commands/diff.js.map +1 -0
- package/dist/cli/commands/docs.d.ts +12 -0
- package/dist/cli/commands/docs.d.ts.map +1 -0
- package/dist/cli/commands/docs.js +115 -0
- package/dist/cli/commands/docs.js.map +1 -0
- package/dist/cli/commands/edit.d.ts +11 -0
- package/dist/cli/commands/edit.d.ts.map +1 -0
- package/dist/cli/commands/edit.js +71 -0
- package/dist/cli/commands/edit.js.map +1 -0
- package/dist/cli/commands/fallback.d.ts +9 -0
- package/dist/cli/commands/fallback.d.ts.map +1 -0
- package/dist/cli/commands/fallback.js +35 -0
- package/dist/cli/commands/fallback.js.map +1 -0
- package/dist/cli/commands/info.d.ts +23 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/info.js +314 -0
- package/dist/cli/commands/info.js.map +1 -0
- package/dist/cli/commands/init.d.ts +18 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +255 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/install.d.ts +27 -0
- package/dist/cli/commands/install.d.ts.map +1 -0
- package/dist/cli/commands/install.js +586 -0
- package/dist/cli/commands/install.js.map +1 -0
- package/dist/cli/commands/instructions.d.ts +8 -0
- package/dist/cli/commands/instructions.d.ts.map +1 -0
- package/dist/cli/commands/instructions.js +218 -0
- package/dist/cli/commands/instructions.js.map +1 -0
- package/dist/cli/commands/kinds.d.ts +6 -0
- package/dist/cli/commands/kinds.d.ts.map +1 -0
- package/dist/cli/commands/kinds.js +59 -0
- package/dist/cli/commands/kinds.js.map +1 -0
- package/dist/cli/commands/list.d.ts +12 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +182 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/policy.d.ts +28 -0
- package/dist/cli/commands/policy.d.ts.map +1 -0
- package/dist/cli/commands/policy.js +50 -0
- package/dist/cli/commands/policy.js.map +1 -0
- package/dist/cli/commands/remove.d.ts +24 -0
- package/dist/cli/commands/remove.d.ts.map +1 -0
- package/dist/cli/commands/remove.js +64 -0
- package/dist/cli/commands/remove.js.map +1 -0
- package/dist/cli/commands/render-engine.d.ts +36 -0
- package/dist/cli/commands/render-engine.d.ts.map +1 -0
- package/dist/cli/commands/render-engine.js +177 -0
- package/dist/cli/commands/render-engine.js.map +1 -0
- package/dist/cli/commands/rule.d.ts +11 -0
- package/dist/cli/commands/rule.d.ts.map +1 -0
- package/dist/cli/commands/rule.js +302 -0
- package/dist/cli/commands/rule.js.map +1 -0
- package/dist/cli/commands/sanitize.d.ts +14 -0
- package/dist/cli/commands/sanitize.d.ts.map +1 -0
- package/dist/cli/commands/sanitize.js +62 -0
- package/dist/cli/commands/sanitize.js.map +1 -0
- package/dist/cli/commands/skill.d.ts +11 -0
- package/dist/cli/commands/skill.d.ts.map +1 -0
- package/dist/cli/commands/skill.js +380 -0
- package/dist/cli/commands/skill.js.map +1 -0
- package/dist/cli/commands/status.d.ts +26 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +454 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/sync.d.ts +14 -0
- package/dist/cli/commands/sync.d.ts.map +1 -0
- package/dist/cli/commands/sync.js +53 -0
- package/dist/cli/commands/sync.js.map +1 -0
- package/dist/cli/commands/update.d.ts +3 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +48 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/index.d.ts +11 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +134 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/config.d.ts +64 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +166 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/discovery.d.ts +50 -0
- package/dist/core/discovery.d.ts.map +1 -0
- package/dist/core/discovery.js +249 -0
- package/dist/core/discovery.js.map +1 -0
- package/dist/core/fallback.d.ts +23 -0
- package/dist/core/fallback.d.ts.map +1 -0
- package/dist/core/fallback.js +119 -0
- package/dist/core/fallback.js.map +1 -0
- package/dist/core/import-discovery.d.ts +56 -0
- package/dist/core/import-discovery.d.ts.map +1 -0
- package/dist/core/import-discovery.js +304 -0
- package/dist/core/import-discovery.js.map +1 -0
- package/dist/core/kindLoader.d.ts +119 -0
- package/dist/core/kindLoader.d.ts.map +1 -0
- package/dist/core/kindLoader.js +141 -0
- package/dist/core/kindLoader.js.map +1 -0
- package/dist/core/manifest.d.ts +39 -0
- package/dist/core/manifest.d.ts.map +1 -0
- package/dist/core/manifest.js +167 -0
- package/dist/core/manifest.js.map +1 -0
- package/dist/core/plugin.d.ts +22 -0
- package/dist/core/plugin.d.ts.map +1 -0
- package/dist/core/plugin.js +20 -0
- package/dist/core/plugin.js.map +1 -0
- package/dist/core/registry.d.ts +115 -0
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/core/registry.js +105 -0
- package/dist/core/registry.js.map +1 -0
- package/dist/core/render.d.ts +64 -0
- package/dist/core/render.d.ts.map +1 -0
- package/dist/core/render.js +457 -0
- package/dist/core/render.js.map +1 -0
- package/dist/core/resolve.d.ts +39 -0
- package/dist/core/resolve.d.ts.map +1 -0
- package/dist/core/resolve.js +128 -0
- package/dist/core/resolve.js.map +1 -0
- package/dist/core/schema.d.ts +308 -0
- package/dist/core/schema.d.ts.map +1 -0
- package/dist/core/schema.js +81 -0
- package/dist/core/schema.js.map +1 -0
- package/dist/core/scope.d.ts +74 -0
- package/dist/core/scope.d.ts.map +1 -0
- package/dist/core/scope.js +176 -0
- package/dist/core/scope.js.map +1 -0
- package/dist/core/template.d.ts +32 -0
- package/dist/core/template.d.ts.map +1 -0
- package/dist/core/template.js +32 -0
- package/dist/core/template.js.map +1 -0
- package/dist/core/tokens.d.ts +33 -0
- package/dist/core/tokens.d.ts.map +1 -0
- package/dist/core/tokens.js +97 -0
- package/dist/core/tokens.js.map +1 -0
- package/dist/core/types.d.ts +103 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +10 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/artifact-paths.d.ts +39 -0
- package/dist/lib/artifact-paths.d.ts.map +1 -0
- package/dist/lib/artifact-paths.js +83 -0
- package/dist/lib/artifact-paths.js.map +1 -0
- package/dist/lib/artifact-table.d.ts +126 -0
- package/dist/lib/artifact-table.d.ts.map +1 -0
- package/dist/lib/artifact-table.js +263 -0
- package/dist/lib/artifact-table.js.map +1 -0
- package/dist/lib/editor.d.ts +17 -0
- package/dist/lib/editor.d.ts.map +1 -0
- package/dist/lib/editor.js +33 -0
- package/dist/lib/editor.js.map +1 -0
- package/dist/lib/fs.d.ts +87 -0
- package/dist/lib/fs.d.ts.map +1 -0
- package/dist/lib/fs.js +229 -0
- package/dist/lib/fs.js.map +1 -0
- package/dist/lib/git.d.ts +13 -0
- package/dist/lib/git.d.ts.map +1 -0
- package/dist/lib/git.js +28 -0
- package/dist/lib/git.js.map +1 -0
- package/dist/lib/gitignore.d.ts +26 -0
- package/dist/lib/gitignore.d.ts.map +1 -0
- package/dist/lib/gitignore.js +97 -0
- package/dist/lib/gitignore.js.map +1 -0
- package/dist/lib/loadout-column.d.ts +66 -0
- package/dist/lib/loadout-column.d.ts.map +1 -0
- package/dist/lib/loadout-column.js +66 -0
- package/dist/lib/loadout-column.js.map +1 -0
- package/dist/lib/output.d.ts +15 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +32 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/scope-indicators.d.ts +60 -0
- package/dist/lib/scope-indicators.d.ts.map +1 -0
- package/dist/lib/scope-indicators.js +110 -0
- package/dist/lib/scope-indicators.js.map +1 -0
- package/docs/authoring.md +182 -0
- package/docs/commands.md +192 -0
- package/docs/concepts.md +114 -0
- package/docs/index.md +60 -0
- package/docs/quickstart.md +100 -0
- package/docs/troubleshooting.md +147 -0
- package/docs/visual-language.md +251 -0
- package/docs/workflows.md +184 -0
- 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
|
+
}
|