Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 16, 2025

GitHub Copilot requires YAML frontmatter with applyTo glob patterns for path-specific instructions, setup workflows for Coding Agent, and custom agents for specialized tasks. Our instruction files used markdown headers instead of proper frontmatter, had no environment setup, and lacked custom agents.

Changes

YAML Frontmatter Migration

All instruction files in .github/instructions/ now use proper frontmatter:

---
applyTo: "crates/feedparser-rs-core/src/parser/**"
---

# Parser Module Instructions
...

Multi-path format for test files:

---
applyTo:
  - "tests/**"
  - "crates/**/tests/**"
  - "crates/**/benches/**"
---

Files updated: parser.instructions.md, types.instructions.md, python-bindings.instructions.md, node-bindings.instructions.md, tests.instructions.md

Coding Agent Setup Workflow

Created .github/copilot-setup-steps.yml with:

  • Rust toolchain (stable + rustfmt/clippy)
  • cargo-make and nextest installation
  • Rust-cache for build artifacts
  • Build, test, lint, format, doc steps

Custom Agents

Created .github/agents/ with two specialized agents:

rust-developer.agent.md - Core parser development

---
name: Rust Parser Developer
tools: [read, search, edit, terminal]
---

Focus: Tolerant parsing, performance optimization, RSS/Atom/JSON Feed specs

code-reviewer.agent.md - Security and quality review

---
name: Code Reviewer  
tools: [read, search]
---

Focus: SSRF/XSS/DoS protection, API compatibility, bozo pattern validation

References

Original prompt

This section details on the original issue you should resolve

<issue_title>chore: Update Copilot instructions to match GitHub documentation</issue_title>
<issue_description>## Summary

Current Copilot instructions need to be updated to follow GitHub's official documentation for maximum compatibility with GitHub Copilot Coding Agent and Code Review features.

Current Issues

1. Path-specific instructions missing YAML frontmatter

Documentation requirement: Files in .github/instructions/ must have YAML frontmatter with applyTo glob patterns.

Current state: Our instruction files use markdown headers like **Applies to:** ... instead of proper frontmatter.

Files affected:

  • parser.instructions.md - Missing frontmatter
  • types.instructions.md - Missing frontmatter
  • python-bindings.instructions.md - Missing frontmatter
  • node-bindings.instructions.md - Missing frontmatter
  • tests.instructions.md - Missing frontmatter

Required fix:

---
applyTo: "crates/feedparser-rs-core/src/parser/**"
---
# Parser Module Instructions
...

2. No custom agents configured

Documentation: Create custom agents

Current state: No .github/agents/ directory exists.

Recommended agents to create:

Agent Purpose Tools
rust-parser.agent.md Core parser development read, search, edit, terminal
python-bindings.agent.md PyO3 binding work read, search, edit, terminal
code-review.agent.md Specialized code review read, search

3. Missing copilot-setup-steps.yml for Coding Agent

Documentation: Coding Agent needs environment setup for running tests/builds.

Required file: .github/copilot-setup-steps.yml

name: Copilot Setup

on:
  workflow_dispatch:

jobs:
  setup:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Install Rust
        uses: dtolnay/rust-action@stable
        with:
          toolchain: stable
          components: rustfmt, clippy
          
      - name: Cache cargo
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/bin/
            ~/.cargo/registry/
            ~/.cargo/git/
            target/
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
          
      - name: Build
        run: cargo build --all-features
        
      - name: Run tests
        run: cargo test --all-features
        
      - name: Lint
        run: cargo clippy --all-features -- -D warnings

4. Instructions too verbose

Best practice: "Keep instructions concise (ideally under two pages)"

Current state:

  • types.instructions.md - 14,737 bytes (~400 lines)
  • python-bindings.instructions.md - 13,908 bytes
  • tests.instructions.md - 12,927 bytes

Recommendation: Condense to essential patterns and link to detailed docs.

5. Missing excludeAgent for targeted instructions

Some instructions should only apply to code review, not coding agent:

---
applyTo: "crates/feedparser-rs-core/src/parser/**"
excludeAgent: "coding-agent"
---
# Code Review Specific Rules
...

Tasks

Phase 1: Fix frontmatter (Critical)

  • Add YAML frontmatter with applyTo to all .github/instructions/*.md files
  • Verify glob patterns match intended file paths

Phase 2: Add Coding Agent support

  • Create .github/copilot-setup-steps.yml
  • Test with GitHub Copilot Coding Agent

Phase 3: Create custom agents

  • Create .github/agents/ directory
  • Add rust-developer.agent.md
  • Add code-reviewer.agent.md

Phase 4: Optimize instructions

  • Condense verbose instructions to essential rules
  • Add excludeAgent where appropriate
  • Move detailed examples to separate documentation

References

Expected Frontmatter Format

parser.instructions.md

---
applyTo: "crates/feedparser-rs-core/src/parser/**"
---

types.instructions.md

---
applyTo: "crates/feedparser-rs-core/src/types/**"
---

python-bindings.instructions.md

---
applyTo: "crates/feedparser-rs-py/**"
---

node-bindings.instructions.md

---
applyTo: "crates/feedparser-rs-node/**"
---

tests.instructions.md

---
applyTo:
  - "tests/**"
  - "crates/**/tests/**"
  - "crates/**/benches/**"
---
```</issue_description>...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes bug-ops/feedparser-rs#20

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/bug-ops/feedparser-rs/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.

@github-actions github-actions bot added type: documentation Improvements or additions to documentation type: tooling Development tools, CI/CD, or infrastructure component: core feedparser-rs-core Rust library component: python Python bindings (PyO3) component: node Node.js bindings (napi-rs) size: S Small PR (<50 lines changed) labels Dec 16, 2025
Copilot AI changed the title [WIP] Update Copilot instructions for compatibility with GitHub documentation chore: Update Copilot instructions to GitHub documentation standards Dec 16, 2025
Copilot AI requested a review from bug-ops December 16, 2025 17:04
@bug-ops bug-ops marked this pull request as ready for review December 16, 2025 17:09
@github-actions github-actions bot added size: L Large PR (<500 lines changed) and removed size: S Small PR (<50 lines changed) labels Dec 16, 2025
@bug-ops bug-ops merged commit 004aff3 into main Dec 16, 2025
38 of 47 checks passed
@bug-ops bug-ops deleted the copilot/update-copilot-instructions branch December 16, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: core feedparser-rs-core Rust library component: node Node.js bindings (napi-rs) component: python Python bindings (PyO3) size: L Large PR (<500 lines changed) type: documentation Improvements or additions to documentation type: tooling Development tools, CI/CD, or infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants