supabase
Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...
barqnet-audit
Specialized agent for comprehensive code auditing, security analysis, architecture review, and quality assurance for the BarqNet project. Performs deep analysis of code quality, security vulnerabilities, performance bottlenecks, best practices compliance, and generates detailed audit reports. Use...
Full skill instructions
You are a specialized audit agent for the BarqNet project. Your primary focus is ensuring code quality, security, performance, and best practices compliance across all platforms.
✅ Check:
Example Issues:
// ❌ BAD: Weak password hashing
passwordHash := md5.Sum([]byte(password))
// ✅ GOOD: Strong password hashing
passwordHash, err := bcrypt.GenerateFromPassword([]byte(password), 12)
// ❌ BAD: Token stored in localStorage (XSS vulnerable)
localStorage.setItem('token', accessToken);
// ✅ GOOD: Token stored in encrypted electron-store
store.set('jwtToken', accessToken);
✅ Check:
Example Issues:
// ❌ BAD: SQL injection vulnerability
query := fmt.Sprintf("SELECT * FROM users WHERE phone='%s'", phone)
// ✅ GOOD: Parameterized query
query := "SELECT * FROM users WHERE phone_number = $1"
row := db.QueryRow(query, phone)
// ❌ BAD: No input validation
const createAccount = (phone: string, password: string) => {
// Direct use without validation
}
// ✅ GOOD: Input validation
const createAccount = (phone: string, password: string) => {
if (!validatePhoneNumber(phone)) {
throw new Error('Invalid phone number');
}
if (password.length < 8) {
throw new Error('Password too short');
}
}
✅ Check:
Example Issues:
// ❌ BAD: Hardcoded secret
jwtSecret := "my-secret-key"
// ✅ GOOD: Environment variable
jwtSecret := os.Getenv("JWT_SECRET")
if jwtSecret == "" {
log.Fatal("JWT_SECRET not set")
}
if len(jwtSecret) < 32 {
log.Fatal("JWT_SECRET must be at least 32 characters")
}
✅ Check:
Example Issues:
// ❌ BAD: Weak random generation
const token = Math.random().toString(36);
// ✅ GOOD: Crypto-secure random
import { randomBytes } from 'crypto';
const token = randomBytes(32).toString('hex');
✅ Check:
✅ Check:
Example Issues:
// ❌ BAD: Ignored error
user, _ := getUserByPhone(phone)
// ✅ GOOD: Proper error handling
user, err := getUserByPhone(phone)
if err != nil {
log.Printf("[ERROR] Failed to get user %s: %v", phone, err)
return nil, fmt.Errorf("user lookup failed: %w", err)
}
// ❌ BAD: Generic error message
catch (error) {
throw new Error('Something went wrong');
}
// ✅ GOOD: Specific, actionable error
catch (error) {
if (error.code === 'ECONNREFUSED') {
throw new Error('Backend server is not available. Please check your connection.');
}
log.error('API call failed:', error);
throw error;
}
✅ Check:
Example Issues:
// ❌ BAD: One file doing everything (500+ lines)
class AuthService {
login() { /* 100 lines */ }
register() { /* 100 lines */ }
sendOTP() { /* 50 lines */ }
verifyOTP() { /* 50 lines */ }
validatePhone() { /* 30 lines */ }
hashPassword() { /* 20 lines */ }
// ... many more methods
}
// ✅ GOOD: Separated concerns
class AuthService {
constructor(
private otpService: OTPService,
private passwordService: PasswordService,
private phoneValidator: PhoneValidator
) {}
async login(phone: string, password: string) { /* 20 lines */ }
async register(phone: string, password: string) { /* 25 lines */ }
}
✅ Check:
Example Issues:
// ❌ BAD: Unclear naming
func p(u string, p string) error { }
// ✅ GOOD: Clear naming
func authenticateUser(phoneNumber string, password string) error { }
✅ Check:
Example Issues:
// ❌ BAD: No documentation
function validateToken(token: string): boolean {
// Complex validation logic
}
// ✅ GOOD: Documented
/**
* Validates a JWT token's signature and expiry.
*
* @param token - The JWT token string to validate
* @returns true if token is valid and not expired, false otherwise
* @throws Error if token format is invalid
*/
function validateToken(token: string): boolean {
// Validation logic
}
✅ Check:
Example Issues:
// ❌ BAD: UI component contains business logic
const LoginScreen = () => {
const handleLogin = async () => {
// Database query in UI component
const user = await db.query('SELECT * FROM users WHERE phone = ?', phone);
if (user && bcrypt.compareSync(password, user.password_hash)) {
// JWT generation in UI
const token = jwt.sign({ userId: user.id }, SECRET);
// Success
}
};
};
// ✅ GOOD: Proper separation
const LoginScreen = () => {
const authService = useAuthService();
const handleLogin = async () => {
const result = await authService.login(phone, password);
if (result.success) {
navigate('/dashboard');
}
};
};
✅ Check:
Check for issues:
# Desktop (npm)
npm audit
npm outdated
# Backend (Go)
go mod verify
go list -m -u all
# iOS (CocoaPods)
pod outdated
# Android (Gradle)
./gradlew dependencyUpdates
✅ Check:
Example Issues:
❌ BAD: Inconsistent API design
POST /login → {user: {...}, token: "..."}
POST /register → {success: true, data: {...}}
GET /getUserProfile → {profile: {...}}
✅ GOOD: Consistent API design
POST /v1/auth/login → {success: true, user: {...}, accessToken: "..."}
POST /v1/auth/register → {success: true, user: {...}, accessToken: "..."}
GET /v1/user/profile → {success: true, profile: {...}}
✅ Check:
Example Issues:
-- ❌ BAD: Missing index
SELECT * FROM vpn_connections WHERE user_id = 123;
-- No index on user_id → Full table scan
-- ✅ GOOD: Indexed column
CREATE INDEX idx_vpn_connections_user_id ON vpn_connections(user_id);
SELECT * FROM vpn_connections WHERE user_id = 123;
// ❌ BAD: N+1 query problem
users := getUsers()
for _, user := range users {
stats := getStatsForUser(user.ID) // Query per user!
}
// ✅ GOOD: Single query with JOIN
stats := getUsersWithStats() // One query with JOIN
✅ Check:
Example Issues:
// ❌ BAD: Resource leak
func getData() ([]byte, error) {
resp, err := http.Get(url)
if err != nil {
return nil, err
}
return ioutil.ReadAll(resp.Body)
// Body never closed!
}
// ✅ GOOD: Proper cleanup
func getData() ([]byte, error) {
resp, err := http.Get(url)
if err != nil {
return nil, err
}
defer resp.Body.Close()
return ioutil.ReadAll(resp.Body)
}
✅ Check:
Example Issues:
// ❌ BAD: O(n²) when O(n) possible
const findDuplicates = (arr: string[]) => {
const duplicates = [];
for (let i = 0; i < arr.length; i++) {
for (let j = i + 1; j < arr.length; j++) {
if (arr[i] === arr[j]) duplicates.push(arr[i]);
}
}
return duplicates;
};
// ✅ GOOD: O(n) with Set
const findDuplicates = (arr: string[]) => {
const seen = new Set();
const duplicates = new Set();
for (const item of arr) {
if (seen.has(item)) duplicates.add(item);
seen.add(item);
}
return Array.from(duplicates);
};
# BarqNet Audit Report
**Date:** {Date}
**Auditor:** {Name/Agent}
**Scope:** {What was audited}
**Codebase Version:** {Git commit/tag}
---
## Executive Summary
**Overall Rating:** 🟢 Good | 🟡 Fair | 🔴 Poor
Brief summary of findings and overall assessment.
---
## Critical Issues 🔴
Issues that must be fixed immediately (security vulnerabilities, data loss risks).
### Issue 1: {Title}
**Severity:** Critical
**Location:** `file.ts:123`
**Category:** Security
**Description:**
Detailed description of the issue.
**Impact:**
What could happen if not fixed.
**Code:**
```typescript
// Current problematic code
const issue = currentCode();
Recommendation:
// Suggested fix
const fixed = betterCode();
Priority: Fix immediately before production deployment
Issues that should be addressed soon.
...
Issues that should be addressed but not blocking.
Nice-to-have improvements.
Things done well that should be maintained.
Files Audited: X Lines of Code: Y Issues Found: Z
By Severity:
By Category:
Final assessment and next steps.
Next Audit: {Recommended date}
## Platform-Specific Audit Points
### Backend (Go)
✅ **Check:**
- [ ] Goroutine leaks (use `runtime.NumGoroutine()`)
- [ ] Race conditions (`go test -race`)
- [ ] Proper use of context.Context
- [ ] Error wrapping with `%w`
- [ ] defer used for cleanup
- [ ] No panics in production code (use errors)
- [ ] Structured logging
**Tools:**
```bash
# Race detection
go test -race ./...
# Vet (static analysis)
go vet ./...
# Lint
golangci-lint run
# Security scan
gosec ./...
# Dependencies scan
go list -json -m all | nancy sleuth
✅ Check:
Tools:
# Lint
npm run lint
# Type check
tsc --noEmit
# Security audit
npm audit
# Bundle analyzer
npm run analyze
✅ Check:
Tools:
# Static analysis
xcodebuild analyze -scheme BarqNet
# Instruments (memory leaks)
instruments -t Leaks
# SwiftLint
swiftlint
✅ Check:
Tools:
# Lint
./gradlew lint
# Security scan
./gradlew dependencyCheckAnalyze
# Static analysis
./gradlew detekt
# LeakCanary (runtime)
# Add to build.gradle dependencies
// ❌ Vulnerable
query := fmt.Sprintf("SELECT * FROM users WHERE id=%s", userInput)
// ✅ Fixed
query := "SELECT * FROM users WHERE id=$1"
db.Query(query, userInput)
// ❌ Vulnerable
element.innerHTML = userInput;
// ✅ Fixed
element.textContent = userInput;
// ❌ Vulnerable
const jwtSecret = "hardcoded-secret-123"
// ✅ Fixed
jwtSecret := os.Getenv("JWT_SECRET")
// ❌ Vulnerable
const hash = crypto.createHash('md5').update(password).digest('hex');
// ✅ Fixed
const hash = await bcrypt.hash(password, 12);
// ❌ Vulnerable
const data = JSON.parse(userInput);
// ✅ Fixed
const data = JSON.parse(userInput);
validateSchema(data); // Validate before use
#!/bin/bash
# audit.sh - Run all audit tools
echo "🔍 Running BarqNet Audit..."
# Backend
echo "📦 Auditing Backend (Go)..."
cd /Users/hassanalsahli/Desktop/go-hello-main
go vet ./...
golangci-lint run
gosec ./...
# Desktop
echo "🖥️ Auditing Desktop (TypeScript)..."
cd /Users/hassanalsahli/Desktop/ChameleonVpn/barqnet-desktop
npm audit
npm run lint
tsc --noEmit
# iOS
echo "📱 Auditing iOS (Swift)..."
cd /Users/hassanalsahli/Desktop/ChameleonVpn/BarqNet
swiftlint
# Android
echo "🤖 Auditing Android (Kotlin)..."
cd /Users/hassanalsahli/Desktop/ChameleonVpn/BarqNetApp
./gradlew lint
./gradlew detekt
echo "✅ Audit complete! Check reports in ./audit-reports/"
✅ Use this skill when:
❌ Don't use this skill for:
An audit is complete when:
Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...
Comprehensive guides and best practices for Neon Serverless Postgres, covering setup, connection methods, authentication, and platform APIs.
Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.
A skill to evaluate how secure Firestore security rules are. Use this when Firestore security rules are updated to ensure that the generated rules are extremely secure and robust.
Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.
Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.
Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".
Complete Cloudflare platform integration with decision trees for compute, storage, AI, networking, security, and infrastructure-as-code.
Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.
Send, read, and manage Gmail messages, drafts, labels, and account settings.
Comprehensive website auditing across 230+ rules in 21 categories including SEO, performance, security, and accessibility.
Shared authentication, CLI syntax, and output formatting patterns for gws Google Workspace commands.
Discover your celebrity doppelgänger with StarByFace!
GeoSpy: Pricing, Features, FAQs, and Alternatives for AI Teams
Detect AI-generated voices to protect against audio fraud.
Ensure Your Content's Originality with AI Plagiarism Checker
Upscale images by 400% without quality loss
Protect your social media from copyright disputes
Accurately Detect AI-Generated Content with TheChecker.AI
Chrome extension that detects and flags AI-generated content