Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 20, 2025

This PR implements comprehensive GitHub Copilot instructions to help AI assistants understand and work effectively with the Riteway testing library.

What's Added

.cursorrules

A comprehensive project configuration file that provides AI assistants with:

  • Complete project overview and architecture documentation
  • Coding standards and test writing patterns specific to Riteway
  • Development workflow including common commands (npm test, npm run lint, etc.)
  • Key design principles emphasizing Readable, Isolated, Thorough, and Explicit tests
  • Best practices for maintaining the required {given, should, actual, expected} assertion pattern

/ai Directory with Specialized Prompts

A collection of detailed guides for common development scenarios:

  • test-writing.md - Comprehensive patterns for writing Riteway tests with examples for pure functions, async operations, error handling, and React components
  • component-testing.md - React component testing patterns using render() and match() utilities, including event handling and conditional rendering
  • api-development.md - Guidelines for extending the Riteway API while maintaining backward compatibility and design principles
  • debugging.md - Common test failure patterns and debugging strategies with solutions for async issues, object comparisons, and environment problems
  • refactoring.md - Safe refactoring techniques for both test code and production code with step-by-step examples

AI_SETUP.md

Documentation explaining how the AI assistance works and what benefits developers can expect when using compatible AI tools.

Benefits for Developers

AI assistants will now:

  • Generate proper Riteway test code following the required assertion pattern
  • Understand the project's unique testing philosophy and conventions
  • Provide contextually appropriate debugging suggestions
  • Suggest refactoring approaches that maintain test reliability
  • Help with React component testing using Riteway's utilities

Example Improvement

Before this setup, an AI might generate generic test code:

test('should work', () => {
  expect(myFunction()).toBe(true);
});

After this setup, AI assistants will generate proper Riteway tests:

describe('myFunction()', async assert => {
  assert({
    given: 'valid input parameters',
    should: 'return expected result',
    actual: myFunction(input),
    expected: expectedOutput
  });
});

The configuration automatically activates when using compatible AI tools - no additional setup required.

Fixes #377.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] ✨ Set up Copilot instructions ✨ Set up Copilot instructions with .cursorrules and AI prompts Aug 20, 2025
Copilot AI requested a review from ericelliott August 20, 2025 03:10
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.

✨ Set up Copilot instructions

2 participants