@next-friday/create-app 2.1.8 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/package.json +1 -1
  2. package/templates/base/.agents/agents.json +7 -0
  3. package/templates/base/.agents/hooks/agent-format-after-edit.sh +15 -0
  4. package/templates/base/.agents/hooks/agent-production-gate.sh +10 -0
  5. package/templates/base/.agents/hooks/agent-test-edit-gate.sh +25 -0
  6. package/templates/base/.agents/review.md +21 -0
  7. package/templates/base/.agents/rules/no-suppression.md +1 -1
  8. package/templates/base/.agents/skills/babysit-pr/SKILL.md +8 -0
  9. package/templates/base/.agents/skills/brand-policy/SKILL.md +12 -0
  10. package/templates/base/.agents/skills/compliance-policy/SKILL.md +12 -0
  11. package/templates/base/.agents/skills/security-policy/SKILL.md +12 -0
  12. package/templates/base/.agents/skills/ux-policy/SKILL.md +12 -0
  13. package/templates/base/.agents/skills/write-intent/SKILL.md +30 -0
  14. package/templates/base/.agents/skills/write-spec/SKILL.md +12 -0
  15. package/templates/base/.claude/managed-settings.example.json +26 -0
  16. package/templates/base/.claude/settings.json +31 -0
  17. package/templates/base/.claude/skills/babysit-pr/SKILL.md +8 -0
  18. package/templates/base/.claude/skills/brand-policy/SKILL.md +12 -0
  19. package/templates/base/.claude/skills/compliance-policy/SKILL.md +12 -0
  20. package/templates/base/.claude/skills/security-policy/SKILL.md +12 -0
  21. package/templates/base/.claude/skills/ux-policy/SKILL.md +12 -0
  22. package/templates/base/.claude/skills/write-intent/SKILL.md +30 -0
  23. package/templates/base/.claude/skills/write-spec/SKILL.md +12 -0
  24. package/templates/base/.cursor/BUGBOT.md +1 -0
  25. package/templates/base/.cursor/hooks.json +15 -0
  26. package/templates/base/.cursor/rules/no-suppression.mdc +1 -1
  27. package/templates/base/.cursor/skills/babysit-pr/SKILL.md +8 -0
  28. package/templates/base/.cursor/skills/brand-policy/SKILL.md +12 -0
  29. package/templates/base/.cursor/skills/compliance-policy/SKILL.md +12 -0
  30. package/templates/base/.cursor/skills/security-policy/SKILL.md +12 -0
  31. package/templates/base/.cursor/skills/ux-policy/SKILL.md +12 -0
  32. package/templates/base/.cursor/skills/write-intent/SKILL.md +30 -0
  33. package/templates/base/.cursor/skills/write-spec/SKILL.md +12 -0
  34. package/templates/base/.github/workflows/agent-evals.yml +128 -0
  35. package/templates/base/.github/workflows/claude.yml +39 -0
  36. package/templates/base/.github/zizmor.yml +1 -1
  37. package/templates/base/REVIEW.md +21 -0
  38. package/templates/base/SETUP.md +108 -0
  39. package/templates/base/bands.yaml +10 -0
  40. package/templates/base/evals/README.md +15 -0
  41. package/templates/base/evals/check.sh +17 -0
  42. package/templates/base/intent/README.md +8 -0
  43. package/templates/base/lessons/README.md +3 -0
  44. package/templates/base/scripts/sync-agent-rules.ts +111 -1
  45. package/templates/nestjs/.agents/agents/verifier.md +1 -0
  46. package/templates/nestjs/.claude/agents/verifier.md +7 -0
  47. package/templates/nestjs/.cursor/agents/verifier.md +7 -0
  48. package/templates/nestjs/.github/workflows/ci.yml +44 -0
  49. package/templates/nestjs/.lintstagedrc.json +2 -1
  50. package/templates/nestjs/AGENTS.md +17 -4
  51. package/templates/nestjs/README.md +1 -16
  52. package/templates/nextjs/.agents/agents/verifier.md +1 -0
  53. package/templates/nextjs/.agents/mcp.json +8 -0
  54. package/templates/nextjs/.claude/agents/verifier.md +7 -0
  55. package/templates/nextjs/.cursor/agents/verifier.md +7 -0
  56. package/templates/nextjs/.cursor/mcp.json +8 -0
  57. package/templates/nextjs/.github/workflows/ci.yml +44 -0
  58. package/templates/nextjs/.lintstagedrc.json +2 -1
  59. package/templates/nextjs/.mcp.json +8 -0
  60. package/templates/nextjs/AGENTS.md +17 -4
  61. package/templates/nextjs/README.md +1 -16
  62. package/templates/nodejs/.agents/agents/verifier.md +1 -0
  63. package/templates/nodejs/.claude/agents/verifier.md +7 -0
  64. package/templates/nodejs/.cursor/agents/verifier.md +7 -0
  65. package/templates/nodejs/.github/workflows/ci.yml +44 -0
  66. package/templates/nodejs/.lintstagedrc.json +2 -1
  67. package/templates/nodejs/AGENTS.md +17 -4
  68. package/templates/nodejs/README.md +1 -16
  69. package/templates/payload/.agents/agents/verifier.md +1 -0
  70. package/templates/payload/.agents/mcp.json +8 -0
  71. package/templates/payload/.claude/agents/verifier.md +7 -0
  72. package/templates/payload/.cursor/agents/verifier.md +7 -0
  73. package/templates/payload/.cursor/mcp.json +8 -0
  74. package/templates/payload/.github/workflows/ci.yml +44 -0
  75. package/templates/payload/.lintstagedrc.json +2 -1
  76. package/templates/payload/.mcp.json +8 -0
  77. package/templates/payload/AGENTS.md +17 -4
  78. package/templates/payload/README.md +1 -16
  79. package/templates/turborepo/.agents/agents/verifier.md +1 -0
  80. package/templates/turborepo/.agents/mcp.json +8 -0
  81. package/templates/turborepo/.claude/agents/verifier.md +7 -0
  82. package/templates/turborepo/.cursor/agents/verifier.md +7 -0
  83. package/templates/turborepo/.cursor/mcp.json +8 -0
  84. package/templates/turborepo/.github/workflows/ci.yml +44 -0
  85. package/templates/turborepo/.mcp.json +8 -0
  86. package/templates/turborepo/AGENTS.md +17 -4
  87. package/templates/turborepo/README.md +1 -16
