@quickback-dev/cli 0.10.16 → 0.10.20

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 (249) hide show
  1. package/dist/commands/compile.d.ts.map +1 -1
  2. package/dist/commands/compile.js +40 -2
  3. package/dist/commands/compile.js.map +1 -1
  4. package/dist/docs/content.js +6 -6
  5. package/dist/docs/content.js.map +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/skill/SKILL.md +142 -1051
  8. package/dist/skill/agents/quickback-specialist/AGENT.md +36 -0
  9. package/dist/skill/docs/changelog.md +1192 -0
  10. package/dist/skill/docs/compiler/claude-code-skill.md +312 -0
  11. package/dist/skill/docs/compiler/cloud-compiler/authentication.md +63 -0
  12. package/dist/skill/docs/compiler/cloud-compiler/cli.md +307 -0
  13. package/dist/skill/docs/compiler/cloud-compiler/endpoints.md +78 -0
  14. package/dist/skill/docs/compiler/cloud-compiler/index.md +65 -0
  15. package/dist/skill/docs/compiler/cloud-compiler/local-compiler.md +115 -0
  16. package/dist/skill/docs/compiler/cloud-compiler/troubleshooting.md +76 -0
  17. package/dist/skill/docs/compiler/config/agents.md +144 -0
  18. package/dist/skill/docs/compiler/config/auth.md +109 -0
  19. package/dist/skill/docs/compiler/config/bindings.md +176 -0
  20. package/dist/skill/docs/compiler/config/domains.md +149 -0
  21. package/dist/skill/docs/compiler/config/index.md +419 -0
  22. package/dist/skill/docs/compiler/config/output.md +338 -0
  23. package/dist/skill/docs/compiler/config/providers.md +248 -0
  24. package/dist/skill/docs/compiler/config/security.md +255 -0
  25. package/dist/skill/docs/compiler/config/single-tenant.md +128 -0
  26. package/dist/skill/docs/compiler/config/variables.md +157 -0
  27. package/dist/skill/docs/compiler/definitions/access.md +445 -0
  28. package/dist/skill/docs/compiler/definitions/actions.md +884 -0
  29. package/dist/skill/docs/compiler/definitions/concepts.md +52 -0
  30. package/dist/skill/docs/compiler/definitions/feature.md +164 -0
  31. package/dist/skill/docs/compiler/definitions/firewall.md +285 -0
  32. package/dist/skill/docs/compiler/definitions/guards.md +241 -0
  33. package/dist/skill/docs/compiler/definitions/index.md +219 -0
  34. package/dist/skill/docs/compiler/definitions/masking.md +241 -0
  35. package/dist/skill/docs/compiler/definitions/read.md +220 -0
  36. package/dist/skill/docs/compiler/definitions/schema.md +697 -0
  37. package/dist/skill/docs/compiler/definitions/validation.md +35 -0
  38. package/dist/skill/docs/compiler/definitions/views.md +292 -0
  39. package/dist/skill/docs/compiler/getting-started/claude-code.md +126 -0
  40. package/dist/skill/docs/compiler/getting-started/full-example.md +431 -0
  41. package/dist/skill/docs/compiler/getting-started/hand-crafted.md +178 -0
  42. package/dist/skill/docs/compiler/getting-started/index.md +192 -0
  43. package/dist/skill/docs/compiler/getting-started/patterns.md +225 -0
  44. package/dist/skill/docs/compiler/getting-started/template-blog.md +280 -0
  45. package/dist/skill/docs/compiler/getting-started/template-cloudflare.md +260 -0
  46. package/dist/skill/docs/compiler/getting-started/template-empty.md +112 -0
  47. package/dist/skill/docs/compiler/getting-started/templates.md +111 -0
  48. package/dist/skill/docs/compiler/index.md +85 -0
  49. package/dist/skill/docs/compiler/targets/hono-api/cloudflare.md +94 -0
  50. package/dist/skill/docs/compiler/targets/hono-api/database/d1.md +246 -0
  51. package/dist/skill/docs/compiler/targets/hono-api/database/index.md +16 -0
  52. package/dist/skill/docs/compiler/targets/hono-api/database/neon.md +144 -0
  53. package/dist/skill/docs/compiler/targets/hono-api/database/using-d1.md +39 -0
  54. package/dist/skill/docs/compiler/targets/hono-api/index.md +37 -0
  55. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +323 -0
  56. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +357 -0
  57. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/caching.md +105 -0
  58. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/crud.md +652 -0
  59. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/errors.md +224 -0
  60. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/index.md +37 -0
  61. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +203 -0
  62. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/query-params.md +199 -0
  63. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/views-api.md +161 -0
  64. package/dist/skill/docs/compiler/targets/index.md +47 -0
  65. package/dist/skill/docs/compiler/targets/supabase-rls/index.md +55 -0
  66. package/dist/skill/docs/compiler/targets/supabase-rls/limitations.md +48 -0
  67. package/dist/skill/docs/compiler/targets/supabase-rls/mappings.md +99 -0
  68. package/dist/skill/docs/compiler/targets/supabase-rls/setup.md +88 -0
  69. package/dist/skill/docs/compiler/troubleshooting.md +120 -0
  70. package/dist/skill/docs/index.md +77 -0
  71. package/dist/skill/docs/stack/account-ui/customization.md +378 -0
  72. package/dist/skill/docs/stack/account-ui/environment-variables.md +325 -0
  73. package/dist/skill/docs/stack/account-ui/features/admin.md +76 -0
  74. package/dist/skill/docs/stack/account-ui/features/api-keys.md +22 -0
  75. package/dist/skill/docs/stack/account-ui/features/avatars.md +37 -0
  76. package/dist/skill/docs/stack/account-ui/features/cli-authorize.md +21 -0
  77. package/dist/skill/docs/stack/account-ui/features/index.md +291 -0
  78. package/dist/skill/docs/stack/account-ui/features/organizations.md +29 -0
  79. package/dist/skill/docs/stack/account-ui/features/passkeys.md +31 -0
  80. package/dist/skill/docs/stack/account-ui/features/passwordless.md +28 -0
  81. package/dist/skill/docs/stack/account-ui/features/sessions.md +20 -0
  82. package/dist/skill/docs/stack/account-ui/hooks.md +209 -0
  83. package/dist/skill/docs/stack/account-ui/index.md +147 -0
  84. package/dist/skill/docs/stack/account-ui/library-usage.md +257 -0
  85. package/dist/skill/docs/stack/account-ui/standalone.md +149 -0
  86. package/dist/skill/docs/stack/account-ui/with-quickback.md +160 -0
  87. package/dist/skill/docs/stack/account-ui/worker.md +362 -0
  88. package/dist/skill/docs/stack/auth/api-keys.md +15 -0
  89. package/dist/skill/docs/stack/auth/device-auth.md +14 -0
  90. package/dist/skill/docs/stack/auth/index.md +64 -0
  91. package/dist/skill/docs/stack/auth/jwt-optimization.md +245 -0
  92. package/dist/skill/docs/stack/auth/plugins/aws-ses.md +127 -0
  93. package/dist/skill/docs/stack/auth/plugins/combo-auth.md +74 -0
  94. package/dist/skill/docs/stack/auth/plugins/index.md +228 -0
  95. package/dist/skill/docs/stack/auth/plugins/upgrade-anonymous.md +155 -0
  96. package/dist/skill/docs/stack/auth/security.md +455 -0
  97. package/dist/skill/docs/stack/auth/using-auth.md +39 -0
  98. package/dist/skill/docs/stack/cms/actions.md +199 -0
  99. package/dist/skill/docs/stack/cms/components.md +479 -0
  100. package/dist/skill/docs/stack/cms/connecting.md +199 -0
  101. package/dist/skill/docs/stack/cms/dashboard.md +39 -0
  102. package/dist/skill/docs/stack/cms/index.md +158 -0
  103. package/dist/skill/docs/stack/cms/inline-editing.md +136 -0
  104. package/dist/skill/docs/stack/cms/pages.md +275 -0
  105. package/dist/skill/docs/stack/cms/record-layouts.md +151 -0
  106. package/dist/skill/docs/stack/cms/schema-format.md +437 -0
  107. package/dist/skill/docs/stack/cms/schema-registry.md +200 -0
  108. package/dist/skill/docs/stack/cms/security.md +203 -0
  109. package/dist/skill/docs/stack/cms/table-views.md +142 -0
  110. package/dist/skill/docs/stack/index.md +65 -0
  111. package/dist/skill/docs/stack/queues/handlers.md +317 -0
  112. package/dist/skill/docs/stack/queues/index.md +56 -0
  113. package/dist/skill/docs/stack/queues/using-queues.md +192 -0
  114. package/dist/skill/docs/stack/realtime/durable-objects.md +488 -0
  115. package/dist/skill/docs/stack/realtime/index.md +67 -0
  116. package/dist/skill/docs/stack/realtime/using-realtime.md +211 -0
  117. package/dist/skill/docs/stack/storage/index.md +17 -0
  118. package/dist/skill/docs/stack/storage/kv.md +204 -0
  119. package/dist/skill/docs/stack/storage/r2.md +232 -0
  120. package/dist/skill/docs/stack/storage/using-kv.md +70 -0
  121. package/dist/skill/docs/stack/storage/using-r2.md +55 -0
  122. package/dist/skill/docs/stack/vector/embeddings.md +554 -0
  123. package/dist/skill/docs/stack/vector/index.md +44 -0
  124. package/dist/skill/docs/stack/vector/using-embeddings.md +186 -0
  125. package/dist/skill/docs/stack/webhooks/inbound.md +186 -0
  126. package/dist/skill/docs/stack/webhooks/index.md +36 -0
  127. package/dist/skill/docs/stack/webhooks/outbound.md +281 -0
  128. package/package.json +1 -1
  129. package/src/skill/SKILL.md +142 -1051
  130. package/src/skill/agents/quickback-specialist/AGENT.md +36 -0
  131. package/src/skill/docs/changelog.md +1192 -0
  132. package/src/skill/docs/compiler/claude-code-skill.md +312 -0
  133. package/src/skill/docs/compiler/cloud-compiler/authentication.md +63 -0
  134. package/src/skill/docs/compiler/cloud-compiler/cli.md +307 -0
  135. package/src/skill/docs/compiler/cloud-compiler/endpoints.md +78 -0
  136. package/src/skill/docs/compiler/cloud-compiler/index.md +65 -0
  137. package/src/skill/docs/compiler/cloud-compiler/local-compiler.md +115 -0
  138. package/src/skill/docs/compiler/cloud-compiler/troubleshooting.md +76 -0
  139. package/src/skill/docs/compiler/config/agents.md +144 -0
  140. package/src/skill/docs/compiler/config/auth.md +109 -0
  141. package/src/skill/docs/compiler/config/bindings.md +176 -0
  142. package/src/skill/docs/compiler/config/domains.md +149 -0
  143. package/src/skill/docs/compiler/config/index.md +419 -0
  144. package/src/skill/docs/compiler/config/output.md +338 -0
  145. package/src/skill/docs/compiler/config/providers.md +248 -0
  146. package/src/skill/docs/compiler/config/security.md +255 -0
  147. package/src/skill/docs/compiler/config/single-tenant.md +128 -0
  148. package/src/skill/docs/compiler/config/variables.md +157 -0
  149. package/src/skill/docs/compiler/definitions/access.md +445 -0
  150. package/src/skill/docs/compiler/definitions/actions.md +884 -0
  151. package/src/skill/docs/compiler/definitions/concepts.md +52 -0
  152. package/src/skill/docs/compiler/definitions/feature.md +164 -0
  153. package/src/skill/docs/compiler/definitions/firewall.md +285 -0
  154. package/src/skill/docs/compiler/definitions/guards.md +241 -0
  155. package/src/skill/docs/compiler/definitions/index.md +219 -0
  156. package/src/skill/docs/compiler/definitions/masking.md +241 -0
  157. package/src/skill/docs/compiler/definitions/read.md +220 -0
  158. package/src/skill/docs/compiler/definitions/schema.md +697 -0
  159. package/src/skill/docs/compiler/definitions/validation.md +35 -0
  160. package/src/skill/docs/compiler/definitions/views.md +292 -0
  161. package/src/skill/docs/compiler/getting-started/claude-code.md +126 -0
  162. package/src/skill/docs/compiler/getting-started/full-example.md +431 -0
  163. package/src/skill/docs/compiler/getting-started/hand-crafted.md +178 -0
  164. package/src/skill/docs/compiler/getting-started/index.md +192 -0
  165. package/src/skill/docs/compiler/getting-started/patterns.md +225 -0
  166. package/src/skill/docs/compiler/getting-started/template-blog.md +280 -0
  167. package/src/skill/docs/compiler/getting-started/template-cloudflare.md +260 -0
  168. package/src/skill/docs/compiler/getting-started/template-empty.md +112 -0
  169. package/src/skill/docs/compiler/getting-started/templates.md +111 -0
  170. package/src/skill/docs/compiler/index.md +85 -0
  171. package/src/skill/docs/compiler/targets/hono-api/cloudflare.md +94 -0
  172. package/src/skill/docs/compiler/targets/hono-api/database/d1.md +246 -0
  173. package/src/skill/docs/compiler/targets/hono-api/database/index.md +16 -0
  174. package/src/skill/docs/compiler/targets/hono-api/database/neon.md +144 -0
  175. package/src/skill/docs/compiler/targets/hono-api/database/using-d1.md +39 -0
  176. package/src/skill/docs/compiler/targets/hono-api/index.md +37 -0
  177. package/src/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +323 -0
  178. package/src/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +357 -0
  179. package/src/skill/docs/compiler/targets/hono-api/using-the-api/caching.md +105 -0
  180. package/src/skill/docs/compiler/targets/hono-api/using-the-api/crud.md +652 -0
  181. package/src/skill/docs/compiler/targets/hono-api/using-the-api/errors.md +224 -0
  182. package/src/skill/docs/compiler/targets/hono-api/using-the-api/index.md +37 -0
  183. package/src/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +203 -0
  184. package/src/skill/docs/compiler/targets/hono-api/using-the-api/query-params.md +199 -0
  185. package/src/skill/docs/compiler/targets/hono-api/using-the-api/views-api.md +161 -0
  186. package/src/skill/docs/compiler/targets/index.md +47 -0
  187. package/src/skill/docs/compiler/targets/supabase-rls/index.md +55 -0
  188. package/src/skill/docs/compiler/targets/supabase-rls/limitations.md +48 -0
  189. package/src/skill/docs/compiler/targets/supabase-rls/mappings.md +99 -0
  190. package/src/skill/docs/compiler/targets/supabase-rls/setup.md +88 -0
  191. package/src/skill/docs/compiler/troubleshooting.md +120 -0
  192. package/src/skill/docs/index.md +77 -0
  193. package/src/skill/docs/stack/account-ui/customization.md +378 -0
  194. package/src/skill/docs/stack/account-ui/environment-variables.md +325 -0
  195. package/src/skill/docs/stack/account-ui/features/admin.md +76 -0
  196. package/src/skill/docs/stack/account-ui/features/api-keys.md +22 -0
  197. package/src/skill/docs/stack/account-ui/features/avatars.md +37 -0
  198. package/src/skill/docs/stack/account-ui/features/cli-authorize.md +21 -0
  199. package/src/skill/docs/stack/account-ui/features/index.md +291 -0
  200. package/src/skill/docs/stack/account-ui/features/organizations.md +29 -0
  201. package/src/skill/docs/stack/account-ui/features/passkeys.md +31 -0
  202. package/src/skill/docs/stack/account-ui/features/passwordless.md +28 -0
  203. package/src/skill/docs/stack/account-ui/features/sessions.md +20 -0
  204. package/src/skill/docs/stack/account-ui/hooks.md +209 -0
  205. package/src/skill/docs/stack/account-ui/index.md +147 -0
  206. package/src/skill/docs/stack/account-ui/library-usage.md +257 -0
  207. package/src/skill/docs/stack/account-ui/standalone.md +149 -0
  208. package/src/skill/docs/stack/account-ui/with-quickback.md +160 -0
  209. package/src/skill/docs/stack/account-ui/worker.md +362 -0
  210. package/src/skill/docs/stack/auth/api-keys.md +15 -0
  211. package/src/skill/docs/stack/auth/device-auth.md +14 -0
  212. package/src/skill/docs/stack/auth/index.md +64 -0
  213. package/src/skill/docs/stack/auth/jwt-optimization.md +245 -0
  214. package/src/skill/docs/stack/auth/plugins/aws-ses.md +127 -0
  215. package/src/skill/docs/stack/auth/plugins/combo-auth.md +74 -0
  216. package/src/skill/docs/stack/auth/plugins/index.md +228 -0
  217. package/src/skill/docs/stack/auth/plugins/upgrade-anonymous.md +155 -0
  218. package/src/skill/docs/stack/auth/security.md +455 -0
  219. package/src/skill/docs/stack/auth/using-auth.md +39 -0
  220. package/src/skill/docs/stack/cms/actions.md +199 -0
  221. package/src/skill/docs/stack/cms/components.md +479 -0
  222. package/src/skill/docs/stack/cms/connecting.md +199 -0
  223. package/src/skill/docs/stack/cms/dashboard.md +39 -0
  224. package/src/skill/docs/stack/cms/index.md +158 -0
  225. package/src/skill/docs/stack/cms/inline-editing.md +136 -0
  226. package/src/skill/docs/stack/cms/pages.md +275 -0
  227. package/src/skill/docs/stack/cms/record-layouts.md +151 -0
  228. package/src/skill/docs/stack/cms/schema-format.md +437 -0
  229. package/src/skill/docs/stack/cms/schema-registry.md +200 -0
  230. package/src/skill/docs/stack/cms/security.md +203 -0
  231. package/src/skill/docs/stack/cms/table-views.md +142 -0
  232. package/src/skill/docs/stack/index.md +65 -0
  233. package/src/skill/docs/stack/queues/handlers.md +317 -0
  234. package/src/skill/docs/stack/queues/index.md +56 -0
  235. package/src/skill/docs/stack/queues/using-queues.md +192 -0
  236. package/src/skill/docs/stack/realtime/durable-objects.md +488 -0
  237. package/src/skill/docs/stack/realtime/index.md +67 -0
  238. package/src/skill/docs/stack/realtime/using-realtime.md +211 -0
  239. package/src/skill/docs/stack/storage/index.md +17 -0
  240. package/src/skill/docs/stack/storage/kv.md +204 -0
  241. package/src/skill/docs/stack/storage/r2.md +232 -0
  242. package/src/skill/docs/stack/storage/using-kv.md +70 -0
  243. package/src/skill/docs/stack/storage/using-r2.md +55 -0
  244. package/src/skill/docs/stack/vector/embeddings.md +554 -0
  245. package/src/skill/docs/stack/vector/index.md +44 -0
  246. package/src/skill/docs/stack/vector/using-embeddings.md +186 -0
  247. package/src/skill/docs/stack/webhooks/inbound.md +186 -0
  248. package/src/skill/docs/stack/webhooks/index.md +36 -0
  249. package/src/skill/docs/stack/webhooks/outbound.md +281 -0
