@next-friday/create-app 3.0.0 → 4.0.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.
Files changed (54) hide show
  1. package/package.json +1 -1
  2. package/templates/base/{.cursor/rules/git-workflow.mdc → .agents/skills/git-workflow/SKILL.md} +2 -2
  3. package/templates/base/{.cursor/rules/script-driven-changes.mdc → .agents/skills/script-driven-changes/SKILL.md} +2 -2
  4. package/templates/base/{.agents/rules/git-workflow.md → .claude/skills/git-workflow/SKILL.md} +5 -0
  5. package/templates/base/{.agents/rules/script-driven-changes.md → .claude/skills/script-driven-changes/SKILL.md} +5 -0
  6. package/templates/base/.cursor/BUGBOT.md +2 -2
  7. package/templates/base/.cursor/skills/git-workflow/SKILL.md +15 -0
  8. package/templates/base/.cursor/skills/script-driven-changes/SKILL.md +12 -0
  9. package/templates/nestjs/.agents/rules.json +23 -9
  10. package/templates/nestjs/.claude/rules/constitution-changes.md +25 -0
  11. package/templates/nestjs/.claude/rules/diagnostics-and-error-handling.md +13 -0
  12. package/templates/nestjs/.claude/rules/structured-logging.md +9 -0
  13. package/templates/{base → nestjs}/.cursor/rules/constitution-changes.mdc +2 -1
  14. package/templates/{base → nestjs}/.cursor/rules/diagnostics-and-error-handling.mdc +2 -1
  15. package/templates/{base → nestjs}/.cursor/rules/structured-logging.mdc +2 -1
  16. package/templates/nestjs/Dockerfile +14 -4
  17. package/templates/nextjs/.agents/rules.json +23 -9
  18. package/templates/nextjs/.claude/rules/constitution-changes.md +25 -0
  19. package/templates/nextjs/.claude/rules/diagnostics-and-error-handling.md +15 -0
  20. package/templates/nextjs/.claude/rules/structured-logging.md +11 -0
  21. package/templates/nextjs/.cursor/rules/constitution-changes.mdc +11 -0
  22. package/templates/nextjs/.cursor/rules/diagnostics-and-error-handling.mdc +13 -0
  23. package/templates/nextjs/.cursor/rules/structured-logging.mdc +9 -0
  24. package/templates/nextjs/Dockerfile +14 -4
  25. package/templates/nodejs/.agents/rules.json +23 -9
  26. package/templates/nodejs/.claude/rules/constitution-changes.md +25 -0
  27. package/templates/nodejs/.claude/rules/diagnostics-and-error-handling.md +13 -0
  28. package/templates/nodejs/.claude/rules/structured-logging.md +9 -0
  29. package/templates/nodejs/.cursor/rules/constitution-changes.mdc +11 -0
  30. package/templates/nodejs/.cursor/rules/diagnostics-and-error-handling.mdc +13 -0
  31. package/templates/nodejs/.cursor/rules/structured-logging.mdc +9 -0
  32. package/templates/nodejs/Dockerfile +14 -4
  33. package/templates/payload/.agents/rules.json +23 -9
  34. package/templates/payload/.claude/rules/constitution-changes.md +25 -0
  35. package/templates/payload/.claude/rules/diagnostics-and-error-handling.md +15 -0
  36. package/templates/payload/.claude/rules/structured-logging.md +11 -0
  37. package/templates/payload/.cursor/rules/constitution-changes.mdc +11 -0
  38. package/templates/payload/.cursor/rules/diagnostics-and-error-handling.mdc +13 -0
  39. package/templates/payload/.cursor/rules/structured-logging.mdc +9 -0
  40. package/templates/payload/Dockerfile +14 -4
  41. package/templates/turborepo/.agents/rules.json +23 -9
  42. package/templates/turborepo/.claude/rules/constitution-changes.md +25 -0
  43. package/templates/turborepo/.claude/rules/diagnostics-and-error-handling.md +15 -0
  44. package/templates/turborepo/.claude/rules/structured-logging.md +11 -0
  45. package/templates/turborepo/.cursor/rules/constitution-changes.mdc +11 -0
  46. package/templates/turborepo/.cursor/rules/diagnostics-and-error-handling.mdc +13 -0
  47. package/templates/turborepo/.cursor/rules/structured-logging.mdc +9 -0
  48. package/templates/turborepo/apps/app/Dockerfile +14 -4
  49. package/templates/turborepo/apps/backoffice/Dockerfile +14 -4
  50. package/templates/base/.claude/rules/constitution-changes.md +0 -1
  51. package/templates/base/.claude/rules/diagnostics-and-error-handling.md +0 -1
  52. package/templates/base/.claude/rules/git-workflow.md +0 -1
  53. package/templates/base/.claude/rules/script-driven-changes.md +0 -1
  54. package/templates/base/.claude/rules/structured-logging.md +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-friday/create-app",
