aiblueprint-cli 1.4.22 → 1.4.24
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/claude-code-config/skills/git-commit/SKILL.md +42 -0
- package/claude-code-config/{commands/git/create-pr.md → skills/git-create-pr/SKILL.md} +12 -18
- package/claude-code-config/skills/git-fix-pr-comments/SKILL.md +51 -0
- package/claude-code-config/skills/git-merge/SKILL.md +68 -0
- package/claude-code-config/skills/{claude-memory → meta-claude-memory}/SKILL.md +7 -2
- package/claude-code-config/skills/meta-claude-memory/references/rules-directory-guide.md +298 -0
- package/claude-code-config/skills/meta-prompt-creator/SKILL.md +285 -0
- package/claude-code-config/skills/meta-prompt-creator/references/anthropic-best-practices.md +126 -0
- package/claude-code-config/skills/meta-prompt-creator/references/anti-patterns.md +57 -0
- package/claude-code-config/skills/meta-prompt-creator/references/clarity-principles.md +54 -0
- package/claude-code-config/skills/meta-prompt-creator/references/context-management.md +389 -0
- package/claude-code-config/skills/meta-prompt-creator/references/few-shot-patterns.md +47 -0
- package/claude-code-config/skills/meta-prompt-creator/references/openai-best-practices.md +50 -0
- package/claude-code-config/skills/meta-prompt-creator/references/prompt-templates.md +110 -0
- package/claude-code-config/skills/meta-prompt-creator/references/reasoning-techniques.md +52 -0
- package/claude-code-config/skills/meta-prompt-creator/references/system-prompt-patterns.md +48 -0
- package/claude-code-config/skills/meta-prompt-creator/references/xml-structure.md +36 -0
- package/claude-code-config/skills/meta-skill-creator/LICENSE.txt +202 -0
- package/claude-code-config/skills/meta-skill-creator/SKILL.md +421 -0
- package/claude-code-config/skills/meta-skill-creator/package.json +5 -0
- package/claude-code-config/skills/meta-skill-creator/references/output-patterns.md +82 -0
- package/claude-code-config/skills/meta-skill-creator/references/progressive-disclosure-patterns.md +374 -0
- package/claude-code-config/skills/meta-skill-creator/references/prompting-integration.md +363 -0
- package/claude-code-config/skills/meta-skill-creator/references/real-world-examples.md +513 -0
- package/claude-code-config/skills/meta-skill-creator/references/script-patterns.md +385 -0
- package/claude-code-config/skills/meta-skill-creator/references/workflows.md +28 -0
- package/claude-code-config/skills/meta-skill-creator/references/xml-tag-guide.md +606 -0
- package/claude-code-config/skills/meta-skill-creator/scripts/init-skill.ts +214 -0
- package/claude-code-config/skills/meta-skill-creator/scripts/package-skill.ts +146 -0
- package/claude-code-config/skills/meta-skill-creator/scripts/validate.ts +138 -0
- package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/SKILL.md +41 -15
- package/claude-code-config/skills/{setup-ralph → ralph-loop}/steps/step-00-init.md +2 -3
- package/claude-code-config/skills/utils-fix-errors/SKILL.md +61 -0
- package/claude-code-config/skills/utils-fix-grammar/SKILL.md +59 -0
- package/claude-code-config/skills/utils-oneshot/SKILL.md +56 -0
- package/claude-code-config/skills/workflow-apex/SKILL.md +303 -0
- package/claude-code-config/skills/workflow-apex/scripts/setup-templates.sh +134 -0
- package/claude-code-config/skills/workflow-apex/scripts/update-progress.sh +80 -0
- package/claude-code-config/skills/workflow-apex/steps/step-00-init.md +288 -0
- package/claude-code-config/skills/workflow-apex/steps/step-00b-branch.md +126 -0
- package/claude-code-config/skills/workflow-apex/steps/step-00b-economy.md +244 -0
- package/claude-code-config/skills/workflow-apex/steps/step-00b-interactive.md +153 -0
- package/claude-code-config/skills/workflow-apex/steps/step-01-analyze.md +361 -0
- package/claude-code-config/skills/workflow-apex/steps/step-02-plan.md +264 -0
- package/claude-code-config/skills/workflow-apex/steps/step-03-execute.md +239 -0
- package/claude-code-config/skills/workflow-apex/steps/step-04-validate.md +264 -0
- package/claude-code-config/skills/workflow-apex/steps/step-05-examine.md +294 -0
- package/claude-code-config/skills/workflow-apex/steps/step-06-resolve.md +237 -0
- package/claude-code-config/skills/workflow-apex/steps/step-07-tests.md +250 -0
- package/claude-code-config/skills/workflow-apex/steps/step-08-run-tests.md +308 -0
- package/claude-code-config/skills/workflow-apex/steps/step-09-finish.md +193 -0
- package/claude-code-config/skills/workflow-apex/templates/00-context.md +51 -0
- package/claude-code-config/skills/workflow-apex/templates/01-analyze.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/02-plan.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/03-execute.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/04-validate.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/05-examine.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/06-resolve.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/07-tests.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/08-run-tests.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/09-finish.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/README.md +195 -0
- package/claude-code-config/skills/workflow-apex/templates/step-complete.md +7 -0
- package/dist/cli.js +46 -3
- package/package.json +1 -1
- package/claude-code-config/commands/explore.md +0 -90
- package/claude-code-config/commands/git/commit.md +0 -60
- package/claude-code-config/commands/git/fix-pr-comments.md +0 -59
- package/claude-code-config/commands/oneshot.md +0 -57
- package/claude-code-config/skills/create-slash-commands/SKILL.md +0 -1110
- package/claude-code-config/skills/create-slash-commands/references/arguments.md +0 -273
- package/claude-code-config/skills/create-slash-commands/references/patterns.md +0 -947
- package/claude-code-config/skills/create-slash-commands/references/prompt-examples.md +0 -656
- package/claude-code-config/skills/create-slash-commands/references/tool-restrictions.md +0 -389
- /package/claude-code-config/skills/{claude-memory → meta-claude-memory}/references/comprehensive-example.md +0 -0
- /package/claude-code-config/skills/{claude-memory → meta-claude-memory}/references/project-patterns.md +0 -0
- /package/claude-code-config/skills/{claude-memory → meta-claude-memory}/references/prompting-techniques.md +0 -0
- /package/claude-code-config/skills/{claude-memory → meta-claude-memory}/references/section-templates.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/context-management.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/debugging-agents.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/error-handling-and-recovery.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/evaluation-and-testing.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/orchestration-patterns.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/subagents.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/writing-subagent-prompts.md +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/SKILL.md +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/scripts/setup.sh +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/steps/step-01-interactive-prd.md +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/steps/step-02-create-stories.md +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/steps/step-03-finish.md +0 -0
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
Complete examples of well-structured skills demonstrating best practices, progressive disclosure, and expert prompting techniques.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<example name="simple_skill">
|
|
6
|
+
**Type**: Simple skill with required tags only
|
|
7
|
+
|
|
8
|
+
**Directory structure**:
|
|
9
|
+
```
|
|
10
|
+
process-pdfs/
|
|
11
|
+
└── SKILL.md
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
**SKILL.md**:
|
|
15
|
+
```yaml
|
|
16
|
+
---
|
|
17
|
+
name: process-pdfs
|
|
18
|
+
description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
<objective>
|
|
22
|
+
Extract text and tables from PDF files, fill forms, and merge documents using Python libraries.
|
|
23
|
+
|
|
24
|
+
This skill provides comprehensive PDF processing capabilities for data extraction, form automation, and document manipulation tasks.
|
|
25
|
+
</objective>
|
|
26
|
+
|
|
27
|
+
<quick_start>
|
|
28
|
+
Extract text with pdfplumber:
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
import pdfplumber
|
|
32
|
+
|
|
33
|
+
with pdfplumber.open("file.pdf") as pdf:
|
|
34
|
+
# Extract text from first page
|
|
35
|
+
text = pdf.pages[0].extract_text()
|
|
36
|
+
print(text)
|
|
37
|
+
|
|
38
|
+
# Extract tables
|
|
39
|
+
tables = pdf.pages[0].extract_tables()
|
|
40
|
+
for table in tables:
|
|
41
|
+
print(table)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Install required package:
|
|
45
|
+
```bash
|
|
46
|
+
pip install pdfplumber
|
|
47
|
+
```
|
|
48
|
+
</quick_start>
|
|
49
|
+
|
|
50
|
+
<common_patterns>
|
|
51
|
+
<pattern name="batch_processing">
|
|
52
|
+
Process multiple PDFs:
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from pathlib import Path
|
|
56
|
+
|
|
57
|
+
pdf_dir = Path("pdfs/")
|
|
58
|
+
for pdf_file in pdf_dir.glob("*.pdf"):
|
|
59
|
+
with pdfplumber.open(pdf_file) as pdf:
|
|
60
|
+
text = pdf.pages[0].extract_text()
|
|
61
|
+
output_file = pdf_file.with_suffix(".txt")
|
|
62
|
+
output_file.write_text(text)
|
|
63
|
+
```
|
|
64
|
+
</pattern>
|
|
65
|
+
|
|
66
|
+
<pattern name="error_handling">
|
|
67
|
+
Handle corrupted PDFs gracefully:
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
try:
|
|
71
|
+
with pdfplumber.open(pdf_path) as pdf:
|
|
72
|
+
text = pdf.pages[0].extract_text()
|
|
73
|
+
except Exception as e:
|
|
74
|
+
print(f"Failed to process {pdf_path}: {e}")
|
|
75
|
+
continue
|
|
76
|
+
```
|
|
77
|
+
</pattern>
|
|
78
|
+
</common_patterns>
|
|
79
|
+
|
|
80
|
+
<success_criteria>
|
|
81
|
+
- Text extracted successfully from PDF
|
|
82
|
+
- Output is clean and properly formatted
|
|
83
|
+
- No encoding errors
|
|
84
|
+
- Tables parsed into structured data
|
|
85
|
+
</success_criteria>
|
|
86
|
+
```
|
|
87
|
+
</example>
|
|
88
|
+
|
|
89
|
+
<example name="standard_skill">
|
|
90
|
+
**Type**: Standard skill with progressive disclosure
|
|
91
|
+
|
|
92
|
+
**Directory structure**:
|
|
93
|
+
```
|
|
94
|
+
manage-stripe/
|
|
95
|
+
├── SKILL.md
|
|
96
|
+
├── references/
|
|
97
|
+
│ ├── payments.md
|
|
98
|
+
│ ├── subscriptions.md
|
|
99
|
+
│ └── webhooks.md
|
|
100
|
+
└── scripts/
|
|
101
|
+
└── validate-webhook.py
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**SKILL.md**:
|
|
105
|
+
```yaml
|
|
106
|
+
---
|
|
107
|
+
name: manage-stripe
|
|
108
|
+
description: This skill should be used when the user asks to "manage Stripe", "create Stripe payment", "handle subscriptions", "process webhooks", or mentions Stripe API, payment processing, or subscription management.
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
<objective>
|
|
112
|
+
Manage Stripe payments, subscriptions, and webhooks using the Stripe API. This skill provides comprehensive Stripe integration patterns with security best practices.
|
|
113
|
+
</objective>
|
|
114
|
+
|
|
115
|
+
<quick_start>
|
|
116
|
+
<setup>
|
|
117
|
+
Install Stripe SDK:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
pip install stripe
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Set API key:
|
|
124
|
+
|
|
125
|
+
```python
|
|
126
|
+
import stripe
|
|
127
|
+
stripe.api_key = os.environ["STRIPE_SECRET_KEY"]
|
|
128
|
+
```
|
|
129
|
+
</setup>
|
|
130
|
+
|
|
131
|
+
<create_payment>
|
|
132
|
+
Create a payment intent:
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
intent = stripe.PaymentIntent.create(
|
|
136
|
+
amount=1000, # Amount in cents
|
|
137
|
+
currency="usd",
|
|
138
|
+
payment_method_types=["card"]
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
print(intent.client_secret)
|
|
142
|
+
```
|
|
143
|
+
</create_payment>
|
|
144
|
+
</quick_start>
|
|
145
|
+
|
|
146
|
+
<security_checklist>
|
|
147
|
+
**Before deploying**:
|
|
148
|
+
|
|
149
|
+
- [ ] API keys stored in environment variables (never hardcoded)
|
|
150
|
+
- [ ] Webhook signatures validated (prevent tampering)
|
|
151
|
+
- [ ] Amounts in cents to avoid decimal precision issues
|
|
152
|
+
- [ ] Idempotency keys used for critical operations
|
|
153
|
+
- [ ] Error messages don't leak sensitive information
|
|
154
|
+
- [ ] Test mode vs live mode clearly separated
|
|
155
|
+
</security_checklist>
|
|
156
|
+
|
|
157
|
+
<reference_guides>
|
|
158
|
+
For detailed guidance on specific features:
|
|
159
|
+
|
|
160
|
+
- **`references/payments.md`** - Payment intents, charges, refunds
|
|
161
|
+
- **`references/subscriptions.md`** - Subscription creation, management, billing
|
|
162
|
+
- **`references/webhooks.md`** - Webhook handling, signature validation
|
|
163
|
+
|
|
164
|
+
For webhook validation, use:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
python scripts/validate-webhook.py payload.json signature
|
|
168
|
+
```
|
|
169
|
+
</reference_guides>
|
|
170
|
+
|
|
171
|
+
<success_criteria>
|
|
172
|
+
- Payment processed successfully
|
|
173
|
+
- Webhook signatures validated
|
|
174
|
+
- Errors handled gracefully
|
|
175
|
+
- Security checklist items verified
|
|
176
|
+
- Idempotency maintained
|
|
177
|
+
</success_criteria>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**references/payments.md**:
|
|
181
|
+
```xml
|
|
182
|
+
<overview>
|
|
183
|
+
Complete guide to Stripe payment processing including payment intents, charges, and refunds.
|
|
184
|
+
</overview>
|
|
185
|
+
|
|
186
|
+
<payment_intents>
|
|
187
|
+
<create_intent>
|
|
188
|
+
Create a payment intent for one-time payments:
|
|
189
|
+
|
|
190
|
+
```python
|
|
191
|
+
import stripe
|
|
192
|
+
|
|
193
|
+
intent = stripe.PaymentIntent.create(
|
|
194
|
+
amount=2000,
|
|
195
|
+
currency="usd",
|
|
196
|
+
payment_method_types=["card"],
|
|
197
|
+
metadata={"order_id": "123"}
|
|
198
|
+
)
|
|
199
|
+
```
|
|
200
|
+
</create_intent>
|
|
201
|
+
|
|
202
|
+
<confirm_intent>
|
|
203
|
+
Confirm a payment intent:
|
|
204
|
+
|
|
205
|
+
```python
|
|
206
|
+
intent = stripe.PaymentIntent.confirm(
|
|
207
|
+
intent.id,
|
|
208
|
+
payment_method="pm_card_visa"
|
|
209
|
+
)
|
|
210
|
+
```
|
|
211
|
+
</confirm_intent>
|
|
212
|
+
</payment_intents>
|
|
213
|
+
|
|
214
|
+
<refunds>
|
|
215
|
+
<create_refund>
|
|
216
|
+
Issue a full refund:
|
|
217
|
+
|
|
218
|
+
```python
|
|
219
|
+
refund = stripe.Refund.create(
|
|
220
|
+
payment_intent=intent.id
|
|
221
|
+
)
|
|
222
|
+
```
|
|
223
|
+
</create_refund>
|
|
224
|
+
|
|
225
|
+
<partial_refund>
|
|
226
|
+
Issue a partial refund:
|
|
227
|
+
|
|
228
|
+
```python
|
|
229
|
+
refund = stripe.Refund.create(
|
|
230
|
+
payment_intent=intent.id,
|
|
231
|
+
amount=500 # Partial amount in cents
|
|
232
|
+
)
|
|
233
|
+
```
|
|
234
|
+
</partial_refund>
|
|
235
|
+
</refunds>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
**scripts/validate-webhook.py**:
|
|
239
|
+
```python
|
|
240
|
+
#!/usr/bin/env python3
|
|
241
|
+
"""Validate Stripe webhook signature."""
|
|
242
|
+
import sys
|
|
243
|
+
import stripe
|
|
244
|
+
import os
|
|
245
|
+
|
|
246
|
+
def validate_webhook(payload, signature):
|
|
247
|
+
"""Validate webhook signature."""
|
|
248
|
+
webhook_secret = os.environ.get("STRIPE_WEBHOOK_SECRET")
|
|
249
|
+
|
|
250
|
+
if not webhook_secret:
|
|
251
|
+
print("❌ STRIPE_WEBHOOK_SECRET not set")
|
|
252
|
+
return False
|
|
253
|
+
|
|
254
|
+
try:
|
|
255
|
+
event = stripe.Webhook.construct_event(
|
|
256
|
+
payload, signature, webhook_secret
|
|
257
|
+
)
|
|
258
|
+
print(f"✅ Valid webhook: {event['type']}")
|
|
259
|
+
return True
|
|
260
|
+
except ValueError:
|
|
261
|
+
print("❌ Invalid payload")
|
|
262
|
+
return False
|
|
263
|
+
except stripe.error.SignatureVerificationError:
|
|
264
|
+
print("❌ Invalid signature")
|
|
265
|
+
return False
|
|
266
|
+
|
|
267
|
+
if __name__ == "__main__":
|
|
268
|
+
if len(sys.argv) < 3:
|
|
269
|
+
print("Usage: validate-webhook.py <payload-file> <signature>")
|
|
270
|
+
sys.exit(1)
|
|
271
|
+
|
|
272
|
+
with open(sys.argv[1]) as f:
|
|
273
|
+
payload = f.read()
|
|
274
|
+
|
|
275
|
+
signature = sys.argv[2]
|
|
276
|
+
success = validate_webhook(payload, signature)
|
|
277
|
+
sys.exit(0 if success else 1)
|
|
278
|
+
```
|
|
279
|
+
</example>
|
|
280
|
+
|
|
281
|
+
<example name="complex_skill">
|
|
282
|
+
**Type**: Complex skill with multiple domains
|
|
283
|
+
|
|
284
|
+
**Directory structure**:
|
|
285
|
+
```
|
|
286
|
+
manage-bigquery/
|
|
287
|
+
├── SKILL.md
|
|
288
|
+
├── references/
|
|
289
|
+
│ ├── finance.md
|
|
290
|
+
│ ├── sales.md
|
|
291
|
+
│ ├── product.md
|
|
292
|
+
│ └── authentication.md
|
|
293
|
+
├── examples/
|
|
294
|
+
│ ├── finance-query.sql
|
|
295
|
+
│ └── sales-query.sql
|
|
296
|
+
└── scripts/
|
|
297
|
+
└── validate-query.py
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**SKILL.md**:
|
|
301
|
+
```yaml
|
|
302
|
+
---
|
|
303
|
+
name: manage-bigquery
|
|
304
|
+
description: This skill should be used when the user asks to "query BigQuery", "analyze data warehouse", "run SQL queries", or mentions BigQuery, data analysis, or specific data domains (finance, sales, product).
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
<objective>
|
|
308
|
+
Query and analyze data from BigQuery across multiple domains (finance, sales, product) with proper authentication, query optimization, and cost management.
|
|
309
|
+
</objective>
|
|
310
|
+
|
|
311
|
+
<quick_start>
|
|
312
|
+
<setup>
|
|
313
|
+
Install BigQuery client:
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
pip install google-cloud-bigquery
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Set up authentication:
|
|
320
|
+
|
|
321
|
+
```python
|
|
322
|
+
from google.cloud import bigquery
|
|
323
|
+
import os
|
|
324
|
+
|
|
325
|
+
# Set credentials
|
|
326
|
+
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentials.json"
|
|
327
|
+
|
|
328
|
+
# Create client
|
|
329
|
+
client = bigquery.Client(project="your-project-id")
|
|
330
|
+
```
|
|
331
|
+
</setup>
|
|
332
|
+
|
|
333
|
+
<simple_query>
|
|
334
|
+
Run a basic query:
|
|
335
|
+
|
|
336
|
+
```python
|
|
337
|
+
query = """
|
|
338
|
+
SELECT user_id, created_at
|
|
339
|
+
FROM `project.dataset.users`
|
|
340
|
+
WHERE created_at >= '2024-01-01'
|
|
341
|
+
LIMIT 100
|
|
342
|
+
"""
|
|
343
|
+
|
|
344
|
+
results = client.query(query).result()
|
|
345
|
+
for row in results:
|
|
346
|
+
print(row.user_id, row.created_at)
|
|
347
|
+
```
|
|
348
|
+
</simple_query>
|
|
349
|
+
</quick_start>
|
|
350
|
+
|
|
351
|
+
<domain_references>
|
|
352
|
+
Query different business domains with specialized references:
|
|
353
|
+
|
|
354
|
+
- **Finance data**: See [references/finance.md](references/finance.md) for revenue, billing, and payment metrics
|
|
355
|
+
- **Sales data**: See [references/sales.md](references/sales.md) for opportunities, pipeline, and conversion metrics
|
|
356
|
+
- **Product data**: See [references/product.md](references/product.md) for usage, features, and engagement metrics
|
|
357
|
+
- **Authentication**: See [references/authentication.md](references/authentication.md) for credential setup
|
|
358
|
+
|
|
359
|
+
**Working examples**:
|
|
360
|
+
- `examples/finance-query.sql` - Revenue analysis query
|
|
361
|
+
- `examples/sales-query.sql` - Pipeline analysis query
|
|
362
|
+
</domain_references>
|
|
363
|
+
|
|
364
|
+
<cost_management>
|
|
365
|
+
<query_validation>
|
|
366
|
+
Validate queries before running to avoid high costs:
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
python scripts/validate-query.py query.sql
|
|
370
|
+
# Estimates: 2.3 GB processed, ~$0.01 cost
|
|
371
|
+
```
|
|
372
|
+
</query_validation>
|
|
373
|
+
|
|
374
|
+
<best_practices>
|
|
375
|
+
- Use `LIMIT` for exploratory queries
|
|
376
|
+
- Partition tables by date for cost efficiency
|
|
377
|
+
- Use `_TABLE_SUFFIX` for date range queries
|
|
378
|
+
- Cache results when possible
|
|
379
|
+
- Use query parameters to avoid recompilation
|
|
380
|
+
</best_practices>
|
|
381
|
+
</cost_management>
|
|
382
|
+
|
|
383
|
+
<security_checklist>
|
|
384
|
+
- [ ] Credentials stored securely (not in code)
|
|
385
|
+
- [ ] Row-level security policies applied
|
|
386
|
+
- [ ] Query parameterization used (prevent injection)
|
|
387
|
+
- [ ] Audit logging enabled
|
|
388
|
+
- [ ] Access controls validated
|
|
389
|
+
</security_checklist>
|
|
390
|
+
|
|
391
|
+
<success_criteria>
|
|
392
|
+
- Query executes successfully
|
|
393
|
+
- Results match expected schema
|
|
394
|
+
- Cost is within budget
|
|
395
|
+
- Performance is acceptable (<30s for most queries)
|
|
396
|
+
- Security checklist verified
|
|
397
|
+
</success_criteria>
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
**references/finance.md**:
|
|
401
|
+
```xml
|
|
402
|
+
<overview>
|
|
403
|
+
Finance domain queries for revenue, billing, and payment metrics.
|
|
404
|
+
</overview>
|
|
405
|
+
|
|
406
|
+
<table_schemas>
|
|
407
|
+
<revenue_table>
|
|
408
|
+
**Table**: `project.finance.revenue`
|
|
409
|
+
|
|
410
|
+
Schema:
|
|
411
|
+
- `revenue_id` (STRING) - Unique revenue record ID
|
|
412
|
+
- `user_id` (STRING) - Customer ID
|
|
413
|
+
- `amount` (FLOAT64) - Revenue amount in USD
|
|
414
|
+
- `created_at` (TIMESTAMP) - Transaction timestamp
|
|
415
|
+
- `payment_method` (STRING) - Payment type (card, bank, etc)
|
|
416
|
+
</revenue_table>
|
|
417
|
+
</table_schemas>
|
|
418
|
+
|
|
419
|
+
<common_queries>
|
|
420
|
+
<monthly_revenue>
|
|
421
|
+
Monthly recurring revenue (MRR):
|
|
422
|
+
|
|
423
|
+
```sql
|
|
424
|
+
SELECT
|
|
425
|
+
DATE_TRUNC(created_at, MONTH) as month,
|
|
426
|
+
SUM(amount) as mrr
|
|
427
|
+
FROM `project.finance.revenue`
|
|
428
|
+
WHERE payment_method = 'subscription'
|
|
429
|
+
GROUP BY month
|
|
430
|
+
ORDER BY month DESC
|
|
431
|
+
```
|
|
432
|
+
</monthly_revenue>
|
|
433
|
+
|
|
434
|
+
<churn_analysis>
|
|
435
|
+
Revenue churn rate:
|
|
436
|
+
|
|
437
|
+
```sql
|
|
438
|
+
WITH monthly_cohorts AS (
|
|
439
|
+
SELECT
|
|
440
|
+
user_id,
|
|
441
|
+
DATE_TRUNC(MIN(created_at), MONTH) as cohort_month,
|
|
442
|
+
DATE_TRUNC(created_at, MONTH) as revenue_month,
|
|
443
|
+
SUM(amount) as revenue
|
|
444
|
+
FROM `project.finance.revenue`
|
|
445
|
+
GROUP BY user_id, revenue_month
|
|
446
|
+
)
|
|
447
|
+
|
|
448
|
+
SELECT
|
|
449
|
+
cohort_month,
|
|
450
|
+
revenue_month,
|
|
451
|
+
COUNT(DISTINCT user_id) as active_users,
|
|
452
|
+
SUM(revenue) as revenue
|
|
453
|
+
FROM monthly_cohorts
|
|
454
|
+
GROUP BY cohort_month, revenue_month
|
|
455
|
+
ORDER BY cohort_month, revenue_month
|
|
456
|
+
```
|
|
457
|
+
</churn_analysis>
|
|
458
|
+
</common_queries>
|
|
459
|
+
```
|
|
460
|
+
</example>
|
|
461
|
+
|
|
462
|
+
<key_patterns>
|
|
463
|
+
<pattern name="minimal_simple">
|
|
464
|
+
**When to use**: Simple, focused skills
|
|
465
|
+
|
|
466
|
+
**Structure**:
|
|
467
|
+
- SKILL.md only
|
|
468
|
+
- Required tags only
|
|
469
|
+
- 200-400 lines
|
|
470
|
+
|
|
471
|
+
**Example**: File format conversion, text extraction
|
|
472
|
+
</pattern>
|
|
473
|
+
|
|
474
|
+
<pattern name="standard_progressive">
|
|
475
|
+
**When to use**: Most skills
|
|
476
|
+
|
|
477
|
+
**Structure**:
|
|
478
|
+
- SKILL.md (400-500 lines)
|
|
479
|
+
- references/ for detailed content
|
|
480
|
+
- scripts/ for utilities
|
|
481
|
+
- examples/ for working code
|
|
482
|
+
|
|
483
|
+
**Example**: API integrations, document processing
|
|
484
|
+
</pattern>
|
|
485
|
+
|
|
486
|
+
<pattern name="complex_multi_domain">
|
|
487
|
+
**When to use**: Multiple domains or security-critical
|
|
488
|
+
|
|
489
|
+
**Structure**:
|
|
490
|
+
- SKILL.md (500 lines max)
|
|
491
|
+
- references/ organized by domain
|
|
492
|
+
- scripts/ for validation and utilities
|
|
493
|
+
- examples/ for each domain
|
|
494
|
+
- Comprehensive security checklist
|
|
495
|
+
|
|
496
|
+
**Example**: Payment processing, data warehouse queries
|
|
497
|
+
</pattern>
|
|
498
|
+
</key_patterns>
|
|
499
|
+
|
|
500
|
+
<success_indicators>
|
|
501
|
+
A well-structured skill demonstrates:
|
|
502
|
+
|
|
503
|
+
- **Clear purpose**: Objective states exactly what the skill does
|
|
504
|
+
- **Quick start**: User can begin immediately with working example
|
|
505
|
+
- **Progressive disclosure**: Detailed content in references/
|
|
506
|
+
- **Security awareness**: Checklist for sensitive operations
|
|
507
|
+
- **Validation**: Scripts and examples are tested and working
|
|
508
|
+
- **Domain organization**: Multi-domain skills separated clearly
|
|
509
|
+
- **Cost awareness**: Resource usage considerations documented
|
|
510
|
+
- **Error handling**: Edge cases and failures addressed
|
|
511
|
+
- **Best practices**: Anti-patterns shown and avoided
|
|
512
|
+
- **Success criteria**: Specific, measurable outcomes defined
|
|
513
|
+
</success_indicators>
|