Skip to content

Commit 846387e

Browse files
atomikpandaclaude
andcommitted
feat: add dotular-module creation skill for Claude Code
Skill guides Claude through researching tool config files via web search, scanning the local machine, and producing a complete registry module YAML with cross-platform support. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ecdbbec commit 846387e

1 file changed

Lines changed: 183 additions & 0 deletions

File tree

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
---
2+
name: dotular-module
3+
description: Use when user asks to create a dotular module, add a tool to dotular, or manage a tool's config with dotular. Triggers on phrases like "create a module for X", "add X to dotular", "make a dotular module for X".
4+
---
5+
6+
# Create Dotular Registry Module
7+
8+
Create a complete dotular registry module for a tool by researching its config files, scanning the local machine, and writing the module YAML.
9+
10+
## Process
11+
12+
```dot
13+
digraph module_creation {
14+
"User requests module for tool X" [shape=doublecircle];
15+
"Web search for tool's config" [shape=box];
16+
"Scan local machine for found paths" [shape=box];
17+
"Present summary table" [shape=box];
18+
"User confirms?" [shape=diamond];
19+
"User wants changes?" [shape=diamond];
20+
"Adjust items" [shape=box];
21+
"Create module files" [shape=box];
22+
"Display result" [shape=doublecircle];
23+
24+
"User requests module for tool X" -> "Web search for tool's config";
25+
"Web search for tool's config" -> "Scan local machine for found paths";
26+
"Scan local machine for found paths" -> "Present summary table";
27+
"Present summary table" -> "User confirms?";
28+
"User confirms?" -> "Create module files" [label="yes"];
29+
"User confirms?" -> "User wants changes?" [label="no"];
30+
"User wants changes?" -> "Adjust items" [label="yes"];
31+
"Adjust items" -> "Present summary table";
32+
"User wants changes?" -> "Display result" [label="cancel"];
33+
"Create module files" -> "Display result";
34+
}
35+
```
36+
37+
## Step 1: Research (MANDATORY — do not skip)
38+
39+
You MUST use WebSearch to find the following for the tool across **all three platforms** (macOS, Linux, Windows). Do NOT rely on your training data alone — tools change their config locations across versions.
40+
41+
Search for:
42+
- **Package manager names**: brew/brew-cask, apt, dnf, pacman, choco, winget, scoop, snap, flatpak
43+
- **Config file and directory locations** per OS (check the tool's official docs)
44+
- **macOS defaults domains** (for `setting` items) if the tool writes to `defaults`
45+
- **Post-install setup commands** (for `run` items)
46+
- **Verification command** (usually `tool --version`)
47+
- **Install scripts** (for `script` items, e.g., curl-pipe-bash installers)
48+
49+
## Step 2: Local Scan
50+
51+
For each config path found in research, check if it exists on the user's machine:
52+
53+
```bash
54+
# Expand ~ and check existence
55+
ls -la ~/.config/toolname/ 2>/dev/null
56+
ls -la ~/Library/Application\ Support/ToolName/ 2>/dev/null
57+
```
58+
59+
Record which files/directories exist. This validates your research and identifies files available to copy into the module store.
60+
61+
## Step 3: Present Summary
62+
63+
Show a structured summary using this format:
64+
65+
```
66+
## Proposed module: <tool-name>
67+
68+
### Packages
69+
| Platform | Package | Via | skip_if |
70+
|----------|---------|-----|---------|
71+
| macOS | tool | brew | command -v tool |
72+
| Linux | tool | apt | command -v tool |
73+
| Windows | tool | winget | |
74+
75+
### Config Files & Directories
76+
| Type | Name | Exists? | macOS | Linux | Windows |
77+
|------|------|---------|-------|-------|---------|
78+
| file | config.yml | Yes | ~/.config/tool | ~/.config/tool | %APPDATA%\tool |
79+
| directory | themes | No | ~/.config/tool/themes | ~/.config/tool/themes | %APPDATA%\tool\themes |
80+
81+
### Settings (if any)
82+
| Domain | Key | Value |
83+
|--------|-----|-------|
84+
| com.example.tool | ShowSidebar | true |
85+
86+
### Post-install Commands (if any)
87+
| Command | After |
88+
|---------|-------|
89+
| tool setup | package |
90+
91+
### Recommendation
92+
Include: [items to include and why]
93+
Skip: [items to skip and why]
94+
```
95+
96+
Include a clear recommendation. Wait for user confirmation before proceeding.
97+
98+
## Step 4: Execute
99+
100+
After user confirms:
101+
102+
1. **Create module directory** (if config files exist to store):
103+
```bash
104+
mkdir -p modules/<tool>/
105+
```
106+
107+
2. **Copy existing config files** into the module store:
108+
```bash
109+
cp ~/.config/tool/config.yml modules/<tool>/config.yml
110+
```
111+
File placement rule: files go at `modules/<tool>/<filename>` where `<filename>` matches the `file:` value in the YAML. The runner prepends the module name as `sourcePrefix`.
112+
113+
3. **Write module YAML** at `modules/<tool>.yaml`:
114+
115+
```yaml
116+
name: <tool-name>
117+
version: "1.0.0"
118+
items:
119+
- package: <name>
120+
via: brew
121+
skip_if: command -v <name>
122+
verify: <name> --version
123+
124+
- package: <name>
125+
via: apt
126+
skip_if: command -v <name>
127+
128+
- package: <name-or-id>
129+
via: winget
130+
131+
- file: <filename>
132+
destination:
133+
macos: <path>
134+
linux: <path>
135+
windows: <path>
136+
```
137+
138+
**Multiple package items**: Create a separate `package` item for each platform's package manager (see `dotular.yaml` VS Code module for this pattern). Use `skip_if: command -v <tool>` so only the available manager runs. The runner executes all items — an unavailable package manager simply fails, but `skip_if` prevents redundant installs after the first succeeds.
139+
140+
4. If **no config files** to store (package-only module), skip creating the subdirectory.
141+
142+
## Step 5: Verify
143+
144+
Display the complete contents of the generated `modules/<tool>.yaml` for user review.
145+
146+
## YAML Field Reference
147+
148+
| Field | When to use | Notes |
149+
|-------|-------------|-------|
150+
| `skip_if` | Package and script items | `command -v <tool>` for idempotency |
151+
| `verify` | Package and binary items | Usually `tool --version` |
152+
| `direction` | Omit unless pull/sync needed | Defaults to `push` |
153+
| `link` | When symlink management preferred | Set `true`; omit for copy (default) |
154+
| `permissions` | Sensitive files (credentials, tokens) | Use `"0600"` |
155+
| `after` | Run items that depend on package install | Set to `package` |
156+
| `via` | Required for package/script items | See package managers list below |
157+
158+
### Package managers by platform
159+
160+
| Platform | Managers |
161+
|----------|----------|
162+
| macOS | `brew`, `brew-cask`, `mas` |
163+
| Linux | `apt`, `dnf`, `pacman`, `snap`, `flatpak`, `nix` |
164+
| Windows | `winget`, `choco`, `scoop` |
165+
| Cross-platform | `flatpak`, `nix` |
166+
167+
## Common Mistakes
168+
169+
| Mistake | Fix |
170+
|---------|-----|
171+
| Relying on training data for config paths | ALWAYS web search — paths change between versions |
172+
| Missing `skip_if` on package items | Add `skip_if: command -v <tool>` for idempotency |
173+
| Using trailing `/` in destination | Match existing convention: `~/.config/tool` not `~/.config/tool/` |
174+
| Forgetting Windows paths | Always research all 3 platforms for PlatformMap |
175+
| Editing user's `dotular.yaml` | This skill creates REGISTRY modules only — never touch personal config |
176+
| Updating `modules/index.yaml` | Out of scope — tell user to add the entry manually |
177+
178+
## Out of Scope
179+
180+
- Editing the user's personal `dotular.yaml`
181+
- Updating `modules/index.yaml` (remind user to do this manually)
182+
- Encryption (`encrypted` field) or hooks
183+
- Parameters/templating

0 commit comments

Comments
 (0)