Practical AI advice for teams and leaders

Beginner Steps. Advanced AI.

Published guideUpdated

Chapter 6 of 20Set up

Chapter menu20 chapters

Give Codex your working rules

Save a short instruction file so Codex knows how to work on your website.

Kooka, a friendly kookaburra teacher wearing glasses and holding a blue notebook.

Let's write down how Codex should work on this project.

Follow the pictures

Illustrated examples. Your app may look different. Tap an image to enlarge it.

  1. Save the starter rules

    Download AGENTS.md. Save it inside fieldnotes-studio, beside README.md.

    Illustration: save AGENTS.md next to README.md at the top level of fieldnotes-studio.
    Illustrated example
    Save to
    fieldnotes-studio → AGENTS.md beside README.md

    Look for: AGENTS.md appears beside README.md in the project folder.

    More help with this action

    Codex reads AGENTS.md when starting work. Use it to record project context, review expectations, and checks. Keep agreements readable and specific. AGENTS.md supplies standing expectations; skills supply focused workflows. Neither replaces permissions or proves correctness. You still inspect the results and decide when to publish.

    Show the steps
    1. Download the starter AGENTS.md file. Place it beside README.md in fieldnotes-studio, rather than inside docs.
    2. The project root means the top-level fieldnotes-studio folder.
    3. Keep this file out of website-workshop and out of a nested docs folder.
    4. If your browser adds a suffix to a duplicate download, keep one clearly named AGENTS.md.

    You should now see: AGENTS.md appears beside README.md in the project folder.

  2. Check the filename

    Open AGENTS.md as plain text. Check its exact name and location; it must not end in .txt.

    Illustration: use the exact AGENTS.md filename and avoid an extra .txt extension.
    Illustrated example
    Check
    AGENTS.md: capitals, .md, no extra .txt

    Look for: The instruction file is plain text and named exactly AGENTS.md.

    More help with this action

    Follow these steps if you want more help.

    Show the steps
    1. Open the file as plain text. Check the official AGENTS.md naming and placement rules: the filename must be AGENTS.md, with capital letters and no .txt extension.
    2. Open it with a plain-text editor or Codex's file viewer.
    3. Confirm the full filename, including its extension. Some editors add .txt without making it obvious.
    4. Other global or nested guidance may also apply; later ask Codex to list what it loaded.

    You should now see: The instruction file is plain text and named exactly AGENTS.md.

  3. Make the rules fit your site

    Read the rules and adapt them to your website brief: static Astro, npm, small changes, and protected secrets.

    Illustration: adapt AGENTS.md to your website brief and agreed way of working.
    Illustrated example
    Read and adapt
    AGENTS.md → Your website requirements

    Look for: The rules describe how you want Codex to work on this website.

    More help with this action

    Follow these steps if you want more help.

    Show the steps
    1. Read every agreement and adapt it to your website brief: static Astro, npm, small changes, protected secrets, and understandable code.
    2. The starter contains general agreements, not your business details. Add short context for Fieldnotes Studio and its four pages.
    3. Keep rules you understand, and adjust wording that does not fit your project.
    4. After chapter 8, compare this file with your full brief and update any mismatched decisions.

    You should now see: The rules describe how you want Codex to work on this website.

  4. Use real check commands

    Ask Codex to check which project commands exist. Before setup, website tests and package.json may not exist yet.

    Illustration: distinguish available package.json scripts from checks that still need to be created.
    Illustrated example
    Ask Codex
    Find package.json → List existing scripts → Name missing checks

    Look for: You can tell existing checks from ones that still need to be set up.

    More help with this action

    Follow these steps if you want more help.

    Show the steps
    1. Before scaffolding, website checks do not exist. After setup, use scripts actually defined in package.json; an instruction to run tests does not create them.
    2. It is normal for this new repository to have no package.json before the Astro setup chapter.
    3. Ask Codex to inspect actual build, type-check and test scripts if the file exists.
    4. Record missing checks as setup work. Never accept a claimed pass for a nonexistent command; update the rules after real scripts are created.

    You should now see: You can tell existing checks from ones that still need to be set up.

  5. Keep review and spending rules

    Keep the starter review and publication rules: show a local preview, explain results, and ask before publishing or new spending.

    Illustration: review a local preview and require authorization before publishing or adding costs.
    Illustrated example
    Rules
    Local preview → Your review → Publication authorization

    Look for: Your agreements cover review, credentials, spending and publication.

    More help with this action

    Follow these steps if you want more help.

    Show the steps
    1. Retain the Starter kit working agreements requiring a reviewable preview and your approval before deployment or new spending.
    2. Keep the requirement to show a working preview, explain changed behaviour, and report validation evidence and limitations.
    3. Publishing, sending real messages or changing production data requires authorization for that action.
    4. Add your spending preference for new services. Adapt the wording to authorization already given; these rules do not replace permission controls.

    You should now see: Your agreements cover review, credentials, spending and publication.

  6. Confirm and save your rules

    In a new Codex chat, send the agreement-check prompt. Review and save AGENTS.md using the commit commands.

    Illustration: confirm the working rules in a fresh chat, then stage, review and commit them.
    Illustrated example
    In Codex
    New chat → Copy agreement prompt → Send
    Save
    git add → Review staged diff → Commit AGENTS.md

    Look for: Codex summarises the actual agreements and Git records the reviewed instruction file.

    More help with this action

    Follow these steps if you want more help.

    Show the steps
    1. Start a fresh project chat and use the working-agreements confirmation prompt. Compare its response with AGENTS.md, then stage, review, and commit using the instruction-file commands.
    2. Compare the fresh chat's response with the actual rules, including existing versus missing checks.
    3. For a newly created file, run git add AGENTS.md before git diff --cached -- AGENTS.md; ordinary git diff does not show untracked content.
    4. Read the staged diff before committing. Saving these rules is not a request to start building.

    You should now see: Codex summarises the actual agreements and Git records the reviewed instruction file.

Why this step matters

AGENTS.md is a plain-text instruction file Codex reads when work starts. It records the project’s expectations and checks.

Instructions guide the agent; they do not create tests or replace permissions. You still review results and decide when to publish.

Basics, explained

AGENTS.md

A Markdown file containing persistent instructions and project context for the coding agent.

Project root

The top-level project folder; here it is fieldnotes-studio, containing README.md and the Git history.

Markdown

A plain-text format that uses simple markers for headings and lists. A .md file is readable without special software.

Ask your agent

PromptConfirm working agreements

Copy into Codex, then adapt it to your project.

List the loaded instruction files and summarise AGENTS.md, including secrets, small changes, validation, spending, and deployment. Distinguish scripts that exist from checks still to establish. Do not start building yet.

Files & commands

shellStage, review, then save the instruction file

Read this step before using the example.

git add AGENTS.md
git diff --cached -- AGENTS.md
git commit -m "Add website working agreements"
Check your work

Tick each item after you confirm it yourself. You can untick it at any time.

If something goes wrong
Codex misses your new instructions.
Check folder and filename, then start a fresh chat. Ask it to list loaded sources; global or nested instructions may apply.
An instruction demands a nonexistent command.
Use the actual package.json script or mark the check as something to establish during setup. Keep failures visible.
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: .

Download guide .md Go to starter files

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.

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 files .md bundle
FileAGENTS.md

Save at the path above.

Download file
# 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

Save at the path above.

Download file
---
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

Save at the path above.

Download file
---
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

Save at the path above.

Download file
---
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

Save at the path above.

Download file
---
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.
Back to the chapter start