| type | skill |
| name | admin-ui |
| description | Use when editing owner/admin pages, CRUD forms, media library, environment editor, permissions, audit log, integrations, or admin navigation. |
Admin UI
- Follow the root
AGENTS.md repository contract and its app/view/storage area rules.
- Keep owner/admin UI PHP-template based.
- Admin mutations should route through controllers/services and remain auditable.
- Use schema-driven resource fields and the media library for product, temple, and astrologer media.
- Keep astrologer accounts admin-created; show temporary credentials only until the provider changes the initial password.
- Validate with
php tests/run.php; use a browser workflow for changed admin pages.
Admin Panel Agent (bapXcli)
The admin panel has an agent interface at /admin/agent that:
- Answers questions about the site: user count, orders, revenue, products, consultations
- Creates/edits blog posts via natural language prompts (delegates to
bapXaura write blog)
- Reads MySQL data through
DatabaseService to answer queries
- Calls AI model configured in Admin → Integrations (Google Gemini endpoint by default)
- Reads attachments from
.agents/temp/ (screenshots, documents provided by the user)
- Triggers CI/CD actions on the hosting server via
workflow_dispatch
Implementation Pattern
The agent controller:
- Receives prompt via POST (JSON body with
prompt field, optional attachment reference)
- Builds context from MySQL:
DatabaseService queries for users, orders, products, etc.
- Calls AI API using
SecretService (agent_api_key, agent_model, api_endpoint)
- Streams Markdown response back to the admin panel UI
Agent Permissions
The admin agent has read access to:
users — count, list
orders — count, list, revenue totals
products — list, details
astrologers — list, details
appointments — list, count
support_tickets — list, count
audit_events — recent events
settings — public settings
Write/mutation operations require explicit user confirmation before execution.
AI Integration Secrets
Configured in Admin → Integrations with these fields stored in MySQL secrets table:
| Key | Purpose |
|---|
agent_api_key | Authentication key |
agent_model | Model ID; defaults to gemma-4-31b-it |
api_endpoint | Full provider API URL |