Skip to main content
ClaudeWave
Skill491 repo starsupdated 24d ago

gsd-integration-checker

Verifies that integrations work correctly by checking endpoints, responses, and data flow. Spawned by /gsd:complete-milestone orchestrator.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/allgpt-co/QuickVoice /tmp/gsd-integration-checker && cp -r /tmp/gsd-integration-checker/.claude/skills/gsd/agents/integration-checker ~/.claude/skills/gsd-integration-checker
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# GSD Integration Checker

Verifies that external integrations work correctly by checking endpoints, responses, and data flow.

## When to Use

Use this agent when:
- A milestone involving external service integrations has been completed
- You need to verify that integrations are working correctly
- You are spawned by `/gsd:complete-milestone` orchestrator

## Core Responsibilities

1. **Verify endpoint configuration** - Check if endpoints are properly configured
2. **Test request/response flow** - Ensure data flows correctly through integration
3. **Validate authentication** - Confirm auth mechanisms work as expected
4. **Check error handling** - Verify proper error responses and logging
5. **Verify data persistence** - Confirm data is stored/retrieved correctly
6. **Document findings** - Create clear verification report

## Philosophy

### Integration Verification ≠ Feature Testing

You're NOT testing if the feature works. You're testing if the INTEGRATION works correctly.

**What to verify:**
- Are endpoints called correctly?
- Do requests include proper headers/auth?
- Are responses handled correctly?
- Does data flow through the system as expected?
- Are errors logged and handled appropriately?

**What NOT to verify:**
- UI appearance (unless integration affects UI)
- User experience flows (unless integration affects UX)
- Business logic correctness (that's the feature's responsibility)

## Verification Dimensions

### 1. Endpoint Configuration

Check that integration endpoints are:
- Properly configured (correct URLs, paths)
- Protected with appropriate authentication
- Have required middleware (CORS, rate limiting, etc.)
- Documented in codebase or integration docs

### 2. Request/Response Flow

Verify that:
- Requests include all required parameters
- Request format matches API specification
- Responses include expected data structure
- Response codes are correct (200 for success, 4xx/5xx for errors)
- Errors are returned in consistent format

### 3. Authentication & Authorization

Verify that:
- API keys/tokens are properly configured
- Authentication headers are included correctly
- OAuth flows work as designed
- User identity is passed through correctly
- Authorization checks are implemented where required

### 4. Data Persistence

Verify that:
- Data is saved to correct database/location
- Data can be retrieved correctly
- Data transformations are applied correctly
- Data relationships are maintained (foreign keys, etc.)

### 5. Error Handling

Verify that:
- Errors are caught and logged appropriately
- Error responses follow API specifications
- Retry logic is implemented for transient failures
- User-facing error messages are clear

## Process

### Step 1: Load Context

Read milestone context:

```bash
# Find milestone directory
MILESTONE_DIR=$(find .planning/phases -name "*-milestone" -type d | head -1)

# Read milestone SUMMARY
cat "$MILESTONE_DIR"/*-SUMMARY.md

# Identify integrations from milestone
grep -i "integration\|external.*service\|api" "$MILESTONE_DIR"/*-SUMMARY.md
```

### Step 2: Identify Integration Points

From milestone SUMMARY, extract:
- External services integrated
- Endpoints created/modified
- Configuration requirements
- Data models affected

### Step 3: Verify Endpoint Configuration

For each integration point:

**Check endpoint exists:**

```bash
# Check if endpoint file exists
if [ -f "src/api/external-service/route.ts" ]; then
    echo "EXISTS"
else
    echo "MISSING"
fi
```

**Check endpoint configuration:**

```bash
# Check for API base URL configuration
grep -r "BASE_URL\|API_URL\|ENDPOINT" "src/api/external-service/route.ts" 2>/dev/null

# Check for authentication setup
grep -r "API_KEY\|SECRET\|TOKEN" "src/api/external-service/route.ts" 2>/dev/null
```

### Step 4: Test Request/Response Flow

**Test endpoint with curl:**

```bash
# Example test command
curl -X POST http://localhost:3000/api/external-service/endpoint \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer test-token" \
  -d '{"test": "data"}'
```

**Verify response:**
- Status code is 200-299 for success
- Response body contains expected data
- Response headers are correct (Content-Type, etc.)

### Step 5: Verify Authentication

**Test authentication flow:**

```bash
# Test protected endpoint without auth
curl http://localhost:3000/api/external-service/endpoint

# Should return 401 Unauthorized
```

**Test with valid credentials:**

```bash
# Test with valid API key
curl -H "X-API-Key: valid-key" http://localhost:3000/api/external-service/endpoint

# Should return 200 with data
```

**Verify token-based auth:**

```bash
# Test OAuth flow
curl -H "Authorization: Bearer oauth-token" http://localhost:3000/api/external-service/endpoint
```

### Step 6: Check Data Persistence

**Verify data is saved:**

```bash
# Check database for records
# Example for Prisma
npx prisma studio execute "SELECT * FROM ExternalServiceData" --json

# Or check application logs
grep "ExternalServiceData.*created\|saved" logs/app.log | tail -20
```

**Verify data can be retrieved:**

```bash
# Test retrieval endpoint
curl http://localhost:3000/api/external-service/data/123

# Should return the saved record
```

### Step 7: Check Error Handling

**Verify error responses:**

```bash
# Test error endpoint
curl -X POST http://localhost:3000/api/external-service/endpoint \
  -H "Content-Type: application/json" \
  -d '{"invalid": "data"}'

# Should return 400 with error message
```

**Verify error logging:**

```bash
# Check logs for error messages
grep "ERROR.*ExternalService\|Failed.*external.*API" logs/app.log | tail -10
```

### Step 8: Document Findings

Create verification report with:

- Integration points tested
- Configuration status
- Test results
- Issues found
- Recommendations

## Verification Criteria

### Endpoint Configuration

- [ ] All endpoints exist and are properly configured
- [ ] API base URLs are correct
- [ ] Authentication mechanisms are properly set up
- [ ] Required