Copilot Coding Agent

Bonus: Copilot Coding Agent in Action

Automating ByteStrike's Mission with Autonomous Development Tasks

Bonus: Automating ByteStrike's Mission with Copilot Coding Agent

The Mission Expands

ByteStrike's initial decoder was a success. The encrypted blueprints have been extracted and analyzed. But now The League has expanded the operation.

There are three problems:

  1. The decoder works, but it lacks proper documentation. New operatives need to understand how it works, and right now the code is difficult to follow.
  2. The secret extraction system needs new capabilities. The League wants to support batch processing of multiple blueprint files, with proper error handling and retry logic.
  3. Critical components lack unit tests. For a mission-critical system, this is unacceptable.

ByteStrike has limited time. These tasks are essential but repetitive. This is where Copilot coding agent comes in.

What is Copilot Coding Agent?

GitHub Copilot coding agent is an autonomous AI pair programmer that can work on your behalf to complete development tasks. Unlike Chat mode, which requires constant guidance, coding agent takes an issue description and works through it end-to-end, producing a draft pull request.

For ByteStrike's mission, this means:

  • Assign documentation tasks to Copilot coding agent while you focus on architectural decisions
  • Request new features asynchronously, letting the agent implement while you work on other priorities
  • Generate tests automatically without manual repetition
  • Review the work before merging, maintaining quality control

Think of it as hiring a specialized contractor who works 24/7 to tackle your backlog. You describe the work, Copilot executes it, and you review before deployment.

The Power of Well-Scoped Instructions

Here is the critical truth: there is no magic bullet here. Copilot coding agent is effective, but only when given clear, specific instructions. Just like a human developer, it performs best when the scope is well-defined and the requirements are explicit.

A vague instruction like "improve the code" will produce vague results. A precise instruction like "Add docstrings to all functions in decoder.py following PEP 257 standards, and ensure each docstring includes parameter types and return value documentation" will produce exactly what you need.

This is why clear scoping is essential before assigning work to Copilot coding agent. Invest time upfront in writing good issue descriptions, and you'll see exponentially better results.

Preparing Your Environment

Copilot coding agent works like a full-time developer. It needs the right tools and dependencies installed. This is where the .github/workflows/copilot-setup-steps.yml file comes in.

This special GitHub Actions workflow runs before Copilot begins work, ensuring it has everything needed. Choose the setup for your primary language:

name: "Copilot Setup Steps"

on:
  workflow_dispatch

jobs:
  copilot-setup-steps:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: "3.11"
          cache: "pip"

      - name: Install dependencies
        run: |
          pip install pytest pytest-cov
          pip install -r requirements.txt
name: "Copilot Setup Steps"

on:
  workflow_dispatch

jobs:
  copilot-setup-steps:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "npm"
          cache-dependency-path: "./package.json"

      - name: Install dependencies
        run: |
          npm ci
          npm install --save-dev jest @types/jest
name: "Copilot Setup Steps"

on:
  workflow_dispatch

jobs:
  copilot-setup-steps:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
                      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set up .NET
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: "8.0.x"

      - name: Restore dependencies
        run: |
          dotnet restore
          dotnet add ./Tests package xunit
          dotnet add ./Tests package xunit.runner.visualstudio

Key points:

  • The job must be called copilot-setup-steps
  • Add a workflow_dispatch trigger so you can test it manually before Copilot runs it
  • Set permissions to the minimum required (contents: read if cloning)
  • Install all tools and dependencies the agent will need

Task 1: Document the Decoder

ByteStrike's decoder has been battle-tested, but new team members struggle to understand it. The code needs comprehensive documentation that explains what each function does, what parameters it expects, and what it returns.

Instead of manually writing documentation, assign this to Copilot coding agent:

  1. Navigate to your repository on GitHub
  2. Click the Issues tab
  3. Click New issue and select Blank issue
  4. Set the title to: Add comprehensive documentation to blueprint decoder
  5. Set the description to something like this:
    The blueprint decoder has been deployed to production, but lacks proper documentation.
    New operatives cannot easily understand how to use it.
    
    Requirements:
    - Add docstrings to all functions in decoder.py and secret_extractor.py
    - Follow PEP 257 conventions
    - Include parameter types and descriptions
    - Include return value documentation
    - Add type hints where missing
    - Do not modify function logic, only add documentation
    - Ensure all docstrings are clear and helpful to new developers
    The blueprint decoder has been deployed to production, but lacks proper documentation.
    New operatives cannot easily understand how to use it.
    
    Requirements:
    - Add JSDoc comments to all functions in decoder.js and secretExtractor.js
    - Follow JSDoc conventions
    - Include parameter types and descriptions
    - Include return value documentation
    - Add TypeScript-style type annotations in comments where applicable
    - Do not modify function logic, only add documentation
    - Ensure all comments are clear and helpful to new developers
    The blueprint decoder has been deployed to production, but lacks proper documentation.
    New operatives cannot easily understand how to use it.
    
    Requirements:
    - Add XML documentation comments to all public methods in Decoder.cs and SecretExtractor.cs
    - Follow C# XML documentation conventions
    - Include parameter descriptions and types
    - Include return value documentation
    - Add proper access modifiers and inheritance documentation
    - Do not modify method logic, only add documentation
    - Ensure all comments are clear and helpful to new developers
  6. Click the Assignees button and select Copilot
  7. Click Create issue

