

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# Strapi Monorepo — Agent Guide23Strapi is an open-source headless CMS.4Yarn workspaces + Nx monorepo. Node ≥22 ≤26, Yarn 4.5Target branch: `develop` (not `main`). All PRs go to `develop`.67---89## Repository Structure1011```12packages/core/ # Framework: strapi, admin, database, content-manager, types, utils…13packages/plugins/ # Official plugins: users-permissions, i18n, graphql, documentation…14packages/providers/ # Email + upload provider implementations15packages/utils/ # Shared tooling: logger, eslint-config, tsconfig, vitest-config16packages/cli/ # CLI tools: create-strapi-app, cloud-cli17examples/ # Dev sandboxes only — not published, not for production fixes18docs/ # Contributor documentation (also at contributor.strapi.io)19tests/ # Integration, E2E, and CLI test infrastructure20```2122The following are the most important packages (not exhaustive — run `yarn workspaces list` for the full set):2324| Package | Description |25| ---------------------------------- | --------------------------------------------------------- |26| `@strapi/strapi` | Main framework entry point (Koa server) |27| `@strapi/admin` | React 18 admin dashboard |28| `@strapi/core` | Core business logic |29| `@strapi/database` | Database abstraction (MySQL, PostgreSQL, MariaDB, SQLite) |30| `@strapi/content-manager` | Content management UI |31| `@strapi/types` | Shared TypeScript type definitions |32| `@strapi/permissions` | RBAC engine |33| `@strapi/plugin-users-permissions` | JWT authentication |3435### Skills directories3637**`.ai/skills/`** is the canonical source for committed repo skills. Each subdirectory containing a `SKILL.md` is a skill.3839The AI-tooling well-known locations are **symlink targets** maintained by `yarn ai:sync`: `.agents/skills/`, `.claude/skills/`, `.cursor/skills/`.4041Run `yarn ai:sync` after adding or removing a skill in `.ai/skills/` to keep all three target dirs up to date. Links are local-only (gitignored target dirs) — only `.ai/skills/` content is committed.4243On **Windows**, the CLI creates directory **junctions** (no extra setup). Directory symlinks require Developer Mode or an elevated shell.4445```bash46yarn ai:sync # idempotent — create/prune .ai links in all 3 tool dirs47yarn ai:unlink # remove only .ai-sourced links (leaves brain links intact)48yarn ai:status # read-only report: linked / missing / conflict / stale49```5051---5253## Architecture5455- **`Strapi` class** — The DI container and central hub. Accessed as a `strapi` parameter injected through the factory pattern (e.g. `createService(strapi)`). Never use `global.strapi` — always prefer proper dependency injection. Provides `strapi.documents`, `strapi.db`, `strapi.log`, etc. Lifecycle: Register → Bootstrap → Start → Destroy (`start()` calls `load()` internally, which runs register + bootstrap).56- **Server / Admin split** — Koa.js HTTP server (`@strapi/strapi`) + React/Redux admin (`@strapi/admin`). Packages with both concerns export dual entry points: `strapi-server` (Node.js logic) and `strapi-admin` (UI components).57- **Document Service** — The primary high-level API for content (`strapi.documents`). Replaced the legacy Entity Service. Always use this for reading/writing content — never raw DB queries unless you're working inside `@strapi/database` itself.58- **Polymorphic (morph\*) relations** — Contributor doc: [docs/docs/docs/01-core/database/01-relations/polymorphic-relations.md](docs/docs/docs/01-core/database/01-relations/polymorphic-relations.md) (storage, DB populate, and how `getDeepPopulate` / relation traversal interact with `morphToOne` and join-based morphs).59- **Plugin system** — Plugins register routes, controllers, services, content types, and middleware via the same `strapi-server` / `strapi-admin` dual structure. Official plugins live in `packages/plugins/`.60- **Content Types** — Defined using a JSON-based notation (not JSON Schema spec). Each content type has a `schema.json` file — see any `packages/core/content-manager/server/src/content-types/` for examples. The database layer auto-generates tables from them. Never write raw migrations for content type changes.61- **EE / CE split** — Some features are Enterprise Edition only, gated at runtime. See EE toggles in the Testing section below.62- **`@strapi/types`** — Single source of truth for shared TypeScript types. Import from here; improve these types rather than duplicating locally.6364---6566## Monorepo Setup6768```bash69# Initial setup (run once after cloning)70yarn install71yarn setup # clean + build all packages; hints to run ai:sync if links are missing72yarn ai:sync # link .ai/skills into .agents/ .claude/ .cursor/73```7475---7677## Development7879```bash80# Run the dev sandbox81cd examples/getstarted82yarn develop # SQLite (default)8384# Start non-memory databases (postgres/mysql)85docker-compose -f docker-compose.dev.yml up -d86DB=postgres yarn develop # PostgreSQL87DB=mysql yarn develop # MySQL8889# Watch all packages + run sandbox with admin watch (two terminals)90yarn watch # terminal 1, repo root91cd examples/getstarted && yarn develop --watch-admin # terminal 292```9394---9596## Build9798```bash99yarn build # all packages (code + types)100yarn build:code # faster — skips .d.ts generation101yarn nx build @strapi/admin # single package102```103104---105106## Testing107108### Unit tests (fastest — run first)109110Unit test files live in `__tests__/` subdirectories within each package.111112```bash113yarn test:unit114yarn test:unit:watch115yarn test:unit:update # update snapshots116```117118### Frontend tests (admin panel)119120Frontend test files also live in `__tests__/` within their respective packages.121122```bash123yarn test:front # runs with IS_EE=true (EE features enabled)124yarn test:front:ce # runs with IS_EE=false (Community Edition only)125yarn test:front:update # update snapshots (EE)126yarn test:front:update:ce # update snapshots (CE)127```128129### Type checking130131```bash132yarn test:ts # all packages + front + back133```134135### API integration tests136137Integration tests live in `tests/api/`. Test apps are generated automatically — always regenerate with `yarn test:generate-app` rather than reusing a stale one (stale apps cause misleading failures).138139```bash140yarn test:api # SQLite141yarn test:api --db=postgres142yarn test:api --db=mysql143yarn test:api -u # update snapshots144```145146### CLI tests147148CLI tests live in `tests/cli/`.149150```bash151yarn test:cli152yarn test:cli:debug # with debug output153yarn test:cli:update # update snapshots154```155156### E2E tests (Playwright)157158E2E tests live in `tests/e2e/tests/` organized by domain (e.g. `admin`, `content-manager`, `i18n`).159160```bash161yarn playwright install # one-time browser install162yarn test:e2e --setup --concurrency=1 # run all domains sequentially163yarn test:e2e --domains content-manager admin # run specific domains only164yarn test:e2e --concurrency=3 # run 3 domains in parallel165```166167### EE toggles168169- `IS_EE=true` — enables Enterprise features in frontend tests (`yarn test:front`)170- `RUN_EE=true` — enables Enterprise features in E2E tests171172### Pre-PR checklist173174All tests must pass before merging. Run at minimum:175176```bash177yarn test:unit && yarn test:front && yarn test:ts && yarn lint && yarn prettier:check178```179180E2E (`yarn test:e2e`) is required per CONTRIBUTING.md but slow — CI enforces it on every PR.181182**When to add or update tests:** Always for bug fixes (reproduce the bug first). For features, add tests when they cover meaningful behaviour — not just to hit coverage numbers. When changing existing behaviour, update the affected tests to match.183184---185186## Quality Gates187188### Commits189190Must follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) (enforced by Husky `commit-msg` hook and CI via `commitlint`). Format:191192```193<type>(<optional-scope>): <description>194```195196Valid types: `feat` `fix` `chore` `ci` `docs` `enhancement` `test` `revert` `security` `future` `release`197198**Examples:**199200```bash201feat(content-manager): add bulk delete action202fix(database): preserve relation order during publish203chore(admin): migrate data-fetching to react-query204```205206Use `yarn commit` for an interactive prompt. Run `yarn version:check` if you've touched any `package.json`.207208### TypeScript209210- Import types from `@strapi/types` — extend or improve them rather than duplicating locally.211- Never use `any` when a proper type exists or can be reasonably defined. Prefer `unknown` otherwise.212- Run `yarn test:ts` before pushing.213214### Linting & Formatting215216```bash217yarn lint # ESLint across all packages218yarn lint:fix # auto-fix219yarn format # Prettier (2-space indent, single quotes, semicolons, trailing commas, arrow parens, 100-char width, LF)220yarn prettier:check # check only221```222223---224225## Security226227- Never commit secrets, credentials, or API keys.228- Never disable or weaken authentication/authorization checks.229- Use parameterized queries — never interpolate user input into raw SQL or database queries.230- Validate and sanitize all user input at controller/service boundaries.231- When working with EE-gated features, do not bypass license checks.232233---234235## PR Guidelines236237- Branch from `develop`, target `develop` — never `main`.238- Link the issue you're fixing in the description.239- All tests must pass before merging.240- PR description must follow [.github/PULL_REQUEST_TEMPLATE.md](.github/PULL_REQUEST_TEMPLATE.md) — do not invent your own sections.241242---243244## Notes for Agents245246- **`examples/`** apps are sandboxes only — use them to reproduce and test fixes, never commit changes to them unless specifically asked to do so. **Exception:** `examples/complex` is the **migration test fixture** (schemas, seeds, `validate-migration.js`, DB tooling); CI runs `migration_v5` against it via `tests/migration/`. It may relocate under `tests/migration/` in the future.247- **Workspace deps** — internal `packages/` deps reference each other with pinned semver versions (e.g. `"5.42.0"`), not `workspace:*`. The `workspace:*` protocol is only used in `examples/` apps and some root devDeps.248- **Entity Service is deprecated** — always use the Document Service (`strapi.documents`) for content operations.249- **Lifecycle phases** — `strapi.isLoaded` must be `true` before accessing services. Plugins and DB are not available until after the `load()` phase.250
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 201k | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| aaif-goose/gooseAGENTS.md · 53k | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 8 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| deepseek-ai/deepseek-harnessnative/landlock-run/AGENTS.md · 104k | AGENTS.md | setupteststylearch+3 | 100/100 | today | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 68k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 13 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | today | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| elastic/elasticsearchx-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+2 | 100/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/strapi-strapi-agents)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.