| name | stockflow-yaml-runtime |
|---|---|
| description | Use this skill when working on Stockflow's YAML-first execution model. Focus on user-authored YAML workflows, database-first setup, db:generate flow, and secure runtime behavior. Exclude temporal/ and bpm_engine/ unless explicitly requested. |
This skill is for /home/shakir/projects/autobizt/supabase and focuses on stockflow/.
Primary targets:
stockflow/- root infra files related to Stockflow (
docker-compose.yml,.env,config/)
Do not modify temporal/ or bpm_engine/ unless the user explicitly overrides this skill scope.
- Stockflow is inspired by Kestra and Supabase.
- The core idea is YAML-driven backend execution.
- Design intent includes tighter control for security-sensitive workflows.
- API entry:
stockflow/src/index.ts - Runtime executor:
stockflow/src/runtime/index.ts - Built-in runtime functions:
stockflow/src/runtime/system-functions.ts - YAML loader/template resolver:
stockflow/src/helper/yaml.loader.ts - Query compiler:
stockflow/src/helper/query.model.ts - DB + schema:
stockflow/src/db/index.ts,stockflow/src/db/schema.ts - RLS middleware:
stockflow/src/middleware/withDb.ts,stockflow/src/middleware/rls.ts - YAML functions:
stockflow/data/functions/**/*.yml - MCP tool bootstrap:
stockflow/src/mcp/index.ts
- User creates/updates PostgreSQL tables.
- User runs
npm run db:generateinsidestockflow/. - User writes YAML functions for business operations.
- Runtime executes YAML through
/api/rpc.
- Edit or add file in
stockflow/data/functions/. - Define
params,steps, andreturn. - Use supported step types only:
call,map,editField,reference,query,persist,condition,loop. - If function should appear as MCP tool, set:
skill: truetitle: "<tool title>"
- Validate that called system functions exist in
system-functions.ts.
- Add implementation in
stockflow/src/runtime/system-functions.ts. - Ensure function is deterministic and handles malformed inputs safely.
- Wire YAML calls with
type: callandfunction: <name>.
- Update
stockflow/src/helper/query.model.ts. - Keep filter/search/having semantics backward compatible.
- Verify sort/populate behavior for nested tables.
After edits, run only relevant checks:
cd stockflow
npm run db:generate
npm run buildIf DB-dependent checks cannot run (environment missing), report explicitly.
- Exclude
temporal/by default. - Exclude
bpm_engine/by default. - Avoid changing generated migration snapshots unless migration work is requested.
- Preserve RLS behavior in middleware and transaction contexts.
- Never hardcode secrets in code or docs.