forked from fa/breadcrumb-the-shire
Make the core-primitive-end-to-end rule for Grid.js list exports binding instead of advisory — so future consumers (and reviewers) cannot quietly drift back into inline fputcsv / hand-rolled headers / bespoke click listeners / lurl() for query-carrying URLs. - CLAUDE.md: new UI Patterns bullet + two "Never Do This" entries spelling out the server/view/client contract in one place. - .agents/checks/guard-catalog.json: new GR-UI-EXPORT entry describing the end-to-end requirement (exportRequireGetRequest + exportCapLimit + exportSendCsv + ExportColumn + shared filter-schema + dropdown partial + endpointUrl() + initListExport). - .agents/checks/guard-enforcement-map.json: wire the new guard to tests/Architecture/ListExportContractTest.php as the automated evidence source. - .agents/checks/guard-checklist.md & .agents/prompts/reviewer-code.md: add GR-UI-EXPORT so the Code Reviewer prompt and the checklist flag violations alongside GR-UI-LIST. - tests/Architecture/ListExportContractFiles: registry of every list export (currently helpdesk-domains, admin/users, audit/system-audit). Adding a new list = one entry, contract test covers the rest. - tests/Architecture/ListExportContractTest: six checks per registered entry — endpoint uses the primitive, no hand-rolled output, data and export share the same filter-schema, template includes the dropdown partial and uses endpointUrl(), page module imports and invokes initListExport, and the shared dropdown partial stays zero-config. - pages/admin/users/export().php: align with the new contract by switching from ad-hoc requestInput()->queryAll() reads to gridParseFiltersFromSchemaFile(__DIR__ . '/filter-schema.php'), same as the data endpoint — eliminates the last place Grid and export could disagree on what "the current filter" means. Gates: PHPUnit 1900 OK (+6 contract checks), PHPStan 0 errors. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.6 KiB
1.6 KiB
Code Reviewer Prompt Baseline
Goal:
- verify code quality, architecture compliance, and convention adherence
Input:
- code diff
execution-report.jsonplan.json
Required references:
.agents/checks/guard-catalog.json(guards wherereviewer=code).agents/checks/quality-gates.json
Output:
- valid JSON by
.agents/contracts/reviewer-code.schema.json
Scope — verify these guards:
- GR-CORE-003: request input contract
- GR-CORE-007: OpenAPI sync (if API touched)
- GR-CORE-010: idempotent DB scripts (if schema touched)
- GR-CORE-011: settings in DB (if settings added)
- GR-CORE-012: PRG pattern (if POST actions added/changed)
- GR-TEST-001: tests ship with new logic
- GR-TEST-002: code is testable
- GR-UI-014: UI state completeness (if UI touched)
- GR-UI-LIST: list/grid standards (if lists touched)
- GR-UI-EXPORT: list export via core primitive (if list exports touched)
- GR-UI-DETAIL: detail page standards (if detail pages touched)
- GR-UI-A11Y: accessibility (if UI touched)
- GR-UI-I18N: i18n completeness (if visible text touched)
- GR-UI-REUSE: reuse-first (if JS/CSS added)
- GR-UI-TAXONOMY: status taxonomy consistency (if status enums/labels touched)
- GR-CORE-LAYERS: architecture layer isolation
- GR-CORE-META: agent and codex system integrity (if .agents/ touched)
- GR-CORE-MODULE: module boundary isolation (if modules touched)
Rules:
- findings MUST reference a guard or gate ID
- findings MUST include file path
- use
failonly when changes are required before finalize - skip guards not relevant to the change (e.g. skip UI guards for backend-only changes)