taubyte-resource-creation
Resource Creation
Preconditions
taubyte-core-constraintsloadedtaubyte-scope-routingcompletedtaubyte-project-and-applicationcompleted for project (and application only if the task required it — do not assume an application exists)tau --json currentwas run after the lasttau select project/tau new project; theProjectfield matches the task’s intended project (seetaubyte-orchestrator→ New project hard gate — never import or create resources under a stale selection)taubyte-context-loginitializedtaubyte-build-runtime-configavailable for server-side config/build logic
Order
- Global / project-level resources first (
domain, andwebsite/libraryonly whentaubyte-scope-routingkeeps them at project scope) — no application step unless routing says otherwise. - Full-stack multi-app (see
taubyte-reference-index→ Full-stack worked example):domainat project level → create/select Frontend → website there → create/select Backend →library,database,messaging(when using PubSub/WebSocket),functionsthere. Createmessagingbefore or together with functions that publish or subscribe to that channel; createlibrary/databasebefore or in lockstep with function YAML that references them. Push project config and wait for config build success before relying on realtime or new routes. - Website default: when
taubyte-scope-routing→ Website when logically appropriate applies,tau new website(and import/push per below) is in scope for that project — not optional for user-facing app briefs unless the user chose headless / API-only. - Application-scoped resources next (database, storage, messaging, service, smartops, and function when scoped to an application) — run
tau select applicationonly for the phase that needs it; do not create an application for website-only or simple global function work.
Rules
- Use default non-interactive mode unless user requested interactive.
- For full flags, use
taubyte-resource-flags-reference. - Use
MSYS_NO_PATHCONV=1for path-like flags in Git Bash. - Never use
--generated-fqdn-prefixunless the user explicitly asks for a specific prefix value. - If server-side config is needed, update
.taubyte/config.yaml; if env vars are needed, declare them in.taubyte/build.shonly (seetaubyte-build-runtime-config). Validate both before push. - For Go function implementation correctness, apply
taubyte-go-sdk-constraints. - After creating a serverless function with
--template empty, immediately editempty.goat the function root (same directory asgo.mod— never underlib/) with a real implementation. Do not createlib/, moveempty.gointolib/, or add hand-writtenmain.go; seetaubyte-go-sdk-constraints(layout + Docker WASM test). - Website/library creation must use explicit repo strategy; never rely on implicit repo auto-selection.
- Deterministic default for generated repos:
- website:
tb_code_<project>_<website> - library:
tb_code_<project>_<library>
- website:
- Immediately import after creation to sync local repository clone (only after preconditions above — especially correct
Projectintau --json current):tau import website --name <site>tau import library --name <lib>
- Immediately verify bound repo fullname/ID in config yaml after creation/import; if mismatch, stop and fix before any push.
- Update context log after every mutation.
One Go WASM library, multiple HTTP functions
When several routes share one build:
- Create one library resource + repo (
libraries/<name>.yaml, GitHub source). - Add separate
functions/<handler>.yamlfiles under the same Backend (or chosen) application, each withsource: libraries/<sameLibraryName>(path relative to that application). - Split behavior with
trigger.type: https(orhttpper CLI),trigger.method,trigger.paths, andexecution.call— eachcallmust match a//export <call>symbol in the library sources. Pure PubSub consumers may omitdomains:; HTTP routes keepdomains: [...]as usual. - Define a
databaseresource whosematch(e.g./leaderboardorappdata) is identical to the string passed todatabase.New(...)in the Go code (including a leading/when the YAML uses one). After editing YAML or Go, grep fordatabase.New(and confirm every literal matches somedatabases/*.yamlin the same application. - For
libraries/*.yaml, setsource.pathto the path inside the library repository where sources live (must match the cloned repo layout — not an invented folder). Mismatch is a common cause of “API runs but data doesn’t persist” or wrong handlers.
Verify each resource’s bound github.fullname after import/create. Multi-repo splits (config vs website vs library vs code skeleton) follow the same explicit-repo rules as any tau import website / tau import library workflow.
For a concrete YAML + repo layout, see taubyte-reference-index → Full-stack worked example.
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-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.
11understanding-taubyte-architecture
Explains the Taubyte mental model — `tau` CLI vs `dream` local cloud, remote-vs-local cloud types, GitHub as the single source of truth, and the config/code/website/library repo layout that drives builds. Use when the user asks how Taubyte fits together, why pushes don't show up, what repos are needed, or whether to use Dream or a remote cloud.
11