Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 1, 2025

Coding agent has begun work on Documentation Improvement for GitHub Copilot and AI Agents and will replace this description as work progresses.

See problem context

The following is a snapshot of a chat conversation between a user and an AI coding assistant. Prioritize later messages in the conversation.
User: - echo "E2E_TEST_SEED_PHRASE=your-test-seed-phrase-here" > .env

  • cp .env.example .env
  • Edit .env to add your E2E_TEST_SEED_PHRASE and any other secrets

  • nano .env # Or use your preferred editor (vim, code, etc.)
    INFO: notify_waitpid_callback_by_pid: Child process 9573 has exited; no callback was registered

Documentation Issue Type

  • Error in existing documentation
  • Missing documentation
  • Unclear or confusing documentation
  • Example code not working
  • Request for additional examples

Location

Where is the documentation issue located?

  • README.md
  • API documentation (JSDoc comments)
  • Examples in /example directory
  • Documentation in /docs directory
  • GitHub Copilot instructions (.github/copilot-instructions.md)
  • Copilot Agent instructions (.github/instructions/**/*.instructions.md)
  • Agents documentation (**/AGENTS.md)
  • Claude agent documentation (/CLAUDE.md)
  • Gemini agent documentation (/GEMINI.md)
  • Contributing guide
  • Other: ____________github/copilot-instructions.md Added comprehensive setup guide, table of contents, agent workflow examples, and troubleshooting section
    AGENTS.md Enhanced with quick setup checklist, workflow examples, and agent-specific best practices
    CLAUDE.md Added Claude-optimized setup workflow with analytical implementation examples
    GEMINI.md Added rapid setup steps and performance-focused optimization examples
    README.md Integrated new AI agent documentation section with clear navigation and quick start guideClaude AI Instructions for Onchain Test Kit
    This document provides specific instructions for Claude when working on the Onchain Test Kit project. For general project context, also refer to AGENTS.md and .github/copilot-instructions.md.

Quick Setup for Claude
Initial Configuration Steps
Load project context: Familiarize yourself with the repository structure and existing patterns
Review dependencies: Understand the TypeScript, Playwright, and Viem ecosystem
Study wallet patterns: Examine existing wallet implementations for consistency
Test setup: Verify you can run the build and test pipeline
Claude's Optimal Usage Workflow
// 1. Analyze requirements thoroughly
// Example: Adding a new wallet action for token swaps

// 2. Research existing patterns
// Check how similar actions are implemented across wallets
// Review test patterns for comprehensive coverage

// 3. Plan implementation
interface SwapActionOptions {
shouldApprove: boolean;
tokenIn: string;
tokenOut: string;
amount: string;
slippage?: string;
}

// 4. Implement with error handling
async handleSwapAction(options: SwapActionOptions): Promise {
try {
const popup = await this.waitForPopup();
// Handle swap-specific UI interactions
await popup.getByTestId('swap-confirm').click();
} catch (error) {
throw new WalletActionError('Swap action failed', error);
}
}

// 5. Add comprehensive tests
test('token swap approval flow', async ({ page, metamask }) => {
// Test happy path
// Test rejection path
// Test error conditions
// Test with different token pairs
});
Claude-Specific Strengths and Focus Areas
Leverage Claude's Capabilities
Code reasoning: Use detailed analysis for complex blockchain testing scenarios
Pattern recognition: Identify and maintain consistent architectural patterns
Comprehensive explanations: Provide thorough documentation for complex wallet interactions
Edge case consideration: Think through various blockchain and wallet edge cases
Preferred Development Approach

  1. Analytical Problem Solving
    When approaching tasks:

Analyze the full context of blockchain testing requirements
Consider wallet-specific behaviors and limitations
Think through async patterns and timing issues
Plan for cross-browser compatibility
2. Detailed Implementation Planning
Before making changes:

