@next-friday/create-app 9.1.1 → 9.2.1
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 +14 -10
- 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 +11 -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/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 +11 -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 +70 -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/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/build-plans-and-waits-for-the-engineer/case.yaml +67 -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/prompt.md +10 -0
- package/templates/base/.agents/skill-evals/sdlc/deploy-stops-at-the-production-gate/case.yaml +7 -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/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/drafts-intent-and-waits-for-yes/case.yaml +12 -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/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 +33 -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/prompt.md +8 -0
- package/templates/base/.agents/skill-evals/sdlc/interviews-before-writing-intent/case.yaml +11 -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/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 +11 -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/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 +10 -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.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 +41 -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/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 +11 -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/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 +41 -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/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 +10 -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/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 +9 -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/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 +10 -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/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 +14 -9
- package/templates/base/.agents/skills/sdlc/playbooks/deploy.md +2 -2
- package/templates/base/.agents/skills/sdlc/playbooks/design.md +3 -3
- package/templates/base/.agents/skills/sdlc/playbooks/fix.md +23 -0
- package/templates/base/.agents/skills/sdlc/playbooks/maintain.md +3 -4
- package/templates/base/.agents/skills/sdlc/playbooks/open-pr.md +3 -3
- package/templates/base/.agents/skills/sdlc/playbooks/plan.md +3 -3
- package/templates/base/.agents/skills/sdlc/playbooks/review.md +2 -2
- package/templates/base/.agents/skills/sdlc-help/SKILL.md +4 -2
- 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 +14 -9
- package/templates/base/.claude/skills/sdlc/playbooks/deploy.md +2 -2
- package/templates/base/.claude/skills/sdlc/playbooks/design.md +3 -3
- package/templates/base/.claude/skills/sdlc/playbooks/fix.md +23 -0
- package/templates/base/.claude/skills/sdlc/playbooks/maintain.md +3 -4
- package/templates/base/.claude/skills/sdlc/playbooks/open-pr.md +3 -3
- package/templates/base/.claude/skills/sdlc/playbooks/plan.md +3 -3
- package/templates/base/.claude/skills/sdlc/playbooks/review.md +2 -2
- package/templates/base/.claude/skills/sdlc-help/SKILL.md +4 -2
- 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 +14 -9
- package/templates/base/.cursor/skills/sdlc/playbooks/deploy.md +2 -2
- package/templates/base/.cursor/skills/sdlc/playbooks/design.md +3 -3
- package/templates/base/.cursor/skills/sdlc/playbooks/fix.md +23 -0
- package/templates/base/.cursor/skills/sdlc/playbooks/maintain.md +3 -4
- package/templates/base/.cursor/skills/sdlc/playbooks/open-pr.md +3 -3
- package/templates/base/.cursor/skills/sdlc/playbooks/plan.md +3 -3
- package/templates/base/.cursor/skills/sdlc/playbooks/review.md +2 -2
- package/templates/base/.cursor/skills/sdlc-help/SKILL.md +4 -2
- 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 +265 -226
- 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 +1197 -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 +17 -13
- 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 +21 -19
- 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 +17 -13
- 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 +15 -14
- 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 +17 -12
- 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 +13 -11
- 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 +22 -18
- 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 +17 -15
- 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 +22 -18
- 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 +9 -9
- 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 +12 -11
- 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 +16 -16
- 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
|
@@ -15,10 +15,6 @@ type SubagentConfig = {
|
|
|
15
15
|
const sourceDirectory = ".agents/rules";
|
|
16
16
|
const configPath = ".agents/rules.json";
|
|
17
17
|
|
|
18
|
-
const claudeExtras: Record<string, string> = {
|
|
19
|
-
"agents-guide.md": "@../../AGENTS.md\n",
|
|
20
|
-
};
|
|
21
|
-
|
|
22
18
|
/**
|
|
23
19
|
* List the names of files with an extension in a directory.
|
|
24
20
|
* @param directory Directory to read.
|
|
@@ -87,10 +83,6 @@ for (const name of configNames) {
|
|
|
87
83
|
expected.set(path.join(cursorDirectory, `${name}.mdc`), renderCursorRule(rule, body));
|
|
88
84
|
}
|
|
89
85
|
|
|
90
|
-
for (const [file, content] of Object.entries(claudeExtras)) {
|
|
91
|
-
expected.set(path.join(claudeDirectory, file), content);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
86
|
const skillSourceDirectory = ".agents/skills";
|
|
95
87
|
const skillDirectories = [".claude/skills", ".cursor/skills"];
|
|
96
88
|
const subagentSourceDirectory = ".agents/agents";
|
|
@@ -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
|
|
@@ -170,6 +166,59 @@ jobs:
|
|
|
170
166
|
environment: dev
|
|
171
167
|
commit_sha: ${{ github.sha }}
|
|
172
168
|
|
|
169
|
+
triage:
|
|
170
|
+
name: Triage failed build
|
|
171
|
+
needs:
|
|
172
|
+
- changes
|
|
173
|
+
- checks
|
|
174
|
+
- image
|
|
175
|
+
if: failure() && vars.CLAUDE_CI_ENABLED == 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
|
|
176
|
+
runs-on: ubuntu-latest
|
|
177
|
+
timeout-minutes: 15
|
|
178
|
+
permissions:
|
|
179
|
+
actions: read # Needed to read the logs of the failed jobs.
|
|
180
|
+
id-token: write # Needed to authenticate the Claude GitHub App with the workflow's OIDC token.
|
|
181
|
+
pull-requests: write # Needed to post the summary on the pull request.
|
|
182
|
+
steps:
|
|
183
|
+
- name: Require a Claude credential
|
|
184
|
+
env:
|
|
185
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
186
|
+
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
187
|
+
run: |
|
|
188
|
+
[[ -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; }
|
|
189
|
+
- name: Collect the build log
|
|
190
|
+
env:
|
|
191
|
+
GH_TOKEN: ${{ github.token }}
|
|
192
|
+
REPOSITORY: ${{ github.repository }}
|
|
193
|
+
RUN_ID: ${{ github.run_id }}
|
|
194
|
+
run: |
|
|
195
|
+
mkdir -p out
|
|
196
|
+
for job in $(gh api "repos/$REPOSITORY/actions/runs/$RUN_ID/jobs" --paginate --jq '.jobs[] | select(.conclusion == "failure") | .id'); do
|
|
197
|
+
gh api --allow-escape-sequences "repos/$REPOSITORY/actions/jobs/$job/logs" >> out/build.log
|
|
198
|
+
done
|
|
199
|
+
- name: Triage failed build
|
|
200
|
+
id: triage
|
|
201
|
+
uses: anthropics/claude-code-action@61a9c274fa7110a66dfafc1bbbced03833eb25fe # v1.0.269
|
|
202
|
+
with:
|
|
203
|
+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
204
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
205
|
+
prompt: >
|
|
206
|
+
Read the build log at out/build.log. Identify the most
|
|
207
|
+
likely cause, say whether the failure looks flaky or real, and write a
|
|
208
|
+
three-line summary for the PR thread.
|
|
209
|
+
claude_args: >-
|
|
210
|
+
--model claude-haiku-5-5
|
|
211
|
+
--max-turns 5
|
|
212
|
+
--allowedTools "Read"
|
|
213
|
+
--json-schema '{"type":"object","properties":{"summary":{"type":"string"}},"required":["summary"]}'
|
|
214
|
+
- name: Post the summary
|
|
215
|
+
env:
|
|
216
|
+
GH_TOKEN: ${{ github.token }}
|
|
217
|
+
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
218
|
+
REPOSITORY: ${{ github.repository }}
|
|
219
|
+
SUMMARY: ${{ fromJSON(steps.triage.outputs.structured_output).summary }}
|
|
220
|
+
run: gh pr comment "$PR_NUMBER" --repo "$REPOSITORY" --body "$SUMMARY"
|
|
221
|
+
|
|
173
222
|
ci:
|
|
174
223
|
name: All Checks
|
|
175
224
|
if: always()
|
|
@@ -4,21 +4,21 @@ NestJS HTTP API in TypeScript on pnpm and Node.js `>=24.15.0 <25`.
|
|
|
4
4
|
|
|
5
5
|
## Commands
|
|
6
6
|
|
|
7
|
-
| Task | Command |
|
|
8
|
-
| :-------------------------- | :-------------------------------------------------- |
|
|
9
|
-
| Start with reload | `pnpm start:dev` |
|
|
10
|
-
| One test | `pnpm vitest run src/port.test.ts -t "<test name>"` |
|
|
11
|
-
| Unit tests | `pnpm test`, or `pnpm test:coverage` |
|
|
12
|
-
| End-to-end tests | `pnpm test:e2e` |
|
|
13
|
-
| What `pre-push` runs | `pnpm check` |
|
|
14
|
-
| Every check | `pnpm verify` |
|
|
15
|
-
| Render rules after a change | `pnpm rules:sync` |
|
|
7
|
+
| Task | Command | Healthy output |
|
|
8
|
+
| :-------------------------- | :-------------------------------------------------- | :------------------------------------------------------- |
|
|
9
|
+
| Start with reload | `pnpm start:dev` | `Nest application successfully started` |
|
|
10
|
+
| One test | `pnpm vitest run src/port.test.ts -t "<test name>"` | `Tests 1 passed \| 9 skipped (10)` |
|
|
11
|
+
| Unit tests | `pnpm test`, or `pnpm test:coverage` | `Tests 12 passed (12)` |
|
|
12
|
+
| End-to-end tests | `pnpm test:e2e` | `Tests 2 passed (2)` |
|
|
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.` |
|
|
16
16
|
|
|
17
17
|
## Verifying your work
|
|
18
18
|
|
|
19
19
|
- Build: `pnpm build` (prints nothing after `$ tsc -p tsconfig.build.json`)
|
|
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,13 +33,17 @@ Run all three before reporting any task complete, and paste the output. `pnpm ve
|
|
|
33
33
|
2. **Read configuration from environment variables and fail when one is missing**, as `parsePort` does. Document each variable in `.env.example`.
|
|
34
34
|
3. **Log through Nest's `Logger`.** It goes to the `ConsoleLogger` set in `src/main.ts`.
|
|
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
|
-
8. **Write replies a person can check.**
|
|
39
|
+
8. **Write replies a person can check.** 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
|
-
- **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.
|
|
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. 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.
|
|
47
|
+
- **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>`.
|
|
48
|
+
- **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.
|
|
49
|
+
- **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,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 endpoints. CI runs it on every pull request that is ready for review and changes code.
|
|
40
40
|
- **Coverage:** CI requires 95% line coverage on changed lines in `src/`, except `main.ts` and `*.module.ts`, which hold only wiring. Keep logic out of them, as `src/port.ts` does for `main.ts`. CI does not gate branch coverage, because NestJS decorators emit metadata branches that never run.
|
|
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
|
-
# Runs on any OCI platform (Railway,
|
|
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-nestjs
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
NestJS HTTP API.
|
|
4
4
|
|
|
5
5
|
## Getting started
|
|
6
6
|
|
|
@@ -28,21 +28,19 @@ Follow [SETUP.md](SETUP.md) in order. It sets up the repository, the reviews, an
|
|
|
28
28
|
| `pnpm test` | Run unit tests (`src/**/*.test.ts`) |
|
|
29
29
|
| `pnpm test:e2e` | Run end-to-end tests (`test/**/*.e2e.test.ts`) |
|
|
30
30
|
| `pnpm check` | Run the static checks, the unit tests for changed code, and the production build (the `pre-push` hook) |
|
|
31
|
-
| `pnpm verify` | Run the static checks, all unit tests with coverage, and the production build
|
|
31
|
+
| `pnpm verify` | Run the static checks, all unit tests with coverage, the end-to-end tests, and the production build |
|
|
32
32
|
|
|
33
|
-
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 and Scorecard run on public repositories, and on private ones when the `CODE_SCANNING` repository variable is `true`.
|
|
33
|
+
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`.
|
|
34
34
|
|
|
35
35
|
## Container
|
|
36
36
|
|
|
37
|
-
The `Dockerfile` builds a production image that runs as
|
|
37
|
+
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`.
|
|
38
38
|
|
|
39
39
|
```sh
|
|
40
40
|
docker build -t app .
|
|
41
41
|
docker run --env PORT=3000 --publish 3000:3000 app
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
On Vercel, the zero-configuration NestJS preset takes precedence over the `Dockerfile`. Set the project framework to Container to use the image, and set `PORT` in the project settings.
|
|
45
|
-
|
|
46
44
|
## Deploy
|
|
47
45
|
|
|
48
46
|
`.github/workflows/deploy.yml` deploys the `Dockerfile` to Railway and promotes one commit through `dev`, `uat`, and `prod`. `railway.json` sets the Railway health check to `/health`. The workflow stays off until you configure it:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "next-friday-template-nestjs",
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"private": true,
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "NestJS HTTP API.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/next-friday/next-friday-template-nestjs.git"
|
|
@@ -11,60 +11,61 @@
|
|
|
11
11
|
"author": "Next Friday",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"scripts": {
|
|
14
|
+
"bands:check": "node scripts/check-bands.ts",
|
|
14
15
|
"build": "tsc -p tsconfig.build.json",
|
|
15
16
|
"check": "pnpm verify:static && pnpm test:changed && pnpm build",
|
|
16
|
-
"clean": "rm -rf dist coverage
|
|
17
|
+
"clean": "rm -rf dist coverage .eslintcache node_modules/.cache",
|
|
17
18
|
"debug:build": "tsc -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
18
|
-
"debug:serve": "node --env-file-if-exists=.env --inspect --watch dist/main",
|
|
19
|
+
"debug:serve": "node --env-file-if-exists=.env --inspect --watch dist/main.js",
|
|
19
20
|
"depcruise": "depcruise --config .dependency-cruiser.json src test eslint.config.ts vitest.config.ts vitest.e2e.config.ts",
|
|
20
21
|
"dev:build": "tsc -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
21
|
-
"dev:serve": "node --env-file-if-exists=.env --watch dist/main",
|
|
22
|
+
"dev:serve": "node --env-file-if-exists=.env --watch dist/main.js",
|
|
23
|
+
"evals:run": "node scripts/run-agent-evals.ts",
|
|
22
24
|
"format": "prettier --write --cache .",
|
|
23
25
|
"format:check": "prettier --check --cache . && editorconfig-checker",
|
|
24
26
|
"gates:check": "node scripts/check-agent-gates.ts",
|
|
25
|
-
"human-gates:check": "node scripts/check-human-gates.ts",
|
|
26
|
-
"intent:check": "node scripts/check-intent.ts",
|
|
27
27
|
"knip": "knip",
|
|
28
28
|
"lint": "eslint . --fix --cache --max-warnings=0 --no-inline-config",
|
|
29
29
|
"lint:check": "eslint . --cache --max-warnings=0 --no-inline-config",
|
|
30
|
-
"
|
|
30
|
+
"loop:measure": "node scripts/measure-loop.ts",
|
|
31
|
+
"plan:check": "node scripts/check-plan.ts",
|
|
31
32
|
"prepare": "husky",
|
|
32
33
|
"rules:check": "node scripts/sync-agent-rules.ts --check",
|
|
33
34
|
"rules:sync": "node scripts/sync-agent-rules.ts",
|
|
34
35
|
"sort-package-json": "sort-package-json package.json",
|
|
35
36
|
"sort-package-json:check": "sort-package-json --check package.json",
|
|
36
|
-
"start": "pnpm build && node --env-file-if-exists=.env dist/main",
|
|
37
|
+
"start": "pnpm build && node --env-file-if-exists=.env dist/main.js",
|
|
37
38
|
"start:debug": "pnpm build && pnpm run \"/^debug:/\"",
|
|
38
39
|
"start:dev": "pnpm build && pnpm run \"/^dev:/\"",
|
|
39
|
-
"start:prod": "node dist/main",
|
|
40
|
-
"suppressions:check": "bash .agents/hooks/agent-suppression-gate.sh --repo",
|
|
40
|
+
"start:prod": "node dist/main.js",
|
|
41
41
|
"test": "vitest run --passWithNoTests",
|
|
42
42
|
"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",
|
|
43
43
|
"test:coverage": "vitest run --coverage --passWithNoTests",
|
|
44
44
|
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
45
45
|
"test:watch": "vitest",
|
|
46
46
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
47
|
-
"verify": "pnpm verify:static && pnpm test:coverage && pnpm build",
|
|
48
|
-
"verify:static": "pnpm
|
|
47
|
+
"verify": "pnpm verify:static && pnpm test:coverage && pnpm test:e2e && pnpm build",
|
|
48
|
+
"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"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@nestjs/common": "12.3.
|
|
52
|
-
"@nestjs/core": "12.3.
|
|
53
|
-
"@nestjs/platform-express": "12.3.
|
|
51
|
+
"@nestjs/common": "12.3.3",
|
|
52
|
+
"@nestjs/core": "12.3.3",
|
|
53
|
+
"@nestjs/platform-express": "12.3.3",
|
|
54
54
|
"@nestjs/terminus": "12.1.0",
|
|
55
55
|
"reflect-metadata": "0.2.2",
|
|
56
56
|
"rxjs": "7.8.2"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@commitlint/cli": "21.2.4",
|
|
60
|
-
"@nestjs/testing": "12.3.
|
|
60
|
+
"@nestjs/testing": "12.3.3",
|
|
61
61
|
"@next-friday/commitlint-config-friday": "4.0.0",
|
|
62
62
|
"@next-friday/eslint-config-friday": "5.1.0",
|
|
63
63
|
"@next-friday/prettier-config-friday": "4.0.0",
|
|
64
|
+
"@swc/core": "1.16.22",
|
|
64
65
|
"@types/node": "26.6.6",
|
|
65
66
|
"@types/supertest": "7.2.1",
|
|
66
|
-
"@vitest/coverage-v8": "5.0
|
|
67
|
-
"dependency-cruiser": "18.7.
|
|
67
|
+
"@vitest/coverage-v8": "5.1.0",
|
|
68
|
+
"dependency-cruiser": "18.7.2",
|
|
68
69
|
"editorconfig-checker": "7.0.0",
|
|
69
70
|
"eslint": "10.14.0",
|
|
70
71
|
"fast-check": "4.10.2",
|
|
@@ -76,7 +77,8 @@
|
|
|
76
77
|
"sort-package-json": "4.1.0",
|
|
77
78
|
"supertest": "7.3.1",
|
|
78
79
|
"typescript": "7.0.2",
|
|
79
|
-
"vitest": "5.0
|
|
80
|
+
"vitest": "5.1.0",
|
|
81
|
+
"yaml": "2.9.1"
|
|
80
82
|
},
|
|
81
83
|
"packageManager": "pnpm@12.6.0+sha512.3ef68f951cb111ac204b4a5a16f0b2ddf0da56a96e0413e81d855d9f0b55ef926714709028e1cd00c405c2c5fb7b9e8ec4dc46777c805d0373c2f2ff00fd20ec",
|
|
82
84
|
"engines": {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "./tsconfig.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"rootDir": "./src"
|
|
5
|
-
"types": ["node"]
|
|
4
|
+
"rootDir": "./src"
|
|
6
5
|
},
|
|
7
6
|
"include": ["src"],
|
|
8
|
-
"exclude": ["node_modules", "
|
|
7
|
+
"exclude": ["node_modules", "dist", "**/*.test.ts"]
|
|
9
8
|
}
|
|
@@ -6,14 +6,12 @@
|
|
|
6
6
|
"removeComments": true,
|
|
7
7
|
"emitDecoratorMetadata": true,
|
|
8
8
|
"experimentalDecorators": true,
|
|
9
|
-
"incremental": true,
|
|
10
|
-
"resolveJsonModule": true,
|
|
11
9
|
"skipLibCheck": true,
|
|
12
10
|
"sourceMap": true,
|
|
13
11
|
"strictPropertyInitialization": false,
|
|
14
12
|
"outDir": "./dist",
|
|
15
13
|
"rootDir": ".",
|
|
16
|
-
"types": ["
|
|
14
|
+
"types": ["node"]
|
|
17
15
|
},
|
|
18
16
|
"include": ["**/*.ts"],
|
|
19
17
|
"exclude": ["node_modules", "dist"]
|
|
@@ -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
|
|
@@ -176,6 +172,59 @@ jobs:
|
|
|
176
172
|
environment: dev
|
|
177
173
|
commit_sha: ${{ github.sha }}
|
|
178
174
|
|
|
175
|
+
triage:
|
|
176
|
+
name: Triage failed build
|
|
177
|
+
needs:
|
|
178
|
+
- changes
|
|
179
|
+
- checks
|
|
180
|
+
- image
|
|
181
|
+
if: failure() && vars.CLAUDE_CI_ENABLED == 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
|
|
182
|
+
runs-on: ubuntu-latest
|
|
183
|
+
timeout-minutes: 15
|
|
184
|
+
permissions:
|
|
185
|
+
actions: read # Needed to read the logs of the failed jobs.
|
|
186
|
+
id-token: write # Needed to authenticate the Claude GitHub App with the workflow's OIDC token.
|
|
187
|
+
pull-requests: write # Needed to post the summary on the pull request.
|
|
188
|
+
steps:
|
|
189
|
+
- name: Require a Claude credential
|
|
190
|
+
env:
|
|
191
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
192
|
+
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
193
|
+
run: |
|
|
194
|
+
[[ -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; }
|
|
195
|
+
- name: Collect the build log
|
|
196
|
+
env:
|
|
197
|
+
GH_TOKEN: ${{ github.token }}
|
|
198
|
+
REPOSITORY: ${{ github.repository }}
|
|
199
|
+
RUN_ID: ${{ github.run_id }}
|
|
200
|
+
run: |
|
|
201
|
+
mkdir -p out
|
|
202
|
+
for job in $(gh api "repos/$REPOSITORY/actions/runs/$RUN_ID/jobs" --paginate --jq '.jobs[] | select(.conclusion == "failure") | .id'); do
|
|
203
|
+
gh api --allow-escape-sequences "repos/$REPOSITORY/actions/jobs/$job/logs" >> out/build.log
|
|
204
|
+
done
|
|
205
|
+
- name: Triage failed build
|
|
206
|
+
id: triage
|
|
207
|
+
uses: anthropics/claude-code-action@61a9c274fa7110a66dfafc1bbbced03833eb25fe # v1.0.269
|
|
208
|
+
with:
|
|
209
|
+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
210
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
211
|
+
prompt: >
|
|
212
|
+
Read the build log at out/build.log. Identify the most
|
|
213
|
+
likely cause, say whether the failure looks flaky or real, and write a
|
|
214
|
+
three-line summary for the PR thread.
|
|
215
|
+
claude_args: >-
|
|
216
|
+
--model claude-haiku-5-5
|
|
217
|
+
--max-turns 5
|
|
218
|
+
--allowedTools "Read"
|
|
219
|
+
--json-schema '{"type":"object","properties":{"summary":{"type":"string"}},"required":["summary"]}'
|
|
220
|
+
- name: Post the summary
|
|
221
|
+
env:
|
|
222
|
+
GH_TOKEN: ${{ github.token }}
|
|
223
|
+
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
224
|
+
REPOSITORY: ${{ github.repository }}
|
|
225
|
+
SUMMARY: ${{ fromJSON(steps.triage.outputs.structured_output).summary }}
|
|
226
|
+
run: gh pr comment "$PR_NUMBER" --repo "$REPOSITORY" --body "$SUMMARY"
|
|
227
|
+
|
|
179
228
|
ci:
|
|
180
229
|
name: All Checks
|
|
181
230
|
if: always()
|