agentleFS
jonathan-vellajonathan-vella/apex/.github/copilot-instructions.md

apex

Copilot instructions216 starsChanged 2 months agoMITView on GitHub

VS Code Copilot-specific orchestration instructions. For general project conventions, build commands, and code style, see the root AGENTS.md. This section is the canonical declaration of Azure infrastructure defaults. Azure-producing skills, agents, and prompts use this section — never restate the values inline. The IaC workflow, CAF naming guidance, AVM procedure, and reference index live in .github/skills/apex-azure-defaults/SKILL.md. Tag schema is whatever live Azure Policy enforces in the target subscription. Governance Discovery (Step 3.5) discovers the real contract via discover.py and writes…

  • Reads credentials
  • Commits and pushes

The file

We split this copilot-instructions.md into the rules it gives an agent

8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    All session state flows through apex-recall.

    line 69
  2. Distinctive:

    If recall returns sufficient, current context, skip redundant file reads.

    line 94
  3. Very specific:

    If a required reviewer is unavailable, STOP and request a human handoff to 10-Challenger.

    line 132
  4. Very specific:

    Keep essential role, approval, security, output, and stop rules in main agent bodies.

    line 136
  5. Distinctive:

    Use available editing tools for existing files, preserve user work, and validate before dependent follow-up edits.

    line 142
  6. Distinctive:

    Keep the helper single-quoted.

    line 167
  7. Distinctive:

    Check whether the needed information is already in context from earlier file reads before calling Explore.

    line 180
  8. Very specific:

    Terminal hygiene: Never use mv -i, rm -i, cp -i, read -p, or any prompt-driven shell builtin (incl.

    line 188

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

APEX - Copilot Instructions

VS Code Copilot-specific orchestration instructions. For general project conventions, build commands, and code style, see the root AGENTS.md.

Azure Defaults (canonical)

This section is the canonical declaration of Azure infrastructure defaults. Azure-producing skills, agents, and prompts use this section — never restate the values inline. The IaC workflow, CAF naming guidance, AVM procedure, and reference index live in .github/skills/apex-azure-defaults/SKILL.md.

Default Regions

ServiceDefault RegionReason
All resourcesswedencentralEU GDPR-compliant
Static Web AppswesteuropeNot available in swedencentral
FailovergermanywestcentralEU paired alternative

Required Tags (Azure Policy Enforced)

Tag schema is whatever live Azure Policy enforces in the target subscription. Governance Discovery (Step 3.5) discovers the real contract via discover.py and writes it to 04-governance-constraints.json (tag_contract.tags[], tag_contract.source: "policy"); that always wins.

Greenfield fallback (no tag policy found at any inherited scope): the APEX-standard 9-tag set — environment, owner, costcenter, application, workload, sla, backup-policy, maint-window, technical-contact — all lowercase. This mirrors the org-wide resource-group tag-deny policy (every key must exist on the RG or the deployment is denied). Citation + greenfield decision checklist: apex-azure-defaults/references/tag-strategy.md.

The PascalCase set (Environment, ManagedBy, Project, Owner) is a deprecated convention retained only for backward compatibility on existing projects whose deployed resources already carry that casing. Do not propagate it to new projects. ManagedBy and Project are not part of the required contract — ManagedBy may still be emitted as an optional deploy-provenance marker.

Security baseline + AVM mandate

Non-negotiable: HTTPS-only, TLS 1.2 minimum, no public blob, Managed Identity over keys, AVM-first. PaaS data services use private endpoints and disabled public access in every environment, except Log Analytics and workspace-based Application Insights: authenticated public query/ingestion is permitted when policy and approved requirements allow it; AMPLS is required for mandated private monitoring, not by default. App Service APIs are private; public-facing web applications may use public HTTPS ingress. Private DNS resolution is required; verified DINE ownership avoids duplicate DNS deployment, not DNS itself. Full rules: iac-policy-compliance.md and iac-security-baseline.md.

SKU source of truth

Creative SKU decisions (App Service, VM, SQL, Cosmos, AKS pools, Redis, APIM, App Gateway, Storage replication) flow through agent-output/{project}/sku-manifest.{json,md} — never re-derive SKUs from artifact prose. Authoring rules: sku-manifest.instructions.md.

Session State — apex-recall

All session state flows through apex-recall. Do not read or write 00-session-state.json directly.

# Lifecycle
apex-recall init <project> --json                                    # new project
apex-recall show <project> --json                                    # context: step, decisions, findings, artifacts
apex-recall checkpoint <project> <step> <phase> --json               # after each phase
apex-recall complete-step <project> <step> --json                    # on step completion
apex-recall review-audit <project> <step> ... --json                 # after challenger reviews

# Atomic step transition — PREFERRED for moving between steps. Bundles
# complete-step (with challenger gate) + decide + start-step into one
# 00-session-state.json write, avoiding partial-update drift.
apex-recall transition <project> --from-step <s> --to-step <t> \
    --complete --decision key=value --json

# Decisions + findings
apex-recall decide <project> --key <k> --value <v> --json
apex-recall decide <project> --decision "<text>" --rationale "<why>" --json
apex-recall finding <project> --add "<text>" --json

# Read-only orientation: sessions | files | search '<term>' | decisions (all accept --json)

If recall returns sufficient, current context, skip redundant file reads. A file inventory is not its content. Read missing required sections directly; after edits, compaction, or a new chat, refresh what is no longer current or available. Empty/failed recall does not waive required inputs or approvals: recover existing project state before advancing, and never infer completion from artifact numbering.

Canonical show --json schema (including the session.steps shape and jq query templates) lives at tools/apex-recall/docs/show-schema.md. The valid decision-keys registry lives at tools/apex-recall/docs/decision-keys.md.

Multi-Step Workflow

The Steps 1–7 + Post-Lessons table is in AGENTS.md; the machine-readable source is .github/skills/apex-workflow-engine/templates/workflow-graph.json. Each step's outputs land in agent-output/{project}/; context flows via artifacts and handoffs. Follow the graph's review contract and workflow table, including the independent Step 2 cost-feasibility review. Reuse valid completed reviews; missing/stale evidence or blocking findings must be resolved before approval. Deep review requires decisions.review_depth = "deep" or an explicit user request, never complexity alone. Production handoffs and approval gates remain human-controlled.

Skills

Skills auto-discover via the description field in .github/skills/{name}/SKILL.md. Agents read SKILL.md files on demand and load references/*.md only when the body explicitly points to one. There is one tier — no digest, no minimal.

Harness And Runtime Boundaries

  • Local prompt files are adapters, not Agent Host entry points. On Agent Host, use the shared skill and explicitly select its owning main agent before consequential work. Skills inherit the caller's model/tools; they do not switch agents or confer permissions.
  • Main agents, including 10-Challenger, use disable-model-invocation: true. The Orchestrator routes through human handoffs only. Explicit caller allowlists must not override that boundary; legacy discovery settings are not a security boundary.
  • If a required reviewer is unavailable, STOP and request a human handoff to 10-Challenger; never invoke a nested wrapper or fabricate an inline review. Missing/empty reviewer output permits exactly one identical-input retry, then a human handoff under the review protocol.
  • Keep essential role, approval, security, output, and stop rules in main agent bodies. Authoring applyTo matches do not prove runtime attachment. Load required guidance when missing; do not automatically load vendor-authoring guidance during production work.
  • Agent frontmatter owns model assignments. Sol, Terra, and Luna labels do not prove runtime cost-tier eligibility, availability, or API support. Stop on unsupported routing; do not substitute models automatically. Local and Agent Host behavior needs separate verification.
  • Use available editing tools for existing files, preserve user work, and validate before dependent follow-up edits. No shared procedure requires a particular bulk-edit tool.

Chat Triggers

  • Messages starting with gh are GitHub operations (e.g., gh pr create, gh workflow run, gh api). Follow .github/skills/apex-github-operations/SKILL.md (gh CLI-first, MCP fallback).

GitHub Tool Priority (Mandatory)

For issues and pull requests, prefer the gh CLI over GitHub MCP tools — the CLI is always available in this dev container and is the more stable primitive. Fall back to MCP only when an operation has no gh CLI equivalent (e.g., rich PR review thread management or bulk GraphQL queries). In devcontainers, do not run gh auth commands unless the user explicitly asks for CLI auth troubleshooting. Git normally uses VS Code-forwarded host credentials; gh uses its explicitly authenticated config volume or optional GH_TOKEN inherited by the host VS Code process at launch (${localEnv:GH_TOKEN}). terminal.integrated.env.* affects terminals only, not that substitution or all hooks, MCP processes, and the extension host. Never request tokens through chat, expose them to the model, or store secrets in repository files. For an identity mismatch, compare gh api user --jq .login with the account named in Git's denial. Only with explicit user authorization, use git -c credential.helper= -c credential.helper='!gh auth git-credential' push origin <approved-feature-branch>. Keep the helper single-quoted. Never switch credentials automatically, change persistent Git configuration, force-push, or infer approval to push to main.

Explore Subagent Thoroughness

Specify thoroughness explicitly when invoking Explore:

Lookup TypeThoroughnessExamples
Single file read, config checkquick"What's in azure.yaml?", "Find the main.bicep path"
Multi-file comparison, pattern searchmedium"How do agents reference skills?", "What modules exist?"
Deep codebase researchthorough"Audit all security patterns", "Full dependency analysis"

Check whether the needed information is already in context from earlier file reads before calling Explore.

Conventions, Key Files & Validation

See AGENTS.md for all conventions, project structure, key file paths, and build/validation commands.

Terminal hygiene: Never use mv -i, rm -i, cp -i, read -p, or any prompt-driven shell builtin (incl. inside bash -c '...'). Pipe >50-line output to a file. See .github/instructions/no-interactive-shell.instructions.md for the full ruleset; npm run lint:safe-shell enforces it on committed agent/skill/instruction snippets.

Artifact lint delegation: Agents do not call npm run lint:artifact-templates or markdownlint-cli2 directly against agent-output/**. The lefthook artifact-validation pre-commit hook and the 10-Challenger review own the contract. Validator-tracked anti-pattern — see agent-authoring.instructions.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.