taubyte-core-constraints
Core Constraints
Must-follow rules
- Never ask user to run setup commands manually; agent performs setup.
- Run CLI preflight (
taubyte-cli-prereqs) before all Taubyte operations. - For Dream/local, never run backend-contacting
taucommands before Dream is up and universe exists. - Use
dreamcommands directly; never usetau dream. - Use default universe
defaultunless user explicitly requests another. - After resource creation, push config (
tau push project --config-only) before relying on resource visibility. - After code changes, push code (
tau push project --code-only) and verify builds/logs. - Never set function timeout to
0; use valid durations (30s,1m, etc.). - HTTP functions: one function per path+method; never comma-separated methods.
- For functions/websites in automation, use empty template; for Go functions, include
--language Go. - Use matcher values for DB/storage SDK calls, not human-facing resource names or YAML filenames (
description/ basename are not runtime keys). The Go string must match YAMLmatch(and regex pattern whenuseRegex: true). Examples:match: appdata↔database.New("appdata");match: /todos↔database.New("/todos")— leading slash must match exactly. - Do not bypass failing
tau push projectwith direct git operations. - On Git Bash Windows for path-like flags, prefix with
MSYS_NO_PATHCONV=1. - Website
.taubyte/build.shmust be non-empty and must write deploy output to/out. - Verify project selection with
tau --json currentbefore resource mutations. - Website/library git fallback is an exception path only when
tau push website|libraryis unavailable; never apply this exception to project config/code pushes. - Never create website/library without explicit repository strategy:
- use
--generate-repositorywith deterministic--repository-name, or - use explicit existing
--repository-name/--repository-id.
- use
- After creating website/library, verify repository binding in config (
websites/*.yamlorlibraries/*.yaml) before pushing. - Go functions:
empty.gostays at the function root next togo.mod. Never manually createlib/, never moveempty.gounderlib/, and never hand-authormain.goin the function folder to fix builds. For local WASM verification, use thetaubyte/go-wasiDocker recipe intaubyte-go-sdk-constraints— notlib/+main.goshims. - New project: If the user asked to create a new project, run
tau new project+tau select project, thentau --json currentand confirmProjectmatches the new name before anytau import,tau push project, ortau newresource command. Stale selection is the usual cause of “imports pulling the wrong GitHub project.” - Project config notification email: ensure
config/config.yamlhas a validnotification.email(not""). Prefergit config user.email; if unavailable, ask the user for the email. Write it as a plain YAML value (no quotes) to avoidmail: no addressconfig-compiler failures. - Push ordering: always push project config first and wait for the latest Config build to succeed before pushing website/library code that depends on those resources being present in config.
- HTTP handlers with a body: set headers (e.g.
Content-Type) as needed, write the body (Write/ equivalent), thenReturnwith the final status as the last step. Returning before writing yields empty or broken JSON and clients that look like “API does nothing.” - After adding or renaming databases or messaging, grep the codebase for
database.New(andpubsubnode.Channel((or equivalent) and diff literals againstconfig/applications/<app>/databases/*.yamlandmessaging/*.yamlbefore declaring the task done.
Database and messaging (config ↔ code)
- Database: path is
config/applications/<app>/databases/<name>.yaml. Everydatabase.New(...)in WASM for that app must use the same string as resourcematchwhenuseRegex: false. Typical YAML also includesuseRegex,access.network,storage.size,replicas.min/replicas.max— follow CLI-generated shapes when unsure. - Messaging + PubSub: the messaging resource defines
channel.match(andbridges.mqtt/bridges.websocket). PubSub-triggered functions usetrigger.type: pubsubandtrigger.channelequal to that match. Producers in HTTP code use the same channel string withpubsub/node. When both messaging and function YAML includelocal, keep them consistent. Enablewebsocketin messaging config if handlers exposeWebSocket().Url()to browsers. - Debugging “database open failed”: first compare YAML
matchvs everydatabase.Newliteral in that application (including/).
Layout constraints
- Project has
tb_config_<name>+tb_code_<name>. - Website/library have separate repositories.
- Function build layout must be discoverable by build system (avoid misplaced function paths). For Go serverless functions, that means root
empty.goonly for authored sources; do not invent alib/tree or commit ad-hocmain.gobeside it.
More from taubyte/skills
verifying-taubyte-functions
Verifies a Taubyte Go function locally via the `taubyte/go-wasi` Docker recipe (preferred over `tau build`, with tmpfs+bind-mount-ro to avoid root-owned artifacts in the source tree), and verifies a function actually serves on Dream by curling the gateway with the right `Host:` header (plus `/etc/hosts` mapping for `*.localtau`). Use when locally compiling a Go function to WASM, when smoke-testing a function before pushing, or when probing a Dream-hosted HTTP function from the laptop.
12creating-taubyte-resources
Creates Taubyte resources non-interactively via `tau new` for domain, website, library, function, application, database, storage, messaging, and service. Encodes the project-vs-application scope rule, the database `min < max` constraint, the website/library `--generate-repository` + import sequence, and the forbidden `--generated-fqdn-prefix` flag. Use when adding any resource to a Taubyte project's config repo.
12diagnosing-dream-builds
Diagnoses Dream local-cloud builds when `tau list/query builds` is empty or unreliable, by hitting the jobs HTTP endpoint directly (`GET /jobs/<project_id>`, `GET /job/<job_id>`) using the GitHub token from `~/tau.yaml`, then downloading logs with `tau query logs --jid`. Use when Dream builds appear silent, the build table is empty after `dream inject`, or you need raw job ids and logs for a failing build.
11taubyte-resource-creation
Scope-aware resource creation workflow. Uses non-interactive mode by default and references the shared flags catalog.
11taubyte-push-build-verify
Pushes config/code and verifies builds/logs. Includes website/library push handling with tau command first, git fallback.
11taubyte-scope-routing
Routes project-level vs application-scoped work; defaults to a website when a browser UI is logically appropriate; avoids unnecessary applications for simple website/function-only tasks unless needed.
11