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>
- 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 some **databases/*.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*.