TorbatYar/docs/ai-framework/prompt-rules.md
Mortezakoohjani 5c6a2e78cf feat(platform): seed service registry, deploy all modules, and fix homepage catalog.
Register all active platform services and base features in core DB so admin can manage them, add delivery/hospitality/sports-center backend phases, update apps catalog and production deploy tooling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 12:39:51 +03:30

3.7 KiB
Raw Blame History

Prompt Rules

How every future AI phase prompt must behave.

Core Rules

  1. Never duplicate permanent instructions. Do not paste master-prompt.md, Definition of Done, enterprise completeness checklists, project principles, or entire architecture docs into a phase prompt.
  2. Only describe the current phase. Objective, Scope, Out of Scope, modules/services touched, completion criteria, and phase-specific constraints.
  3. Follow Runtime Read Policy. Instruct the agent to follow runtime-read-policy.md; do not duplicate document lists in phase prompts.
  4. Enterprise quality is automatic. Do not ask whether to add health, permissions, tests, audit, events, OpenAPI, pagination, or other mandatory-phase-artifacts.md — the framework already requires them when applicable.
  5. Enterprise Phase Discovery is automatic. Agents must run enterprise-phase-discovery.md before Implementation — do not restate the full Discovery procedure in the phase prompt.
  6. Reference, dont rewrite. Link to templates, gates, DoD, Discovery, and manifests instead of redefining them.
  7. No silent scope expansion. Out of Scope must be explicit; agents must not implement adjacent or future phases (boundary-rules.md).
  8. No business logic in framework prompts. Framework docs stay process-only; phase prompts carry feature intent.
  9. Completion stops the agent. After Discovery gaps closed + DoD + gates + handover are done, stop — do not start the next phase unless asked.
  10. CRUD is never enough. Phase prompts must not imply that CRUD-only delivery completes a phase.

Required Phase Prompt Skeleton

# Phase <ID> — <Title>

Follow [Runtime Read Policy](runtime-read-policy.md).

Permanent framework rules live under `docs/ai-framework/` — link to them; do not paste ([prompt-rules.md](prompt-rules.md)).

## Objective
...

## Scope
...

## Out of Scope
(explicit; do not pull future phases forward)

## Required Templates
(list only those that apply: service/module/entity/repository/service-layer/api/event/testing/documentation)

## Completion Criteria
- Enterprise Phase Discovery completed (gaps promoted & closed)
- Business Analysis + Domain Modeling completed
- Mandatory phase artifacts delivered for this boundary
- Definition of Done satisfied (CRUD is not sufficient)
- Enterprise Completeness signed off
- Development loop completed
- Quality gates passed
- Phase handover completed
- Registries/manifests/progress/next-steps updated
- Stop after this phase only

Forbidden Prompt Behaviors

  • Re-stating Database-per-Service, tenancy, FE/BE, DoD, Discovery procedure, or completeness matrices in full (link instead)
  • Asking to “also quickly do” the next phase
  • Allowing TODO leftovers for claimed work
  • Instructing agents to bypass quality gates or mark missing artifacts as “limitations”
  • Overwriting accepted ADRs
  • Treating CRUD as the definition of done
  • Skipping Discovery or coding before the Discovery Record exists
  • Waiving tenant isolation, audit, events, or tests for convenience

When to Extend the Framework

If a permanent rule is missing, update docs/ai-framework/ (and ADR if architectural) in a dedicated docs change — do not bury permanent rules inside a single phase prompt.