create-ailk 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/README.md +43 -4
  2. package/component-catalog.json +146 -21
  3. package/component-catalog.md +9 -6
  4. package/dist/add-module-core.d.ts +22 -0
  5. package/dist/add-module-core.js +50 -0
  6. package/dist/add-module.d.ts +89 -0
  7. package/dist/add-module.js +334 -0
  8. package/dist/category-profile.d.ts +126 -0
  9. package/dist/category-profile.js +262 -0
  10. package/dist/cli.js +73 -11
  11. package/dist/index.d.ts +4 -2
  12. package/dist/index.js +6 -1
  13. package/dist/lib/extract-module-bundle.d.ts +56 -1
  14. package/dist/lib/extract-module-bundle.js +165 -13
  15. package/dist/lib/license-key-files.d.ts +15 -0
  16. package/dist/lib/license-key-files.js +102 -0
  17. package/dist/lib/pro-callout.d.ts +16 -10
  18. package/dist/lib/pro-callout.js +26 -3
  19. package/dist/license-set.d.ts +34 -0
  20. package/dist/license-set.js +194 -0
  21. package/dist/module-architecture.d.ts +20 -0
  22. package/dist/module-architecture.js +77 -19
  23. package/dist/modules/commerce/0.6.1.tar.gz +0 -0
  24. package/dist/modules/docs-blog/0.6.1.tar.gz +0 -0
  25. package/dist/modules/marketing-site/0.6.1.tar.gz +0 -0
  26. package/dist/modules/minimalism-site/0.6.1.tar.gz +0 -0
  27. package/dist/modules/multi-tenant/0.6.1.tar.gz +0 -0
  28. package/dist/modules/saas-product/0.6.1.tar.gz +0 -0
  29. package/dist/modules/scheduling/0.6.1.tar.gz +0 -0
  30. package/dist/modules/signal-collectors/0.6.1.tar.gz +0 -0
  31. package/dist/modules/simple-service/0.6.1.tar.gz +0 -0
  32. package/dist/modules/workspace/0.6.1.tar.gz +0 -0
  33. package/dist/parse-args.d.ts +7 -0
  34. package/dist/parse-args.js +23 -1
  35. package/dist/programmatic.d.ts +46 -0
  36. package/dist/programmatic.js +130 -9
  37. package/dist/site-chrome.d.ts +18 -7
  38. package/dist/site-chrome.js +32 -14
  39. package/dist/site-roster.d.ts +127 -0
  40. package/dist/site-roster.js +494 -0
  41. package/dist/surfaces.d.ts +20 -7
  42. package/dist/surfaces.js +149 -28
  43. package/dist/sync-routes.d.ts +9 -0
  44. package/dist/sync-routes.js +2 -2
  45. package/dist/template-manifest.d.ts +58 -2
  46. package/dist/template-manifest.js +196 -69
  47. package/package.json +6 -4
  48. package/site-templates/_base/content/en/BookCall/book-call.mdx +53 -0
  49. package/site-templates/_base/content/en/GlossaryList/glossary.mdx +66 -0
  50. package/site-templates/_base/content/en/NewsletterSignup/newsletter.mdx +68 -0
  51. package/site-templates/_base/content/en/Pricing/pricing.mdx +71 -62
  52. package/site-templates/_base/content/en/PrivacyPage/privacy.mdx +2 -3
  53. package/site-templates/_base/content/en/TermsPage/terms.mdx +2 -3
  54. package/site-templates/_base/content/en/UseCase/first-use-case.mdx +23 -0
  55. package/site-templates/_base/content/en/UseCase/second-use-case.mdx +23 -0
  56. package/site-templates/_base/content/en/UseCase/third-use-case.mdx +23 -0
  57. package/site-templates/designs/minimalism/DESIGN.md +162 -0
  58. package/site-templates/designs/standard/DESIGN.md +162 -0
  59. package/site-templates/marketing-site/DESIGN.md +55 -41
  60. package/site-templates/marketing-site/TEMPLATE-MANIFEST.json +312 -57
  61. package/site-templates/marketing-site/TEMPLATE-MANIFEST.md +209 -90
  62. package/site-templates/marketing-site/ailk-template.json +1 -0
  63. package/site-templates/marketing-site-free/DESIGN.md +55 -41
  64. package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.json +260 -66
  65. package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.md +294 -114
  66. package/site-templates/marketing-site-free/ailk-template.json +3 -2
  67. package/site-templates/minimalism-site/DESIGN.md +54 -40
  68. package/site-templates/minimalism-site/TEMPLATE-MANIFEST.json +246 -19
  69. package/site-templates/minimalism-site/TEMPLATE-MANIFEST.md +185 -51
  70. package/site-templates/minimalism-site/ailk-template.json +3 -2
  71. package/site-templates/minimalism-site/content/en/BookCall/book-call.mdx +53 -0
  72. package/site-templates/minimalism-site/content/en/ContactPage/contact.mdx +3 -37
  73. package/site-templates/minimalism-site/content/en/PurchasePolicyPage/purchase-policy.mdx +124 -0
  74. package/site-templates/saas-product/DESIGN.md +55 -41
  75. package/site-templates/simple-service/DESIGN.md +55 -41
  76. package/site-templates/simple-service/TEMPLATE-MANIFEST.json +135 -26
  77. package/site-templates/simple-service/TEMPLATE-MANIFEST.md +114 -59
  78. package/site-templates/simple-service/ailk-template.json +4 -3
  79. package/site-templates/simple-service/content/en/BookCall/book-call.mdx +53 -0
  80. package/site-templates/simple-service/content/en/ContactPage/contact.mdx +1 -36
  81. package/site-templates/simple-service/content/en/PurchasePolicyPage/purchase-policy.mdx +124 -0
  82. package/templates/.claude/settings.json +15 -0
  83. package/templates/.claude/skills/README.md +8 -8
  84. package/templates/.claude/skills/{scaffold-auth → add-auth}/SKILL.md +7 -7
  85. package/templates/.claude/skills/{scaffold-auth → add-auth}/references/env-vars.md +2 -2
  86. package/templates/.claude/skills/{scaffold-auth → add-auth}/references/oauth-app-setup.md +3 -3
  87. package/templates/.claude/skills/{scaffold-page → add-page}/SKILL.md +76 -62
  88. package/templates/.claude/skills/add-page/references/page-types.md +111 -0
  89. package/templates/.claude/skills/{scaffold-page → add-page}/templates/content.mdx.tmpl +4 -4
  90. package/templates/.claude/skills/{scaffold-page → add-page}/templates/route.tsx.tmpl +1 -1
  91. package/templates/.claude/skills/{audit-site → check-site}/SKILL.md +16 -17
  92. package/templates/.claude/skills/{audit-site → check-site}/references/common-errors.md +3 -3
  93. package/templates/.claude/skills/{audit-site → check-site}/references/findings-glossary.md +16 -14
  94. package/templates/.claude/skills/{audit-site → check-site}/references/severity-levels.md +1 -1
  95. package/templates/.claude/skills/fill-page/SKILL.md +180 -0
  96. package/templates/.claude/skills/fill-page/profiles/plumbing.yaml +80 -0
  97. package/templates/.claude/skills/fill-page/references/section-sources.md +41 -0
  98. package/templates/.claude/skills/{provision-config → setup-deploy}/SKILL.md +8 -8
  99. package/templates/.claude/skills/{provision-config → setup-deploy}/references/env-vars-template.md +2 -2
  100. package/templates/.claude/skills/{provision-config → setup-deploy}/references/runbook-template.md +8 -8
  101. package/templates/.claude/skills/{provision-config → setup-deploy}/references/vercel-json-template.md +1 -1
  102. package/templates/.claude/skills/upgrade-plan/SKILL.md +117 -0
  103. package/templates/.claude/skills/upgrade-plan/references/options.md +24 -0
  104. package/templates/.claude/skills/upgrade-plan/scripts/upgrade-plan.ts +527 -0
  105. package/templates/.github/workflows/ci.yml +5 -0
  106. package/templates/CLAUDE.md +8 -2
  107. package/templates/DESIGN.md +52 -45
  108. package/templates/README.md +108 -46
  109. package/templates/apps/api/.env.example +2 -1
  110. package/templates/apps/api/package.json +1 -1
  111. package/templates/apps/api/src/config/__tests__/index.test.ts +37 -2
  112. package/templates/apps/api/src/config/index.ts +19 -6
  113. package/templates/apps/api/src/lib/license-key-store.ts +45 -0
  114. package/templates/apps/api/src/lib/site.ts +5 -3
  115. package/templates/apps/api/src/middleware/__tests__/auth.database-not-configured.test.ts +97 -0
  116. package/templates/apps/api/src/middleware/auth.ts +9 -0
  117. package/templates/apps/api/src/routes/content/__tests__/get-page.test.ts +127 -5
  118. package/templates/apps/api/src/routes/content/get-page.ts +86 -2
  119. package/templates/apps/api/src/server.ts +6 -0
  120. package/templates/apps/mcp/__tests__/audit-single-page.test.ts +75 -1
  121. package/templates/apps/mcp/__tests__/lib/audit-single-page-readiness-scan.test.ts +57 -9
  122. package/templates/apps/mcp/package.json +2 -1
  123. package/templates/apps/mcp/src/index.ts +7 -0
  124. package/templates/apps/mcp/src/lib/audit-single-page.ts +36 -10
  125. package/templates/apps/mcp/src/lib/license-key-store.ts +45 -0
  126. package/templates/apps/web/__tests__/setup.ts +18 -0
  127. package/templates/apps/web/app/[locale]/(auth)/forgot-password/forgot-password-card.tsx +10 -2
  128. package/templates/apps/web/app/[locale]/(auth)/layout.tsx +2 -2
  129. package/templates/apps/web/app/[locale]/(auth)/reset-password/reset-password-card.tsx +10 -4
  130. package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-card.tsx +22 -14
  131. package/templates/apps/web/app/[locale]/(auth)/sign-up/sign-up-card.tsx +26 -18
  132. package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +12 -4
  133. package/templates/apps/web/app/[locale]/[slug]/__tests__/page.test.tsx +35 -4
  134. package/templates/apps/web/app/[locale]/[slug]/page.tsx +49 -9
  135. package/templates/apps/web/app/[locale]/book-a-call/page.tsx +50 -0
  136. package/templates/apps/web/app/[locale]/careers/__tests__/page-renderer-migration.test.tsx +3 -3
  137. package/templates/apps/web/app/[locale]/case-studies/__tests__/page-renderer-migration.test.tsx +3 -3
  138. package/templates/apps/web/app/[locale]/clients/__tests__/page-renderer-migration.test.tsx +3 -4
  139. package/templates/apps/web/app/[locale]/contact/ContactForm.tsx +94 -33
  140. package/templates/apps/web/app/[locale]/contact/ConversationalIntakeWrapper.tsx +53 -23
  141. package/templates/apps/web/app/[locale]/contact/__tests__/ContactForm.test.tsx +96 -0
  142. package/templates/apps/web/app/[locale]/contact/__tests__/ConversationalIntakeWrapper.test.tsx +84 -2
  143. package/templates/apps/web/app/[locale]/contact/__tests__/page-renderer-migration.test.tsx +5 -6
  144. package/templates/apps/web/app/[locale]/contact/page.tsx +25 -7
  145. package/templates/apps/web/app/[locale]/courses/__tests__/page-renderer-migration.test.tsx +3 -3
  146. package/templates/apps/web/app/[locale]/downloads/__tests__/page-renderer-migration.test.tsx +3 -4
  147. package/templates/apps/web/app/[locale]/events/__tests__/page-renderer-migration.test.tsx +4 -5
  148. package/templates/apps/web/app/[locale]/glossary/page.tsx +50 -0
  149. package/templates/apps/web/app/[locale]/how-to/__tests__/page-renderer-migration.test.tsx +1 -1
  150. package/templates/apps/web/app/[locale]/how-to/page.tsx +25 -15
  151. package/templates/apps/web/app/[locale]/integrations/__tests__/page-renderer-migration.test.tsx +3 -3
  152. package/templates/apps/web/app/[locale]/layout.tsx +113 -51
  153. package/templates/apps/web/app/[locale]/newsletter/page.tsx +50 -0
  154. package/templates/apps/web/app/[locale]/partners/__tests__/page-renderer-migration.test.tsx +3 -3
  155. package/templates/apps/web/app/[locale]/products/__tests__/page-renderer-migration.test.tsx +3 -3
  156. package/templates/apps/web/app/[locale]/projects/__tests__/page-renderer-migration.test.tsx +4 -5
  157. package/templates/apps/web/app/[locale]/{shipping → purchase-policy}/page.tsx +15 -10
  158. package/templates/apps/web/app/[locale]/resources/__tests__/page-renderer-migration.test.tsx +4 -5
  159. package/templates/apps/web/app/[locale]/services/__tests__/page-renderer-migration.test.tsx +3 -3
  160. package/templates/apps/web/app/[locale]/software/[slug]/page.tsx +14 -1
  161. package/templates/apps/web/app/[locale]/software/__tests__/page-renderer-migration.test.tsx +1 -1
  162. package/templates/apps/web/app/[locale]/software/page.tsx +25 -15
  163. package/templates/apps/web/app/[locale]/tech-articles/__tests__/page-renderer-migration.test.tsx +1 -1
  164. package/templates/apps/web/app/[locale]/tech-articles/page.tsx +25 -15
  165. package/templates/apps/web/app/[locale]/testimonials/__tests__/page-renderer-migration.test.tsx +3 -4
  166. package/templates/apps/web/app/[locale]/use-cases/[slug]/page.tsx +48 -0
  167. package/templates/apps/web/app/[locale]/use-cases/__tests__/page-renderer-migration.test.tsx +3 -4
  168. package/templates/apps/web/app/[locale]/use-cases/page.tsx +15 -2
  169. package/templates/apps/web/app/[locale]/whitepapers/__tests__/page-renderer-migration.test.tsx +1 -1
  170. package/templates/apps/web/app/[locale]/whitepapers/page.tsx +25 -15
  171. package/templates/apps/web/app/error-fallback.tsx +17 -45
  172. package/templates/apps/web/app/not-found.tsx +14 -38
  173. package/templates/apps/web/app/og/route.tsx +6 -0
  174. package/templates/apps/web/eslint.config.mjs +3 -0
  175. package/templates/apps/web/instrumentation.ts +14 -0
  176. package/templates/apps/web/lib/__tests__/structured-data.test.tsx +38 -0
  177. package/templates/apps/web/lib/license-key-store.ts +52 -0
  178. package/templates/apps/web/lib/nav-config.ts +64 -12
  179. package/templates/apps/web/lib/prisma-for-auth.ts +9 -6
  180. package/templates/apps/web/lib/site-brand.tsx +1 -1
  181. package/templates/apps/web/lib/site-chrome.ts +3 -3
  182. package/templates/apps/web/lib/site-identity.ts +134 -0
  183. package/templates/apps/web/lib/site-theme.ts +11 -0
  184. package/templates/apps/web/messages/en.json +52 -37
  185. package/templates/apps/web/public/android-chrome-192x192.png +0 -0
  186. package/templates/apps/web/public/android-chrome-512x512.png +0 -0
  187. package/templates/apps/web/public/apple-touch-icon.png +0 -0
  188. package/templates/apps/web/public/favicon-16x16.png +0 -0
  189. package/templates/apps/web/public/favicon-32x32.png +0 -0
  190. package/templates/apps/web/public/favicon.ico +0 -0
  191. package/templates/apps/web/public/favicon.svg +3 -3
  192. package/templates/apps/web/public/logomark.svg +6 -3
  193. package/templates/apps/web/public/logos/ai-launch-kit-light.svg +4 -0
  194. package/templates/apps/web/public/logos/ai-launch-kit.svg +4 -0
  195. package/templates/apps/web/public/logos/atomic-agent-light.svg +4 -0
  196. package/templates/apps/web/public/logos/atomic-agent.svg +4 -0
  197. package/templates/apps/web/public/logos/salessmyth-light.svg +4 -0
  198. package/templates/apps/web/public/logos/salessmyth.svg +4 -0
  199. package/templates/apps/web/public/site.webmanifest +4 -4
  200. package/templates/apps/web/public/wordmark-light.svg +4 -0
  201. package/templates/apps/web/public/wordmark.svg +3 -3
  202. package/templates/apps/web/security-headers.config.ts +5 -1
  203. package/templates/content/_site.mdx +23 -0
  204. package/templates/content/en/AboutPage/about.mdx +150 -144
  205. package/templates/content/en/BlogList/blog.mdx +105 -0
  206. package/templates/content/en/ContactPage/contact.mdx +44 -85
  207. package/templates/content/en/FAQPage/faq.mdx +86 -57
  208. package/templates/content/en/HomePage/home.mdx +276 -217
  209. package/templates/content/en/PurchasePolicyPage/purchase-policy.mdx +182 -0
  210. package/templates/content/en/SoftwareProduct/product.mdx +175 -0
  211. package/templates/content/en/UseCasesList/use-cases.mdx +170 -0
  212. package/templates/database/CHANGELOG.md +7 -0
  213. package/templates/database/package.json +1 -1
  214. package/templates/package.json +3 -1
  215. package/templates/tools/lint-architecture.ts +315 -0
  216. package/templates/tools/tsconfig.json +14 -0
  217. package/versions.json +33 -33
  218. package/templates/.claude/skills/add-schema/SKILL.md +0 -277
  219. package/templates/.claude/skills/add-schema/references/conflict-handling.md +0 -200
  220. package/templates/.claude/skills/add-schema/references/file-finding.md +0 -123
  221. package/templates/.claude/skills/add-schema/references/schema-types.md +0 -234
  222. package/templates/.claude/skills/scaffold-page/references/page-types.md +0 -169
  223. package/templates/.claude/skills/suggest-site-pages/SKILL.md +0 -242
  224. package/templates/.claude/skills/suggest-site-pages/references/categories.md +0 -287
  225. package/templates/apps/web/app/[locale]/cancellation/page.tsx +0 -44
  226. package/templates/apps/web/app/[locale]/returns/page.tsx +0 -44
  227. package/templates/content/en/CancellationPolicyPage/cancellation.mdx +0 -108
  228. package/templates/content/en/LandingPage/blog.mdx +0 -83
  229. package/templates/content/en/LandingPage/features.mdx +0 -103
  230. package/templates/content/en/LandingPage/how-it-works.mdx +0 -143
  231. package/templates/content/en/ReturnsPolicyPage/returns.mdx +0 -108
  232. package/templates/content/en/ShippingPolicyPage/shipping.mdx +0 -108
