Skip to content
Back to skills

Contentful

ASecurity

Contentful content types, GraphQL/REST queries, CLI migrations, assets and locales. Use when changing a Contentful content model, querying Contentful, or migrating its content.

  • 80 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 28, 2026
ai-agentsgobashapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned October 5, 2026

npx -y skills add monkilabs/opencastle --skill contentful-cms --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Contentful?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Contentful
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/monkilabs-contentful/badge)](https://www.skillsdirectory.com/skills/monkilabs-contentful)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: contentful-cms
description: "Contentful content types, GraphQL/REST queries, CLI migrations, assets and locales. Use when changing a Contentful content model, querying Contentful, or migrating its content."
---

# Contentful CMS

Project config, content types, and API keys: `.opencastle/stack/cms-config.md`. Docs: https://www.contentful.com/developers/docs/

## Gotchas

- Never migrate `master` directly. Create a sandbox environment, migrate there, validate, then promote or re-run against `master` in a maintenance window.
- Rollback is *recreate*, not undo: delete the sandbox, re-clone from `master`, re-run a corrected migration. Reverse migrations only work for additive schema changes.
- Links are not resolved by default — REST needs `include` (link resolution depth); GraphQL resolves nested selections but each level costs query complexity.
- Use `sys.publishedAt` as the cache-invalidation key.
- Prefer typed content types over JSON fields, and attach `validations` to every required field — Contentful will not enforce shape otherwise. Uniqueness must be declared explicitly: `.validations([{ unique: true }])`.
- Reference fields need an explicit `linkContentType` validation or any entry type can be linked:
  `blogPost.createField('author').type('Link').linkType('Entry').validations([{ linkContentType: ['person'] }])`

## Migration command

```bash
contentful space migration --space-id <SPACE_ID> --environment-id sandbox migration.js
```

Migration scripts export `function (migration) { ... }` and use `createContentType` / `createField` / `displayField`.

## Post-migration validation

1. Query a representative sample of affected entries; assert required fields and unique constraints hold (exit non-zero on a miss).
2. Build the site against sandbox content to catch render-time failures.
3. Run integration tests covering the modified content types.

Files in this skill

  • REFERENCE.md753 B
  • SKILL.md2.8 KB
  • config.ts2.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…