@@ -17,21 +17,34 @@ Turborepo workspace in TypeScript on pnpm and Node.js `>=24.22.1 <25`. `apps/app
17
17
  | Every check | `pnpm verify` |
18
18
  | Render rules after a change | `pnpm rules:sync` |
19
19
 
20
- ## How it fits together
20
+ ## Verifying your work
21
+
22
+ - Build: `pnpm build` (prints `Tasks: 2 successful, 2 total`)
23
+ - Test: `pnpm test:coverage` (all green, and prints `Tasks: 2 successful, 2 total`; never skip or delete a failing test)
24
+ - Lint: `pnpm verify:static` (ESLint allows zero warnings; the dependency check prints `Tasks: 2 successful, 2 total`)
25
+
26
+ Run all three before reporting any task complete, and paste the output. `pnpm verify` runs all three.
27
+ If a test fails, fix the code, not the test.
28
+
29
+ ## Architecture
21
30
 
22
31
  - Root scripts run lint, format, Knip, and the agent checks once for the workspace, and hand `build`, `test`, `typecheck`, and `depcruise` to Turborepo for each app. `TURBO_FILTER` narrows them; the default is every app.
23
32
  - The site lives in `apps/app/app/`. The backoffice site lives in `apps/backoffice/src/app/(frontend)/`, its collections in `apps/backoffice/src/collections/`, and its config in `apps/backoffice/src/payload.config.ts`. The root `generate:*` and `migrate*` scripts run in the backoffice.
24
33
  - In development, Payload applies collection changes to the database directly. In production, the backoffice applies the migrations in `apps/backoffice/src/migrations/` when it starts.
25
34
 
26
- ## Mandatory rules
35
+ ## Conventions
27
36
 
28
- 1. **Follow `.agents/rules/`.** `.agents/rules.json` gives each rule's scope; Claude Code and Cursor load them. After changing either, run `pnpm rules:sync`; `pnpm check` fails on stale copies.
37
+ 1. **Follow `.agents/rules/`.** `.agents/rules.json` gives each rule's scope; Claude Code and Cursor load them. After changing either, or a skill or subagent in `.agents/skills/` or `.agents/agents/`, run `pnpm rules:sync`; `pnpm check` fails on stale copies.
29
38
  2. **Change the backoffice schema only through collections, then regenerate and commit.** Payload generates `apps/backoffice/src/app/(payload)/`, `apps/backoffice/src/payload-types.ts`, and `apps/backoffice/src/migrations/`; run `pnpm generate:types`, `pnpm generate:importmap`, and `pnpm migrate:create <name>`. Do not edit those files by hand.
30
39
  3. **Put unit tests next to the code and Playwright end-to-end tests in `apps/app/test/` and `apps/backoffice/test/` as `*.e2e.test.ts`.** Vitest collects `apps/app/app/**/*.test.{ts,tsx}` and `apps/backoffice/src/**/*.test.{ts,tsx}`.
31
40
  4. **Ask the user before adding component tests.** They need a DOM test environment, and Vitest runs in Node.js.
32
41
  5. **Read backoffice configuration through `requireEnvironment` in `apps/backoffice/src/environment.ts`.** Document each variable in `.env.example`.
42
+ 6. **Start from the accepted spec, in plan mode.** Claude Code starts every session in plan mode (`.claude/settings.json`); in Cursor, switch to Plan Mode before the first edit. Give the plan the change's `intent/<change>/intent.md` and `spec.md`, and have it name the files that change, the order of the work, and the tests that prove it. Commit the approved plan as `intent/<change>/plan.md`. When implementation departs from the plan, update `plan.md` in the same commit.
43
+ 7. **Start a bug fix with a failing test.** Reproduce the bug as a test, run it, and confirm it fails for the reason you expect. Commit that test. Then create `.git/bug-fix-in-progress`, so `.agents/hooks/agent-test-edit-gate.sh` blocks test edits, and make the test pass without editing it. Delete `.git/bug-fix-in-progress` when the fix is done.
44
+
45
+ ## Things Claude gets wrong
33
46
 
34
- ## Known pitfalls
47
+ When Claude makes a mistake twice, add the correction here.
35
48
 
36
49
  - **Next.js docs live per app**: this Next.js version differs from your training data. Read the guide in `apps/app/node_modules/next/dist/docs/` or `apps/backoffice/node_modules/next/dist/docs/` before writing Next.js code; the workspace root has no `next` package.
37
50
  - **Database for `pnpm dev` and end-to-end tests**: the backoffice needs a PostgreSQL database in `DATABASE_URL` and `PAYLOAD_SECRET` in `.env`; the README lists every variable. Run `pnpm --filter ./apps/app exec playwright install chromium` once before the first `pnpm test:e2e`.
@@ -24,22 +24,7 @@ In development, Payload applies collection changes to the database directly. In
24
24
 
25
25
  ## After creating a project from this template
26
26
 
27
- 1. Install gitleaks and jq (see [CONTRIBUTING.md](CONTRIBUTING.md)). Make the first commit on `main` and push it. The Git hooks allow only this first commit and push on `main`; work on branches after that.
28
-
29
- ```sh
30
- git add --all
31
- git commit -m "chore(repo): start from template"
32
- git push --set-upstream origin main
33
- ```
34
-
35
- 2. Add your team as the owner of every file in `.github/CODEOWNERS`, and replace the owner placeholder in `.github/zizmor.yml`.
36
- 3. Replace the template's description and owner: `package.json#description`, `repository.url`, and `author`, and the `Next Friday Next.js template` text in `apps/app/app/layout.tsx`, `apps/app/app/page.tsx`, and their tests, and the `Next Friday Payload template` text in `apps/backoffice/src/app/(frontend)/layout.tsx`, `apps/backoffice/src/app/(frontend)/page.tsx`, and their tests. Change `license` from `UNLICENSED` if the project is open source.
37
- 4. In the repository settings:
38
- - **Actions → General → Workflow permissions:** select **Read repository contents and packages permissions**. Every workflow requests the extra permissions it needs.
39
- - **Advanced Security:** enable private vulnerability reporting, Dependabot alerts, Dependabot security updates, secret scanning, and push protection. `SECURITY.md` sends reporters to private vulnerability reporting.
40
- - **Cursor Bugbot:** enable the repository at [Bugbot](https://cursor.com/automations/from-cursor/bugbot). Bugbot reviews pull requests against the rules linked from `.cursor/BUGBOT.md`.
41
- - **Rules → Rulesets:** protect `main` with squash merges only, a linear history, no force pushes or deletion, and the required checks `All Checks` and `Validate pull request title`. Rulesets in a private repository need GitHub Pro, Team, or Enterprise; on GitHub Free, make the repository public or upgrade.
42
- - Create the `needs triage` label, which the issue forms apply: `gh label create "needs triage"`.
27
+ Follow [SETUP.md](SETUP.md) in order. It sets up the repository, the reviews, and the AI-native SDLC. In step 1, also replace the `Next Friday Next.js template` text in `apps/app/app/layout.tsx`, `apps/app/app/page.tsx`, and their tests, and the `Next Friday Payload template` text in `apps/backoffice/src/app/(frontend)/layout.tsx`, `apps/backoffice/src/app/(frontend)/page.tsx`, and their tests.
43
28
 
44
29
  ## Scripts
45
30