Skip to content

Conversation

@newhoggy
Copy link
Contributor

Changes

This PR adds comprehensive AI assistant guidelines and tooling for the cardano-cli project:

  • Added: .github/copilot-instructions.md - Complete AI coding assistant guidelines (197 lines)
  • Added: scripts/wiki-update - Automated ADR documentation management script (52 lines)
  • Modified: .gitignore - Added exclusions for .ai-scratch/ and docs/mirror/ directories

Changelog

- description: |
    Add comprehensive AI assistant guidelines and ADR management system for cardano-cli development
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  - documentation  # change in code docs, haddocks...

Context

This PR introduces a comprehensive framework for AI coding assistants working on the cardano-cli project. The goal is to provide AI assistants with detailed architectural guidance, development patterns, and best practices specific to this codebase.

The framework includes:

  • Architectural Documentation: Complete overview of era-based command structure, module organization, and type-safe era handling patterns
  • Development Workflows: Standardized procedures for building, testing, package management, and CI/HLS considerations
  • ADR Integration: Local mirror system for Architecture Decision Records with automatic freshness checking
  • AI-Specific Guidelines: Detailed instructions for CLI usage patterns, era preferences, output design, git workflows, and file organization
  • Documentation Management: Automated wiki synchronization system for keeping ADRs up-to-date

This addresses the need for AI assistants to understand cardano-cli's unique architectural patterns, especially the era-based command system and the project's formal decision-making process through ADRs.

How to trust this PR

Key files to review:

  1. .github/copilot-instructions.md - The main AI guidelines document covering:

    • Era-based architecture patterns and module organization
    • Development workflows and testing conventions using tasty-discover and Hedgehog
    • CLI help reference system using golden test files
    • Local ADR integration with automatic freshness monitoring
    • AI-specific usage guidelines for era handling, git commands, and file organization
  2. scripts/wiki-update - ADR management automation that:

    • Clones/updates cardano-node-wiki to docs/mirror/cardano-node-wiki
    • Handles conflicts by discarding local changes and resetting to remote main
    • Tracks update timestamps in docs/mirror/dates/cardano-node-wiki
    • Creates directory structure automatically
  3. .gitignore - Excludes new directories:

    • .ai-scratch/ for temporary AI-generated files (commit messages, analysis outputs)
    • docs/mirror/ for local documentation mirrors

Testing the wiki-update script:

# Test the ADR management system
./scripts/wiki-update

# Verify ADRs are available locally
ls docs/mirror/cardano-node-wiki/docs/ADR-*.md

# Check update timestamp
cat docs/mirror/dates/cardano-node-wiki

# Test update functionality (run again)
./scripts/wiki-update

Verifying AI guidelines:

The guidelines reference concrete project patterns and can be validated by checking:

  • Golden test files in cardano-cli/test/cardano-cli-golden/files/golden/help/
  • Era-specific commands in src/Cardano/CLI/EraBased/
  • ADR documents for architectural decisions (once mirrored locally)
  • Project-specific conventions for language extensions and error handling

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@newhoggy newhoggy force-pushed the newhoggy/copilot-instructions branch 3 times, most recently from 437867c to 927e451 Compare August 13, 2025 15:29
This commit introduces a complete framework for AI coding assistants working on the cardano-cli project, including:

New Files Added:

.github/copilot-instructions.md (197 lines)
- Comprehensive architectural overview of era-based command structure
- Development workflows for building, testing, and package management
- Project-specific conventions for language extensions, error handling, and command structure
- CLI help reference system with golden test patterns
- Architecture Decision Records (ADRs) integration with local mirror system
- AI-specific guidelines for CLI usage, era handling, output design, and flag patterns
- Wiki management instructions for maintaining up-to-date ADR documentation

scripts/wiki-update (52 lines)
- Automated script to clone/update cardano-node-wiki repository to docs/mirror/cardano-node-wiki
- Handles both initial cloning and subsequent updates with conflict resolution
- Writes timestamp to docs/mirror/dates/cardano-node-wiki for freshness tracking
- Ensures clean updates by discarding local changes and resetting to remote main branch

.gitignore updates (6 lines)
- Added .ai-scratch/ directory for temporary AI-generated files
- Added docs/mirror/ directory for local documentation mirrors

Key Features:

1. ADR Integration: Local mirror system for Architecture Decision Records with automatic freshness checking
2. AI Guidelines: Specific instructions for era preferences, CLI patterns, git command usage, and file organization
3. Development Workflows: Standardized build, test, and package management procedures
4. Documentation Management: Automated wiki synchronization with timestamp tracking

This establishes a comprehensive foundation for AI assistants to work effectively within the cardano-cli project's architectural patterns and development practices.
@newhoggy newhoggy force-pushed the newhoggy/copilot-instructions branch from 927e451 to b057f60 Compare August 14, 2025 11:50
@newhoggy newhoggy requested a review from neilmayhew August 14, 2025 11:51
@github-actions
Copy link

github-actions bot commented Oct 1, 2025

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Stale label Oct 1, 2025
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.

3 participants