Watch for the eyes emoji (👀) in the issue, indicating Copilot is working. After a few moments, Copilot will create a draft pull request with a checklist of tasks. You can view the live session to see how Copilot approaches the problem.

Task 2: Add Batch Processing Capabilities

The League has new requirements. Instead of processing a single blueprint file, the system needs to handle multiple files asynchronously. This is more complex than the documentation task, but still perfect for Copilot coding agent.

  1. In your repository, create a new issue
  2. Set the title to: Implement batch blueprint processing with retry logic
  3. Set the description to:
    The decoder currently processes one blueprint file at a time. The League now needs
    the ability to process multiple files in a single batch, with proper error handling and retry logic.
    
    Requirements:
    - Create a new BatchProcessor class that accepts a list of blueprint file paths
    - Implement exponential backoff retry logic (up to 3 retries with 1s, 2s, 4s delays)
    - Failed files should be logged with error details
    - Return a summary report including:
      * Total files processed
      * Successful extractions
      * Failed files and reasons
      * Total secrets extracted
    - Write unit tests for all new methods
    - Use async/await patterns for concurrent processing
    - Ensure backwards compatibility with existing decoder functions
    The decoder currently processes one blueprint file at a time. The League now needs
    the ability to process multiple files in a single batch, with proper error handling and retry logic.
    
    Requirements:
    - Create a new BatchProcessor class that accepts a list of blueprint file paths
    - Implement exponential backoff retry logic (up to 3 retries with 1s, 2s, 4s delays)
    - Failed files should be logged with error details
    - Return a summary report including:
      * Total files processed
      * Successful extractions
      * Failed files and reasons
      * Total secrets extracted
    - Write unit tests for all new methods using Jest
    - Use Promise and async/await for concurrent processing
    - Ensure backwards compatibility with existing decoder functions
    The decoder currently processes one blueprint file at a time. The League now needs
    the ability to process multiple files in a single batch, with proper error handling and retry logic.
    
    Requirements:
    - Create a new BatchProcessor class that accepts a list of blueprint file paths
    - Implement exponential backoff retry logic (up to 3 retries with 1s, 2s, 4s delays)
    - Failed files should be logged with error details
    - Return a summary report including:
      * Total files processed
      * Successful extractions
      * Failed files and reasons
      * Total secrets extracted
    - Write unit tests for all new methods using xUnit
    - Use Task and async/await for concurrent processing
    - Ensure backwards compatibility with existing decoder methods
  4. Assign to Copilot and create the issue

Notice how much detail went into the requirements. This specificity is directly proportional to the quality of the work Copilot produces. Without clear scope, results are scattered.

While Copilot works on this, ByteStrike can focus on other mission-critical tasks. Instead of being blocked waiting for implementation, work continues in parallel.

Task 3: Generate Comprehensive Tests

