CI: gate on Prettier; docs: disclose AI assistance

- ci.yml runs `npm run format:check` before the build.
- CONTRIBUTING / AGENTS: point at `npm run format` instead of the old
  "no formatter" note.
- README: new "Built with AI assistance" section — the project is
  developed with Claude / Claude Code, human-directed and reviewed;
  visible in the Co-Authored-By trailers. CONTRIBUTING asks contributors
  to disclose AI-assisted PRs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Ve7HLspzeG2xDPtJQ8vmu
This commit is contained in:
chris 2026-09-10 11:26:16 -04:00
parent 671e72972a
commit 39bffcab32
4 changed files with 35 additions and 10 deletions

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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