@agility/create-next-app 1.0.0-beta.2

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 (213) hide show
  1. package/.claude/settings.json +7 -0
  2. package/.claude/settings.local.json +24 -0
  3. package/FEATURE_ROADMAP.md +343 -0
  4. package/README.md +205 -0
  5. package/TESTING.md +131 -0
  6. package/bin/create-agility-app.js +48 -0
  7. package/dist/agility/api-keys/generateApiKeys.d.ts +9 -0
  8. package/dist/agility/api-keys/generateApiKeys.d.ts.map +1 -0
  9. package/dist/agility/api-keys/generateApiKeys.js +99 -0
  10. package/dist/agility/api-keys/generateApiKeys.js.map +1 -0
  11. package/dist/agility/api-keys/getApiKeys.d.ts +9 -0
  12. package/dist/agility/api-keys/getApiKeys.d.ts.map +1 -0
  13. package/dist/agility/api-keys/getApiKeys.js +14 -0
  14. package/dist/agility/api-keys/getApiKeys.js.map +1 -0
  15. package/dist/agility/index.d.ts +3 -0
  16. package/dist/agility/index.d.ts.map +1 -0
  17. package/dist/agility/index.js +8 -0
  18. package/dist/agility/index.js.map +1 -0
  19. package/dist/agility/instance/createNewInstance.d.ts +8 -0
  20. package/dist/agility/instance/createNewInstance.d.ts.map +1 -0
  21. package/dist/agility/instance/createNewInstance.js +65 -0
  22. package/dist/agility/instance/createNewInstance.js.map +1 -0
  23. package/dist/agility/instance/getAvailableInstances.d.ts +8 -0
  24. package/dist/agility/instance/getAvailableInstances.d.ts.map +1 -0
  25. package/dist/agility/instance/getAvailableInstances.js +43 -0
  26. package/dist/agility/instance/getAvailableInstances.js.map +1 -0
  27. package/dist/agility/instance/manageInstance.d.ts +9 -0
  28. package/dist/agility/instance/manageInstance.d.ts.map +1 -0
  29. package/dist/agility/instance/manageInstance.js +82 -0
  30. package/dist/agility/instance/manageInstance.js.map +1 -0
  31. package/dist/agility/utils/getMgmtAPIUrl.d.ts +20 -0
  32. package/dist/agility/utils/getMgmtAPIUrl.d.ts.map +1 -0
  33. package/dist/agility/utils/getMgmtAPIUrl.js +61 -0
  34. package/dist/agility/utils/getMgmtAPIUrl.js.map +1 -0
  35. package/dist/auth/api-key/authenticateWithApiKey.d.ts +6 -0
  36. package/dist/auth/api-key/authenticateWithApiKey.d.ts.map +1 -0
  37. package/dist/auth/api-key/authenticateWithApiKey.js +28 -0
  38. package/dist/auth/api-key/authenticateWithApiKey.js.map +1 -0
  39. package/dist/auth/index.d.ts +3 -0
  40. package/dist/auth/index.d.ts.map +1 -0
  41. package/dist/auth/index.js +8 -0
  42. package/dist/auth/index.js.map +1 -0
  43. package/dist/auth/oauth/authenticate.d.ts +6 -0
  44. package/dist/auth/oauth/authenticate.d.ts.map +1 -0
  45. package/dist/auth/oauth/authenticate.js +162 -0
  46. package/dist/auth/oauth/authenticate.js.map +1 -0
  47. package/dist/auth/oauth/constants.d.ts +5 -0
  48. package/dist/auth/oauth/constants.d.ts.map +1 -0
  49. package/dist/auth/oauth/constants.js +9 -0
  50. package/dist/auth/oauth/constants.js.map +1 -0
  51. package/dist/auth/oauth/exchangeCodeForToken.d.ts +7 -0
  52. package/dist/auth/oauth/exchangeCodeForToken.d.ts.map +1 -0
  53. package/dist/auth/oauth/exchangeCodeForToken.js +39 -0
  54. package/dist/auth/oauth/exchangeCodeForToken.js.map +1 -0
  55. package/dist/cli/index.d.ts +3 -0
  56. package/dist/cli/index.d.ts.map +1 -0
  57. package/dist/cli/index.js +290 -0
  58. package/dist/cli/index.js.map +1 -0
  59. package/dist/cli/promptForMissingOptions.d.ts +8 -0
  60. package/dist/cli/promptForMissingOptions.d.ts.map +1 -0
  61. package/dist/cli/promptForMissingOptions.js +92 -0
  62. package/dist/cli/promptForMissingOptions.js.map +1 -0
  63. package/dist/config/env/createEnvFile.d.ts +6 -0
  64. package/dist/config/env/createEnvFile.d.ts.map +1 -0
  65. package/dist/config/env/createEnvFile.js +31 -0
  66. package/dist/config/env/createEnvFile.js.map +1 -0
  67. package/dist/config/index.d.ts +2 -0
  68. package/dist/config/index.d.ts.map +1 -0
  69. package/dist/config/index.js +6 -0
  70. package/dist/config/index.js.map +1 -0
  71. package/dist/config/mcp/createMcpConfig.d.ts +5 -0
  72. package/dist/config/mcp/createMcpConfig.d.ts.map +1 -0
  73. package/dist/config/mcp/createMcpConfig.js +32 -0
  74. package/dist/config/mcp/createMcpConfig.js.map +1 -0
  75. package/dist/config/packages/installAgilityPackages.d.ts +6 -0
  76. package/dist/config/packages/installAgilityPackages.d.ts.map +1 -0
  77. package/dist/config/packages/installAgilityPackages.js +61 -0
  78. package/dist/config/packages/installAgilityPackages.js.map +1 -0
  79. package/dist/config/setupProject.d.ts +8 -0
  80. package/dist/config/setupProject.d.ts.map +1 -0
  81. package/dist/config/setupProject.js +32 -0
  82. package/dist/config/setupProject.js.map +1 -0
  83. package/dist/create-next-app/createNextApp.d.ts +9 -0
  84. package/dist/create-next-app/createNextApp.d.ts.map +1 -0
  85. package/dist/create-next-app/createNextApp.js +83 -0
  86. package/dist/create-next-app/createNextApp.js.map +1 -0
  87. package/dist/create-next-app/index.d.ts +3 -0
  88. package/dist/create-next-app/index.d.ts.map +1 -0
  89. package/dist/create-next-app/index.js +8 -0
  90. package/dist/create-next-app/index.js.map +1 -0
  91. package/dist/scaffold/components/createPageComponents.d.ts +6 -0
  92. package/dist/scaffold/components/createPageComponents.d.ts.map +1 -0
  93. package/dist/scaffold/components/createPageComponents.js +62 -0
  94. package/dist/scaffold/components/createPageComponents.js.map +1 -0
  95. package/dist/scaffold/containers/createContainers.d.ts +6 -0
  96. package/dist/scaffold/containers/createContainers.d.ts.map +1 -0
  97. package/dist/scaffold/containers/createContainers.js +48 -0
  98. package/dist/scaffold/containers/createContainers.js.map +1 -0
  99. package/dist/scaffold/index.d.ts +2 -0
  100. package/dist/scaffold/index.d.ts.map +1 -0
  101. package/dist/scaffold/index.js +6 -0
  102. package/dist/scaffold/index.js.map +1 -0
  103. package/dist/scaffold/instance/createBlankInstance.d.ts +8 -0
  104. package/dist/scaffold/instance/createBlankInstance.d.ts.map +1 -0
  105. package/dist/scaffold/instance/createBlankInstance.js +51 -0
  106. package/dist/scaffold/instance/createBlankInstance.js.map +1 -0
  107. package/dist/scaffold/models/createContentModels.d.ts +6 -0
  108. package/dist/scaffold/models/createContentModels.d.ts.map +1 -0
  109. package/dist/scaffold/models/createContentModels.js +70 -0
  110. package/dist/scaffold/models/createContentModels.js.map +1 -0
  111. package/dist/templates/copyDirectory.d.ts +5 -0
  112. package/dist/templates/copyDirectory.d.ts.map +1 -0
  113. package/dist/templates/copyDirectory.js +28 -0
  114. package/dist/templates/copyDirectory.js.map +1 -0
  115. package/dist/templates/copyTemplates.d.ts +8 -0
  116. package/dist/templates/copyTemplates.d.ts.map +1 -0
  117. package/dist/templates/copyTemplates.js +58 -0
  118. package/dist/templates/copyTemplates.js.map +1 -0
  119. package/dist/templates/index.d.ts +2 -0
  120. package/dist/templates/index.d.ts.map +1 -0
  121. package/dist/templates/index.js +6 -0
  122. package/dist/templates/index.js.map +1 -0
  123. package/dist/types/index.d.ts +50 -0
  124. package/dist/types/index.d.ts.map +1 -0
  125. package/dist/types/index.js +3 -0
  126. package/dist/types/index.js.map +1 -0
  127. package/dist/utils/git.d.ts +9 -0
  128. package/dist/utils/git.d.ts.map +1 -0
  129. package/dist/utils/git.js +71 -0
  130. package/dist/utils/git.js.map +1 -0
  131. package/dist/utils/validation.d.ts +45 -0
  132. package/dist/utils/validation.d.ts.map +1 -0
  133. package/dist/utils/validation.js +180 -0
  134. package/dist/utils/validation.js.map +1 -0
  135. package/package.json +45 -0
  136. package/src/agility/api-keys/generateApiKeys.ts +100 -0
  137. package/src/agility/api-keys/getApiKeys.ts +13 -0
  138. package/src/agility/index.ts +3 -0
  139. package/src/agility/instance/createNewInstance.ts +67 -0
  140. package/src/agility/instance/getAvailableInstances.ts +49 -0
  141. package/src/agility/instance/manageInstance.ts +90 -0
  142. package/src/agility/utils/getMgmtAPIUrl.ts +68 -0
  143. package/src/auth/api-key/authenticateWithApiKey.ts +24 -0
  144. package/src/auth/index.ts +3 -0
  145. package/src/auth/oauth/authenticate.ts +165 -0
  146. package/src/auth/oauth/constants.ts +6 -0
  147. package/src/auth/oauth/exchangeCodeForToken.ts +43 -0
  148. package/src/cli/index.ts +281 -0
  149. package/src/cli/promptForMissingOptions.ts +104 -0
  150. package/src/config/env/createEnvFile.ts +30 -0
  151. package/src/config/index.ts +2 -0
  152. package/src/config/mcp/createMcpConfig.ts +30 -0
  153. package/src/config/packages/installAgilityPackages.ts +63 -0
  154. package/src/config/setupProject.ts +31 -0
  155. package/src/create-next-app/createNextApp.ts +75 -0
  156. package/src/create-next-app/index.ts +3 -0
  157. package/src/scaffold/components/createPageComponents.ts +74 -0
  158. package/src/scaffold/containers/createContainers.ts +55 -0
  159. package/src/scaffold/index.ts +2 -0
  160. package/src/scaffold/instance/createBlankInstance.ts +55 -0
  161. package/src/scaffold/models/createContentModels.ts +83 -0
  162. package/src/templates/copyDirectory.ts +24 -0
  163. package/src/templates/copyTemplates.ts +57 -0
  164. package/src/templates/index.ts +2 -0
  165. package/src/types/index.ts +55 -0
  166. package/src/utils/git.ts +74 -0
  167. package/src/utils/validation.ts +184 -0
  168. package/templates/.claude/QUICK-START.md +230 -0
  169. package/templates/.claude/README.md +32 -0
  170. package/templates/.claude/settings.json +8 -0
  171. package/templates/BLANK-INSTANCE-SETUP.md +375 -0
  172. package/templates/DEVELOPMENT.md +160 -0
  173. package/templates/EXAMPLE-PROMPTS.md +643 -0
  174. package/templates/PROMPTS.md +410 -0
  175. package/templates/README.md +281 -0
  176. package/templates/agents.md +429 -0
  177. package/templates/app/[locale]/[...slug]/error.tsx +17 -0
  178. package/templates/app/[locale]/[...slug]/not-found.tsx +9 -0
  179. package/templates/app/[locale]/[...slug]/page.tsx +102 -0
  180. package/templates/app/[locale]/layout.tsx +22 -0
  181. package/templates/app/[locale]/page.tsx +12 -0
  182. package/templates/app/api/dynamic-redirect/route.ts +24 -0
  183. package/templates/app/api/preview/exit/route.ts +34 -0
  184. package/templates/app/api/preview/route.ts +63 -0
  185. package/templates/app/api/revalidate/route.ts +118 -0
  186. package/templates/components/agility-components/RichTextArea.tsx +66 -0
  187. package/templates/components/agility-components/index.ts +30 -0
  188. package/templates/components/agility-pages/MainTemplate.tsx +36 -0
  189. package/templates/components/agility-pages/index.ts +11 -0
  190. package/templates/docs/01-agility-cms-overview.md +139 -0
  191. package/templates/docs/02-page-routing.md +251 -0
  192. package/templates/docs/03-creating-components.md +462 -0
  193. package/templates/docs/04-data-fetching.md +484 -0
  194. package/templates/docs/05-containers-and-lists.md +596 -0
  195. package/templates/docs/06-localization.md +561 -0
  196. package/templates/docs/07-caching-strategies.md +410 -0
  197. package/templates/docs/08-common-components.md +756 -0
  198. package/templates/docs/09-whats-included.md +279 -0
  199. package/templates/docs/10-mcp-server-setup.md +153 -0
  200. package/templates/docs/11-linked-nested-content.md +611 -0
  201. package/templates/docs/README.md +164 -0
  202. package/templates/lib/cms/getAgilityContext.ts +28 -0
  203. package/templates/lib/cms/getAgilityPage.ts +51 -0
  204. package/templates/lib/cms/getAgilitySDK.ts +22 -0
  205. package/templates/lib/cms/getContentItem.ts +20 -0
  206. package/templates/lib/cms/getContentList.ts +19 -0
  207. package/templates/lib/cms/getRedirections.ts +85 -0
  208. package/templates/lib/cms/getSitemapFlat.ts +19 -0
  209. package/templates/lib/cms/getSitemapNested.ts +19 -0
  210. package/templates/lib/env.ts +99 -0
  211. package/templates/lib/i18n/config.ts +28 -0
  212. package/templates/proxy.ts +101 -0
  213. package/tsconfig.json +21 -0
