@bffless/claude-skills 1.2.2 → 1.3.0
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-plugin/plugin.json +5 -0
- package/package.json +2 -1
- package/skills/pipelines/SKILL.md +102 -21
- package/skills/proxy-rules/SKILL.md +30 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bffless/claude-skills",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Claude Code plugin with BFFless platform skills",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code-plugin",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"url": "https://github.com/bffless/claude-skills"
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
|
+
".claude-plugin/plugin.json",
|
|
20
21
|
"skills/"
|
|
21
22
|
]
|
|
22
23
|
}
|
|
@@ -7,27 +7,88 @@ description: Backend automation without code using handler chains
|
|
|
7
7
|
|
|
8
8
|
**Docs**: https://docs.bffless.app/features/pipelines/
|
|
9
9
|
|
|
10
|
-
Pipelines provide backend functionality for static sites without writing server code. Chain handlers together to process forms, store data, send emails, and more.
|
|
10
|
+
Pipelines provide backend functionality for static sites without writing server code. Chain handlers together to process forms, store data, send emails, call AI models, accept payments, and more.
|
|
11
11
|
|
|
12
12
|
## Handler Types
|
|
13
13
|
|
|
14
|
-
| Handler | Purpose |
|
|
15
|
-
|
|
16
|
-
| **Form** | Parse form submissions (multipart, JSON, URL-encoded) |
|
|
17
|
-
| **Data
|
|
18
|
-
| **
|
|
19
|
-
| **
|
|
20
|
-
| **
|
|
21
|
-
| **Aggregate** | Combine data from multiple sources |
|
|
14
|
+
| Handler | Type | Purpose |
|
|
15
|
+
|---------|------|---------|
|
|
16
|
+
| **Form** | `form_handler` | Parse form submissions (multipart, JSON, URL-encoded) |
|
|
17
|
+
| **Data Create** | `data_create` | Create DB records in a pipeline schema |
|
|
18
|
+
| **Data Query** | `data_query` | Read/list DB records with filters, sorting, pagination |
|
|
19
|
+
| **Data Update** | `data_update` | Update existing DB records |
|
|
20
|
+
| **Data Delete** | `data_delete` | Delete DB records |
|
|
21
|
+
| **Aggregate** | `db_aggregate` | Combine/aggregate data from multiple sources |
|
|
22
|
+
| **Email** | `email_handler` | Send emails via configured provider |
|
|
23
|
+
| **Response** | `response_handler` | Return custom JSON, status codes, or redirect |
|
|
24
|
+
| **Function** | `function_handler` | Custom JavaScript for transformation/logic |
|
|
25
|
+
| **AI** | `ai_handler` | Call OpenAI/Anthropic/Google AI models (chat or completion) |
|
|
26
|
+
| **HTTP Request** | `http_request` | Make outbound HTTP requests to external APIs |
|
|
27
|
+
| **File Upload** | `file_upload_handler` | Upload files from forms or URLs to storage |
|
|
28
|
+
| **File Serve** | `file_serve_handler` | Serve files from storage with Range request support |
|
|
29
|
+
| **Image Convert** | `image_convert_handler` | Convert images between PNG/JPEG/WebP using sharp |
|
|
30
|
+
| **Signed URL** | `signed_url` | Generate time-limited presigned URLs for storage files |
|
|
31
|
+
| **Replicate** | `replicate` | Call Replicate ML models (image gen, embeddings, etc.) |
|
|
32
|
+
| **Embed Store** | `embed_store` | Store embedding vectors for semantic search |
|
|
33
|
+
| **Vector Search** | `vector_search` | Query embeddings by cosine similarity |
|
|
34
|
+
| **Stripe Checkout** | `stripe_checkout` | Create Stripe Checkout sessions for payments/subscriptions |
|
|
35
|
+
| **Stripe Webhook** | `stripe_webhook` | Validate Stripe webhook signatures and parse events |
|
|
22
36
|
|
|
23
37
|
## DB Records
|
|
24
38
|
|
|
25
39
|
Schema-based data storage built into BFFless:
|
|
26
40
|
|
|
27
41
|
1. Define schema in project settings (fields, types, validation)
|
|
28
|
-
2. Use Data CRUD
|
|
42
|
+
2. Use Data CRUD handlers to interact with records
|
|
29
43
|
3. Query with filters, sorting, pagination
|
|
30
44
|
|
|
45
|
+
## AI Handler
|
|
46
|
+
|
|
47
|
+
Call AI models directly from pipelines. Supports chat (multi-turn) and completion (single-turn) modes.
|
|
48
|
+
|
|
49
|
+
Key config:
|
|
50
|
+
- `provider`: `openai`, `anthropic`, or `google`
|
|
51
|
+
- `mode`: `chat` or `completion`
|
|
52
|
+
- `messageField`: field name containing the user message (from input)
|
|
53
|
+
- `systemPrompt`: system instructions for the AI
|
|
54
|
+
- `persistMessages`: store conversation history in a pipeline schema
|
|
55
|
+
- `persistMessagesSchemaId`: which schema to store messages in
|
|
56
|
+
|
|
57
|
+
## HTTP Request Handler
|
|
58
|
+
|
|
59
|
+
Make outbound API calls to external services from within a pipeline.
|
|
60
|
+
|
|
61
|
+
Key config:
|
|
62
|
+
- `url`: target URL (supports expressions like `${steps.prev.apiUrl}`)
|
|
63
|
+
- `method`: GET, POST, PATCH, DELETE
|
|
64
|
+
- `body`: request body (expressions supported)
|
|
65
|
+
- `headers`: custom headers to add
|
|
66
|
+
- `forwardAuth`: forward the original request's auth header
|
|
67
|
+
|
|
68
|
+
## File Handlers
|
|
69
|
+
|
|
70
|
+
**Upload** (`file_upload_handler`): Handles multipart file uploads or downloads from URLs. Supports allowed MIME type filtering, max file size, optional image conversion, and date-bucketed storage.
|
|
71
|
+
|
|
72
|
+
**Serve** (`file_serve_handler`): Streams files from storage with HTTP Range support for video/audio playback. Config: `subDir`, `cacheMaxAge`.
|
|
73
|
+
|
|
74
|
+
**Image Convert** (`image_convert_handler`): Converts between PNG, JPEG, WebP. Config: `inputPath`, `outputFormat`, `quality`.
|
|
75
|
+
|
|
76
|
+
**Signed URL** (`signed_url`): Generates time-limited presigned URLs for private storage files. Config: `path`, `expiresIn` (seconds, default 3600).
|
|
77
|
+
|
|
78
|
+
## Stripe Handlers
|
|
79
|
+
|
|
80
|
+
**Checkout** (`stripe_checkout`): Creates Stripe Checkout sessions. Config: `priceId`, `mode` (payment/subscription), `successUrl`, `cancelUrl`, `customerEmail`, `environment` (live/test).
|
|
81
|
+
|
|
82
|
+
**Webhook** (`stripe_webhook`): Validates webhook signatures and parses events. Config: `allowedEventTypes` (optional filter), `environment`.
|
|
83
|
+
|
|
84
|
+
## Vector/Embedding Handlers
|
|
85
|
+
|
|
86
|
+
**Embed Store** (`embed_store`): Stores embedding vectors in the database. Supports single embeddings or chunked documents. Config: `schemaId`, `recordId`, `embedding` or `chunks`.
|
|
87
|
+
|
|
88
|
+
**Vector Search** (`vector_search`): Queries embeddings by cosine similarity. Config: `schemaId`, `queryVector`, `limit`, `threshold`.
|
|
89
|
+
|
|
90
|
+
**Replicate** (`replicate`): Calls Replicate ML models for image generation, embeddings, etc. Auto-uploads large files to Replicate's Files API. Config: `model`, `version`, `input`.
|
|
91
|
+
|
|
31
92
|
## Expression Syntax
|
|
32
93
|
|
|
33
94
|
Access data throughout the pipeline using expressions:
|
|
@@ -41,6 +102,15 @@ Access data throughout the pipeline using expressions:
|
|
|
41
102
|
|
|
42
103
|
Example: `${input.email}` or `${steps.createUser.id}`
|
|
43
104
|
|
|
105
|
+
## Validators
|
|
106
|
+
|
|
107
|
+
Pipelines support validators that run before any steps execute:
|
|
108
|
+
|
|
109
|
+
- `auth_required` - Require authenticated user
|
|
110
|
+
- `rate_limit` - Rate limit requests (by IP or user)
|
|
111
|
+
|
|
112
|
+
Both support conditions to selectively apply (e.g., only rate limit POST requests).
|
|
113
|
+
|
|
44
114
|
## Common Workflows
|
|
45
115
|
|
|
46
116
|
**Contact form:**
|
|
@@ -49,17 +119,27 @@ Example: `${input.email}` or `${steps.createUser.id}`
|
|
|
49
119
|
3. Email → notify admin
|
|
50
120
|
4. Response → thank you message
|
|
51
121
|
|
|
52
|
-
**
|
|
53
|
-
1. Form handler → parse
|
|
54
|
-
2.
|
|
55
|
-
3.
|
|
56
|
-
|
|
122
|
+
**AI chat:**
|
|
123
|
+
1. Form handler → parse user message
|
|
124
|
+
2. AI handler → call model with conversation context
|
|
125
|
+
3. Response → return AI response
|
|
126
|
+
|
|
127
|
+
**File upload with processing:**
|
|
128
|
+
1. File Upload → store file
|
|
129
|
+
2. Image Convert → resize/convert
|
|
130
|
+
3. Data Create → store metadata
|
|
131
|
+
4. Response → return file URL
|
|
132
|
+
|
|
133
|
+
**Stripe payment:**
|
|
134
|
+
1. Form handler → parse product selection
|
|
135
|
+
2. Stripe Checkout → create session
|
|
136
|
+
3. Response → redirect to Stripe
|
|
57
137
|
|
|
58
|
-
**
|
|
59
|
-
1. Form handler → parse
|
|
60
|
-
2.
|
|
61
|
-
3.
|
|
62
|
-
4. Response →
|
|
138
|
+
**Semantic search:**
|
|
139
|
+
1. Form handler → parse query
|
|
140
|
+
2. AI/Replicate → generate query embedding
|
|
141
|
+
3. Vector Search → find similar records
|
|
142
|
+
4. Response → return results
|
|
63
143
|
|
|
64
144
|
## Configuration Tips
|
|
65
145
|
|
|
@@ -67,13 +147,14 @@ Example: `${input.email}` or `${steps.createUser.id}`
|
|
|
67
147
|
2. Use Response handler last to control what client sees
|
|
68
148
|
3. Test with simple inputs before adding validation
|
|
69
149
|
4. Check pipeline logs for debugging failed executions
|
|
150
|
+
5. Use `postSteps` for async work after the response is sent (e.g., sending emails)
|
|
70
151
|
|
|
71
152
|
## Troubleshooting
|
|
72
153
|
|
|
73
154
|
**Pipeline not triggering?**
|
|
74
155
|
- Verify endpoint path matches request URL
|
|
75
156
|
- Check HTTP method (GET, POST, etc.) is correct
|
|
76
|
-
- Ensure pipeline is enabled and
|
|
157
|
+
- Ensure pipeline is enabled and rule set is assigned to alias
|
|
77
158
|
|
|
78
159
|
**Expression returning undefined?**
|
|
79
160
|
- Check handler name matches exactly (case-sensitive)
|
|
@@ -13,7 +13,34 @@ Proxy rules forward requests from your static site to backend APIs, eliminating
|
|
|
13
13
|
|
|
14
14
|
**Project defaults**: Apply to all aliases unless overridden
|
|
15
15
|
|
|
16
|
-
**Alias overrides**: Specific aliases can have
|
|
16
|
+
**Alias overrides**: Specific aliases can have their own proxy rule sets assigned
|
|
17
|
+
|
|
18
|
+
## Rule Sets
|
|
19
|
+
|
|
20
|
+
Proxy rules are organized into **rule sets** — named, reusable groups of rules.
|
|
21
|
+
|
|
22
|
+
An alias can have **multiple rule sets** attached. When multiple rule sets are assigned, their rules are merged in priority order (first set wins if two sets define the same path+method).
|
|
23
|
+
|
|
24
|
+
This allows logical grouping, e.g.:
|
|
25
|
+
- `api-proxy` — routes to your backend API
|
|
26
|
+
- `pipelines` — pipeline-based handlers for chat, forms, etc.
|
|
27
|
+
- `auth-proxy` — cookie-to-bearer token transformation
|
|
28
|
+
|
|
29
|
+
### Assigning Rule Sets to Aliases
|
|
30
|
+
|
|
31
|
+
Use `update_alias` with `proxyRuleSetIds` (array) to attach one or more rule sets:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
update_alias(
|
|
35
|
+
repository: "owner/repo",
|
|
36
|
+
alias: "production",
|
|
37
|
+
proxyRuleSetIds: ["rule-set-id-1", "rule-set-id-2"]
|
|
38
|
+
)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The legacy `proxyRuleSetId` (singular) still works for backwards compatibility but only supports one rule set.
|
|
42
|
+
|
|
43
|
+
**Important**: After creating proxy rules, you must assign the rule set(s) to an alias for rules to take effect. Rules won't be active until linked to an alias.
|
|
17
44
|
|
|
18
45
|
## Rule Structure
|
|
19
46
|
|
|
@@ -75,9 +102,9 @@ With strip prefix OFF:
|
|
|
75
102
|
|
|
76
103
|
**Requests not proxying?**
|
|
77
104
|
- Check path pattern matches request URL exactly
|
|
78
|
-
- Verify
|
|
105
|
+
- Verify rule set is assigned to the alias via `update_alias`
|
|
79
106
|
- Confirm target URL is HTTPS and reachable
|
|
80
107
|
|
|
81
108
|
**Getting CORS errors still?**
|
|
82
|
-
- Ensure the proxy rule is
|
|
109
|
+
- Ensure the proxy rule set is assigned to the alias being accessed
|
|
83
110
|
- Check browser DevTools for actual request URL (may not be hitting proxy)
|