Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Aug 23, 2025

This PR adds a comprehensive .github/copilot-instructions.md file that provides GitHub Copilot coding agents with detailed instructions for working effectively in the lambda-api codebase.

What's Included

The instructions cover all essential aspects of lambda-api development:

Build and Test Workflow

  • Dependencies: npm ci (35 seconds)
  • Testing: Complete test suite with timing guidance
    • npm test - Full test suite (12 seconds, 478 tests)
    • npm run test:unit - Unit tests only (6 seconds)
    • npm run test:types - TypeScript validation (4 seconds)
  • Code Quality: ESLint and Prettier commands with <1 second execution
  • CI Pipeline: npm run test-ci replicating GitHub Actions workflow

Validation Guidelines

The instructions emphasize manual validation with specific test scenarios:

  • Basic route creation and JSON responses
  • Path parameters (e.g., /users/:id)
  • HTTP methods (GET, POST, PUT, DELETE)
  • Middleware functionality
  • Error handling
  • Route debugging with api.routes(true)

Project Context

  • Zero dependencies design principle
  • No build step required (pure JavaScript)
  • 97.63% test coverage across 27 test suites
  • Express.js-like API optimized for AWS Lambda
  • Serverless architecture patterns

Practical Examples

Working code examples demonstrate:

const api = require('./index.js')();
api.get('/test', (req, res) => res.json({ status: 'ok' }));
const mockEvent = { httpMethod: 'GET', path: '/test', body: null, headers: {}, multiValueHeaders: {} };
api.run(mockEvent, {}).then(result => console.log(result));

Validation Process

All commands and examples were thoroughly tested:

  • Measured actual execution times for timeout recommendations
  • Verified all code examples work correctly
  • Tested complete end-to-end scenarios
  • Validated formatting and linting requirements
  • Ensured instructions follow "never cancel" guidelines with appropriate timeouts

The instructions enable coding agents to work efficiently without extensive exploration, reducing development time and preventing common mistakes.

Fixes #293.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • coveralls.io
    • Triggering command: node ./node_modules/coveralls/bin/coveralls.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


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

Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] ✨ Set up Copilot instructions Add comprehensive GitHub Copilot instructions for lambda-api development Aug 23, 2025
@Copilot Copilot AI requested a review from naorpeled August 23, 2025 16:57
Copilot finished work on behalf of naorpeled August 23, 2025 16:57
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