Beginner Steps. Advanced AI.
Published guideUpdated
Chapter 13 of 20Build & check
Build your first page
Let Codex build the Home page. Open it, check it, and save a working version.
One working page is a great place to start. Let’s open it together.
Follow the pictures
Illustrated examples. Your app may look different. Tap an image to enlarge it.
-
Check your tools
Ask Codex to check your project and Node version against the Astro requirements.
Illustrated example - In Codex
- fieldnotes-studio → New chat → Ask to check the tools
Look for: Codex confirms the right project and whether Node is supported.
More help with this action
Ask Codex to inspect the project folder and Node version before installing anything. Have it confirm that your supported Node LTS version meets the current Astro installation requirements.
Check before installing
- Open the fieldnotes-studio project in Codex. Start a chat within that project, so the agent works in the correct folder.
- Ask: “Check the current branch and my Node and npm versions. Compare Node with Astro’s current requirements. Do not install anything yet.”
- Read the result. If a tool is missing or unsupported, return to the computer-setup chapter and fix that before continuing.
You should now see: Codex confirms the right project and whether Node is supported.
-
Create the starting files
Copy the first-page prompt into Codex. Ask it to create the Astro starting files without overwriting your earlier work.
Illustrated example - In Codex
- Copy prompt → Paste → Send
- Keep safe
- Existing Git history, instructions, skills, and notes
Look for: The project has Astro files and your earlier work is still there.
More help with this action
Use the first-milestone prompt to scaffold a minimal Astro project. If the existing folder is unsuitable for the wizard, use a temporary scaffold. Exclude its .git folder, merge README.md and .gitignore instead of overwriting them, and preserve AGENTS.md, .agents/, and docs/.
Preserve the existing project
- Open the linked prompt, click Copy prompt, then paste it into your fieldnotes-studio chat and send it.
- The folder already contains Git history and instructions. If Astro needs an empty folder, Codex should create a temporary scaffold, then copy only the needed starting files.
- Do not copy the temporary .git folder. Merge README.md and .gitignore rather than replacing them, and preserve AGENTS.md, .agents/, and docs/.
- Ask Codex to list what it added and confirm that the existing branch, history, and planning files survived.
You should now see: The project has Astro files and your earlier work is still there.
-
Build Home
Ask Codex to build Home using your brief and a shared page layout. Use your real text and permitted images.
Illustrated example - Build request
- Your brief → Shared layout → Home
Look for: Home shows your approved offer and a clear way to contact you.
More help with this action
Ask Codex to create a shared Astro page layout, header, footer, colours, typography, and the Home page from the approved brief. Use real copy and images you have permission to publish.
Build one complete page
- Ask Codex to read docs/website-brief.md, docs/content.md, and the approved design direction before making the page.
- Have it create the shared layout, header, footer, colours, and typography, then use them on Home.
- Check that the text describes your real offer. Replace practice business details and use images you are allowed to publish.
You should now see: Home shows your approved offer and a clear way to contact you.
-
Add the first checks
Ask Codex to add an Astro code check and a browser test, then run them with the build.
Illustrated example - Ask Codex
- Check code → Test Home → Build
Look for: You have real check commands and a report showing what happened.
More help with this action
Have Codex inspect package.json, document the actual build and preview commands, and add an explicit Astro code-check command and a first Playwright browser smoke test. It must install and configure any tools those checks need.
Establish checks that really run
- Ask Codex to inspect package.json and document the build, preview, code-check, and test commands that actually exist.
- Have it install and configure the required checking tools. The first browser test should open Home and check an important visible result.
- Ask it to run the checks and build, show the actual results, and repair failures caused by this work. A successful build alone does not prove the page works.
You should now see: You have real check commands and a report showing what happened.
-
Open your preview
Open the local preview. Check Home on a wide screen and a phone-sized screen.
Illustrated example - On your computer
- Preview address → Browser → Wide and narrow screens
Look for: Home opens locally and remains readable at both sizes.
More help with this action
Use the local development, build, and preview instructions to start the website. Open the address reported by the terminal, inspect Home at desktop and phone widths, then run the code check, browser test, and production build.
Open the address Codex provides
- Ask Codex to start the local preview and give you the address reported by the running server. Click that address or copy it into your browser.
- Review the heading, navigation, images, and contact action. Narrow the browser or use the browser’s device tools to inspect a phone-sized layout.
- After the checks and build pass, also inspect the production preview. It serves the last built version, so rebuild after later changes.
You should now see: Home opens locally and remains readable at both sizes.
-
Save this milestone
Review the changed files. Ask Codex to save a Git commit after the page and checks work.
Illustrated example - Save process
- Review changes → Run checks → Commit
Look for: A named commit records your checked first page.
More help with this action
Review the changed files and save a Git commit only after the first page passes these checks. Record any deliberately unfinished pages in the task list.
Save a recoverable version
- Ask Codex to show the changed files and explain what each change does. Look for unrelated changes or accidental private information.
- Confirm that the code check, browser test, build, and your own preview review are complete. Record unfinished pages in the task list.
- Ask Codex to save the approved changes in a descriptive commit, such as “Build checked Home page”, and report its commit identifier.
You should now see: A named commit records your checked first page.
Why this step matters
Astro prepares ordinary website files from your project. Our example uses its static output: pages are generated before publication, so this first version needs neither a database nor an OpenAI API key on the website.
The installer creates the starting files. Codex should preserve the repository, instructions, skills, and brief you already prepared. A successful build is useful evidence, but does not prove that links, layout, or visitor journeys work. Begin browser checks now.
Basics, explained
Scaffold
The initial folders and files that give a new project a working starting point.
Component
A reusable piece of a page, such as the header. Updating one shared component updates every page that uses it.
Smoke test
A small automated check that catches basic breakage, such as a Home page that fails to load or loses its main heading.
Ask your agent
PromptBuild the first milestone
Read our brief, AGENTS.md, and relevant skills. Inspect this repository first. Scaffold a minimal static Astro site using the official current installer. If using a temporary scaffold, exclude its .git folder, merge README.md and .gitignore rather than overwrite them, and preserve existing Git history, AGENTS.md, .agents/, and docs/. Build only the shared foundation and Fieldnotes Studio Home page. Add a working local preview, explicit code diagnostics, and one meaningful browser smoke test. Document commands that actually exist in package.json. Run the checks and build, report their results, and give me the local address to inspect. Keep the site local. Files & commands
shOfficial Astro installer; let Codex choose the safe destination
npm create astro@latest shStandard scaffold commands; check package.json first
npm run dev
# Stop the dev server with Ctrl+C before using the same terminal again.
npx astro check
npm run build
npm run preview If something goes wrong
- The terminal reports that Node is unsupported.
- Compare node --version with the current Astro prerequisites. Install a supported LTS release using the setup instructions, restart the terminal, and retry.
- The preview address does not open.
- Check whether the terminal still shows a running server and which address it reports. Restart the dev server if it stopped; an occupied port can change the address.
Official links & further reading
Personal notes
Add questions, decisions or ideas for your website. Saved in this browser when available; export your notes to keep a copy. Never enter secrets.
Downloads & saved progressGuide, notes and personal checks
Download the complete guide or export your notes from every chapter. Instructions last reviewed: .
Checks and notes stay in this browser, separately for each language. Export your notes to preserve them. Never enter API keys or other secrets here.
NotesNotes as Markdown
Clipboard access is unavailable. Copy the visible, selected text below using your keyboard or browser menu.
0 of 65 checks marked across the guide
These are your saved personal checkmarks. They do not run tests or verify security, and are separate from the chapter position bar above.
Starter filesWorking instructions and four skills
These templates give your agent a starting set of working instructions. Review them, adapt them to your website, and save each file at the exact path shown, relative to your project folder.
A downloaded skill is an instruction file. It does not install a test runner, run a security scan, or prove your site is safe. The guide shows how to set up and check that work.
Download the instruction files in the language of this guide. Keep the technical filenames and paths as shown.
Download all starter filesFileAGENTS.md
# Website working agreements
This project follows the website brief and acceptance criteria we have agreed with its owner. Use the existing technology choices unless a concrete requirement calls for a change.
## How to work
- For a substantial feature, explain the proposed changes and verification plan before implementing it. Complete authorized local work in small, reviewable stages.
- Read the files relevant to the task. Keep unrelated pages and configuration intact.
- Explain new technical terms in plain language when reporting to the owner.
- Use the repository's website-design, clean-code, website-testing and website-security skills when their workflows apply.
- Record important decisions and unresolved content in the project's notes. Do not invent business facts, endorsements or publishing rights.
## Verification
- Inspect package.json to find the actual build, type-check and test commands. Do not invent a successful check or create a meaningless test just to make a command pass.
- Run checks appropriate to the change. Local tests use disposable fixtures and have no production access; run them and repair failures caused by the requested change without asking at every step.
- Verify visitor interactions in a browser when browser tools are available. Report checks that remain unavailable or incomplete.
- Show the owner a working local preview and summarise changed behaviour, evidence and remaining limitations.
## Credentials and publication
- Keep API keys and other secrets out of browser code, prompts, logs and Git. Store local secrets in ignored files or the chosen secret store.
- Local build and test work is authorized. Publishing the site, sending a real message, processing a payment or changing production data requires the owner's authorization for that action.
- Preserve a recoverable working version before release. Describe how to restore it.
These are starter agreements for a new tutorial project. Adapt them to the owner's actual requirements and existing authorization.
File.agents/skills/website-design/SKILL.md
---
name: website-design
description: Develop or refine a website's visual direction and responsive interface from its brief, content and existing design. Use for page design or visual implementation.
---
Read the website brief and any existing design notes relevant to the requested page. Work within the user's brand, content and technology choices.
When establishing a new direction, propose typography, a small colour palette, a spacing rhythm and a sample page. Explain how these choices support the audience and main visitor action. Use real content to judge hierarchy and line lengths.
Implement reusable elements for navigation, headings, buttons and repeated content. Give primary actions a clear visual hierarchy. Preserve visible keyboard focus, readable contrast and usable labels. Design narrow screens alongside desktop screens; check long headings, navigation and tap targets in a browser.
Use semantic HTML before adding custom interaction. Keep motion optional and respect reduced-motion preferences. Use assets with known permission to publish; record their sources. Do not invent client testimonials, achievements or business facts.
Before expanding a design across all pages, show the first complete page at desktop and mobile widths. Describe the main design decisions and any unresolved content. When a browser tool is unavailable, report that visual verification is still pending.
File.agents/skills/clean-code/SKILL.md
---
name: clean-code
description: Implement or refactor website code into understandable components using the project's existing stack and conventions. Use for website implementation or maintainability work.
---
Read the relevant files and package scripts before choosing an implementation. Preserve working behaviour outside the requested change. Prefer the existing stack and dependencies when they meet the need.
Keep page content separate from repeated layout where that makes editing easier. Name components, variables and functions for their purpose. Use shared components for repeated navigation and page elements; avoid abstraction for a single trivial use.
Handle empty, invalid, loading and error states for interactions that need them. Use native browser controls and semantic HTML when they serve the interaction. Avoid fake form submission, simulated success messages and dead links.
Use type checking and the project's formatting or lint rules where configured. When adding a package, explain its purpose and any new maintenance or runtime requirements. Keep generated build output, dependencies and local environment files out of version control.
Run the existing checks relevant to the change, including a production build when output can change. Summarise changed behaviour, verification results and remaining limits. Explain the main files in plain language so a beginner can find and edit their content.
File.agents/skills/website-testing/SKILL.md
---
name: website-testing
description: Verify website changes through visitor journeys, appropriate automated tests and browser checks. Use when testing a website, investigating a failure or preparing a release.
---
Start from the brief and observable acceptance criteria. Inspect existing test and build commands; do not assume that a script exists. Choose checks based on the changed behaviour and the cost of failure.
Exercise the main visitor journey and affected links, navigation and forms. Include invalid input and relevant error states. For a contact form, verify actual delivery in the agreed test destination before reporting that it works. For an email link, explain that it opens the visitor's configured email app and does not send a message automatically.
Check narrow and wide screens in a browser. Include keyboard navigation, visible focus, accessible names, zoom and horizontal overflow. Automated accessibility results complement these manual checks and do not establish complete accessibility conformance.
Add automated tests for important behaviour or demonstrated regressions. Test observable outcomes and meaningful failure cases; avoid tests that merely repeat the implementation or match incidental wording. Use disposable test data and local fixtures. Never send real messages, charge payments or alter production data without the user's authorization.
Reproduce a failure, fix its cause and rerun affected checks. Report commands run, results, browser checks performed and anything not checked. A successful build shows that the site can be generated; verify visitor behaviour separately. Never report a check as passed when it was skipped or unavailable.
File.agents/skills/website-security/SKILL.md
---
name: website-security
description: Review a website's secrets, dependencies, inputs, permissions and deployment configuration, and repair scoped security findings. Use for requested security review or release preparation.
---
Identify the site's relevant surfaces: static pages, forms, backend routes, authentication, third-party scripts and stored data. Scope review to the actual architecture and authorized environment.
Keep credentials out of browser code, logs, prompts and Git. Distinguish build-time public configuration from server secrets. If a key was committed or exposed, stop using it, explain that deleting the file does not revoke the key, and have the owner revoke or rotate it before further use. Do not print the credential in your report.
Inspect applicable dependency advisories and assess whether the affected package and vulnerable behaviour are used. Repair within the project's compatible versions and rerun affected checks. Avoid automatic forced upgrades that may break the website.
For backend interactions, validate inputs on the server, encode output appropriately, and check authentication and authorization separately. Consider abuse controls for public forms or AI endpoints. An OpenAI API key belongs on the server; publishing a static site does not provide a secret server environment.
Check HTTPS and applicable security headers at the actual hosting layer. Collect only the data the feature needs, and explain its destination and retention. Do not claim legal compliance from a code scan.
Report each finding with its location, plausible impact, fix and verification. State review scope, tools used, unresolved findings and inaccessible surfaces. A clean scan is evidence about that scan's scope, not a guarantee that the website has no vulnerabilities. Do not scan third-party systems or deploy changes outside the authorized task.