GritFlow
Guide

The PACT Framework

Prepare. Architect. Code. Test. A four-phase workflow that transforms chaotic AI development into repeatable success.

Why Structured AI Development?

Unstructured AI Development

  • • Jump straight to code → miss edge cases
  • • No research → reinvent the wheel
  • • Circular fixes → same bugs return
  • • No testing → ship broken code
  • • Lost context → repeat mistakes

With PACT Framework

  • • Research first → informed decisions
  • • Architecture plans → fewer rewrites
  • • Checklist-driven → predictable quality
  • • Built-in QA → confident shipping
  • • Session memory → compound learning
P

Prepare

Research before you build

Gather documentation, understand requirements, and build context before writing a single line of code.

Outputs

  • Research documentation
  • Competitive analysis
  • Technical requirements
  • Context bucket contents

Key Modules

  • context7-integration
  • session-memory
  • deep-investigation

Agent: grit-pact-preparer

A

Architect

Design before you implement

Create detailed architectural plans, identify edge cases, and define the implementation approach.

Outputs

  • Architecture diagrams
  • API contracts
  • Data models
  • Implementation plan

Key Modules

  • subtask-planning
  • verification-types
  • spec-critique

Agent: grit-pact-architect

C

Code

Build with confidence

Implement the architecture with specialized agents, pre-implementation checklists, and recovery tracking.

Outputs

  • Production-ready code
  • Unit tests
  • Documentation updates
  • Migration scripts

Key Modules

  • pre-implementation-checklist
  • self-critique
  • recovery-tracking

Agent: grit-pact-coder

T

Test

Validate before you ship

Comprehensive testing with the Test Companion, automated QA loops, and human validation.

Outputs

  • Test reports
  • Bug fixes
  • Performance metrics
  • Sign-off documentation

Key Modules

  • qa-fix-loop
  • playwright-decision-tree
  • validation-patterns

Agent: grit-pact-test-engineer

21 Reusable Prompt Modules

PACT's power comes from its modular architecture. Each module solves a specific problem and can be combined as needed.

ModulePhasePurpose
deep-investigationPrepareMandatory codebase analysis with parallel agents
context7-integrationAllLibrary documentation lookup for any technology
session-memoryAllPersist discoveries across sessions
subtask-planningArchitectBreak work into verifiable units
spec-critiqueArchitectExtended thinking validation before coding
pre-implementation-checklistCodePredictive bug prevention
self-critiqueCodeQuality gate before completion
recovery-trackingCodePrevent circular fixes across sessions
qa-fix-loopTest5-iteration structured fix cycle
validation-patternsTestAPI, Browser, Database verification

Session Memory: Learning That Persists

Unlike traditional AI workflows where context is lost, PACT maintains session memory that compounds your learning over time.

.gritflow/
├── patterns.md          # Discovered patterns (reused across sessions)
├── gotchas.md           # Known issues and pitfalls
├── codebase_map.json    # Project structure
├── attempt_history.json # What's been tried
└── session_insights/    # Per-session learnings
    ├── 2025-01-15.json
    ├── 2025-01-16.json
    └── 2025-01-17.json

Ready to PACT Your Next Feature?

Start with the getting started guide to install GritFlow, then run your first PACT workflow.

PACT Framework Guide - GritFlow | next-forge