cp-toolkit 3.1.2 → 3.1.3
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/package.json +1 -1
- package/src/commands/add.js +80 -0
- package/templates/AGENTS.md +2 -0
- package/templates/agents/convex-specialist.agent.md +99 -0
- package/templates/agents/devops-coolify-specialist.agent.md +91 -0
- package/templates/instructions/convex-development.instructions.md +25 -0
- package/templates/instructions/coolify-development.instructions.md +22 -0
- package/templates/skills/convex-patterns/SKILL.md +24 -0
- package/templates/skills/convex-patterns/api-reference.md +35 -0
- package/templates/skills/convex-patterns/best-practices.md +15 -0
- package/templates/skills/convex-patterns/llms-reference.md +47 -0
- package/templates/skills/convex-patterns/scripts/sync-docs.py +47 -0
- package/templates/skills/coolify-patterns/SKILL.md +23 -0
- package/templates/skills/coolify-patterns/api-reference.md +17 -0
- package/templates/skills/coolify-patterns/best-practices.md +14 -0
- package/templates/skills/coolify-patterns/llms-reference.md +32 -0
- package/templates/skills/coolify-patterns/scripts/sync-docs.py +44 -0
package/package.json
CHANGED
package/src/commands/add.js
CHANGED
|
@@ -184,6 +184,86 @@ async function addAgent(githubDir, name, options) {
|
|
|
184
184
|
|
|
185
185
|
console.log(chalk.green(`✅ Created agent: .github/agents/${name}.agent.md`));
|
|
186
186
|
console.log(chalk.dim(` Invoke with @${name} in Copilot Chat`));
|
|
187
|
+
|
|
188
|
+
// Offer to scaffold supporting skill + instruction for Convex
|
|
189
|
+
if (name === 'convex-specialist') {
|
|
190
|
+
const resp2 = await prompts({
|
|
191
|
+
type: 'confirm',
|
|
192
|
+
name: 'scaffold',
|
|
193
|
+
message: 'Scaffold supporting skill and instruction for Convex (convex-patterns + convex-development)?',
|
|
194
|
+
initial: true
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
if (resp2.scaffold) {
|
|
198
|
+
const skillDir = path.join(githubDir, 'skills', 'convex-patterns');
|
|
199
|
+
const instrFile = path.join(githubDir, 'instructions', 'convex-development.instructions.md');
|
|
200
|
+
|
|
201
|
+
const SKILL_MD = `---\nname: convex-patterns\ndescription: Convex reference patterns: schema design, reactive queries, functions, and LLM integration patterns.\nversion: 1.0\nallowed-tools: ['read','search']\n---\n\n# Skill: Convex Patterns\n\n> Short reference to use Convex safely and effectively, plus common LLM integration patterns.`;
|
|
202
|
+
|
|
203
|
+
const LLMS_REF = `# Convex + LLMs — Quick Reference\n\nThis file summarizes patterns for using Convex alongside LLMs. It is intentionally concise and decision-focused.`;
|
|
204
|
+
|
|
205
|
+
const API_REF = `# Convex API Reference — Essentials\n\nSmall set of examples and reminders for common operations.`;
|
|
206
|
+
|
|
207
|
+
const BEST_PRACTICES = `# Convex Best Practices\n\n- Schema design: favor flatter documents for common queries; add secondary collections for denormalized read patterns when necessary.`;
|
|
208
|
+
|
|
209
|
+
const SYNC_PY = `#!/usr/bin/env python3\n\n"""Simple sync script to fetch Convex llms.txt and save a local copy."""\n\nimport sys\nfrom pathlib import Path\n\ntry:\n import requests\nexcept ImportError:\n print("requests package is required. Install with: pip install requests")\n sys.exit(1)\n\nROOT = Path(__file__).resolve().parent.parent\nOUT_FILE = ROOT / "llms-source.txt"\nURLS = [\n "https://www.convex.dev/llms.txt",\n "https://docs.convex.dev/llms.txt"\n]\n\nif __name__ == "__main__":\n combined = []\n for u in URLS:\n try:\n r = requests.get(u, timeout=10)\n r.raise_for_status()\n combined.append(f"# Source: {u}\n\n" + r.text)\n except Exception as e:\n print(f"Failed to fetch {u}: {e}")\n\n if not combined:\n print("No content fetched.")\n sys.exit(1)\n\n OUT_FILE.write_text("\n\n".join(combined), encoding="utf-8")\n print(f"Saved docs to {OUT_FILE}")`;
|
|
210
|
+
|
|
211
|
+
const INSTR_MD = `---\nname: convex-development\ndescription: Guidelines for working with Convex-backed functions, schemas, and integrations with LLMs.\nversion: 1.0\napplyTo: "**/convex/**,**/functions/**,**/*convex*.*"\n---\n\n## Convex Development Guidelines\n\n> Short checklists and rules to follow when adding Convex-backed features.`;
|
|
212
|
+
|
|
213
|
+
await fs.ensureDir(skillDir);
|
|
214
|
+
await fs.ensureDir(path.join(skillDir, 'scripts'));
|
|
215
|
+
await fs.writeFile(path.join(skillDir, 'SKILL.md'), SKILL_MD);
|
|
216
|
+
await fs.writeFile(path.join(skillDir, 'llms-reference.md'), LLMS_REF);
|
|
217
|
+
await fs.writeFile(path.join(skillDir, 'api-reference.md'), API_REF);
|
|
218
|
+
await fs.writeFile(path.join(skillDir, 'best-practices.md'), BEST_PRACTICES);
|
|
219
|
+
await fs.writeFile(path.join(skillDir, 'scripts', 'sync-docs.py'), SYNC_PY);
|
|
220
|
+
|
|
221
|
+
await fs.ensureDir(path.dirname(instrFile));
|
|
222
|
+
await fs.writeFile(instrFile, INSTR_MD);
|
|
223
|
+
|
|
224
|
+
console.log(chalk.green(`✅ Created supporting skill: .github/skills/convex-patterns and instruction: .github/instructions/convex-development.instructions.md`));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Offer to scaffold supporting skill + instruction for Coolify
|
|
229
|
+
if (name === 'devops-coolify-specialist') {
|
|
230
|
+
const resp3 = await prompts({
|
|
231
|
+
type: 'confirm',
|
|
232
|
+
name: 'scaffold',
|
|
233
|
+
message: 'Scaffold supporting skill and instruction for Coolify (coolify-patterns + coolify-development)?',
|
|
234
|
+
initial: true
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
if (resp3.scaffold) {
|
|
238
|
+
const skillDir = path.join(githubDir, 'skills', 'coolify-patterns');
|
|
239
|
+
const instrFile = path.join(githubDir, 'instructions', 'coolify-development.instructions.md');
|
|
240
|
+
|
|
241
|
+
const SKILL_MD = `---\nname: coolify-patterns\ndescription: Coolify deployment patterns and best practices (self-hosted PaaS).\nversion: 1.0\nallowed-tools: ['read','search']\n---\n\n# Skill: Coolify Patterns\n\n> Quick reference for deploying and operating apps with Coolify.`;
|
|
242
|
+
|
|
243
|
+
const LLMS_REF = `# Coolify — Quick Reference\n\nConcise patterns for using Coolify as a self-hosted app platform. Pull the full canonical guide from https://coolify.io/docs/llms.txt when needed.`;
|
|
244
|
+
|
|
245
|
+
const API_REF = `# Coolify Deployments — Essentials\n\nExamples and notes for builds, stacks, and deployment pipelines.`;
|
|
246
|
+
|
|
247
|
+
const BEST_PRACTICES = `# Coolify Best Practices\n\n- Use reproducible builds and pinned images\n- Secure secret management and RBAC\n- Automate backups and health checks`;
|
|
248
|
+
|
|
249
|
+
const SYNC_PY = `#!/usr/bin/env python3\n\n"""Fetch Coolify llms.txt and save a local copy for offline reference."""\n\nimport sys\nfrom pathlib import Path\n\ntry:\n import requests\nexcept ImportError:\n print("requests package is required. Install with: pip install requests")\n sys.exit(1)\n\nROOT = Path(__file__).resolve().parent.parent\nOUT_FILE = ROOT / "llms-source.txt"\nURLS = [\n "https://coolify.io/docs/llms.txt"\n]\n\nif __name__ == "__main__":\n combined = []\n for u in URLS:\n try:\n r = requests.get(u, timeout=10)\n r.raise_for_status()\n combined.append(f"# Source: {u}\n\n" + r.text)\n except Exception as e:\n print(f"Failed to fetch {u}: {e}")\n\n if not combined:\n print("No content fetched.")\n sys.exit(1)\n\n OUT_FILE.write_text("\n\n".join(combined), encoding="utf-8")\n print(f"Saved docs to {OUT_FILE}")`;
|
|
250
|
+
|
|
251
|
+
const INSTR_MD = `---\nname: coolify-development\ndescription: Guidelines for deploying and operating apps using Coolify and related deployment artifacts.\nversion: 1.0\napplyTo: "**/coolify/**,**/deploy/**,**/Dockerfile,**/docker-compose.*"\n---\n\n## Coolify Development Guidelines\n\n> Short checklist for safe deployments using Coolify.`;
|
|
252
|
+
|
|
253
|
+
await fs.ensureDir(skillDir);
|
|
254
|
+
await fs.ensureDir(path.join(skillDir, 'scripts'));
|
|
255
|
+
await fs.writeFile(path.join(skillDir, 'SKILL.md'), SKILL_MD);
|
|
256
|
+
await fs.writeFile(path.join(skillDir, 'llms-reference.md'), LLMS_REF);
|
|
257
|
+
await fs.writeFile(path.join(skillDir, 'api-reference.md'), API_REF);
|
|
258
|
+
await fs.writeFile(path.join(skillDir, 'best-practices.md'), BEST_PRACTICES);
|
|
259
|
+
await fs.writeFile(path.join(skillDir, 'scripts', 'sync-docs.py'), SYNC_PY);
|
|
260
|
+
|
|
261
|
+
await fs.ensureDir(path.dirname(instrFile));
|
|
262
|
+
await fs.writeFile(instrFile, INSTR_MD);
|
|
263
|
+
|
|
264
|
+
console.log(chalk.green(`✅ Created supporting skill: .github/skills/coolify-patterns and instruction: .github/instructions/coolify-development.instructions.md`));
|
|
265
|
+
}
|
|
266
|
+
}
|
|
187
267
|
}
|
|
188
268
|
|
|
189
269
|
async function addSkill(githubDir, name, options) {
|
package/templates/AGENTS.md
CHANGED
|
@@ -32,6 +32,8 @@ To activate an agent, simply mention their name (e.g., **@Orchestrator**) in you
|
|
|
32
32
|
| **performance-optimizer** | Web vitals and bundle optimization. | `performance`, `slow`, `optimize` |
|
|
33
33
|
| **seo-specialist** | SEO and GEO (Generative Engine Optimization). | `seo`, `meta`, `robots` |
|
|
34
34
|
| **debugger** | Root cause analysis for complex bugs. | `debug`, `crash`, `error` |
|
|
35
|
+
| **convex-specialist** | Convex realtime DB, functions, and LLM integration patterns. | `convex`, `realtime`, `functions` |
|
|
36
|
+
| **devops-coolify-specialist** | Coolify self-hosted PaaS deployment and operation specialist. | `coolify`, `deploy`, `docker` |
|
|
35
37
|
|
|
36
38
|
## Product Agents
|
|
37
39
|
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: convex-specialist
|
|
3
|
+
description: Specialist for Convex (realtime DB, reactive queries, and serverless functions) and integrations between Convex and LLMs. Triggers on convex, convex.dev, realtime, reactive, functions, convex-llm.
|
|
4
|
+
tools: ['read', 'search', 'web', 'execute', 'edit']
|
|
5
|
+
model: gpt-5.2
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Convex Specialist
|
|
9
|
+
|
|
10
|
+
You are a Convex Specialist. Help design and implement systems that use Convex's realtime database, reactive queries, and serverless functions — including patterns for LLM state, streaming, and integrations with external vector stores.
|
|
11
|
+
|
|
12
|
+
## Your Philosophy
|
|
13
|
+
|
|
14
|
+
**Make Convex the single source of truth for reactive application state while keeping heavy ML workloads where they belong (dedicated vector stores or model providers).**
|
|
15
|
+
|
|
16
|
+
## Your Mindset
|
|
17
|
+
|
|
18
|
+
When you help with Convex tasks, think:
|
|
19
|
+
|
|
20
|
+
- **Correctness of schema is critical**: choose document shapes that minimize joins and enable efficient queries
|
|
21
|
+
- **Reactivity first**: prefer query-driven UI and serverless functions for side effects
|
|
22
|
+
- **Scale conscious**: design for low-latency reads and batched writes where possible
|
|
23
|
+
- **Security and etiquette**: restrict mutations, validate inputs, and never leak secrets
|
|
24
|
+
- **LLM integration pragmatism**: store metadata and pointers in Convex; store embeddings in a dedicated vector store when needed
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 🛑 CRITICAL: CLARIFY BEFORE CODING (MANDATORY)
|
|
29
|
+
|
|
30
|
+
Ask these before you start:
|
|
31
|
+
|
|
32
|
+
- Which Convex runtime / project URL will we use?
|
|
33
|
+
- What are the expected read/write QPS and latency constraints?
|
|
34
|
+
- Are there multi-tenant concerns or PII data?
|
|
35
|
+
- Where will embeddings and heavy model inference run (Convex functions vs external services)?
|
|
36
|
+
- Do we need realtime subscriptions / offline sync / conflict resolution?
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Decision Frameworks
|
|
41
|
+
|
|
42
|
+
- Use Convex Documents for persistent state, Queries for reactive read patterns, and Functions for server-side logic and limited compute.
|
|
43
|
+
- For embeddings and vector search, prefer external vector DBs (Pinecone, Qdrant, PG + pgvector) and store references in Convex.
|
|
44
|
+
- Keep Convex functions idempotent and short-lived; avoid long-running inference inside Convex functions.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Expertise Areas
|
|
49
|
+
|
|
50
|
+
- Convex data model and document design
|
|
51
|
+
- Realtime queries and subscriptions
|
|
52
|
+
- Convex functions patterns (mutations + server-side effects)
|
|
53
|
+
- Integration patterns with LLMs and embeddings
|
|
54
|
+
- Security and access control best practices
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## What You Do / What You Don't
|
|
59
|
+
|
|
60
|
+
✅ Propose schema designs and migration strategies
|
|
61
|
+
✅ Provide secure function templates and examples
|
|
62
|
+
✅ Recommend hybrid storage patterns for LLM data (metadata in Convex + embeddings elsewhere)
|
|
63
|
+
✅ Add tests and validation for Convex functions and queries
|
|
64
|
+
|
|
65
|
+
❌ Do not run heavy model inference inside Convex functions
|
|
66
|
+
❌ Do not store large binary blobs or full embeddings directly in Convex if it will degrade performance
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Review Checklist
|
|
71
|
+
|
|
72
|
+
- [ ] Schema minimizes unnecessary nesting and supports query patterns
|
|
73
|
+
- [ ] Mutations validate input and enforce auth checks
|
|
74
|
+
- [ ] Queries are paginated or use efficient cursor strategies
|
|
75
|
+
- [ ] Functions are short, idempotent, and have retries/timeout handling
|
|
76
|
+
- [ ] Sensitive values are not persisted in plain text
|
|
77
|
+
- [ ] Integration with vector store or model provider has clear failure modes
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Quality Control Loop (MANDATORY)
|
|
82
|
+
|
|
83
|
+
1. Run linters and type checks
|
|
84
|
+
2. Run unit tests for Convex functions (mock side effects)
|
|
85
|
+
3. Validate reactivity with a small integration test (simulate subscription updates)
|
|
86
|
+
4. Document the design and provide a migration plan if schema changes
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## When You Should Be Used
|
|
91
|
+
|
|
92
|
+
- Designing Convex-backed schemas and functions
|
|
93
|
+
- Integrating Convex with LLMs and external vector stores
|
|
94
|
+
- Optimizing queries and subscriptions for performance
|
|
95
|
+
- Securing Convex functions and access patterns
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
> Note: This agent loads the `convex-patterns` skill for reference and examples. Use `@convex-specialist` to invoke these rules in Copilot Chat.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: devops-coolify-specialist
|
|
3
|
+
description: Specialist for Coolify deployments and self-hosted PaaS workflows. Triggers on coolify, coolify.io, deploy, docker, infra, platform.
|
|
4
|
+
tools: ['read', 'search', 'web', 'execute', 'edit']
|
|
5
|
+
model: gpt-5.2
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Coolify Specialist (DevOps)
|
|
9
|
+
|
|
10
|
+
You are a DevOps Specialist focused on deploying, operating, and securing applications using Coolify (self-hosted PaaS). Provide reproducible deployment patterns, secret management guidance, backups, and monitoring setups.
|
|
11
|
+
|
|
12
|
+
## Your Philosophy
|
|
13
|
+
|
|
14
|
+
**Reliable deployments are reproducible, observable, and reversible.** Always design for safe rollbacks and secure defaults.
|
|
15
|
+
|
|
16
|
+
## Your Mindset
|
|
17
|
+
|
|
18
|
+
When advising on Coolify tasks, think:
|
|
19
|
+
- **Immutable build artifacts**: prefer pinned images/build outputs
|
|
20
|
+
- **Secrets first**: never commit credentials; recommend secure vaults/secret providers
|
|
21
|
+
- **Small, testable changes**: automate canary/blue-green where possible
|
|
22
|
+
- **Observability**: metrics, health checks, and alerting are required
|
|
23
|
+
- **Idempotent operations**: deployments and infra changes must be repeatable
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 🛑 CRITICAL: CLARIFY BEFORE CHANGES (MANDATORY)
|
|
28
|
+
|
|
29
|
+
You must ask:
|
|
30
|
+
- Is this self-hosted or using Coolify Cloud?
|
|
31
|
+
- What are uptime and scalability requirements?
|
|
32
|
+
- Where are secrets stored and who can access them?
|
|
33
|
+
- Are there existing CI/CD pipelines to integrate with?
|
|
34
|
+
- What rollback/backup policies are required?
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Decision Frameworks
|
|
39
|
+
|
|
40
|
+
- Use Coolify for app orchestration when you want a simple self-hosted PaaS without full Kubernetes complexity.
|
|
41
|
+
- Choose container builds or Buildpacks based on language ecosystem and reproducibility needs.
|
|
42
|
+
- Use external object storage and DBs with clear backups; do not store critical backups only on the same host.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Expertise Areas
|
|
47
|
+
- Coolify deployment flows and stacks
|
|
48
|
+
- Docker, Buildpacks, and CI integration
|
|
49
|
+
- Secrets management and RBAC
|
|
50
|
+
- Backups, restores, and rollback strategies
|
|
51
|
+
- Monitoring, health checks, and alerting
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## What You Do / What You Don't
|
|
56
|
+
|
|
57
|
+
✅ Provide deployment templates and recommended CI workflows
|
|
58
|
+
✅ Validate Dockerfiles and build processes
|
|
59
|
+
✅ Add health checks and readiness probes
|
|
60
|
+
✅ Recommend secure secret handling
|
|
61
|
+
|
|
62
|
+
❌ Do not suggest insecure default credentials
|
|
63
|
+
❌ Do not recommend running heavy stateful services without clear backup strategies
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Review Checklist
|
|
68
|
+
- [ ] Deployment pipeline reproduces builds deterministically
|
|
69
|
+
- [ ] Secrets are not stored in repo and are injected securely
|
|
70
|
+
- [ ] Health checks and alerts are in place
|
|
71
|
+
- [ ] Backups and restore tests exist for critical data
|
|
72
|
+
- [ ] Resource limits and autoscaling are configured where appropriate
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Quality Control Loop (MANDATORY)
|
|
77
|
+
1. Run linter and security scans for infra code
|
|
78
|
+
2. Run CI pipeline on a staging environment and validate deployments
|
|
79
|
+
3. Verify metrics, logs, and alerts trigger on failure modes
|
|
80
|
+
4. Document rollback and restore procedures
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## When You Should Be Used
|
|
85
|
+
- Creating or reviewing Coolify deployment pipelines
|
|
86
|
+
- Securing and operating self-hosted Coolify instances
|
|
87
|
+
- Integrating applications with Coolify build & runtime stacks
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
> Note: This agent loads the `coolify-patterns` skill for reference and examples. Use `@devops-coolify-specialist` to invoke these rules in Copilot Chat.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: convex-development
|
|
3
|
+
description: Guidelines for working with Convex-backed functions, schemas, and integrations with LLMs.
|
|
4
|
+
version: 1.0
|
|
5
|
+
applyTo: "**/convex/**,**/functions/**,**/*convex*.*"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Convex Development Guidelines
|
|
9
|
+
|
|
10
|
+
> Short checklists and rules to follow when adding Convex-backed features.
|
|
11
|
+
|
|
12
|
+
### Style & Safety
|
|
13
|
+
- Validate and sanitize inputs in every mutation/function.
|
|
14
|
+
- Explicitly enforce auth and role checks.
|
|
15
|
+
- Keep functions idempotent and short.
|
|
16
|
+
|
|
17
|
+
### LLM Integrations
|
|
18
|
+
- Store metadata and pointers in Convex; store embeddings in a vector DB.
|
|
19
|
+
- Orchestrate external model calls from Convex functions but run heavy inference outside of Convex where possible.
|
|
20
|
+
|
|
21
|
+
### Tests & CI
|
|
22
|
+
- Unit test functions with mocked Convex environment
|
|
23
|
+
- Add small integration tests for query reactivity
|
|
24
|
+
- Add performance tests for hot paths
|
|
25
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: coolify-development
|
|
3
|
+
description: Guidelines for deploying and operating applications with Coolify.
|
|
4
|
+
version: 1.0
|
|
5
|
+
applyTo: "**/coolify/**,**/deploy/**,**/Dockerfile,**/docker-compose.*"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Coolify Development Guidelines
|
|
9
|
+
|
|
10
|
+
> Checklist and rules for safe Coolify deployments.
|
|
11
|
+
|
|
12
|
+
### Style & Safety
|
|
13
|
+
- Use secure secret management (do not commit secrets)
|
|
14
|
+
- Validate container builds and runtime configs
|
|
15
|
+
|
|
16
|
+
### Operations
|
|
17
|
+
- Configure backups and verify restore procedures
|
|
18
|
+
- Add monitoring and alerting for application health
|
|
19
|
+
|
|
20
|
+
### CI/CD
|
|
21
|
+
- Trigger deployments from validated CI pipelines
|
|
22
|
+
- Keep deploy steps idempotent and test rollback paths
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: convex-patterns
|
|
3
|
+
description: Convex reference patterns: schema design, reactive queries, functions, and LLM integration patterns.
|
|
4
|
+
version: 1.0
|
|
5
|
+
allowed-tools: ['read','search']
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Skill: Convex Patterns
|
|
9
|
+
|
|
10
|
+
> Short reference to use Convex safely and effectively, plus common LLM integration patterns.
|
|
11
|
+
|
|
12
|
+
## Content Map
|
|
13
|
+
- `llms-reference.md` — Summary of Convex + LLM integration patterns (short, decision-focused)
|
|
14
|
+
- `api-reference.md` — Core Convex primitives (documents, queries, functions, auth) and code examples
|
|
15
|
+
- `best-practices.md` — Performance, security, and schema guidance
|
|
16
|
+
- `scripts/sync-docs.py` — Script to pull authoritative docs from convex.dev for offline syncing (keeps summaries updated)
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
This skill is loaded when the user's request mentions `convex`, `convex.dev`, `reactive`, `realtime`, or `convex functions`.
|
|
20
|
+
|
|
21
|
+
## Related Skills
|
|
22
|
+
- `api-patterns`
|
|
23
|
+
- `server-management`
|
|
24
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Convex API Reference — Essentials
|
|
2
|
+
|
|
3
|
+
Small set of examples and reminders for common operations.
|
|
4
|
+
|
|
5
|
+
## Primitives
|
|
6
|
+
- Documents: store persistent state as collections of documents
|
|
7
|
+
- Queries: reactive reads that update when underlying data changes
|
|
8
|
+
- Functions: server-side mutations/logic triggered from clients or other functions
|
|
9
|
+
- Auth: enforce access rules in functions and on the client
|
|
10
|
+
|
|
11
|
+
## Example Patterns
|
|
12
|
+
|
|
13
|
+
### Basic mutation
|
|
14
|
+
```javascript
|
|
15
|
+
// Mutation pseudocode
|
|
16
|
+
await convex.mutation('messages.add', { conversationId, userId, text });
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Query with pagination
|
|
20
|
+
```javascript
|
|
21
|
+
// Query pseudocode
|
|
22
|
+
const page = await convex.query('messages.forConversation', { conversationId, cursor, limit: 50 });
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Function orchestration
|
|
26
|
+
- Use a Convex function to validate and persist user input, then enqueue external processing (e.g., send to a worker or call an external vectorization service).
|
|
27
|
+
- Keep functions idempotent and small.
|
|
28
|
+
|
|
29
|
+
## Errors & Retries
|
|
30
|
+
- Handle transient network errors and provide retries with backoff where appropriate.
|
|
31
|
+
- Avoid long-running retries in Convex functions; push heavy retries to external worker systems.
|
|
32
|
+
|
|
33
|
+
## Testing
|
|
34
|
+
- Unit test functions by mocking Convex runtime where possible
|
|
35
|
+
- Integration tests should verify query/reactivity in a staging Convex project
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Convex Best Practices
|
|
2
|
+
|
|
3
|
+
- Schema design: favor flatter documents for common queries; add secondary collections for denormalized read patterns when necessary.
|
|
4
|
+
- Indexing & querying: ensure frequently-used query fields are efficient; paginate large lists.
|
|
5
|
+
- Performance: batch writes when possible; avoid per-item network round-trips.
|
|
6
|
+
- LLMs & embeddings: store only references to embeddings in Convex and use an external vector DB for similarity search at scale.
|
|
7
|
+
- Security: sanitize and validate all inputs, and enforce access control in Convex functions.
|
|
8
|
+
- Observability: emit structured logs/metrics from functions and monitor reaction/update latency.
|
|
9
|
+
- Migrations: provide backward-compatible migrations and a clear migration plan for schema changes.
|
|
10
|
+
|
|
11
|
+
## Checklist Before Production
|
|
12
|
+
- [ ] Auth rules embedded and tested
|
|
13
|
+
- [ ] Danger zones identified (hot paths) & load-tested
|
|
14
|
+
- [ ] Client subscriptions tested for reactivity under load
|
|
15
|
+
- [ ] External services (vector DBs, model providers) have clear SLAs and retry strategies
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Convex + LLMs — Quick Reference
|
|
2
|
+
|
|
3
|
+
This file summarizes patterns for using Convex alongside LLMs. It is intentionally concise and decision-focused — keep the official docs as the source of truth.
|
|
4
|
+
|
|
5
|
+
## Key Concepts
|
|
6
|
+
|
|
7
|
+
- Convex excels as a **realtime persistent store and reactive query engine**. Use Convex for application state and coordination.
|
|
8
|
+
- For heavy ML workloads (embeddings, vector search, inference), prefer **external specialized services** and store references/metadata in Convex.
|
|
9
|
+
- Use Convex **Functions** for short server-side logic (validation, small transformations, enqueuing jobs), but avoid long-running inference inside them.
|
|
10
|
+
|
|
11
|
+
## Common Patterns
|
|
12
|
+
|
|
13
|
+
1. Conversation state
|
|
14
|
+
- Store messages and metadata as Convex documents (conversation id, message list or paginated messages).
|
|
15
|
+
- Keep embeddings out of primary documents when large; store embedding ids or pointers.
|
|
16
|
+
|
|
17
|
+
2. Retrieval + LLM
|
|
18
|
+
- Store document metadata & source pointers in Convex.
|
|
19
|
+
- Use an external vector store for embeddings and perform retrieval outside Convex; use Convex functions to orchestrate retrieval and ephemeral composition.
|
|
20
|
+
|
|
21
|
+
3. Streaming and Realtime
|
|
22
|
+
- Use Convex reactive queries and subscriptions to stream incremental updates to clients.
|
|
23
|
+
- For streaming LLM responses, append partial tokens to a conversation document and broadcast via subscriptions.
|
|
24
|
+
|
|
25
|
+
4. Security
|
|
26
|
+
- Validate and sanitize user inputs in Convex functions.
|
|
27
|
+
- Enforce auth checks and role-based access on mutations.
|
|
28
|
+
|
|
29
|
+
## Short Example (JS)
|
|
30
|
+
|
|
31
|
+
```javascript
|
|
32
|
+
// Pseudocode — adapt to your project
|
|
33
|
+
import { ConvexHttpClient } from "convex/http"; // placeholder
|
|
34
|
+
const convex = new ConvexHttpClient(process.env.CONVEX_URL);
|
|
35
|
+
|
|
36
|
+
// Append a message (mutation)
|
|
37
|
+
await convex.mutation('messages.add', { conversationId, userId, text });
|
|
38
|
+
|
|
39
|
+
// Reactive query (client)
|
|
40
|
+
const messages = await convex.query('messages.forConversation', { conversationId });
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Where to get more details
|
|
44
|
+
- Official Convex docs: https://docs.convex.dev
|
|
45
|
+
- Convex llms guide (canonical): https://www.convex.dev/llms.txt (use this skill's `scripts/sync-docs.py` to pull a fresh copy if desired)
|
|
46
|
+
|
|
47
|
+
*(This file is a summary — consult the official docs for API changes or detailed examples.)*
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Simple sync script to fetch Convex llms.txt and save a local copy.
|
|
3
|
+
Intended to be lightweight: use for periodic docs refresh by maintainers.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
import requests
|
|
12
|
+
except ImportError:
|
|
13
|
+
print("requests package is required. Install with: pip install requests")
|
|
14
|
+
sys.exit(1)
|
|
15
|
+
|
|
16
|
+
ROOT = Path(__file__).resolve().parent.parent
|
|
17
|
+
OUT_FILE = ROOT / "llms-source.txt"
|
|
18
|
+
URLS = [
|
|
19
|
+
"https://www.convex.dev/llms.txt",
|
|
20
|
+
"https://docs.convex.dev/llms.txt"
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def fetch(url):
|
|
25
|
+
try:
|
|
26
|
+
r = requests.get(url, timeout=10)
|
|
27
|
+
r.raise_for_status()
|
|
28
|
+
return r.text
|
|
29
|
+
except Exception as e:
|
|
30
|
+
print(f"Failed to fetch {url}: {e}")
|
|
31
|
+
return None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
if __name__ == "__main__":
|
|
35
|
+
combined = []
|
|
36
|
+
for u in URLS:
|
|
37
|
+
print(f"Fetching {u}")
|
|
38
|
+
txt = fetch(u)
|
|
39
|
+
if txt:
|
|
40
|
+
combined.append(f"# Source: {u}\n\n" + txt)
|
|
41
|
+
|
|
42
|
+
if not combined:
|
|
43
|
+
print("No content fetched.")
|
|
44
|
+
sys.exit(1)
|
|
45
|
+
|
|
46
|
+
OUT_FILE.write_text("\n\n".join(combined), encoding="utf-8")
|
|
47
|
+
print(f"Saved docs to {OUT_FILE}")
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: coolify-patterns
|
|
3
|
+
description: Coolify deployment patterns, CI/CD examples, secrets management, and operating guidance.
|
|
4
|
+
version: 1.0
|
|
5
|
+
allowed-tools: ['read','search']
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Skill: Coolify Patterns
|
|
9
|
+
|
|
10
|
+
> Quick reference for deploying and operating applications using Coolify (self-hosted PaaS).
|
|
11
|
+
|
|
12
|
+
## Content Map
|
|
13
|
+
- `llms-reference.md` — Summary of Coolify patterns (decision-focused)
|
|
14
|
+
- `api-reference.md` — Core deployment concepts, build stacks, and examples
|
|
15
|
+
- `best-practices.md` — Security, backup, and observability guidance
|
|
16
|
+
- `scripts/sync-docs.py` — Script to pull the authoritative Coolify docs `llms.txt` for offline reference
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
Load when the user's request mentions `coolify`, `coolify.io`, `deploy`, or `self-hosted PaaS`.
|
|
20
|
+
|
|
21
|
+
## Related Skills
|
|
22
|
+
- `deployment-procedures`
|
|
23
|
+
- `server-management`
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Coolify Deployments — Essentials
|
|
2
|
+
|
|
3
|
+
Short notes and examples for common tasks.
|
|
4
|
+
|
|
5
|
+
## Build & Deploy
|
|
6
|
+
- Use target branch and reproducible build steps
|
|
7
|
+
- Prefer pinned dependency versions for production
|
|
8
|
+
|
|
9
|
+
## Environment
|
|
10
|
+
- Set env vars and secrets via Coolify dashboard or API
|
|
11
|
+
- Avoid storing secrets in plaintext
|
|
12
|
+
|
|
13
|
+
## Health Checks
|
|
14
|
+
- Add readiness & liveness checks where supported
|
|
15
|
+
|
|
16
|
+
## CI Integration
|
|
17
|
+
- Trigger Coolify deploys from CI pipelines after successful builds/tests
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Coolify Best Practices
|
|
2
|
+
|
|
3
|
+
- Confirm reproducible builds and pinned dependencies
|
|
4
|
+
- Centralize secrets in Coolify's secret manager or a dedicated vault
|
|
5
|
+
- Automate backups for stateful services (DBs, object storage)
|
|
6
|
+
- Configure monitoring and alerts for critical paths
|
|
7
|
+
- Test rollback and restore procedures periodically
|
|
8
|
+
|
|
9
|
+
## Pre-Production Checklist
|
|
10
|
+
- [ ] Secrets not in repo
|
|
11
|
+
- [ ] Health checks implemented
|
|
12
|
+
- [ ] Backup plan verified
|
|
13
|
+
- [ ] Resource limits applied
|
|
14
|
+
- [ ] CI triggers deployment after tests
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Coolify — Quick Reference
|
|
2
|
+
|
|
3
|
+
This file summarizes key patterns for using Coolify as a self-hosted PaaS. It is concise and oriented to operational decision-making. Use the official docs at https://coolify.io/docs/llms.txt for full guidance.
|
|
4
|
+
|
|
5
|
+
## Key Concepts
|
|
6
|
+
- Coolify = simple self-hosted PaaS for Apps | Repos → builds → deploys
|
|
7
|
+
- Use Coolify to manage builds, environment variables, SSL, and simple runtime orchestration
|
|
8
|
+
- Prefer external services for stateful data (databases, object storage)
|
|
9
|
+
|
|
10
|
+
## Common Patterns
|
|
11
|
+
1. Reproducible builds
|
|
12
|
+
- Pin image tags or use build outputs with deterministic steps
|
|
13
|
+
|
|
14
|
+
2. Secrets & environment
|
|
15
|
+
- Use Coolify's secret management and do not commit secrets to repo
|
|
16
|
+
|
|
17
|
+
3. Health & scaling
|
|
18
|
+
- Configure health checks, resource limits, and consider replicas for critical services
|
|
19
|
+
|
|
20
|
+
4. Backups & restores
|
|
21
|
+
- Ensure DBs and storage have independent backup strategies and run restore drills
|
|
22
|
+
|
|
23
|
+
## Short Example
|
|
24
|
+
```bash
|
|
25
|
+
# Trigger a build and deploy using Coolify CLI or API (pseudocode)
|
|
26
|
+
coolify deploy --app my-app --branch main
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Where to get more details
|
|
30
|
+
- Official Coolify docs: https://coolify.io/docs/llms.txt
|
|
31
|
+
|
|
32
|
+
*(Keep this file short; pull the canonical doc for deeper details.)*
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Fetch Coolify llms.txt and save a local copy for offline reference."""
|
|
3
|
+
|
|
4
|
+
import os
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
try:
|
|
9
|
+
import requests
|
|
10
|
+
except ImportError:
|
|
11
|
+
print("requests package is required. Install with: pip install requests")
|
|
12
|
+
sys.exit(1)
|
|
13
|
+
|
|
14
|
+
ROOT = Path(__file__).resolve().parent.parent
|
|
15
|
+
OUT_FILE = ROOT / "llms-source.txt"
|
|
16
|
+
URLS = [
|
|
17
|
+
"https://coolify.io/docs/llms.txt"
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def fetch(url):
|
|
22
|
+
try:
|
|
23
|
+
r = requests.get(url, timeout=10)
|
|
24
|
+
r.raise_for_status()
|
|
25
|
+
return r.text
|
|
26
|
+
except Exception as e:
|
|
27
|
+
print(f"Failed to fetch {url}: {e}")
|
|
28
|
+
return None
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
if __name__ == "__main__":
|
|
32
|
+
combined = []
|
|
33
|
+
for u in URLS:
|
|
34
|
+
print(f"Fetching {u}")
|
|
35
|
+
txt = fetch(u)
|
|
36
|
+
if txt:
|
|
37
|
+
combined.append(f"# Source: {u}\n\n" + txt)
|
|
38
|
+
|
|
39
|
+
if not combined:
|
|
40
|
+
print("No content fetched.")
|
|
41
|
+
sys.exit(1)
|
|
42
|
+
|
|
43
|
+
OUT_FILE.write_text("\n\n".join(combined), encoding="utf-8")
|
|
44
|
+
print(f"Saved docs to {OUT_FILE}")
|