Portable operating rules for any AI agent or agentic tool (GitHub Copilot, Claude Code, Codex, Cursor, Copilot CLI, and other AGENTS.md-aware harnesses) working in this repository. This file is the tool-neutral entry point; the authoritative, auto-loaded detail lives in Instructions/ and .memory-bank/.
CopilotAtelier is a portable GitHub Copilot customization toolkit: custom agents (Agents/), auto-applied coding instructions (Instructions/), on-demand skills (Skills/), and prompt templates (Prompts/), synced across machines by Setup-CopilotSettings.ps1.
This repo enforces a discovery-first, close-out-clean contract on every substantive turn.
Pre-flight (before the first tool call) — see Instructions/preflight.instructions.md:
- Probe for
.memory-bank/(list_dir/file_search/Test-Path). The workspace summary is not authoritative for dotfolders — do not conclude "no Memory Bank" without probing. - Read
.memory-bank/index.md, then apply its task routes. Only the index is unconditional;promptHistory.mdis local ephemera limited to interaction-history analysis and Memory Bank evals. Fail open to the complete available base when the index saysloading-mode: fullor routing is unsafe. Seven files are required and version-controlled; include localpromptHistory.mdand optionalglossary.mdwhen present. For durable writes, load thememory-bankSkill and create only missing files before the first project edit. Never overwrite existing files. Do not initialize for Q&A, clarification, read-only work, or transient preferences. - Match
Instructions/*.instructions.mdbyapplyToagainst files you will touch; read each match. - Match
Skills/**/SKILL.mdby description against the task; read each match. - Do not append
promptHistory.mdat pre-flight. Post-flight owns the append for substantive turns; routine pre-flight does not read it. - Open the reply with a UTC timestamp
[YYYY-MM-DD HH:mm UTC]plus a one-line PRE-FLIGHT acknowledgment.
Post-flight (before ending the reply) — see Instructions/postflight.instructions.md:
Classify the turn first. A non-impacting turn (pure Q&A, read-only investigation, a self-documenting git commit/merge) skips steps 1–4 and emits only POST-FLIGHT: n/a — non-impacting turn (<reason>). A substantive turn (a file changed, a durable decision emerged, the user asked to record, a bug was found, or a tag was cut) runs all steps:
- Verify the change (parse / lint / build / tests). Markdown-only edits: state "no executable verification required."
- Update the Memory Bank (
activeContext.md,progress.md,promptHistory.md). - Update
CHANGELOG.mdunder[Unreleased]for any user-visible change. - Commit locally on an
ai/<slug>branch with a conventional-commit message plus aCo-authored-by: AI Assistant <ai@example.com>trailer, unless the user explicitly requested uncommitted changes. - Clear the deployed Definition of Done gate: acceptance criteria, role-specific gates, focused/final validation, self-review, risk-triggered independent review, security, and residual-risk reporting.
- Emit a
[x]/[ ]POST-FLIGHT checklist.
Never run git push (or any remote-mutating git operation) unless the user explicitly asks in the current turn. Local commits and branches are fine; pushing, force-pushing, and PR creation require explicit per-turn authorization. Do not bypass hooks (for example --no-verify).
- Approved verbs only. Every function uses a verb from
Get-Verb(Get,Set,New,Test,Invoke,Remove, and so on). NoRetrieve/Delete/Change. [CmdletBinding()]on advanced functions; validate parameters ([ValidateNotNullOrEmpty()],[ValidateSet()],[ValidatePattern()]).-ErrorAction Stopplus try/catch for anything that must not silently fail;[PSCredential]/SecureStringfor secrets, never plaintext.- Full detail:
Instructions/powershell.instructions.mdandInstructions/powershell-execution-safety.instructions.md.
- Tests are Pester 5. Write or update the test alongside the code — do not ship script changes without covering tests.
- Run Pester through the fully detached cross-platform launcher to avoid freezing the editor (see
Instructions/powershell-execution-safety.instructions.md); helper functions used insideItlive inBeforeAll. - Patterns:
Skills/pester-patterns/; conventions:Instructions/pester.instructions.md.
- Follow
Instructions/copilot-authoring.instructions.md: correct frontmatter per file type, narrowapplyTo, purposeful emphasis, no maintenance footers. - New skills follow the
skill-creatorskill: third-persondescription≤ 1024 chars withUSE FOR:/DO NOT USE FOR:, body ≤ 500 lines, references one level deep, folder name matching thename:field. - When building agents, LLM features, or MCP servers, run the
agent-security-reviewskill (lethal-trifecta test, OWASP Top 10 for LLM Applications, containment-first); measure skill/prompt/agent changes with theagent-evalsskill. - Markdown must lint clean (see
Instructions/markdown.instructions.md). - If a
glossary.mdexists in.memory-bank/, use only its canonical terms (Ubiquitous Language).
Agents declare Claude Opus 4.8 (copilot) as the current model. When bumping models, update the agent frontmatters and reflect the change in the Memory Bank.