Guide for automated agents (LLMs, code assistants, review bots) working on this repository.
This is the primary entrypoint for AI agents working on this repository. Read this file first.
This file owns the high-level operating contract for agents:
- workflow
- repository exploration requirements
- change hygiene
- review expectations
- completion format
- document ownership and reading order
After this file:
- read
SKILL.mdfor the compact quick-start and document map - read
GEMINI.mdfor technical conventions and framework-level guardrails - read task-specific documents only when needed
Version scope
The default branch of this repository documents and implements Pair v4 in alpha state. Use the
v3branch for the stable Pair v3 line. Guidance in this branch targets Pair v4 and may not apply, or may apply only partially, to products based on earlier major versions.
Help improve the Pair v4 framework with small, safe, reviewable changes that respect existing architecture and conventions.
When instructions conflict, prefer the smallest safe change aligned with existing Pair patterns and backward compatibility.
Before making any change:
- Inspect the
/srcdirectory to understand namespace layout. - Identify the closest existing component solving a similar problem.
- Read at least one full class in that component to understand conventions.
- Check if utilities already exist before creating helpers.
- Inspect
/tests(if present) to understand expected behavior. - Verify public API usage before modifying framework classes.
Never introduce a new architectural pattern if an existing one already solves the problem.
For coding conventions and technical guardrails, defer to GEMINI.md.
If /tests is not present, verify behavior through the closest available manual or local validation path and mention that in the final report.
- Locate the relevant component in
/src. - Read existing patterns in that component or namespace.
- Implement the smallest possible change that solves the task.
- Verify that backward compatibility is preserved (unless explicitly requested otherwise).
- Add or update tests if the behavior changes.
- Keep the implementation consistent with Pair conventions defined in
GEMINI.md. - If public framework behavior changes, update the relevant pages in the sibling
pair.wikidocs, especially forsrc/Apiand.envconfiguration changes.
Use deeper documents only when needed:
PAIR_PATTERNS.mdfor idiomatic implementation detailsPAIR_ARCHITECTURE.mdfor framework internalsPAIR_TASKS.mdfor larger or riskier tasksPAIR_CONTEXT.mdwhen there is a risk of importing patterns from other frameworks
Use each file for its owning responsibility:
AGENTS.md: primary entrypoint, workflow, mandatory exploration, output contract, document ownershipSKILL.md: compact quick-start, search heuristics, component map, minimal runbookGEMINI.md: technical conventions, architecture summary, coding standards, security and testing guidanceCODEX.md: Codex-specific operating notes that must stay compatible with this fileCLAUDE.md: Claude-specific reading order that must stay compatible with this filePAIR_ARCHITECTURE.md: framework internals and design reasoningPAIR_PATTERNS.md: implementation patterns and nearby code shapePAIR_CONTEXT.md: strategic context and anti-pattern avoidancePAIR_TASKS.md: guidance for larger, riskier, or multi-step tasks
Do not duplicate the same rule in multiple files unless the repetition prevents a likely mistake.
Default reading order for most tasks:
AGENTS.mdSKILL.mdGEMINI.mdCODEX.mdorCLAUDE.mdonly when relevant to the current agent- One deeper task-specific document only if uncertainty remains
If the task is small and local, stop after step 3 unless there is ambiguity or architectural risk.
If guidance conflicts, use this order:
- Existing repository code
- Tests
AGENTS.mdSKILL.mdGEMINI.md- Agent-specific file (
CODEX.md,CLAUDE.md, or equivalent) PAIR_ARCHITECTURE.mdPAIR_CONTEXT.mdPAIR_PATTERNS.mdPAIR_TASKS.md
Agents must follow these rules:
- Keep diffs minimal.
- Avoid unsolicited refactoring.
- Preserve backward compatibility by default.
- Do not introduce heavy dependencies for simple tasks.
- Do not introduce jQuery.
- Do not log sensitive data.
- Do not commit credentials or secrets.
- Do not modify unrelated files.
- Add comments/docblocks to PHP and JS functions that are touched.
- Add a short comment for non-trivial code paths that are introduced or changed.
- Comments and docblocks in Pair framework code must always be written in English.
- Comments and docblocks are non-authoritative documentation only; removing them must never change runtime behavior.
- Do not encode required behavior, configuration, or migration-critical instructions exclusively in comments or docblocks.
- If a request is ambiguous, too broad, or risks an architectural or backward-compatibility mistake, ask for clarification before changing code.
Agents must avoid:
- Large refactors unrelated to the task
- Rewriting existing utilities with custom implementations
- Introducing new dependencies without clear justification
- Changing public APIs without explicit request
- Changing coding conventions defined in GEMINI.md
- Creating parallel architectures for existing components
Every change proposal or pull request should include:
- What changed
- Why the change is needed
- Files modified
- Risk assessment
- Manual test steps
- Possible follow‑up improvements (optional)
What / Why:
- ...
Files:
- ...
Risk and rollback:
- ...
Manual test:
- ...
Before completing the task:
- I read
AGENTS.mdfirst and used it as the primary guide - I followed conventions defined in
GEMINI.md - I applied the quick-start guardrails defined in
SKILL.md - I explored the repository before coding
- I preserved backward compatibility
- I did not introduce performance regressions
- I did not introduce new dependencies unnecessarily
- I did not commit secrets
- I updated or added tests when behavior changed
- I updated
pair.wikidocs when public framework behavior changed - I documented manual test steps if applicable