Skip to content

Add .github/copilot-instructions.md with coding conventions#88

Merged
dgenio merged 4 commits intomainfrom
53-add-copilot-instructions
Mar 6, 2026
Merged

Add .github/copilot-instructions.md with coding conventions#88
dgenio merged 4 commits intomainfrom
53-add-copilot-instructions

Conversation

@dgenio
Copy link
Owner

@dgenio dgenio commented Mar 6, 2026

What changed

  • Created .github/copilot-instructions.md (98 lines) with repository-level coding guidance for GitHub Copilot
  • Added [tool.ruff.lint.isort] / known-first-party = ["chainweaver"] to pyproject.toml to back the import-order claim in the instructions file (behavior-preserving — codifies Ruff's auto-detection)

Sections included

Section Purpose
Language & runtime Python 3.10+, from __future__ import annotations, type annotations
Code style Ruff config summary (matches pyproject.toml exactly)
Architecture rules Pydantic models, exception hierarchy, no LLM in executor
Project layout Key files/dirs so Copilot can orient without searching
Testing pytest conventions, fixtures, assertion style
Validation commands ruff check, ruff format --check, mypy, pytest (matches CI)
PR conventions Imperative mood titles, one logical change per PR
Anti-patterns Explicit "never generate these" rules
Trust these instructions Per GitHub best practices — tells Copilot to defer to this file

Why

Closes #53

Without this file, Copilot has no project-specific guidance on coding style, testing patterns, import organization, or validation commands. This complements AGENTS.md (architecture context) with coding conventions scoped to Copilot specifically.

How verified

  • ruff check chainweaver/ tests/ examples/ — all checks passed
  • ruff format --check chainweaver/ tests/ examples/ — 13 files already formatted
  • python -m pytest tests/ -v — 46 passed, 0 failed
  • Line count: 98 lines (within ≤120 limit)

Acceptance criteria checklist

  • .github/copilot-instructions.md exists
  • File is ≤120 lines (98)
  • File links to AGENTS.md for architecture context (header + footer)
  • Ruff config cited matches pyproject.toml [tool.ruff] section
  • Validation commands match CI pipeline (.github/workflows/ci.yml)
  • No architecture map or decision context (those live in AGENTS.md)
  • Anti-patterns section included

Tradeoffs / risks

  • Drift risk: If Ruff rules change in pyproject.toml, this file must be updated in the same PR. This convention is documented in the file itself (PR conventions section).
  • Project layout addition (Mode B delta): Added a project layout section not in the original spec. This follows GitHub's official recommendation to include layout info so Copilot doesn't have to search the codebase each time. Stays well within the 120-line budget.

Scope notes

  • .github/copilot-instructions.md — new documentation file (98 lines)
  • pyproject.toml — added [tool.ruff.lint.isort] with known-first-party = ["chainweaver"] to explicitly back the import-order claim in the instructions file. This is behavior-preserving (codifies Ruff's existing auto-detection).

Closes #53

Create copilot-instructions.md (98 lines) with project-specific
guidance for GitHub Copilot covering:

- Language & runtime (Python 3.10+, future annotations, type hints)
- Code style (Ruff config matching pyproject.toml)
- Architecture rules (Pydantic models, exception hierarchy, no LLM in executor)
- Project layout (key files/dirs for fast Copilot orientation)
- Testing conventions (pytest, fixtures, assertions)
- Validation commands (lint, format, mypy, pytest  matching CI)
- PR conventions
- Anti-patterns (never generate these)
- Trust these instructions footer (per GitHub best practices)
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds repository-scoped GitHub Copilot guidance for ChainWeaver to help generated code match the project’s Python/runtime constraints, style/tooling, layout, testing conventions, and PR hygiene.

Changes:

  • Introduces .github/copilot-instructions.md with language/runtime rules, Ruff/mypy/pytest commands, architecture constraints, and anti-patterns.
  • Documents project layout to reduce agent search and improve navigation context.
  • Establishes Copilot-specific PR conventions and “trust these instructions” guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@dgenio dgenio merged commit 1d2b09f into main Mar 6, 2026
4 checks passed
@dgenio dgenio deleted the 53-add-copilot-instructions branch March 6, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add .github/copilot-instructions.md with coding conventions and validation commands

2 participants