3
- "version": "3.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "Create a Next Friday project from a template.",
5
5
  "keywords": [
6
6
  "create",
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: "Git workflow: trunk-based branches, commits, and pull requests"
3
- alwaysApply: true
2
+ name: git-workflow
3
+ description: Trunk-based branches, commits, and pull requests. Use when creating a branch, committing, pushing, or opening, updating, or merging a pull request.
4
4
  ---
5
5
 
6
6
  # Git Workflow
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: "Scripts: apply a repeated edit across many files with a script"
3
- alwaysApply: true
2
+ name: script-driven-changes
3
+ description: Change many files with a script, not by hand. Use when a change repeats one pattern across more than a few files, or needs a one-off script.
4
4
  ---
5
5
 
6
6
  # Scripts
@@ -1,3 +1,8 @@
1
+ ---
2
+ name: git-workflow
3
+ description: Trunk-based branches, commits, and pull requests. Use when creating a branch, committing, pushing, or opening, updating, or merging a pull request.
4
+ ---
5
+
1
6
  # Git Workflow
2
7
 
3
8
  The repository uses trunk-based development.
@@ -1,3 +1,8 @@
1
+ ---
2
+ name: script-driven-changes
3
+ description: Change many files with a script, not by hand. Use when a change repeats one pattern across more than a few files, or needs a one-off script.
4
+ ---
5
+
1
6
  # Scripts
2
7
 
3
8
  When a change repeats one pattern across more than a few files, run a script. Derive facts from the toolchain (TypeScript compiler API, `git`), not by reading files by eye. Edit by hand when the change needs judgment in one place.
@@ -16,10 +16,10 @@ Review pull requests against the project's agent guide and rules:
16
16
  - [Test Admission](../.agents/rules/deterministic-testing.md)
17
17
  - [Diagnostics](../.agents/rules/diagnostics-and-error-handling.md)
18
18
  - [Evidence](../.agents/rules/evidence-before-claims.md)
19
- - [Git Workflow](../.agents/rules/git-workflow.md)
19
+ - [Git Workflow](../.agents/skills/git-workflow/SKILL.md)
20
20
  - [Findings](../.agents/rules/no-suppression.md)
21
21
  - [Platform and Library First](../.agents/rules/platform-and-library-first.md)
22
- - [Scripts](../.agents/rules/script-driven-changes.md)
22
+ - [Scripts](../.agents/skills/script-driven-changes/SKILL.md)
23
23
  - [Sibling Style](../.agents/rules/single-author-style.md)
24
24
  - [Logging](../.agents/rules/structured-logging.md)
25
25
  - [TypeScript-First](../.agents/rules/typescript-first.md)
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: git-workflow
3
+ description: Trunk-based branches, commits, and pull requests. Use when creating a branch, committing, pushing, or opening, updating, or merging a pull request.
4
+ ---
5
+
6
+ # Git Workflow
7
+
8
+ The repository uses trunk-based development.
9
+
10
+ - Branch from the latest `origin/main`, in a worktree or a new branch named `<type>/<short-description>`. `main` is the only long-lived branch. The Git hooks block commits and pushes on it, except the first commit and push that create `main` in a new repository.
11
+ - Write commit messages in the format that `@next-friday/commitlint-config-friday` defines. The `commit-msg` hook rejects anything else.
12
+ - When work ends in a pull request, push its branch and open the pull request ready for review without asking. CI skips drafts. Work that does not end in one, such as an investigation or a prototype, opens none.
13
+ - Fill the pull request body from `.github/pull_request_template.md`.
14
+ - After you open a pull request, report its URL and continue. Drive it to merge-ready only when the user asks, and watch the checks with `gh pr checks --watch`. Merge only when the user asks to merge, land, or ship. Merge with `--squash`, bottom-up for a stack.
15
+ - Rebase and `git push --force-with-lease` only branches you own.
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: script-driven-changes
3
+ description: Change many files with a script, not by hand. Use when a change repeats one pattern across more than a few files, or needs a one-off script.
4
+ ---
5
+
6
+ # Scripts
7
+
8
+ When a change repeats one pattern across more than a few files, run a script. Derive facts from the toolchain (TypeScript compiler API, `git`), not by reading files by eye. Edit by hand when the change needs judgment in one place.
9
+
10
+ Commit a script when a reviewer needs to rerun it or when the work outlives the session, and add it as a `package.json` script so knip counts it as an entry. Keep any other one-off script in a temporary directory outside the repository, and remove a committed script when its workflow ends. Fail on unmapped input. Back up before a destructive run.
11
+
12
+ Print summaries: counts, first errors. Verify what owned checks omit, such as the running app.
@@ -12,7 +12,25 @@
12
12
  "description": "Codebase hygiene: modify existing code instead of accumulating new code"
13
13
  },
14
14
  "constitution-changes": {
15
- "description": "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue"
15
+ "description": "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue",
16
+ "globs": [
17
+ ".agents/rules/**",
18
+ ".agents/rules.json",
19
+ ".agents/hooks/**",
20
+ ".claude/settings.json",
21
+ ".claude/rules/**",
22
+ ".cursor/rules/**",
23
+ ".cursor/hooks/**",
24
+ ".cursor/hooks.json",
25
+ "scripts/sync-agent-rules.ts",
26
+ "scripts/check-agent-gates.ts",
27
+ ".husky/**",
28
+ ".commitlintrc.json",
29
+ ".prettierrc.json",
30
+ "eslint.config.ts",
31
+ ".lintstagedrc.json",
32
+ ".gitleaks.toml"
33
+ ]
16
34
  },
17
35
  "current-state-authority": {
18
36
  "description": "Current state: implement from user requirements and the working tree"
@@ -32,28 +50,24 @@
32
50
  "globs": ["**/*.test.ts"]
33
51
  },
34
52
  "diagnostics-and-error-handling": {
35
- "description": "Diagnostics: fix runtime failures at the source and keep the root cause"
53
+ "description": "Diagnostics: fix runtime failures at the source and keep the root cause",
54
+ "globs": ["**/*.ts", "**/*.js"]
36
55
  },
37
56
  "evidence-before-claims": {
38
57
  "description": "Evidence: verify and cite a claim before stating or writing it"
39
58
  },
40
- "git-workflow": {
41
- "description": "Git workflow: trunk-based branches, commits, and pull requests"
42
- },
43
59
  "no-suppression": {
44
60
  "description": "Findings: fix scanner and linter reports without inline suppressions"
45
61
  },
46
62
  "platform-and-library-first": {
47
63
  "description": "Platform and library first: use built-in features, then maintained libraries, then custom code"
48
64
  },
49
- "script-driven-changes": {
50
- "description": "Scripts: apply a repeated edit across many files with a script"
51
- },
52
65
  "single-author-style": {
53
66
  "description": "Sibling style: match layout, naming, and composition in the same project"
54
67
  },
55
68
  "structured-logging": {
56
- "description": "Logging: log through a logging library in structured, durable records"
69
+ "description": "Logging: log through a logging library in structured, durable records",
70
+ "globs": ["**/*.ts", "**/*.js"]
57
71
  },
