Skip to content

ParkerRex/tec-claude-code-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

VAI Prompts - Multi-Agent Development System

AI agents that build features and fix bugs for you. Handles the tedious stuff from requirements to PRs so you can focus on the interesting problems.

Join our Discord


What This Does

Two workflows:

  • ๐ŸŽจ Feature Development - Spec โ†’ Plan โ†’ Code โ†’ Tests โ†’ PR (all automated)
  • ๐Ÿ› Bug Resolution - RCA โ†’ Solution โ†’ Fix โ†’ Tests โ†’ PR (with actual investigation)

Key stuff:

  • Stack analysis caches so you're not burning tokens analyzing the same codebase repeatedly
  • Adaptive clarification (asks 3-12 questions depending on complexity, or uses defaults)
  • UI validation loop (vision model grades your UI and auto-fixes it until it doesn't look like shit)
  • Quality gates (linting, tests, builds, accessibility)
  • Resumable (interrupt anywhere, pick up later)
  • Human-in-loop or full auto mode (your choice)

๐ŸŽจ Feature Development Workflow

Type one command, get a production-ready feature. Reviews at each step if you want, or let it run.

One Command

# Manual mode - you review and approve each phase
/feature-start "Add user authentication with OAuth providers" user-auth

# Auto mode - fully automated from idea to PR
/feature-start "Add real-time notifications" notifications --auto

What Happens (8 Phases)

Phase 1: Initialization ๐ŸŽฏ

Agent: feat-orchestrator

  • Creates workspace: .agents/features/user-auth/
  • Loads config from .claude/feat-config.json
  • Initializes state tracking for resumability
  • Determines feature type (frontend/backend/full-stack)

Output: Feature workspace ready, workflow configured


Phase 2: Stack Analysis ๐Ÿ”

Agent: feat-stack-analyzer

Analyzes your codebase once, caches everything:

  • Scans package.json, lock files, tsconfig.json
  • Analyzes directory structure and file organization
  • Samples actual code files to extract patterns
  • Identifies: Framework (Next.js 14), UI library (React + Tailwind), Database (Convex), Auth (Clerk)
  • Documents: Component patterns, naming conventions, error handling, import aliases
  • Generates recommendations: "When adding components, place in components/features/{name}/"

Result: Complete stack profile saved to .agents/stack-profile.json

This runs once. Every feature after uses the cache. Saves 80% of tokens.

Intervention: None (cached on subsequent runs)


Phase 3: Clarification ๐Ÿ’ฌ

Agent: feat-clarification

Asks questions based on complexity:

Simple CRUD (3-5 questions):

1. Primary user flow in 2-3 sentences?
2. Main success outcome?
3. Critical edge cases to handle?

Complex Feature (9-12 questions):

1. Describe the complete user journey
2. Which user roles interact with this?
3. Real-time updates needed?
4. Integration with existing features?
5. Scale expectations (users/requests)?
6. Data privacy considerations?
7. Mobile-first or desktop-first?
8. Accessibility requirements (WCAG)?
9. Performance budget?
10. Third-party services needed?

Questions adapt to feature type. Skips obvious stuff by using the stack profile. Auto mode uses defaults.

Output: .agents/features/user-auth/user-auth-clarifications.md

Intervention Point: Review answers, modify if needed


Phase 4: Technical Specification ๐Ÿ“‹

Agent: feat-spec

Generates a complete PRD with:

  • Executive Summary: Business value, technical approach
  • Problem Statement: Current limitations, user pain points
  • Goals & Objectives: SMART objectives with KPIs
  • User Stories: Complete with acceptance criteria
    US-001: As an unauthenticated user, I want to sign in with Google
    - Priority: High
    - Acceptance Criteria:
      โœ“ OAuth flow completes in <5s
      โœ“ Session persists across page reloads
      โœ“ Error states handled gracefully
    
  • Technical Requirements: Uses your actual stack from profile
    • "Framework: Next.js 14.2 with App Router"
    • "Auth: Clerk (already in stack)"
    • "Database: Convex with existing schema patterns"
  • System Architecture: Component diagrams, data flow
  • API Specifications: Full endpoint definitions with Zod schemas
  • Security Requirements: Authentication, authorization, encryption
  • Data Models: Complete schema with relationships
  • Testing Strategy: Unit, integration, E2E coverage
  • Success Metrics: Measurable KPIs

Not generic. Uses your actual stack and patterns from the profile.

Output: .agents/features/user-auth/user-auth-tech-spec.md

Intervention Point: Review spec, request changes


Phase 5: Implementation Planning ๐Ÿ“

Agent: feat-plan

Breaks spec into atomic tasks:

### Phase 1: Foundation
- [ ] TASK-001: Create Convex schema for User entity
  - Details: Add to convex/schema.ts following existing patterns
  - Acceptance: Schema compiles, migrations run
  - Dependencies: None

- [ ] TASK-002: Create TypeScript types for auth
  - Details: Define in types/auth.ts with Zod schemas
  - Acceptance: Types exported, importable
  - Dependencies: TASK-001

### Phase 2: Backend
- [ ] TASK-003: Implement OAuth callback handler
  - Details: Create app/api/auth/callback/route.ts using Clerk
  - Acceptance: Callback handles Google/GitHub, creates user
  - Dependencies: TASK-001, TASK-002

### Phase 3: Frontend
- [ ] TASK-010: Build SignIn component
  - Details: Use shadcn/ui Button, integrate Clerk SignIn
  - Acceptance: Renders, handles OAuth flow, error states
  - Dependencies: TASK-003

### Phase 4: Testing
- [ ] TASK-020: Unit tests for auth helpers
- [ ] TASK-021: E2E test for complete OAuth flow

Each task: 1-4 hours, references actual files, maps to spec requirements, tracks dependencies.

Output: .agents/features/user-auth/user-auth-plan.md

Intervention Point: Adjust tasks, priorities, estimates


Phase 6: Implementation ๐Ÿ”ง

Agent: feat-implement

Executes tasks one by one:

๐Ÿš€ Starting TASK-001: Create Convex schema for User entity

Reading existing schema patterns from convex/schema.ts...
Creating User table with fields: id, email, name, avatar, provider...
Adding indexes on email and provider...
Running schema validation...

โœ… TASK-001 completed (12:34:56)

๐Ÿš€ Starting TASK-002: Create TypeScript types...

Respects dependencies. Tests after each task. Manual mode asks after each, auto mode runs 10 at a time.

Output:

  • Files modified: 12
  • Files created: 8
  • Lines added: 1,247
  • Updated plan with checkmarks: [x] TASK-001 [COMPLETED: 2025-09-30 14:23:45]

Intervention Point: Review code changes, continue or adjust


Phase 7: Validation โœ…

Agent: feat-validate

Runs quality checks:

Gate 1: Linting & Formatting

Running: biome check --apply
โœ… Pass (2.3s) - 3 auto-fixes applied

Gate 2: Type Checking

Running: tsc --noEmit
โœ… Pass (5.1s) - No errors

Gate 3: Tests

Running: bun test
โœ… Pass (12.7s) - 42/42 tests, 85% coverage

Gate 4: Build

Running: bun run build
โœ… Pass (45.2s) - Build successful

Gate 5: UI Validation (Frontend features only)

Vision model grades your UI and fixes it:

๐Ÿ“ธ Capturing screenshots...
โœ… Desktop (1920x1080)
โœ… Tablet (768x1024)
โœ… Mobile (375x667)

๐ŸŽจ Iteration 1/3: Analyzing UI quality with vision model...
   Score: 5/10
   Issues Found:
   - Button alignment inconsistent
   - Text contrast too low (WCAG fail)
   - Spacing not using design tokens

   ๐Ÿ”ง Applying fixes...
   - Adjusted flex alignment
   - Increased text color contrast
   - Applied consistent gap-4 spacing

๐ŸŽจ Iteration 2/3: Re-analyzing...
   Score: 6/10
   Issues Found:
   - Minor spacing inconsistency in mobile view

   ๐Ÿ”ง Applying fixes...

๐ŸŽจ Iteration 3/3: Final validation...
   Score: 8/10 โœจ
   โœ… Meets quality threshold (โ‰ฅ7)

Grades 1-10, auto-fixes issues, iterates up to 3x until it's โ‰ฅ7. Prevents shipping ugly UIs.

Gate 6: Accessibility

Running: axe-core accessibility tests
โœ… Pass - WCAG AA compliant
   โœ“ Keyboard navigation
   โœ“ Screen reader compatible
   โœ“ Color contrast (4.5:1 minimum)
   โœ“ Focus management
   โœ“ ARIA labels correct

Output: .agents/features/user-auth/validation/

  • validation-report.md - Complete results
  • screenshots/ - Before/after images
  • ui-grade.json - Scoring history
  • accessibility-report.json - WCAG compliance

Intervention Point: Review validation results, fix any remaining issues


Phase 8: Finalization ๐Ÿš€

Agent: feat-finish

Ship it!

Step 1: Git Commit

Staging 20 changed files...
Creating commit with message:
  "feat(auth): Add OAuth authentication with Google and GitHub

  - Implemented OAuth callback handlers
  - Created user session management
  - Added protected route middleware
  - Built sign-in UI with Clerk integration

  Generated by feature workflow
  See: .agents/features/user-auth/"

โœ… Commit created: abc123f

Step 2: CHANGELOG Update

## [Unreleased] - 2025-09-30

### Added
- **User Authentication**: OAuth-based authentication system
  - Google and GitHub sign-in support
  - Session management with 7-day expiry
  - Protected route middleware
  - Responsive sign-in UI

Step 3: Pull Request

Creating PR: feat(auth): Add OAuth authentication

Title: feat(auth): Add OAuth authentication with Google and GitHub

Body:
## Summary
Implements complete OAuth authentication system with Google and GitHub providers.

## Changes
- โœ… OAuth callback handlers (Clerk integration)
- โœ… User session management
- โœ… Protected route middleware
- โœ… Sign-in UI components
- โœ… Comprehensive test coverage (42 tests)

## Testing
- TypeScript: โœ… Pass
- Tests: โœ… Pass (42/42, 85% coverage)
- Linting: โœ… Pass
- Build: โœ… Pass
- UI Quality: โœ… 8/10
- Accessibility: โœ… WCAG AA

## Validation
See: .agents/features/user-auth/validation/validation-report.md

## Tasks Completed
All 28 tasks from implementation plan completed.
See: .agents/features/user-auth/user-auth-plan.md

โœ… PR created: #142

Step 4: Archive

Moving feature docs to shipped archive...
.agents/features/user-auth/ โ†’ .agents/features/shipped/user-auth-20250930/

โœ… Feature archived

Final Output:

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
๐ŸŽ‰ Feature Complete: user-auth
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐Ÿ“Š Summary:
   Mode: Manual
   Duration: 4h 23m
   Tasks: 28/28 โœ…
   Files: 20 changed (+1,247 lines)
   Tests: 42 passing (85% coverage)

๐Ÿ“‹ Deliverables:
   โœ… Tech Spec (comprehensive PRD)
   โœ… Implementation Plan (28 atomic tasks)
   โœ… Code Implementation (production-ready)
   โœ… Tests & Validation (all gates passed)
   โœ… Documentation (PR, changelog, archives)

๐Ÿ”— Pull Request: #142
   https://github.com/user/repo/pull/142

๐Ÿ“ฆ Archived:
   .agents/features/shipped/user-auth-20250930/

๐Ÿ‘ Merge when ready! Feature is production-ready.
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

Feature Workflow: Key Innovations

1. Stack Profile Caching

  • Analyze project once, cache forever
  • 80% reduction in analysis time
  • Consistent recommendations across all features
  • Sub-agents inherit full project context

2. Adaptive Clarification

  • Simple CRUD: 3-5 questions
  • Complex features: 9-12 questions
  • Auto mode uses intelligent defaults
  • Learns from existing similar features

3. UI Validation Loop

  • Vision model scores design quality (1-10)
  • Auto-fixes design issues iteratively
  • Up to 3 improvement cycles
  • Ensures professional-looking UIs

4. Resumable State

  • Interrupt at any phase
  • Resume with /feat-resume user-auth
  • All progress saved to status.json
  • Pick up exactly where you left off

5. Intervention Points

  • Configure review points in feat-config.json
  • Manual mode: review each phase
  • Auto mode: runs end-to-end
  • Hybrid: custom intervention mix

๐Ÿ› Bug Resolution Workflow

Stop wasting hours debugging. Let AI investigate, design the fix, implement it, and ship it - all with a single command.

The Power: One Command, Complete Fix

# Manual mode - review RCA and solution before implementing
/bug-start "Users getting logged out after 5 minutes" auth-token-expiry

# Auto mode - from incident to PR without intervention
/bug-start "Payment fails during high load" payment-race --auto

What Actually Happens (The 4-Phase Investigation)

Phase 1: Root Cause Analysis ๐Ÿ”

Agent: bug-rca

Systematic incident investigation:

Step 1: Information Gathering

๐Ÿ“‹ Analyzing Problem Report
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Problem: Users getting logged out after 5 minutes
Severity: High (affects all users)

๐Ÿ” Gathering Evidence
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Searching codebase for:
- Authentication code (lib/auth/, middleware/)
- Session management (session, token, expiry)
- Recent changes (git log --since="1 week ago")

Step 2: Investigation

๐Ÿ“‚ Found Relevant Code
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
lib/auth/session.ts
  - createSession() sets maxAge: 5 * 60 * 1000 โŒ
  - Expected: 7 days (604800000)
  - Actual: 5 minutes (300000)

middleware.ts
  - Uses session.maxAge for validation
  - No refresh logic present

git blame lib/auth/session.ts
  - Changed in commit abc123f (2 days ago)
  - PR #138: "Quick fix for session timeout"
  - INCORRECT: Developer used 5 minutes instead of 5 days

Step 3: Timeline Reconstruction

๐Ÿ• Timeline of Events
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
T-2 days: PR #138 merged with incorrect session timeout
T-2 days: Deployed to production
T-1 day:  First user complaints start
T-now:    Affecting all authenticated users

Step 4: Impact Analysis

๐Ÿ’ฅ Impact Assessment
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Severity: HIGH
Affected Users: 100% of authenticated users
User Experience: Forced re-login every 5 minutes
Data Loss: No (sessions cleanly expired)
Security Risk: None
Business Impact: High user frustration, support tickets

Step 5: Root Cause Identification

๐ŸŽฏ Root Cause
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
PRIMARY: Incorrect session maxAge value in lib/auth/session.ts
  - Line 42: maxAge: 5 * 60 * 1000 (5 minutes)
  - Should be: 7 * 24 * 60 * 60 * 1000 (7 days)

CONTRIBUTING FACTORS:
  - No unit test for session duration
  - PR review missed the error
  - No staging validation before production deploy

Output: .agents/debugging/auth-token-expiry/auth-token-expiry-rca.md

# Root Cause Analysis: auth-token-expiry

## Executive Summary
Users are being logged out every 5 minutes due to incorrect session
maxAge value in authentication code. Simple fix: change 5 minutes to 7 days.

## Problem Statement
**Reported**: 2025-09-30 14:00
**Impact**: 100% of authenticated users
**Severity**: HIGH

Users report being forced to re-authenticate every 5 minutes during
normal application usage, severely impacting user experience.

## Investigation

### Code Analysis
**File**: lib/auth/session.ts
**Line**: 42
**Issue**: maxAge set to 5 * 60 * 1000 (5 minutes)
**Expected**: 7 * 24 * 60 * 60 * 1000 (7 days)

### Timeline
- **2025-09-28**: PR #138 merged with incorrect timeout value
- **2025-09-29**: First user complaints received
- **2025-09-30**: Issue escalated to engineering

### Evidence
git blame shows commit abc123f changed session duration
PR review comments show no discussion of timeout value
No test coverage for session expiration logic

## Root Cause

**PRIMARY CAUSE**: Developer error in PR #138
- Intended to set 5 days, wrote 5 minutes
- Calculation error: 5 * 60 * 1000 instead of 5 * 24 * 60 * 60 * 1000

**CONTRIBUTING FACTORS**:
1. Missing unit test for session duration constant
2. PR review did not catch calculation error
3. No automated validation of session timeout ranges
4. No staging environment testing before production

## Impact

**User Impact**: HIGH
- All authenticated users affected
- Forced re-login every 5 minutes
- Interrupts workflow, causes frustration

**Business Impact**: MEDIUM
- Increased support ticket volume (50+ tickets)
- User complaints on social media
- No data loss or security breach

**Technical Impact**: LOW
- Isolated to session management
- No database issues
- No cascade failures

## Recommendations

**Immediate Fix** (Priority: CRITICAL):
1. Change maxAge to 7 * 24 * 60 * 60 * 1000
2. Deploy hotfix within 1 hour
3. Monitor user session stability

**Short-term** (Priority: HIGH):
1. Add unit test for session duration
2. Add validation: if (maxAge < 1 hour || maxAge > 30 days) throw
3. Code review checklist: verify time calculations

**Long-term** (Priority: MEDIUM):
1. Implement staging environment validation
2. Add session duration monitoring/alerting
3. Consider using time constants library (ms, timestring)

Intervention Point: Review RCA, confirm root cause before proceeding


Phase 2: Solution Architecture ๐Ÿ“

Agent: bug-solution

Comprehensive fix design:

Step 1: Solution Strategy

๐ŸŽฏ Solution Design
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Primary Fix: Correct session maxAge calculation
Secondary: Add safeguards to prevent recurrence

Risk Level: LOW (simple constant change)
Rollback Plan: Revert single commit

Step 2: Technical Design

๐Ÿ”ง Implementation Plan
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

Change 1: lib/auth/session.ts (Line 42)
  Before: maxAge: 5 * 60 * 1000
  After:  maxAge: 7 * 24 * 60 * 60 * 1000  // 7 days in milliseconds

Change 2: Add time constants (NEW FILE: lib/constants/time.ts)
  export const TIME = {
    FIVE_MINUTES: 5 * 60 * 1000,
    ONE_HOUR: 60 * 60 * 1000,
    ONE_DAY: 24 * 60 * 60 * 1000,
    SEVEN_DAYS: 7 * 24 * 60 * 60 * 1000,
  }

Change 3: Update session.ts to use constant
  import { TIME } from '@/lib/constants/time'
  maxAge: TIME.SEVEN_DAYS

Change 4: Add validation
  if (maxAge < TIME.ONE_HOUR) {
    throw new Error('Session timeout too short')
  }

Change 5: Add unit test (NEW FILE: lib/auth/session.test.ts)
  describe('Session Duration', () => {
    it('should set session to 7 days', () => {
      const session = createSession(user)
      expect(session.maxAge).toBe(7 * 24 * 60 * 60 * 1000)
    })

    it('should reject sessions < 1 hour', () => {
      expect(() => createSession(user, { maxAge: 30000 }))
        .toThrow('Session timeout too short')
    })
  })

Step 3: Testing Strategy

๐Ÿงช Testing Plan
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Unit Tests:
  โœ“ Session duration is 7 days
  โœ“ Validation rejects < 1 hour
  โœ“ Validation rejects > 30 days

Manual Testing:
  1. Create session, verify cookie maxAge
  2. Wait 6 minutes, verify still logged in
  3. Check session expiration after 7 days

Production Validation:
  1. Deploy to staging
  2. Monitor session metrics for 1 hour
  3. Deploy to production
  4. Monitor user session stability

Output: .agents/debugging/auth-token-expiry/auth-token-expiry-solution.md

Intervention Point: Review solution design, approve approach


Phase 3: Implementation ๐Ÿ”ง

Agent: bug-implement

Systematic fix execution:

๐Ÿš€ Implementing Fix: auth-token-expiry
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐Ÿ“ Task 1: Create time constants
   Creating: lib/constants/time.ts
   โœ… Constants defined and exported

๐Ÿ“ Task 2: Fix session maxAge
   Editing: lib/auth/session.ts
   - Changed: maxAge: TIME.SEVEN_DAYS
   - Added: import statement
   - Added: validation logic
   โœ… Session timeout corrected

๐Ÿ“ Task 3: Add unit tests
   Creating: lib/auth/session.test.ts
   - Test: session duration is 7 days
   - Test: validation rejects short durations
   โœ… Tests written (2 tests)

๐Ÿ“ Task 4: Run tests
   Running: bun test lib/auth/session.test.ts
   โœ… All tests passing (2/2)

๐Ÿ“ Task 5: Verify no regressions
   Running: bun test
   โœ… All tests passing (44/44)

๐Ÿ“ Task 6: Build verification
   Running: bun run build
   โœ… Build successful

Files Changed:

  • lib/auth/session.ts (modified)
  • lib/constants/time.ts (created)
  • lib/auth/session.test.ts (created)

Output: Implementation complete with tests

Intervention Point: Review code changes, run manual tests


Phase 4: Finalization & Ship ๐Ÿš€

Agent: bug-orchestrator (with shared-pr-description, shared-changelog)

Git workflow:

๐Ÿ”€ Git Workflow
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

Creating branch: fix/auth-token-expiry
Staging changes: 3 files
Creating commit:

  "fix(auth): Correct session timeout from 5 minutes to 7 days

  Root cause: Developer error in PR #138 set maxAge to 5 minutes
  instead of 7 days due to calculation error (5 * 60 * 1000).

  Changes:
  - Corrected session maxAge to 7 days (604800000ms)
  - Added time constants to prevent future calculation errors
  - Added validation to reject session timeouts < 1 hour
  - Added unit tests for session duration and validation

  Testing:
  - Unit tests: 44/44 passing
  - Manual testing: Session persists beyond 5 minutes
  - Build: Successful

  Impact: Resolves immediate issue affecting 100% of users
  Prevention: Time constants and validation prevent recurrence

  Related: .agents/debugging/auth-token-expiry/"

โœ… Committed: abc123f

CHANGELOG Update:

## [Unreleased] - 2025-09-30

### Fixed
- **Session Timeout**: Corrected authentication session timeout from
  5 minutes to 7 days. Users will no longer be unexpectedly logged out.
  - Added time constants to prevent calculation errors
  - Added validation for session duration ranges
  - Added comprehensive unit tests

Pull Request:

๐ŸŽฏ Creating Pull Request
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

Title: fix(auth): Correct session timeout from 5 minutes to 7 days

Body:
## ๐Ÿ› Bug Fix: Session Timeout Issue

### Problem
Users were being logged out every 5 minutes due to incorrect session
maxAge value in `lib/auth/session.ts`.

### Root Cause
Developer error in PR #138: Set timeout to 5 * 60 * 1000 (5 minutes)
instead of 7 * 24 * 60 * 60 * 1000 (7 days).

See: .agents/debugging/auth-token-expiry/auth-token-expiry-rca.md

### Solution
1. โœ… Corrected session maxAge to 7 days
2. โœ… Created time constants library to prevent future errors
3. โœ… Added validation (rejects < 1 hour, > 30 days)
4. โœ… Added comprehensive unit tests

See: .agents/debugging/auth-token-expiry/auth-token-expiry-solution.md

### Changes
- `lib/auth/session.ts` - Corrected maxAge, added validation
- `lib/constants/time.ts` - NEW: Time duration constants
- `lib/auth/session.test.ts` - NEW: Unit tests

### Testing
- โœ… Unit tests: 44/44 passing (2 new tests)
- โœ… Manual: Session persists > 5 minutes
- โœ… Build: Successful
- โœ… Linting: Clean

### Impact
- **Users**: Immediate resolution, no more forced logouts
- **Prevention**: Constants + validation prevent recurrence
- **Risk**: LOW (simple constant change, well-tested)

### Rollback Plan
Revert commit abc123f if any issues observed

Labels: bug, high-priority, hotfix
Reviewers: @tech-lead

โœ… PR Created: #143
https://github.com/user/repo/pull/143

Final Output:

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
๐ŸŽ‰ Bug Fix Complete: auth-token-expiry
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐Ÿ“Š Summary:
   Mode: Manual
   Duration: 45 minutes
   Files Changed: 3 (2 new, 1 modified)
   Tests: +2 new tests (44/44 passing)

๐Ÿ“‹ Deliverables:
   โœ… Root Cause Analysis (comprehensive investigation)
   โœ… Solution Architecture (detailed fix design)
   โœ… Implementation (code + tests)
   โœ… Validation (all checks passed)
   โœ… Documentation (PR + changelog)

๐Ÿ”— Pull Request: #143
   https://github.com/user/repo/pull/143

๐Ÿš€ Ready to Merge
   - Priority: HIGH (hotfix)
   - Risk: LOW (well-tested)
   - Impact: Immediate resolution for all users

๐Ÿ“ฆ Artifacts Archived:
   .agents/debugging/auth-token-expiry/
   - RCA document
   - Solution architecture
   - Implementation plan

๐Ÿ‘ Merge ASAP to restore normal user experience!
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

Bug Workflow: Key Innovations

1. Systematic Investigation

  • Searches codebase for relevant code
  • Analyzes git history for recent changes
  • Reconstructs timeline of events
  • Identifies primary and contributing factors

2. Evidence-Based RCA

  • Not guesswork - actual file analysis
  • git blame for change attribution
  • Impact assessment (users, business, technical)
  • Clear recommendations (immediate, short-term, long-term)

3. Comprehensive Solutions

  • Not just fix the symptom - prevent recurrence
  • Adds validation, constants, tests
  • Considers rollback plans
  • Risk assessment

4. Validated Implementation

  • Tests added for the specific bug
  • Full regression testing
  • Build verification
  • Manual testing checklist

5. Complete Documentation

  • RCA explains what happened and why
  • Solution documents the approach
  • PR has full context for reviewers
  • Changelog updated for users

๐ŸŽฏ Why This Changes Everything

Traditional Development

Developer writes feature spec (2 hours)
โ†’ Manual planning (1 hour)
โ†’ Coding (8 hours)
โ†’ Oh shit, forgot tests (2 hours)
โ†’ Manual linting/formatting (30 min)
โ†’ Fix failing tests (1 hour)
โ†’ Write PR description (15 min)
โ†’ Update changelog (10 min)
โ†’ Realize UI looks bad, fix design (2 hours)
โ†’ Submit for review

Total: ~17 hours
Quality: Inconsistent
Documentation: Rushed

With Agent System

/feature-start "description" identifier --auto

Total: ~2 hours (mostly AI working)
Quality: Validated at every step
Documentation: Comprehensive, auto-generated

Time Saved: 85% reduction Quality Gained: 10x improvement Consistency: 100% across all features

Traditional Bug Fixing

Developer investigates (2 hours)
โ†’ Finds potential cause (maybe)
โ†’ Implements fix without full context (1 hour)
โ†’ Submits PR with vague description
โ†’ Reviewer asks "but what was the root cause?"
โ†’ Developer goes back to investigate more
โ†’ Eventually ships fix

Total: ~4 hours
Quality: Fix might miss edge cases
Documentation: Minimal

With Agent System

/bug-start "problem description" identifier

Total: ~45 minutes
Quality: Systematic RCA, comprehensive fix
Documentation: Complete audit trail

Time Saved: 80% reduction Quality Gained: RCA-driven, not guess-driven Prevention: Adds safeguards for recurrence


๐Ÿš€ Getting Started

Installation

  1. Clone this repo:
git clone https://github.com/yourusername/vai_prompts
cd vai_prompts
  1. Verify structure:
ls .claude/
# Should see: agents/, commands/, feat-config.json, bug-config.json
  1. Configure your workflows (optional):
# Edit feature workflow settings
code .claude/feat-config.json

# Edit bug workflow settings
code .claude/bug-config.json

First Feature (Recommended)

Start with something simple to see the magic:

/feature-start "Add an about page with company info" about-page --auto

Watch as it:

  • โœ… Analyzes your stack (cached for future use)
  • โœ… Uses smart defaults for clarification
  • โœ… Generates complete tech spec
  • โœ… Creates implementation plan
  • โœ… Implements the code
  • โœ… Validates with all quality gates
  • โœ… Creates PR with full documentation

Time: ~30 minutes (mostly AI working)

First Bug Fix

Try debugging a real issue:

/bug-start "Describe the problem you're seeing" descriptive-name

Follow the workflow:

  • โœ… Review RCA (comprehensive investigation)
  • โœ… Approve solution (detailed fix design)
  • โœ… Watch implementation (code + tests)
  • โœ… Validate fixes (all checks pass)
  • โœ… Ship PR (complete documentation)

Time: ~45 minutes (thorough investigation + fix)


๐Ÿ“š Documentation

๐ŸŽจ Prompts Collection

This repo also includes a curated collection of AI prompts for Claude Code. See prompts.png for visualization.

๐Ÿง  Enhanced with Thinking: Most prompts include advanced thinking capabilities. Enable by saying "think deeply" in your conversation.

๐Ÿค Contributing

This is open-source magic. Contribute:

  • New agent workflows
  • Improved validation gates
  • Better error handling
  • Documentation improvements

Place prompts in .claude/commands/ and agents in .claude/agents/.


๐Ÿ’ก What's Next?

We're just getting started. Planned improvements:

  • Visual regression testing (Percy/Chromatic integration)
  • Cost & performance budgets (track token usage, API costs)
  • Feature flag automation (auto-wrap features in flags)
  • Dependency impact analysis (detect affected features)
  • Learning feedback loops (improve from past implementations)
  • v0 integration (AI-generated UI components)
  • React Scan integration (detect unnecessary re-renders)

The future of software development is multi-agent orchestration. ๐Ÿคฎ

But ya, this is cool stuff. Multi-agent workflows that actually work. No hype, just automation that saves you hours while maintaining quality. Try it and see for yourself.

Now go build something. ๐Ÿš€

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors