AGENT SKILL

taku-sites

Use when a user wants to build or update a Taku Site on a taku.site subdomain. Excludes Marketplace Skills, SubApps, and Stax Cards.

License 许可
Apache-2.0
最近更新
2026-11-04
Stars
★ 0
Forks
2

01 前言 Front Matter

name
taku-sites
description
Use when a user wants to build or update a Taku Site on a taku.site subdomain. Excludes Marketplace Skills, SubApps, and Stax Cards.

02 资源文件 6

03 SKILL.md 正文

Build and publish a Taku Site

You build, run, and test the Site with your own tools. The bundled CLI only does what needs Taku: sign-in and identity, the live capability catalog, the browser SDK file, packaging and contract validation, subdomain availability, and publishing. It does not generate, host, or preview the Site.

Run every CLI command from this Skill's directory: cd <directory-containing-this-SKILL.md> && node scripts/taku-publisher.mjs <command> --json .... Read the JSON status, requires_action, and action_type; exit code 0 alone does not mean success. Do not assume a global CLI or a Publisher checkout.

Flow (in this order)

  1. Sign in first. sites-login --json, let the user finish the browser step, then auth-check --request-id <id> --json until authenticated. Then sites-whoami --json. Sites eligibility and capacity come from the current server policy for the authenticated account, not its email domain or this Skill version. If access is denied, stop and report it; do not work around it. Never ask for, print, or pass tokens; never call the Taku API yourself.
  2. Read the contract. sites-contract --json returns the project format, artifact limits, visitor capabilities, and a separate owner_assets contract. Check declared, authorized, and available independently. Owner library operations are not visitor SDK scopes. If the command fails because you are offline or signed out, fix that; do not guess from memory. Read references/materials.md when adding images or videos: new media must use the quota-managed material manifest, not the code asset bundle.
  3. Build the Site in the user's project to match what they asked for. See references/contract.md for the project layout, the manifest, the browser/Worker boundary, and security rules. See references/capabilities.md for SDK calls, scopes, and credits. For image generation/editing, read references/image-models.md: ask once for economy/quality or a named model if unspecified, retain an existing choice, read sites-image-models --operation <exact operation> --json, and put the selected model/version/parameters into app configuration and actual v2 quotes. Do not silently replace unavailable choices or send model fields through legacy calls. The build choice is not future visitors' payment consent. See references/storage.md for data (personal records, anonymous submissions, favorites, SQL). For a new empty project, sites-init --project <abs-dir> --json writes a minimal starting point. Replace it with a real Site. Get the SDK with sites-sdk-export --output <abs-project>/dist/assets/taku-sites-sdk.mjs --json.
  4. Run and test it yourself, using your normal dev server, tests, and browser. /__taku/* platform capabilities are not available outside Taku, so put them behind a stub. references/testing.md covers what you can and cannot check locally. Tell the user which behaviors you only checked against stubs.
  5. Validate. Run sites-validate --project <abs-dir> --json. Fix errors and rerun until it passes. This is a packaging and compatibility check. It is not an authorization check: the server re-checks the manifest, scopes, and capability availability at publish and at runtime.
  6. Ask the user for one exact subdomain. A request to build a site does not choose a subdomain. Do not suggest or generate candidates. To update a Site they already own, use its projectId from sites-list --json.
  7. Check availability, then ask about Marketplace discovery — mandatory. Run sites-publish --project <abs-dir> --slug <exact-subdomain> --json (or --project-id <owned-id>). If sites_slug_unavailable, ask for another subdomain. Otherwise show the returned confirm_target and build summary, and explicitly ask: “Your Site URL is public. Do you also want to list it on the Taku Marketplace so more people can discover it?” Ask in the user's language, including in external harnesses such as Codex, Claude Code, Cursor and OpenCode, even when they only asked to publish a website. This can share one question with target confirmation. A generic “publish” request, silence or a default checkbox is not an answer; wait for their explicit yes/no. Marketplace listing controls discovery, not the Site's access or visitor sign-in policy.
  8. Publish after both answers. Yes → --listing public; no → --listing private (excluded from Marketplace, while the Site URL remains public). Rerun the same command with that choice and --confirm-target <exact confirm_target>. For updates, tell the user their choice also changes the existing Marketplace listing. Do not silently carry consent across a different Site or a new confirmation after --reset.
  9. Report Site and Marketplace outcomes separately. A Site is live only when sites_published has ready: true, or sites-status --project-id <id> --json confirms the release. Report Marketplace discovery only from marketplace.status: listed is discoverable, unlisted is not, pending is waiting, failed was not confirmed, and unchanged means no listing choice was applied. If sites_publishing, rerun the same sites-publish command with the saved choice after checking status so listing can finish once the Site is ready. On retry_site_listing, the Site is already live: use sites-listing --project-id <id> --listing <same-choice> --json after checking its current state; do not republish it to retry listing. A conflict may reflect a choice made in Console; review it with the user before overwriting. A retry of the same interrupted publish keeps its answer; sites_build_changed / sites_target_changed / sites_listing_changed requires review and new confirmation before --reset. Preserve target, account and Worker-origin options on every retry. Report typed errors as returned.

Session renewal and errors

New Site sessions renew automatically for a fixed 30 days. auth-refresh --json renews now; auth-status --json reports validity without exposing credentials. A lost refresh response is recovered by promptly repeating the original command (within 60s). sites_login_required requires sites-login; publisher_refresh_unavailable means renewal could not be confirmed, so retry the same command without discarding its publish checkpoint. Older sessions without refresh support need login again when expired.

Report http_status, server_error, request_id and the sanitized summary from API errors. A 404 needs a target, account-access, and CLI-version check; none is a confirmed cause merely from the status. auth-logout --json clears local authorization and attempts server revocation; remote_session_revoked: false means revocation was not verified.

04 同仓库更多 Skills