58
72
  "typescript-first": {
59
73
  "description": "TypeScript-first: write source, tests, and scripts as .ts",
@@ -0,0 +1,25 @@
1
+ ---
2
+ paths:
3
+ - ".agents/rules/**"
4
+ - ".agents/rules.json"
5
+ - ".agents/hooks/**"
6
+ - ".claude/settings.json"
7
+ - ".claude/rules/**"
8
+ - ".cursor/rules/**"
9
+ - ".cursor/hooks/**"
10
+ - ".cursor/hooks.json"
11
+ - "scripts/sync-agent-rules.ts"
12
+ - "scripts/check-agent-gates.ts"
13
+ - ".husky/**"
14
+ - ".commitlintrc.json"
15
+ - ".prettierrc.json"
16
+ - "eslint.config.ts"
17
+ - ".lintstagedrc.json"
18
+ - ".gitleaks.toml"
19
+ ---
20
+
21
+ # Constitution Changes
22
+
23
+ The constitution is the set of files that agent settings deny to agents: rules, hooks, lint, format, and commit configuration, and the agent settings themselves. It is company policy.
24
+
25
+ A developer changes the constitution through a dedicated issue, never inside a feature pull request. When a task needs a constitution change, propose it to the user, reference that issue, and wait for it to merge before the task depends on it.
@@ -0,0 +1,13 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.js"
5
+ ---
6
+
7
+ # Diagnostics
8
+
9
+ Resolve runtime failures at the source with the language's standard narrowing, validation, and error types. For missing third-party types, take upstream definitions or a narrow adapter in the established location.
10
+
11
+ Surface errors at the caller or process boundary with diagnostic context. Handle an error to add context, recover, or translate it at an application boundary. Retain the root cause through the language's exception mechanism.
12
+
13
+ Report unresolved type, declaration, or rule conflicts to the user. Findings follow `no-suppression.md`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.js"
5
+ ---
6
+
7
+ # Logging
8
+
9
+ Application code logs through the stack's logging library or the framework's logger, never `console.*`. Write structured records, and send them to a store that keeps them longer than the host does.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue"
3
- alwaysApply: true
3
+ globs: ".agents/rules/**,.agents/rules.json,.agents/hooks/**,.claude/settings.json,.claude/rules/**,.cursor/rules/**,.cursor/hooks/**,.cursor/hooks.json,scripts/sync-agent-rules.ts,scripts/check-agent-gates.ts,.husky/**,.commitlintrc.json,.prettierrc.json,eslint.config.ts,.lintstagedrc.json,.gitleaks.toml"
4
+ alwaysApply: false
4
5
  ---
5
6
 
6
7
  # Constitution Changes
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: "Diagnostics: fix runtime failures at the source and keep the root cause"
3
- alwaysApply: true
3
+ globs: "**/*.ts,**/*.js"
4
+ alwaysApply: false
4
5
  ---
5
6
 
6
7
  # Diagnostics
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: "Logging: log through a logging library in structured, durable records"
3
- alwaysApply: true
3
+ globs: "**/*.ts,**/*.js"
4
+ alwaysApply: false
4
5
  ---
5
6
 
6
7
  # Logging
@@ -1,8 +1,10 @@
1
1
  # Runs on any OCI platform (Railway, Vercel Container Runtime, Fly.io, Cloud Run). The platform sets `PORT`.
2
- FROM node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 AS base
2
+ FROM \
3
+ node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 \
4
+ AS base
3
5
  WORKDIR /app
4
6
  COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
5
- RUN npm install --global "pnpm@$(node --print 'require("./package.json").packageManager.split("+")[0].split("@")[1]')"
7
+ RUN corepack enable
6
8
 
7
9
  FROM base AS build
8
10
  RUN pnpm install --frozen-lockfile --ignore-scripts
@@ -13,12 +15,20 @@ RUN pnpm build
13
15
  FROM base AS prod-deps
14
16
  RUN pnpm install --frozen-lockfile --ignore-scripts --prod
15
17
 
16
- FROM node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
18
+ FROM \
19
+ node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
17
20
  ENV NODE_ENV=production
18
21
  WORKDIR /app
19
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.
20
23
  RUN apk upgrade --no-cache \
21
- && rm -rf /usr/local/lib/node_modules /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/corepack /usr/local/bin/yarn /usr/local/bin/yarnpkg /opt/yarn-*
24
+ && rm -rf \
25
+ /usr/local/lib/node_modules \
26
+ /usr/local/bin/npm \
27
+ /usr/local/bin/npx \
28
+ /usr/local/bin/corepack \
29
+ /usr/local/bin/yarn \
30
+ /usr/local/bin/yarnpkg \
31
+ /opt/yarn-*
22
32
  COPY package.json ./
23
33
  COPY --from=prod-deps /app/node_modules ./node_modules
24
34
  COPY --from=build /app/dist ./dist
@@ -12,7 +12,25 @@
12
12
  "description": "Codebase hygiene: modify existing code instead of accumulating new code"
13
13
  },
14
14
  "constitution-changes": {
15
- "description": "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue"
15
+ "description": "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue",
16
+ "globs": [
17
+ ".agents/rules/**",
18
+ ".agents/rules.json",
19
+ ".agents/hooks/**",
20
+ ".claude/settings.json",
21
+ ".claude/rules/**",
22
+ ".cursor/rules/**",
23
+ ".cursor/hooks/**",
24
+ ".cursor/hooks.json",
25
+ "scripts/sync-agent-rules.ts",
26
+ "scripts/check-agent-gates.ts",
27
+ ".husky/**",
28
+ ".commitlintrc.json",
29
+ "prettier.config.ts",
30
+ "eslint.config.ts",
31
+ ".lintstagedrc.json",
32
+ ".gitleaks.toml"
33
+ ]
16
34
  },
17
35
  "current-state-authority": {
18
36
  "description": "Current state: implement from user requirements and the working tree"
@@ -32,28 +50,24 @@
32
50
  "globs": ["**/*.test.ts", "**/*.test.tsx"]
33
51
  },
34
52
  "diagnostics-and-error-handling": {
35
- "description": "Diagnostics: fix runtime failures at the source and keep the root cause"
53
+ "description": "Diagnostics: fix runtime failures at the source and keep the root cause",
54
+ "globs": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]
36
55
  },
37
56
  "evidence-before-claims": {
38
57
  "description": "Evidence: verify and cite a claim before stating or writing it"
39
58
  },
40
- "git-workflow": {
41
- "description": "Git workflow: trunk-based branches, commits, and pull requests"
42
- },
43
59
  "no-suppression": {
44
60
  "description": "Findings: fix scanner and linter reports without inline suppressions"
45
61
  },
46
62
  "platform-and-library-first": {
47
63
  "description": "Platform and library first: use built-in features, then maintained libraries, then custom code"
48
64
  },
49
- "script-driven-changes": {
50
- "description": "Scripts: apply a repeated edit across many files with a script"
51
- },
52
65
  "single-author-style": {
53
66
  "description": "Sibling style: match layout, naming, and composition in the same project"
54
67
  },
55
68
  "structured-logging": {
56
- "description": "Logging: log through a logging library in structured, durable records"
69
+ "description": "Logging: log through a logging library in structured, durable records",
70
+ "globs": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]
57
71
  },