@@ -1,200 +0,0 @@
1
- # Conflict Handling — Replace / Append / Ask
2
-
3
- When `add-schema` is asked to attach a schema to a page that
4
- already has JSON-LD, the resolution depends on (a) whether the
5
- incoming type is **primary** or **supplementary** per
6
- `references/schema-types.md`, and (b) what's already there.
7
-
8
- This file is the decision tree the skill applies in Steps 4–5 of
9
- the SKILL.md mechanic.
10
-
11
- ## The decision tree
12
-
13
- ```
14
- ┌─────────────────────────────────┐
15
- │ New schema — type T, page P │
16
- └─────────────────┬───────────────┘
17
- ▼
18
- ┌────────────────────────────────────┐
19
- │ Existing JSON-LD on page P? │
20
- └─┬─────────────────┬────────────────┘
21
- │ │
22
- No│ Yes│
23
- ▼ ▼
24
- ┌──────────┐ ┌─────────────────────────────┐
25
- │ APPEND │ │ Existing schema parseable? │
26
- │ (first │ │ (canonical <JsonLd> │
27
- │ attach) │ │ pattern only) │
28
- └──────────┘ └──┬──────────────┬───────────┘
29
- │ │
30
- No│ Yes│
31
- ▼ ▼
32
- ┌────────────┐ ┌──────────────────────┐
33
- │ ASK │ │ Same @type as T? │
34
- │ (consumer │ └──┬────────────────┬──┘
35
- │ decides: │ │ │
36
- │ alongside │ Yes│ No│
37
- │ / │ ▼ ▼
38
- │ migrate / │ ┌─────────────┐ ┌──────────────────┐
39
- │ cancel) │ │ T is │ │ APPEND │
40
- └────────────┘ │ primary? │ │ (different types │
41
- └─┬───────┬───┘ │ always stack) │
42
- │ │ └──────────────────┘
43
- Yes│ No│
44
- ▼ ▼
45
- ┌──────────┐ ┌──────────┐
46
- │ REPLACE │ │ APPEND │
47
- │ (after │ │ (supp. │
48
- │ confirm) │ │ stacks) │
49
- └──────────┘ └──────────┘
50
- ```
51
-
52
- ## Case-by-case
53
-
54
- ### Case 1 — No existing JSON-LD
55
-
56
- **Action:** APPEND (first attachment).
57
-
58
- Add the import line + `<JsonLd>` JSX element. Confirm via Step 7
59
- diff before write. This is the simplest path.
60
-
61
- ### Case 2 — Existing JSON-LD, same `@type`, primary type
62
-
63
- **Action:** REPLACE (after confirming).
64
-
65
- Example: page has `<JsonLd schema={buildProduct(oldProduct)}/>`,
66
- consumer asks to add `Product` schema. The new `Product` replaces
67
- the old one — locating the existing JSX, swapping the
68
- `schema={…}` expression.
69
-
70
- Confirmation message:
71
-
72
- > "`Product` schema is already attached to `/<slug>`. I'll replace
73
- > it with the new one. The old expression
74
- > `buildProduct(oldProduct)` becomes
75
- > `buildProduct(newProduct)` — confirm or cancel."
76
-
77
- ### Case 3 — Existing JSON-LD, same `@type`, supplementary type
78
-
79
- **Action:** APPEND (supplementary stacks).
80
-
81
- This is rare but valid. Example: page has `<JsonLd
82
- schema={buildReview(review1)}/>`, consumer asks to add another
83
- `Review`. Reviews can stack — append a second `<JsonLd>` element
84
- rather than replacing.
85
-
86
- If unsure whether the consumer meant replace or append, ask:
87
-
88
- > "There's already a `Review` schema on this page. I can:
89
- >
90
- > - Add a second `Review` (stack — both visible in
91
- > structured data).
92
- > - Replace the existing one (only the new review is visible).
93
- >
94
- > Which?"
95
-
96
- ### Case 4 — Existing JSON-LD, different `@type`
97
-
98
- **Action:** APPEND.
99
-
100
- Example: page has `<JsonLd schema={buildOrganization(...)}/>`,
101
- consumer asks to add `FAQPage`. Different types always stack — add
102
- a new `<JsonLd>` element next to the existing one.
103
-
104
- This is the most common case for supplementary types
105
- (`FAQPage`, `HowTo`, `BreadcrumbList`, `Review`,
106
- `AggregateRating`).
107
-
108
- ### Case 5 — Existing JSON-LD is non-canonical
109
-
110
- **Action:** ASK.
111
-
112
- Triggers when the existing structured data:
113
-
114
- - Uses a raw `<script type="application/ld+json">` block.
115
- - Uses a hand-coded JSON literal (no builder import).
116
- - Uses `metadata.other` in `generateMetadata`.
117
- - Has `<JsonLd>` JSX with a `schema` prop that doesn't match a
118
- recognized builder call.
119
-
120
- The skill must not silently rewrite. Ask:
121
-
122
- > "I see existing structured data on this page that wasn't
123
- > created by the canonical `<JsonLd schema={builder(...)}/>`
124
- > pattern. I can:
125
- >
126
- > - **Add alongside** — leave the existing data, add my new
127
- > schema as a separate `<JsonLd>` element.
128
- > - **Migrate to canonical** — replace the existing structured
129
- > data with the canonical pattern, then add my new schema.
130
- > - **Cancel** — leave the file alone.
131
- >
132
- > Which?"
133
-
134
- Wait for choice. The "migrate to canonical" path is the deepest —
135
- it requires parsing the existing JSON-LD object literal,
136
- inferring the builder, and rewriting. Don't attempt unless the
137
- consumer explicitly chooses migrate.
138
-
139
- ### Case 6 — Existing JSON-LD is malformed / unparseable
140
-
141
- **Action:** ASK with a stronger refuse-default.
142
-
143
- Triggers when the file's JSON-LD block can't be parsed at all (broken
144
- JSX, malformed JSON literal, syntax error). The default is **don't
145
- touch the existing data**:
146
-
147
- > "There's existing JSON-LD on this page that doesn't parse
148
- > cleanly. I shouldn't rewrite it without you seeing what's
149
- > there. I can:
150
- >
151
- > - **Add alongside** — append my new schema as a separate
152
- > `<JsonLd>` element. Existing broken data stays as-is (you
153
- > fix it later).
154
- > - **Cancel** — open the file yourself, fix the existing
155
- > block, then re-run this skill.
156
- >
157
- > Recommended: cancel and fix the existing data first."
158
-
159
- ## Identity-on-non-home-page edge case
160
-
161
- If the consumer asks to attach `Organization`, `Person`, or
162
- another identity type (per `references/schema-types.md`) to a
163
- **non-home** page, surface a flag:
164
-
165
- > "`Organization` is typically a site-wide identity emitted in
166
- > the layout (so it appears on every page). Adding it to one
167
- > page means only that page surfaces the entity. Continue, or
168
- > add it to your layout instead?"
169
-
170
- Wait for the consumer's choice. If they continue, proceed
171
- through the normal decision tree. If they want to add to the
172
- layout, point at `apps/web/app/layout.tsx` and stop —
173
- modifying the layout is outside this skill's lane.
174
-
175
- ## Validation after write
176
-
177
- Regardless of replace / append, after the write the file must
178
- still parse:
179
-
180
- - For `.tsx`: TS parse check (parse only, not full type-check).
181
- - For `.mdx`: MDX parse check.
182
-
183
- If parse fails, revert the write and surface the literal parse
184
- error per SKILL.md Step 8.
185
-
186
- ## Why this complexity exists
187
-
188
- Type-aware conflict handling is what separates `add-schema` from
189
- "just append every time." The two cases that drive the
190
- complexity:
191
-
192
- - A consumer iterating on `Product` schema (Case 2) expects
193
- replacement, not stacking — duplicate `Product` schemas hurt
194
- citation more than help.
195
- - A consumer adding `FAQPage` to a `Product` page (Case 4) wants
196
- both — `Product` is the page's identity, `FAQPage` adds
197
- question/answer dimensions. Stacking is correct.
198
-
199
- The decision tree above codifies the difference once so the
200
- skill applies it consistently.
@@ -1,123 +0,0 @@
1
- # File-Finding — Slug → File Resolution
2
-
3
- The `add-schema` skill resolves a slug like `/pricing` to one or
4
- more files in the consumer's repo. This file is the source of
5
- truth for the resolution logic the skill applies in Step 2.
6
-
7
- ## The two locations to scan
8
-
9
- A slug can map to either (or both) of:
10
-
11
- 1. **App Router route file.**
12
- - Primary: `apps/web/app/<slug>/page.tsx` (monorepo layout, the
13
- AILK default).
14
- - Fallback: `app/<slug>/page.tsx` (standalone Next.js app at
15
- repo root).
16
- - Slug supports nested paths: `/products/widget` →
17
- `app/products/widget/page.tsx`.
18
- - The `[slug]` dynamic-route convention is also valid: `/blog/foo`
19
- can map to `app/blog/[slug]/page.tsx`. The skill recognizes
20
- both static and dynamic route files; for dynamic routes, it
21
- modifies the route handler itself (not the dynamic instance).
22
-
23
- 2. **MDX content file.**
24
- - Scan: `content/**/<slug>.mdx`.
25
- - The frontmatter `slug:` field is **authoritative** when
26
- present. Filename match is a fallback.
27
- - Multi-type content folders: a slug can live in
28
- `content/Product/widget.mdx` or
29
- `content/BlogPosting/widget.mdx`. The frontmatter `type:`
30
- field disambiguates.
31
-
32
- ## Match outcomes
33
-
34
- ### Zero matches
35
-
36
- Refuse with a clear pointer:
37
-
38
- > "No page exists at `/<slug>`. Use `scaffold-page` (#362) to
39
- > create one first; come back here once it exists to add
40
- > additional schema."
41
-
42
- Do not write anything.
43
-
44
- ### One match
45
-
46
- Proceed. Show the consumer which file you'll modify in Step 7's
47
- diff so they can confirm the path before any write.
48
-
49
- ### Multiple matches
50
-
51
- List and ask. Common multi-match shapes:
52
-
53
- - **Route + MDX coexistence.** Many AILK pages have both a
54
- `apps/web/app/<slug>/page.tsx` (renderer) and a
55
- `content/<Type>/<slug>.mdx` (data). The route renders the MDX —
56
- schema can attach in either:
57
- - Attaching in the route puts JSON-LD in JSX.
58
- - Attaching in the MDX puts JSON-LD inline in content.
59
- - The canonical AILK pattern emits via the route (the route
60
- imports `<JsonLd schema={builder(page)}/>` and reads frontmatter
61
- via the content adapter). When in doubt, modify the route.
62
-
63
- - **Multiple MDX files for the same slug.** Rare; usually means
64
- the consumer has organized content by `type/` and the same slug
65
- appears in different type folders. List all matches with their
66
- `type:` frontmatter and ask which one the consumer means.
67
-
68
- - **Static + dynamic route ambiguity.** If both `app/<slug>/page.tsx`
69
- and `app/<slug>/[child]/page.tsx` exist, only the static
70
- `<slug>/page.tsx` is the target — the dynamic file handles
71
- child routes, not the index.
72
-
73
- Ask the consumer plainly:
74
-
75
- > "Found multiple files for `/<slug>`:
76
- >
77
- > - `apps/web/app/<slug>/page.tsx` — App Router route
78
- > - `content/Product/<slug>.mdx` — MDX content
79
- >
80
- > Where should I attach the schema? (Recommended: route, since
81
- > JSON-LD belongs in the rendered output.)"
82
-
83
- Wait for the consumer's choice.
84
-
85
- ## What the skill does NOT touch
86
-
87
- - **Layout files.** `apps/web/app/layout.tsx` is the right place
88
- for site-wide identity schema (`Organization` / `Person`). If
89
- the consumer asks to add identity schema to a leaf page, the
90
- skill flags this and asks (per `references/schema-types.md`).
91
- - **`globals.css`, `metadata.ts`, `route.ts`** — these aren't
92
- where JSON-LD lives. The skill scans only `page.tsx` and
93
- `*.mdx` for slug-pattern matches.
94
- - **`packages/schema/`** — read-only at v1 (per the issue scope).
95
- The skill imports from `@working-theory/schema` but never modifies it.
96
-
97
- ## Edge case — non-MDX content backend
98
-
99
- If the consumer's project uses a non-MDX adapter (Sanity, Payload,
100
- or any other), the MDX scan returns nothing. The skill still tries
101
- the App Router route file. If the route exists, attaching schema
102
- there works regardless of where the page's content data lives.
103
-
104
- If the consumer wants schema attached **to content** (not the
105
- route) and they're on a non-MDX backend, this skill at v1 says:
106
-
107
- > "Your content backend isn't MDX. JSON-LD attachment in
108
- > non-MDX backends ships in a future PR. For now, attach the
109
- > schema to the route file (`app/<slug>/page.tsx`) — that's
110
- > rendered server-side and works regardless of content adapter."
111
-
112
- ## Validation after resolution
113
-
114
- Before any write, the skill confirms the resolved file is one of:
115
-
116
- - `.tsx` (App Router page) — must contain `export default
117
- function … Page()`.
118
- - `.mdx` (content file) — must have frontmatter delimiters
119
- (`---`).
120
-
121
- If the file at the resolved path doesn't match one of those
122
- shapes, the skill surfaces the mismatch and stops. Don't write to
123
- a file you can't recognize.
@@ -1,234 +0,0 @@
1
- # Schema Types — Primary / Supplementary Catalog
2
-
3
- The schema.org types `add-schema` recognizes, each tagged
4
- **primary** (typically one per page) or **supplementary** (stacks
5
- freely). The skill reads this file to decide replace-vs-append in
6
- Step 6 of the mechanic.
7
-
8
- This catalog mirrors `@working-theory/schema`'s exports. When new builders
9
- ship in `@working-theory/schema`, this file updates in a follow-up PR. Until
10
- then, unrecognized types fall through to the "ask the consumer"
11
- path in SKILL.md.
12
-
13
- ## Primary types (one per page; replace on conflict)
14
-
15
- These name what the page **is about**. Replacing on same-type
16
- conflict is the usual intent — adding a new `Product` schema
17
- generally means swapping the existing one.
18
-
19
- | `@type` | Builder | Aliases | Typical page |
20
- | ------------------- | ------------------ | ----------------------------- | ------------------------- |
21
- | `HomePage` | `buildHomePage` | "home" | `/` |
22
- | `AboutPage` | `buildAboutPage` | "about" | `/about` |
23
- | `ContactPage` | `buildContactPage` | "contact" | `/contact` |
24
- | `PrivacyPage` | `buildPrivacyPage` | "privacy" | `/privacy` |
25
- | `TermsPage` | `buildTermsPage` | "terms" | `/terms` |
26
- | `Product` | `buildProduct` | "product" | Per-item product page |
27
- | `Service` | `buildService` | "service", "service offering" | `/pricing`, `/services/*` |
28
- | `Article` | `buildArticle` | "article" | Editorial piece |
29
- | `BlogPosting` | `buildBlogPosting` | "blog post", "post" | `/blog/<slug>` |
30
- | `NewsArticle` | `buildNewsArticle` | "news article" | News piece |
31
- | `Course` | `buildCourse` | "course" | `/courses/<slug>` |
32
- | `Event` | `buildEvent` | "event" | Event landing |
33
- | `JobPosting` | `buildJobPosting` | "job", "career" | `/jobs/<slug>` |
34
- | `Recipe` | `buildRecipe` | "recipe" | Per-recipe page |
35
- | `Book` | `buildBook` | "book" | Book detail page |
36
- | `Movie` | `buildMovie` | "movie", "film" | Movie detail |
37
- | `MusicAlbum` | `buildMusicAlbum` | "album" | Album page |
38
- | `RealEstateListing` | _consumer-defined_ | "listing", "property" | `/listings/<slug>` |
39
-
40
- ## Supplementary types (stack freely; always append)
41
-
42
- These add **dimensions** to a page that already has a primary
43
- type. Multiple of these can coexist on one page — never replace,
44
- always append.
45
-
46
- | `@type` | Builder | Aliases | Use |
47
- | ----------------- | --------------------- | ----------------------------- | ------------------------------------- |
48
- | `FAQPage` | _consumer-defined_ | "faq", "FAQ" | Q&A block on any page |
49
- | `HowTo` | _consumer-defined_ | "how-to", "howto", "tutorial" | Step-by-step instructions |
50
- | `BreadcrumbList` | `buildBreadcrumbList` | "breadcrumbs" | Site navigation context |
51
- | `Review` | _consumer-defined_ | "review" | Single review (within Product, etc.) |
52
- | `AggregateRating` | _consumer-defined_ | "rating", "ratings", "stars" | Aggregate of reviews |
53
- | `VideoObject` | _consumer-defined_ | "video" | Embedded video metadata |
54
- | `ImageObject` | _consumer-defined_ | "image" | Image with structured metadata |
55
- | `AudioObject` | _consumer-defined_ | "audio", "podcast" | Audio embed metadata |
56
- | `Offer` | _consumer-defined_ | "offer" | Pricing offer (under Product/Service) |
57
- | `OfferCatalog` | _consumer-defined_ | "catalog", "offer catalog" | Multi-offer container |
58
- | `MonetaryAmount` | _consumer-defined_ | "monetary amount", "amount" | Used inside Service / Offer |
59
-
60
- ## Identity types (one site-wide; emit on home or in layout)
61
-
62
- These are **the site's identity**. Typically one per site (not per
63
- page) and lives in the home page or a layout component. The skill
64
- treats them as **primary** for the conflict logic but flags the
65
- consumer if they're trying to add one to a non-home page.
66
-
67
- | `@type` | Builder | Aliases | Use |
68
- | --------------- | ------------------- | -------------------------------- | ------------------------- |
69
- | `Organization` | `buildOrganization` | "org", "organization", "company" | Business identity |
70
- | `Person` | `buildPerson` | "person", "individual" | Solo individual identity |
71
- | `LocalBusiness` | _consumer-defined_ | "local business" | Brick-and-mortar business |
72
- | `Restaurant` | _consumer-defined_ | "restaurant" | Restaurant subtype |
73
- | `Store` | _consumer-defined_ | "store" | Retail subtype |
74
-
75
- When adding `Organization` or `Person` to a non-home page, the
76
- skill should ask:
77
-
78
- > "`Organization` is typically a site-wide identity emitted in
79
- > the layout (so it appears on every page). Adding it to one
80
- > page means only that page surfaces the entity. Continue, or
81
- > add it to your layout instead?"
82
-
83
- ## Specialty types
84
-
85
- Less-frequently-used but in the catalog. The skill recognizes
86
- these by name; conflict handling defaults to **supplementary**
87
- (append).
88
-
89
- | `@type` | Builder | Aliases |
90
- | ----------------------------------- | ------------------ | -------------------------------- |
91
- | `MedicalCondition` | _consumer-defined_ | "medical condition" |
92
- | `MedicalProcedure` | _consumer-defined_ | "medical procedure", "procedure" |
93
- | `Drug` | _consumer-defined_ | "drug", "medication" |
94
- | `LearningResource` | _consumer-defined_ | "lesson", "learning resource" |
95
- | `EducationalOccupationalCredential` | _consumer-defined_ | "credential", "certification" |
96
- | `SoftwareApplication` | _consumer-defined_ | "app", "software" |
97
- | `MobileApplication` | _consumer-defined_ | "mobile app" |
98
- | `WebApplication` | _consumer-defined_ | "web app" |
99
- | `Dataset` | _consumer-defined_ | "dataset" |
100
- | `ScholarlyArticle` | _consumer-defined_ | "scholarly article", "paper" |
101
- | `LegislativeBuilding` | _consumer-defined_ | _rare, government use_ |
102
-
103
- ## AILK page types (registry-backed — 60 keys, one builder each)
104
-
105
- Every key below is an entry in `@working-theory/schema`'s page-type registry
106
- (`packages/schema/src/registry/entries.ts`) and has a real, exported builder
107
- reachable via `buildJsonLd({ type: '<Key>', ... })` — this is the complete
108
- list of scaffoldable AILK page types, as opposed to the smaller general
109
- schema.org vocabulary tables above (some of which is still
110
- `_consumer-defined_`, i.e. not yet builder-backed). Several keys share one
111
- `@type` (e.g. `PrivacyPage` / `TermsPage` / `LandingPage` / `ThankYouPage` all
112
- emit `WebPage`) — the registry has 60 entries but only 24 distinct `@type`
113
- values. Re-derive with `pnpm page-type-counts`
114
- (`scripts/component/page-type-counts.ts` in the `ai-launch-kit-internal`
115
- source repo) before hand-editing this table.
116
-
117
- ### Core (15)
118
-
119
- | Key | `@type` |
120
- | --- | --- |
121
- | `HomePage` | `HomePage` |
122
- | `AboutPage` | `AboutPage` |
123
- | `ContactPage` | `ContactPage` |
124
- | `PrivacyPage` | `WebPage` |
125
- | `TermsPage` | `WebPage` |
126
- | `LandingPage` | `WebPage` |
127
- | `ThankYouPage` | `WebPage` |
128
- | `BookCall` | `WebPage` |
129
- | `NewsletterSignup` | `WebPage` |
130
- | `DemoRequest` | `WebPage` |
131
- | `TrialSignup` | `WebPage` |
132
- | `Waitlist` | `WebPage` |
133
- | `Assessment` | `WebApplication` |
134
- | `Calculator` | `WebApplication` |
135
- | `CampaignLP` | `WebPage` |
136
-
137
- ### Identity (4)
138
-
139
- `Organization` / `Person` / `BreadcrumbList` / `ContactPoint` — see the
140
- [Identity types](#identity-types-one-site-wide-emit-on-home-or-in-layout)
141
- table above; all four are registry-backed.
142
-
143
- ### Canonical-List (17)
144
-
145
- | Key | `@type` |
146
- | --- | --- |
147
- | `ServicesList` | `CollectionPage` |
148
- | `ProductsList` | `CollectionPage` |
149
- | `ProjectsList` | `CollectionPage` |
150
- | `FAQPage` | `FAQPage` |
151
- | `CareersList` | `CollectionPage` |
152
- | `UseCasesList` | `CollectionPage` |
153
- | `TestimonialsList` | `CollectionPage` |
154
- | `ClientsList` | `CollectionPage` |
155
- | `DownloadsList` | `CollectionPage` |
156
- | `EventsList` | `CollectionPage` |
157
- | `CoursesList` | `CollectionPage` |
158
- | `TeamList` | `CollectionPage` |
159
- | `PartnersList` | `CollectionPage` |
160
- | `IntegrationsList` | `CollectionPage` |
161
- | `GlossaryList` | `CollectionPage` |
162
- | `LocationsList` | `CollectionPage` |
163
- | `DocsList` | `CollectionPage` |
164
-
165
- ### Canonical-Detail (14)
166
-
167
- | Key | `@type` |
168
- | --- | --- |
169
- | `Service` | `Service` |
170
- | `Product` | `Product` |
171
- | `Project` | `CreativeWork` |
172
- | `Event` | `Event` |
173
- | `Course` | `Course` |
174
- | `TeamMember` | `ProfilePage` |
175
- | `Partner` | `AboutPage` |
176
- | `Integration` | `WebPage` |
177
- | `JobPosting` | `JobPosting` |
178
- | `SoftwareProduct` | `WebPage` |
179
- | `Location` | `Place` |
180
- | `ServiceAreaPage` | `WebPage` |
181
- | `UseCase` | `WebPage` |
182
- | `Pricing` | `WebPage` |
183
-
184
- ### Editorial-List (3)
185
-
186
- | Key | `@type` |
187
- | --- | --- |
188
- | `BlogList` | `Blog` |
189
- | `ResourcesHub` | `CollectionPage` |
190
- | `CaseStudiesList` | `CollectionPage` |
191
-
192
- ### Editorial-Detail (7)
193
-
194
- | Key | `@type` |
195
- | --- | --- |
196
- | `BlogPosting` | `BlogPosting` |
197
- | `CaseStudy` | `Article` |
198
- | `HowTo` | `HowTo` |
199
- | `Whitepaper` | `Article` |
200
- | `ResourceDetail` | `Article` |
201
- | `TechArticle` | `TechArticle` |
202
- | `DocsDetail` | `TechArticle` |
203
-
204
- ## Total
205
-
206
- **Two distinct counts, not one.** The AILK page-type registry — the types
207
- `add-schema` can scaffold with a real builder — has **60 keys** (24 distinct
208
- `@type` values; see the family tables above). The general schema.org
209
- vocabulary tables earlier in this file are a separate, smaller, hand-curated
210
- list the skill also recognizes by name for non-registry types; several of
211
- those are still `_consumer-defined_` because `@working-theory/schema` hasn't
212
- shipped a typed builder for them yet — for those, the skill emits the JSON-LD
213
- as an inline literal with a comment noting the upstream issue.
214
-
215
- ## When `@working-theory/schema` doesn't yet export the builder
216
-
217
- Some entries above say `_consumer-defined_` for the builder
218
- column. The skill's behavior in that case:
219
-
220
- 1. Surface the gap:
221
-
222
- > "`@working-theory/schema` doesn't export `build<Type>` yet. I can:
223
- >
224
- > - Emit the JSON-LD as an inline object literal (less
225
- > type-safe but works).
226
- > - Skip — you author it manually using the canonical
227
- > `<JsonLd schema={...}/>` pattern.
228
- >
229
- > Which?"
230
-
231
- 2. Wait for the consumer's choice. Don't fabricate a builder.
232
-
233
- This matches `scaffold-page` (#362)'s behavior — both skills handle
234
- the missing-builder case the same way.