Build, test and publish an app #

View this page as Markdown

On this page

Prompt:

Build me a notes app with sign-in. Let me test it before you put it live.

Start with a template or the code you already have. Then follow the linked steps to test your app and put the checked version into production. Choose serverless for a new app with static files, functions, or both unless the app needs a server.

What your AI does #

Your AI assistant writes or adapts the app, tests its behavior, and deploys it to a development environment. It promotes the tested version when you ask, then checks production.

What you need #

Without a shell, use Deploy from a chat for the file workflow. Your AI assistant can check the hosted app, but it reports local tests as not run.

Before your AI starts #

Your AI should confirm the intended behavior, the project folder, and whether this is a new or existing application. For a server, ask the person to choose a size. Size and usage explains the choices. If nobody can answer, follow the behavior the request states and keep any size it names. For a server without a named size, use the unattended default in skill:deploy:prepare and report the choice. When you build a demo, there is no free plan or tier to select, and its charges draw first from the account's monthly Free Allowance.

Before the first deploy of the person's app, tell them which resources it will use, including any server size, database, or file storage, and point to pricing and read_balance. If the app needs sign-in, ask whether sign-up is open to anyone, limited to invited people, or requires a work account.

For this workflow, confirm that the person wants development before the first deploy. With nobody to ask, turn it on only if their request already asks for development. Otherwise stop and report before deploying. An application starts with production alone, so a deploy without development puts the version live.

For an unattended run or a computer using a token, follow Deploy with nobody at the keyboard. Keep the token's value out of chat.

Steps #

For the AI assistant: follow these phases in order. Read each linked procedure before doing its work.

1. Start from a template or existing code #

With a shell and a new app, follow Starting a new service to choose a template and create the project. For sign-in and private notes, choose functions-sign-in if the app can run as functions, or server-sign-in if it needs a server. Create the functions app without a size.

For existing code, read skill:move-existing-app with read_context and use Bring an existing application to prepare the code. Keep its project layout; do not scaffold over it. Before adding a capability, read Use the feature package library to check for a feature package and its integration instructions.

Without a shell, follow Design and write the app to prepare the files. For existing code, keep its layout. In this phase, prepare the project only. Follow phases 2 and 3 below before any linked procedure reaches a deploy.

2. Create the application and turn development on #

Read the deployment skill with read_context, id skill:deploy. Follow Create the application, reusing the application's identifier if it already exists.

Read skill:develop-then-promote and skill:release with read_context. Then follow Turn the development environment on, before deploying. Record the development hostname the response returns. Take production's hostname from a later platform response, rather than composing it. Keep each check on its intended environment.

3. Declare the services and prepare local settings #

Read skill:manifest-author with read_context, then follow Author the manifest to submit the whole declaration. For sign-in, also read skill:add-sign-in and follow Add sign-in to your app.

Before deploying, follow Store a secret to supply each secret a manifest setting references, in the environment you are about to deploy to. Check development and production separately; a value stored only for one does not supply the other.

For a local run of a server app, follow Run your app on your computer. Its provision command writes the development credentials into the environment file without passing their values through chat. Keep that file out of Git and follow the guide for settings the command does not write.

Without a shell, skip local provisioning. Follow Declare the services and libraries for the manifest and any package files needed on the hosted app.

4. Test locally and deploy to development #

With a shell, follow Test your application locally to check the app's behavior. For a server app, start and check the real local server using Run your app on your computer, then stop the processes you started. For functions-sign-in, use the template’s tests for the local check and verify browser sign-in in development in phase 5.

Fix failing checks before deployment. Follow Deploy to development and its linked upload procedure. Wait until the deploy ends successfully, following the returned status call where needed.

Without a shell, use the app ID and manifest from the earlier phases and follow Check and deploy the files. The earlier create_environment step means this deploy goes to development. Report which local checks could not run, then perform the hosted checks in phase 5.

5. Check the task in development #

Follow Check development before promoting. Check the behavior the person requested, its saved data where applicable, and the logs. A successful health check alone does not prove the app works.

For sign-in, follow Test sign-in with test end users, explicitly choosing development. For the notes app, check that a signed-in user can save and read their notes, and another user cannot read them.

Fix a failed check and deploy the corrected version to development before repeating it. Give the person the development address so they can try the app. Report the development version you checked and the results to the person. Keep that version number to pass to promote. If the person has yet to ask for this promote, ask whether to publish it.

6. Promote and check production #

Promote only when the person has asked for that promote. Otherwise ask and wait. Follow Promote to production, including its database migration cautions. Pass the development version number you checked in phase 5 as version, then wait for the outcome.

Follow Check the release against production. That section covers read-only checks and checks using a test end user on the first deploy. It also explains when other production writes on an app with real users need the owner's confirmation. Apply those production-write limits when checking signed-in behavior too.

Check that production is serving the promoted version. Report the production address, the version serving there, the checks that passed, and anything still unchecked. If the promote fails, read its recorded outcome before choosing the recovery in the linked guide. Also report who can sign up, what the app stores, where its source lives, and which test records remain.

Expected result #

Development serves the version whose requested behavior you checked. After an authorized promote, production's status shows that version as deployed, and the production checks report what worked and what remains unchecked.

Your AI assistant gives you the production address and check results. In a run without a shell, it identifies local checks as not run.

Refusals #

This table covers common refusals only. The linked procedures and the refusals reference give the other causes and remedies.

Refusal Cause Remedy
manifest_missing The application has no manifest on file. Submit it using phase 3 before deploying.
setting_secret_missing The target environment lacks a secret a setting needs. Use Store a secret, then repeat the refused operation.
deploy_in_flight Another deploy is still running. Read its status and wait for its outcome before starting another.
nothing_to_promote Development is running no version, and the promotion request does not specify one. Complete the development deploy in phase 4 first.
environment_not_created The application has production alone. Confirm the intended workflow and turn development on using phase 2.

For a local test failure, use Test your application locally: Refusals and the affected package's test-double instructions. If a prerequisite remains unavailable, stop and report what is needed before continuing.