58
72
  "typescript-first": {
59
73
  "description": "TypeScript-first: write source, tests, and scripts as .ts or .tsx",
@@ -0,0 +1,25 @@
1
+ ---
2
+ paths:
3
+ - ".agents/rules/**"
4
+ - ".agents/rules.json"
5
+ - ".agents/hooks/**"
6
+ - ".claude/settings.json"
7
+ - ".claude/rules/**"
8
+ - ".cursor/rules/**"
9
+ - ".cursor/hooks/**"
10
+ - ".cursor/hooks.json"
11
+ - "scripts/sync-agent-rules.ts"
12
+ - "scripts/check-agent-gates.ts"
13
+ - ".husky/**"
14
+ - ".commitlintrc.json"
15
+ - "prettier.config.ts"
16
+ - "eslint.config.ts"
17
+ - ".lintstagedrc.json"
18
+ - ".gitleaks.toml"
19
+ ---
20
+
21
+ # Constitution Changes
22
+
23
+ The constitution is the set of files that agent settings deny to agents: rules, hooks, lint, format, and commit configuration, and the agent settings themselves. It is company policy.
24
+
25
+ A developer changes the constitution through a dedicated issue, never inside a feature pull request. When a task needs a constitution change, propose it to the user, reference that issue, and wait for it to merge before the task depends on it.
@@ -0,0 +1,15 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.tsx"
5
+ - "**/*.js"
6
+ - "**/*.jsx"
7
+ ---
8
+
9
+ # Diagnostics
10
+
11
+ Resolve runtime failures at the source with the language's standard narrowing, validation, and error types. For missing third-party types, take upstream definitions or a narrow adapter in the established location.
12
+
13
+ Surface errors at the caller or process boundary with diagnostic context. Handle an error to add context, recover, or translate it at an application boundary. Retain the root cause through the language's exception mechanism.
14
+
15
+ Report unresolved type, declaration, or rule conflicts to the user. Findings follow `no-suppression.md`.
@@ -0,0 +1,11 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.tsx"
5
+ - "**/*.js"
6
+ - "**/*.jsx"
7
+ ---
8
+
9
+ # Logging
10
+
11
+ Application code logs through the stack's logging library or the framework's logger, never `console.*`. Write structured records, and send them to a store that keeps them longer than the host does.
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue"
3
+ globs: ".agents/rules/**,.agents/rules.json,.agents/hooks/**,.claude/settings.json,.claude/rules/**,.cursor/rules/**,.cursor/hooks/**,.cursor/hooks.json,scripts/sync-agent-rules.ts,scripts/check-agent-gates.ts,.husky/**,.commitlintrc.json,prettier.config.ts,eslint.config.ts,.lintstagedrc.json,.gitleaks.toml"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Constitution Changes
8
+
9
+ The constitution is the set of files that agent settings deny to agents: rules, hooks, lint, format, and commit configuration, and the agent settings themselves. It is company policy.
10
+
11
+ A developer changes the constitution through a dedicated issue, never inside a feature pull request. When a task needs a constitution change, propose it to the user, reference that issue, and wait for it to merge before the task depends on it.
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: "Diagnostics: fix runtime failures at the source and keep the root cause"
3
+ globs: "**/*.ts,**/*.tsx,**/*.js,**/*.jsx"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Diagnostics
8
+
9
+ Resolve runtime failures at the source with the language's standard narrowing, validation, and error types. For missing third-party types, take upstream definitions or a narrow adapter in the established location.
10
+
11
+ Surface errors at the caller or process boundary with diagnostic context. Handle an error to add context, recover, or translate it at an application boundary. Retain the root cause through the language's exception mechanism.
12
+
13
+ Report unresolved type, declaration, or rule conflicts to the user. Findings follow `no-suppression.md`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: "Logging: log through a logging library in structured, durable records"
3
+ globs: "**/*.ts,**/*.tsx,**/*.js,**/*.jsx"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Logging
8
+
9
+ Application code logs through the stack's logging library or the framework's logger, never `console.*`. Write structured records, and send them to a store that keeps them longer than the host does.
@@ -1,20 +1,30 @@
1
1
  # Runs on any OCI platform (Railway, Fly.io, Cloud Run). On Vercel, deploy without it. The platform sets `PORT`.
2
- FROM node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 AS build
2
+ FROM \
3
+ node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 \
4
+ AS build
3
5
  ENV NEXT_TELEMETRY_DISABLED=1
4
6
  WORKDIR /app
5
7
  COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
6
- RUN npm install --global "pnpm@$(node --print 'require("./package.json").packageManager.split("+")[0].split("@")[1]')"
8
+ RUN corepack enable
7
9
  RUN pnpm install --frozen-lockfile --ignore-scripts
8
10
  COPY next.config.ts postcss.config.mjs tsconfig.json ./
9
11
  COPY app ./app
10
12
  RUN pnpm build
11
13
 
12
- FROM node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
14
+ FROM \
15
+ node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
13
16
  ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1 HOSTNAME=0.0.0.0
14
17
  WORKDIR /app
15
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.
16
19
  RUN apk upgrade --no-cache \
17
- && rm -rf /usr/local/lib/node_modules /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/corepack /usr/local/bin/yarn /usr/local/bin/yarnpkg /opt/yarn-*
20
+ && rm -rf \
21
+ /usr/local/lib/node_modules \
22
+ /usr/local/bin/npm \
23
+ /usr/local/bin/npx \
24
+ /usr/local/bin/corepack \
25
+ /usr/local/bin/yarn \
26
+ /usr/local/bin/yarnpkg \
27
+ /opt/yarn-*
18
28
  # Next.js writes .next/cache at runtime. Add `COPY --from=build --chown=node:node /app/public ./public` when the app has a public/ folder, and allow it in .dockerignore.
19
29
  COPY --from=build --chown=node:node /app/.next/standalone ./
20
30
  COPY --from=build --chown=node:node /app/.next/static ./.next/static
@@ -12,7 +12,25 @@
12
12
  "description": "Codebase hygiene: modify existing code instead of accumulating new code"
13
13
  },
14
14
  "constitution-changes": {
15
- "description": "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue"
15
+ "description": "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue",
16
+ "globs": [
17
+ ".agents/rules/**",
18
+ ".agents/rules.json",
19
+ ".agents/hooks/**",
20
+ ".claude/settings.json",
21
+ ".claude/rules/**",
22
+ ".cursor/rules/**",
23
+ ".cursor/hooks/**",
24
+ ".cursor/hooks.json",
25
+ "scripts/sync-agent-rules.ts",
26
+ "scripts/check-agent-gates.ts",
27
+ ".husky/**",
28
+ ".commitlintrc.json",
29
+ ".prettierrc.json",
30
+ "eslint.config.ts",
31
+ ".lintstagedrc.json",
32
+ ".gitleaks.toml"
33
+ ]
16
34
  },
17
35
  "current-state-authority": {
18
36
  "description": "Current state: implement from user requirements and the working tree"
@@ -32,28 +50,24 @@
32
50
  "globs": ["**/*.test.ts"]
33
51
  },
34
52
  "diagnostics-and-error-handling": {
35
- "description": "Diagnostics: fix runtime failures at the source and keep the root cause"
53
+ "description": "Diagnostics: fix runtime failures at the source and keep the root cause",
54
+ "globs": ["**/*.ts", "**/*.js"]
36
55
  },
37
56
  "evidence-before-claims": {
38
57
  "description": "Evidence: verify and cite a claim before stating or writing it"
39
58
  },