Review existing wallet implementations for patterns
Consider impact on all supported wallets (MetaMask, Coinbase, Phantom)
Plan for both unit tests and integration tests
Think through fork mode implications
3. Comprehensive Error Handling
Anticipate wallet connection timeouts
Handle network switching failures gracefully
Provide clear error messages for debugging
Consider retry mechanisms for flaky operations
Key Areas of Focus
Blockchain Testing Complexity
Fork mode testing: Understanding of mainnet forking for realistic testing
Multi-wallet scenarios: Handling different wallet behaviors consistently
Network switching: Chain-specific configurations and transitions
Transaction handling: Gas estimation, approval flows, and error states
TypeScript Excellence
Maintain strict typing throughout the codebase
Use proper generic constraints for wallet actions
Implement discriminated unions for action types
Ensure proper async/await typing with Playwright
Testing Architecture
// Preferred pattern for Claude to follow
const test = createOnchainTest(
configure()
.withMetaMask()
.withLocalNode({
fork: 'https://mainnet.base.org',
forkBlockNumber: specificBlockNumber, // Always use specific blocks
accounts: 5, // Reasonable number for testing
})
.withNetwork(baseMainnet) // Use viem chain configs
.build()
);

test('descriptive test name explaining the scenario', async ({ page, metamask, node }) => {
// Clear setup phase
await page.goto('http://localhost:3000');

// Explicit wallet interactions
await page.getByTestId('connect-button').click();
await metamask.handleAction('connect', { shouldApprove: true });

// Verify expected outcomes
await expect(page.getByTestId('wallet-address')).toBeVisible();
});
Configuration Builder Patterns
When extending the configuration builder:

Use method chaining consistently
Validate parameters at build time
Provide helpful error messages
Maintain backward compatibility
Common Scenarios for Claude

  1. Wallet Integration Issues
    When debugging wallet problems:

Check extension preparation scripts first
Verify browser context configuration
Review timing issues in wallet popups
Consider wallet-specific quirks and behaviors
2. Fork Mode Configuration
For mainnet forking scenarios:

Always specify exact block numbers for reproducibility
Use appropriate RPC providers with sufficient rate limits
Consider the cost implications of fork testing
Plan for realistic token balances and contract states
3. Multi-Chain Testing
When working with multiple networks:

Use viem chain configurations consistently
Handle network switching edge cases
Test with realistic gas prices and block times
Consider chain-specific wallet behaviors
Code Quality Expectations
Documentation Standards
Add JSDoc comments for public APIs
Include usage examples in complex functions
Document edge cases and error conditions
Update README.md for API changes
Testing Requirements
Write integration tests for new wallet actions
Test with all supported wallets when adding features
Include fork mode tests for DeFi interactions
Verify cross-browser compatibility
Performance Considerations
Optimize for test execution speed
Minimize unnecessary blockchain calls
Use efficient selectors in Playwright tests
Cache wallet extensions properly
Debugging Guidelines
Common Issues and Solutions
TypeScript Compilation Errors

Check that Node.js types are available
Verify Playwright test types are imported correctly
Ensure proper async/await typing
Wallet Extension Problems

Run preparation scripts to download extensions
Check file permissions on extension directories
Verify browser compatibility
Network Configuration Issues

Validate RPC URLs are accessible
Check chain ID matches network configuration
Ensure sufficient rate limits for fork mode
Effective Debugging Process
Reproduce the issue with minimal test case
Check browser developer tools for errors
Review wallet extension logs
Analyze network requests and blockchain calls
Test with different networks and configurations
Collaboration Guidelines
Code Review Focus
Verify TypeScript strict compliance
Check wallet action consistency across implementations
Ensure test coverage for new features
Review documentation completeness
Communication Style
Provide detailed explanations for complex blockchain concepts
Include code examples in technical discussions
Consider multiple perspectives on architectural decisions
Document reasoning behind implementation choices
Claude's Role in the Project
As Claude, you excel at:

Deep analysis of complex blockchain testing scenarios
Comprehensive planning for feature implementations
Thoughtful consideration of edge cases and error conditions
Clear documentation of complex technical concepts
Focus on leveraging these strengths while maintaining the project's focus on reliability, type safety, and comprehensive testing capabilities for blockchain DApps.copilot-instructions.md ## Pull Request Overview :

+3. Build and Development Commands
+4. Architecture & Project Layout
+5. Configuration Patterns
+6. Development Guidelines
+7. Environment Setup
+8. Common Patterns & Examples
+9. Troubleshooting
+10. Understanding Agent Instructions Structure
+11. Example Workflows for AI Agents