@@ -0,0 +1,35 @@
1
+ # Validation
2
+
3
+ ## Action Input Validation
4
+
5
+ You can validate input data in custom actions using Zod schemas. The input is validated before the action handler executes:
6
+
7
+ ```typescript
8
+ // quickback/features/applications/actions.ts
9
+ import { defineActions } from '@quickback/compiler';
10
+ import { z } from 'zod';
11
+
12
+ export default defineActions(applications, {
13
+ 'advance-stage': {
14
+ description: "Move application to the next pipeline stage",
15
+ input: z.object({
16
+ stage: z.enum(["screening", "interview", "offer", "hired"]),
17
+ notes: z.string().min(1).max(500).optional(),
18
+ }),
19
+ access: { roles: ["owner", "hiring-manager"] },
20
+ execute: async ({ db, record, ctx, input }) => {
21
+ // input is validated against the Zod schema before execution
22
+ return record;
23
+ },
24
+ },
25
+ });
26
+ ```
27
+
28
+ If validation fails, the API returns a `400 Bad Request` with details about which fields failed.
29
+
30
+ See [Actions](/compiler/definitions/actions) for the full action definition reference.
31
+
32
+ > **Planned: Field-Level Validation**
33
+ >
34
+ > Field-level validation rules in `defineTable()` (e.g., `minLength`, `maxLength`, `enum`) are planned for a future release. Today, use Zod schemas in actions for input validation, and rely on your Drizzle schema constraints (`.notNull()`, column types) for database-level enforcement.
35
+
@@ -0,0 +1,292 @@
1
+ # Views - Column Level Security
2
+
3
+ Views implement **Column Level Security (CLS)** - controlling which columns users can access. This complements **Row Level Security (RLS)** provided by the [Firewall](/compiler/definitions/firewall), which controls which rows users can access.
4
+
5
+ > **Migration note**: views were previously declared at the resource top
6
+ > level (`views: {...}`). In DSL v2 they live under
7
+ > [`read.views`](/compiler/definitions/read#views-under-read-views) so the
8
+ > read pipeline owns its own configuration. The top-level form is rejected
9
+ > at compile time.
10
+
11
+ | Security Layer | Controls | Quickback Feature |
12
+ |----------------|----------|-------------------|
13
+ | Row Level Security | Which records | Firewall |
14
+ | Column Level Security | Which fields | Views |
15
+
16
+ Views provide named field projections with role-based access control. Use views to return different sets of columns to different users without duplicating CRUD endpoints.
17
+
18
+ ## When to Use Views
19
+
20
+ | Concept | Purpose | Example |
21
+ |---------|---------|---------|
22
+ | CRUD list | Full records | Returns all columns |
23
+ | Masking | Hide values | Email `j***@c******.com` |
24
+ | Views | Exclude columns | Only `id`, `name`, `source` |
25
+
26
+ - **CRUD list** returns all fields to authorized users
27
+ - **Masking** transforms sensitive values but still includes the column
28
+ - **Views** completely exclude columns from the response
29
+
30
+ ## Basic Usage
31
+
32
+ ```typescript
33
+ // features/candidates/candidates.ts
34
+ import { sqliteTable, text } from 'drizzle-orm/sqlite-core';
35
+ import { defineTable } from '@quickback/compiler';
36
+
37
+ export const candidates = sqliteTable('candidates', {
38
+ id: text('id').primaryKey(),
39
+ name: text('name').notNull(),
40
+ email: text('email').notNull(),
41
+ phone: text('phone'),
42
+ source: text('source'),
43
+ resumeUrl: text('resume_url'),
44
+ internalNotes: text('internal_notes'),
45
+ organizationId: text('organization_id').notNull(),
46
+ });
47
+
48
+ export default defineTable(candidates, {
49
+ masking: {
50
+ email: { type: 'email', show: { roles: ['hiring-manager', 'recruiter'] } },
51
+ phone: { type: 'phone', show: { roles: ['hiring-manager', 'recruiter'] } },
52
+ },
53
+
54
+ read: {
55
+ access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
56
+
57
+ // Named field projections
58
+ views: {
59
+ pipeline: {
60
+ fields: ['id', 'name', 'source'],
61
+ access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
62
+ },
63
+ full: {
64
+ fields: ['id', 'name', 'email', 'phone', 'source', 'resumeUrl', 'internalNotes'],
65
+ access: { roles: ['hiring-manager', 'recruiter'] },
66
+ },
67
+ report: {
68
+ fields: ['id', 'name', 'source', 'createdAt'],
69
+ access: { roles: ['owner', 'hiring-manager'] },
70
+ },
71
+ },
72
+ },
73
+ });
74
+ ```
75
+
76
+ ## Generated Endpoints
77
+
78
+ Each view generates **two** equivalent GET endpoints — pick whichever is more ergonomic for your client:
79
+
80
+ ```
81
+ GET /api/v1/candidates # Full read - read.access fields
82
+ GET /api/v1/candidates?view=pipeline # Query-string dispatch
83
+ GET /api/v1/candidates/views/pipeline # Explicit path form
84
+ GET /api/v1/candidates?view=full # hiring-manager/recruiter only
85
+ GET /api/v1/candidates/views/report # report fields
86
+ ```
87
+
88
+ The `?view=` query-string form is convenient when the rest of your client
89
+ already builds collection URLs and you only need to swap the projection.
90
+ The `/views/{name}` path form is better when you want a stable URL per
91
+ projection.
92
+
93
+ ## Query Parameters
94
+
95
+ Views support the same query parameters as the list endpoint:
96
+
97
+ ### Pagination
98
+
99
+ | Parameter | Description | Default | Max |
100
+ |-----------|-------------|---------|-----|
101
+ | `limit` | Number of records to return | 50 | 100 |
102
+ | `offset` | Number of records to skip | 0 | - |
103
+
104
+ ```bash
105
+ # Get first 10 records
106
+ GET /api/v1/candidates/views/pipeline?limit=10
107
+
108
+ # Get records 11-20
109
+ GET /api/v1/candidates/views/pipeline?limit=10&offset=10
110
+ ```
111
+
112
+ ### Filtering
113
+
114
+ ```bash
115
+ # Filter by exact value
116
+ GET /api/v1/candidates/views/pipeline?source=linkedin
117
+
118
+ # Filter with operators
119
+ GET /api/v1/candidates/views/pipeline?createdAt.gt=2024-01-01
120
+
121
+ # Multiple filters (AND logic)
122
+ GET /api/v1/candidates/views/pipeline?source=linkedin&name.like=Smith
123
+ ```
124
+
125
+ ### Sorting
126
+
127
+ | Parameter | Description | Default |
128
+ |-----------|-------------|---------|
129
+ | `sort` | Field to sort by | `createdAt` |
130
+ | `order` | Sort direction (`asc` or `desc`) | `desc` |
131
+
132
+ ```bash
133
+ GET /api/v1/candidates/views/pipeline?sort=name&order=asc
134
+ ```
135
+
136
+ ## Security
137
+
138
+ All four security pillars apply to views:
139
+
140
+ | Pillar | Behavior |
141
+ |--------|----------|
142
+ | **Firewall** | WHERE clause applied (same as list) |
143
+ | **Access** | Per-view access control |
144
+ | **Guards** | N/A (read-only) |
145
+ | **Masking** | Applied to returned fields |
146
+
147
+ ### Firewall
148
+
149
+ Views automatically apply the same firewall conditions as the list endpoint. Users only see records within their organization scope.
150
+
151
+ ### Access Control
152
+
153
+ Each view has its own access configuration:
154
+
155
+ ```typescript
156
+ read: {
157
+ access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
158
+ views: {
159
+ // Pipeline view - available to all roles
160
+ pipeline: {
161
+ fields: ['id', 'name', 'source'],
162
+ access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
163
+ },
164
+ // Full view - recruiter and above
165
+ full: {
166
+ fields: ['id', 'name', 'source', 'email', 'phone', 'internalNotes'],
167
+ access: { roles: ['hiring-manager', 'recruiter'] },
168
+ },
169
+ },
170
+ }
171
+ ```
172
+
173
+ ### Masking
174
+
175
+ Masking rules are applied to the returned fields. If a view includes a masked field like `email`, the masking rules still apply:
176
+
177
+ ```typescript
178
+ masking: {
179
+ email: { type: 'email', show: { roles: ['hiring-manager', 'recruiter'] } },
180
+ },
181
+
182
+ read: {
183
+ access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
184
+ views: {
185
+ // Even if an interviewer accesses the 'full' view, email will be masked
186
+ // because masking rules take precedence
187
+ full: {
188
+ fields: ['id', 'name', 'email'],
189
+ access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
190
+ },
191
+ },
192
+ }
193
+ ```
194
+
195
+ ### How Views and Masking Work Together
196
+
197
+ Views and masking are orthogonal concerns:
198
+ - **Views** control field selection (which columns appear)
199
+ - **Masking** controls field transformation (how values appear based on role)
200
+
201
+ Example configuration:
202
+
203
+ ```typescript
204
+ masking: {
205
+ email: { type: 'email', show: { roles: ['hiring-manager', 'recruiter'] } },
206
+ },
207
+
208
+ read: {
209
+ access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
210
+ views: {
211
+ pipeline: {
212
+ fields: ['id', 'name'], // email NOT included
213
+ access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
214
+ },
215
+ full: {
216
+ fields: ['id', 'name', 'email'], // email included
217
+ access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
218
+ },
219
+ },
220
+ }
221
+ ```
222
+
223
+ | Endpoint | Role | `email` in response? | `email` value |
224
+ |----------|------|---------------------|---------------|
225
+ | `/views/pipeline` | interviewer | No | N/A |
226
+ | `/views/pipeline` | recruiter | No | N/A |
227
+ | `/views/full` | interviewer | Yes | `j***@c******.com` |
228
+ | `/views/full` | recruiter | Yes | `jane@company.com` |
229
+
230
+ ## Response Format
231
+
232
+ View responses include metadata about the view:
233
+
234
+ ```json
235
+ {
236
+ "data": [
237
+ { "id": "cnd_123", "name": "Jane Doe", "source": "linkedin" },
238
+ { "id": "cnd_456", "name": "John Smith", "source": "referral" }
239
+ ],
240
+ "view": "pipeline",
241
+ "fields": ["id", "name", "source"],
242
+ "pagination": {
243
+ "limit": 50,
244
+ "offset": 0,
245
+ "count": 2
246
+ }
247
+ }
248
+ ```
249
+
250
+ ## Complete Example
251
+
252
+ ```typescript
253
+ // features/jobs/jobs.ts
254
+ export default defineTable(jobs, {
255
+ guards: {
256
+ createable: ['title', 'department', 'status', 'salaryMin', 'salaryMax'],
257
+ updatable: ['title', 'department', 'status'],
258
+ },
259
+
260
+ masking: {
261
+ salaryMin: { type: 'redact', show: { roles: ['owner', 'hiring-manager'] } },
262
+ salaryMax: { type: 'redact', show: { roles: ['owner', 'hiring-manager'] } },
263
+ },
264
+
265
+ read: {
266
+ access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
267
+ views: {
268
+ // Public job board view
269
+ board: {
270
+ fields: ['id', 'title', 'department', 'status'],
271
+ access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
272
+ },
273
+ // Internal view with salary info
274
+ internal: {
275
+ fields: ['id', 'title', 'department', 'status', 'salaryMin', 'salaryMax'],
276
+ access: { roles: ['owner', 'hiring-manager'] },
277
+ },
278
+ // Compensation report
279
+ compensation: {
280
+ fields: ['id', 'title', 'department', 'salaryMin', 'salaryMax'],
281
+ access: { roles: ['owner', 'hiring-manager'] },
282
+ },
283
+ },
284
+ },
285
+
286
+ crud: {
287
+ create: { access: { roles: ['owner', 'hiring-manager'] } },
288
+ update: { access: { roles: ['owner', 'hiring-manager'] } },
289
+ delete: { access: { roles: ['owner', 'hiring-manager'] } },
290
+ },
291
+ });
292
+ ```
@@ -0,0 +1,126 @@
1
+ # AI Tools
2
+
3
+ The Quickback CLI ships with built-in support for AI developer tools. One install gets you a Claude Code skill, Cursor IDE rules, and an MCP server that works with any AI tool.
4
+
5
+ ## MCP Server
6
+
7
+ The MCP server exposes Quickback documentation, project config, and feature definitions to any MCP-compatible AI tool — Claude Desktop, Cursor, VS Code Copilot, Windsurf, and more.
8
+
9
+ ### Setup
10
+
11
+ Add to your AI tool's MCP configuration:
12
+
13
+ ```json
14
+ {
15
+ "mcpServers": {
16
+ "quickback": {
17
+ "command": "npx",
18
+ "args": ["@quickback-dev/cli", "mcp"]
19
+ }
20
+ }
21
+ }
22
+ ```
23
+
24
+ **Where to put this:**
25
+
26
+ | Tool | Config File |
27
+ |------|-------------|
28
+ | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) |
29
+ | Cursor | `.cursor/mcp.json` in your project root |
30
+ | VS Code (Copilot) | `.vscode/mcp.json` in your project root |
31
+
32
+ ### What the MCP Server Provides
33
+
34
+ **Documentation tools:**
35
+
36
+ | Tool | Description |
37
+ |------|-------------|
38
+ | `list_topics` | List all 100+ documentation topics |
39
+ | `get_doc` | Get a specific doc by name (supports fuzzy matching) |
40
+ | `search_docs` | Search documentation content by keyword |
41
+
42
+ **Project-aware tools** (when running inside a Quickback project):
43
+
44
+ | Tool | Description |
45
+ |------|-------------|
46
+ | `read_config` | Read your `quickback.config.ts` |
47
+ | `list_features` | List all features and their table files |
48
+ | `read_feature` | Read the source code of a specific feature |
49
+ | `read_schema_registry` | Read the compiled `schema-registry.json` |
50
+
51
+ The MCP server also registers every documentation topic as an MCP resource at `quickback://docs/{topic}`.
52
+
53
+ ---
54
+
55
+ ## Claude Code Skill
56
+
57
+ The Claude Code skill gives Claude deep knowledge of Quickback's security layers, patterns, and APIs. It also activates a specialist agent for generating complete feature definitions.
58
+
59
+ ### Install
60
+
61
+ ```bash
62
+ quickback claude install
63
+ ```
64
+
65
+ **Options:**
66
+
67
+ | Flag | Description |
68
+ |------|-------------|
69
+ | `--global` | Install to `~/.claude/` (available in all projects) |
70
+ | `--local` | Install to `./quickback/.claude/` (project-specific) |
71
+
72
+ ### Manage
73
+
74
+ ```bash
75
+ quickback claude status # Check installation
76
+ quickback claude update # Update to latest version
77
+ quickback claude remove # Remove the skill
78
+ ```
79
+
80
+ ### What You Get
81
+
82
+ - **Quickback Skill** — Claude understands `defineTable()`, `defineActions()`, security pillars, provider options, and the compiler workflow
83
+ - **Specialist Agent** — Automatically activates when creating resources, configuring security, or defining actions. Generates complete, working code in your `quickback/features/` directory.
84
+
85
+ ---
86
+
87
+ ## Cursor IDE Rules
88
+
89
+ Cursor rules provide Quickback context directly to Cursor's AI, activated automatically when editing `quickback/**/*.ts` files.
90
+
91
+ ### Install
92
+
93
+ ```bash
94
+ quickback cursor install
95
+ ```
96
+
97
+ This copies `quickback.mdc` to `.cursor/rules/` in your project. Consider committing this file to your repo so your team gets the rules automatically.
98
+
99
+ ### Manage
100
+
101
+ ```bash
102
+ quickback cursor status # Check installation
103
+ quickback cursor update # Update to latest version
104
+ quickback cursor remove # Remove the rules
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Usage Examples
110
+
111
+ With any of these tools installed, you can ask your AI to:
112
+
113
+ ```
114
+ "Create a candidates feature with org-scoped firewall and email/phone masking"
115
+
116
+ "Add an 'approve' action to expenses that sets status and records the approver"
117
+
118
+ "Show me the firewall documentation"
119
+
120
+ "What security layers does my current project have configured?"
121
+ ```
122
+
123
+ ## See Also
124
+
125
+ - [Claude Code Plugin](/compiler/claude-code-skill) — Full plugin reference
126
+ - [Getting Started](/compiler/getting-started) — Project setup guide