40
- "git-workflow": {
41
- "description": "Git workflow: trunk-based branches, commits, and pull requests"
42
- },
43
59
  "no-suppression": {
44
60
  "description": "Findings: fix scanner and linter reports without inline suppressions"
45
61
  },
46
62
  "platform-and-library-first": {
47
63
  "description": "Platform and library first: use built-in features, then maintained libraries, then custom code"
48
64
  },
49
- "script-driven-changes": {
50
- "description": "Scripts: apply a repeated edit across many files with a script"
51
- },
52
65
  "single-author-style": {
53
66
  "description": "Sibling style: match layout, naming, and composition in the same project"
54
67
  },
55
68
  "structured-logging": {
56
- "description": "Logging: log through a logging library in structured, durable records"
69
+ "description": "Logging: log through a logging library in structured, durable records",
70
+ "globs": ["**/*.ts", "**/*.js"]
57
71
  },
58
72
  "typescript-first": {
59
73
  "description": "TypeScript-first: write source, tests, and scripts as .ts",
@@ -0,0 +1,25 @@
1
+ ---
2
+ paths:
3
+ - ".agents/rules/**"
4
+ - ".agents/rules.json"
5
+ - ".agents/hooks/**"
6
+ - ".claude/settings.json"
7
+ - ".claude/rules/**"
8
+ - ".cursor/rules/**"
9
+ - ".cursor/hooks/**"
10
+ - ".cursor/hooks.json"
11
+ - "scripts/sync-agent-rules.ts"
12
+ - "scripts/check-agent-gates.ts"
13
+ - ".husky/**"
14
+ - ".commitlintrc.json"
15
+ - ".prettierrc.json"
16
+ - "eslint.config.ts"
17
+ - ".lintstagedrc.json"
18
+ - ".gitleaks.toml"
19
+ ---
20
+
21
+ # Constitution Changes
22
+
23
+ The constitution is the set of files that agent settings deny to agents: rules, hooks, lint, format, and commit configuration, and the agent settings themselves. It is company policy.
24
+
25
+ A developer changes the constitution through a dedicated issue, never inside a feature pull request. When a task needs a constitution change, propose it to the user, reference that issue, and wait for it to merge before the task depends on it.
@@ -0,0 +1,13 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.js"
5
+ ---
6
+
7
+ # Diagnostics
8
+
9
+ Resolve runtime failures at the source with the language's standard narrowing, validation, and error types. For missing third-party types, take upstream definitions or a narrow adapter in the established location.
10
+
11
+ Surface errors at the caller or process boundary with diagnostic context. Handle an error to add context, recover, or translate it at an application boundary. Retain the root cause through the language's exception mechanism.
12
+
13
+ Report unresolved type, declaration, or rule conflicts to the user. Findings follow `no-suppression.md`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.js"
5
+ ---
6
+
7
+ # Logging
8
+
9
+ Application code logs through the stack's logging library or the framework's logger, never `console.*`. Write structured records, and send them to a store that keeps them longer than the host does.
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue"
3
+ globs: ".agents/rules/**,.agents/rules.json,.agents/hooks/**,.claude/settings.json,.claude/rules/**,.cursor/rules/**,.cursor/hooks/**,.cursor/hooks.json,scripts/sync-agent-rules.ts,scripts/check-agent-gates.ts,.husky/**,.commitlintrc.json,.prettierrc.json,eslint.config.ts,.lintstagedrc.json,.gitleaks.toml"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Constitution Changes
8
+
9
+ The constitution is the set of files that agent settings deny to agents: rules, hooks, lint, format, and commit configuration, and the agent settings themselves. It is company policy.
10
+
11
+ A developer changes the constitution through a dedicated issue, never inside a feature pull request. When a task needs a constitution change, propose it to the user, reference that issue, and wait for it to merge before the task depends on it.
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: "Diagnostics: fix runtime failures at the source and keep the root cause"
3
+ globs: "**/*.ts,**/*.js"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Diagnostics
8
+
9
+ Resolve runtime failures at the source with the language's standard narrowing, validation, and error types. For missing third-party types, take upstream definitions or a narrow adapter in the established location.
10
+
11
+ Surface errors at the caller or process boundary with diagnostic context. Handle an error to add context, recover, or translate it at an application boundary. Retain the root cause through the language's exception mechanism.
12
+
13
+ Report unresolved type, declaration, or rule conflicts to the user. Findings follow `no-suppression.md`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: "Logging: log through a logging library in structured, durable records"
3
+ globs: "**/*.ts,**/*.js"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Logging
8
+
9
+ Application code logs through the stack's logging library or the framework's logger, never `console.*`. Write structured records, and send them to a store that keeps them longer than the host does.
@@ -1,8 +1,10 @@
1
1
  # Runs on any OCI platform (Railway, Fly.io, Cloud Run). The platform sets `PORT`.
2
- FROM node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 AS base
2
+ FROM \
3
+ node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 \
4
+ AS base
3
5
  WORKDIR /app
4
6
  COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
5
- RUN npm install --global "pnpm@$(node --print 'require("./package.json").packageManager.split("+")[0].split("@")[1]')"
7
+ RUN corepack enable
6
8
 
7
9
  FROM base AS build
8
10
  RUN pnpm install --frozen-lockfile --ignore-scripts
@@ -13,12 +15,20 @@ RUN pnpm build
13
15
  FROM base AS prod-deps
14
16
  RUN pnpm install --frozen-lockfile --ignore-scripts --prod
15
17
 
16
- FROM node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
18
+ FROM \
19
+ node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
17
20
  ENV NODE_ENV=production
18
21
  WORKDIR /app
19
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.
20
23
  RUN apk upgrade --no-cache \
21
- && rm -rf /usr/local/lib/node_modules /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/corepack /usr/local/bin/yarn /usr/local/bin/yarnpkg /opt/yarn-*
24
+ && rm -rf \
25
+ /usr/local/lib/node_modules \
26
+ /usr/local/bin/npm \
27
+ /usr/local/bin/npx \
28
+ /usr/local/bin/corepack \
29
+ /usr/local/bin/yarn \
30
+ /usr/local/bin/yarnpkg \
31
+ /opt/yarn-*
22
32
  COPY package.json ./
23
33
  COPY --from=prod-deps /app/node_modules ./node_modules
24
34
  COPY --from=build /app/dist ./dist
@@ -12,7 +12,25 @@
12
12
  "description": "Codebase hygiene: modify existing code instead of accumulating new code"
13
13
  },
