pudo-code-system

Upvote PUDO on Forg 1st Place on Forg PUDO on Unikorn.vn PUDO Weekly Rank

PUDO Code System

A portable operating layer for reliable AI-assisted development.

CLI Install Test License: MIT Version 1.3.1 PRs Welcome AI Agnostic

🌍 Languages: English | TiαΊΏng Việt | PortuguΓͺs | EspaΓ±ol | Русский

Watch the PUDO Code System overview video
πŸŽ₯ Watch the overview video


Table of Contents


The Problem

You open your editor. You type a vague request to your AI assistant. It generates something. You paste it in. It half-works. You ask for a fix. It breaks something else. Repeat for 3 hours.

This is chaos coding. It feels productive, but it’s not.

The issue isn’t the AI β€” it’s the lack of structure. Without a clear methodology, AI-assisted development becomes a random walk through your codebase.

The Solution: PUDO

PUDO is an AI Agent Operating Layer that installs into any repository. It gives you:

PUDO is not a new AI model. It’s the operating layer that makes your existing AI tools more reliable.

Recent research on configuring agentic coding tools identifies repository-level context files as the dominant mechanism and notes AGENTS.md emerging as an interoperable standard across tools. PUDO starts from that repo-level layer and adds executable checks, quality gates, handoff, and measurement. (arXiv:2602.14690)

The MCP Server

The PUDO MCP server turns the operating layer into tools that compatible coding agents can call directly. Instead of relying on an agent to remember documentation, the agent calls PUDO tools to generate rules, validate output, run quality gates, and maintain session continuity.

MCP Tool What It Gives The Agent
pudo.generateAgentRules Project-specific agent instructions
pudo.validateAgentRules Validation of installed workflow files
pudo.createContextPack Repository-bounded context without sensitive or generated paths
pudo.runQualityGate Evidence checks before advancing or releasing
pudo.scoreRepoReadiness Machine-readable readiness scoring
pudo.doctor Workflow and policy gap diagnosis
pudo.initProject Approval-gated project initialization
pudo.updateSessionHandoff Approval-gated continuity between sessions

The alpha server uses local stdio, restricts reads to one configured repository root, requires explicit approval for writes, and exposes no shell or network execution.

# Via npx (no install needed)
npx @dongduong2001/mcp-server@alpha

# Or install globally
npm install -g @dongduong2001/mcp-server@alpha
pudo-mcp-server

See PUDO MCP Server, Agent Tool Security, and the MCP Security Checklist.

The 4 Phases

Phase Goal You Do AI Does
(P) Plan Define what and why Set scope, constraints, success criteria Draft implementation plan, identify risks
(U) Understand Know where and how Point to relevant code, explain context Analyze codebase, map dependencies, find patterns
(D) Develop Build it Review, approve, test Write code, run tests, track progress
(O) Optimize Make it better Validate improvements, merge Refactor, benchmark, document changes

PUDO 4-Phase Infographic

Key insight: PUDO is a cycle, not a pipeline. You revisit phases as you learn more. A discovery in Develop might send you back to Plan. That’s expected and by design.

Architecture Overview

PUDO has three product surfaces that work together:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Your Repository                           β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                β”‚
β”‚  β”‚  Agent Config   β”‚    β”‚  Quality Layer   β”‚                β”‚
β”‚  β”‚                 β”‚    β”‚                  β”‚                β”‚
β”‚  β”‚  AGENTS.md      β”‚    β”‚  quality-gates   β”‚                β”‚
β”‚  β”‚  CLAUDE.md      β”‚    β”‚  qc-checklists   β”‚                β”‚
β”‚  β”‚  GEMINI.md      β”‚    β”‚  anti-hallucin.  β”‚                β”‚
β”‚  β”‚  .cursor/rules  β”‚    β”‚  token-budget    β”‚                β”‚
β”‚  β”‚  copilot-inst.  β”‚    β”‚  ai-output-rev.  β”‚                β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”‚           β”‚                      β”‚                          β”‚
β”‚           β–Ό                      β–Ό                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”‚
β”‚  β”‚              CLI  (npx pudo-code-system)          β”‚       β”‚
β”‚  β”‚                                                  β”‚       β”‚
β”‚  β”‚  init Β· check Β· score Β· score --strict Β· doctor  β”‚       β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚
β”‚                         β”‚                                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            MCP Server  (stdio, local, sandboxed)            β”‚
β”‚                                                             β”‚
β”‚  generateAgentRules  Β·  createContextPack                   β”‚
β”‚  runQualityGate      Β·  scoreRepoReadiness                  β”‚
β”‚  initProject         Β·  updateSessionHandoff                β”‚
β”‚  validateAgentRules  Β·  doctor                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        AI Coding Agents                    β”‚
β”‚                                            β”‚
β”‚  Cursor  Claude  Codex  Copilot            β”‚
β”‚  Gemini  OpenCode  Kiro                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Agent Config files tell every AI assistant how to behave in your repo. Quality Layer provides checklists, gates, and anti-patterns to validate AI output. CLI gives you executable workflow commands that produce machine-readable results. MCP Server exposes all of the above as callable tools for compatible agents.


