@ericrisco/rsc 0.1.47 → 0.1.49
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/manifest.json +29 -29
- package/package.json +1 -1
- package/skills/db-migrations/SKILL.md +3 -20
- package/skills/decision-records/SKILL.md +3 -3
- package/skills/deep-learning/SKILL.md +12 -49
- package/skills/digitalocean/SKILL.md +10 -34
- package/skills/django/SKILL.md +2 -7
- package/skills/docker/SKILL.md +12 -44
- package/skills/document-processing/SKILL.md +5 -13
- package/skills/domains-dns/SKILL.md +2 -17
- package/skills/drizzle-orm/SKILL.md +1 -4
- package/skills/duckdb/SKILL.md +12 -18
- package/skills/dynamodb/SKILL.md +27 -40
- package/skills/e-signature/SKILL.md +9 -9
- package/skills/e2e-testing/SKILL.md +2 -12
- package/skills/electron/SKILL.md +12 -24
- package/skills/elixir/SKILL.md +6 -14
- package/skills/email-connector/SKILL.md +20 -37
- package/skills/email-deliverability/SKILL.md +9 -29
- package/skills/embeddings-search/SKILL.md +10 -19
- package/skills/error-handling/SKILL.md +10 -44
- package/skills/error-handling/scripts/verify.sh +0 -0
- package/skills/expo/SKILL.md +30 -45
- package/skills/fal/SKILL.md +2 -16
- package/skills/finance-ops/SKILL.md +5 -13
- package/skills/financial-model/SKILL.md +17 -35
- package/skills/finetuning/SKILL.md +7 -19
- package/skills/firebase/SKILL.md +19 -33
- package/skills/fly-io/SKILL.md +4 -13
- package/skills/fundraising/SKILL.md +5 -14
- package/skills/game-design/SKILL.md +9 -33
package/manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.49",
|
|
3
3
|
"counts": {
|
|
4
4
|
"skills": 258
|
|
5
5
|
},
|
|
@@ -1136,7 +1136,7 @@
|
|
|
1136
1136
|
},
|
|
1137
1137
|
{
|
|
1138
1138
|
"id": "db-migrations",
|
|
1139
|
-
"description": "Use when
|
|
1139
|
+
"description": "Use when a schema change must ship without downtime — NOT NULL, rename, type change, or backfilling millions of live rows — for the expand-contract sequence and the lock/batching discipline that keeps each step from freezing prod. NOT lock internals or EXPLAIN (that is `postgresdb`), NOT drizzle-kit mechanics (that is `drizzle-orm`), NOT PITR (that is `backups`).",
|
|
1140
1140
|
"tags": [
|
|
1141
1141
|
"migrations",
|
|
1142
1142
|
"zero-downtime",
|
|
@@ -1170,7 +1170,7 @@
|
|
|
1170
1170
|
},
|
|
1171
1171
|
{
|
|
1172
1172
|
"id": "decision-records",
|
|
1173
|
-
"description": "Use when a
|
|
1173
|
+
"description": "Use when a hard-to-reverse choice (database, framework, vendor, auth model) must be frozen as an immutable numbered ADR — the context that forced it, the options weighed, the decision, consequences both ways — or superseded without erasing history. NOT a meeting recap (that is meeting-notes), NOT standing project principles (that is constitution).",
|
|
1174
1174
|
"tags": [
|
|
1175
1175
|
"decision-records",
|
|
1176
1176
|
"adr",
|
|
@@ -1193,7 +1193,7 @@
|
|
|
1193
1193
|
},
|
|
1194
1194
|
{
|
|
1195
1195
|
"id": "deep-learning",
|
|
1196
|
-
"description": "Use when training or debugging a neural
|
|
1196
|
+
"description": "Use when training or debugging a neural net in PyTorch — the forward/loss/backward/step loop and its silent bugs, mixed precision (AMP), AdamW/LR schedules, DDP/FSDP/ZeRO, checkpoints and seeds. NOT LoRA/QLoRA on a pretrained LLM (that is `finetuning`), NOT tabular sklearn/XGBoost (that is `machine-learning`), NOT tokenization or NLP metrics (that is `nlp`).",
|
|
1197
1197
|
"tags": [
|
|
1198
1198
|
"pytorch",
|
|
1199
1199
|
"deep-learning",
|
|
@@ -1250,7 +1250,7 @@
|
|
|
1250
1250
|
},
|
|
1251
1251
|
{
|
|
1252
1252
|
"id": "digitalocean",
|
|
1253
|
-
"description": "Use when deploying or operating a workload on DigitalOcean
|
|
1253
|
+
"description": "Use when deploying or operating a workload on DigitalOcean — Droplet vs App Platform vs Functions, doctl, app spec YAML, Managed Postgres/MySQL/Valkey on the VPC, S3-compatible Spaces + CDN. NOT host-agnostic CI/CD or rollback strategy (that is `deployment`), NOT a bare Hetzner VPS (that is `hetzner`), NOT another managed PaaS (that is `railway`).",
|
|
1254
1254
|
"tags": [
|
|
1255
1255
|
"digitalocean",
|
|
1256
1256
|
"doctl",
|
|
@@ -1274,7 +1274,7 @@
|
|
|
1274
1274
|
},
|
|
1275
1275
|
{
|
|
1276
1276
|
"id": "django",
|
|
1277
|
-
"description": "Use when building, reviewing, securing, testing or shipping a Django
|
|
1277
|
+
"description": "Use when building, reviewing, securing, testing or shipping a Django app — models, migrations, QuerySets/managers, FBV/CBV views, forms, the admin, settings split, and Django REST Framework (serializers, ModelViewSet, permissions). NOT async FastAPI/Pydantic services (that is `fastapi`), NOT Postgres schema/index work (that is `postgresdb`).",
|
|
1278
1278
|
"tags": [
|
|
1279
1279
|
"python",
|
|
1280
1280
|
"django",
|
|
@@ -1294,7 +1294,7 @@
|
|
|
1294
1294
|
},
|
|
1295
1295
|
{
|
|
1296
1296
|
"id": "docker",
|
|
1297
|
-
"description": "Use when authoring or auditing a Dockerfile
|
|
1297
|
+
"description": "Use when authoring or auditing a Dockerfile, shrinking a bloated image, hardening a container that runs as root, picking a base image, or wiring a Compose dev loop with hot reload. NOT CI builds or deploy-to-host (that is `deployment`), NOT k8s autoscaling (that is `scaling`), NOT app-level injection or secrets-in-code (that is `secure-coding`).",
|
|
1298
1298
|
"tags": [
|
|
1299
1299
|
"docker",
|
|
1300
1300
|
"containers",
|
|
@@ -1312,7 +1312,7 @@
|
|
|
1312
1312
|
},
|
|
1313
1313
|
{
|
|
1314
1314
|
"id": "document-processing",
|
|
1315
|
-
"description": "Use when
|
|
1315
|
+
"description": "Use when the deliverable is a document's bytes or its literal content — text/tables out of PDFs, AcroForm fill and flatten, page merge/split, PDF/DOCX from templates, OCR of image-only scans. NOT schema-typed fields pulled from text (that is structured-extraction), NOT signature routing (e-signature) or spreadsheet cells/formulas (spreadsheet-ops).",
|
|
1316
1316
|
"tags": [
|
|
1317
1317
|
"pdf",
|
|
1318
1318
|
"ocr",
|
|
@@ -1332,7 +1332,7 @@
|
|
|
1332
1332
|
},
|
|
1333
1333
|
{
|
|
1334
1334
|
"id": "domains-dns",
|
|
1335
|
-
"description": "Use when pointing a
|
|
1335
|
+
"description": "Use when pointing a domain at a host or fixing broken HTTPS — delegating nameservers, writing A/AAAA/CNAME/ALIAS/MX/TXT/CAA rows, apex vs www, standing up auto-renewing TLS, and cutting nameservers over without downtime. NOT inbox placement or warmup (that is `email-deliverability`), NOT what runs behind the name (that is `deployment`).",
|
|
1336
1336
|
"tags": [
|
|
1337
1337
|
"dns",
|
|
1338
1338
|
"tls",
|
|
@@ -1356,7 +1356,7 @@
|
|
|
1356
1356
|
},
|
|
1357
1357
|
{
|
|
1358
1358
|
"id": "drizzle-orm",
|
|
1359
|
-
"description": "Use when modeling data or querying with Drizzle ORM in TypeScript — schema
|
|
1359
|
+
"description": "Use when modeling data or querying with Drizzle ORM in TypeScript — `pgTable` schema in `.ts`, type-safe select/insert/relational queries, `drizzle-kit` migrations. NOT Prisma Client or `schema.prisma` (that is `prisma-orm`), NOT ORM-agnostic migration strategy (that is `db-migrations`), NOT Postgres engine tuning or EXPLAIN (that is `postgresdb`).",
|
|
1360
1360
|
"tags": [
|
|
1361
1361
|
"drizzle",
|
|
1362
1362
|
"drizzle-orm",
|
|
@@ -1382,7 +1382,7 @@
|
|
|
1382
1382
|
},
|
|
1383
1383
|
{
|
|
1384
1384
|
"id": "duckdb",
|
|
1385
|
-
"description": "Use when
|
|
1385
|
+
"description": "Use when analytical SQL must run in-process with no server: Parquet/CSV/JSON/Arrow queried in place, OLAP embedded in an app or notebook, a slow pandas groupby on multi-GB data, or S3/lakehouse data read without downloading. NOT a multi-user analytics server (that is clickhouse-analytics), NOT an app's transactional CRUD store (that is postgresdb).",
|
|
1386
1386
|
"tags": [
|
|
1387
1387
|
"duckdb",
|
|
1388
1388
|
"olap",
|
|
@@ -1404,7 +1404,7 @@
|
|
|
1404
1404
|
},
|
|
1405
1405
|
{
|
|
1406
1406
|
"id": "dynamodb",
|
|
1407
|
-
"description": "Use when
|
|
1407
|
+
"description": "Use when modeling or operating a DynamoDB table: deriving partition/sort keys from access patterns, single-table vs table-per-entity, adding a GSI/LSI, on-demand vs provisioned capacity, or diagnosing hot-partition throttling. NOT relational schema/SQL/EXPLAIN (that is `postgresdb`), NOT aggregation-pipeline document modeling (that is `mongodb`).",
|
|
1408
1408
|
"tags": [
|
|
1409
1409
|
"dynamodb",
|
|
1410
1410
|
"nosql",
|
|
@@ -1425,7 +1425,7 @@
|
|
|
1425
1425
|
},
|
|
1426
1426
|
{
|
|
1427
1427
|
"id": "e-signature",
|
|
1428
|
-
"description": "Use when
|
|
1428
|
+
"description": "Use when wiring an e-signature flow with DocuSign or Dropbox Sign — picking the SES/AES/QES legal tier, sending a PDF or template for signature, embedded signing, verifying signing webhooks, retrieving the signed PDF plus audit trail. NOT drafting contract text (that is `contracts`), NOT extracting fields from PDFs (that is `document-processing`).",
|
|
1429
1429
|
"tags": [
|
|
1430
1430
|
"e-signature",
|
|
1431
1431
|
"docusign",
|
|
@@ -1448,7 +1448,7 @@
|
|
|
1448
1448
|
},
|
|
1449
1449
|
{
|
|
1450
1450
|
"id": "e2e-testing",
|
|
1451
|
-
"description": "Use when writing or stabilizing
|
|
1451
|
+
"description": "Use when writing or stabilizing Playwright tests that drive a real browser through multi-step journeys — durable locators, web-first assertions, storageState auth, trace/retries, and flakes that only bite in CI. NOT in-process component tests (that is testing-web), NOT WCAG auditing (that is accessibility), NOT the pre-merge gate (that is verify).",
|
|
1452
1452
|
"tags": [
|
|
1453
1453
|
"playwright",
|
|
1454
1454
|
"e2e",
|
|
@@ -1467,7 +1467,7 @@
|
|
|
1467
1467
|
},
|
|
1468
1468
|
{
|
|
1469
1469
|
"id": "electron",
|
|
1470
|
-
"description": "Use when building, hardening, or shipping a cross-platform desktop app
|
|
1470
|
+
"description": "Use when building, hardening, or shipping a cross-platform Electron desktop app — main/renderer/preload process model, typed contextBridge IPC, locking down nodeIntegration/contextIsolation/sandbox/CSP, or packaging with signing and auto-update. NOT a Rust-backed shell on the native webview (that is tauri), nor the web UI inside it (that is react).",
|
|
1471
1471
|
"tags": [
|
|
1472
1472
|
"electron",
|
|
1473
1473
|
"desktop",
|
|
@@ -1488,7 +1488,7 @@
|
|
|
1488
1488
|
},
|
|
1489
1489
|
{
|
|
1490
1490
|
"id": "elixir",
|
|
1491
|
-
"description": "Use when writing or refactoring Elixir/OTP
|
|
1491
|
+
"description": "Use when writing or refactoring Elixir/OTP on the BEAM — GenServers, supervision trees and restart strategies, pattern matching, mix projects and releases — or when processes misbehave (restart loops, mailbox growth, call timeouts). NOT a Phoenix web app, LiveView, Ecto or channels (that is `phoenix`).",
|
|
1492
1492
|
"tags": [
|
|
1493
1493
|
"elixir",
|
|
1494
1494
|
"otp",
|
|
@@ -1508,7 +1508,7 @@
|
|
|
1508
1508
|
},
|
|
1509
1509
|
{
|
|
1510
1510
|
"id": "email-connector",
|
|
1511
|
-
"description": "Use when wiring
|
|
1511
|
+
"description": "Use when wiring server code to send transactional or bulk email via Resend, SendGrid, or Postmark: a provider-agnostic sendEmail() seam, idempotent retries, 100-cap batches with partial failures, transactional-vs-broadcast streams, bounce webhooks feeding a suppression list. NOT SPF/DKIM/DMARC inbox reputation (that is `email-deliverability`).",
|
|
1512
1512
|
"tags": [
|
|
1513
1513
|
"email",
|
|
1514
1514
|
"transactional-email",
|
|
@@ -1530,7 +1530,7 @@
|
|
|
1530
1530
|
},
|
|
1531
1531
|
{
|
|
1532
1532
|
"id": "email-deliverability",
|
|
1533
|
-
"description": "Use when mail
|
|
1533
|
+
"description": "Use when mail already sent lands in spam, is rejected, or fails the Gmail/Yahoo bulk-sender checks and the fix is authentication and reputation, not the sending code: SPF/DKIM/DMARC alignment, domain warmup, spam-complaint rate, one-click unsubscribe, BIMI. NOT putting mail on the wire through a provider API (that is `email-connector`).",
|
|
1534
1534
|
"tags": [
|
|
1535
1535
|
"email",
|
|
1536
1536
|
"deliverability",
|
|
@@ -1552,7 +1552,7 @@
|
|
|
1552
1552
|
},
|
|
1553
1553
|
{
|
|
1554
1554
|
"id": "embeddings-search",
|
|
1555
|
-
"description": "Use when
|
|
1555
|
+
"description": "Use when choosing an embedding model, chunk size, or query form, when semantic search returns irrelevant results, when adding hybrid BM25+vector or a reranker, or when a retrieval change needs a number (recall@k, nDCG, MRR). NOT operating the store — index tuning, quantization (that is `vector-db`) — nor the retrieve-to-answer loop (that is `rag`).",
|
|
1556
1556
|
"tags": [
|
|
1557
1557
|
"embeddings",
|
|
1558
1558
|
"semantic-search",
|
|
@@ -1575,7 +1575,7 @@
|
|
|
1575
1575
|
},
|
|
1576
1576
|
{
|
|
1577
1577
|
"id": "error-handling",
|
|
1578
|
-
"description": "Use when designing
|
|
1578
|
+
"description": "Use when designing the reaction to a class of failures — typed error taxonomies, retry/backoff/timeout policy, circuit breakers, React/Next error boundaries, and the user-message vs operator-log split. NOT diagnosing one specific crash (that is debug), NOT logs/metrics/traces (that is observability), NOT the wire error envelope (that is api-design).",
|
|
1579
1579
|
"tags": [
|
|
1580
1580
|
"error-handling",
|
|
1581
1581
|
"resilience",
|
|
@@ -1598,7 +1598,7 @@
|
|
|
1598
1598
|
},
|
|
1599
1599
|
{
|
|
1600
1600
|
"id": "expo",
|
|
1601
|
-
"description": "Use when
|
|
1601
|
+
"description": "Use when shipping a React Native app with Expo — EAS Build/Submit/Update, eas.json profiles and channels, config plugins, prebuild/CNG, runtime-version policy, OTA updates that never land, SDK upgrades, the New Architecture. NOT RN UI, navigation or native-module authoring (that is `react-native`), NOT a Dart app (that is `flutter`).",
|
|
1602
1602
|
"tags": [
|
|
1603
1603
|
"expo",
|
|
1604
1604
|
"eas",
|
|
@@ -1641,7 +1641,7 @@
|
|
|
1641
1641
|
},
|
|
1642
1642
|
{
|
|
1643
1643
|
"id": "fal",
|
|
1644
|
-
"description": "Use when calling a fal.ai
|
|
1644
|
+
"description": "Use when calling a fal.ai endpoint by id to generate image, audio, or video from JS/Python/curl: subscribe vs submit, queue states, ED25519 webhook signature verification, per-call cost, or migrating off @fal-ai/serverless-client. NOT which model or art direction (that is ai-media); NOT the same models on another platform (that is replicate).",
|
|
1645
1645
|
"tags": [
|
|
1646
1646
|
"fal",
|
|
1647
1647
|
"fal-ai",
|
|
@@ -1680,7 +1680,7 @@
|
|
|
1680
1680
|
},
|
|
1681
1681
|
{
|
|
1682
1682
|
"id": "finance-ops",
|
|
1683
|
-
"description": "Use when running the money side of a small company on a cash basis
|
|
1683
|
+
"description": "Use when running the money side of a small company on a cash basis: a 13-week rolling cash-flow forecast and runway, bank-vs-books reconciliation, mapping spend to tax-return expense categories, or a month-end close. NOT posting journal entries, payroll or depreciation (that is `bookkeeping`); NOT multi-year projections (that is `financial-model`).",
|
|
1684
1684
|
"tags": [
|
|
1685
1685
|
"cash-flow",
|
|
1686
1686
|
"reconciliation",
|
|
@@ -1702,7 +1702,7 @@
|
|
|
1702
1702
|
},
|
|
1703
1703
|
{
|
|
1704
1704
|
"id": "financial-model",
|
|
1705
|
-
"description": "Use when a founder needs the
|
|
1705
|
+
"description": "Use when a founder needs the driver-based 18–36 month projection: revenue, cost and headcount builds resolving to net burn, runway, cash-out date, scenarios and the raise size. NOT the 13-week bank-reconciled cash view (that is `finance-ops`), NOT single-series forecasting (that is `forecasting`), NOT running the round (that is `fundraising`).",
|
|
1706
1706
|
"tags": [
|
|
1707
1707
|
"financial-model",
|
|
1708
1708
|
"projections",
|
|
@@ -1725,7 +1725,7 @@
|
|
|
1725
1725
|
},
|
|
1726
1726
|
{
|
|
1727
1727
|
"id": "finetuning",
|
|
1728
|
-
"description": "Use when adapting an open-weight model to a target
|
|
1728
|
+
"description": "Use when adapting an open-weight model to a target form or behavior — tone, output format, reasoning pattern — via LoRA/QLoRA or full fine-tuning with TRL SFTTrainer, then preference optimization (DPO/ORPO/KTO/GRPO), and for fine-tune vs prompt vs RAG. NOT adding facts to a model (that is rag); NOT the single-GPU Unsloth backend or GGUF export (that is unsloth).",
|
|
1729
1729
|
"tags": [
|
|
1730
1730
|
"finetuning",
|
|
1731
1731
|
"lora",
|
|
@@ -1749,7 +1749,7 @@
|
|
|
1749
1749
|
},
|
|
1750
1750
|
{
|
|
1751
1751
|
"id": "firebase",
|
|
1752
|
-
"description": "Use when building on Firebase —
|
|
1752
|
+
"description": "Use when building on Firebase — Firestore data modeling, Security Rules, Auth and custom claims, Cloud Functions, Storage, modular Web/Admin SDK imports — including symptoms like a database open to the internet, a query rejected by rules, or a doc stuck at ~1 write/sec. NOT managed-Postgres BaaS with SQL and RLS (that is supabase).",
|
|
1753
1753
|
"tags": [
|
|
1754
1754
|
"firebase",
|
|
1755
1755
|
"firestore",
|
|
@@ -1783,7 +1783,7 @@
|
|
|
1783
1783
|
},
|
|
1784
1784
|
{
|
|
1785
1785
|
"id": "fly-io",
|
|
1786
|
-
"description": "Use when deploying or operating an app on Fly.io — writing fly.toml,
|
|
1786
|
+
"description": "Use when deploying or operating an app on Fly.io — writing fly.toml, placing Machines in regions near users, attaching Volumes, managing secrets, or picking a scaling lever (autostop/autostart, scale count, fly-replay). NOT choosing which host to deploy on (that is `deployment`), NOT a git-push PaaS with no regions model (that is `railway`).",
|
|
1787
1787
|
"tags": [
|
|
1788
1788
|
"fly-io",
|
|
1789
1789
|
"deployment",
|
|
@@ -1822,7 +1822,7 @@
|
|
|
1822
1822
|
},
|
|
1823
1823
|
{
|
|
1824
1824
|
"id": "fundraising",
|
|
1825
|
-
"description": "Use when planning or running an equity
|
|
1825
|
+
"description": "Use when planning or running an equity round as a process: sizing the raise to a milestone, choosing post-money SAFE vs priced round, tiering investors by intro path, sequencing outreach for momentum, or reading a term sheet before signing. NOT the slide narrative (that is `pitch-deck`), NOT the cap-table or valuation math (that is `financial-model`).",
|
|
1826
1826
|
"tags": [
|
|
1827
1827
|
"fundraising",
|
|
1828
1828
|
"seed",
|
|
@@ -1845,7 +1845,7 @@
|
|
|
1845
1845
|
},
|
|
1846
1846
|
{
|
|
1847
1847
|
"id": "game-design",
|
|
1848
|
-
"description": "Use when designing or repairing
|
|
1848
|
+
"description": "Use when designing or repairing what makes a game fun — verbs and mechanics, moment-to-moment/session/meta loops, progression, economy faucets and sinks, difficulty curves, dominant strategies, juice, prototyping and scope. NOT engine code (that is `godot`), NOT story (that is `game-storytelling`), NOT level layout (that is `level-design`).",
|
|
1849
1849
|
"tags": [
|
|
1850
1850
|
"game-design",
|
|
1851
1851
|
"mechanics",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: db-migrations
|
|
3
|
-
description: "Use when
|
|
3
|
+
description: "Use when a schema change must ship without downtime — NOT NULL, rename, type change, or backfilling millions of live rows — for the expand-contract sequence and the lock/batching discipline that keeps each step from freezing prod. NOT lock internals or EXPLAIN (that is `postgresdb`), NOT drizzle-kit mechanics (that is `drizzle-orm`), NOT PITR (that is `backups`)."
|
|
4
4
|
tags: [migrations, zero-downtime, expand-contract, schema, backfill, ddl]
|
|
5
5
|
recommends: [postgresdb, drizzle-orm, backups, sql, planetscale]
|
|
6
6
|
origin: risco
|
|
@@ -17,20 +17,9 @@ point without an outage.
|
|
|
17
17
|
|
|
18
18
|
This skill is engine-neutral. It owns the *choreography* — what order to run things in and how to keep each
|
|
19
19
|
DDL from freezing the table — across Postgres, MySQL, and serverless variants, whatever runner you use
|
|
20
|
-
(Flyway, Alembic, golang-migrate, drizzle-kit, raw SQL).
|
|
21
|
-
Postgres tuning manual.
|
|
20
|
+
(Flyway, Alembic, golang-migrate, drizzle-kit, raw SQL).
|
|
22
21
|
|
|
23
|
-
##
|
|
24
|
-
|
|
25
|
-
**Use when:**
|
|
26
|
-
|
|
27
|
-
- Sequencing a multi-step zero-downtime change: NOT NULL, rename, split/merge, type change, drop, add FK.
|
|
28
|
-
- Backfilling a new column/table over millions of rows without blocking writes or blowing up replica lag.
|
|
29
|
-
- Making one DDL statement safe: `lock_timeout`, `CONCURRENTLY`, running outside a transaction.
|
|
30
|
-
- Coordinating deploy order so app version N and N+1 are both schema-compatible at every step.
|
|
31
|
-
- Deciding rollback strategy (forward-fix vs reversible) and choosing an OSC tool for a big MySQL ALTER.
|
|
32
|
-
|
|
33
|
-
**Route elsewhere:**
|
|
22
|
+
## Route elsewhere
|
|
34
23
|
|
|
35
24
|
- Postgres lock internals, EXPLAIN/ANALYZE, indexing strategy, RLS, PgBouncer → `../postgresdb/SKILL.md`.
|
|
36
25
|
- Writing schema and running drizzle-kit specifically → `../drizzle-orm/SKILL.md`.
|
|
@@ -246,9 +235,3 @@ the same static checks against the example migrations shipped in `references/`.
|
|
|
246
235
|
| Contracting before the cooling period | Kills your no-schema-change rollback path | wait until the new app has run clean; then drop |
|
|
247
236
|
| Relying on `down()` in prod | Data already changed; rollback is unsafe or wrong | forward-only; expand-contract IS the rollback (Step 6) |
|
|
248
237
|
| Coupling app + schema in one deploy | Breaks N/N-1; an instant where some app can't run | separate deploys; schema is a superset of both (Step 3) |
|
|
249
|
-
|
|
250
|
-
## References
|
|
251
|
-
|
|
252
|
-
- `references/expand-contract-playbook.md` — ordered deploy/migrate checklists per change (NOT NULL, rename, split, type change, drop, add FK).
|
|
253
|
-
- `references/backfill-and-batching.md` — batched backfill scripts (Postgres + MySQL), replica-lag throttle, checksum verification, snapshot+CDC for huge tables.
|
|
254
|
-
- `references/tools-and-runners.md` — 2026 tool matrix, gh-ost vs pt-osc, per-runner transaction opt-out, Squawk CI config.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: decision-records
|
|
3
|
-
description: "Use when a
|
|
3
|
+
description: "Use when a hard-to-reverse choice (database, framework, vendor, auth model) must be frozen as an immutable numbered ADR — the context that forced it, the options weighed, the decision, consequences both ways — or superseded without erasing history. NOT a meeting recap (that is meeting-notes), NOT standing project principles (that is constitution)."
|
|
4
4
|
tags: [decision-records, adr, architecture-decisions, rationale, decision-log, madr, knowledge-ops]
|
|
5
5
|
recommends: [meeting-notes, constitution, sop-builder, knowledge-ops, codebase-onboarding, plan, specify]
|
|
6
6
|
origin: risco
|
|
@@ -182,7 +182,7 @@ A decision log is only useful if it stays navigable.
|
|
|
182
182
|
- **Index every ADR at creation.** One row: `| 0007 | Choose Postgres | accepted | 2026-06-02 |`. No orphans.
|
|
183
183
|
- **Keep supersession links live** in both directions.
|
|
184
184
|
- **Review cadence.** Periodically sweep `accepted` ADRs — anything reality has overtaken gets a superseding record, not a silent edit.
|
|
185
|
-
- **Index the log from the entry point** — `02-DOCS/wiki/index.md`
|
|
185
|
+
- **Index the log from the entry point** — `02-DOCS/wiki/index.md` — so onboarding finds it. The broader wiki and onboarding doc belong to [`knowledge-ops`](../knowledge-ops/SKILL.md) and [`codebase-onboarding`](../codebase-onboarding/SKILL.md); this skill owns only the ADRs the wiki links to. The meeting that spawned a decision routes to [`meeting-notes`](../meeting-notes/SKILL.md); the repeatable how-to it implies routes to [`sop-builder`](../sop-builder/SKILL.md).
|
|
186
186
|
|
|
187
187
|
## Anti-patterns
|
|
188
188
|
|
|
@@ -199,4 +199,4 @@ A decision log is only useful if it stays navigable.
|
|
|
199
199
|
|
|
200
200
|
## Verify
|
|
201
201
|
|
|
202
|
-
Lint a produced ADR (or a whole decisions dir) with `scripts/verify.sh <path>`: it checks for a recognized status, a date, the required sections, ≥2 options, and a valid filename — read-only, no network.
|
|
202
|
+
Lint a produced ADR (or a whole decisions dir) with `scripts/verify.sh <path>`: it checks for a recognized status, a date, the required sections, ≥2 options, and a valid filename — read-only, no network. It expects the skeletons above.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: deep-learning
|
|
3
|
-
description: "Use when training or debugging a neural
|
|
3
|
+
description: "Use when training or debugging a neural net in PyTorch — the forward/loss/backward/step loop and its silent bugs, mixed precision (AMP), AdamW/LR schedules, DDP/FSDP/ZeRO, checkpoints and seeds. NOT LoRA/QLoRA on a pretrained LLM (that is `finetuning`), NOT tabular sklearn/XGBoost (that is `machine-learning`), NOT tokenization or NLP metrics (that is `nlp`)."
|
|
4
4
|
tags: [pytorch, deep-learning, neural-networks, training-loop, autograd, mixed-precision, amp, ddp, fsdp, optimizer, lr-scheduler, reproducibility, torch-compile]
|
|
5
5
|
recommends: [machine-learning, finetuning, nlp, python]
|
|
6
6
|
origin: risco
|
|
@@ -27,8 +27,7 @@ is stable 2.x API. The one namespace shift to know: AMP now lives under `torch.a
|
|
|
27
27
|
| Adapting a *pretrained LLM* — LoRA/QLoRA, SFT, trl/peft | [`finetuning`](../finetuning/SKILL.md) |
|
|
28
28
|
| Classic/tabular — sklearn, XGBoost/LightGBM, feature engineering | [`machine-learning`](../machine-learning/SKILL.md) |
|
|
29
29
|
| Tokenization, NLP task modeling, task metrics (F1/BLEU/ROUGE) | [`nlp`](../nlp/SKILL.md) |
|
|
30
|
-
|
|
31
|
-
If the model is a from-scratch or vision/custom net and you're writing the loop yourself, stay.
|
|
30
|
+
| Envs, packaging, tests and hygiene around the model code | [`python`](../python/SKILL.md) |
|
|
32
31
|
|
|
33
32
|
## 1. PyTorch essentials
|
|
34
33
|
|
|
@@ -83,7 +82,7 @@ for epoch in range(epochs):
|
|
|
83
82
|
scheduler.step() # if a per-step scheduler
|
|
84
83
|
```
|
|
85
84
|
|
|
86
|
-
The load-bearing traps
|
|
85
|
+
The load-bearing traps, stated next to the lines they govern:
|
|
87
86
|
|
|
88
87
|
- **Missing `optimizer.zero_grad()` → gradients silently add up across batches.** PyTorch
|
|
89
88
|
*accumulates* `.grad` by design (so you can split a batch); if you never zero it, every step
|
|
@@ -200,7 +199,6 @@ Save optimizer + scheduler + scaler too, or a resumed run restarts its LR schedu
|
|
|
200
199
|
`pytorch.org/docs/stable/notes/randomness.html`, quoted: *"Completely reproducible results are not
|
|
201
200
|
guaranteed across PyTorch releases, individual commits, or different platforms. Furthermore,
|
|
202
201
|
results may not be reproducible between CPU and GPU executions, even when using identical seeds."*
|
|
203
|
-
So bit-exact reproducibility is a debugging/regression tool, not a guarantee.
|
|
204
202
|
|
|
205
203
|
```python
|
|
206
204
|
import random, numpy as np, torch
|
|
@@ -217,47 +215,12 @@ DataLoader workers need their own seeding (each worker forks its RNG), via `work
|
|
|
217
215
|
a seeded `generator` — full snippet in `references/training-recipes.md`. Determinism costs speed
|
|
218
216
|
(`benchmark=False` disables autotuned convs).
|
|
219
217
|
|
|
220
|
-
##
|
|
221
|
-
|
|
222
|
-
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
-
|
|
229
|
-
seed for debugging, don't promise bit-exactness. (randomness note, pytorch.org)
|
|
230
|
-
- **fp16 without `GradScaler`** underflows to zero grads → no learning. bf16 doesn't need it.
|
|
231
|
-
- **`CrossEntropyLoss`/`BCEWithLogitsLoss` take raw logits** — no Softmax/Sigmoid before them.
|
|
232
|
-
- **Everything on the same device** — a stray CPU tensor in a CUDA graph is a hard error you'll hit
|
|
233
|
-
fast; `.to(device)` inputs, targets, and model.
|
|
234
|
-
- **NaN loss?** LR too high, no AMP scaler on fp16, unclipped exploding grads, or a `log(0)`/`0/0`
|
|
235
|
-
in a custom loss. Bisect: drop LR 10×, clip grads, switch fp16→bf16.
|
|
236
|
-
|
|
237
|
-
## Related skills
|
|
238
|
-
|
|
239
|
-
- [`finetuning`](../finetuning/SKILL.md) — adapting a **pretrained LLM** (LoRA/QLoRA, SFT via
|
|
240
|
-
trl/peft). If the base is a foundation model you're specializing, that's the skill; this one is
|
|
241
|
-
general/from-scratch net training.
|
|
242
|
-
- [`machine-learning`](../machine-learning/SKILL.md) — classic/**tabular** (sklearn, GBDT). No
|
|
243
|
-
autograd, no GPU loop.
|
|
244
|
-
- [`nlp`](../nlp/SKILL.md) — tokenization, NLP **task** modeling and metrics. Route text task
|
|
245
|
-
specifics there; route the raw training loop back here.
|
|
246
|
-
- [`python`](../python/SKILL.md) — env/packaging, testing, general Python hygiene under the model
|
|
247
|
-
code.
|
|
248
|
-
|
|
249
|
-
## Checklist
|
|
250
|
-
|
|
251
|
-
- [ ] Right skill: from-scratch/vision/custom net in PyTorch (not finetuning / ML / nlp).
|
|
252
|
-
- [ ] Loop has all five steps in order; `zero_grad(set_to_none=True)` every step.
|
|
253
|
-
- [ ] Loss takes raw logits (no double activation); running loss uses `.item()`.
|
|
254
|
-
- [ ] `model.train()` for training; `model.eval()` **and** `torch.no_grad()` for val/inference.
|
|
255
|
-
- [ ] AMP: `torch.autocast` on forward+loss only; fp16 → `GradScaler`, bf16 → skip it; clip after
|
|
256
|
-
`unscale_`.
|
|
257
|
-
- [ ] AdamW (decoupled decay) with no weight decay on bias/Norm params; LR warmup→cosine, `step()`
|
|
258
|
-
cadence matches scheduler units.
|
|
259
|
-
- [ ] Multi-GPU chosen by fit: DDP (fits) vs FSDP2 (doesn't) vs ZeRO (offload/config).
|
|
260
|
-
- [ ] Checkpoint saves model+optimizer+scheduler+scaler `state_dict`s; resume loads model first.
|
|
261
|
-
- [ ] Seeds set; determinism flags on if needed, with the "not guaranteed across releases/devices"
|
|
262
|
-
caveat acknowledged.
|
|
263
|
-
- [ ] Version claims hedged to "PyTorch 2.x (~2.13, verify)"; no hard minor pin presented as current.
|
|
218
|
+
## Anti-patterns (the silent killers)
|
|
219
|
+
|
|
220
|
+
| Anti-pattern | What actually happens | Instead |
|
|
221
|
+
|---|---|---|
|
|
222
|
+
| Validating with the model left in `train()` mode, or without `torch.no_grad()` | Dropout keeps dropping and BatchNorm uses *batch* stats instead of running stats, so val numbers are wrong; the graph is still built and can OOM | `model.eval()` + `torch.no_grad()` around val/inference, `model.train()` after (`nn.Module.eval` / autograd docs, pytorch.org) |
|
|
223
|
+
| Reading a NaN loss as a modeling problem | It is almost always LR too high, fp16 with no `GradScaler`, unclipped exploding grads, or a `log(0)`/`0/0` in a custom loss | Bisect: drop LR 10×, clip grads, switch fp16→bf16 |
|
|
224
|
+
| fp16 with the scaler left off | Gradients underflow to zero → no learning, and no error to tell you | Keep `GradScaler` on fp16, or move to bf16 where underflow can't happen |
|
|
225
|
+
| A stray CPU tensor in a CUDA graph | Hard device-mismatch error mid-step, usually on the targets or a hand-built mask rather than the inputs | `.to(device)` inputs, targets **and** model |
|
|
226
|
+
| Promising bit-exact reproducibility from seeds | Not guaranteed across releases, commits, platforms, or CPU-vs-GPU even with identical seeds | Seed for debugging/regression and say so; state the caveat with the result (randomness note, pytorch.org) |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: digitalocean
|
|
3
|
-
description: "Use when deploying or operating a workload on DigitalOcean
|
|
3
|
+
description: "Use when deploying or operating a workload on DigitalOcean — Droplet vs App Platform vs Functions, doctl, app spec YAML, Managed Postgres/MySQL/Valkey on the VPC, S3-compatible Spaces + CDN. NOT host-agnostic CI/CD or rollback strategy (that is `deployment`), NOT a bare Hetzner VPS (that is `hetzner`), NOT another managed PaaS (that is `railway`)."
|
|
4
4
|
tags: [digitalocean, doctl, app-platform, droplets, spaces, deployment, paas, vps]
|
|
5
5
|
recommends: [deployment, postgresdb, docker, domains-dns, monitoring, scaling, hetzner]
|
|
6
6
|
origin: risco
|
|
@@ -8,10 +8,11 @@ origin: risco
|
|
|
8
8
|
|
|
9
9
|
# DigitalOcean — Droplet vs App Platform, doctl, Managed DBs, Spaces
|
|
10
10
|
|
|
11
|
-
You own one decision: **where on DO does this run, and how do I ship it.**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
You own one decision: **where on DO does this run, and how do I ship it.** Host-agnostic
|
|
12
|
+
CI/CD, release gating and rollback strategy are `../deployment/SKILL.md`; authoring the
|
|
13
|
+
Dockerfile is `docker`; DNS records and the registrar are `domains-dns`; a bare Hetzner box
|
|
14
|
+
and its economics are `hetzner`. Pick the compute model first, then wire data and storage,
|
|
15
|
+
then the ops that bite in production.
|
|
15
16
|
|
|
16
17
|
```text
|
|
17
18
|
workload → [Droplet | App Platform | Functions] → Managed DB (VPC private host) → Spaces (S3 + CDN)
|
|
@@ -34,11 +35,9 @@ Droplet only when you need the box itself.
|
|
|
34
35
|
Rules of thumb:
|
|
35
36
|
|
|
36
37
|
- **Stateless web service or API from a Git repo → App Platform.** It builds, deploys, gives
|
|
37
|
-
you TLS and a URL, and re-deploys on push. No box to patch.
|
|
38
|
+
you TLS and a URL, and re-deploys on push. No box to patch. **Static frontend → App
|
|
39
|
+
Platform static site (free, up to 3)**; don't run a Droplet to serve HTML.
|
|
38
40
|
- **You need root, a long-lived stateful daemon, custom ports, or a cron host → Droplet.**
|
|
39
|
-
App Platform components are not meant to be a persistent pet process.
|
|
40
|
-
- **Static frontend → App Platform static site (free, up to 3).** Don't run a Droplet to
|
|
41
|
-
serve HTML.
|
|
42
41
|
- **A managed Postgres/MySQL/Valkey → always the Managed Database product**, never a DB you
|
|
43
42
|
hand-install on a Droplet, unless you have a hard reason.
|
|
44
43
|
|
|
@@ -156,8 +155,8 @@ doctl compute droplet create web-1 \
|
|
|
156
155
|
to spin up and destroy, but a powered-off Droplet still bills for storage — destroy, don't
|
|
157
156
|
just power off, to stop charges.
|
|
158
157
|
|
|
159
|
-
Cloud-init recipes, firewall inbound/outbound rule sets, snapshot cadence
|
|
160
|
-
failover live in `references/droplet-ops.md`.
|
|
158
|
+
Cloud-init recipes, firewall inbound/outbound rule sets, snapshot cadence + restore,
|
|
159
|
+
reserved-IP failover, and the VPC + private-DB layout live in `references/droplet-ops.md`.
|
|
161
160
|
|
|
162
161
|
## Managed Databases
|
|
163
162
|
|
|
@@ -206,11 +205,6 @@ browser fetches it cross-origin, and a **lifecycle** rule to expire/transition o
|
|
|
206
205
|
|
|
207
206
|
## Basic ops + cost gotchas
|
|
208
207
|
|
|
209
|
-
```bash
|
|
210
|
-
doctl apps logs <app-id> --type run --follow # app logs
|
|
211
|
-
doctl apps update <app-id> --spec .do/app.yaml # change instance_count/size by editing the spec
|
|
212
|
-
```
|
|
213
|
-
|
|
214
208
|
- Set **alerts** on the app/DB (deploy failures, CPU, restart count) so you hear about
|
|
215
209
|
trouble before users do. App-level dashboards/alerting *strategy* is `../monitoring`.
|
|
216
210
|
- **Scale** by editing `instance_count`/`instance_size_slug` in the spec and re-applying;
|
|
@@ -231,21 +225,3 @@ doctl apps update <app-id> --spec .do/app.yaml # change instance_count/size by e
|
|
|
231
225
|
| Hand-installing Postgres on a Droplet "to save money" | You now own patching, backups, failover | Managed Database unless you have a hard reason |
|
|
232
226
|
| Powering off a Droplet to stop billing | Powered-off Droplets still bill for storage | Snapshot then destroy |
|
|
233
227
|
| Leaving a reserved IP unassigned | It's billed when not attached | Release it |
|
|
234
|
-
|
|
235
|
-
## References
|
|
236
|
-
|
|
237
|
-
- `references/app-spec.md` — full multi-component app spec (web + worker + static_site + job
|
|
238
|
-
+ database), health checks, ingress routes, instance-size slug table, env/SECRET scoping,
|
|
239
|
-
autoscaling and alerts.
|
|
240
|
-
- `references/droplet-ops.md` — cloud-init examples, cloud firewall inbound/outbound rule
|
|
241
|
-
recipes, snapshot/backup cadence + restore, reserved IP failover, VPC + private DB layout.
|
|
242
|
-
|
|
243
|
-
## Boundary
|
|
244
|
-
|
|
245
|
-
This skill is DigitalOcean-specific deployment. For neighbors:
|
|
246
|
-
|
|
247
|
-
- Host-agnostic CI/CD pipelines, release gating, rollback strategy → `../deployment/SKILL.md`.
|
|
248
|
-
- Postgres schema/query/index work (not "provision a DO cluster") → `../postgresdb/SKILL.md`.
|
|
249
|
-
- Authoring the Dockerfile itself → `docker`. DNS records/registrar → `domains-dns`.
|
|
250
|
-
- Uptime/metrics dashboards + alerting strategy → `monitoring`. Host-agnostic capacity →
|
|
251
|
-
`scaling`. A Hetzner bare VPS and its economics → `hetzner`.
|