14
14
  "constitution-changes": {
15
- "description": "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue"
15
+ "description": "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue",
16
+ "globs": [
17
+ ".agents/rules/**",
18
+ ".agents/rules.json",
19
+ ".agents/hooks/**",
20
+ ".claude/settings.json",
21
+ ".claude/rules/**",
22
+ ".cursor/rules/**",
23
+ ".cursor/hooks/**",
24
+ ".cursor/hooks.json",
25
+ "scripts/sync-agent-rules.ts",
26
+ "scripts/check-agent-gates.ts",
27
+ ".husky/**",
28
+ ".commitlintrc.json",
29
+ ".prettierrc.json",
30
+ "eslint.config.ts",
31
+ ".lintstagedrc.json",
32
+ ".gitleaks.toml"
33
+ ]
16
34
  },
17
35
  "current-state-authority": {
18
36
  "description": "Current state: implement from user requirements and the working tree"
@@ -32,28 +50,24 @@
32
50
  "globs": ["**/*.test.ts", "**/*.test.tsx"]
33
51
  },
34
52
  "diagnostics-and-error-handling": {
35
- "description": "Diagnostics: fix runtime failures at the source and keep the root cause"
53
+ "description": "Diagnostics: fix runtime failures at the source and keep the root cause",
54
+ "globs": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]
36
55
  },
37
56
  "evidence-before-claims": {
38
57
  "description": "Evidence: verify and cite a claim before stating or writing it"
39
58
  },
40
- "git-workflow": {
41
- "description": "Git workflow: trunk-based branches, commits, and pull requests"
42
- },
43
59
  "no-suppression": {
44
60
  "description": "Findings: fix scanner and linter reports without inline suppressions"
45
61
  },
46
62
  "platform-and-library-first": {
47
63
  "description": "Platform and library first: use built-in features, then maintained libraries, then custom code"
48
64
  },
49
- "script-driven-changes": {
50
- "description": "Scripts: apply a repeated edit across many files with a script"
51
- },
52
65
  "single-author-style": {
53
66
  "description": "Sibling style: match layout, naming, and composition in the same project"
54
67
  },
55
68
  "structured-logging": {
56
- "description": "Logging: log through a logging library in structured, durable records"
69
+ "description": "Logging: log through a logging library in structured, durable records",
70
+ "globs": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]
57
71
  },
58
72
  "typescript-first": {
59
73
  "description": "TypeScript-first: write source, tests, and scripts as .ts or .tsx",
@@ -0,0 +1,25 @@
1
+ ---
2
+ paths:
3
+ - ".agents/rules/**"
4
+ - ".agents/rules.json"
5
+ - ".agents/hooks/**"
6
+ - ".claude/settings.json"
7
+ - ".claude/rules/**"
8
+ - ".cursor/rules/**"
9
+ - ".cursor/hooks/**"
10
+ - ".cursor/hooks.json"
11
+ - "scripts/sync-agent-rules.ts"
12
+ - "scripts/check-agent-gates.ts"
13
+ - ".husky/**"
14
+ - ".commitlintrc.json"
15
+ - ".prettierrc.json"
16
+ - "eslint.config.ts"
17
+ - ".lintstagedrc.json"
18
+ - ".gitleaks.toml"
19
+ ---
20
+
21
+ # Constitution Changes
22
+
23
+ The constitution is the set of files that agent settings deny to agents: rules, hooks, lint, format, and commit configuration, and the agent settings themselves. It is company policy.
24
+
25
+ A developer changes the constitution through a dedicated issue, never inside a feature pull request. When a task needs a constitution change, propose it to the user, reference that issue, and wait for it to merge before the task depends on it.
@@ -0,0 +1,15 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.tsx"
5
+ - "**/*.js"
6
+ - "**/*.jsx"
7
+ ---
8
+
9
+ # Diagnostics
10
+
11
+ Resolve runtime failures at the source with the language's standard narrowing, validation, and error types. For missing third-party types, take upstream definitions or a narrow adapter in the established location.
12
+
13
+ Surface errors at the caller or process boundary with diagnostic context. Handle an error to add context, recover, or translate it at an application boundary. Retain the root cause through the language's exception mechanism.
14
+
15
+ Report unresolved type, declaration, or rule conflicts to the user. Findings follow `no-suppression.md`.
@@ -0,0 +1,11 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.tsx"
5
+ - "**/*.js"
6
+ - "**/*.jsx"
7
+ ---
8
+
9
+ # Logging
10
+
11
+ Application code logs through the stack's logging library or the framework's logger, never `console.*`. Write structured records, and send them to a store that keeps them longer than the host does.
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue"
3
+ globs: ".agents/rules/**,.agents/rules.json,.agents/hooks/**,.claude/settings.json,.claude/rules/**,.cursor/rules/**,.cursor/hooks/**,.cursor/hooks.json,scripts/sync-agent-rules.ts,scripts/check-agent-gates.ts,.husky/**,.commitlintrc.json,.prettierrc.json,eslint.config.ts,.lintstagedrc.json,.gitleaks.toml"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Constitution Changes
8
+
9
+ The constitution is the set of files that agent settings deny to agents: rules, hooks, lint, format, and commit configuration, and the agent settings themselves. It is company policy.
10
+
11
+ A developer changes the constitution through a dedicated issue, never inside a feature pull request. When a task needs a constitution change, propose it to the user, reference that issue, and wait for it to merge before the task depends on it.
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: "Diagnostics: fix runtime failures at the source and keep the root cause"
3
+ globs: "**/*.ts,**/*.tsx,**/*.js,**/*.jsx"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Diagnostics
8
+
9
+ Resolve runtime failures at the source with the language's standard narrowing, validation, and error types. For missing third-party types, take upstream definitions or a narrow adapter in the established location.
10
+
11
+ Surface errors at the caller or process boundary with diagnostic context. Handle an error to add context, recover, or translate it at an application boundary. Retain the root cause through the language's exception mechanism.
12
+
13
+ Report unresolved type, declaration, or rule conflicts to the user. Findings follow `no-suppression.md`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: "Logging: log through a logging library in structured, durable records"
3
+ globs: "**/*.ts,**/*.tsx,**/*.js,**/*.jsx"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Logging
8
+
9
+ Application code logs through the stack's logging library or the framework's logger, never `console.*`. Write structured records, and send them to a store that keeps them longer than the host does.
@@ -1,9 +1,11 @@
1
1
  # Runs on any OCI platform (Railway, Fly.io, Cloud Run). On Vercel, deploy without it. The platform sets `PORT`.
2
- FROM node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 AS build
2
+ FROM \
3
+ node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 \
4
+ AS build
3
5
  ENV NEXT_TELEMETRY_DISABLED=1
4
6
  WORKDIR /app
5
7
  COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
6
- RUN npm install --global "pnpm@$(node --print 'require("./package.json").packageManager.split("+")[0].split("@")[1]')"
8
+ RUN corepack enable
7
9
  RUN pnpm install --frozen-lockfile --ignore-scripts
8
10
  COPY next.config.ts tsconfig.json ./
9
11
  COPY src ./src
@@ -11,12 +13,20 @@ COPY src ./src
11
13
  # the platform sets the real ones at runtime, and the build never connects to the database.
12
14
  RUN PAYLOAD_SECRET=build-only DATABASE_URL=postgres://build-only@localhost/build-only APP_URL=http://localhost:3000 pnpm build
13
15
 
14
- FROM node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
16
+ FROM \
17
+ node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
15
18
  ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1 HOSTNAME=0.0.0.0
16
19
  WORKDIR /app
17
20
  # 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.
18
21
  RUN apk upgrade --no-cache \
19
- && rm -rf /usr/local/lib/node_modules /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/corepack /usr/local/bin/yarn /usr/local/bin/yarnpkg /opt/yarn-* \
22
+ && rm -rf \
23
+ /usr/local/lib/node_modules \
24
+ /usr/local/bin/npm \
25
+ /usr/local/bin/npx \
26
+ /usr/local/bin/corepack \
27
+ /usr/local/bin/yarn \
28
+ /usr/local/bin/yarnpkg \
29
+ /opt/yarn-* \
20
30
  && install -d -o node -g node media
21
31
  # Next.js writes .next/cache at runtime. Add `COPY --from=build --chown=node:node /app/public ./public` when the app has a public/ folder, and allow it in .dockerignore. Uploads go to the container filesystem, which is lost on redeploy; use a storage adapter or a mounted volume in production.
22
32
  COPY --from=build --chown=node:node /app/.next/standalone ./
@@ -12,7 +12,25 @@
12
12
  "description": "Codebase hygiene: modify existing code instead of accumulating new code"
13
13
  },
