diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0852ec9..ca3ff06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,8 @@ jobs: - run: npm ci + - run: npm run format:check + # The build's `prebuild` step fetches a data snapshot from PokéAPI. # Cache it so only the first run (or a change to the script) pays that # cost; CI only needs *a* snapshot to prove the build compiles. diff --git a/AGENTS.md b/AGENTS.md index e4caf2b..a369da0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,9 +21,10 @@ npm run preview # serve the production build — REQUIRED to test the se ``` - Node **20+**. -- There is **no lint or test command** and **no test suite**. The build - (`npm run build`) is the only automated check — it must pass. It runs - esbuild over every module, so it catches syntax and import errors. +- Automated checks (both run in CI, both must pass): + `npm run format:check` (Prettier) and `npm run build` (esbuild transforms + every module, so it catches syntax and import errors). Run `npm run format` + before finishing. There is **no test suite** and no ESLint. - `npm run snapshot -- --force` rebuilds the snapshot even if it's fresh. ## Project structure @@ -60,8 +61,8 @@ npm run preview # serve the production build — REQUIRED to test the se caught set. - Respect `prefersReducedMotion()` (from `src/store/settings.js`) for any animation. -- 2-space indent, semicolons, single quotes, trailing commas in multi-line - literals. Match the surrounding file; keep comments about _why_. +- Formatting is Prettier (`npm run format`). Otherwise match the + surrounding file; keep comments about _why_. - No new runtime dependencies. Prefer adding to the snapshot over a new runtime fetch. @@ -90,7 +91,8 @@ npm run preview # serve the production build — REQUIRED to test the se ## Verifying a change -`npm run build` must pass. Then sanity-check by hand: the dex grid +`npm run format` then `npm run build` — both must pass. Then sanity-check +by hand: the dex grid (filters, sort, catching from a card), switching games (numbers + typings update), a detail page (all tabs, form switch), and `npm run preview` offline (DevTools → Network → Offline → reload). Check light and dark diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e08de2..e9bbf42 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,11 +54,13 @@ See the **Project layout** and **How it works** sections in ## Code style -There's no linter or formatter config yet — **match the surrounding -code**: +Formatting is **Prettier** (`.prettierrc.json`). Run `npm run format` +before committing; CI runs `npm run format:check` and will fail on +unformatted code. There's no ESLint — for everything Prettier doesn't +decide, **match the surrounding code**: -- 2-space indent, semicolons, single quotes, trailing commas in - multi-line literals (an `.editorconfig` covers whitespace). +- 2-space indent, semicolons, single quotes, 100-col width, trailing + commas (all handled by Prettier). - Build DOM with the `el()` helper from `src/lib/dom.js`, not template strings or `innerHTML` (except the deliberate `html:` prop for trusted inline SVG). @@ -110,6 +112,10 @@ Describe what you tested in the PR. - Fill in the PR template. Screenshots or a short clip for anything visual. - It's fine to open a draft PR early to discuss direction. +- AI-assisted contributions are welcome — say so in the PR description if a + tool wrote a meaningful part of it, and review it yourself first. The + same bar applies either way. This project is itself built this way (see + the README). ## Reporting bugs diff --git a/README.md b/README.md index 5673162..9d80d39 100644 --- a/README.md +++ b/README.md @@ -275,6 +275,21 @@ coordinates), no automated test suite yet, and no formal Lighthouse pass. --- +## Built with AI assistance + +Pocketdex is developed with heavy use of AI coding tools — primarily +Anthropic's Claude, via Claude Code. Direction, design decisions, review +and testing are human-led; a large share of the implementation is +AI-generated and then reviewed before it lands. You'll see this in the git +history (`Co-Authored-By: Claude …` trailers). + +This doesn't change anything for contributors: use whatever tools you like, +disclose AI-generated PRs in the description, and expect the same review +either way. There's an [AGENTS.md](AGENTS.md) so agents have the house +rules too. + +--- + ## Legal Pocketdex is an unofficial, non-commercial fan project. It is **not