@@ -0,0 +1,375 @@
1
+ # Setting Up a Blank Agility CMS Instance
2
+
3
+ This guide walks you through setting up a brand new Agility CMS instance from scratch to work with this Next.js starter.
4
+
5
+ ## ⚠️ Getting a Blank Instance
6
+
7
+ **Most Agility CMS instances come with starter content.** If you need a completely blank instance to build from scratch, contact **support@agilitycms.com** to request one.
8
+
9
+ > **Note**: If you already have an Agility CMS instance with existing content, you don't need this guide! Just build components for your existing content models.
10
+
11
+ ## 🎯 Overview
12
+
13
+ When you have a blank Agility CMS instance, it's completely empty. You need to create:
14
+ 1. **Content Models** (define your content types)
15
+ 2. **Page Templates** (define page layouts)
16
+ 3. **Page Modules** (components editors can add to pages)
17
+ 4. **Sample Content** (test data to build against)
18
+ 5. **Pages** (actual pages in your sitemap)
19
+
20
+ This guide assumes you're working with AI assistance. The AI can't create things in Agility CMS for you, but it can tell you exactly what to create!
21
+
22
+ ## ✅ Step 1: Get Your Credentials
23
+
24
+ Before starting, make sure your `.env.local` has:
25
+
26
+ ```env
27
+ AGILITY_GUID=your-instance-guid
28
+ AGILITY_API_FETCH_KEY=your-fetch-api-key
29
+ AGILITY_API_PREVIEW_KEY=your-preview-api-key
30
+ AGILITY_SECURITY_KEY=your-security-key
31
+ AGILITY_LOCALES=en-us
32
+ AGILITY_SITEMAP=website
33
+ ```
34
+
35
+ Get these from: Agility CMS > Settings > API Keys
36
+
37
+ ## 🎨 Step 2: Plan Your Content Structure
38
+
39
+ ### Ask AI to Help You Plan
40
+
41
+ Use this prompt with your AI assistant:
42
+
43
+ ```
44
+ "I have a blank Agility CMS instance. Help me plan the content structure for a [describe your website type and purpose].
45
+
46
+ The site should have:
47
+ - [List main pages: e.g., Home, About, Services, Blog, Contact]
48
+ - [List content types: e.g., Blog posts, team members, testimonials]
49
+ - [List special features: e.g., multi-language, filtering, search]
50
+
51
+ Please provide:
52
+ 1. Complete list of content models to create with all fields
53
+ 2. List of page modules (components) needed
54
+ 3. Page templates needed
55
+ 4. Suggested sample content to add
56
+ 5. Build order (what to create first)"
57
+ ```
58
+
59
+ The AI will give you a comprehensive plan. **Save this plan** - you'll reference it throughout setup!
60
+
61
+ ## 🏗️ Step 3: Create Content Models
62
+
63
+ Content Models define your content types (Blog Post, Team Member, Product, etc.)
64
+
65
+ ### In Agility CMS:
66
+ 1. Go to **Settings > Content Definitions > Content Models**
67
+ 2. Click **"+ New"** to create a model
68
+ 3. For each model in your AI's plan, create it with these steps:
69
+
70
+ #### Example: Creating a "Blog Post" Model
71
+
72
+ 1. **Name**: Blog Post
73
+ 2. **Reference Name**: blogPost (camelCase, no spaces)
74
+ 3. **Description**: Blog post content
75
+ 4. Click **"Add Fields"**:
76
+ - Title (Short Text) - required
77
+ - Slug (Short Text) - required, unique
78
+ - Excerpt (Long Text)
79
+ - Content (HTML)
80
+ - FeaturedImage (Image)
81
+ - Date (Date/Time)
82
+ - Author (Content Link - if you have authors model)
83
+ - Categories (Content List - if you have categories model)
84
+
85
+ 5. Click **Save**
86
+
87
+ **Repeat for each content model in your plan.**
88
+
89
+ ### 📋 Common Content Models Checklist
90
+
91
+ For most websites, you'll want:
92
+
93
+ - [ ] **Page** (for basic pages: About, Services, etc.)
94
+ - Title, Slug, SEO fields (title, description), Content (HTML)
95
+
96
+ - [ ] **Blog Post** (if you have a blog)
97
+ - Title, Slug, Excerpt, Content, FeaturedImage, Date, Author, Categories
98
+
99
+ - [ ] **Category** (for blog categories)
100
+ - Title, Slug, Description
101
+
102
+ - [ ] **Author** (for blog authors)
103
+ - Name, Bio, Photo, Email, Social Links
104
+
105
+ - [ ] **Team Member** (if you have team section)
106
+ - Name, Title, Bio, Photo, Email, Social Links, Order
107
+
108
+ - [ ] **Testimonial** (for social proof)
109
+ - Quote, Author, Company, Title, Photo, Rating
110
+
111
+ - [ ] **Service/Product** (if applicable)
112
+ - Name, Description, Features, Image, Price, Category
113
+
114
+ ## 🎭 Step 4: Create Page Modules (Components)
115
+
116
+ Page Modules are components that editors can add to page zones.
117
+
118
+ ### In Agility CMS:
119
+ 1. Go to **Settings > Content Definitions > Page Modules**
120
+ 2. Click **"+ New"** to create a module
121
+
122
+ #### Example: Creating a "Hero" Module
123
+
124
+ 1. **Name**: Hero
125
+ 2. **Reference Name**: Hero (PascalCase)
126
+ 3. **Description**: Hero section with heading, text, and CTA
127
+ 4. **Add Fields**:
128
+ - heading (Short Text) - required
129
+ - subheading (Short Text)
130
+ - backgroundImage (Image)
131
+ - primaryCTA (Link)
132
+ - secondaryCTA (Link)
133
+
134
+ 5. Click **Save**
135
+
136
+ **Create all modules from your AI's plan.**
137
+
138
+ ### 📋 Common Page Modules Checklist
139
+
140
+ Essential modules for most sites:
141
+
142
+ - [ ] **Hero** - Hero section with heading, image, CTA
143
+ - [ ] **RichTextArea** - Flexible content area (already included in starter)
144
+ - [ ] **ContentListDisplay** - Shows items from a content list
145
+ - [ ] **TextBlock** - Heading and text content
146
+ - [ ] **ImageTextBlock** - Image with text (side by side)
147
+ - [ ] **CallToAction** - CTA button/banner
148
+ - [ ] **Testimonials** - Testimonial cards/carousel
149
+ - [ ] **Form** - Contact/newsletter form
150
+ - [ ] **BlogListing** - Blog posts grid
151
+ - [ ] **FeaturedContent** - Highlighted content items
152
+
153
+ ## 📄 Step 5: Create Page Templates
154
+
155
+ Page Templates define the layout of your pages (zones where modules go).
156
+
157
+ ### Default Template (Already Included)
158
+ The starter includes **MainTemplate** with a single "main" zone. This works for most pages!
159
+
160
+ ### Creating Additional Templates (Optional)
161
+
162
+ Only create new templates if you need different layouts:
163
+
164
+ 1. Go to **Settings > Content Definitions > Page Templates**
165
+ 2. Click **"+ New"**
166
+ 3. Example: "Two Column Template"
167
+ - Add Zone: "left-zone"
168
+ - Add Zone: "right-zone"
169
+ 4. Save
170
+
171
+ Then ask AI:
172
+ ```
173
+ "Create a TwoColumn page template component that displays left-zone and right-zone in a 2-column grid"
174
+ ```
175
+
176
+ ## 📝 Step 6: Add Sample Content
177
+
178
+ Before building components, add sample content so you have data to test with.
179
+
180
+ ### In Agility CMS:
181
+ 1. Go to **Content > [Your Content List]**
182
+ 2. Click **"+ New"** and fill in fields
183
+ 3. Add at least 2-3 items per content list
184
+
185
+ #### Example: Adding Blog Posts
186
+ 1. Go to **Content > Blog Posts**
187
+ 2. Add 3-5 sample posts with:
188
+ - Real-ish titles and content
189
+ - Featured images
190
+ - Different dates
191
+ - Various categories
192
+
193
+ **Why**: You need real content to test filtering, pagination, layouts, etc.
194
+
195
+ ## 🗺️ Step 7: Create Pages in Sitemap
196
+
197
+ Now create actual pages in your site structure.
198
+
199
+ ### In Agility CMS:
200
+ 1. Go to **Pages**
201
+ 2. Click **"+ Add Page"**
202
+ 3. For each page:
203
+ - **Name**: Home, About, Blog, etc.
204
+ - **Template**: MainTemplate (or your custom template)
205
+ - **Visible in Menu**: Yes/No
206
+ - Save
207
+
208
+ 4. Add modules to page zones:
209
+ - Click **"Add Module"** in a zone
210
+ - Select your module (Hero, TextBlock, etc.)
211
+ - Fill in the content
212
+ - Save
213
+
214
+ ### 📋 Essential Pages Checklist
215
+
216
+ - [ ] **Home** (path: `/`)
217
+ - Add Hero module
218
+ - Add featured content sections
219
+ - Add CTA
220
+
221
+ - [ ] **About** (path: `/about`)
222
+ - Add TextBlock with company info
223
+ - Add Team Members display (if applicable)
224
+
225
+ - [ ] **Blog** (path: `/blog`)
226
+ - Add BlogListing module
227
+
228
+ - [ ] **Contact** (path: `/contact`)
229
+ - Add Form module
230
+ - Add contact info TextBlock
231
+
232
+ - [ ] **Sample Blog Post** (path: `/blog/sample-post`)
233
+ - This will be created automatically from your blog content
234
+
235
+ ## 💻 Step 8: Build Components with AI
236
+
237
+ Now you're ready to build! The AI can now create components that work with your CMS structure.
238
+
239
+ ### For Each Module You Created:
240
+
241
+ ```
242
+ "Create the [ModuleName] component with these requirements:
243
+
244
+ **Fields from Agility CMS:**
245
+ - [field1]: [type]
246
+ - [field2]: [type]
247
+ [copy exact field names and types from your module definition]
248
+
249
+ **Layout:**
250
+ - [Describe layout: full-width, grid, flex, etc.]
251
+ - [Responsive behavior]
252
+
253
+ **Styling:**
254
+ - [Colors, spacing, typography]
255
+ - [Any special effects]
256
+
257
+ **Reference Name**: [exact name from CMS]"
258
+ ```
259
+
260
+ The AI will create the component code AND tell you to register it in `index.ts`.
261
+
262
+ ### Build Order:
263
+ 1. ✅ Simple modules first (TextBlock, RichTextArea)
264
+ 2. ✅ Hero/featured sections
265
+ 3. ✅ Content list displays (Blog, Team, etc.)
266
+ 4. ✅ Interactive components (Forms, carousels)
267
+ 5. ✅ Navigation and footer
268
+ 6. ✅ Detail pages (single blog post, etc.)
269
+
270
+ ## 🧪 Step 9: Test Everything
271
+
272
+ ### Test Checklist:
273
+ - [ ] Run `npm run dev` successfully
274
+ - [ ] Home page loads and displays all modules
275
+ - [ ] Navigate to each page via menu
276
+ - [ ] Content lists display correctly
277
+ - [ ] Images load (using AgilityPic)
278
+ - [ ] Links work
279
+ - [ ] Forms submit (if applicable)
280
+ - [ ] Preview mode works
281
+ - [ ] Build succeeds: `npm run build`
282
+
283
+ ## 🚀 Step 10: Configure Webhooks (Optional)
284
+
285
+ Set up automatic cache revalidation when content changes:
286
+
287
+ 1. Go to **Agility CMS > Settings > Webhooks**
288
+ 2. Click **"+ New Webhook"**
289
+ 3. Configure:
290
+ - **Name**: Next.js Revalidation
291
+ - **URL**: `https://yourdomain.com/api/revalidate`
292
+ - **Events**: Content Published, Page Published
293
+ - **Active**: Yes
294
+ 4. Save
295
+
296
+ > Note: This only works when deployed. For local development, changes appear after refresh.
297
+
298
+ ## 🎓 Quick Reference: Agility CMS Terminology
299
+
300
+ | Term | What It Is | Example |
301
+ |------|-----------|---------|
302
+ | **Content Model** | Definition of a content type | Blog Post, Team Member |
303
+ | **Page Module** | Component editors add to pages | Hero, TextBlock |
304
+ | **Page Template** | Layout with zones | MainTemplate (main zone) |
305
+ | **Content Instance** | Actual content item | "My First Blog Post" |
306
+ | **Zone** | Area on a template where modules go | "main", "sidebar" |
307
+ | **Reference Name** | Code identifier (must match exactly!) | "Hero", "blogPost" |
308
+ | **Content Link** | Single linked item | Post → Author |
309
+ | **Content List** | Multiple linked items | Post → Categories |
310
+
311
+ ## 🆘 Common Setup Issues
312
+
313
+ ### "Module not rendering"
314
+ - ✅ Check reference name matches exactly (case-sensitive!)
315
+ - ✅ Verify module is registered in `index.ts`
316
+ - ✅ Confirm module exists in Agility CMS
317
+ - ✅ Make sure you added the module to the page zone
318
+
319
+ ### "Content not showing"
320
+ - ✅ Verify referenceName in code matches CMS exactly
321
+ - ✅ Check content is published (not draft)
322
+ - ✅ Confirm content exists for the locale (en-us)
323
+ - ✅ Check API keys are correct in `.env.local`
324
+
325
+ ### "Images broken"
326
+ - ✅ Ensure using `<AgilityPic>` not `<Image>` or `<img>`
327
+ - ✅ Check image field is type `ImageField`
328
+ - ✅ Verify images are uploaded in Agility CMS
329
+
330
+ ### "Build fails"
331
+ - ✅ Check all components are registered
332
+ - ✅ Verify TypeScript types match CMS fields
333
+ - ✅ Make sure `.env.local` is complete
334
+ - ✅ Check for syntax errors in components
335
+
336
+ ## 💡 Pro Tips
337
+
338
+ 1. **Name Things Clearly**: Use descriptive names in both CMS and code
339
+ 2. **Stay Consistent**: Pick a naming convention (camelCase vs PascalCase) and stick to it
340
+ 3. **Start Simple**: Get basic pages working before adding complex features
341
+ 4. **Test Incrementally**: Build one component, test it, then move on
342
+ 5. **Use Sample Content**: Don't try to build with empty lists
343
+ 6. **Document Reference Names**: Keep a list of exact reference names from CMS
344
+ 7. **Ask AI for Help**: When stuck, describe the exact error you're seeing
345
+
346
+ ## 📚 Next Steps
347
+
348
+ After setup is complete:
349
+
350
+ 1. **Read**: [PROMPTS.md](./PROMPTS.md) - Learn how to write effective prompts
351
+ 2. **Build**: Start creating components with AI assistance
352
+ 3. **Refine**: Iterate on designs and functionality
353
+ 4. **Deploy**: Push to production (Vercel, Netlify, etc.)
354
+ 5. **Optimize**: Add caching, SEO, performance improvements
355
+
356
+ ## 🎯 Quick Start Checklist
357
+
358
+ Use this checklist for your setup:
359
+
360
+ - [ ] Environment variables configured
361
+ - [ ] Content models created in Agility CMS
362
+ - [ ] Page modules created in Agility CMS
363
+ - [ ] Page template configured (use MainTemplate or create custom)
364
+ - [ ] Sample content added (2-3 items per list)
365
+ - [ ] Pages created in sitemap
366
+ - [ ] Modules added to page zones
367
+ - [ ] Components built with AI (registered in index.ts)
368
+ - [ ] Site running locally (`npm run dev`)
369
+ - [ ] All pages accessible
370
+ - [ ] Content displaying correctly
371
+ - [ ] Build successful (`npm run build`)
372
+
373
+ ---
374
+
375
+ **Ready to build?** Follow this guide, use the prompts in [PROMPTS.md](./PROMPTS.md), and let AI help you create an amazing website! 🎨✨
@@ -0,0 +1,160 @@
1
+ # Development Guide
2
+
3
+ This project includes comprehensive documentation for building with Agility CMS and AI coding assistants.
4
+
5
+ ## 🚀 Getting Started
6
+
7
+ Choose your path:
8
+
9
+ ### Have an Existing Agility Instance? (Most Users)
10
+ You're ready to build! Start creating components for your existing content models.
11
+ - **[PROMPTS.md](./PROMPTS.md)** - Learn to write effective prompts for AI assistants
12
+ - **[EXAMPLE-PROMPTS.md](./EXAMPLE-PROMPTS.md)** - Ready-to-use prompt library
13
+ - **[.claude/QUICK-START.md](./.claude/QUICK-START.md)** - 5-minute quickstart
14
+
15
+ ### Need a Blank Instance?
16
+ Contact **support@agilitycms.com** to request a blank Agility CMS instance, then:
17
+ - **[BLANK-INSTANCE-SETUP.md](./BLANK-INSTANCE-SETUP.md)** - Complete guide for blank instances
18
+
19
+ ### Building with AI?
20
+ - **[PROMPTS.md](./PROMPTS.md)** - Learn to write effective prompts
21
+ - **[EXAMPLE-PROMPTS.md](./EXAMPLE-PROMPTS.md)** - Ready-to-use prompt library
22
+
23
+ ## 📚 Documentation
24
+
25
+ All documentation is located in the `.claude/` directory:
26
+
27
+ ### For Developers
28
+ - **[Quick Start](./.claude/QUICK-START.md)** - Get up and running in 5 minutes
29
+ - **[Agility CMS Overview](./.claude/docs/01-agility-cms-overview.md)** - How Agility CMS works
30
+ - **[Creating Components](./.claude/docs/03-creating-components.md)** - Build new features
31
+ - **[Common Components](./.claude/docs/08-common-components.md)** - Ready-to-use examples
32
+
33
+ ### For AI Coding Assistants
34
+ - **[AI Assistant Guide](./.claude/docs/00-ai-assistant-guide.md)** - Guide for AI tools
35
+ - **[Full Documentation Index](./.claude/README.md)** - Complete documentation
36
+
37
+ ## 🤖 Using with AI Tools
38
+
39
+ ### Claude Code
40
+ Documentation is automatically discovered. Just ask:
41
+ ```
42
+ "Add a blog with pagination"
43
+ "Create a hero section"
44
+ ```
45
+
46
+ ### Cursor
47
+ Reference docs explicitly:
48
+ ```
49
+ "Following the pattern in .claude/docs/03-creating-components.md,
50
+ create a testimonials carousel"
51
+ ```
52
+
53
+ Or use the AI sidebar with:
54
+ ```
55
+ @.claude/docs/03-creating-components.md
56
+ ```
57
+
58
+ ### GitHub Copilot
59
+ Use workspace context:
60
+ ```
61
+ @workspace /new Using the Agility CMS patterns in .claude/docs/,
62
+ create a team members grid component
63
+ ```
64
+
65
+ ### Google AI Studio / Gemini
66
+ Share the documentation files and reference them:
67
+ ```
68
+ "Based on the patterns in .claude/docs/03-creating-components.md..."
69
+ ```
70
+
71
+ ## 📖 Common Tasks
72
+
73
+ ### Add a New Component
74
+ 1. Read [.claude/docs/03-creating-components.md](./.claude/docs/03-creating-components.md)
75
+ 2. Create file in `src/components/agility-components/YourComponent.tsx`
76
+ 3. Register in `src/components/agility-components/index.ts`
77
+ 4. Create component model in Agility CMS
78
+ 5. Add to pages in CMS
79
+
80
+ ### Fetch Content Lists
81
+ 1. Read [.claude/docs/05-containers-and-lists.md](./.claude/docs/05-containers-and-lists.md)
82
+ 2. Use `getContentList()` helper
83
+ 3. Always pass `locale` parameter
84
+
85
+ ### Add Multi-Language Support
86
+ 1. Read [.claude/docs/06-localization.md](./.claude/docs/06-localization.md)
87
+ 2. Update `AGILITY_LOCALES` in `.env.local`
88
+ 3. Update `lib/i18n/config.ts`
89
+
90
+ ## 🎯 AI Prompt Examples
91
+
92
+ Try these prompts with any AI assistant:
93
+
94
+ ```
95
+ "Add a blog listing component with pagination following the Agility CMS patterns"
96
+
97
+ "Create a contact form component using the hybrid server/client pattern from the docs"
98
+
99
+ "Implement a testimonials carousel like the example in .claude/docs/08-common-components.md"
100
+
101
+ "Add a FAQ accordion component with the patterns from .claude/docs/"
102
+ ```
103
+
104
+ ## 📂 Project Structure
105
+
106
+ ```
107
+ src/
108
+ ├── app/
109
+ │ ├── api/ # API routes
110
+ │ │ ├── preview/ # Preview mode endpoints
111
+ │ │ ├── revalidate/ # Webhook for cache revalidation
112
+ │ │ └── dynamic-redirect/ # Dynamic page redirects
113
+ │ └── [locale]/[...slug]/page.tsx # All pages route here
114
+ ├── components/
115
+ │ ├── agility-components/ # CMS components (add here)
116
+ │ └── agility-pages/ # Page templates
117
+ └── lib/cms/ # CMS helper functions
118
+ ```
119
+
120
+ ## 🔗 API Routes
121
+
122
+ This project includes API routes for Agility CMS integration:
123
+
124
+ ### Preview Mode
125
+ - **`/api/preview`** - Enables preview/draft mode for viewing unpublished content
126
+ - **`/api/preview/exit`** - Exits preview mode and returns to published content
127
+
128
+ ### Cache Revalidation
129
+ - **`/api/revalidate`** - Webhook endpoint for on-demand cache revalidation when content changes in Agility CMS
130
+
131
+ ### Dynamic Redirects
132
+ - **`/api/dynamic-redirect`** - Redirects to the correct URL for a dynamic page based on ContentID
133
+
134
+ **Configure webhooks in Agility CMS:** Settings > Webhooks > Add Webhook → Point to `https://yourdomain.com/api/revalidate`
135
+
136
+ ## 🔧 Development Commands
137
+
138
+ ```bash
139
+ npm run dev # Start development server
140
+ npm run build # Build for production
141
+ npm run start # Start production server
142
+ ```
143
+
144
+ ## 📞 Getting Help
145
+
146
+ - **Documentation**: See [.claude/README.md](./.claude/README.md)
147
+ - **Agility CMS Docs**: https://agilitycms.com/docs
148
+ - **Next.js Docs**: https://nextjs.org/docs
149
+
150
+ ## 🌟 Key Features
151
+
152
+ - ✅ Agility CMS integration with type-safe helpers
153
+ - ✅ Multi-locale support out of the box
154
+ - ✅ Server Components with ISR caching
155
+ - ✅ AI-friendly documentation
156
+ - ✅ Production-ready patterns
157
+
158
+ ---
159
+
160
+ **Ready to build?** Check out [.claude/QUICK-START.md](./.claude/QUICK-START.md) and start creating! 🚀