Install Into a Project

Use the init command to generate agent rules, PR templates, quality checklists, and a session handoff file in any repository:

npx pudo-code-system init

Non-interactive setup:

npx pudo-code-system init \
  --yes \
  --tools=cursor,claude,codex,copilot,gemini,opencode,kiro \
  --project=nextjs \
  --strictness=standard

Generated files include: AGENTS.md, CLAUDE.md, GEMINI.md, .cursor/rules/pudo-core.mdc, .github/copilot-instructions.md, opencode/opencode.md, kiro/system-prompt.md, .github/pull_request_template.md, .pudo/config.json, and .pudo/session.md.

Executable workflow commands:

npx pudo-code-system check              # validate installed config files
npx pudo-code-system score              # score repo readiness (0-100)
npx pudo-code-system score --json       # machine-readable JSON output
npx pudo-code-system score --strict     # fail if score is below threshold
npx pudo-code-system doctor             # diagnose workflow gaps

score evaluates instruction specificity, context quality, workflow evidence, AI/MCP safety, tests, CI, benchmarks, and release traceability. Its JSON output follows schemas/pudo-score.schema.json.

Quick Start

1. Plan

Before writing any code, define what you’re building:

I need to build [FEATURE].
The success criteria are [CRITERIA].
The constraints are [CONSTRAINTS].
Create an implementation plan before writing any code.

2. Understand

Research before you build:

Before implementing, analyze the existing codebase:
- What patterns are already established?
- What dependencies are involved?
- What could break?

3. Develop

Build with structure:

Implement the plan. Track progress with a task checklist.
Write tests alongside the implementation.
Flag any deviations from the plan.

4. Optimize

Don’t ship the first draft:

Review the implementation:
- Are there performance improvements?
- Is the code consistent with existing patterns?
- Write a walkthrough summarizing what changed and why.

5. Repeat

Every task, every feature, every bug fix β€” Plan β†’ Understand β†’ Develop β†’ Optimize.


PUDO Modes

Use the smallest mode that safely fits the task. See PUDO Modes for the full guide.

Mode Use For Process
PUDO Lite Small fixes, scripts, tasks under 30 minutes Three checks: scope, relevant files, verification
PUDO Standard Medium features, real bugs, focused refactors Full Plan β†’ Understand β†’ Develop β†’ Optimize
PUDO Enterprise Team, production, security, compliance Full PUDO plus owner, rollback, monitoring, migration, risk log

Quality Gates

Each phase ends with a gate. Do not move forward until the gate passes, or until the risk is explicitly accepted.

Gate Run Before Must Prove
Plan Gate Understand Scope, success criteria, constraints, and out-of-scope items are clear
Understand Gate Develop Relevant files, architecture, APIs, and patterns were verified
Develop Gate Optimize Implementation stays in scope, has tests, and handles key edge cases
Optimize Gate Release Refactors preserve behavior; performance, security, docs, and risks reviewed
Release Gate Merge/deploy Changelog, migration, rollback, monitoring, and owner approval handled

See Quality Gates, QC Checklists, AI Output Review, Anti-Hallucination Rules, Token Budget Rules, Context Engineering, and the Edge Case Catalogue.


Examples

See PUDO applied to real-world scenarios:

# Scenario Complexity Key Takeaway
01 Building a landing page Beginner How Plan prevents scope creep
02 Stripe API integration Intermediate How Understand saves debugging time
03 Fixing a production bug Advanced How the full cycle prevents regressions
04 Quality gate failure case Intermediate How a failed gate prevents bad releases
05 Before/after token waste Intermediate How source grounding reduces wasted AI turns

Prompt Library

PUDO ships with 21 ready-to-use prompts across 4 phases. Copy-paste into any AI assistant. Each phase folder includes a README.md explaining how to extend the prompts for your team.

