Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 3.3 KB

copilot-instructions.md

File metadata and controls

27 lines (18 loc) · 3.3 KB

Copilot instructions: Plugin Elementary

Read AGENTS.md first: it is the source of truth for this project's conventions (stack, structure, TDD, framework patterns, security, guardrails), shared across all AI tools. This file adds only the Copilot-specific review conduct.

Detailed, path-scoped rules live in .github/instructions/:

  • primitives-php.instructions.md (generated by npm run sync-ai from the framework; absent until then): **/*.php framework architecture, security, testing, review flags.
  • structure.instructions.md: plugin layout and wiring.

This is the skeleton/template: names are placeholders (Project_Name / project-name) filled in per project. The framework (rtCamp\WPPrimitives) lives in the gitignored vendor/ and is not visible at review.

Task prompts

Two reusable prompts in prompts/, invoked in Copilot Chat. They are the Copilot peers of the Claude skills, kept consistent with them:

  • /init (init.prompt.md): set up / manage the project; installs dependencies (npm install, composer install), then drives npm run init.
  • /scaffold (scaffold.prompt.md): add one feature, TDD-first, via @rtcamp/wp-tooling.

Both are agentic: gather inputs and confirm before acting, and after any code change refresh the local knowledge graph (graphify update ., never committed) per the graphify policy in AGENTS.md. The review conduct below applies to PR review, not to running these prompts.

Review conduct

These tune how you comment; the what lives in AGENTS.md and the path-scoped files. Balance matters: catch every real issue, but don't drown it in noise.

  • One comment per distinct issue, and never more than one per comment. Every distinct problem gets its OWN separate comment at its own line, even when several issues sit on the same or adjacent lines (e.g. an unauthenticated permission_callback, raw $_POST use, and SQL injection in one method are THREE comments, not one). Do not merge unrelated findings. Conversely, when a single root cause spans several lines (e.g. the Singleton trait plus its get_instance() bootstrap), post it once at the clearest line and name the related lines; don't repeat the same finding.
  • Always post the missing-tests (TDD) finding when a new/changed feature or class ships without a matching test in tests/php/. This is mandatory and exempt from dedupe, trimming, and any comment-budget; never drop it in favour of other findings.
  • Order the rest by impact: security → architecture/contract (Singleton/Shareable/Loader/PSR-4/abstracts) → WordPress correctness → style. Lead with what breaks things.
  • Don't spend comments on what PHPCS/PHPStan already enforce. A bare "add a void return type" or "add visibility" is noise; the linters catch it. Only raise a typing issue when it changes behavior or hides a real bug. If a non-linter-covered style note is worth raising, give it its own comment too.
  • On a correct, deliberate implementation, don't manufacture findings. An idiomatic, defensible choice is not a bug. Prefer zero comments over low-value ones. A clean PR comes back clean. (A genuine correctness/security observation on otherwise-good code is still welcome; a stylistic preference is not.)