Commit fed17ec
authored
feat: add Claude Code integration for end-users (#63)
### **User description**
## Summary
Adds Claude Code integration for SRTD end-users:
- **Skill** (`.claude/skills/srtd-cli/SKILL.md`): Focused on iterative
SQL template development workflow with watch mode central. Written for
LLM consumption, not human documentation.
- **Rule** (`.claude/rules/srtd.md`): Path-scoped guardrails injected
when editing template files (`**/migrations-templates/**/*.sql`)
- **README section**: Simple copy commands for users to add integration
to their projects
### Key Design Decisions
The skill is intentionally minimal and workflow-focused:
1. Start with `srtd watch --json` in background
2. Monitor via `TaskOutput` for `templateApplied`/`templateError` events
3. Iterate on templates until working
4. Build only at the end
Not a comprehensive CLI reference - just what an LLM needs to work
effectively with SRTD.
## Test plan
- [x] Verified skill loads via `/srtd-cli`
- [x] Tested watch mode in background with `--json` flag
- [x] Created templates, saw them apply, introduced errors, fixed them
- [x] Confirmed rule format matches Claude Code spec (quoted glob
patterns in YAML array)
___
### **PR Type**
Enhancement
___
### **Description**
- Add Claude Code skill and rule for SRTD template development
- Rewrite skill focused on iterative watch-mode workflow
- Provide copy commands in README for easy integration
- Remove test template and build log from sample directory
___
### Diagram Walkthrough
```mermaid
flowchart LR
A["Claude Code User"] -->|"activates skill"| B["SRTD Skill<br/>srtd-cli/SKILL.md"]
B -->|"guides workflow"| C["Start watch --json<br/>in background"]
C -->|"monitor events"| D["templateApplied/<br/>templateError"]
D -->|"iterate templates"| E["Edit SQL files"]
E -->|"when ready"| F["srtd build"]
G["Path-scoped Rule<br/>.claude/rules/srtd.md"] -->|"provides inline<br/>guardrails"| E
H["README section"] -->|"copy commands"| I["Install to project"]
```
<details><summary><h3>File Walkthrough</h3></summary>
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>SKILL.md</strong><dd><code>Rewrite skill for
LLM-focused iterative workflow</code>
</dd></summary>
<hr>
.claude/skills/srtd-cli/SKILL.md
<ul><li>Rewritten from comprehensive CLI reference to focused iterative
<br>workflow guide<br> <li> Emphasizes starting <code>srtd watch
--json</code> in background as first step<br> <li> Documents monitoring
<code>TaskOutput</code> for
<code>templateApplied</code>/<code>templateError</code> <br>events<br>
<li> Simplified template patterns with idempotent examples for
functions, <br>policies, triggers<br> <li> Removed command tables,
keyboard shortcuts, and configuration details</ul>
</details>
</td>
<td><a
href="https://github.com/t1mmen/srtd/pull/63/files#diff-49eac8f54faaaaa96bf927aaa971dde73830bdbe11c706a1e9232974e98a879b">+41/-180</a></td>
</tr>
<tr>
<td>
<details>
<summary><strong>srtd.md</strong><dd><code>Add path-scoped rules for
template file editing</code>
</dd></summary>
<hr>
.claude/rules/srtd.md
<ul><li>New file providing path-scoped guardrails for template files<br>
<li> Covers required idempotent patterns for functions, views, policies,
<br>triggers<br> <li> Documents template dependencies via
<code>@depends-on</code> comments<br> <li> Explains WIP template
behavior and testing workflow<br> <li> Lists common mistakes to avoid
when editing templates</ul>
</details>
</td>
<td><a
href="https://github.com/t1mmen/srtd/pull/63/files#diff-d1bcafa2b5a3d62e5513e94324f50f7d29da4569365062075c6fbf4ab6259098">+48/-0</a>
</td>
</tr>
</table></td></tr><tr><td><strong>Documentation</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>README.md</strong><dd><code>Add Claude Code integration
setup instructions</code>
</dd></summary>
<hr>
README.md
<ul><li>Add new "Claude Code Integration" section with copy commands<br>
<li> Provide instructions to copy skill and rule from node_modules to
<br>project<br> <li> Brief explanation of skill activation and rule
guidance</ul>
</details>
</td>
<td><a
href="https://github.com/t1mmen/srtd/pull/63/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5">+12/-0</a>
</td>
</tr>
</table></td></tr><tr><td><strong>Miscellaneous</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>.srtd.buildlog.json</strong><dd><code>Remove test build
log file</code>
</dd></summary>
<hr>
supabase/migrations-templates/.srtd.buildlog.json
- Removed test build log file from sample directory
</details>
</td>
<td><a
href="https://github.com/t1mmen/srtd/pull/63/files#diff-bda5df27adb782036a76d413c8b895dce469785af067dbd2f9d9cc9a56675cd7">+0/-11</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>test.sql</strong><dd><code>Remove test template
file</code>
</dd></summary>
<hr>
supabase/migrations-templates/test.sql
- Removed test template file from sample directory
</details>
</td>
<td><a
href="https://github.com/t1mmen/srtd/pull/63/files#diff-60e63cc33c071554e9f9c757d797badf3d0b8b2e6ff1771a7b4f711986efa964">+0/-6</a>
</td>
</tr>
</table></td></tr></tbody></table>
</details>
___1 parent 085985b commit fed17ec
File tree
5 files changed
+51
-222
lines changed- .claude
- rules
- skills/srtd-cli
- supabase/migrations-templates
5 files changed
+51
-222
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 8 | + | |
145 | 9 | | |
| 10 | + | |
146 | 11 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 12 | + | |
168 | 13 | | |
| 14 | + | |
169 | 15 | | |
170 | | - | |
| 16 | + | |
171 | 17 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 18 | + | |
176 | 19 | | |
177 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
178 | 24 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 25 | + | |
186 | 26 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 27 | + | |
192 | 28 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 29 | + | |
209 | 30 | | |
210 | | - | |
211 | 31 | | |
212 | | - | |
213 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
214 | 35 | | |
215 | 36 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 37 | + | |
220 | 38 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 39 | + | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
236 | 248 | | |
237 | 249 | | |
238 | 250 | | |
| |||
This file was deleted.
This file was deleted.
0 commit comments