14
14
  "constitution-changes": {
15
- "description": "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue"
15
+ "description": "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue",
16
+ "globs": [
17
+ ".agents/rules/**",
18
+ ".agents/rules.json",
19
+ ".agents/hooks/**",
20
+ ".claude/settings.json",
21
+ ".claude/rules/**",
22
+ ".cursor/rules/**",
23
+ ".cursor/hooks/**",
24
+ ".cursor/hooks.json",
25
+ "scripts/sync-agent-rules.ts",
26
+ "scripts/check-agent-gates.ts",
27
+ ".husky/**",
28
+ ".commitlintrc.json",
29
+ "prettier.config.ts",
30
+ "eslint.config.ts",
31
+ ".lintstagedrc.json",
32
+ ".gitleaks.toml"
33
+ ]
16
34
  },
17
35
  "current-state-authority": {
18
36
  "description": "Current state: implement from user requirements and the working tree"
@@ -32,28 +50,24 @@
32
50
  "globs": ["**/*.test.ts", "**/*.test.tsx"]
33
51
  },
34
52
  "diagnostics-and-error-handling": {
35
- "description": "Diagnostics: fix runtime failures at the source and keep the root cause"
53
+ "description": "Diagnostics: fix runtime failures at the source and keep the root cause",
54
+ "globs": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]
36
55
  },
37
56
  "evidence-before-claims": {
38
57
  "description": "Evidence: verify and cite a claim before stating or writing it"
39
58
  },
40
- "git-workflow": {
41
- "description": "Git workflow: trunk-based branches, commits, and pull requests"
42
- },
43
59
  "no-suppression": {
44
60
  "description": "Findings: fix scanner and linter reports without inline suppressions"
45
61
  },
46
62
  "platform-and-library-first": {
47
63
  "description": "Platform and library first: use built-in features, then maintained libraries, then custom code"
48
64
  },
49
- "script-driven-changes": {
50
- "description": "Scripts: apply a repeated edit across many files with a script"
51
- },
52
65
  "single-author-style": {
53
66
  "description": "Sibling style: match layout, naming, and composition in the same project"
54
67
  },
55
68
  "structured-logging": {
56
- "description": "Logging: log through a logging library in structured, durable records"
69
+ "description": "Logging: log through a logging library in structured, durable records",
70
+ "globs": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]
57
71
  },
