Skip to content

[SD-32] Add AI rules generation script and Makefile target#15

Merged
dudarev merged 5 commits into
mainfrom
codex/implement-github-copilot-rule-configuration
Jun 14, 2025
Merged

[SD-32] Add AI rules generation script and Makefile target#15
dudarev merged 5 commits into
mainfrom
codex/implement-github-copilot-rule-configuration

Conversation

@dudarev
Copy link
Copy Markdown
Owner

@dudarev dudarev commented Jun 14, 2025

Summary

  • generate AI assistant rule files from master docs/ai/AI-rules.md
  • add Makefile command generate-ai-rules
  • produce AGENTS.md, CLAUDE.md, .cursorrules

Testing

  • make ai-rules
  • make ci (fails: pytest complains about coverage arguments)

https://chatgpt.com/codex/tasks/task_e_68498ff9d6a8832fb280f2fd5e0aabe8

@dudarev dudarev changed the title Add AI rules generation script and Makefile target [SD-32] Add AI rules generation script and Makefile target Jun 14, 2025
@linear
Copy link
Copy Markdown

linear Bot commented Jun 14, 2025

SD-32 Implement GitHub Copilot rule configuration

Implement repository-specific rule configuration for GitHub Copilot based on the research findings from SD-12.

Reference: Research document docs/research/2025-06-03-copilot-jules-claude-rules.md

Deliverables:

  • Create .github/copilot-instructions.md based on master docs/ai/AI-rules.md file
  • Include DDD architecture rules from ADR 008
  • Add testing requirements from ADR 004
  • Include security guidelines and coding standards
  • Test with Copilot Chat to validate rule effectiveness

Acceptance Criteria:

  • .github/copilot-instructions.md file created and committed
  • Content derived from master docs/ai/AI-rules.md file (following implementation plan from SD-12 research)
  • Rules reference SpeechDown's DDD architecture (domain/application/infrastructure layers)
  • Include naming conventions (interfaces end in Port, implementations in Adapter)
  • Specify testing requirements (pytest, unit tests required)
  • Include security guidelines (no secrets, PEP8 compliance)
  • Manual testing confirms Copilot Chat follows the guidelines
  • File is properly formatted markdown and passes CI checks

Implementation Notes:
Based on research, GitHub Copilot automatically incorporates instructions from .github/copilot-instructions.md into all Copilot Chat responses for the repository. This file should be generated from or based on the master AI rules file as outlined in the SD-12 implementation plan.

dudarev added 2 commits June 14, 2025 18:02
… and clarity

- Updated AI rules documentation across multiple files to include notes for maintainers and detailed setup instructions.
- Improved the Makefile to streamline AI rules generation and testing commands.
- Enhanced the `generate_ai_rules.py` script to filter content based on target AI assistant types, ensuring appropriate sections are included or excluded.
- Added related ADR references in existing ADR documents for better traceability.
@dudarev dudarev requested a review from Copilot June 14, 2025 15:27
Copy link
Copy Markdown

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

This PR adds tooling to generate AI assistant–specific rule files from a single master Markdown document, integrates the new command into the build, and aligns Python version requirements across configs.

  • Introduce scripts/generate_ai_rules.py for filtering docs/ai/AI-rules.md into Copilot, Cursor, Claude, and Agents files.
  • Add an ai-rules Makefile target and update CI targets to include FFmpeg installation and Python 3.11.
  • Synchronize Python version (>=3.11) in pyproject.toml, docs, and GitHub Actions.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/generate_ai_rules.py New script to parse and split master AI rules by target.
pyproject.toml Downgraded requires-python to >=3.11; separated testing deps into testing and testing-local.
docs/research/2025-06-03-copilot-jules-claude-rules.md Updated Python version note to 3.11.
docs/ai/AI-rules.md Added master AI rules with maintainer note and markers.
docs/adrs/current/003_standardized_adr_prompt.md Added “Related ADRs” link.
docs/adrs/current/001_adrs_process.md Added “Related ADRs” link.
Makefile Expanded .PHONY, added ai-rules target, adjusted test/CI targets.
.github/workflows/ci.yml Changed GitHub Actions Python version to 3.11; added FFmpeg install.
.github/copilot-instructions.md Generated Copilot rules file.
CLAUDE.md Generated Claude rules file.
AGENTS.md Generated general agents rules file.
.cursorrules Generated Cursor rules file.
Comments suppressed due to low confidence (3)

scripts/generate_ai_rules.py:11

  • Consider adding unit tests for filter_content_for_target and the main function to verify that each target (copilot, cursor, remote, claude) produces the expected output files.
def filter_content_for_target(content: str, target: str) -> str:

Makefile:94

  • [nitpick] Please update the project README or contributing guide to document the new make ai-rules target so contributors know how to regenerate AI assistant rules.
ai-rules:

Makefile:94

  • [nitpick] The PR description refers to a generate-ai-rules command, but the Makefile target is named ai-rules. Consider aligning these names for consistency.
ai-rules:

@dudarev dudarev merged commit 4cbe46b into main Jun 14, 2025
1 check passed
@dudarev dudarev deleted the codex/implement-github-copilot-rule-configuration branch June 14, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants