Agent Init Prompts
This directory holds copy-paste bootstrap prompts that initialize the local agentic setup of an existing project that talks to or runs a backend built on sopheak/sp-laravel-api — either a client (frontend/mobile/HTTP consumer) or the backend itself (Laravel app that configures the package).
A prompt here is meant to be pasted into an AI agent at the very start of an "initialize our local agentic setup" session. It encodes the non-negotiable parts of the API contract / package architecture so the agent does not have to re-learn them — or, more importantly, re-make the classic mistakes (bracket filters, select=*, invented relations, debugging the backend from the frontend, or writing custom CRUD controllers). The agent is expected to extend the project's existing .agents/ rules, not rebuild them.
Available Prompts
- Frontend Setup Prompt — initialize the local agentic setup of an existing API client project: learn the package, internalize the query/response contract, wire up schema discovery (MCP), extend the project's
.agents/rules with the missing sp-laravel-api knowledge, and set up the API-issue reporting workflow. - Backend Setup Prompt — initialize the local agentic setup of an existing Laravel backend that uses the package: learn the package, internalize the config-driven architecture (RecordTableType, triggers, validators, permissions, RPC functions), follow the migration → config → sync → validate workflow, and extend the project's
.agents/rules with the missing sp-laravel-api knowledge.
How to use
- Open the prompt page and click the copy button in the top-right corner of the code block (or manually select and copy the prompt text).
- Replace the
{PLACEHOLDERS}({project-name},{api-host},{schema-mcp-url},{api-prefix}, etc.) with your deployment's values. - Paste it into your AI agent's chat (Claude Code, Trae, opencode, etc.) at the start of the session — it is a self-contained init-context prompt.
Reference implementations
- Client: the KarunaFilm monorepo (
client_app/admin_appFlutter apps). Its.agents/rules/and.agents/context/backend-boundaries.mdshow the intended end state: a rootAGENTS.md, chunked rule files, a confirmed query-syntax table, minimalselect=projections, and a frontend-only scope with anapi-reports/folder. - Backend: the KarunaFilm API (
karunafilm_apiLaravel app). Its.agents/rules/(architecture, coding-standards, metadata) and.agents/context/sp-laravel-api.mdshow the intended end state: Option-1 module structure (config/records/tables/+app/Record/{Domain}/), the migration → config → sync → validate workflow, and distilled known-behaviors.
Docs the prompts point to
The prompts instruct the agent to read the package docs the "smart" way — the token-efficient chunked reference first:
docs/getting-started/mental-model.md,docs/getting-started/architecture.mddocs/guide/api/api-crud-operations.mddocs/guide/modules/module-pagination.mddocs/guide/api/api-nested-and-bulk-operations.mddocs/guide/api/api-errors-rate-security.mddocs/guide/api/api-config-and-middleware.mddocs/guide/api/api-validation.mddocs/guide/api/api-type-reference-and-examples.mddocs/guide/features/feature-permission.mddocs/guide/features/feature-record-trigger-functions.mddocs/core-concepts/relationships.md