connore 0.0.0-stage → 0.1.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 (136) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +52 -2
  3. package/bin/ctxkit.js +5 -0
  4. package/package.json +33 -4
  5. package/packs/CONTRIBUTING.md +32 -0
  6. package/packs/base/catalog/README.md +24 -0
  7. package/packs/base/catalog/api.md +46 -0
  8. package/packs/base/catalog/auth.md +46 -0
  9. package/packs/base/catalog/backend.md +46 -0
  10. package/packs/base/catalog/blueprints.md +46 -0
  11. package/packs/base/catalog/components.md +46 -0
  12. package/packs/base/catalog/database.md +46 -0
  13. package/packs/base/catalog/docs.md +46 -0
  14. package/packs/base/catalog/github.md +46 -0
  15. package/packs/base/catalog/golden.md +46 -0
  16. package/packs/base/catalog/motion.md +46 -0
  17. package/packs/base/catalog/plan.md +46 -0
  18. package/packs/base/catalog/screenshots.md +46 -0
  19. package/packs/base/catalog/skills.md +46 -0
  20. package/packs/base/catalog/tokens.md +47 -0
  21. package/packs/base/planning/START.md +28 -0
  22. package/packs/base/planning/blueprint-template.md +46 -0
  23. package/packs/base/planning/plan-template.md +45 -0
  24. package/packs/base/rules/anti-patterns.md +43 -0
  25. package/packs/base/rules/code-style.md +43 -0
  26. package/packs/base/rules/definition-of-done.md +47 -0
  27. package/packs/base/rules/dependency-policy.md +43 -0
  28. package/packs/base/rules/error-handling.md +43 -0
  29. package/packs/base/rules/security-baseline.md +43 -0
  30. package/packs/base/templates/bug-report.md +43 -0
  31. package/packs/base/templates/feature-spec.md +43 -0
  32. package/packs/base/templates/handoff.md +43 -0
  33. package/packs/base/templates/project-brief.md +43 -0
  34. package/packs/base/workflow/build-loop.md +48 -0
  35. package/packs/base/workflow/code-review.md +43 -0
  36. package/packs/base/workflow/debugging.md +43 -0
  37. package/packs/base/workflow/git-and-commits.md +43 -0
  38. package/packs/base/workflow/idea-to-spec.md +43 -0
  39. package/packs/base/workflow/session-handoff.md +43 -0
  40. package/packs/base/workflow/spec-to-plan.md +43 -0
  41. package/packs/frontend/components/button.md +25 -0
  42. package/packs/frontend/components/card.md +25 -0
  43. package/packs/frontend/components/input.md +25 -0
  44. package/packs/frontend/design/rules.md +24 -0
  45. package/packs/frontend/design/tokens.md +40 -0
  46. package/packs/nextjs-fullstack/backend/api-conventions.md +48 -0
  47. package/packs/nextjs-fullstack/backend/auth-and-roles.md +43 -0
  48. package/packs/nextjs-fullstack/backend/background-jobs.md +43 -0
  49. package/packs/nextjs-fullstack/backend/caching.md +43 -0
  50. package/packs/nextjs-fullstack/backend/database.md +43 -0
  51. package/packs/nextjs-fullstack/backend/file-uploads.md +43 -0
  52. package/packs/nextjs-fullstack/backend/logging.md +43 -0
  53. package/packs/nextjs-fullstack/backend/migrations.md +43 -0
  54. package/packs/nextjs-fullstack/backend/rate-limiting.md +43 -0
  55. package/packs/nextjs-fullstack/backend/secrets-and-env.md +43 -0
  56. package/packs/nextjs-fullstack/backend/validation.md +43 -0
  57. package/packs/nextjs-fullstack/blueprints/ai-app.md +84 -0
  58. package/packs/nextjs-fullstack/blueprints/internal-tool.md +83 -0
  59. package/packs/nextjs-fullstack/blueprints/saas-app.md +83 -0
  60. package/packs/nextjs-fullstack/build-deploy/ci.md +43 -0
  61. package/packs/nextjs-fullstack/build-deploy/deploy.md +43 -0
  62. package/packs/nextjs-fullstack/build-deploy/monitoring.md +43 -0
  63. package/packs/nextjs-fullstack/build-deploy/performance.md +43 -0
  64. package/packs/nextjs-fullstack/build-deploy/project-structure.md +43 -0
  65. package/packs/nextjs-fullstack/build-deploy/release-checklist.md +43 -0
  66. package/packs/nextjs-fullstack/build-deploy/testing.md +43 -0
  67. package/packs/nextjs-fullstack/evals/README.md +43 -0
  68. package/packs/nextjs-fullstack/examples/golden-app/README.md +43 -0
  69. package/packs/nextjs-fullstack/frontend/accessibility.md +43 -0
  70. package/packs/nextjs-fullstack/frontend/components.md +43 -0
  71. package/packs/nextjs-fullstack/frontend/forms.md +43 -0
  72. package/packs/nextjs-fullstack/frontend/layout.md +43 -0
  73. package/packs/nextjs-fullstack/frontend/loading-empty-error.md +43 -0
  74. package/packs/nextjs-fullstack/frontend/motion.md +43 -0
  75. package/packs/nextjs-fullstack/frontend/responsive.md +43 -0
  76. package/packs/nextjs-fullstack/frontend/seo.md +43 -0
  77. package/packs/nextjs-fullstack/frontend/tables.md +43 -0
  78. package/packs/nextjs-fullstack/frontend/tokens.md +43 -0
  79. package/packs/nextjs-fullstack/integrations/analytics.md +43 -0
  80. package/packs/nextjs-fullstack/integrations/email.md +43 -0
  81. package/packs/nextjs-fullstack/integrations/llm-apis.md +43 -0
  82. package/packs/nextjs-fullstack/integrations/oauth.md +43 -0
  83. package/packs/nextjs-fullstack/integrations/object-storage.md +43 -0
  84. package/packs/nextjs-fullstack/integrations/payments.md +43 -0
  85. package/packs/nextjs-fullstack/integrations/queues.md +43 -0
  86. package/packs/nextjs-fullstack/integrations/search.md +43 -0
  87. package/packs/nextjs-fullstack/integrations/webhooks.md +43 -0
  88. package/packs/nextjs-fullstack/playbooks/add-ai-feature.md +43 -0
  89. package/packs/nextjs-fullstack/playbooks/add-auth.md +43 -0
  90. package/packs/nextjs-fullstack/playbooks/add-billing.md +50 -0
  91. package/packs/nextjs-fullstack/playbooks/add-crud.md +43 -0
  92. package/packs/nextjs-fullstack/playbooks/add-email.md +43 -0
  93. package/packs/nextjs-fullstack/playbooks/add-file-upload.md +43 -0
  94. package/packs/nextjs-fullstack/playbooks/add-webhook.md +43 -0
  95. package/packs/nextjs-fullstack/playbooks/ship-to-prod.md +43 -0
  96. package/src/cli.js +288 -0
  97. package/src/commands/add.js +61 -0
  98. package/src/commands/catalog.js +21 -0
  99. package/src/commands/doctor.js +42 -0
  100. package/src/commands/hook.js +67 -0
  101. package/src/commands/init.js +69 -0
  102. package/src/commands/learn.js +39 -0
  103. package/src/commands/lint.js +5 -0
  104. package/src/commands/list.js +10 -0
  105. package/src/commands/log.js +25 -0
  106. package/src/commands/memory.js +14 -0
  107. package/src/commands/plan.js +41 -0
  108. package/src/commands/reindex.js +8 -0
  109. package/src/commands/review.js +31 -0
  110. package/src/commands/search.js +21 -0
  111. package/src/commands/stats.js +35 -0
  112. package/src/commands/undo.js +7 -0
  113. package/src/commands/update.js +16 -0
  114. package/src/lib/catalog.js +32 -0
  115. package/src/lib/config.js +64 -0
  116. package/src/lib/frontmatter.js +70 -0
  117. package/src/lib/fs-safe.js +87 -0
  118. package/src/lib/gitlog.js +75 -0
  119. package/src/lib/ignore.js +47 -0
  120. package/src/lib/index.js +72 -0
  121. package/src/lib/lessons.js +173 -0
  122. package/src/lib/lint.js +67 -0
  123. package/src/lib/lock.js +47 -0
  124. package/src/lib/memory.js +49 -0
  125. package/src/lib/mutate.js +24 -0
  126. package/src/lib/packs.js +10 -0
  127. package/src/lib/paths.js +25 -0
  128. package/src/lib/plan.js +156 -0
  129. package/src/lib/pointers.js +76 -0
  130. package/src/lib/provider.js +27 -0
  131. package/src/lib/report.js +33 -0
  132. package/src/lib/run.js +73 -0
  133. package/src/lib/search.js +40 -0
  134. package/src/lib/secrets.js +25 -0
  135. package/src/lib/signals.js +55 -0
  136. package/src/lib/sync.js +36 -0
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Database
3
+ type: doc
4
+ tags: [doc]
5
+ stack: nextjs
6
+ status: draft
7
+ verified:
8
+ description: Draft direction for Database.
9
+ ---
10
+
11
+ # Database
12
+
13
+ ## Use when
14
+ TODO
15
+
16
+ ## Default
17
+ TODO
18
+
19
+ ## Use instead when
20
+ TODO
21
+
22
+ ## Never
23
+ TODO
24
+
25
+ ## Why
26
+ TODO
27
+
28
+ ## Steps
29
+ 1. TODO
30
+
31
+ ## Done when
32
+ TODO
33
+
34
+ ## Example
35
+ TODO
36
+
37
+ ## Common mistakes
38
+ TODO
39
+
40
+ ## Sources
41
+ TODO
42
+
43
+ License: MIT
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: File Uploads
3
+ type: doc
4
+ tags: [doc]
5
+ stack: nextjs
6
+ status: draft
7
+ verified:
8
+ description: Draft direction for File Uploads.
9
+ ---
10
+
11
+ # File Uploads
12
+
13
+ ## Use when
14
+ TODO
15
+
16
+ ## Default
17
+ TODO
18
+
19
+ ## Use instead when
20
+ TODO
21
+
22
+ ## Never
23
+ TODO
24
+
25
+ ## Why
26
+ TODO
27
+
28
+ ## Steps
29
+ 1. TODO
30
+
31
+ ## Done when
32
+ TODO
33
+
34
+ ## Example
35
+ TODO
36
+
37
+ ## Common mistakes
38
+ TODO
39
+
40
+ ## Sources
41
+ TODO
42
+
43
+ License: MIT
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Logging
3
+ type: doc
4
+ tags: [doc]
5
+ stack: nextjs
6
+ status: draft
7
+ verified:
8
+ description: Draft direction for Logging.
9
+ ---
10
+
11
+ # Logging
12
+
13
+ ## Use when
14
+ TODO
15
+
16
+ ## Default
17
+ TODO
18
+
19
+ ## Use instead when
20
+ TODO
21
+
22
+ ## Never
23
+ TODO
24
+
25
+ ## Why
26
+ TODO
27
+
28
+ ## Steps
29
+ 1. TODO
30
+
31
+ ## Done when
32
+ TODO
33
+
34
+ ## Example
35
+ TODO
36
+
37
+ ## Common mistakes
38
+ TODO
39
+
40
+ ## Sources
41
+ TODO
42
+
43
+ License: MIT
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Migrations
3
+ type: doc
4
+ tags: [doc]
5
+ stack: nextjs
6
+ status: draft
7
+ verified:
8
+ description: Draft direction for Migrations.
9
+ ---
10
+
11
+ # Migrations
12
+
13
+ ## Use when
14
+ TODO
15
+
16
+ ## Default
17
+ TODO
18
+
19
+ ## Use instead when
20
+ TODO
21
+
22
+ ## Never
23
+ TODO
24
+
25
+ ## Why
26
+ TODO
27
+
28
+ ## Steps
29
+ 1. TODO
30
+
31
+ ## Done when
32
+ TODO
33
+
34
+ ## Example
35
+ TODO
36
+
37
+ ## Common mistakes
38
+ TODO
39
+
40
+ ## Sources
41
+ TODO
42
+
43
+ License: MIT
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Rate Limiting
3
+ type: doc
4
+ tags: [doc]
5
+ stack: nextjs
6
+ status: draft
7
+ verified:
8
+ description: Draft direction for Rate Limiting.
9
+ ---
10
+
11
+ # Rate Limiting
12
+
13
+ ## Use when
14
+ TODO
15
+
16
+ ## Default
17
+ TODO
18
+
19
+ ## Use instead when
20
+ TODO
21
+
22
+ ## Never
23
+ TODO
24
+
25
+ ## Why
26
+ TODO
27
+
28
+ ## Steps
29
+ 1. TODO
30
+
31
+ ## Done when
32
+ TODO
33
+
34
+ ## Example
35
+ TODO
36
+
37
+ ## Common mistakes
38
+ TODO
39
+
40
+ ## Sources
41
+ TODO
42
+
43
+ License: MIT
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Secrets And Env
3
+ type: doc
4
+ tags: [doc]
5
+ stack: nextjs
6
+ status: draft
7
+ verified:
8
+ description: Draft direction for Secrets And Env.
9
+ ---
10
+
11
+ # Secrets And Env
12
+
13
+ ## Use when
14
+ TODO
15
+
16
+ ## Default
17
+ TODO
18
+
19
+ ## Use instead when
20
+ TODO
21
+
22
+ ## Never
23
+ TODO
24
+
25
+ ## Why
26
+ TODO
27
+
28
+ ## Steps
29
+ 1. TODO
30
+
31
+ ## Done when
32
+ TODO
33
+
34
+ ## Example
35
+ TODO
36
+
37
+ ## Common mistakes
38
+ TODO
39
+
40
+ ## Sources
41
+ TODO
42
+
43
+ License: MIT
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Validation
3
+ type: doc
4
+ tags: [doc]
5
+ stack: nextjs
6
+ status: draft
7
+ verified:
8
+ description: Draft direction for Validation.
9
+ ---
10
+
11
+ # Validation
12
+
13
+ ## Use when
14
+ TODO
15
+
16
+ ## Default
17
+ TODO
18
+
19
+ ## Use instead when
20
+ TODO
21
+
22
+ ## Never
23
+ TODO
24
+
25
+ ## Why
26
+ TODO
27
+
28
+ ## Steps
29
+ 1. TODO
30
+
31
+ ## Done when
32
+ TODO
33
+
34
+ ## Example
35
+ TODO
36
+
37
+ ## Common mistakes
38
+ TODO
39
+
40
+ ## Sources
41
+ TODO
42
+
43
+ License: MIT
@@ -0,0 +1,84 @@
1
+ ---
2
+ title: AI-powered app
3
+ type: blueprint
4
+ tags: [blueprint, ai]
5
+ stack: nextjs
6
+ status: draft
7
+ verified: 2026-11-22
8
+ description: A product whose core action is a model call with an eval and a cost cap.
9
+ ---
10
+
11
+ # AI-powered app
12
+
13
+ ## Summary
14
+ The model does one job the user can name. The call runs on the server. A small eval set decides if a prompt change is safe. The user sets the cost cap before you add a second feature.
15
+
16
+ ## Capabilities
17
+ Must: one server-side model call, the prompt stored in the repo, an eval set, auth, a per-user cost cap.
18
+ Should: retrieval over the user's own records, traces, a human review queue for bad outputs.
19
+ Later: a second model, fine-tuning, an agent that writes without a person in the loop.
20
+
21
+ ## Reference architecture
22
+ The browser sends the task, not the raw provider key. A Route Handler checks the session, checks the cap, loads the prompt file, and calls the provider. The eval script runs the same prompt against fixed inputs. Outputs and token counts are rows in Postgres. Provider keys stay in env.
23
+
24
+ ## Data model starter
25
+ users (id, email). prompts (id, name, body, version). runs (id, user_id, prompt_id, input, output, tokens, cost_cents, created_at). eval_cases (id, prompt_id, input, expected). The cap is a column on users or organizations: monthly_cents.
26
+
27
+ ## Integrations
28
+ One model provider, optional object storage for uploads, optional email when a run needs a person. Name the provider only after the user confirms it.
29
+
30
+ ## Phases
31
+
32
+ ### Phase 0: Scope and decisions
33
+ - Confirm the one decision the model is allowed to make
34
+ - Confirm what data the model may see
35
+ - Confirm the monthly spend cap
36
+ Acceptance: Those three answers are written in Current state.
37
+ Gate: The user approved the scope in writing. No provider key in the repo.
38
+ Entries: .ctx/START.md, base/workflow/idea-to-spec.md
39
+
40
+ ### Phase 1: Foundation
41
+ - Create the repo, env sample, CI, database, and sign-in
42
+ - Add a server route that calls the provider with the key from env
43
+ Acceptance: The browser never receives the provider key.
44
+ Gate: CI is green. A missing session returns 401.
45
+ Entries: nextjs-fullstack/backend/api-conventions.md, nextjs-fullstack/backend/secrets-and-env.md
46
+
47
+ ### Phase 2: One eval-backed feature
48
+ - Store the prompt in the repo and version it
49
+ - Add at least 10 eval cases and a script that prints pass and fail counts
50
+ Acceptance: The eval script exits 0 on the current prompt.
51
+ Gate: A prompt edit that drops a case is not merged.
52
+ Entries: base/workflow/build-loop.md, nextjs-fullstack/playbooks/add-ai-feature.md
53
+
54
+ ### Phase 3: Data and cost
55
+ - Save each run with token count and cost
56
+ - Refuse the call when the user is over the monthly cap
57
+ Acceptance: The 11th call over the cap returns 402 and does not call the provider.
58
+ Gate: Cost is computed on the server from the provider usage field.
59
+ Entries: nextjs-fullstack/backend/database.md, nextjs-fullstack/integrations/llm-apis.md
60
+
61
+ ### Phase 4: Hardening
62
+ - Redact secrets from stored inputs
63
+ - Add traces and a way to mark a bad output
64
+ Acceptance: A logged run does not contain an API key or a raw session cookie.
65
+ Gate: doctor and the eval script exit 0.
66
+ Entries: base/rules/security-baseline.md
67
+
68
+ ### Phase 5: Launch
69
+ - Add the review step the user asked for and the rollback for a bad prompt
70
+ Acceptance: You can ship the previous prompt version without a deploy of new code.
71
+ Gate: The user approved the production provider and the cap.
72
+ Entries: nextjs-fullstack/playbooks/ship-to-prod.md
73
+
74
+ ## Gate
75
+ Do not add a second model call while the eval for the first one is failing.
76
+
77
+ ## Pitfalls
78
+ Calling the provider from the client. Changing the prompt with no eval. Saving raw user text that contains secrets. Promising the model is correct because one example looked good.
79
+
80
+ ## Confirm with user
81
+ What the model may decide, what data it may see, the monthly cap, and which provider. Do not invent accuracy numbers or a price.
82
+
83
+ ## Entries to load
84
+ Each phase lists its files. Open those rows only.
@@ -0,0 +1,83 @@
1
+ ---
2
+ title: Internal tool
3
+ type: blueprint
4
+ tags: [blueprint, admin]
5
+ stack: nextjs
6
+ status: draft
7
+ verified: 2026-11-22
8
+ description: An admin or ops tool for a known team, with roles and an audit log.
9
+ ---
10
+
11
+ # Internal tool
12
+
13
+ ## Summary
14
+ A tool for people who already work here. One admin workflow, a role check on every write, and an audit row. It is not a public product and it does not need billing.
15
+
16
+ ## Capabilities
17
+ Must: sign-in limited to the team, one workflow, role checks, an audit row for every write.
18
+ Should: CSV export, empty and error states, a read-only role.
19
+ Later: a public API, SSO if the team does not already have it, bulk edit.
20
+
21
+ ## Reference architecture
22
+ The app sits on the company network or behind the team identity provider. Route Handlers check the session and the role before a write. Every write inserts an audit row in the same transaction. The database is the system of record the tool is editing, or a replica with a single write path back.
23
+
24
+ ## Data model starter
25
+ staff (id, email, role). The table the tool edits, unchanged except for the columns you were asked to add. audit_log (id, staff_id, action, row_id, at). role is one of admin, editor, or reader.
26
+
27
+ ## Integrations
28
+ The team identity provider, the database you were told to use, and email only if a human must be notified. Do not add payments, analytics, or a second database.
29
+
30
+ ## Phases
31
+
32
+ ### Phase 0: Scope and decisions
33
+ - Confirm who can write, who can only read, and who must not sign in
34
+ - Confirm the one workflow and the table it changes
35
+ - Confirm where it is hosted
36
+ Acceptance: The role list and the table name are written in Current state.
37
+ Gate: The user approved the scope in writing.
38
+ Entries: .ctx/START.md, base/workflow/idea-to-spec.md
39
+
40
+ ### Phase 1: Foundation
41
+ - Create the repo, env sample, CI, and the staff table
42
+ - Add sign-in that rejects an email outside the allowed domain
43
+ Acceptance: An outside email receives 403.
44
+ Gate: CI is green.
45
+ Entries: nextjs-fullstack/backend/auth-and-roles.md, nextjs-fullstack/backend/database.md
46
+
47
+ ### Phase 2: One workflow
48
+ - Ship the one create or update path, with loading, empty, and error states
49
+ - Write the audit row in the same transaction as the change
50
+ Acceptance: One real row can be changed and the audit row names the staff id.
51
+ Gate: A reader role receives 403 on that write.
52
+ Entries: nextjs-fullstack/playbooks/add-crud.md, nextjs-fullstack/frontend/loading-empty-error.md
53
+
54
+ ### Phase 3: Permissions
55
+ - Enforce admin, editor, and reader on every write route
56
+ - Add the export the user asked for, as a server route
57
+ Acceptance: Each role is tested with one request.
58
+ Gate: No write route is missing a role check.
59
+ Entries: nextjs-fullstack/backend/auth-and-roles.md
60
+
61
+ ### Phase 4: Hardening
62
+ - Add request logs and a backup note for the table you edit
63
+ Acceptance: A bad write can be traced to a staff id and a time.
64
+ Gate: The test suite and doctor exit 0.
65
+ Entries: base/rules/security-baseline.md, base/rules/definition-of-done.md
66
+
67
+ ### Phase 5: Rollout
68
+ - Write the rollback and who to call when the tool is wrong
69
+ Acceptance: The team can use the workflow without a developer in the room.
70
+ Gate: The user approved the deploy.
71
+ Entries: nextjs-fullstack/build-deploy/deploy.md
72
+
73
+ ## Gate
74
+ Do not add a second workflow while the first write is missing an audit row.
75
+
76
+ ## Pitfalls
77
+ Building billing, marketing pages, or a public signup. Checking the role only in the React page. Editing production data before the audit row exists.
78
+
79
+ ## Confirm with user
80
+ Who can write, what data is sensitive, where it is hosted, and which table is in scope. Do not invent a roadmap or a second department's requirements.
81
+
82
+ ## Entries to load
83
+ Each phase lists its files. Open those rows only.
@@ -0,0 +1,83 @@
1
+ ---
2
+ title: SaaS web app
3
+ type: blueprint
4
+ tags: [blueprint, saas]
5
+ stack: nextjs
6
+ status: draft
7
+ verified: 2026-11-22
8
+ description: B2B or B2C web app with accounts, one core workflow, and billing.
9
+ ---
10
+
11
+ # SaaS web app
12
+
13
+ ## Summary
14
+ A signed-in web app. One workflow works end to end before you add a second feature. Money and roles come after that workflow is real.
15
+
16
+ ## Capabilities
17
+ Must: email and password or OAuth sign-in, one core workflow, billing, settings.
18
+ Should: roles, transactional email, an audit row for writes.
19
+ Later: SSO, a public API, product analytics.
20
+
21
+ ## Reference architecture
22
+ Browser calls Route Handlers. Handlers check the session, validate input, and read or write Postgres. Slow work goes to a job. Files go to object storage. The webhook is a separate route that verifies a signature before it writes.
23
+
24
+ ## Data model starter
25
+ users (id, email, role). organizations (id, name). memberships (user_id, organization_id, role). The core table for the workflow, with organization_id on every row. subscriptions (organization_id, status, price_id). Access reads subscriptions.status. Do not read plan status from the browser.
26
+
27
+ ## Integrations
28
+ Auth, hosted checkout, webhooks, transactional email, object storage. The vendor is a confirm-with-user choice. The job each one does is not.
29
+
30
+ ## Phases
31
+
32
+ ### Phase 0: Scope and decisions
33
+ - Confirm who pays and which plans exist
34
+ - Confirm the one workflow that must work on day one
35
+ - Confirm which data is sensitive
36
+ Acceptance: Those three answers are written in Current state.
37
+ Gate: The user approved the scope in writing. No application code yet.
38
+ Entries: .ctx/START.md, base/workflow/idea-to-spec.md
39
+
40
+ ### Phase 1: Foundation
41
+ - Create the repo, env sample, CI, and database
42
+ - Add sign-in and a session check on every private route
43
+ Acceptance: A signed-out request to a private route returns 401.
44
+ Gate: CI is green and the database migration runs from empty.
45
+ Entries: nextjs-fullstack/backend/api-conventions.md, nextjs-fullstack/backend/auth-and-roles.md, nextjs-fullstack/backend/database.md
46
+
47
+ ### Phase 2: Core workflow
48
+ - Ship one create, read, update, and delete path for the core table
49
+ - Show loading, empty, and error states on that screen
50
+ Acceptance: One real record can be created and read back while signed in.
51
+ Gate: The workflow test passes. Types and lint are clean.
52
+ Entries: nextjs-fullstack/playbooks/add-crud.md, nextjs-fullstack/frontend/forms.md, nextjs-fullstack/frontend/loading-empty-error.md
53
+
54
+ ### Phase 3: Accounts and money
55
+ - Add roles and enforce them on the server
56
+ - Add hosted checkout, a verified webhook, and transactional email
57
+ Acceptance: A retried webhook does not grant access twice.
58
+ Gate: Billing status is read from the database, not from the client.
59
+ Entries: nextjs-fullstack/playbooks/add-billing.md, nextjs-fullstack/integrations/payments.md, nextjs-fullstack/integrations/webhooks.md
60
+
61
+ ### Phase 4: Hardening
62
+ - Apply the security baseline, request logs, backups, and a slow-query check
63
+ Acceptance: A failed payment removes access. Secrets are not in the repo.
64
+ Gate: doctor and the test suite exit 0.
65
+ Entries: base/rules/security-baseline.md, base/rules/definition-of-done.md
66
+
67
+ ### Phase 5: Launch
68
+ - Add the legal pages the user named, the rollout checklist, and a rollback note
69
+ Acceptance: The user can deploy, watch errors, and roll back.
70
+ Gate: The user approved the production deploy.
71
+ Entries: nextjs-fullstack/build-deploy/deploy.md, nextjs-fullstack/playbooks/ship-to-prod.md
72
+
73
+ ## Gate
74
+ A phase gate stays `[ ]` until its Acceptance line is true. Do not open the next phase to get around a red gate.
75
+
76
+ ## Pitfalls
77
+ Building feature screens before sign-in and the organization_id column exist. Trusting the client for the plan. Parsing a webhook body before the signature check.
78
+
79
+ ## Confirm with user
80
+ Who pays, which plans, which data is sensitive, which auth vendor, and the deadline. Do not invent prices, demand, or competitors.
81
+
82
+ ## Entries to load
83
+ Each phase lists its files. Open those rows only.
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Ci
3
+ type: doc
4
+ tags: [doc]
5
+ stack: nextjs
6
+ status: draft
7
+ verified:
8
+ description: Draft direction for Ci.
9
+ ---
10
+
11
+ # Ci
12
+
13
+ ## Use when
14
+ TODO
15
+
16
+ ## Default
17
+ TODO
18
+
19
+ ## Use instead when
20
+ TODO
21
+
22
+ ## Never
23
+ TODO
24
+
25
+ ## Why
26
+ TODO
27
+
28
+ ## Steps
29
+ 1. TODO
30
+
31
+ ## Done when
32
+ TODO
33
+
34
+ ## Example
35
+ TODO
36
+
37
+ ## Common mistakes
38
+ TODO
39
+
40
+ ## Sources
41
+ TODO
42
+
43
+ License: MIT
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Deploy
3
+ type: doc
4
+ tags: [doc]
5
+ stack: nextjs
6
+ status: draft
7
+ verified:
8
+ description: Draft direction for Deploy.
9
+ ---
10
+
11
+ # Deploy
12
+
13
+ ## Use when
14
+ TODO
15
+
16
+ ## Default
17
+ TODO
18
+
19
+ ## Use instead when
20
+ TODO
21
+
22
+ ## Never
23
+ TODO
24
+
25
+ ## Why
26
+ TODO
27
+
28
+ ## Steps
29
+ 1. TODO
30
+
31
+ ## Done when
32
+ TODO
33
+
34
+ ## Example
35
+ TODO
36
+
37
+ ## Common mistakes
38
+ TODO
39
+
40
+ ## Sources
41
+ TODO
42
+
43
+ License: MIT
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Monitoring
3
+ type: doc
4
+ tags: [doc]
5
+ stack: nextjs
6
+ status: draft
7
+ verified:
8
+ description: Draft direction for Monitoring.
9
+ ---
10
+
11
+ # Monitoring
12
+
13
+ ## Use when
14
+ TODO
15
+
16
+ ## Default
17
+ TODO
18
+
19
+ ## Use instead when
20
+ TODO
21
+
22
+ ## Never
23
+ TODO
24
+
25
+ ## Why
26
+ TODO
27
+
28
+ ## Steps
29
+ 1. TODO
30
+
31
+ ## Done when
32
+ TODO
33
+
34
+ ## Example
35
+ TODO
36
+
37
+ ## Common mistakes
38
+ TODO
39
+
40
+ ## Sources
41
+ TODO
42
+
43
+ License: MIT