# Editing this template with an AI assistant

This template is designed so an AI coding assistant — Claude Code, Cursor, GitHub Copilot, or similar — can safely customise it for you even if you don't write code yourself. Almost everything you'd want to change lives in JSON files under `content/`, not in the React components, so an assistant can make accurate, narrow edits without touching layout code.

## How to work with an assistant on this repo

- Ask for one change at a time. "Update my name and email" is a good request. "Redesign the whole site" is not — you won't be able to tell what changed or whether it worked.
- After each change, run `npm run dev` and actually look at [http://localhost:3000](http://localhost:3000). Don't trust a description of what changed — look at the page.
- Once something works, commit it before asking for the next change. Small commits mean you can undo a bad edit without losing a good one.
- If your assistant proposes editing a file under `content/`, `content.example/`, `public/work/`, `placeholders/`, or `_source/` and it doesn't exist yet, that's expected — the seed script creates most of these automatically. Run `npm run seed` if you're unsure.

## Rules to give your assistant

Paste this at the start of a session so it doesn't have to rediscover the project's shape:

```
This is a Next.js static-export portfolio template. Rules for working in this repo:

1. All site copy and project data lives in JSON under content/ (site.json,
   projects.json, images.json). Never hardcode text into a .tsx file in
   app/ or components/ — edit the JSON instead.
2. content/ and public/work/ are gitignored on purpose. Don't "fix" this by
   removing them from .gitignore, and don't move real content into
   content.example/ or placeholders/ (those are the public example/demo
   files, not mine).
3. The schema for every content file is defined in lib/types.ts. Check it
   before adding or renaming a field.
4. content/images.json is generated by scripts/optimize-images.mjs (or
   edited by hand for one-off images). Every image's "key" must match a
   plate's "key" in content/projects.json for captions to show up.
5. Before committing any change, run `npm run build` and confirm it
   completes with no errors.
```

## Copy-paste prompts

Each of these names the exact file to edit — that's what makes an assistant reliable here. Run `npm run dev` after each one and check the browser before moving to the next.

**Change my name, email, and socials**
```
Edit content/site.json. Set "name" to "<Your Name>", "email" to
"<you@example.com>", "role" to "<your title>", and "location" to
"<City, Country>" (or "" to hide it). Under "social", fill in only the
handles I actually use (instagram, behance, linkedin, dribbble, phone) and
leave the rest as empty strings.
```
Updates the name, email, role, and location shown in the header, footer, and hero, and shows or hides each social link based on whether it's filled in.

**Replace all the demo projects with my own**
```
content/projects.json is an array of project objects — the schema is in
lib/types.ts. Replace its contents with one entry per real project of
mine. I'll give you the title, tagline, summary, and colour palette for
each; use an empty array for any field I don't give you a value for
(keywords, typography, plates, sections, steps, facts).
```
Swaps the whole project list. Pair this with the image-swapping prompt below, or the site will show broken plates for slugs that have no matching images.

**Add one new project**
```
Add a new project to the array in content/projects.json, following the
same shape as the existing entries (see lib/types.ts for the full
schema). slug: "<my-slug>", title: "<Title>", displayTitle: "<STYLED
TITLE>", kind: "moodboard" or "campaign", discipline: "<e.g. Brand
Identity>", tagline: "<one line>", summary: "<one paragraph>". Leave
palette, typography, plates, sections, steps, and facts as empty arrays
for now — I'll fill those in once I've added the images.
```
Creates a new project entry with no images yet — safe to run before you have artwork ready, since empty arrays make every optional section on the project page disappear rather than render broken.

**Add my own images to a project**
```
I have new source images for the "<slug>" project. Put them in _source/
named <PREFIX>_01_Description.png, <PREFIX>_02_Description.png, etc.,
inside a subfolder starting with 01_ for mood plates, 02_ for application
mock-ups or 04_ for cover artwork. The project slug is derived from
<PREFIX> automatically, so no script edit is needed unless the derived
slug differs from "<slug>" — in that case add one entry to PREFIX_ALIASES
in scripts/optimize-images.mjs. Then run `npm run images` and show me what
content/images.json now contains for that slug.
```
Wires a project's images through the real pipeline (resized WebP + manifest). The slug comes from the filename, so adding a new project normally needs no code change at all.

**Caption the plates I just added**
```
Look at content/images.json for the "<slug>" project's "mood" array and
list the "key" values. For each one, add a matching object to that
project's "plates" array in content/projects.json with a short "title"
and one-sentence "caption".
```
Fills in the wall captions for whichever images you just ran through `npm run images` — keeps `key` values in sync so nothing silently fails to caption.

**Change the colour scheme**
```
Edit the --color-* custom properties in the @theme block at the top of
app/globals.css (currently --color-ink, --color-ink-2, --color-ink-3,
--color-line, --color-line-2, --color-bone, --color-bone-2,
--color-bone-3). Keep the same near-black / warm-off-white relationship
unless I say otherwise — the site's own chrome is meant to stay neutral
so project artwork supplies the colour.
```
Changes the site's own background/text/border colours (not a project's palette, which is separate content).

