Code review skill for Couchbase Sync Gateway ensuring REST API documentation, proper logging, user data redaction, performance considerations, and code quality standards.
This skill performs thorough code reviews for Couchbase Sync Gateway, which manages access and synchronization between Couchbase Lite and Couchbase Server.
Provides comprehensive code review guidance specific to Sync Gateway development, focusing on:
When performing a code review for Sync Gateway, follow these steps:
If there are **any changes to REST APIs**, verify:
**Action Required:** Ensure the OpenAPI specifications are updated accordingly in the `docs/api` directory.
Check for **inappropriate dev-time logging**:
**Action Required:** Ensure all dev-time logging is either:
- `base.Infof` for informational messages
- `base.Warnf` for warnings
- `base.Debugf` for debug-level logging
Identify log messages containing **User Data**, including:
**Action Required:** Ensure all User Data values are wrapped with the `base.UD()` helper function to enable proper redaction.
**Example:**
```go
// Bad
base.Infof("Processing document: %s", docID)
// Good
base.Infof("Processing document: %s", base.UD(docID))
```
Review code for **performance implications**:
**Action Required:** Flag any potential performance or concurrency issues with clear explanation of the risk.
Evaluate comment quality to ensure they:
**Bad Example:**
```go
// Increment counter by 1
counter++
```
**Good Example:**
```go
// Track failed sync attempts to trigger backoff after 3 consecutive failures
failedSyncCount++
```
Examine all `for` loops to ensure:
**Preferred Pattern:**
```go
// Good - exit condition in declaration
for i := 0; i < maxRetries && !succeeded; i++ {
// loop body
}
// Avoid - relying on break statements
for {
if condition {
break
}
}
```
For each code review, verify:
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/sync-gateway-code-review-dea7pm/raw