Generated file. Source of truth: docs/agent-rules/creatorem-agent-rules.contract.v1.json.
Do not edit manually; regenerate via pnpm --filter creatorem docs:agents:generate.
- contractId:
creatorem-agent-rules-v1 - contractVersion:
1 - language:
en - scope:
generic_creatorem_kit
Enable AI coding agents to implement features in Creatorem SaaS Kit with predictable quality by combining docs capability discovery, kit-first implementation, and example-driven integration patterns.
- Resolve user intent to one or more capability IDs from mcp-index metadata before proposing implementation details.
- Read the primary docs page and its Agent Recipe for each selected capability.
- Locate concrete implementation entrypoints in kit/* for each capability.
- Use examples/* only to map integration composition and app wiring patterns.
- If docs and code conflict, follow source precedence and report the conflict with impacted files.
| Rank | Source | Meaning |
|---|---|---|
| 1 | kit_code | kit/* source code and exported APIs are the implementation truth. |
| 2 | docs_contract | apps/creatorem/content/docs and MCP Context/Agent Recipe define intended usage and integration rules. |
| 3 | examples | examples/* provide real integration templates and composition references. |
- Start with capability discovery and select minimal capability set.
- Implement in shared kit package first when behavior belongs to reusable module.
- Prefer filter-based composition (client/server/cross-env) over app-local hardcoded integration when filter extension points exist.
- Wire app-level composition with filters/config/routes after shared changes.
- Use examples to mirror integration structure for dashboard/mobile scenarios.
- Keep naming and architecture consistent with existing kit conventions.
- Run docs contract and quality checks when docs/MCP contract content is changed.
- Run typecheck/lint/tests scoped to changed packages or apps.
- For database-affecting changes, run SQL generation/reset/types sequence in documented order.
- Report executed commands and unresolved validation blockers in final output.
- Reimplementing behavior directly in apps/* when @kit/* already provides the feature.
- Bypassing filter extension points with app-local hardcoded integration when filter hooks exist.
- Bypassing settings APIs with direct DB reads/writes for keys supported by @kit/settings.
- Treating examples/* as API authority when kit exports or docs contract disagree.
- Skipping capability discovery and editing files from guesswork only.
- Returning changes without explicit validation status and command evidence.
- List changed files and summarize behavior-level impact.
- State which capability IDs were used for retrieval.
- State which @kit/* APIs were reused instead of app-local duplication.
- List validation commands executed and any blockers.
- If assumptions were required, enumerate them explicitly.
Required Actions
- Enqueue schema via server_get_settings_schema in app server filters before reads.
- Use getServerSettings for server reads and getClientSettings/useClientSettings for client reads.
- Use SettingsPages/updateSettingsForm or SettingServerModel.updateSettings for writes.
- Preserve typed schema-driven behavior through parseSchemaSettingConfig and parseUISettingConfig usage.
Capability Refs
settings_architecturesettings_api_fullstack
Path Refs
kit/settings/src/shared/server/get-server-settings.tskit/settings/src/shared/client/get-client-settings.tskit/settings/src/shared/client/use-client-settings.tsexamples/pco-dashboard/lib/init-server-filters.tsexamples/pco-dashboard/app/dashboard/[slug]/settings/[[...settings]]/page-client.tsxexamples/pco-mobile/app/(app)/screens/settings/[...settings]/index.tsx
Required Actions
- Initialize cross-env filters in app i18n bootstrap.
- Use applyCrossEnvAsyncFilter for package translations resolver.
- Use applyCrossEnvFilter to compose namespaces.
- Fallback to app-local locale JSON only when no package translation is returned.
Capability Refs
i18n_web_setupi18n_usage_patternsi18n_mobile_setup
Path Refs
examples/pco-dashboard/lib/init-cross-env-filters.tsexamples/pco-dashboard/config/i18n.config.tskit/i18n/src
Required Actions
- Identify the target filter namespace first (client/server/cross-env).
- Verify slug signature in FilterList before implementing changes.
- Register filters in package modules and initialize them in app entrypoints.
- Document filter parameters in feature docs when filter-backed behavior is changed.
Capability Refs
filter_api_architectureapp_configurationrepo_navigation
Path Refs
kit/utils/src/filters/list.tskit/utils/src/filters/filter-engine.tsapps/dashboard/hooks/use-filters.tsapps/dashboard/lib/init-server-filters.tsapps/dashboard/lib/init-cross-env-filters.tsapps/mobile/hooks/use-filters.tsapps/mobile/config/i18n.config.tsapps/creatorem/content/docs/(common)/filters-api.mdx
Required Actions
- Run SQL generation before reset/type refresh when schema/setup changed.
- Use documented order: creatorem generate-sql -> pnpm run db:reset -> pnpm run db:types.
- Do not manually edit generated migration bundles.
- Confirm local Supabase is running before reset/types operations.
Capability Refs
database_workflowrepo_task_executionproject_generation_and_refactor
Path Refs
supabase/schemassupabase/app-schemassupabase/migrationsapps/creatorem/content/docs/(common)/database.mdxapps/creatorem/content/docs/(common)/scripts.mdx
Trigger: Any feature request, bugfix, or refactor
Required Actions
- Resolve target capabilities before selecting implementation files.
- Read docs page What It Does, How To Use, MCP Context, and Agent Recipe sections.
- Map capability entrypoints to concrete code paths before editing.
Forbidden Actions
- Start implementation from guessed files without capability mapping.
- Ignore MCP Context entrypoints when they exist.
Validation Expectations
- At least one capability ID is referenced in task notes/output.
- Selected files are traceable to capability entrypoints.
Capability Refs
mcp_doc_indexdocs_platformrepo_navigation
Path Refs
apps/creatorem/content/.generated/mcp-index.jsonapps/creatorem/content/docs/web/(root)/mcp-capabilities.mdxapps/creatorem/content/docs/(common)/structure.mdx
Example Refs
examples/pco-dashboardexamples/pco-mobile
Trigger: When implementing or changing reusable behavior
Required Actions
- Implement shared behavior in @kit/* first when ownership is reusable.
- Keep app-level code focused on composition/configuration/filter wiring.
- Reference kit exports and existing routers/hooks/components before creating new ones.
Forbidden Actions
- Copy-paste reusable logic into apps/* as first option.
- Create duplicate APIs that mirror existing kit capabilities.
Validation Expectations
- Output explains why kit reuse was chosen or why app-local scope is necessary.
- Changed app code shows composition around existing kit APIs.
Capability Refs
repo_navigationapp_configuration
Path Refs
kitappsapps/creatorem/content/docs/(common)/structure.mdx
Example Refs
examples/pco-dashboard/configexamples/pco-mobile/config
Trigger: When docs, kit code, and examples diverge
Required Actions
- Apply source precedence strictly: kit code > docs > examples.
- Document detected conflicts and selected resolution path.
- Prefer updating docs/adapters when code truth changed.
Forbidden Actions
- Treat example implementations as authoritative over kit exports.
- Silently choose one source without conflict note.
Validation Expectations
- Conflict note includes impacted files and precedence decision.
- Follow-up docs updates are planned or implemented when needed.
Capability Refs
docs_platformmcp_server_integration
Path Refs
apps/creatorem/content/docskitexamples
Example Refs
examples/pco-dashboard/lib/init-server-filters.ts
Trigger: Settings-related feature implementation
Required Actions
- Follow WF-SETTINGS-01 without bypassing @kit/settings APIs.
- Ensure schema/filter wiring exists before any settings read/write path.
- Prefer typed getters/hooks over manual inference or raw settings DB access.
Forbidden Actions
- Direct raw drizzle access for settings values already modeled in @kit/settings.
- Skipping server_get_settings_schema enqueue step.
Validation Expectations
- Server/client settings reads use sanctioned helpers.
- Required schema keys are discoverable from configured schema map.
Capability Refs
settings_architecturesettings_api_fullstacksettings_mobile_ui
Path Refs
kit/settings/src/shared/server/get-server-settings.tskit/settings/src/shared/client/get-client-settings.tskit/settings/src/shared/client/use-client-settings.tsexamples/pco-dashboard/lib/init-server-filters.tsexamples/pco-mobile/config/settings.ui.config.tsx
Example Refs
examples/pco-dashboard/app/dashboard/[slug]/settings/[[...settings]]/page-client.tsxexamples/pco-mobile/app/(app)/screens/settings/[...settings]/index.tsx
Trigger: Translation/i18n changes
Required Actions
- Follow WF-I18N-01 and keep package namespaces resolvable through cross-env filters.
- Use i18next flow documented in docs and app config patterns.
- Verify namespace registration includes package-level namespaces when required.
Forbidden Actions
- Hardcode translation strings where namespace-based resolution exists.
- Drop cross-env namespace resolution for package content.
Validation Expectations
- i18n config shows namespace composition and resolver fallback behavior.
- Package translations remain accessible for target languages.
Capability Refs
i18n_web_setupi18n_usage_patternsi18n_mobile_setup
Path Refs
examples/pco-dashboard/config/i18n.config.tsexamples/pco-dashboard/lib/init-cross-env-filters.tskit/i18n/src
Example Refs
examples/pco-mobile/config/i18n.config.ts
Trigger: Database schema/setup/migration changes
Required Actions
- Follow WF-DB-01 command order.
- Treat generated migration files as generated artifacts, not hand-authored sources.
- Refresh types after reset to maintain DB/type alignment.
Forbidden Actions
- Edit generated migration bundle manually.
- Run db:types before reset when schema changed.
Validation Expectations
- Command log demonstrates SQL generation/reset/types sequence.
- Output states if database-affecting validations could not be run and why.
Capability Refs
database_workflowrepo_task_execution
Path Refs
supabase/schemassupabase/app-schemassupabase/migrationspackage.json
Example Refs
examples/pco-dashboard/.creatorem/schemasexamples/pco-mobile/.creatorem/schemas
Trigger: When implementing or updating filter-backed features
Required Actions
- Follow WF-FILTERS-01 before editing app integration code.
- Verify filter slug parameters and return type from FilterList.
- Wire/verify app initialization files for the selected namespace.
- Update feature docs Filter API table with filter parameters and init paths.
Forbidden Actions
- Implement app-local behavior that duplicates existing filter extension points.
- Change filter behavior without verifying typed filter contract.
- Ship filter-backed feature updates without docs section updates.
Validation Expectations
- Output identifies namespace and init files used.
- Changed docs include Filter API section updates for impacted feature pages.
- Filter registration and apply points are traceable in changed files.
Capability Refs
filter_api_architecturesettings_api_fullstacki18n_web_setupi18n_mobile_setup
Path Refs
kit/utils/src/filters/list.tsapps/dashboard/hooks/use-filters.tsapps/dashboard/lib/init-server-filters.tsapps/dashboard/lib/init-cross-env-filters.tsapps/mobile/hooks/use-filters.tsapps/mobile/config/i18n.config.tsapps/creatorem/content/docs/(common)/filters-api.mdx
Example Refs
examples/pco-dashboard/hooks/use-filters.tsexamples/pco-dashboard/lib/init-server-filters.tsexamples/pco-dashboard/lib/init-cross-env-filters.tsexamples/pco-mobile/hooks/use-filters.tsexamples/pco-mobile/config/i18n.config.ts
Trigger: Before finalizing any implementation response
Required Actions
- Run relevant validation commands for touched scope (docs/contracts, typecheck, lint, tests).
- Summarize changed paths and behavior impact.
- Report exactly which commands were executed and which failed/skipped.
Forbidden Actions
- Claim success without command evidence.
- Omit known blockers affecting correctness.
Validation Expectations
- Final output includes command results and residual risk statement.
- Validation scope matches changed files/features.
Capability Refs
repo_task_execution
Path Refs
apps/creatorem/package.jsonpackage.json
Example Refs
examples/pco-dashboardexamples/pco-mobile