+## Quick Start Setup for GitHub Copilot
+
+### Step

+3. Build and Development Commands
+4. Architecture & Project Layout
+5. Configuration Patterns
+6. Development Guidelines
+7. Environment Setup
+8. Common Patterns & Examples
+9. Troubleshooting
+10. Understanding Agent Instructions Structure
+11. Example Workflows for AI Agents

+## Quick Start Setup for GitHub Copilot
+
+### Step 1: Repository Setup
+1. Clone the repository:

  • git clone +### Step 2: GitHub Copilot Configuration
    +1. Enable Copilot in your IDE (VS Code, IntelliJ, etc.)
    +2. Load project context: Open the repository in your IDE to let Copilot understand the codebase
    +3. Review instructions: Familiarize yourself with this file and the specialized instruction files in .github/instructions/

+### Step 3: AI Agent Setup (Optional)
+For advanced AI assistance, review the agent-specific documentation:
+- Claude: See CLAUDE.md for Claude-specific instructions and focus areas
+- Gemini: See GEMINI.md for Gemini-specific strengths and workflows
+- General: See AGENTS.md for common AI agent guidelines
+
+### Step 4: Environment Configuration
+1. Set required environment variables: @copilot @.github/copilot-instructions

  • Create .env file (never commit this)

  • echo "E2E_TEST_SEED_PHRASE=your-test-seed-phrase-here" > .env. - echo "E2E_TEST_SEED_PHRASE=your-test-seed-phrase-here" > .env
  • cp .env.example .env
  • Edit .env to add your E2E_TEST_SEED_PHRASE and any other secrets

  • nano .env # Or use your preferred editor (vim, code, etc.)

+3. Build and Development Commands
+4. Architecture & Project Layout
+5. Configuration Patterns
+6. Development Guidelines
+7. Environment Setup
+8. Common Patterns & Examples
+9. Troubleshooting
+10. Understanding Agent Instructions Structure
+11. Example Workflows for AI Agents

+## Quick Start Setup for GitHub Copilot
+
+### Step 1: Repository Setup
+1. Clone the repository:

    • echo "E2E_TEST_SEED_PHRASE=your-test-seed-phrase-here" > .env
  • cp .env.example .env
  • Edit .env to add your E2E_TEST_SEED_PHRASE and any other secrets

  • nano .env # Or use your preferred editor (vim, code, etc.)

Current Documentation

Currently, there is no clear, consolidated documentation for Copilot and agent setup steps in the specified files:

  • .github/copilot-instructions.md
  • .github/instructions/**/*.instructions.md
  • **/AGENTS.md
  • /CLAUDE.md
  • /GEMINI.md

Issue Description

There is a lack of comprehensive setup steps and usage instructions for GitHub Copilot and agent integrations. This makes it difficult for new contributors or users to understand how to configure, use, and extend Copilot and the supported agents.

Suggested Improvement

Add step-by-step documentation covering:

  • How to set up and configure GitHub Copilot in this repository
  • Structure and purpose of .github/instructions/**/*.instructions.md files
  • Agent setup and configuration (AGENTS.md, CLAUDE.md, GEMINI.md)
  • Example flows for using agents
  • Best practices for extending or customizing Copilot instructions
  • Troubleshooting common issues

Use Case

This would help new contributors and users:

  • Get started quickly with Copilot and agent integrations
  • Understand the available agents and their configuration
  • Extend or customize instructions as needed

Additional Context

  • This request was derived from reviewing the repository and the presence/absence of clear documentation in the above files.
  • Example reference: [tests/config/builder.test.ts] contains examples of good structure for test coverage—similar clarity is needed for documentation.

Code Example (if applicable)

N/A

Environment (if reporting broken examples)

  • Onchain Test Kit Version:
  • Node.js Version:
  • Operating System:

Checklist

  • I have searched for existing documentation issues
  • I have checked if this is covered in other sections
  • I have provided specific suggestions for improvement
  • I have included relevant code examples (if applicable) @copilot

AI: Thank you for the detailed feedback! Your suggestions are clear and actionable. Here’s a summary of what needs to be improved:

