๐ค Agentic Development Guide for Gati โ
Last Updated: 2025-11-09
Framework: Gati - Motion in Code
Development Mode: AI-Assisted + Human Oversight
๐ Table of Contents โ
- Overview
- Development Workflow
- Using GitHub Copilot Agent
- Task Assignment Strategy
- Quality Gates
- Best Practices
- Tools & Configuration
Overview โ
Gati uses an agentic development approach where AI coding agents (primarily GitHub Copilot) work alongside human developers to accelerate development while maintaining code quality.
Key Principles โ
- AI for Implementation, Human for Direction - Humans define requirements, AI implements
- Incremental Progress - Small, reviewable changes over large rewrites
- Test-Driven - AI generates tests alongside implementation
- Documentation First - Every feature includes docs
- Quality Gates - Automated checks before merge
Development Workflow โ
Phase 1: Task Selection โ
graph LR
A[GitHub Issue] --> B{Ready?}
B -->|Yes| C[Assign to Agent]
B -->|No| D[Refine Requirements]
D --> A
C --> E[Agent Works]
E --> F[Human Review]
F --> G{Approved?}
G -->|Yes| H[Merge]
G -->|No| I[Feedback]
I --> ESteps:
- Select issue from Milestone 1 board
- Verify acceptance criteria are clear
- Check dependencies are complete
- Assign to Copilot or work with Copilot Chat
Phase 2: Implementation โ
Using GitHub Copilot Agent (Direct Assignment) โ
For well-defined tasks, assign directly:
# Via GitHub CLI
gh issue view 1
gh copilot assign 1
# Or via GitHub UI
# Navigate to issue โ "Assign to Copilot" buttonWhat Copilot Does:
- Reads issue description and acceptance criteria
- Analyzes codebase context
- Creates implementation plan
- Writes code + tests
- Commits to a branch
- Opens PR with detailed description
When to Use:
- โ Task has clear acceptance criteria
- โ Dependencies are satisfied
- โ File paths specified in issue
- โ Limited ambiguity
Using Copilot Chat (Interactive) โ
For complex or exploratory tasks:
@workspace Let's work on #1 - Handler Execution Pipeline
Requirements:
- Implement Request and Response objects
- Create context managers (gctx, lctx)
- Handler signature: handler(req, res, gctx, lctx)
Files to create:
- src/runtime/handler-engine.ts
- src/runtime/types/request.ts
- src/runtime/types/response.ts
Please start with the type definitions.When to Use:
- โ Need iterative refinement
- โ Want to discuss architecture first
- โ Multiple approaches to consider
- โ Learning new patterns
Phase 3: Review & Merge โ
Automated Checks โ
Every PR must pass:
# .github/workflows/pr-checks.yml
- TypeScript compilation
- ESLint (no errors)
- Unit tests (>80% coverage)
- Integration tests (if applicable)
- Build succeedsHuman Review Checklist โ
- [ ] Code matches acceptance criteria
- [ ] Tests cover edge cases
- [ ] Documentation updated
- [ ] No security vulnerabilities
- [ ] Performance acceptable
- [ ] Follows project conventions
- [ ] Comments explain "why", not "what"Using GitHub Copilot Agent โ
Configuration โ
Create .github/copilot-instructions.md:
# Copilot Instructions for Gati
## Project Context
Gati is a cloud-native Node.js framework for versioned APIs.
## Code Style
- TypeScript strict mode
- Functional > OOP where possible
- Clear, descriptive names
- Comments for complex logic only
## Testing Requirements
- Unit tests for all public APIs
- Use Vitest framework
- Test edge cases and errors
- Mock external dependencies
## File Structure
Follow the structure in MILESTONES.md - files are pre-specified per task.
## Import Conventions
```typescript
// External imports first
import { createServer } from 'http';
// Internal imports second
import { Handler } from './types/handler';
import { Context } from './types/context';
```Error Handling โ
- Use custom error classes
- Always include error context
- Log errors with structured logging
### Issue Templates for AI
Create `.github/ISSUE_TEMPLATE/ai-task.md`:
```markdown
---
name: AI Agent Task
about: Task specification for AI coding agents
labels: ai-task, M1
---
## ๐ฏ Objective
[One sentence: what needs to be built]
## ๐ Requirements
### Functional
- [ ] Requirement 1
- [ ] Requirement 2
### Non-Functional
- [ ] Performance: [specific metric]
- [ ] Security: [specific requirement]
## ๐ Files to Create/Modify
### Create
- `path/to/file1.ts` - [purpose]
- `path/to/file2.ts` - [purpose]
### Modify
- `path/to/existing.ts` - [what to change]
## โ
Acceptance Criteria
- [ ] Criterion 1 (testable)
- [ ] Criterion 2 (testable)
## ๐งช Test Requirements
```typescript
// Example test structure
describe('FeatureName', () => {
it('should handle basic case', () => {});
it('should handle error case', () => {});
});๐ Context & References โ
- Related issues: #X, #Y
- Design docs: [link]
- Similar code:
path/to/example.ts
๐ซ Out of Scope โ
- Thing 1
- Thing 2
๐ก Implementation Hints โ
[Optional: architectural guidance, preferred patterns]
---
## Task Assignment Strategy
### Task Categories
| Category | Approach | Example |
|----------|----------|---------|
| **Well-Defined** | Assign to Copilot Agent | "Implement TypeScript config" |
| **Exploratory** | Interactive Copilot Chat | "Design context manager architecture" |
| **Critical Path** | Pair: Human + Copilot | "Handler execution flow" |
| **Documentation** | Copilot writes, Human reviews | "Getting Started guide" |
### Milestone 1 Assignment Plan
#### Week 1: Foundation
```bash
# โ
Completed by human
Issue #12: Setup Monorepo (Completed manually)
Issue #13: TypeScript Config (Completed manually)
# ๐ค Assign to Copilot
gh copilot assign 7 # Context Managers (low risk, clear spec)Week 2: Core Runtime โ
# ๐ฌ Interactive Development
# Open Copilot Chat:
"Let's work on #1 - Handler Pipeline. This is critical.
I want to discuss the architecture first before implementing."
# After architecture finalized:
gh copilot assign 1 # Handler PipelineWeek 3: Routing โ
# ๐ค Direct Assignment (dependencies ready)
gh copilot assign 6 # Route RegistrationWeek 4-5: Integration โ
# ๐ฌ Interactive (complex integration)
"Let's integrate all components for #8 - App Core.
Show me how the pieces fit together first."Quality Gates โ
Before AI Implementation โ
Checklist:
- [ ] Issue has clear acceptance criteria
- [ ] Dependencies satisfied (check MILESTONES.md)
- [ ] File paths specified
- [ ] Test requirements documented
- [ ] Example code provided (if complex)During Implementation โ
Monitor:
- PR description explains changes
- Commits are logical and atomic
- Tests written alongside code
- No compilation errors
- CI passesAfter Implementation โ
Review:
- [ ] Run locally: `npm install && npm test`
- [ ] Code matches issue requirements
- [ ] Edge cases covered
- [ ] Documentation updated
- [ ] No performance regressions
- [ ] Security best practices followedBest Practices โ
1. Start Small โ
โ "Implement entire handler system"
โ
"Implement Request type definition"2. Provide Context โ
โ "@workspace write handler code"
โ
"@workspace Implement handler execution based on #1.
Reference Express.js middleware pattern but use our
signature: handler(req, res, gctx, lctx)"3. Iterate on Feedback โ
Agent: [creates PR]
You: "Good start, but we need error boundaries. See Milestone doc."
Agent: [updates PR with error handling]4. Use Examples โ
"Implement module loader similar to:
- Node.js require() for discovery
- Webpack plugins for lifecycle
- NestJS modules for DI
See examples/hello-world for usage pattern."5. Test First (Sometimes) โ
"Before implementing handler-engine.ts, create tests in
handler-engine.test.ts that define expected behavior."Tools & Configuration โ
Required Tools โ
# GitHub CLI with Copilot
brew install gh
gh extension install github/gh-copilot
# VS Code with extensions
code --install-extension GitHub.copilot
code --install-extension GitHub.copilot-chat
# Node.js tooling
npm install -g pnpmProject Setup โ
# Clone repo
git clone https://github.com/krishnapaul242/gati.git
cd gati
# Install dependencies (when package.json exists)
pnpm install
# Create .env for local development
cp .env.example .env
# Verify setup
pnpm typecheck
pnpm testVS Code Settings โ
Create .vscode/settings.json:
{
"github.copilot.enable": {
"*": true,
"yaml": true,
"plaintext": false,
"markdown": true
},
"github.copilot.advanced": {
"debug.overrideEngine": "gpt-4",
"inlineSuggest.count": 3
},
"editor.inlineSuggest.enabled": true,
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules/typescript/lib"
}Example: Working on Issue #1 โ
Step 1: Review Issue โ
gh issue view 1Output shows:
- Description: Handler execution pipeline
- Files to create: handler-engine.ts, request.ts, response.ts
- Acceptance criteria: 4 specific points
Step 2: Choose Approach โ
Option A: Direct Assignment
gh copilot assign 1
# Wait for PR
# Review when readyOption B: Interactive Development
Open VS Code โ Copilot Chat:
You: @workspace Let's work on #1 step by step.
First, show me the type definitions for Request and Response
based on Express.js but adapted for our context system.
Copilot: [generates src/runtime/types/request.ts]
You: Good! Now add query params and path params extraction.
Copilot: [updates types]
You: Perfect. Create the file and let's move to handler-engine.tsStep 3: Review PR โ
# Checkout PR branch
gh pr checkout 123
# Run tests
pnpm test
# Manual testing
pnpm dev
# If good:
gh pr review 123 --approve
gh pr merge 123Troubleshooting โ
"Agent got stuck or incorrect implementation" โ
Solution:
# Close PR
gh pr close 123
# Create new branch manually
git checkout -b fix/issue-1-take-2
# Use interactive Copilot Chat with more guidance"Too many changes in one PR" โ
Solution:
Break into sub-tasks:
#1.1: Request/Response types
#1.2: Context initialization
#1.3: Handler execution flow
#1.4: Error handling"Tests failing" โ
Solution:
"@workspace The tests for handler-engine are failing.
Here's the error: [paste error].
Please fix the implementation in handler-engine.ts."Metrics & Tracking โ
Dashboard (Weekly Update) โ
| Metric | Target | Current |
|---|---|---|
| Issues completed | 2-3/week | - |
| Test coverage | >80% | - |
| PR review time | <24h | - |
| AI accuracy | >90% | - |
AI Effectiveness โ
Track in AGENTIC_METRICS.md:
| Issue | Method | Human Time | AI Saves | Quality |
| ----- | ------ | ---------- | -------- | ------- |
| #1 | Chat | 2h review | ~8h code | 9/10 |
| #12 | Human | 1h | N/A | 10/10 |Next Steps โ
- โ Review this guide
- โ Setup tools (gh, Copilot)
- โ
Create
.github/copilot-instructions.md - โ Test with one small issue (e.g., #7)
- โ Iterate on workflow
- โ Scale to more complex tasks
Resources โ
Remember: AI is a force multiplier, not a replacement. You architect, review, and decide. AI implements, tests, and documents.
๐ Let's build Gati together!