There's a gap in ByteStrike's codebase. Critical functions lack proper test coverage. This is exactly the type of repetitive work that Copilot excels at.

  1. Create a new issue with the title: Add comprehensive unit tests for secret extraction
  2. Set the description to:
    The secret extraction module lacks proper test coverage.
    We need unit tests that validate all edge cases and failure scenarios.
    
    Requirements:
    - Write tests for the extract_secrets() function covering:
      * Normal extraction (secrets found between {* and *})
      * Multiple secrets in a single file
      * No secrets present (empty result)
      * Malformed markers (incomplete {* or missing *})
      * Empty or null input
      * Files with special characters in secrets
    - Write tests for the categorize_secret() function
    - Achieve minimum 95% code coverage
    - Use pytest framework with fixtures for test data
    - Mock file I/O operations where appropriate
    - Include parametrized tests for multiple input variations
    - Run all tests as part of the validation
    The secret extraction module lacks proper test coverage.
    We need unit tests that validate all edge cases and failure scenarios.
    
    Requirements:
    - Write tests for the extractSecrets() function covering:
      * Normal extraction (secrets found between {* and *})
      * Multiple secrets in a single file
      * No secrets present (empty result)
      * Malformed markers (incomplete {* or missing *})
      * Empty or null input
      * Files with special characters in secrets
    - Write tests for the categorizeSecret() function
    - Achieve minimum 95% code coverage
    - Use Jest framework with test fixtures for test data
    - Mock file I/O operations where appropriate
    - Include parametrized tests for multiple input variations
    - Run all tests as part of the validation
    The secret extraction module lacks proper test coverage.
    We need unit tests that validate all edge cases and failure scenarios.
    
    Requirements:
    - Write tests for the ExtractSecrets() method covering:
      * Normal extraction (secrets found between {* and *})
      * Multiple secrets in a single file
      * No secrets present (empty result)
      * Malformed markers (incomplete {* or missing *})
      * Empty or null input
      * Files with special characters in secrets
    - Write tests for the CategorizeSecret() method
    - Achieve minimum 95% code coverage
    - Use xUnit framework with shared fixtures for test data
    - Mock file I/O operations where appropriate
    - Use Theory attribute for parametrized tests with multiple input variations
    - Run all tests as part of the validation
  3. Assign to Copilot and create

Test generation is one of the highest-value uses for Copilot coding agent. What would take hours to write manually is generated in minutes, then reviewed by your team.

Reviewing Copilot's Work

Once Copilot completes a task, it creates a draft pull request. The process is the same as reviewing work from any developer:

  1. Go to the Pull Requests tab in your repository
  2. Open the PR created by Copilot (usually titled [WIP]: followed by your issue title)
  3. Review the changes, file by file, just as you would with a colleague
  4. Check the Conversation tab to see Copilot's summary and the checklist it followed
  5. Request changes if needed, or approve and merge if satisfied

The key difference from typical code review: Copilot works for free and doesn't get offended by feedback. If results don't meet expectations, iterate. Update the issue with clarifying instructions and reassign to Copilot. That's the advantage of working with AI.

Best Practices for Mission Success

Be Specific

Vague requirements produce vague code. Describe exactly what you want. Include standards (PEP 257 for Python, JSDoc for JavaScript, XML docs for C#) and testing frameworks. The more detail, the better the output.

Start with Small Tasks

Before assigning complex features, start with documentation or test generation. This helps you understand how Copilot works and refine your communication style. Learn on low-stakes tasks.

Provide Context

If you're adding features to existing code, reference the existing patterns and style. Let Copilot know if there's a particular library or framework you prefer. Context reduces rework.

Test Everything

Copilot coding agent produces code, but it's your responsibility to validate it works. Always run tests, check functionality, and review logic before merging to production.

Leverage Async Work

The entire point of Copilot coding agent is asynchronous execution. Assign multiple issues at once. While Copilot works on documentation, you can code new features. While Copilot builds tests, you can review design. This is parallel development.

Iterate and Refine

If the first attempt doesn't meet expectations, it's not a failure. Update the issue with more specific requirements and reassign. Iteration is part of the process, whether you're working with human developers or AI agents.

A Note on Responsibility

Copilot coding agent is powerful, but it comes with responsibility. As ByteStrike would tell you, autonomy requires oversight. When you assign work to Copilot, you're responsible for:

  • Security: Ensure generated code doesn't introduce vulnerabilities
  • Quality: Review code before it reaches production
  • Compliance: Make sure the code meets your organization's standards
  • Testing: Verify that tests pass and coverage is adequate

Think of Copilot as a trusted specialist contractor. You hire them because they're good, but you still review their invoices and test their work before deploying to mission-critical systems.

Summary

Copilot coding agent transforms how teams handle technical debt, feature implementation, and testing. For ByteStrike's operation, it means:

  • Faster turnaround on documentation without sacrificing clarity
  • New features implemented while the team focuses on architecture and planning
  • Comprehensive tests generated automatically
  • More time for high-value decision making, less time on routine coding tasks

The key to success is clear communication. Write specific issues, provide context, set expectations, and review carefully. When you work this way, Copilot coding agent becomes not just a productivity multiplier, but a genuine force multiplier for small teams with big missions.

For ByteStrike and The League, that means more time to focus on what matters: the mission strategy, security, and making sure the code is production-ready when it matters most.

Resources

🎓 Bonus Topics Available

Review other bonus content:

← Return to workshop home