You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a file-length lefthook pre-commit that blocks staged .ts/.tsx
over 300 lines under app/, components/, or lib/. scripts/ is exempt
(seed data lists).
Sync AGENTS.md, README.md, and CONTRIBUTING.md with the 4-job hook,
the 155-repo seed count, the new components in the Layout tree, and
the file-length convention.
Normalize 'Codex' -> 'GPT-5 Codex' in AGENTS.md line 3 and the 0.1.0
changelog bullet to match the UI, which has always used the full name.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@@ -120,6 +121,7 @@ Keep it that way when adding features. If a component needs data, fetch in the p
120
121
-**Brand on UI**: "Agent Friendly Code" (no hyphen). Repo/package slug + GitHub `User-Agent` string: `agent-friendly-code`.
121
122
-**Version**: `APP_VERSION` in `lib/version.ts` and `package.json`'s `version` carry the current release number. Bump both (and add a new bucket in `lib/changelog.ts`) only when cutting a release — never when merging intermediate work.
122
123
-**Versioning + changelog**: bumps on `lib/version.ts` + `package.json``version` happen only on a real release, coordinated with a new bucket in `lib/changelog.ts`. The changelog is a **user-facing capability log** — every bullet describes something a dashboard visitor or API caller can see, click, or call. Codebase hygiene (CI, linters, pre-commit, tests), pure internal refactors, dep bumps, and contributor-facing docs (CONTRIBUTING, PR templates) do **not** earn a changelog line — they stay in `tasks/` and the PR description. When a roadmap item ships, remove it from `lib/roadmap.ts` in the same PR — moved, not duplicated.
124
+
-**File length**: `.ts` / `.tsx` under `app/`, `components/`, `lib/` stay ≤ 300 lines — enforced by the `file-length` pre-commit job in `lefthook.yml`. Near the cap, split into subcomponents or extract helpers to `lib/utils/`. `scripts/` is exempt (seed data lists).
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,8 @@ Read [AGENTS.md](./AGENTS.md) first — it's the source of truth for stack, conv
8
8
9
9
```bash
10
10
bun install
11
-
bun run prepare-hooks # once — installs lefthook pre-commit (Biome + tsc + test)
12
-
bun run seed # optional: populate the DB with the curated set (124 public repos)
11
+
bun run prepare-hooks # once — installs lefthook pre-commit (Biome + tsc + test + file-length)
12
+
bun run seed # optional: populate the DB with the curated set (155 public repos)
13
13
bun run dev # http://localhost:3000
14
14
bun run test# unit tests (node --test + tsx) — requires Node ≥20.9.0
15
15
```
@@ -41,11 +41,12 @@ Don't squash-amend published commits. Don't skip hooks (`--no-verify`); if a hoo
41
41
42
42
## Pre-commit hook
43
43
44
-
`lefthook` runs three jobs on every commit:
44
+
`lefthook` runs four jobs on every commit:
45
45
46
46
1.**Biome** — `check --write` on staged JS/TS/JSON/CSS. Fixes and re-stages.
47
47
2.**tsc** — `--noEmit` on `*.{ts,tsx}`. Blocks commits that don't typecheck.
48
48
3.**test** — `bun run test` when any `*.{ts,tsx}` file is staged. Runs the full `node --test` suite (~1–2 s); blocks on regressions.
49
+
4.**file-length** — blocks staged `.ts`/`.tsx` under `app/`, `components/`, `lib/` that exceed 300 lines. Split into subcomponents or pull helpers into `lib/utils/`. `scripts/` is exempt.
49
50
50
51
Run `bun run prepare-hooks` once after cloning. CI (`.github/workflows/`) runs the same checks on PR for belt-and-braces.
0 commit comments