@next-friday/create-app 9.1.0 → 9.2.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.
- package/README.md +5 -4
- package/dist/main.mjs +135 -96
- package/package.json +8 -6
- package/templates/base/.agents/hooks/agent-mcp-gate.sh +7 -2
- package/templates/base/.agents/hooks/agent-production-gate.sh +6 -1
- package/templates/base/.agents/hooks/agent-shell-gate.sh +1 -181
- package/templates/base/.agents/hooks/agent-test-edit-gate.sh +12 -3
- package/templates/base/.agents/review.md +2 -2
- package/templates/base/.agents/rules/no-suppression.md +1 -1
- package/templates/base/.agents/skill-evals/README.md +42 -0
- package/templates/base/.agents/skill-evals/sdlc/answers-question-without-writing/case.yaml +12 -0
- package/templates/base/.agents/skill-evals/sdlc/answers-question-without-writing/graders/01-the-reply-explains-why-pnpm.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/answers-question-without-writing/graders/02-no-file-in-the-project.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/answers-question-without-writing/graders/03-no-commit-is-made-nothing.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/answers-question-without-writing/graders/04-the-reply-is-in-the.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/answers-question-without-writing/graders/05-every-path-in-the-reply.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/answers-question-without-writing/graders/06-everything-the-reply-states-as.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/answers-question-without-writing/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/build-continues-from-an-accepted-plan/case.yaml +12 -0
- package/templates/base/.agents/skill-evals/sdlc/build-continues-from-an-accepted-plan/fixture.md +1 -0
- package/templates/base/.agents/skill-evals/sdlc/build-continues-from-an-accepted-plan/graders/01-work-happens-on-the-plan-branch.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-continues-from-an-accepted-plan/graders/02-the-plan-is-implemented-and-checked.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-continues-from-an-accepted-plan/graders/03-the-branch-is-pushed.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-continues-from-an-accepted-plan/graders/04-the-reply-lists-three-playbooks.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-continues-from-an-accepted-plan/graders/05-no-approval-and-no-merge.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-continues-from-an-accepted-plan/graders/06-the-reply-ends-at-the-code-owner.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-continues-from-an-accepted-plan/graders/07-the-plan-names-the-engineer.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-continues-from-an-accepted-plan/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/build-interviews-before-planning/case.yaml +71 -0
- package/templates/base/.agents/skill-evals/sdlc/build-interviews-before-planning/fixture.md +1 -0
- package/templates/base/.agents/skill-evals/sdlc/build-interviews-before-planning/graders/01-the-reply-asks-numbered-questions.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-interviews-before-planning/graders/02-no-plan-before-the-answers.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-interviews-before-planning/graders/03-no-question-depends-on-another.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-interviews-before-planning/graders/04-no-file-or-commit.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-interviews-before-planning/graders/05-the-reply-is-in-thai.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-interviews-before-planning/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/build-plans-and-waits-for-the-engineer/case.yaml +68 -0
- package/templates/base/.agents/skill-evals/sdlc/build-plans-and-waits-for-the-engineer/fixture.md +1 -0
- package/templates/base/.agents/skill-evals/sdlc/build-plans-and-waits-for-the-engineer/graders/01-the-plan-has-the-four-headings.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-plans-and-waits-for-the-engineer/graders/02-no-source-file-or-commit.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-plans-and-waits-for-the-engineer/graders/03-the-reply-names-the-gate.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-plans-and-waits-for-the-engineer/graders/04-the-reply-is-in-thai.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/build-plans-and-waits-for-the-engineer/prompt.md +10 -0
- package/templates/base/.agents/skill-evals/sdlc/deploy-stops-at-the-production-gate/case.yaml +8 -0
- package/templates/base/.agents/skill-evals/sdlc/deploy-stops-at-the-production-gate/fixture.md +1 -0
- package/templates/base/.agents/skill-evals/sdlc/deploy-stops-at-the-production-gate/graders/01-no-deployment-is-started.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/deploy-stops-at-the-production-gate/graders/02-the-reply-names-the-release-manager-gate.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/deploy-stops-at-the-production-gate/graders/03-the-reply-says-what-it-could-not-read.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/deploy-stops-at-the-production-gate/graders/04-the-reply-is-in-the-language.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/deploy-stops-at-the-production-gate/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/drafts-intent-and-waits-for-yes/case.yaml +13 -0
- package/templates/base/.agents/skill-evals/sdlc/drafts-intent-and-waits-for-yes/graders/01-a-file-intentkebabcasenameintentmd-exists-with.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/drafts-intent-and-waits-for-yes/graders/02-the-reply-shows-the-draft.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/drafts-intent-and-waits-for-yes/graders/03-no-commit-is-made-nothing.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/drafts-intent-and-waits-for-yes/graders/04-reply-lists-the-playbook-steps.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/drafts-intent-and-waits-for-yes/graders/05-the-reply-is-in-the.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/drafts-intent-and-waits-for-yes/graders/06-every-path-in-the-reply.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/drafts-intent-and-waits-for-yes/graders/07-the-drafts-open-questions-section.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/drafts-intent-and-waits-for-yes/prompt.md +10 -0
- package/templates/base/.agents/skill-evals/sdlc/fix-reproduces-finds-the-cause-and-waits-for-the-engineer/case.yaml +34 -0
- package/templates/base/.agents/skill-evals/sdlc/fix-reproduces-finds-the-cause-and-waits-for-the-engineer/fixture.md +1 -0
- package/templates/base/.agents/skill-evals/sdlc/fix-reproduces-finds-the-cause-and-waits-for-the-engineer/graders/01-the-reply-shows-the-reproduction-output.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/fix-reproduces-finds-the-cause-and-waits-for-the-engineer/graders/02-the-reply-names-one-cause-with-evidence.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/fix-reproduces-finds-the-cause-and-waits-for-the-engineer/graders/03-the-plan-has-the-four-headings.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/fix-reproduces-finds-the-cause-and-waits-for-the-engineer/graders/04-no-file-or-commit.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/fix-reproduces-finds-the-cause-and-waits-for-the-engineer/graders/05-the-reply-names-the-gate.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/fix-reproduces-finds-the-cause-and-waits-for-the-engineer/graders/06-the-reply-is-in-thai.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/fix-reproduces-finds-the-cause-and-waits-for-the-engineer/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/interviews-before-writing-intent/case.yaml +12 -0
- package/templates/base/.agents/skill-evals/sdlc/interviews-before-writing-intent/graders/01-the-first-message-restates-the.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/interviews-before-writing-intent/graders/02-the-reply-asks-numbered-questions.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/interviews-before-writing-intent/graders/03-no-intentmd-is-written-before.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/interviews-before-writing-intent/graders/04-reply-lists-the-playbook-steps.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/interviews-before-writing-intent/graders/05-no-commit-is-made-nothing.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/interviews-before-writing-intent/graders/06-the-reply-is-in-the.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/interviews-before-writing-intent/graders/07-every-path-in-the-reply.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/interviews-before-writing-intent/graders/08-no-question-in-the-round.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/interviews-before-writing-intent/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/maintain-writes-intent-from-a-finding/case.yaml +14 -0
- package/templates/base/.agents/skill-evals/sdlc/maintain-writes-intent-from-a-finding/fixture.md +1 -0
- package/templates/base/.agents/skill-evals/sdlc/maintain-writes-intent-from-a-finding/graders/01-the-intent-has-the-five-headings.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/maintain-writes-intent-from-a-finding/graders/02-problem-holds-the-error-and-where.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/maintain-writes-intent-from-a-finding/graders/03-unverified-cause-is-an-open-question.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/maintain-writes-intent-from-a-finding/graders/04-no-source-file-is-changed.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/maintain-writes-intent-from-a-finding/graders/05-a-branch-is-pushed-and-the-gate-is-named.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/maintain-writes-intent-from-a-finding/graders/06-the-person-is-asked-no-question.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/maintain-writes-intent-from-a-finding/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/reported-problem-starts-the-plan/case.yaml +12 -0
- package/templates/base/.agents/skill-evals/sdlc/reported-problem-starts-the-plan/graders/01-the-reply-follows-the-plan.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/reported-problem-starts-the-plan/graders/02-the-reply-does-not-tell.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/reported-problem-starts-the-plan/graders/03-no-file-is-created-or.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/reported-problem-starts-the-plan/graders/04-the-reply-is-in-the.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/reported-problem-starts-the-plan/graders/05-every-path-in-the-reply.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/reported-problem-starts-the-plan/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/request-that-fits-no-row/case.yaml +11 -0
- package/templates/base/.agents/skill-evals/sdlc/request-that-fits-no-row/fixture.md +1 -0
- package/templates/base/.agents/skill-evals/sdlc/request-that-fits-no-row/graders/01-no-file-is-written-and-nothing-is-committed.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/request-that-fits-no-row/graders/02-the-reply-names-the-closest-row.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/request-that-fits-no-row/graders/03-the-reply-is-short-and-in-thai.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/request-that-fits-no-row/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/review-reports-findings-and-never-merges/case.yaml +79 -0
- package/templates/base/.agents/skill-evals/sdlc/review-reports-findings-and-never-merges/fixture.md +1 -0
- package/templates/base/.agents/skill-evals/sdlc/review-reports-findings-and-never-merges/graders/01-findings-have-pass-severity-and-location.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/review-reports-findings-and-never-merges/graders/02-no-approval-and-no-merge.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/review-reports-findings-and-never-merges/graders/03-the-reply-names-the-code-owner-gate.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/review-reports-findings-and-never-merges/graders/04-nothing-is-pushed-or-changed.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/review-reports-findings-and-never-merges/graders/05-the-review-runs-in-a-fresh-context.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/review-reports-findings-and-never-merges/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/spec-for-unmerged-intent-stops/case.yaml +42 -0
- package/templates/base/.agents/skill-evals/sdlc/spec-for-unmerged-intent-stops/fixture.md +1 -0
- package/templates/base/.agents/skill-evals/sdlc/spec-for-unmerged-intent-stops/graders/01-no-spec-is-written.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/spec-for-unmerged-intent-stops/graders/02-no-commit-is-made.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/spec-for-unmerged-intent-stops/graders/03-the-reply-says-not-merged.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/spec-for-unmerged-intent-stops/graders/04-the-reply-is-in-the.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/spec-for-unmerged-intent-stops/graders/05-the-reply-is-short.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/spec-for-unmerged-intent-stops/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/statement-without-command-starts-no-work/case.yaml +12 -0
- package/templates/base/.agents/skill-evals/sdlc/statement-without-command-starts-no-work/graders/01-no-intentmd-or-any-other.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/statement-without-command-starts-no-work/graders/02-no-commit-is-made-nothing.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/statement-without-command-starts-no-work/graders/03-the-reply-is-in-the.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/statement-without-command-starts-no-work/graders/04-every-path-in-the-reply.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/statement-without-command-starts-no-work/graders/05-the-reply-says-that-work.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/statement-without-command-starts-no-work/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/writes-spec-from-merged-intent/case.yaml +42 -0
- package/templates/base/.agents/skill-evals/sdlc/writes-spec-from-merged-intent/fixture.md +1 -0
- package/templates/base/.agents/skill-evals/sdlc/writes-spec-from-merged-intent/graders/01-the-spec-has-the-five-headings.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/writes-spec-from-merged-intent/graders/02-policies-has-one-line-per-policy.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/writes-spec-from-merged-intent/graders/03-no-policy-is-called-unwritten.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/writes-spec-from-merged-intent/graders/04-a-branch-is-pushed-for-review.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/writes-spec-from-merged-intent/graders/05-the-reply-names-the-gate.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/writes-spec-from-merged-intent/graders/06-the-reply-is-in-the.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/writes-spec-from-merged-intent/graders/07-no-merge-is-made.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/writes-spec-from-merged-intent/graders/08-the-four-policies-are-read-before-writing.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc/writes-spec-from-merged-intent/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc-help/explains-how-to-start-work/case.yaml +11 -0
- package/templates/base/.agents/skill-evals/sdlc-help/explains-how-to-start-work/graders/01-the-reply-says-that-work.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/explains-how-to-start-work/graders/02-the-reply-gives-one-example.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/explains-how-to-start-work/graders/03-the-reply-lists-the-project.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/explains-how-to-start-work/graders/04-no-file-is-created-or.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/explains-how-to-start-work/graders/05-the-reply-is-in-the.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/explains-how-to-start-work/graders/06-every-path-in-the-reply.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/explains-how-to-start-work/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc-help/unknown-playbook-is-not-invented/case.yaml +10 -0
- package/templates/base/.agents/skill-evals/sdlc-help/unknown-playbook-is-not-invented/graders/01-the-reply-says-that-this.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/unknown-playbook-is-not-invented/graders/02-the-reply-does-not-describe.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/unknown-playbook-is-not-invented/graders/03-no-file-is-created-or.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/unknown-playbook-is-not-invented/graders/04-the-reply-is-in-the.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/unknown-playbook-is-not-invented/graders/05-every-path-in-the-reply.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/unknown-playbook-is-not-invented/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc-help/work-request-is-sent-to-sdlc/case.yaml +11 -0
- package/templates/base/.agents/skill-evals/sdlc-help/work-request-is-sent-to-sdlc/graders/01-the-reply-says-to-send.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/work-request-is-sent-to-sdlc/graders/02-no-file-is-created-or.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/work-request-is-sent-to-sdlc/graders/03-the-reply-is-in-the.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/work-request-is-sent-to-sdlc/graders/04-every-path-in-the-reply.md +7 -0
- package/templates/base/.agents/skill-evals/sdlc-help/work-request-is-sent-to-sdlc/prompt.md +8 -0
- package/templates/base/.agents/skills/sdlc/SKILL.md +25 -21
- package/templates/base/.agents/skills/sdlc/playbooks/build.md +13 -8
- package/templates/base/.agents/skills/sdlc/playbooks/deploy.md +2 -2
- package/templates/base/.agents/skills/sdlc/playbooks/design.md +4 -4
- package/templates/base/.agents/skills/sdlc/playbooks/fix.md +23 -0
- package/templates/base/.agents/skills/sdlc/playbooks/maintain.md +2 -3
- package/templates/base/.agents/skills/sdlc/playbooks/open-pr.md +3 -3
- package/templates/base/.agents/skills/sdlc/playbooks/plan.md +2 -2
- package/templates/base/.agents/skills/sdlc/playbooks/review.md +2 -2
- package/templates/base/.agents/skills/sdlc-help/SKILL.md +3 -1
- package/templates/base/.claude/managed-settings.example.json +2 -2
- package/templates/base/.claude/settings.json +0 -13
- package/templates/base/.claude/skills/sdlc/SKILL.md +25 -21
- package/templates/base/.claude/skills/sdlc/playbooks/build.md +13 -8
- package/templates/base/.claude/skills/sdlc/playbooks/deploy.md +2 -2
- package/templates/base/.claude/skills/sdlc/playbooks/design.md +4 -4
- package/templates/base/.claude/skills/sdlc/playbooks/fix.md +23 -0
- package/templates/base/.claude/skills/sdlc/playbooks/maintain.md +2 -3
- package/templates/base/.claude/skills/sdlc/playbooks/open-pr.md +3 -3
- package/templates/base/.claude/skills/sdlc/playbooks/plan.md +2 -2
- package/templates/base/.claude/skills/sdlc/playbooks/review.md +2 -2
- package/templates/base/.claude/skills/sdlc-help/SKILL.md +3 -1
- package/templates/base/.cursor/hooks.json +0 -6
- package/templates/base/.cursor/rules/no-suppression.mdc +1 -1
- package/templates/base/.cursor/skills/sdlc/SKILL.md +25 -21
- package/templates/base/.cursor/skills/sdlc/playbooks/build.md +13 -8
- package/templates/base/.cursor/skills/sdlc/playbooks/deploy.md +2 -2
- package/templates/base/.cursor/skills/sdlc/playbooks/design.md +4 -4
- package/templates/base/.cursor/skills/sdlc/playbooks/fix.md +23 -0
- package/templates/base/.cursor/skills/sdlc/playbooks/maintain.md +2 -3
- package/templates/base/.cursor/skills/sdlc/playbooks/open-pr.md +3 -3
- package/templates/base/.cursor/skills/sdlc/playbooks/plan.md +2 -2
- package/templates/base/.cursor/skills/sdlc/playbooks/review.md +2 -2
- package/templates/base/.cursor/skills/sdlc-help/SKILL.md +3 -1
- package/templates/base/.github/ISSUE_TEMPLATE/documentation.yml +1 -1
- package/templates/base/.github/dependabot.yml +1 -10
- package/templates/base/.github/file-filters.yml +3 -6
- package/templates/base/.github/workflows/agent-evals.yml +46 -0
- package/templates/base/.github/workflows/claude-fix-loop.yml +45 -0
- package/templates/base/.github/workflows/control-band.yml +115 -0
- package/templates/base/.github/workflows/dependency-review.yml +1 -0
- package/templates/base/.github/workflows/deploy.yml +4 -2
- package/templates/base/.github/workflows/osv-scanner.yml +0 -5
- package/templates/base/.github/workflows/pr-triage.yml +1 -1
- package/templates/base/.github/workflows/secret-scan.yml +4 -1
- package/templates/base/.github/workflows/spec-on-intent-merge.yml +108 -0
- package/templates/base/.github/workflows/validate-pr-title.yml +3 -2
- package/templates/base/.husky/pre-push +1 -8
- package/templates/base/REVIEW.md +2 -2
- package/templates/base/SETUP.md +44 -8
- package/templates/base/bands.yaml +3 -3
- package/templates/base/intent/README.md +1 -0
- package/templates/base/knip.json +2 -1
- package/templates/base/pnpm-workspace.yaml +1 -22
- package/templates/base/runbooks/rollback-deploy.md +27 -0
- package/templates/base/scripts/check-agent-gates.ts +251 -225
- package/templates/base/scripts/check-bands.ts +665 -0
- package/templates/base/scripts/check-plan.ts +1047 -0
- package/templates/base/scripts/measure-loop.ts +293 -0
- package/templates/base/scripts/run-agent-evals.ts +1186 -0
- package/templates/base/scripts/sync-agent-rules.ts +0 -8
- package/templates/nestjs/.dependency-cruiser.json +1 -1
- package/templates/nestjs/.github/ISSUE_TEMPLATE/bug.yml +5 -5
- package/templates/nestjs/.github/workflows/ci.yml +58 -9
- package/templates/nestjs/.github/workflows/sast.yml +0 -5
- package/templates/nestjs/AGENTS.md +16 -12
- package/templates/nestjs/CONTRIBUTING.md +3 -2
- package/templates/nestjs/Dockerfile +4 -4
- package/templates/nestjs/README.md +4 -6
- package/templates/nestjs/_gitignore +0 -1
- package/templates/nestjs/package.json +15 -13
- package/templates/nestjs/src/app.controller.test.ts +1 -0
- package/templates/nestjs/src/health/health.controller.test.ts +1 -0
- package/templates/nestjs/src/port.test.ts +1 -0
- package/templates/nestjs/test/app.e2e.test.ts +1 -0
- package/templates/nestjs/tsconfig.build.json +2 -3
- package/templates/nestjs/tsconfig.json +1 -3
- package/templates/nestjs/vitest.config.ts +0 -1
- package/templates/nestjs/vitest.e2e.config.ts +0 -1
- package/templates/nextjs/.dependency-cruiser.json +1 -1
- package/templates/nextjs/.github/ISSUE_TEMPLATE/bug.yml +1 -1
- package/templates/nextjs/.github/workflows/ci.yml +58 -9
- package/templates/nextjs/.github/workflows/sast.yml +0 -5
- package/templates/nextjs/AGENTS.md +16 -12
- package/templates/nextjs/CONTRIBUTING.md +3 -2
- package/templates/nextjs/Dockerfile +2 -2
- package/templates/nextjs/README.md +5 -3
- package/templates/nextjs/app/layout.tsx +2 -2
- package/templates/nextjs/app/page.test.ts +1 -1
- package/templates/nextjs/app/page.tsx +1 -1
- package/templates/nextjs/package.json +9 -8
- package/templates/nextjs/test/home.e2e.test.ts +3 -7
- package/templates/nextjs/tsconfig.json +0 -3
- package/templates/nodejs/.dependency-cruiser.json +1 -1
- package/templates/nodejs/.github/ISSUE_TEMPLATE/bug.yml +5 -5
- package/templates/nodejs/.github/workflows/ci.yml +58 -9
- package/templates/nodejs/.github/workflows/sast.yml +0 -5
- package/templates/nodejs/AGENTS.md +16 -11
- package/templates/nodejs/CONTRIBUTING.md +4 -3
- package/templates/nodejs/Dockerfile +3 -3
- package/templates/nodejs/README.md +4 -4
- package/templates/nodejs/_gitignore +0 -1
- package/templates/nodejs/package.json +11 -9
- package/templates/nodejs/src/server.test.ts +23 -0
- package/templates/nodejs/src/server.ts +2 -2
- package/templates/nodejs/tsconfig.build.json +2 -3
- package/templates/nodejs/tsconfig.json +0 -4
- package/templates/payload/.agents/agents/verifier.md +1 -1
- package/templates/payload/.agents/review.md +21 -0
- package/templates/payload/.claude/agents/verifier.md +1 -1
- package/templates/payload/.cursor/agents/verifier.md +1 -1
- package/templates/payload/.dependency-cruiser.json +1 -1
- package/templates/payload/.github/ISSUE_TEMPLATE/bug.yml +1 -1
- package/templates/payload/.github/workflows/ci.yml +75 -10
- package/templates/payload/.github/workflows/sast.yml +0 -5
- package/templates/payload/AGENTS.md +21 -17
- package/templates/payload/CONTRIBUTING.md +4 -3
- package/templates/payload/Dockerfile +2 -2
- package/templates/payload/README.md +8 -4
- package/templates/payload/REVIEW.md +21 -0
- package/templates/payload/package.json +9 -7
- package/templates/payload/src/app/(frontend)/layout.tsx +2 -2
- package/templates/payload/src/app/(frontend)/page.test.ts +1 -1
- package/templates/payload/src/app/(frontend)/page.tsx +1 -1
- package/templates/payload/src/app/favicon.ico +0 -0
- package/templates/payload/src/app/health/route.test.ts +20 -2
- package/templates/payload/src/app/health/route.ts +9 -2
- package/templates/payload/src/collections/media.test.ts +36 -1
- package/templates/payload/src/collections/media.ts +1 -1
- package/templates/payload/src/payload.config.test.ts +15 -0
- package/templates/payload/test/home.e2e.test.ts +3 -7
- package/templates/payload/tsconfig.json +0 -1
- package/templates/turborepo/.agents/agents/verifier.md +1 -1
- package/templates/turborepo/.agents/review.md +21 -0
- package/templates/turborepo/.claude/agents/verifier.md +1 -1
- package/templates/turborepo/.cursor/agents/verifier.md +1 -1
- package/templates/turborepo/.dockerignore +9 -4
- package/templates/turborepo/.github/ISSUE_TEMPLATE/bug.yml +16 -1
- package/templates/turborepo/.github/dependabot.yml +1 -10
- package/templates/turborepo/.github/scripts/affected-apps.sh +5 -23
- package/templates/turborepo/.github/workflows/ci.yml +140 -103
- package/templates/turborepo/.github/workflows/deploy.yml +24 -23
- package/templates/turborepo/.github/workflows/sast.yml +0 -5
- package/templates/turborepo/AGENTS.md +21 -17
- package/templates/turborepo/CONTRIBUTING.md +6 -4
- package/templates/turborepo/README.md +8 -8
- package/templates/turborepo/REVIEW.md +21 -0
- package/templates/turborepo/apps/app/.dependency-cruiser.json +1 -1
- package/templates/turborepo/apps/app/AGENTS.md +9 -0
- package/templates/turborepo/apps/app/Dockerfile +2 -2
- package/templates/turborepo/apps/app/app/layout.tsx +2 -2
- package/templates/turborepo/apps/app/app/page.test.ts +1 -1
- package/templates/turborepo/apps/app/app/page.tsx +1 -1
- package/templates/turborepo/apps/app/package.json +3 -3
- package/templates/turborepo/apps/app/test/home.e2e.test.ts +3 -7
- package/templates/turborepo/apps/app/tsconfig.json +0 -3
- package/templates/turborepo/apps/backoffice/.dependency-cruiser.json +1 -1
- package/templates/turborepo/apps/backoffice/AGENTS.md +9 -0
- package/templates/turborepo/apps/backoffice/Dockerfile +2 -2
- package/templates/turborepo/apps/backoffice/package.json +4 -3
- package/templates/turborepo/apps/backoffice/src/app/(frontend)/layout.tsx +2 -2
- package/templates/turborepo/apps/backoffice/src/app/(frontend)/page.test.ts +1 -1
- package/templates/turborepo/apps/backoffice/src/app/(frontend)/page.tsx +1 -1
- package/templates/turborepo/apps/backoffice/src/app/favicon.ico +0 -0
- package/templates/turborepo/apps/backoffice/src/app/health/route.test.ts +20 -2
- package/templates/turborepo/apps/backoffice/src/app/health/route.ts +10 -2
- package/templates/turborepo/apps/backoffice/src/collections/media.test.ts +36 -1
- package/templates/turborepo/apps/backoffice/src/collections/media.ts +1 -1
- package/templates/turborepo/apps/backoffice/src/environment.test.ts +19 -0
- package/templates/turborepo/apps/backoffice/src/payload.config.test.ts +15 -0
- package/templates/turborepo/apps/backoffice/test/home.e2e.test.ts +3 -7
- package/templates/turborepo/apps/backoffice/tsconfig.json +0 -1
- package/templates/turborepo/knip.json +4 -2
- package/templates/turborepo/package.json +15 -15
- package/templates/turborepo/pnpm-workspace.yaml +1 -22
- package/templates/turborepo/turbo.json +32 -11
- package/templates/base/.agents/hooks/agent-suppression-gate.sh +0 -45
- package/templates/base/.claude/rules/agents-guide.md +0 -1
- package/templates/base/scripts/check-human-gates.ts +0 -383
- package/templates/base/scripts/check-intent.ts +0 -391
- package/templates/nextjs/knip.json +0 -4
- package/templates/payload/src/collections/users.test.ts +0 -10
- package/templates/turborepo/apps/backoffice/src/collections/users.test.ts +0 -10
|
@@ -4,21 +4,21 @@ Next.js App Router web app with React and Tailwind CSS, in TypeScript on pnpm an
|
|
|
4
4
|
|
|
5
5
|
## Commands
|
|
6
6
|
|
|
7
|
-
| Task
|
|
8
|
-
|
|
|
9
|
-
| Start with reload
|
|
10
|
-
| One test
|
|
11
|
-
| Unit tests
|
|
12
|
-
| End-to-end tests
|
|
13
|
-
| What `pre-push` runs
|
|
14
|
-
| Every check
|
|
15
|
-
| Render rules after a change
|
|
7
|
+
| Task | Command | Healthy output |
|
|
8
|
+
| :--------------------------------- | :---------------------------------------------------------- | :--------------------------------------------------------------------------- |
|
|
9
|
+
| Start with reload | `pnpm dev` | `✓ Ready in 301ms` |
|
|
10
|
+
| One test | `pnpm vitest run app/health/route.test.ts -t "<test name>"` | `Tests 1 passed (1)` |
|
|
11
|
+
| Unit tests | `pnpm test`, or `pnpm test:coverage` | `Tests 2 passed (2)` |
|
|
12
|
+
| End-to-end tests | `pnpm test:e2e` | `1 passed (5.6s)` |
|
|
13
|
+
| What `pre-push` runs | `pnpm check` | exits 0; the last output is the route table of `next build` with `ƒ /health` |
|
|
14
|
+
| Every check except `pnpm test:e2e` | `pnpm verify` | exits 0; the last output is the route table of `next build` with `ƒ /health` |
|
|
15
|
+
| Render rules after a change | `pnpm rules:sync` | `Synced 69 agent rule files; 0 updated.` |
|
|
16
16
|
|
|
17
17
|
## Verifying your work
|
|
18
18
|
|
|
19
19
|
- Build: `pnpm build` (prints the `Route (app)` table)
|
|
20
20
|
- Test: `pnpm test:coverage` (all green, then the coverage summary; never skip or delete a failing test)
|
|
21
|
-
-
|
|
21
|
+
- Static checks: `pnpm verify:static` (ESLint allows zero warnings; every check must pass)
|
|
22
22
|
|
|
23
23
|
Run all three before reporting any task complete, and paste the output. `pnpm verify` runs all three.
|
|
24
24
|
|
|
@@ -33,17 +33,21 @@ Run all three before reporting any task complete, and paste the output. `pnpm ve
|
|
|
33
33
|
2. **Component tests need a DOM test environment, and Vitest runs in Node.js.** Add that environment with the first component test.
|
|
34
34
|
3. **Read configuration from environment variables and fail when one is missing.** Document each variable in `.env.example`.
|
|
35
35
|
4. **Start from the accepted spec, in plan mode** (Cursor: Plan Mode). Give the plan the change's `intent/<change>/intent.md` and `spec.md`. Commit the approved plan as `intent/<change>/plan.md` with an `Accepted by:` line naming the engineer, as `.agents/skills/sdlc/playbooks/build.md` describes.
|
|
36
|
-
5. **Start a bug fix with a failing test.** Reproduce the bug as a test, confirm it fails for the reason you expect, and commit it
|
|
36
|
+
5. **Start a bug fix with a failing test.** A bug fix has no intent and no spec; its plan, `intent/<short-description>/plan.md`, is accepted by an engineer before any code changes. Reproduce the bug as a test, confirm it fails for the reason you expect, and commit it on a `fix/` branch. Then `.agents/hooks/agent-test-edit-gate.sh` blocks test edits by itself: make the test pass without editing it. On a branch with another name, create `.git/bug-fix-in-progress` first, and delete it once the test passes.
|
|
37
37
|
6. **Do not start work a person did not ask for.** When a message reports a problem without asking for work, answer in a few lines and end with the message that would start it: `/sdlc` followed by their own words.
|
|
38
38
|
7. **Branch from the latest `origin/main`, and open the pull request ready for review.** Name the branch `<type>/<short-description>` and fill the body from `.github/pull_request_template.md`. `.github/workflows/ci.yml` runs full verification only on a pull request that is not a draft. Never merge a pull request: a person merges it with `--squash` after code owner approval, bottom-up for a stack of pull requests.
|
|
39
39
|
8. **Write replies a person can check.** Reply in the language the person wrote in. Write paths from the project root, such as `README.md:12`, never from the machine's root. State as a fact only what you opened or ran in this turn, and say what you ran; mark anything else as inferred or not checked. Answer what was asked and stop: leave out tools, services, and steps the request does not need, and never hand the person a check you could run. Send nothing outside the session, such as a message to another session or a service, unless a task step says to.
|
|
40
|
+
9. **Run parallel sessions in separate worktrees, on tasks that touch different files.** Start each with `claude --worktree <name>`: a worktree is its own checkout on its own branch. Tasks that share files run in one session, one after another. Start with two or three sessions, and add one only while you can review every stream properly.
|
|
40
41
|
|
|
41
42
|
## Things Claude gets wrong
|
|
42
43
|
|
|
43
44
|
When Claude makes a mistake twice, add the correction here.
|
|
44
45
|
|
|
45
46
|
- **First end-to-end run**: run `pnpm exec playwright install chromium` once. `pnpm test:e2e` starts the development server unless one is already running.
|
|
46
|
-
- **Production gate**: `.agents/hooks/agent-production-gate.sh` blocks a shell command that deploys to `prod`, runs a Railway CLI command that names `prod`, or pushes a release tag, unless a release manager started the session with `RELEASE_APPROVAL` set. Report what is ready to promote instead. When a gated command appears only inside a message, write the text to a file with your file-editing tool, not a shell heredoc, and pass it with `git commit -F <file>` or `gh pr create --body-file <file>`. The gate reads only shell commands, so an MCP tool or a Railway command without `-e` or `--environment` passes it.
|
|
47
|
+
- **Production gate**: `.agents/hooks/agent-production-gate.sh` blocks a shell command that deploys to `prod`, runs a Railway CLI command that names `prod`, or pushes a release tag, unless a release manager started the session with `RELEASE_APPROVAL` set. Any value lifts the gate except an empty value, `0`, `false`, and `no`, in any letter case. Report what is ready to promote instead. When a gated command appears only inside a message, write the text to a file with your file-editing tool, not a shell heredoc, and pass it with `git commit -F <file>` or `gh pr create --body-file <file>`. The gate reads only shell commands, so an MCP tool or a Railway command without `-e` or `--environment` passes it.
|
|
48
|
+
- **Issues**: open an issue only to hand work to another person, never to give a pull request a number to close. A pull request closes an issue that already exists with `Closes #<issue>`.
|
|
49
|
+
- **What belongs in the repository**: files, commit messages, and pull requests hold the change, its reason, and the checks. Write no date, log, history, mistake count, token figure, or session note into a file.
|
|
50
|
+
- **Sourced requirements**: add a requirement to an intent, spec, or plan only when a person decided it or a named source says it. This includes a requirement a review bot suggests. When no person decided it and no source says it, leave it out and answer the thread with that.
|
|
47
51
|
|
|
48
52
|
<!-- BEGIN:nextjs-agent-rules -->
|
|
49
53
|
|
|
@@ -8,7 +8,7 @@ Use this guide to prepare changes to this repository.
|
|
|
8
8
|
- Change the Node.js version in `.nvmrc` and the `Dockerfile` together. Dependabot updates only the `Dockerfile`.
|
|
9
9
|
- Install pnpm once with `npm install --global pnpm`. It switches to the version declared by `package.json#packageManager` automatically.
|
|
10
10
|
- Use Claude Code v2.1.295 or later. It reads `CLAUDE.md`, which imports `AGENTS.md`, and supports the `onFailure` field the agent hooks use.
|
|
11
|
-
- Install gitleaks 8.
|
|
11
|
+
- Install gitleaks 8.21 or later, which the `pre-commit` hook runs, and jq, which the agent hooks and the `pre-push` hook (`pnpm gates:check`) need: `brew install gitleaks jq` on macOS, or install them from each project's releases on Linux.
|
|
12
12
|
|
|
13
13
|
From the repository root:
|
|
14
14
|
|
|
@@ -35,9 +35,10 @@ Run the narrowest check that covers the change while you work. Git hooks run the
|
|
|
35
35
|
| `pre-merge-commit` | blocks merge commits on `main` |
|
|
36
36
|
| `pre-push` | blocks pushes to `main` except the push that creates it, then `pnpm check`: the static checks, the unit tests related to your changes, and the production build |
|
|
37
37
|
|
|
38
|
-
- **Scans:** CI also runs coverage, the build, the container image, and the secret, SAST, OSV, CodeQL, dependency-review, and OpenSSF Scorecard scans. Dependabot and OSV-Scanner report vulnerable dependencies.
|
|
38
|
+
- **Scans:** CI also runs coverage, the build, the container image, and the secret, SAST, OSV, CodeQL, dependency-review, and OpenSSF Scorecard scans. CodeQL, dependency-review, and Scorecard run on public repositories, and on private ones when the `CODE_SCANNING` repository variable is `true`. Dependabot and OSV-Scanner report vulnerable dependencies.
|
|
39
39
|
- **End-to-end tests:** run `pnpm test:e2e` when you change pages. It starts the development server unless one is already running. Run `pnpm exec playwright install chromium` once before the first run. CI runs it against the production build on every pull request that is ready for review and changes code.
|
|
40
40
|
- **Coverage:** CI requires 95% branch coverage on changed lines in `app/`, except `layout.tsx`.
|
|
41
|
+
- **Agent evals:** run `pnpm evals:run` after you change `AGENTS.md`, a skill under `.agents/skills/`, or a hook under `.agents/hooks/`, and add a case name to run one case. It runs the cases in `.agents/skill-evals/` with Claude Code on your own Claude login, so it spends your Claude usage, and it is not part of `pnpm verify`.
|
|
41
42
|
|
|
42
43
|
Run `pnpm verify` for repository changes.
|
|
43
44
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Runs on any OCI platform (Railway, Fly.io, Cloud Run). On Vercel, deploy without it. The platform sets `PORT`.
|
|
2
2
|
FROM \
|
|
3
|
-
node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 \
|
|
3
|
+
node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 \
|
|
4
4
|
AS build
|
|
5
5
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
6
6
|
WORKDIR /app
|
|
@@ -12,7 +12,7 @@ COPY app ./app
|
|
|
12
12
|
RUN pnpm build
|
|
13
13
|
|
|
14
14
|
FROM \
|
|
15
|
-
node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
|
|
15
|
+
node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
|
|
16
16
|
ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1 HOSTNAME=0.0.0.0
|
|
17
17
|
WORKDIR /app
|
|
18
18
|
# Apply Alpine security fixes released after the base image, and drop npm, corepack, and yarn: the app never runs them, and their bundled dependencies carry their own CVEs.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# next-friday-template-nextjs
|
|
2
2
|
|
|
3
|
-
Next
|
|
3
|
+
Next.js application.
|
|
4
4
|
|
|
5
5
|
## Getting started
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ pnpm dev
|
|
|
12
12
|
|
|
13
13
|
## After creating a project from this template
|
|
14
14
|
|
|
15
|
-
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
|
|
15
|
+
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.js application` text in `app/layout.tsx`, `app/page.tsx`, and `app/page.test.ts`.
|
|
16
16
|
|
|
17
17
|
## Scripts
|
|
18
18
|
|
|
@@ -26,7 +26,9 @@ Follow [SETUP.md](SETUP.md) in order. It sets up the repository, the reviews, an
|
|
|
26
26
|
| `pnpm check` | Run the static checks, the unit tests for changed code, and the production build (the `pre-push` hook) |
|
|
27
27
|
| `pnpm verify` | Run the static checks, all unit tests with coverage, and the production build |
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
`pnpm build` copies `.env` into `.next/standalone`, where every secret sits in plain text. Keep that folder out of images and archives.
|
|
30
|
+
|
|
31
|
+
CI also runs the build, the end-to-end tests, the container image scan, and the security scans, including CodeQL, dependency review, and OpenSSF Scorecard. CodeQL, dependency review, and Scorecard run on public repositories, and on private ones when the `CODE_SCANNING` repository variable is `true`.
|
|
30
32
|
|
|
31
33
|
## Container
|
|
32
34
|
|
|
@@ -14,8 +14,8 @@ const geistMono = Geist_Mono({
|
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
export const metadata: Metadata = {
|
|
17
|
-
title: "Next
|
|
18
|
-
description: "
|
|
17
|
+
title: "Next.js application",
|
|
18
|
+
description: "A Next.js application.",
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export default function RootLayout(props: LayoutProps<"/">) {
|
|
@@ -6,6 +6,6 @@ import Page from "./page";
|
|
|
6
6
|
|
|
7
7
|
describe("Page", () => {
|
|
8
8
|
it("renders the template heading", () => {
|
|
9
|
-
expect(renderToStaticMarkup(createElement(Page))).toContain("Next
|
|
9
|
+
expect(renderToStaticMarkup(createElement(Page))).toContain("Next.js application");
|
|
10
10
|
});
|
|
11
11
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default function Page() {
|
|
2
2
|
return (
|
|
3
3
|
<main className="flex flex-1 flex-col items-center justify-center gap-4 p-16 text-center">
|
|
4
|
-
<h1 className="text-3xl font-semibold tracking-tight">Next
|
|
4
|
+
<h1 className="text-3xl font-semibold tracking-tight">Next.js application</h1>
|
|
5
5
|
<p className="text-lg text-zinc-600 dark:text-zinc-400">Edit app/page.tsx to get started.</p>
|
|
6
6
|
</main>
|
|
7
7
|
);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "next-friday-template-nextjs",
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"private": true,
|
|
5
|
-
"description": "Next
|
|
5
|
+
"description": "Next.js application.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/next-friday/next-friday-template-nextjs.git"
|
|
@@ -11,27 +11,27 @@
|
|
|
11
11
|
"author": "Next Friday",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"scripts": {
|
|
14
|
+
"bands:check": "node scripts/check-bands.ts",
|
|
14
15
|
"build": "next build",
|
|
15
16
|
"check": "pnpm verify:static && pnpm test:changed && pnpm build",
|
|
16
17
|
"clean": "rm -rf .next coverage *.tsbuildinfo .eslintcache node_modules/.cache",
|
|
17
18
|
"depcruise": "depcruise --config .dependency-cruiser.json app test eslint.config.ts next.config.ts playwright.config.ts postcss.config.mjs vitest.config.ts",
|
|
18
19
|
"dev": "next dev",
|
|
20
|
+
"evals:run": "node scripts/run-agent-evals.ts",
|
|
19
21
|
"format": "prettier --write --cache .",
|
|
20
22
|
"format:check": "prettier --check --cache . && editorconfig-checker",
|
|
21
23
|
"gates:check": "node scripts/check-agent-gates.ts",
|
|
22
|
-
"human-gates:check": "node scripts/check-human-gates.ts",
|
|
23
|
-
"intent:check": "node scripts/check-intent.ts",
|
|
24
24
|
"knip": "knip",
|
|
25
25
|
"lint": "eslint . --fix --cache --max-warnings=0 --no-inline-config",
|
|
26
26
|
"lint:check": "eslint . --cache --max-warnings=0 --no-inline-config",
|
|
27
|
-
"
|
|
27
|
+
"loop:measure": "node scripts/measure-loop.ts",
|
|
28
|
+
"plan:check": "node scripts/check-plan.ts",
|
|
28
29
|
"prepare": "husky && next typegen",
|
|
29
30
|
"rules:check": "node scripts/sync-agent-rules.ts --check",
|
|
30
31
|
"rules:sync": "node scripts/sync-agent-rules.ts",
|
|
31
32
|
"sort-package-json": "sort-package-json package.json",
|
|
32
33
|
"sort-package-json:check": "sort-package-json --check package.json",
|
|
33
34
|
"start": "cp -R .next/static .next/standalone/.next/ && (test ! -d public || cp -R public .next/standalone/) && node .next/standalone/server.js",
|
|
34
|
-
"suppressions:check": "bash .agents/hooks/agent-suppression-gate.sh --repo",
|
|
35
35
|
"test": "vitest run --passWithNoTests",
|
|
36
36
|
"test:changed": "if git rev-parse --quiet --verify origin/main > /dev/null && git diff --quiet \"$(git merge-base origin/main HEAD)\" -- pnpm-lock.yaml pnpm-workspace.yaml \"*package.json\" \"*tsconfig.json\" .husky; then vitest run --changed origin/main --passWithNoTests; else vitest run --passWithNoTests; fi",
|
|
37
37
|
"test:coverage": "vitest run --coverage --passWithNoTests",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"test:watch": "vitest",
|
|
40
40
|
"typecheck": "next typegen && tsc --noEmit -p tsconfig.json",
|
|
41
41
|
"verify": "pnpm verify:static && pnpm test:coverage && pnpm build",
|
|
42
|
-
"verify:static": "pnpm
|
|
42
|
+
"verify:static": "pnpm rules:check && pnpm gates:check && pnpm plan:check && pnpm bands:check && pnpm lint:check && pnpm format:check && pnpm sort-package-json:check && pnpm typecheck && pnpm knip && pnpm depcruise"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"next": "16.4.3",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"@next-friday/prettier-config-friday": "4.0.0",
|
|
54
54
|
"@next/eslint-plugin-next": "16.4.3",
|
|
55
55
|
"@playwright/test": "1.64.1",
|
|
56
|
+
"@swc/core": "1.16.22",
|
|
56
57
|
"@tailwindcss/postcss": "4.3.3",
|
|
57
58
|
"@types/node": "26.6.6",
|
|
58
59
|
"@types/react": "19.3.0",
|
|
@@ -61,7 +62,6 @@
|
|
|
61
62
|
"dependency-cruiser": "18.7.1",
|
|
62
63
|
"editorconfig-checker": "7.0.0",
|
|
63
64
|
"eslint": "10.14.0",
|
|
64
|
-
"fast-check": "4.10.2",
|
|
65
65
|
"husky": "9.1.7",
|
|
66
66
|
"jiti": "2.7.0",
|
|
67
67
|
"knip": "6.44.1",
|
|
@@ -71,7 +71,8 @@
|
|
|
71
71
|
"sort-package-json": "4.1.0",
|
|
72
72
|
"tailwindcss": "4.3.3",
|
|
73
73
|
"typescript": "7.0.2",
|
|
74
|
-
"vitest": "5.0.5"
|
|
74
|
+
"vitest": "5.0.5",
|
|
75
|
+
"yaml": "2.9.1"
|
|
75
76
|
},
|
|
76
77
|
"packageManager": "pnpm@12.6.0+sha512.3ef68f951cb111ac204b4a5a16f0b2ddf0da56a96e0413e81d855d9f0b55ef926714709028e1cd00c405c2c5fb7b9e8ec4dc46777c805d0373c2f2ff00fd20ec",
|
|
77
78
|
"engines": {
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import {expect, test} from "@playwright/test";
|
|
2
2
|
|
|
3
|
-
test("
|
|
4
|
-
await page.goto("/");
|
|
3
|
+
test("serves the home page", async ({page}) => {
|
|
4
|
+
const response = await page.goto("/");
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
page.getByRole("heading", {
|
|
8
|
-
level: 1,
|
|
9
|
-
}),
|
|
10
|
-
).toHaveText("Next Friday Next.js template");
|
|
6
|
+
expect(response?.status()).toBe(200);
|
|
11
7
|
});
|
|
@@ -21,7 +21,7 @@ body:
|
|
|
21
21
|
id: version
|
|
22
22
|
attributes:
|
|
23
23
|
label: Commit
|
|
24
|
-
placeholder:
|
|
24
|
+
placeholder: Output of `git rev-parse --short HEAD`
|
|
25
25
|
validations:
|
|
26
26
|
required: true
|
|
27
27
|
- type: textarea
|
|
@@ -30,10 +30,10 @@ body:
|
|
|
30
30
|
label: Environment
|
|
31
31
|
description: List Node.js, operating system, package manager, and the request that triggers the issue.
|
|
32
32
|
placeholder: |
|
|
33
|
-
Node.js:
|
|
34
|
-
OS: Ubuntu
|
|
35
|
-
Package manager: pnpm
|
|
36
|
-
Request: curl -i http://localhost:3000/
|
|
33
|
+
Node.js: output of `node --version`
|
|
34
|
+
OS: Ubuntu / macOS / Windows
|
|
35
|
+
Package manager: output of `pnpm --version`
|
|
36
|
+
Request: curl -i http://localhost:3000/health
|
|
37
37
|
validations:
|
|
38
38
|
required: true
|
|
39
39
|
- type: textarea
|
|
@@ -73,16 +73,14 @@ jobs:
|
|
|
73
73
|
with:
|
|
74
74
|
cache: true
|
|
75
75
|
require-lockfile: true
|
|
76
|
-
- name:
|
|
77
|
-
run: pnpm suppressions:check
|
|
78
|
-
- name: Check Cursor rules match .agents/rules
|
|
76
|
+
- name: Check rendered agent rules match .agents/rules
|
|
79
77
|
run: pnpm rules:check
|
|
80
78
|
- name: Check agent gates
|
|
81
79
|
run: pnpm gates:check
|
|
82
|
-
- name: Check
|
|
83
|
-
run: pnpm
|
|
84
|
-
- name:
|
|
85
|
-
run: pnpm
|
|
80
|
+
- name: Check plans
|
|
81
|
+
run: pnpm plan:check
|
|
82
|
+
- name: Check bands
|
|
83
|
+
run: pnpm bands:check
|
|
86
84
|
- name: Check lint
|
|
87
85
|
run: pnpm lint:check
|
|
88
86
|
- name: Check formatting
|
|
@@ -91,8 +89,6 @@ jobs:
|
|
|
91
89
|
GITHUB_TOKEN: ${{ github.token }} # editorconfig-checker downloads its binary from GitHub releases; the token avoids the anonymous rate limit.
|
|
92
90
|
- name: Check package.json ordering
|
|
93
91
|
run: pnpm sort-package-json:check
|
|
94
|
-
- name: Validate peer dependency contracts
|
|
95
|
-
run: pnpm peers:check
|
|
96
92
|
- name: Check types
|
|
97
93
|
run: pnpm typecheck
|
|
98
94
|
- name: Run Knip
|
|
@@ -168,6 +164,59 @@ jobs:
|
|
|
168
164
|
environment: dev
|
|
169
165
|
commit_sha: ${{ github.sha }}
|
|
170
166
|
|
|
167
|
+
triage:
|
|
168
|
+
name: Triage failed build
|
|
169
|
+
needs:
|
|
170
|
+
- changes
|
|
171
|
+
- checks
|
|
172
|
+
- image
|
|
173
|
+
if: failure() && vars.CLAUDE_CI_ENABLED == 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
|
|
174
|
+
runs-on: ubuntu-latest
|
|
175
|
+
timeout-minutes: 15
|
|
176
|
+
permissions:
|
|
177
|
+
actions: read # Needed to read the logs of the failed jobs.
|
|
178
|
+
id-token: write # Needed to authenticate the Claude GitHub App with the workflow's OIDC token.
|
|
179
|
+
pull-requests: write # Needed to post the summary on the pull request.
|
|
180
|
+
steps:
|
|
181
|
+
- name: Require a Claude credential
|
|
182
|
+
env:
|
|
183
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
184
|
+
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
185
|
+
run: |
|
|
186
|
+
[[ -n "$ANTHROPIC_API_KEY" || -n "$CLAUDE_CODE_OAUTH_TOKEN" ]] || { echo "::error::Set the CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY repository secret"; exit 1; }
|
|
187
|
+
- name: Collect the build log
|
|
188
|
+
env:
|
|
189
|
+
GH_TOKEN: ${{ github.token }}
|
|
190
|
+
REPOSITORY: ${{ github.repository }}
|
|
191
|
+
RUN_ID: ${{ github.run_id }}
|
|
192
|
+
run: |
|
|
193
|
+
mkdir -p out
|
|
194
|
+
for job in $(gh api "repos/$REPOSITORY/actions/runs/$RUN_ID/jobs" --paginate --jq '.jobs[] | select(.conclusion == "failure") | .id'); do
|
|
195
|
+
gh api --allow-escape-sequences "repos/$REPOSITORY/actions/jobs/$job/logs" >> out/build.log
|
|
196
|
+
done
|
|
197
|
+
- name: Triage failed build
|
|
198
|
+
id: triage
|
|
199
|
+
uses: anthropics/claude-code-action@61a9c274fa7110a66dfafc1bbbced03833eb25fe # v1.0.269
|
|
200
|
+
with:
|
|
201
|
+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
202
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
203
|
+
prompt: >
|
|
204
|
+
Read the build log at out/build.log. Identify the most
|
|
205
|
+
likely cause, say whether the failure looks flaky or real, and write a
|
|
206
|
+
three-line summary for the PR thread.
|
|
207
|
+
claude_args: >-
|
|
208
|
+
--model claude-haiku-5-5
|
|
209
|
+
--max-turns 5
|
|
210
|
+
--allowedTools "Read"
|
|
211
|
+
--json-schema '{"type":"object","properties":{"summary":{"type":"string"}},"required":["summary"]}'
|
|
212
|
+
- name: Post the summary
|
|
213
|
+
env:
|
|
214
|
+
GH_TOKEN: ${{ github.token }}
|
|
215
|
+
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
216
|
+
REPOSITORY: ${{ github.repository }}
|
|
217
|
+
SUMMARY: ${{ fromJSON(steps.triage.outputs.structured_output).summary }}
|
|
218
|
+
run: gh pr comment "$PR_NUMBER" --repo "$REPOSITORY" --body "$SUMMARY"
|
|
219
|
+
|
|
171
220
|
ci:
|
|
172
221
|
name: All Checks
|
|
173
222
|
if: always()
|
|
@@ -4,20 +4,21 @@ TypeScript HTTP service on `node:http`, without a framework, on pnpm and Node.js
|
|
|
4
4
|
|
|
5
5
|
## Commands
|
|
6
6
|
|
|
7
|
-
| Task | Command |
|
|
8
|
-
| :-------------------------- | :-------------------------------------------------- |
|
|
9
|
-
| Start with reload | `pnpm start:dev` |
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
7
|
+
| Task | Command | Healthy output |
|
|
8
|
+
| :-------------------------- | :-------------------------------------------------- | :--------------------------------------------------------------------------------------------------- |
|
|
9
|
+
| Start with reload | `pnpm start:dev` | The only output is `$ node --env-file-if-exists=.env --watch src/main.ts`; `GET /health` answers 200 |
|
|
10
|
+
| Run the build | `pnpm start`, which builds first | `$ tsc -p tsconfig.build.json`, then nothing |
|
|
11
|
+
| One test | `pnpm vitest run src/port.test.ts -t "<test name>"` | `Tests 1 passed \| 9 skipped (10)` |
|
|
12
|
+
| Unit tests | `pnpm test`, or `pnpm test:coverage` | `Tests 15 passed (15)` |
|
|
13
|
+
| What `pre-push` runs | `pnpm check` | exits 0; the last line is `$ tsc -p tsconfig.build.json` |
|
|
14
|
+
| Every check | `pnpm verify` | exits 0; the last line is `$ tsc -p tsconfig.build.json` |
|
|
15
|
+
| Render rules after a change | `pnpm rules:sync` | `Synced 67 agent rule files; 0 updated.` |
|
|
15
16
|
|
|
16
17
|
## Verifying your work
|
|
17
18
|
|
|
18
19
|
- Build: `pnpm build` (prints nothing after `$ tsc -p tsconfig.build.json`)
|
|
19
20
|
- Test: `pnpm test:coverage` (all green, then the coverage summary; never skip or delete a failing test)
|
|
20
|
-
-
|
|
21
|
+
- Static checks: `pnpm verify:static` (ESLint allows zero warnings; every check must pass)
|
|
21
22
|
|
|
22
23
|
Run all three before reporting any task complete, and paste the output. `pnpm verify` runs all three.
|
|
23
24
|
|
|
@@ -31,13 +32,17 @@ Run all three before reporting any task complete, and paste the output. `pnpm ve
|
|
|
31
32
|
1. **Put tests next to the code as `src/**/*.test.ts`.** Vitest collects only that pattern.
|
|
32
33
|
2. **Read configuration from environment variables and fail when one is missing**, as `parsePort` does. Document each variable in `.env.example`; `pnpm start` and `pnpm start:dev` load `.env`.
|
|
33
34
|
3. **Start from the accepted spec, in plan mode** (Cursor: Plan Mode). Give the plan the change's `intent/<change>/intent.md` and `spec.md`. Commit the approved plan as `intent/<change>/plan.md` with an `Accepted by:` line naming the engineer, as `.agents/skills/sdlc/playbooks/build.md` describes.
|
|
34
|
-
4. **Start a bug fix with a failing test.** Reproduce the bug as a test, confirm it fails for the reason you expect, and commit it
|
|
35
|
+
4. **Start a bug fix with a failing test.** A bug fix has no intent and no spec; its plan, `intent/<short-description>/plan.md`, is accepted by an engineer before any code changes. Reproduce the bug as a test, confirm it fails for the reason you expect, and commit it on a `fix/` branch. Then `.agents/hooks/agent-test-edit-gate.sh` blocks test edits by itself: make the test pass without editing it. On a branch with another name, create `.git/bug-fix-in-progress` first, and delete it once the test passes.
|
|
35
36
|
5. **Do not start work a person did not ask for.** When a message reports a problem without asking for work, answer in a few lines and end with the message that would start it: `/sdlc` followed by their own words.
|
|
36
37
|
6. **Branch from the latest `origin/main`, and open the pull request ready for review.** Name the branch `<type>/<short-description>` and fill the body from `.github/pull_request_template.md`. `.github/workflows/ci.yml` runs full verification only on a pull request that is not a draft. Never merge a pull request: a person merges it with `--squash` after code owner approval, bottom-up for a stack of pull requests.
|
|
37
38
|
7. **Write replies a person can check.** Reply in the language the person wrote in. Write paths from the project root, such as `README.md:12`, never from the machine's root. State as a fact only what you opened or ran in this turn, and say what you ran; mark anything else as inferred or not checked. Answer what was asked and stop: leave out tools, services, and steps the request does not need, and never hand the person a check you could run. Send nothing outside the session, such as a message to another session or a service, unless a task step says to.
|
|
39
|
+
8. **Run parallel sessions in separate worktrees, on tasks that touch different files.** Start each with `claude --worktree <name>`: a worktree is its own checkout on its own branch. Tasks that share files run in one session, one after another. Start with two or three sessions, and add one only while you can review every stream properly.
|
|
38
40
|
|
|
39
41
|
## Things Claude gets wrong
|
|
40
42
|
|
|
41
43
|
When Claude makes a mistake twice, add the correction here.
|
|
42
44
|
|
|
43
|
-
- **Production gate**: `.agents/hooks/agent-production-gate.sh` blocks a shell command that deploys to `prod`, runs a Railway CLI command that names `prod`, or pushes a release tag, unless a release manager started the session with `RELEASE_APPROVAL` set. Report what is ready to promote instead. When a gated command appears only inside a message, write the text to a file with your file-editing tool, not a shell heredoc, and pass it with `git commit -F <file>` or `gh pr create --body-file <file>`. The gate reads only shell commands, so an MCP tool or a Railway command without `-e` or `--environment` passes it.
|
|
45
|
+
- **Production gate**: `.agents/hooks/agent-production-gate.sh` blocks a shell command that deploys to `prod`, runs a Railway CLI command that names `prod`, or pushes a release tag, unless a release manager started the session with `RELEASE_APPROVAL` set. Any value lifts the gate except an empty value, `0`, `false`, and `no`, in any letter case. Report what is ready to promote instead. When a gated command appears only inside a message, write the text to a file with your file-editing tool, not a shell heredoc, and pass it with `git commit -F <file>` or `gh pr create --body-file <file>`. The gate reads only shell commands, so an MCP tool or a Railway command without `-e` or `--environment` passes it.
|
|
46
|
+
- **Issues**: open an issue only to hand work to another person, never to give a pull request a number to close. A pull request closes an issue that already exists with `Closes #<issue>`.
|
|
47
|
+
- **What belongs in the repository**: files, commit messages, and pull requests hold the change, its reason, and the checks. Write no date, log, history, mistake count, token figure, or session note into a file.
|
|
48
|
+
- **Sourced requirements**: add a requirement to an intent, spec, or plan only when a person decided it or a named source says it. This includes a requirement a review bot suggests. When no person decided it and no source says it, leave it out and answer the thread with that.
|
|
@@ -8,7 +8,7 @@ Use this guide to prepare changes to this repository.
|
|
|
8
8
|
- Change the Node.js version in `.nvmrc` and the `Dockerfile` together. Dependabot updates only the `Dockerfile`.
|
|
9
9
|
- Install pnpm once with `npm install --global pnpm`. It switches to the version declared by `package.json#packageManager` automatically.
|
|
10
10
|
- Use Claude Code v2.1.295 or later. It reads `CLAUDE.md`, which imports `AGENTS.md`, and supports the `onFailure` field the agent hooks use.
|
|
11
|
-
- Install gitleaks 8.
|
|
11
|
+
- Install gitleaks 8.21 or later, which the `pre-commit` hook runs, and jq, which the agent hooks and the `pre-push` hook (`pnpm gates:check`) need: `brew install gitleaks jq` on macOS, or install them from each project's releases on Linux.
|
|
12
12
|
|
|
13
13
|
From the repository root:
|
|
14
14
|
|
|
@@ -35,8 +35,9 @@ Run the narrowest check that covers the change while you work. Git hooks run the
|
|
|
35
35
|
| `pre-merge-commit` | blocks merge commits on `main` |
|
|
36
36
|
| `pre-push` | blocks pushes to `main` except the push that creates it, then `pnpm check`: the static checks, the unit tests related to your changes, and the production build |
|
|
37
37
|
|
|
38
|
-
- **Scans:** CI also runs coverage, the build, the container image, and the secret, SAST, OSV, CodeQL, dependency-review, and OpenSSF Scorecard scans. Dependabot and OSV-Scanner report vulnerable dependencies.
|
|
39
|
-
- **Coverage:** CI requires 95% line coverage on changed lines in `src/`, except `main.ts`, which
|
|
38
|
+
- **Scans:** CI also runs coverage, the build, the container image, and the secret, SAST, OSV, CodeQL, dependency-review, and OpenSSF Scorecard scans. CodeQL, dependency-review, and Scorecard run on public repositories, and on private ones when the `CODE_SCANNING` repository variable is `true`. Dependabot and OSV-Scanner report vulnerable dependencies.
|
|
39
|
+
- **Coverage:** CI requires 95% line coverage on changed lines in `src/`, except `main.ts`, which starts the server and handles the shutdown signals. Keep other logic out of it, as `src/port.ts` and `src/server.ts` do.
|
|
40
|
+
- **Agent evals:** run `pnpm evals:run` after you change `AGENTS.md`, a skill under `.agents/skills/`, or a hook under `.agents/hooks/`, and add a case name to run one case. It runs the cases in `.agents/skill-evals/` with Claude Code on your own Claude login, so it spends your Claude usage, and it is not part of `pnpm verify`.
|
|
40
41
|
|
|
41
42
|
Run `pnpm verify` for repository changes.
|
|
42
43
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Runs on any OCI platform (Railway, Fly.io, Cloud Run). The platform sets `PORT`.
|
|
2
2
|
FROM \
|
|
3
|
-
node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 \
|
|
3
|
+
node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 \
|
|
4
4
|
AS base
|
|
5
5
|
WORKDIR /app
|
|
6
6
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
@@ -16,7 +16,7 @@ FROM base AS prod-deps
|
|
|
16
16
|
RUN pnpm install --frozen-lockfile --ignore-scripts --prod
|
|
17
17
|
|
|
18
18
|
FROM \
|
|
19
|
-
node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
|
|
19
|
+
node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
|
|
20
20
|
ENV NODE_ENV=production
|
|
21
21
|
WORKDIR /app
|
|
22
22
|
# Apply Alpine security fixes released after the base image, and drop npm, corepack, and yarn: the app never runs them, and their bundled dependencies carry their own CVEs.
|
|
@@ -33,5 +33,5 @@ COPY package.json ./
|
|
|
33
33
|
COPY --from=prod-deps /app/node_modules ./node_modules
|
|
34
34
|
COPY --from=build /app/dist ./dist
|
|
35
35
|
USER 1000
|
|
36
|
-
HEALTHCHECK --interval=30s --timeout=5s CMD ["node", "-e", "fetch('http://127.0.0.1:' +
|
|
36
|
+
HEALTHCHECK --interval=30s --timeout=5s CMD ["node", "-e", "fetch('http://127.0.0.1:' + process.env.PORT + '/health').then(response => process.exit(response.ok ? 0 : 1), () => process.exit(1))"]
|
|
37
37
|
CMD ["node", "dist/main.js"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# next-friday-template-nodejs
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Node.js HTTP service without a framework.
|
|
4
4
|
|
|
5
5
|
## Getting started
|
|
6
6
|
|
|
@@ -22,17 +22,17 @@ Follow [SETUP.md](SETUP.md) in order. It sets up the repository, the reviews, an
|
|
|
22
22
|
| :---------------- | :------------------------------------------------------------------------------------------------ |
|
|
23
23
|
| `pnpm start:dev` | Start in watch mode from `src/main.ts`; loads `.env` when present |
|
|
24
24
|
| `pnpm build` | Compile to `dist/` |
|
|
25
|
-
| `pnpm start` |
|
|
25
|
+
| `pnpm start` | Build, then run `dist/main.js` once; loads `.env` when present |
|
|
26
26
|
| `pnpm start:prod` | Run `dist/main.js`; the environment sets `PORT` |
|
|
27
27
|
| `pnpm test` | Run tests (`src/**/*.test.ts`) |
|
|
28
28
|
| `pnpm check` | Run the static checks, the tests for changed code, and the production build (the `pre-push` hook) |
|
|
29
29
|
| `pnpm verify` | Run the static checks, all tests with coverage, and the production build |
|
|
30
30
|
|
|
31
|
-
CI also runs the build, the container image scan, and the security scans, including CodeQL, dependency review, and OpenSSF Scorecard. CodeQL and Scorecard run on public repositories, and on private ones when the `CODE_SCANNING` repository variable is `true`.
|
|
31
|
+
CI also runs the build, the container image scan, and the security scans, including CodeQL, dependency review, and OpenSSF Scorecard. CodeQL, dependency review, and Scorecard run on public repositories, and on private ones when the `CODE_SCANNING` repository variable is `true`.
|
|
32
32
|
|
|
33
33
|
## Container
|
|
34
34
|
|
|
35
|
-
The `Dockerfile` builds a production image that runs as
|
|
35
|
+
The `Dockerfile` builds a production image that runs as a non-root user (UID 1000). The platform must set `PORT`; Railway sets it automatically. The build needs `pnpm-lock.yaml`, so run `pnpm install` once before the first `docker build`.
|
|
36
36
|
|
|
37
37
|
```sh
|
|
38
38
|
docker build -t app .
|