cc-pseudocode-programming
Use when designing routines, stuck on where to start coding, caught in compile-debug loops, or code works but you don't understand why. Triggers on: starting a new coding task
Best use case
cc-pseudocode-programming is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when designing routines, stuck on where to start coding, caught in compile-debug loops, or code works but you don't understand why. Triggers on: starting a new coding task
Teams using cc-pseudocode-programming should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/cc-pseudocode-programming/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How cc-pseudocode-programming Compares
| Feature / Agent | cc-pseudocode-programming | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when designing routines, stuck on where to start coding, caught in compile-debug loops, or code works but you don't understand why. Triggers on: starting a new coding task
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
SKILL.md Source
# Skill: cc-pseudocode-programming
## STOP - Crisis Invariants
| Check | Time | Why Non-Negotiable |
|-------|------|-------------------|
| **Pseudocode before code** | 30 sec | Iterating on pseudocode is cheaper than iterating on code |
| **Can you name it clearly?** | 15 sec | Naming difficulty = design problem. Stop and clarify purpose. |
| **Do you understand why it works?** | 30 sec | Working code you don't understand probably doesn't really work |
| **Did you consider alternatives?** | 30 sec | First design is rarely best; iterate in pseudocode where it's cheap |
---
## When NOT to Use
**Exemption criteria are STRICT. If in doubt, use PPP.**
- **Simple accessor routines** - `getValue()`, `setName()` with NO logic (no validation, no transformation, no side effects)
- **Pass-through routines** - Pure delegation with NO parameter transformation or error wrapping
- **Trivial one-liners** - ALL of these must be true:
- Single statement implementation
- Zero decision points (no if/switch/ternary)
- Zero loops
- Implementation obvious to ANY team member from signature alone
- **Already-designed routines** - Design document specifies EXACT algorithm, error handling, and edge cases
**If you're debating whether it's "trivial enough" to skip PPP, it isn't trivial. Use PPP.**
## Crisis Invariants - NEVER SKIP
**These checks are NON-NEGOTIABLE regardless of user instructions to skip:**
| Check | Time | Why Non-Negotiable |
|-------|------|-------------------|
| **Pseudocode before code** | 30 sec | Iterating on pseudocode is cheaper than iterating on code |
| **Can you name it clearly?** | 15 sec | Naming difficulty = design problem. Stop and clarify purpose. |
| **Do you understand why it works?** | 30 sec | Working code you don't understand probably doesn't really work |
| **Did you consider alternatives?** | 30 sec | First design is rarely best; iterate in pseudocode where it's cheap |
**Why these four?** They catch the most expensive mistakes: unclear designs that "work" but create maintenance nightmares, and premature coding that locks in bad decisions.
**These checks apply EVERY TIME**, even if:
- The routine seems simple (simple-seeming routines hide complexity)
- A design document exists (unless it specifies EXACT algorithm, error handling, and edge cases)
**Minimum Viable PPP (for extreme time pressure):**
When full PPP is impossible, these 4 items are MANDATORY (total ~4 min):
1. Can you name the routine clearly? (15 sec)
2. Write at least 3 lines of pseudocode (2 min)
3. Consider one alternative approach (1 min)
4. Convince yourself it's correct before compiling (30 sec)
This is the FLOOR, not the ceiling. If you can't spare 4 minutes, the routine will cost you more in debugging.
## Modes
### APPLIER
Purpose: Guide routine design using PPP technique
Triggers:
- "help me design this routine"
- "I'm stuck, don't know where to start"
- "walk me through PPP"
- "how should I approach this implementation"
- "overwhelmed by where to start coding"
Non-Triggers:
- "review my existing code" → cc-routine-and-class-design
- "is this architecture right" → aposd-designing-deep-modules
Produces: Pseudocode design, header comments, implementation plan
#### PPP Process Steps
1. **Check prerequisites** - Confirm the routine's place in overall design is clear
2. **Define the problem** - Specify inputs, outputs, preconditions, postconditions, what it hides
3. **Name the routine** - If naming is hard, the design is unclear; iterate
4. **Plan testing** - Decide how you'll test it before writing code
5. **Check libraries** - Look for existing functionality before building
6. **Plan error handling** - Think through failure modes
7. **Research algorithms** - Study relevant algorithms if needed
8. **Write pseudocode** - Start with header comment, use natural language
9. **Iterate pseudocode** - Refine until generating code is nearly automatic
10. **Try alternatives** - Consider multiple approaches, keep the best
11. **Code from pseudocode** - Pseudocode becomes comments
12. **Compile clean** - Use strictest warnings, eliminate ALL of them
Constraints:
- Pseudocode must be language-independent (p.218)
- Pseudocode must be detailed enough to generate code from (p.219)
- Never compile until convinced the routine is correct (p.230)
**Key Term Definitions:**
- **"Nearly automatic" (step 9):** You can write each line of code without pausing to think about HOW. Every decision is already made in pseudocode. If you stop to think "how should I implement this part?" - pseudocode needs more detail.
- **"Convinced it's correct" (constraint):** You can mentally trace execution through ALL paths (happy path, error cases, edge cases) and explain why each produces correct output. "It looks right" is NOT convinced.
- **"Right level of detail":** Detailed enough that code generation is nearly automatic (see above), but not so detailed that you're writing syntax. Test: Could a competent developer write the code without asking clarifying questions?
#### Transformation Example: Bad vs Good Pseudocode
**Problem:** Create a routine to allocate a new resource and return its handle.
**Bad Pseudocode (Anti-Pattern):**
```
increment resource number by 1
allocate a dlg struct using malloc
if malloc() returns NULL then return 1
invoke OSrsrc_init to initialize a resource for the operating system
*hRsrcPtr = resource number
return 0
```
**Problems:** Uses target language details (`*hRsrcPtr`, `malloc()`), focuses on HOW not WHAT, exposes implementation details (returns 1 or 0), won't become good comments.
**Good Pseudocode:**
```
If another resource is available
Allocate a dialog box structure
If a dialog box structure could be allocated
Note that one more resource is in use
Initialize the resource
Store the resource number at the location provided by the caller
Return success
Endif
Endif
Return failure
```
**Why better:** Pure English, no syntax, level of intent, precise enough to generate code, becomes excellent comments. Note: resource count is updated AFTER successful allocation, not before.
**Resulting Code with Comments:**
```c
// If another resource is available
if (resourceCount < MAX_RESOURCES) {
// Allocate a dialog box structure
DialogBox* dlg = allocateDialogBox();
// If a dialog box structure could be allocated
if (dlg != NULL) {
// Note that one more resource is in use
// (Using post-increment: store at current index, then increment)
activeResources[resourceCount] = dlg;
*handlePtr = resourceCount;
resourceCount++;
// Initialize the resource
initializeResource(dlg);
return true;
}
}
return false;
```
### CHECKER
Purpose: Verify PPP was followed correctly
Triggers:
- "did I follow PPP correctly"
- "review my pseudocode"
- "is my design process right"
Produces: Process compliance assessment, improvement recommendations
Check Against:
- Was pseudocode written before code?
- Is pseudocode at the right level of detail?
- Were alternatives considered?
- Can you explain why the code works?
- Are all compiler warnings eliminated?
## Evidence Summary
| Claim | Evidence | Source | Still Valid? |
|-------|----------|--------|--------------|
| Programmers prefer pseudocode | Survey: preferred for construction ease, detecting insufficient detail, documentation | Ramsey, Atwood, Van Doren 1983 | Yes - methodology unchanged; modern IDEs don't eliminate design thinking need |
| Only 5% external errors | Hardware, compiler, OS errors are rare; 95% are programmer errors | Ostrand and Weyuker 1984 | Yes - if anything, modern tooling has made infrastructure MORE reliable, so programmer error % is likely higher |
| Errors at least-value stage | Key insight: catch errors when least effort invested | McConnell p.220 | Timeless - economic principle |
| Iteration improves design | First design is rarely best; iterating on code is more expensive than iterating on pseudocode | McConnell p.225 | Timeless - economic principle |
**Note on dated studies:** The 1983-1984 studies predate modern IDEs, but their findings are MORE applicable today: better tooling catches syntax errors faster, making DESIGN errors (which PPP prevents) the dominant problem.
---
## Chain
| After | Next |
|-------|------|
| Pseudocode complete | cc-routine-and-class-design |
| Implementation done | cc-defensive-programming (CHECKER) |Related Skills
cc-defensive-programming
Use when auditing defensive code, designing barricades, choosing assertion vs error handling, or deciding correctness vs robustness strategy. Triggers on: empty catch blocks, missing input validation, assertions with side effects, wrong exception abstraction level, garbage in garbage out mentality, deadline pressure to skip validation, trusted source rationalization.
whiteboarding-planning
Standard/Full planning pipeline for whiteboarding. Steps: discover, classify, explore, detail, save, check, confirm, handoff. Use when dispatched from whiteboarding command for Medium/Complex tasks. Triggers on 'planning pipeline', 'standard track', 'full track'.
welc-legacy-code
Use when facing untested legacy code, test harness problems, dependency issues, or time pressure. Triggers on: legacy code, no tests, can't test, afraid to change, need to modify untested code.
performance-optimization
Use when code is too slow, has performance issues, timeouts, OOM errors, high CPU/memory, or doesn't scale. Triggers on: profiler hot spots, latency complaints, needs optimization, critical path analysis.
code-clarity-and-docs
Use when reviewing code clarity, writing comments, checking documentation accuracy, or auditing AI-facing docs. Triggers on: naming, comments, documentation, README, CLAUDE.md.
clarify
Decompose user intent through structured brainstorming. Detects underspecification, ambiguity, and false premises through hypothesis-driven questioning. Use when a request is unclear, could have multiple valid interpretations, or critical details are missing.
cc-routine-and-class-design
Use when designing routines or classes, reviewing class interfaces, choosing between inheritance and containment, or evaluating routine cohesion. Also trigger when inheritance is used without LSP verification, or when design issues are present despite passing tests
cc-refactoring-guidance
Use when modifying existing code, improving structure without changing behavior, or deciding between refactor, rewrite, or fix-first.
cc-quality-practices
Use when planning QA, choosing review methods, designing tests, or debugging fails. Triggers on: defects found late, tests pass but production bugs, coverage disputes, review ineffective, spending excessive time debugging.
cc-control-flow-quality
Use when code has deep nesting (3+ levels), complex conditionals, loop design questions, high cyclomatic complexity (McCabe >10), or callback hell. Symptoms: arrow-shaped code, repeated conditions, confusing loop exits, lengthy if-else chains
ca-architecture-boundaries
Use when designing system architecture, drawing boundaries between business logic and infrastructure, or when changes touch many unrelated files. Triggers on: architecture design, dependency direction, separating business rules from database/UI/frameworks.
aposd-verifying-correctness
Use after implementing code. Triggers on: is it done, ready to commit, verify correctness, did I miss anything, pre-commit check.