**Change the fonts**
```
In lib/fonts.ts, replace the Google Font used for `syne` (currently Syne,
the display face) with <new font name>, and/or the one used for `archivo`
(currently Archivo, the body face) with <new font name>. Keep the
variable names ("--font-syne", "--font-archivo") unchanged so
app/globals.css doesn't need editing.
```
Swaps the site's typefaces without touching any layout code.

**Reorder my projects**
```
Reorder the objects in the content/projects.json array into this order:
<list slugs in the order you want>. Don't change any project's field
values, just their position in the array.
```
The homepage grid and each project's "next project" link both follow this array's order directly.

**Remove a whole section (e.g. Services)**
```
Edit content/site.json and set "services" to an empty array: [].
```
The Services section on the home page only renders when that array is non-empty — this removes it with no code change. (The Work and About sections aren't optional the same way; ask your assistant before removing those, since it would mean editing app/page.tsx.)

**Add a new section to the home page**
```
I want a new section on the home page between <existing section> and
<existing section>, showing <describe the content>. Look at how the
Services section in app/page.tsx reads from site.services to decide
whether to render, and follow the same pattern: add a new field to the
Site type in lib/types.ts, read it in app/page.tsx, and only render the
section when the field is non-empty.
```
This is the one customisation that legitimately needs a small code change alongside a content change — worth doing deliberately rather than hardcoding new copy directly into the component.

**Make the hero say something different**
```
Edit content/site.json and change "tagline" to "<your new one-line
tagline>". If you want the big name treatment on the hero to say
something other than my name, that's the "name" field, split into words
on the page automatically.
```
The hero headline is your `name`, and the line beneath it is your `tagline` — both plain content edits.

**Change the SEO title and description**
```
Edit content/site.json → "seo". Set "siteName" to "<Your Name> —
<Your Role>", "description" to a one- or two-sentence summary of what I
do (used for search results and social link previews), and "url" to my
real deployed domain, e.g. "https://example.com" (no trailing slash).
```
Feeds the `<title>`, meta description, Open Graph tags, `/robots.txt`, and `/sitemap.xml` — `seo.url` in particular needs to be your real domain or the sitemap will contain the wrong URLs.

**Set up deployment**
```
Walk me through deploying this to <Netlify or Cloudflare Pages>, using
the steps in this repo's README under "Deploying". Before we start,
run `npm run build` and confirm it finishes with no errors, then run
`npm run preview` and check the site at the printed local URL.
```
See "Publishing" below for the full flow.

## Publishing

1. Ask your assistant to run `npm run build` and read the output. A successful build ends by writing files into `out/`; any TypeScript or content error will stop the build with a message pointing at the offending file.
2. Run `npm run preview` and open the printed local address — this serves the actual `out/` folder, so it's the closest thing to what a host will show visitors.
3. Commit your changes (your assistant can do this: `git add`, `git commit`). Remember `content/` and `public/work/` won't be part of the commit — that's expected.
4. Push to your own GitHub repository.
5. Follow the README's **Deploying** section for Netlify or Cloudflare Pages — both just need the build command `npm run build` and output directory `out` pointed at your GitHub repo.
6. After the host finishes its first deploy, open the live URL and click through every project once. A host-side build failure usually mirrors whatever `npm run build` would have told you locally, so if step 1 passed, the host build should too.

## Troubleshooting

| Symptom | Likely cause | Fix |
| --- | --- | --- |
| An image doesn't show, or shows a plain colour block forever | The file isn't in `public/work/<slug>/`, or its `key` in `content/images.json` doesn't match the `key` in that project's `plates` array | Confirm the file exists at the exact path in `src`; confirm the `key` strings match exactly (case-sensitive) between `content/images.json` and `content/projects.json` |
| `npm run build` (or `npm run dev`) fails complaining content is missing | `content/site.json`, `content/projects.json`, or `content/images.json` isn't present, or isn't valid JSON | Run `npm run seed` to restore any missing file from `content.example/`; if a file exists but is invalid, check it with a JSON validator — a trailing comma is the usual culprit |
| Fonts don't look right, or fall back to a system font | The family name in `lib/fonts.ts` or a project's `typography.family` doesn't match a name the template actually bundles | For the site's own fonts, check `lib/fonts.ts`; for a project specimen, `family` must be one of `Montserrat`, `Cormorant Garamond`, `Playfair Display`, `Cinzel` or it silently falls back to the display face |
| I edited a JSON file but the site still shows the old content | The dev server is reading a stale copy, or you edited `content.example/` instead of `content/` | Stop and restart `npm run dev`; double-check you edited the file under `content/`, not `content.example/` |
| A project page 404s | The URL's slug doesn't match any `slug` field in `content/projects.json` | `/work/<slug>/` must exactly match a project's `"slug"` value — check for typos or case mismatches |
