Contentful Custom App From Scratch
Use this skill to turn a customer app idea into a small, locally testable
Contentful App Framework implementation.
Default to the user's own repository, Contentful organization, and app delivery
workflow unless they explicitly choose another destination.
Public Contentful Marketplace apps and Contentful's public apps repository
(https://github.com/contentful/apps) can be useful references for mature App
Framework patterns, UX conventions, and configuration flows. Use them as
examples to adapt, not as required repo structure or publication process.
Working Style
- Start with the app's job, primary users, affected content model, and target
Contentful surface before writing code.
- Ask only for information that changes the architecture or prevents a wrong
build.
- Prefer the smallest version that proves the value in a non-production space.
- Ground capability decisions in official App Framework docs and the current
project structure.
- Keep user-owned secrets, tokens, and production content out of generated code,
logs, and examples.
Workflow
1. Create the Implementation Brief
Capture a short brief before scaffolding:
- app concept in one sentence,
- target users and the workflow they need to improve,
- Contentful locations needed for v1,
- content types, fields, locales, and environments involved,
- external systems, authentication, or APIs involved,
- expected installation and configuration model,
- must-have v1 behavior,
- assumptions and non-goals,
- validation plan for local and sandbox testing.
If the idea is still broad, propose 2-3 feasible v1 options and recommend the
smallest useful one.
For planning details, use App planning.
2. Choose the App Shape
Choose locations by user workflow:
- Use
app-config when the app needs installation-time setup.
- Use
entry-sidebar for entry-level context, status, helper actions, and
lightweight insights.
- Use
entry-field to replace or enhance a field's editing experience.
- Use
dialog for focused picker, confirmation, or multi-step flows launched
from another location.
- Use
page or home for dashboards, bulk tools, onboarding, or full-screen
operational workflows.
- Use
entry-editor only when replacing or heavily extending the full entry
editing experience is worth the maintenance cost.
- Use App Actions or Functions only when the app needs asynchronous behavior,
server-side execution, verified inbound requests, event handling, or access to
secret values outside the browser.
If sensitive credentials are required, model them as secret installation
parameters and consume raw values only in a backend or Function-backed path.
3. Inspect or Scaffold the Project
If the user already has a repo:
- Inspect
package.json, app-related docs, existing app locations, build
scripts, tests, and style conventions.
- Reuse the repo's framework, package manager, lint/test setup, and component
patterns.
- Identify whether the app already uses
@contentful/app-sdk,
@contentful/react-apps-toolkit, @contentful/f36-components, or
contentful-management.
If the user does not have a repo:
- Scaffold with
npx create-contentful-app@latest <app-name>.
- Prefer TypeScript unless the user requests JavaScript.
- Keep the first scaffold close to the generated project until the local app is
wired into Contentful and verified.
4. Build in Contentful-Native Style
- Use the App SDK or React Apps Toolkit to access the current location SDK.
- Use Forma 36 components for Contentful web app UI. Always check if Forma 36 has a similar component before attempting to build something custom.
- Keep UI dense, clear, and editor-friendly; avoid marketing layouts inside the
Contentful web app.
- Include loading, empty, permission, and error states when they affect the main
workflow.
- Keep field and entry writes explicit, reversible where possible, and easy for
editors to understand.
- When runtime locations need app configuration, read installation parameters
from
sdk.parameters.installation. Do not fetch app installation records
through CMA from mount effects, render paths, hooks, or user interactions just
to retrieve configured parameters.
- Avoid broad abstractions until the app has more than one real usage path.
- Do not expose management tokens, API keys, or third-party credentials in
browser code.
5. Wire the Local App into Contentful
Create or update the app definition in a development organization or sandbox:
- set the frontend URL to the local dev server, commonly
http://localhost:3000,
- select only the locations implemented in v1,
- define required installation or instance parameters,
- install the app into a non-production space or environment,
- assign the app to the relevant content types, fields, sidebar, home page, or
page location,
- seed minimal test content when needed.
For local test and handoff steps, use
Repository and validation.
6. Verify Before Handoff
Run the closest meaningful checks available in the user's project:
- package install check when dependencies changed,
- typecheck and lint,
- unit or component tests,
- production build,
- local dev server smoke test,
- manual Contentful web app flow in a non-production space.
rg -n "appInstallation\\.(getForOrganization|get)\\(|getForOrganization"
over the app source when runtime code reads installation parameters, with any
remaining CMA app-installation call explained.
Do not claim the app works unless you ran the relevant validation or clearly
state what could not be run.
7. Hand Off the Result
End with:
- what was built,
- how to run it locally,
- how to install or assign it in Contentful,
- validation performed,
- remaining assumptions, limitations, or credentials needed,
- suggested next iteration.
Related Skills
contentful-custom-app-enhancement - improve or debug an existing custom app.
contentful-api - concrete CMA, CDA, CPA, Images API, and GraphQL examples.
contentful-migration - content model migration scripts.
contentful-guide - Contentful concepts and API routing.
1---2name: contentful-custom-app-from-scratch3description: Design, scaffold, build, and validate a new Contentful App Framework custom app for a customer's own repository or workspace. Use when users want to create a custom app from an idea, choose App Framework locations, build a sidebar app, field editor app, page app, dialog, configuration screen, App Action, or Function-backed app, scaffold with create-contentful-app, or make a locally testable app for an organization-specific Contentful workflow. Also triggers on "build a Contentful app", "custom app from scratch", "App Framework app", "sidebar app", "field editor app", "page app", "app action", and "app function". Not for generic Contentful API examples (contentful-api), content model migrations (contentful-migration), or website integration (contentful-nextjs).4license: MIT5---6
7# Contentful Custom App From Scratch
8
9Use this skill to turn a customer app idea into a small, locally testable
10Contentful App Framework implementation.
11
12Default to the user's own repository, Contentful organization, and app delivery
13workflow unless they explicitly choose another destination.
14
15Public Contentful Marketplace apps and Contentful's public apps repository
16(`https://github.com/contentful/apps`) can be useful references for mature App
17Framework patterns, UX conventions, and configuration flows. Use them as
18examples to adapt, not as required repo structure or publication process.
19
20## Working Style
21
22- Start with the app's job, primary users, affected content model, and target
23 Contentful surface before writing code.
24- Ask only for information that changes the architecture or prevents a wrong
25 build.
26- Prefer the smallest version that proves the value in a non-production space.
27- Ground capability decisions in official App Framework docs and the current
28 project structure.
29- Keep user-owned secrets, tokens, and production content out of generated code,
30 logs, and examples.
31
32## Workflow
33
34### 1. Create the Implementation Brief
35
36Capture a short brief before scaffolding:
37
38- app concept in one sentence,
39- target users and the workflow they need to improve,
40- Contentful locations needed for v1,
41- content types, fields, locales, and environments involved,
42- external systems, authentication, or APIs involved,
43- expected installation and configuration model,
44- must-have v1 behavior,
45- assumptions and non-goals,
46- validation plan for local and sandbox testing.
47
48If the idea is still broad, propose 2-3 feasible v1 options and recommend the
49smallest useful one.
50
51For planning details, use [App planning](references/app-planning.md).
52
53### 2. Choose the App Shape
54
55Choose locations by user workflow:
56
57- Use `app-config` when the app needs installation-time setup.
58- Use `entry-sidebar` for entry-level context, status, helper actions, and
59 lightweight insights.
60- Use `entry-field` to replace or enhance a field's editing experience.
61- Use `dialog` for focused picker, confirmation, or multi-step flows launched
62 from another location.
63- Use `page` or `home` for dashboards, bulk tools, onboarding, or full-screen
64 operational workflows.
65- Use `entry-editor` only when replacing or heavily extending the full entry
66 editing experience is worth the maintenance cost.
67- Use App Actions or Functions only when the app needs asynchronous behavior,
68 server-side execution, verified inbound requests, event handling, or access to
69 secret values outside the browser.
70
71If sensitive credentials are required, model them as secret installation
72parameters and consume raw values only in a backend or Function-backed path.
73
74### 3. Inspect or Scaffold the Project
75
76If the user already has a repo:
77
781. Inspect `package.json`, app-related docs, existing app locations, build
79 scripts, tests, and style conventions.
802. Reuse the repo's framework, package manager, lint/test setup, and component
81 patterns.
823. Identify whether the app already uses `@contentful/app-sdk`,
83 `@contentful/react-apps-toolkit`, `@contentful/f36-components`, or
84 `contentful-management`.
85
86If the user does not have a repo:
87
881. Scaffold with `npx create-contentful-app@latest <app-name>`.
892. Prefer TypeScript unless the user requests JavaScript.
903. Keep the first scaffold close to the generated project until the local app is
91 wired into Contentful and verified.
92
93### 4. Build in Contentful-Native Style
94
95- Use the App SDK or React Apps Toolkit to access the current location SDK.
96- Use Forma 36 components for Contentful web app UI. Always check if Forma 36 has a similar component before attempting to build something custom.
97- Keep UI dense, clear, and editor-friendly; avoid marketing layouts inside the
98 Contentful web app.
99- Include loading, empty, permission, and error states when they affect the main
100 workflow.
101- Keep field and entry writes explicit, reversible where possible, and easy for
102 editors to understand.
103- When runtime locations need app configuration, read installation parameters
104 from `sdk.parameters.installation`. Do not fetch app installation records
105 through CMA from mount effects, render paths, hooks, or user interactions just
106 to retrieve configured parameters.
107- Avoid broad abstractions until the app has more than one real usage path.
108- Do not expose management tokens, API keys, or third-party credentials in
109 browser code.
110
111### 5. Wire the Local App into Contentful
112
113Create or update the app definition in a development organization or sandbox:
114
115- set the frontend URL to the local dev server, commonly
116 `http://localhost:3000`,
117- select only the locations implemented in v1,
118- define required installation or instance parameters,
119- install the app into a non-production space or environment,
120- assign the app to the relevant content types, fields, sidebar, home page, or
121 page location,
122- seed minimal test content when needed.
123
124For local test and handoff steps, use
125[Repository and validation](references/repo-and-validation.md).
126
127### 6. Verify Before Handoff
128
129Run the closest meaningful checks available in the user's project:
130
131- package install check when dependencies changed,
132- typecheck and lint,
133- unit or component tests,
134- production build,
135- local dev server smoke test,
136- manual Contentful web app flow in a non-production space.
137- `rg -n "appInstallation\\.(getForOrganization|get)\\(|getForOrganization"`
138 over the app source when runtime code reads installation parameters, with any
139 remaining CMA app-installation call explained.
140
141Do not claim the app works unless you ran the relevant validation or clearly
142state what could not be run.
143
144### 7. Hand Off the Result
145
146End with:
147
148- what was built,
149- how to run it locally,
150- how to install or assign it in Contentful,
151- validation performed,
152- remaining assumptions, limitations, or credentials needed,
153- suggested next iteration.
154
155## Related Skills
156
157- `contentful-custom-app-enhancement` - improve or debug an existing custom app.
158- `contentful-api` - concrete CMA, CDA, CPA, Images API, and GraphQL examples.
159- `contentful-migration` - content model migration scripts.
160- `contentful-guide` - Contentful concepts and API routing.