Phase Prompts
(P) Plan Scope Definition Β· Architecture Draft Β· Risk Assessment Β· Database Schema Β· API Contract Β· Security Threat Model
(U) Understand Codebase Analysis Β· Dependency Audit Β· Pattern Recognition Β· Crash Log Analysis
(D) Develop Feature Implementation Β· Test-Driven Dev Β· Component Scaffold Β· Integration Test Suite Β· E2E Test Suite
(O) Optimize Performance Review Β· Code Review Checklist Β· Refactor Opportunities Β· Memory Profiling Β· Network Troubleshooting
Skills Architecture & Planning Β· Software Engineering Β· Troubleshooting & Debugging Β· DevOps Engineering Β· Test Engineering
DevOps Tools GitHub Actions Β· GitLab CI Β· Argo CD Β· Jenkins Β· Terraform Β· Docker Β· Kubernetes

AI Integrations

PUDO is designed to be the default operating layer for AI coding agents, working across all major tools.

Tool Current Files Recommended Setup Status
Codex AGENTS.md, codex/AGENTS.md Keep root AGENTS.md; copy codex/AGENTS.md for a fuller Codex template OK
Claude Code / Projects CLAUDE.md, claude/CLAUDE.md, .claude/settings.json Use root CLAUDE.md as the bridge; keep detailed workflow in claude/CLAUDE.md Updated
Cursor Project Rules, legacy .cursorrules Prefer .cursor/rules/*.mdc; keep .cursorrules for legacy Cursor versions Migrated
GitHub Copilot .github/copilot-instructions.md, .github/instructions/ Use repo-wide instructions plus path-specific .instructions.md files Added
Gemini GEMINI.md, antigravity/instructions.xml Use GEMINI.md as the instruction bridge; keep Antigravity XML for Gemini-style workspaces CLI generated
OpenCode opencode/opencode.md Add to OpenCode system prompts or workspace instructions CLI generated
Kiro kiro/system-prompt.md Set as the Kiro system prompt CLI generated

Repository Structure

pudo-code-system/
β”œβ”€β”€ AGENTS.md                   # Shared agent rules (Codex, cross-tool)
β”œβ”€β”€ CLAUDE.md                   # Claude Code memory bridge
β”œβ”€β”€ GEMINI.md                   # Gemini agent instructions
β”‚
β”œβ”€β”€ docs/                       # Documentation
β”‚   β”œβ”€β”€ README.md               # Documentation index
β”‚   β”œβ”€β”€ philosophy.md           # Why PUDO exists and its design principles
β”‚   β”œβ”€β”€ workflow.md             # Deep-dive into each phase
β”‚   β”œβ”€β”€ pudo-modes.md           # Lite / Standard / Enterprise guide
β”‚   β”œβ”€β”€ getting-started.md      # First steps for new users
β”‚   β”œβ”€β”€ architecture.md         # System diagram and component overview
β”‚   β”œβ”€β”€ context-engineering.md  # How to bound AI context effectively
β”‚   β”œβ”€β”€ mcp.md                  # MCP server setup and usage
β”‚   β”œβ”€β”€ agent-skill-contract.md # Agent capability contracts
β”‚   β”œβ”€β”€ team-adoption-guide.md  # Multi-phase team rollout guide
β”‚   └── faq.md                  # Frequently asked questions
β”‚
β”œβ”€β”€ prompts/                    # 21 ready-to-use AI prompts
β”‚   β”œβ”€β”€ plan/                   # Scoping, architecture, risk
β”‚   β”œβ”€β”€ understand/             # Codebase analysis, patterns
β”‚   β”œβ”€β”€ develop/                # Implementation, testing
β”‚   └── optimize/               # Performance, review, refactor
β”‚
β”œβ”€β”€ skills/                     # Domain-specific PUDO variants
β”‚   β”œβ”€β”€ plan/                   # Architecture & planning
β”‚   β”œβ”€β”€ code/                   # Software engineering
β”‚   β”œβ”€β”€ debug/                  # Troubleshooting
β”‚   β”œβ”€β”€ devops/                 # CI/CD, infra tools
β”‚   β”œβ”€β”€ test/                   # Test engineering
β”‚   β”œβ”€β”€ frontend/               # Frontend patterns
β”‚   β”œβ”€β”€ backend/                # Backend patterns
β”‚   └── mobile/                 # Mobile development
β”‚
β”œβ”€β”€ quality/                    # Quality enforcement
β”‚   β”œβ”€β”€ quality-gates.md        # Phase gate checklists
β”‚   β”œβ”€β”€ qc-checklists.md        # Product, eng, security checklists
β”‚   β”œβ”€β”€ ai-output-review.md     # Reviewing AI-generated code
β”‚   β”œβ”€β”€ anti-hallucination.md   # Preventing AI errors
β”‚   β”œβ”€β”€ token-budget.md         # Context window management
β”‚   β”œβ”€β”€ mcp-security-checklist.md
β”‚   β”œβ”€β”€ agent-tool-security.md
β”‚   └── edge-cases/             # Edge case catalogue
β”‚
β”œβ”€β”€ examples/                   # Real-world PUDO walkthroughs
β”‚   β”œβ”€β”€ 01-landing-page/
β”‚   β”œβ”€β”€ 02-api-integration/
β”‚   β”œβ”€β”€ 03-debug-production/
β”‚   β”œβ”€β”€ 04-quality-gate-failure/
β”‚   └── 05-before-after-token-waste/
β”‚
β”œβ”€β”€ templates/                  # Stack-specific project scaffolds
β”‚   β”œβ”€β”€ nextjs/
β”‚   β”œβ”€β”€ react-vite/
β”‚   β”œβ”€β”€ node-express/
β”‚   β”œβ”€β”€ python-fastapi/
β”‚   └── ...
β”‚
β”œβ”€β”€ benchmarks/                 # Measurement framework
β”‚   β”œβ”€β”€ README.md               # How to benchmark
β”‚   β”œβ”€β”€ metrics-sheet.csv       # Template for recording results
β”‚   β”œβ”€β”€ token-waste-calculator.md
β”‚   └── results/                # Measured case studies
β”‚
β”œβ”€β”€ schemas/                    # JSON schemas for machine-readable output
β”‚   β”œβ”€β”€ pudo-score.schema.json
β”‚   β”œβ”€β”€ pudo-metrics.schema.json
β”‚   └── pudo-run-trace.schema.json
β”‚
β”œβ”€β”€ packages/
β”‚   └── pudo-mcp-server/        # MCP server (TypeScript)
β”‚       β”œβ”€β”€ src/server.ts
β”‚       β”œβ”€β”€ tools/              # 8 callable MCP tools
β”‚       └── tests/
β”‚
β”œβ”€β”€ bin/
β”‚   └── pudo.js                 # CLI entry point
β”‚
β”œβ”€β”€ .pudo/                      # PUDO operating-kit state
β”‚   β”œβ”€β”€ config.json
β”‚   β”œβ”€β”€ session.md              # Session handoff file
β”‚   └── checklists/
β”‚
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ workflows/              # CI: CLI install test, PUDO check
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/         # Bug report, feature request
β”‚   β”œβ”€β”€ pull_request_template.md
β”‚   └── CODEOWNERS
β”‚
└── cursor/, claude/, codex/,   # Tool-specific config dirs
    kiro/, opencode/, antigravity/

Measurement Targets

These numbers are directional targets to validate with your own benchmark data, not proven PUDO-wide guarantees. Current public evidence is one measured case study β€” do not cite this table as a benchmark claim until you have your own data. Gains depend on task size, repo quality, and how consistently you follow PUDO.

Task Type Token Waste Reduction Target Dev Time Reduction Target
One-line fix / small script 0–8% -5% to +5%
Small / medium feature 25–38% 12–20%
Hard bug / production issue 22–35% 10–18%
Multi-file feature / tests / team handoff 35–48% 18–28%
Measurement target for mature usage 34% 18%

Measure your own results with the Benchmark Kit. Track tokens, AI turns, failed attempts, unnecessary file reads, time to verified implementation, bugs found after AI output, and PR review comments. See the sample measured case in benchmarks/results/stripe-webhook-2026-05.


Philosophy

PUDO isn’t just a checklist β€” it’s a mindset. Read the full philosophy to understand the principles behind the method.

TL;DR:


Onboarding Paths

Path Best For Setup
Solo dev Small projects, personal repos, fast iteration npx pudo-code-system init --strictness=lite
Team lead Shared PR review, handoff, medium features npx pudo-code-system init --strictness=standard --tools=cursor,claude,codex,copilot,gemini,opencode,kiro
Enterprise / security Production, compliance, migrations, sensitive data npx pudo-code-system init --strictness=enterprise plus Release Gate

See Team Adoption Guide for a multi-phase team rollout plan.


When Not To Use PUDO

PUDO may be overkill for one-line fixes, throwaway prototypes, pure exploration, and non-critical scripts. Use the full cycle when correctness, maintainability, security, or team handoff matters.

Current Limitations

Who Is This For?


Contributing

PUDO grows with the community. See CONTRIBUTING.md for how to add prompts, submit walkthroughs, improve docs, and report issues.

Questions? Open a Discussion or check SUPPORT.md.


Support & Funding

If you find PUDO helpful, consider supporting the project:


License

MIT β€” Use it, fork it, make it yours.


Stop vibing. Start PUDO-ing.

Plan β†’ Understand β†’ Develop β†’ Optimize