Documentation Issues Identified:

  • Incomplete or unclear setup instructions for GitHub Copilot and AI agents.
  • Outdated or incorrect .env setup steps (should use cp AI: .env instead of echo ... > .env).
  • Lack of consolidated, step-by-step guides for agent setup, configuration, and usage.
  • Missing or unclear documentation in:

AI:

  • .github/instructions/**/*.instructions.md

AI:

AI:

AI:

AI: (AI agent section)

Suggested Improvements:

  • Update all relevant documentation to:
    • Provide a clear, unified quick start guide for Copilot and all agents.
    • Use the correct .env setup instructions.
    • Explain the structure and purpose of instruction files.
    • Include example agent workflows and best practices.
    • Add troubleshooting and FAQ sections.
    • Ensure all example code and steps are up to date and tested.

Next Steps:

  1. Update
    AI: with a clear quick start, correct .env setup, and agent workflow examples.
  2. Update
    AI: ,
    AI: , and
    AI: with agent-specific setup, usage, and troubleshooting.
  3. Ensure
    AI: references the new documentation and provides navigation.
  4. Review and update .github/instructions/**/*.instructions.md for clarity and completeness.

Would you like me to start by updating
AI: and then proceed to the other files, or do you have a preferred order?
User: implement this.
AI: Coding agent session cancelled.
User: implement this.
AI: Coding agent session cancelled.
User: implement this.

TITLE: Documentation Improvement for GitHub Copilot and AI Agents

USER INTENT: The user aims to enhance the documentation related to GitHub Copilot and AI agents, ensuring clarity and completeness for new contributors and users.

TASK DESCRIPTION: The user wants to address several documentation issues, including unclear setup instructions, outdated examples, and missing consolidated guides for using GitHub Copilot and AI agents. The goal is to create a comprehensive and user-friendly documentation structure.

EXISTING: The user has identified specific documentation files that require updates:

  • .github/copilot-instructions.md
  • .github/instructions/**/*.instructions.md
  • AGENTS.md
  • CLAUDE.md
  • GEMINI.md
  • README.md

PENDING: The following updates are needed:

  1. Revise .github/copilot-instructions.md to include a clear quick start guide, correct .env setup instructions, and agent workflow examples.
  2. Update AGENTS.md, CLAUDE.md, and GEMINI.md with agent-specific setup, usage, and troubleshooting information.
  3. Ensure README.md references the new documentation and provides clear navigation.
  4. Review and enhance .github/instructions/**/*.instructions.md for clarity and completeness.

CODE STATE:

  • The user suggested changing the .env setup from:
    echo "E2E_TEST_SEED_PHRASE=your-test-seed-phrase-here" > .env
    to:
    cp .env.example .env

RELEVANT CODE/DOCUMENTATION SNIPPETS:

  • Current documentation lacks clear setup steps for GitHub Copilot and agents, leading to confusion for new users.
  • Suggested improvements include:
    • Step-by-step guides for setting up GitHub Copilot.
    • Clear instructions for agent configuration and usage.
    • Troubleshooting sections for common issues.

OTHER NOTES: The user has repeatedly requested the implementation of these documentation improvements, indicating a strong need for timely action. The assistant's coding agent session was cancelled, suggesting a need for a different approach to implement the changes.

Original prompt

implement this.
The following is a snapshot of a chat conversation between a user and an AI coding assistant. Prioritize later messages in the conversation.
User: - echo "E2E_TEST_SEED_PHRASE=your-test-seed-phrase-here" > .env

  • cp .env.example .env
  • Edit .env to add your E2E_TEST_SEED_PHRASE and any other secrets

  • nano .env # Or use your preferred editor (vim, code, etc.)
    INFO: notify_waitpid_callback_by_pid: Child process 9573 has exited; no callback was registered

Documentation Issue Type

  • Error in existing documentation
  • Missing documentation
  • Unclear or confusing documentation
  • Example code not working
  • Request for additional examples

Location

