Skip to content

Conversation

noizu
Copy link
Collaborator

@noizu noizu commented Sep 11, 2025

Summary

This PR adds Claude Code agent definitions, prompting conventions, and architecture documentation for ProxySQL. The agents provide AI-assisted development workflows for ProxySQL's C++ codebase, including code exploration, test-driven development, and tool creation.

flowchart TD
    A[ ]
    A:::note

    classDef note fill:#fff9c4,stroke:#fbc02d,stroke-width:2px,color:#000;

    A["HEY: key review note - are arch documents accurate, and adequate.  
    Are any major areas missing that should be covered.  
    Are any sections too internal to include and should be stripped?"]
Loading

DOCUMENTATION-INDEX.md
ARCHITECTURE-OVERVIEW.md
PROJECT-LAYOUT.md
RELEASE-PIPELINE.md
TEST-PIPELINE.md
VISUAL-GUIDE.md

Changes Overview

1. Agent Definitions (.claude/agents/)

Added five Claude Code agents for ProxySQL development tasks:

  • gopher-scout.md - Codebase exploration
  • system-digest.md - Architecture analysis and documentation
  • tdd-driven-builder.md - Test-driven development
  • tool-forge.md - CLI and MCP tool creation
  • gpt-qa.md - Test suite generation

2. Claude Code Integration (CLAUDE.md)

  • Project-specific instructions for Claude Code
  • Agent usage guidelines with examples
  • Parallel agent execution patterns
  • Development workflows mapped to ProxySQL architecture

3. Architecture Documentation (doc/architecture/)

  • ARCHITECTURE-OVERVIEW.md - System architecture, threading model, protocol handlers
  • PROJECT-LAYOUT.md - Directory structure and module boundaries
  • VISUAL-GUIDE.md - Mermaid diagrams for architecture visualization
  • TEST-PIPELINE.md - TAP test framework documentation
  • RELEASE-PIPELINE.md - Release process and packaging workflow

4. Documentation Index (doc/DOCUMENTATION-INDEX.md)

  • Index of documentation files
  • Categorization by purpose, audience, and protocol
  • Reference paths and navigation

Agent Capabilities Summary

Agent Model Purpose Key Features
gopher-scout Sonnet Code exploration • Scans C++ source files
• Analyzes protocols
• Traces connection pooling
• Summarizes findings
system-digest Opus Architecture analysis • Multi-source analysis
• Cross-reference generation
• IDE navigation links
• Documentation synthesis
tdd-driven-builder Inherit TDD development • Red-Green-Refactor cycle
• TAP test integration
• ProxySQL conventions
• Test planning
tool-forge Sonnet Tool creation • CLI utilities
• MCP servers
• Admin tools
• Python/C++/Shell
gpt-qa Opus Test generation • Equivalency partitioning
• TAP framework
• Coverage analysis
• Test categorization

CLAUDE.md Setup

The CLAUDE.md file provides:

  1. Quick Start: Build commands and directory overview
  2. Architecture Reference: Components and locations
  3. Agent Usage Patterns:
    # Single agent
    "Use gopher-scout to analyze MySQL authentication"
    
    # Parallel execution
    "Run gopher-scout and system-digest in parallel to analyze connection pooling"
  4. Development Workflows: Tasks with file locations
  5. Testing Guidelines: TAP test framework
  6. Debugging Tips: Core dumps, memory debugging, protocol tracing

Review Guidance

Reviewers, please verify:

  1. Technical Accuracy:

    • Architecture descriptions match ProxySQL implementation
    • File paths and code references are correct
    • Build commands and testing procedures are current
    • Threading model and protocol descriptions are accurate
  2. Completeness:

    • Major ProxySQL components are documented
    • Agent capabilities align with development needs
    • Common workflows are covered
    • Testing documentation covers test types
  3. Clarity:

    • Documentation is clear
    • Examples are practical
    • Navigation structure works
    • Agent instructions are clear
  4. Improvements Needed:

    • Missing architectural components
    • Additional agent capabilities needed
    • Workflow patterns not covered
    • Integration points needing detail

Benefits

  • Faster Development: AI agents analyze C++ code patterns faster than manual exploration
  • Testing: Automated test generation for coverage
  • Productivity Tools: CLI tools for ProxySQL administration
  • Documentation: Architecture analysis and documentation generation
  • Focused Assistance: Each agent handles specific development tasks

Testing

Agent definitions validated against:

  • ProxySQL codebase structure
  • TAP test framework requirements
  • Build system conventions
  • Architecture patterns in lib/ and src/

Next Steps

  1. Review and validate documentation accuracy
  2. Test agent definitions with development scenarios
  3. Gather feedback on additional capabilities needed
  4. Consider project-specific agent workflows

Related Context

  • Developer onboarding and productivity
  • AI-assisted code review and analysis
  • Automated documentation generation
  • Test-driven development support

Note to Reviewers: Please verify the technical accuracy of the architecture documentation and whether agent capabilities align with ProxySQL development patterns.

Copy link

@Copilot 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 introduces comprehensive Claude Code agent definitions and architecture documentation for ProxySQL development. The addition includes specialized AI agents for code exploration, test-driven development, and tool creation, along with detailed architecture guides covering ProxySQL's threading model, protocol handlers, and deployment patterns.

Key changes:

  • Five Claude Code agents with specific development capabilities (code exploration, TDD, tool creation, architecture analysis)
  • Comprehensive architecture documentation with visual diagrams and technical details
  • Claude Code integration guide with parallel agent execution patterns
  • Project documentation index and reference materials

Reviewed Changes

Copilot reviewed 100 out of 101 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
doc/architecture/VISUAL-GUIDE.md Mermaid diagrams and visual representations of ProxySQL architecture
doc/architecture/TEST-PIPELINE.md TAP test framework documentation and CI/CD pipeline details
doc/architecture/RELEASE-PIPELINE.md Package building, distribution, and release process documentation
doc/architecture/PROJECT-LAYOUT.md Directory structure mapping and module organization guide
doc/architecture/ARCHITECTURE-OVERVIEW.md Detailed architectural analysis and design patterns
doc/DOCUMENTATION-INDEX.md Comprehensive index of documentation files and navigation
CLAUDE.md Claude Code integration guide with agent usage patterns
.claude/npl/ NPL framework documentation for Claude Code agent definitions
Comments suppressed due to low confidence (1)

doc/architecture/VISUAL-GUIDE.md:1

  • The file count annotation "[MySQL Components - 25+ files]" at line 113 should be verified against the actual file listing which shows only 10 specific files, creating potential confusion about the actual component count.
# ProxySQL Visual Architecture Guide

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

style DIGEST fill:#c8e6c9
```

### Query Normalization Known Issues
Copy link
Preview

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

The "Known Query Digest Bugs" section documents 12 specific bugs but doesn't reference actual bug tracking numbers or provide links to issues, making it difficult to verify current status or track resolution progress.

Copilot uses AI. Check for mistakes.

Choose a reason for hiding this comment

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

will update in a future update


### Internal Testing Systems (proxysql_3p_testing)

**⚠️ Note**: Items under `priv-infra/proxysql_3p_testing/` are **Internal Systems**
Copy link
Preview

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

[nitpick] References to "Internal Systems" appear throughout the document but the accessibility and purpose of these internal components for external contributors is unclear, potentially hindering community development understanding.

Suggested change
**⚠️ Note**: Items under `priv-infra/proxysql_3p_testing/` are **Internal Systems**
**⚠️ Note**: Items under `priv-infra/proxysql_3p_testing/` are **Internal Systems**.
These components are maintained by the core ProxySQL team and are not accessible to external contributors by default.
Their purpose is to provide infrastructure and test suites for validating third-party integrations in controlled environments.
If you are an external contributor, you can participate in third-party integration testing by using the public workflows and test matrices described in this document.
For more information or to request access, please contact the maintainers or refer to the project's contribution guidelines.

Copilot uses AI. Check for mistakes.

Choose a reason for hiding this comment

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

  • Strip fropm docs

template<typename T>
class ConsumerThread : public Thread {
wqueue<WorkItem<T>*>& m_queue;
}
Copy link
Preview

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

The code snippet shows incomplete class definition syntax (missing closing brace and semicolon) which could mislead developers about the actual implementation structure.

Suggested change
}
};

Copilot uses AI. Check for mistakes.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @noizu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the ProxySQL repository by integrating AI-assisted development capabilities through specialized Claude Code agents and providing a robust suite of architectural and operational documentation. The changes aim to boost developer productivity, automate testing, and offer deeper insights into the ProxySQL C++ codebase, making it more accessible for current and future contributors.

Highlights

  • New Claude Code Agents: Introduction of five specialized Claude Code agents (gopher-scout, system-digest, tdd-driven-builder, tool-forge, gpt-qa) to streamline ProxySQL development workflows.
  • Comprehensive Architecture Documentation: Addition of extensive new architecture documentation, including ARCHITECTURE-OVERVIEW.md, PROJECT-LAYOUT.md, VISUAL-GUIDE.md, TEST-PIPELINE.md, and RELEASE-PIPELINE.md.
  • Claude Code Integration Guide: Integration of Claude Code usage guidelines and project-specific instructions within a new CLAUDE.md file, detailing agent capabilities and parallel execution patterns.
  • Centralized Documentation Index: Creation of a central DOCUMENTATION-INDEX.md to improve navigation and categorization of all project documentation.
  • Noizu Prompt Lingua (NPL) Documentation: Extensive addition of Noizu Prompt Lingua (NPL) documentation, detailing its core concepts, syntax, instructing patterns, formatting, and special sections, enabling advanced prompt engineering.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@renecannao
Copy link
Contributor

Can one of the admins verify this patch?

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This is an excellent pull request that adds a tremendous amount of value through comprehensive agent definitions and architecture documentation. The level of detail in the architecture documents, especially the visual guides and pipeline descriptions, is outstanding and will be a huge asset for developer onboarding and productivity. The Claude agent definitions are well-structured and highly relevant to ProxySQL development workflows. I've found a few minor areas for improvement, primarily related to path consistency in the new NPL documentation and some small clarifications in the architecture documents to enhance their accuracy. Overall, this is a very impressive and high-quality contribution.

Comment on lines 95 to 98

Choose a reason for hiding this comment

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

medium

The relative paths in the 'See Also' section appear to be incorrect. For example, a path like ./.claude/npl/directive.md will not resolve correctly from this file's location within a standard Markdown renderer or on platforms like GitHub. The paths should be relative to the current file's location. This issue seems to be present in several of the new NPL documentation files.

Suggested change
- `./.claude/npl/directive.md` - Overview of all directive patterns
- `./.claude/npl/formatting/template.md` - Template definition and structure
- `./.claude/npl/special-section/named-template.md` - Named template declarations
- `./.claude/npl/fences/template.md` - Template fence specifications
- `../directive.md` - Overview of all directive patterns
- `../formatting/template.md` - Template definition and structure
- `../special-section/named-template.md` - Named template declarations
- `../fences/template.md` - Template fence specifications

Choose a reason for hiding this comment

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

  • lets set an project env variable for these or something


3. **Query Processing**:
- **Fast Digest Path**: Optimized for queries > 100KB
- **Multi-threaded Digesting**: 4 threads for parallel processing

Choose a reason for hiding this comment

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

medium

This is a great detail. To make the documentation even more precise, it would be helpful to clarify whether the number of digest threads is a fixed value or if it's configurable. If it is configurable, mentioning the name of the configuration variable would be a valuable addition for operators.

Choose a reason for hiding this comment

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

@JavierJF is it fixed or configurable?


## Security Considerations

### Package Signing *(Future Enhancement)*

Choose a reason for hiding this comment

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

medium

There appears to be a minor inconsistency in the documentation regarding package signing. This section correctly notes it as a 'Future Enhancement', but the 'Release Pipeline Architecture' diagram at the top of the document includes a 'Package Signing' step as part of the current flow. Aligning the diagram with the text would improve clarity.

Choose a reason for hiding this comment

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

@mirostauder is package signing implemented?

@noizu
Copy link
Collaborator Author

noizu commented Sep 12, 2025

Note: Im updating the NPL framework to avoid the need to checkin in all of the supporting files.

@sysown sysown deleted a comment from gemini-code-assist bot Sep 18, 2025
@sysown sysown deleted a comment from Copilot AI Sep 18, 2025
needs to have it's script dir in path. The  sub agents when loaded may then
go and popualte and additional prompt conventions they need as they
areloaded.
Copy link

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.

3 participants