58
72
  "typescript-first": {
59
73
  "description": "TypeScript-first: write source, tests, and scripts as .ts or .tsx",
@@ -0,0 +1,25 @@
1
+ ---
2
+ paths:
3
+ - ".agents/rules/**"
4
+ - ".agents/rules.json"
5
+ - ".agents/hooks/**"
6
+ - ".claude/settings.json"
7
+ - ".claude/rules/**"
8
+ - ".cursor/rules/**"
9
+ - ".cursor/hooks/**"
10
+ - ".cursor/hooks.json"
11
+ - "scripts/sync-agent-rules.ts"
12
+ - "scripts/check-agent-gates.ts"
13
+ - ".husky/**"
14
+ - ".commitlintrc.json"
15
+ - "prettier.config.ts"
16
+ - "eslint.config.ts"
17
+ - ".lintstagedrc.json"
18
+ - ".gitleaks.toml"
19
+ ---
20
+
21
+ # Constitution Changes
22
+
23
+ The constitution is the set of files that agent settings deny to agents: rules, hooks, lint, format, and commit configuration, and the agent settings themselves. It is company policy.
24
+
25
+ A developer changes the constitution through a dedicated issue, never inside a feature pull request. When a task needs a constitution change, propose it to the user, reference that issue, and wait for it to merge before the task depends on it.
@@ -0,0 +1,15 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.tsx"
5
+ - "**/*.js"
6
+ - "**/*.jsx"
7
+ ---
8
+
9
+ # Diagnostics
10
+
11
+ Resolve runtime failures at the source with the language's standard narrowing, validation, and error types. For missing third-party types, take upstream definitions or a narrow adapter in the established location.
12
+
13
+ Surface errors at the caller or process boundary with diagnostic context. Handle an error to add context, recover, or translate it at an application boundary. Retain the root cause through the language's exception mechanism.
14
+
15
+ Report unresolved type, declaration, or rule conflicts to the user. Findings follow `no-suppression.md`.
@@ -0,0 +1,11 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.tsx"
5
+ - "**/*.js"
6
+ - "**/*.jsx"
7
+ ---
8
+
9
+ # Logging
10
+
11
+ Application code logs through the stack's logging library or the framework's logger, never `console.*`. Write structured records, and send them to a store that keeps them longer than the host does.
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Constitution changes: change rules, hooks, and agent settings only through a dedicated issue"
3
+ globs: ".agents/rules/**,.agents/rules.json,.agents/hooks/**,.claude/settings.json,.claude/rules/**,.cursor/rules/**,.cursor/hooks/**,.cursor/hooks.json,scripts/sync-agent-rules.ts,scripts/check-agent-gates.ts,.husky/**,.commitlintrc.json,prettier.config.ts,eslint.config.ts,.lintstagedrc.json,.gitleaks.toml"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Constitution Changes
8
+
9
+ The constitution is the set of files that agent settings deny to agents: rules, hooks, lint, format, and commit configuration, and the agent settings themselves. It is company policy.
10
+
11
+ A developer changes the constitution through a dedicated issue, never inside a feature pull request. When a task needs a constitution change, propose it to the user, reference that issue, and wait for it to merge before the task depends on it.
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: "Diagnostics: fix runtime failures at the source and keep the root cause"
3
+ globs: "**/*.ts,**/*.tsx,**/*.js,**/*.jsx"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Diagnostics
8
+
9
+ Resolve runtime failures at the source with the language's standard narrowing, validation, and error types. For missing third-party types, take upstream definitions or a narrow adapter in the established location.
10
+
11
+ Surface errors at the caller or process boundary with diagnostic context. Handle an error to add context, recover, or translate it at an application boundary. Retain the root cause through the language's exception mechanism.
12
+
13
+ Report unresolved type, declaration, or rule conflicts to the user. Findings follow `no-suppression.md`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: "Logging: log through a logging library in structured, durable records"
3
+ globs: "**/*.ts,**/*.tsx,**/*.js,**/*.jsx"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Logging
8
+
9
+ Application code logs through the stack's logging library or the framework's logger, never `console.*`. Write structured records, and send them to a store that keeps them longer than the host does.
@@ -1,22 +1,32 @@
1
1
  # Runs on any OCI platform (Railway, Fly.io, Cloud Run). On Vercel, deploy without it. The platform sets `PORT`.
2
- FROM node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 AS build
2
+ FROM \
3
+ node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 \
4
+ AS build
3
5
  ENV NEXT_TELEMETRY_DISABLED=1
4
6
  WORKDIR /app
5
7
  COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
6
8
  COPY apps/app/package.json apps/app/package.json
7
9
  COPY apps/backoffice/package.json apps/backoffice/package.json
8
- RUN npm install --global "pnpm@$(node --print 'require("./package.json").packageManager.split("+")[0].split("@")[1]')"
10
+ RUN corepack enable
9
11
  RUN pnpm install --frozen-lockfile --ignore-scripts --filter ./apps/app...
10
12
  COPY apps/app/next.config.ts apps/app/postcss.config.mjs apps/app/tsconfig.json apps/app/
11
13
  COPY apps/app/app apps/app/app
12
14
  RUN pnpm --filter ./apps/app build
13
15
 
14
- FROM node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
16
+ FROM \
17
+ node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
15
18
  ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1 HOSTNAME=0.0.0.0
16
19
  WORKDIR /app
17
20
  # 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.
18
21
  RUN apk upgrade --no-cache \
19
- && rm -rf /usr/local/lib/node_modules /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/corepack /usr/local/bin/yarn /usr/local/bin/yarnpkg /opt/yarn-*
22
+ && rm -rf \
23
+ /usr/local/lib/node_modules \
24
+ /usr/local/bin/npm \
25
+ /usr/local/bin/npx \
26
+ /usr/local/bin/corepack \
27
+ /usr/local/bin/yarn \
28
+ /usr/local/bin/yarnpkg \
29
+ /opt/yarn-*
20
30
  # Next.js writes .next/cache at runtime. Add `COPY --from=build --chown=node:node /app/apps/app/public ./apps/app/public` when the app has a public/ folder.
21
31
  COPY --from=build --chown=node:node /app/apps/app/.next/standalone ./
22
32
  COPY --from=build --chown=node:node /app/apps/app/.next/static ./apps/app/.next/static
@@ -1,11 +1,13 @@
1
1
  # Runs on any OCI platform (Railway, Fly.io, Cloud Run). On Vercel, deploy without it. The platform sets `PORT`.
2
- FROM node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 AS build
2
+ FROM \
3
+ node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 \
4
+ AS build
3
5
  ENV NEXT_TELEMETRY_DISABLED=1
4
6
  WORKDIR /app
5
7
  COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
6
8
  COPY apps/app/package.json apps/app/package.json
7
9
  COPY apps/backoffice/package.json apps/backoffice/package.json
8
- RUN npm install --global "pnpm@$(node --print 'require("./package.json").packageManager.split("+")[0].split("@")[1]')"
10
+ RUN corepack enable
9
11
  RUN pnpm install --frozen-lockfile --ignore-scripts --filter ./apps/backoffice...
10
12
  COPY apps/backoffice/next.config.ts apps/backoffice/tsconfig.json apps/backoffice/
11
13
  COPY apps/backoffice/src apps/backoffice/src
@@ -13,12 +15,20 @@ COPY apps/backoffice/src apps/backoffice/src
13
15
  # The platform sets the real ones at runtime, and the build never connects to the database.
14
16
  RUN PAYLOAD_SECRET=build-only DATABASE_URL=postgres://build-only@localhost/build-only APP_URL=http://localhost:3001 pnpm --filter ./apps/backoffice build
15
17
 
16
- FROM node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
18
+ FROM \
19
+ node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
17
20
  ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1 HOSTNAME=0.0.0.0
18
21
  WORKDIR /app
19
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.
20
23
  RUN apk upgrade --no-cache \
21
- && rm -rf /usr/local/lib/node_modules /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/corepack /usr/local/bin/yarn /usr/local/bin/yarnpkg /opt/yarn-* \
24
+ && rm -rf \
25
+ /usr/local/lib/node_modules \
26
+ /usr/local/bin/npm \
27
+ /usr/local/bin/npx \
28
+ /usr/local/bin/corepack \
29
+ /usr/local/bin/yarn \
30
+ /usr/local/bin/yarnpkg \
31
+ /opt/yarn-* \
22
32
  && install -d -o node -g node apps/backoffice/media
23
33
  # Next.js writes .next/cache at runtime. Uploads go to the container filesystem, which is lost on redeploy; use a storage adapter or a mounted volume in production.
24
34
  COPY --from=build --chown=node:node /app/apps/backoffice/.next/standalone ./
@@ -1 +0,0 @@
1
- @../../.agents/rules/constitution-changes.md
@@ -1 +0,0 @@
1
- @../../.agents/rules/diagnostics-and-error-handling.md
@@ -1 +0,0 @@
1
- @../../.agents/rules/git-workflow.md
@@ -1 +0,0 @@
1
- @../../.agents/rules/script-driven-changes.md
@@ -1 +0,0 @@
1
- @../../.agents/rules/structured-logging.md