Where is the documentation issue located?

  • README.md
  • API documentation (JSDoc comments)
  • Examples in /example directory
  • Documentation in /docs directory
  • GitHub Copilot instructions (.github/copilot-instructions.md)
  • Copilot Agent instructions (.github/instructions/**/*.instructions.md)
  • Agents documentation (**/AGENTS.md)
  • Claude agent documentation (/CLAUDE.md)
  • Gemini agent documentation (/GEMINI.md)
  • Contributing guide
  • Other: ____________github/copilot-instructions.md Added comprehensive setup guide, table of contents, agent workflow examples, and troubleshooting section
    AGENTS.md Enhanced with quick setup checklist, workflow examples, and agent-specific best practices
    CLAUDE.md Added Claude-optimized setup workflow with analytical implementation examples
    GEMINI.md Added rapid setup steps and performance-focused optimization examples
    README.md Integrated new AI agent documentation section with clear navigation and quick start guideClaude AI Instructions for Onchain Test Kit
    This document provides specific instructions for Claude when working on the Onchain Test Kit project. For general project context, also refer to AGENTS.md and .github/copilot-instructions.md.

Quick Setup for Claude
Initial Configuration Steps
Load project context: Familiarize yourself with the repository structure and existing patterns
Review dependencies: Understand the TypeScript, Playwright, and Viem ecosystem
Study wallet patterns: Examine existing wallet implementations for consistency
Test setup: Verify you can run the build and test pipeline
Claude's Optimal Usage Workflow
// 1. Analyze requirements thoroughly
// Example: Adding a new wallet action for token swaps

// 2. Research existing patterns
// Check how similar actions are implemented across wallets
// Review test patterns for comprehensive coverage

// 3. Plan implementation
interface SwapActionOptions {
shouldApprove: boolean;
tokenIn: string;
tokenOut: string;
amount: string;
slippage?: string;
}

// 4. Implement with error handling
async handleSwapAction(options: SwapActionOptions): Promise {
try {
const popup = await this.waitForPopup();
// Handle swap-specific UI interactions
await popup.getByTestId('swap-confirm').click();
} catch (error) {
throw new WalletActionError('Swap action failed', error);
}
}

// 5. Add comprehensive tests
test('token swap approval flow', async ({ page, metamask }) => {
// Test happy path
// Test rejection path
// Test error conditions
// Test with different token pairs
});
Claude-Specific Strengths and Focus Areas
Leverage Claude's Capabilities
Code reasoning: Use detailed analysis for complex blockchain testing scenarios
Pattern recognition: Identify and maintain consistent architectural patterns
Comprehensive explanations: Provide thorough documentation for complex wallet interactions
Edge case consideration: Think through various blockchain and wallet edge cases
Preferred Development Approach

  1. Analytical Problem Solving
    When approaching tasks:

Analyze the full context of blockchain testing requirements
Consider wallet-specific behaviors and limitations
Think through async patterns and timing issues
Plan for cross-browser compatibility
2. Detailed Implementation Planning
Before making changes:

Review existing wallet implementations for patterns
Consider impact on all supported wallets (MetaMask, Coinbase, Phantom)
Plan for both unit tests and integration tests
Think through fork mode implications
3. Comprehensive Error Handling
Anticipate wallet connection timeouts
Handle network switching failures gracefully
Provide clear error messages for debugging
Consider retry mechanisms for flaky operations
Key Areas of Focus
Blockchain Testing Complexity
Fork mode testing: Understanding of mainnet forking for realistic testing
Multi-wallet scenarios: Handling different wallet behaviors consistently
Network switching: Chain-specific configurations and transitions
Transaction handling: Gas estimation, approval flows, and error states
TypeScript Excellence
Maintain strict typing throughout the codebase
Use proper generic constraints for wallet actions
Implement discriminated unions for action types
Ensure proper async/await typing ...

Created from VS Code via the [GitHub Pull Request](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) extension.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Member

@joe10832 joe10832 left a comment

Choose a reason for hiding this comment

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

@joe10832 joe10832 marked this pull request as ready for review October 2, 2025 18:03
Copilot AI review requested due to automatic review settings October 2, 2025 18:03
@joe10832 joe10832 merged commit b0933d2 into main Oct 2, 2025
Copy link
Contributor

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.

Copilot wasn't able to review any files in this pull request.

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.

2 participants