by Varietyz
A disciplined methodology for AI-assisted software development. Covers architectural constraints, validation hooks, session governance, and PAG (Pattern Abstract Grammar) for structured AI collaboration. Copy claude-setup/ into your project to start.
# Add to your Claude Code skills
git clone https://github.com/Varietyz/Disciplined-AI-Software-DevelopmentDisciplined AI Software Development Methodology © 2025 by Jay Baleine is licensed under CC BY-SA 4.0
📘 Using CLI-based AI models? (Claude Code, Cursor, Windsurf, etc.)
This documentation covers web browser AI collaboration. For CLI agents with tool access, PAG (Pattern Abstract Grammar) is an AI first language with explicit validation gates, phase sequencing, and constraint enforcement designed for agentic workflows.
PAG expands on this methodology with formal grammar, tool invocation patterns, orchestration templates, and algorithm loop documentation. Visit banes-lab.com/pag for the complete specification.
PAG Documents: PAG-COLLABORATION.md | PAG-AGENT-ORCHESTRATION.md
A structured approach for working with AI on development projects. This methodology addresses common issues like code bloat, architectural drift, context dilution, and behavioral inconsistency through systematic constraints and behavioral enforcement.
AI systems work on Question → Answer patterns. When you ask for broad, multi-faceted implementations, you typically get:
The methodology uses four stages with systematic constraints, behavioral consistency enforcement, and validation checkpoints. Each stage builds on empirical data rather than assumptions.
No comments yet. Be the first to share your thoughts!
Planning saves debugging time. Planning thoroughly upfront typically prevents days of fixing architectural issues later.
This methodology supports multiple instruction formats:
READ, WRITE, SET, VALIDATE). Reduces interpretive ambiguity through code-like patterns. Effective for CLI-based AI agents or when explicit constraints matter.The principles remain identical; choose the format that matches your AI interface.
Deploy systematic behavioral consistency and constraint enforcement:
Configure AI Custom Instructions:
Set up AI-PREFERENCES.XML as custom instructions. This establishes behavioral constraints and uncertainty flagging with ⚠️ indicators when the AI lacks certainty.
RECOMMENDED: Load Persona Framework:
Upload CORE-PERSONA-FRAMEWORK.json and select domain-appropriate persona:
RECOMMENDED: Activate Persona:
Issue command: "Simulate Persona"
Share METHODOLOGY.XML with the AI to structure your project plan. Work together to:
Output: A development plan following dependency chains with modular boundaries.
PAG Alternative: For explicit structure, express your plan using PAG phases with validation gates:
# PHASE 1: Core Implementation
## PURPOSE
Implement primary application logic.
## DEPENDENCIES
Phase 0 infrastructure complete.
## VALIDATION GATE
✅ All core functions implemented
✅ Unit tests passing
✅ Benchmarks integrated
Work phase by phase, section by section. Each request follows: "Can you implement [specific component]?" with focused objectives.
File size stays ≤150 lines. This constraint provides:
Implementation flow:
Request (prose or PAG) → AI processes → Validate → Benchmark → Continue
The benchmarking suite (built first) provides performance data throughout development. Feed this data back to the AI for optimization decisions based on measurements rather than guesswork.
Decision Processing: AI handles "Can you do A?" more reliably than "Can you do A, B, C, D, E, F, G, H?"
Context Management: Small files and bounded problems prevent the AI from juggling multiple concerns simultaneously.
Behavioral Constraint Enforcement: Persona system prevents AI drift through systematic character validation, maintaining consistent collaboration patterns across extended sessions.
Empirical Validation: Performance data replaces subjective assessment. Decisions come from measurable outcomes.
Systematic Constraints: Architectural checkpoints, file size limits, and dependency gates force consistent behavior.
Structured Instruction Clarity: By reducing interpretive ambiguity. ALWAYS: Keep files under 150 lines is less ambiguous than "try to keep files small."
Discord Bot Template - Production-ready bot foundation with plugin architecture, security, API management, and comprehensive testing. 46 files, all under 150 lines, with benchmarking suite and automated compliance checking. (View Project Structure)
PhiCode Runtime - Programming language runtime engine with transpilation, caching, security validation, and Rust acceleration. Complex system maintaining architectural discipline across 70+ modules. (View Project Structure)
PhiPipe - CI/CD regression detection system with statistical analysis, GitHub integration, and concurrent processing. Go-based service handling performance baselines and automated regression alerts. (View Project Structure)
You can compare the methodology principles to the codebase structure to see how the approach translates to working code.
Each format emphasizes different domains:
| Format | Best For | Characteristics |
|--------|----------|-----------------|
| Markdown (.md) | Documentation, web browser AI | Human-readable, AI continues structure naturally |
| XML (.xml) | Machine parsing, structured prompts | Explicit tags, code-like structure |
| JSON (.json) | Configuration, programmatic access | Strict syntax, data exchange |
| PAG | CLI agents, explicit constraints | Validation gates, ALWAYS/NEVER rules |
XML and JSON provide code-like structure that tends to strengthen code generation while reducing unnecessary jargon. Markdown works well for documentation as AI recognizes and continues the structure naturally.
PAG is particularly effective when you need explicit validation gates and constraint enforcement. See PAG Documentation for full language reference.
Use the included project extraction tool systematically to generate structured snapshots of your codebase:
python scripts/pr