Skip to content

Refine Copilot coding‑agent instructions to align with our actual plugin context #566

@ashleyshaw

Description

@ashleyshaw

🧠 Issue: Refine Copilot coding‑agent instructions to align with our actual plugin context

🎯 Background

We currently have draft .instructions.md files with content that:

  • References WordPress or generic tour‑operator plugin logic not relevant to our codebase
  • Includes outdated boilerplate or tooling assumptions
  • Doesn’t reflect our specific plugin architecture, build tools, or CI pipeline

GitHub recently added support for .instructions.md in Copilot coding agent tasks (GitHub Changelog, Jul 23, 2025) :contentReference[oaicite:1]{index=1}

✅ Objective

  • Remove any WordPress or generic tour‑operator-plugin references entirely
  • Focus instructions on our real project structure, domain logic, build/test commands, linting rules, etc.
  • Ensure instructions are scoped per directory where applicable, and only apply when appropriate

🔧 Proposed Plan

1. Remove irrelevant content

Purge existing .instructions.md content that references:

  • WordPress hooks, themes, modules
  • Generic tour‑operator boilerplate or plugin scaffolding

2. Add scoped .instructions.md files under .github/instructions/

Example front‑matter:

---
applyTo: "src/custom‑plugin/**/*.js"
---

Then include only instructions related to:

  • Build/test commands (npm run build / yarn test)
  • Module structure, folder logic
  • Naming conventions and linting (e.g. ESLint config, Prettier)
  • Domain-specific guidance (e.g. “handle date parsing using UTC offset logic”, “use existing tour booking SDK integration module”)

This is supported by Copilot coding agent in VS Code and IDEs ([GitHub Docs][1], [The GitHub Blog][2]).

3. Optional: Add or update .github/copilot-instructions.md

For broad context that applies across the entire repository, particularly for:

  • Chat and code‑review flows
  • Overall style preferences
  • Global tooling conventions

Repository-wide custom instructions are picked up automatically by Copilot Chat and code review features ([GitHub Docs][3], [The GitHub Blog][4]).

4. Exclude legacy or irrelevant files from Copilot

Configure Copilot content exclusion (via repo or org settings) to prevent access to:

  • /wordpress/**
  • /deprecated-samples/
  • Other legacy folders

This ensures agent suggestions aren’t influenced by outdated files ([GitHub][5], [GitHub][6]).

📌 Next Steps

  • Review and sanitize existing .instructions.md
  • Draft new per-directory .instructions.md files with appropriate applyTo
  • (Optional) Create/update .github/copilot-instructions.md for global guidance
  • Configure content exclusion settings in GitHub
  • Test the agent by kicking off a sample task (e.g. “refactor booking flow”) and evaluate how suggestions align with project context

📚 References

  • GitHub Copilot coding agent now supports .instructions.md for background agent tasks ([The GitHub Blog][2])
  • Docs on repository-level .github/copilot-instructions.md support for chat and code review ([GitHub Docs][3], [The GitHub Blog][7])
  • Guidance for .instructions.md files with applyTo in VS Code agent mode ([GitHub][5])
  • Best practices for excluding content from Copilot with content exclusion settings ([GitHub Docs][8], [GitHub Docs][1])

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions