Varietyz/Disciplined-AI-Software-Development — Prompts & Instructions
The methodology ships every instruction in multiple formats simultaneously:
| Format |
File |
Best for |
| Markdown |
AI-PREFERENCES.md, METHODOLOGY.md |
Web browser AI (ChatGPT, Claude web, Gemini) |
| XML |
AI-PREFERENCES.XML, METHODOLOGY.XML |
Machine-parseable; CLI agents (Claude Code, Cursor) |
| JSON |
prompt_formats/software_development/JSON/ |
Structured API payloads |
| PAG |
Inline within XML/Markdown |
Validation gates, constraint enforcement |
AI-PREFERENCES.md / AI-PREFERENCES.XML — custom instructions
Pasted as custom instructions before any session. Establishes behavioral constraints:
- File size limit: ≤ 150 lines (≤ 250 for web components)
- Separation of concerns: each module must have single responsibility
- Decision processing: focus on one objective at a time
- Context window management: small, bounded problems only
The XML version is designed for machine parsing — it wraps the same content in schema-structured tags for predictable extraction by CLI agents.
METHODOLOGY.XML — structured methodology prompt
Delivered during Stage 2 (Collaborative Planning). Contains the four-stage methodology in XML schema form. Purpose: reduce interpretive ambiguity by removing prose from constraint definitions.
Example constraint block structure:
<constraint id="file_size_limit">
<rule type="ALWAYS">Split files exceeding 150 lines INTO separate modules</rule>
<rule type="NEVER">Create monolithic files</rule>
<validation>VALIDATE module HAS single_responsibility</validation>
</constraint>
PAG (Pattern Abstract Grammar)
PAG is the methodology's proprietary instruction syntax. Keywords:
| Keyword |
Function |
ALWAYS |
Mandatory positive behavior |
NEVER |
Mandatory negative constraint |
VALIDATE |
Assertion that must pass before proceeding |
READ |
Information retrieval instruction |
WRITE |
Output generation instruction |
SET |
Variable assignment |
FOR EACH |
Iteration construct |
END FOR |
Loop termination |
INTO |
Decomposition directive |
HAS |
Property assertion |
Full PAG example from METHODOLOGY.md:
CONSTRAINT file_size_limit:
SET max_lines = 150
ALWAYS: Split files exceeding max_lines INTO separate_modules
NEVER: Create monolithic files
CONSTRAINT separation_of_concerns:
FOR EACH module IN codebase:
VALIDATE module HAS single_responsibility
VALIDATE module HAS clear_interfaces
END FOR
PAG for CLI agents (PAG-AGENT-ORCHESTRATION.md)
A version of the PAG methodology adapted for agentic/CLI workflows with tool access. The key difference from PAG-COLLABORATION.md:
- PAG-AGENT-ORCHESTRATION.md: designed for Claude Code, Cursor, Windsurf (agents that can read/write files directly)
- PAG-COLLABORATION.md: designed for collaborative web browser sessions (ChatGPT, Claude web)
The distinction reflects the methodology's multi-tool philosophy: same constraints, different delivery mechanisms.
Persona prompts
Five persona files, each a JSON object. Upload to session alongside AI-PREFERENCES and METHODOLOGY:
CORE-PERSONA-FRAMEWORK.json
Base framework. Loaded first. Establishes:
- Response style constraints
- Behavioral consistency enforcement
- Session governance rules
GUIDE-PERSONA.json
Methodology enforcement specialist. Prevents "vibe coding" — AI writing broad, unfocused implementations instead of bounded, single-responsibility modules. Active during Stage 3 (Implementation).
TECDOC-PERSONA.json
Technical documentation specialist. Ensures implementation is documented as it is written, not retroactively.
R&D-PERSONA.json
Research scientist with absolute code quality standards. Active during Stage 4 (Data-Driven Iteration). Focuses on benchmark analysis and quality metrics.
MURMATE-PERSONA.json
Visual systems specialist. Active for UI/UX-related components.
CREATE-PERSONA-PLUGIN.json
Template for creating project-specific personas. Not a persona itself — a schema definition for extending the base framework.
Prompt delivery for web browser vs CLI
The methodology explicitly distinguishes two delivery contexts:
Web browser (ChatGPT, Claude web, Gemini):
- Paste AI-PREFERENCES.md as custom instructions
- Upload CORE-PERSONA-FRAMEWORK.json + specific persona at session start
- Share METHODOLOGY.md when planning
- Use PAG-COLLABORATION.md for instruction syntax
CLI agents (Claude Code, Cursor, Windsurf):
- CLAUDE.md at project root with behavioral constraints
- METHODOLOGY.XML as machine-parseable input
- AI-PREFERENCES.XML as system-level constraints
- Use PAG-AGENT-ORCHESTRATION.md for instruction syntax
Context recovery prompt
scripts/project_extract.py generates a snapshot file (THE_PROJECT.md by default) formatted for sharing with AI sessions. The generated file includes:
- Structured module list with file paths
- Each module's content (up to configurable limits)
- Dependency graph (if INCLUDE_DEPS=True)
This is shared at the start of each new session to restore context without manually re-pasting code.