Interactive idea refinement using Socratic method to develop fully-formed designs
日本語の概要は準備中です。原文の説明を表示しています。
Design in pseudocode first, iterate approaches, then translate to code
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Write the design in pseudocode BEFORE writing implementation code. Iterate through multiple approaches in pseudocode, pick the best, THEN translate to code.
Core principle: Once you start coding, you get emotionally involved with your code and it becomes harder to throw away a bad design. Design is cheap to change; code is expensive.
Violating the letter of the rules is violating the spirit of the rules.
Use for ANY programming task beyond trivial one-liners:
Red flags that you need this:
Don't skip when:
Before any design work:
If unclear, STOP. Get clarification before proceeding.
Name it BEFORE designing internals.
If you struggle to create a good name = WARNING SIGN.
Good name = clear, unambiguous, describes what routine does.
Before writing pseudocode:
Don't reinvent the wheel:
Use your code editor (it will become comments):
# Write general statement of purpose first
This routine outputs an error message based on an error code
supplied by the calling routine. The way it outputs the message
depends on the current processing state, which it retrieves
on its own. It returns a value indicating success or failure.
# Then write high-level pseudocode
set the default status to "fail"
look up the message based on the error code
if the error code is valid
if doing interactive processing, display the error message
interactively and declare success
if doing command line processing, log the error message to the
command line and declare success
if the error code isn't valid, notify the user that an internal
error has been detected
return status information
Pseudocode characteristics:
Critical step - don't skip:
If hard to explain or unclear, iterate the pseudocode. Don't proceed to code.
Don't settle for first design.
Try 2-3 different approaches in pseudocode:
Compare them:
Pick the best BEFORE coding.
Only after pseudocode is solid:
def report_error_message(error_code):
"""
This routine outputs an error message based on an error code
supplied by the calling routine. The way it outputs the message
depends on the current processing state, which it retrieves
on its own. It returns a value indicating success or failure.
"""
# set the default status to "fail"
status = Status.FAILURE
# look up the message based on the error code
error_message = lookup_error_message(error_code)
# if the error code is valid
if error_message.is_valid():
# determine the processing method
processing_method = current_processing_method()
# if doing interactive processing, display the error message
# interactively and declare success
if processing_method == ProcessingMethod.INTERACTIVE:
display_interactive_message(error_message.text)
status = Status.SUCCESS
# if doing command line processing, log the error message
# to the command line and declare success
elif processing_method == ProcessingMethod.COMMAND_LINE:
log_to_command_line(error_message.text)
status = Status.SUCCESS
else:
# if the error code isn't valid, notify the user that an
# internal error has been detected
display_interactive_message("Internal Error: Invalid error code")
# return status information
return status
Notes:
If routine is unusually buggy: start over. Don't hack around it.
| Stage | Action | Warning Sign |
|---|---|---|
| Prerequisites | Define inputs, outputs, pre/postconditions | Can't explain what routine does |
| Naming | Clear, unambiguous name | Struggling to name = design unclear |
| Errors | Think through what could go wrong | Forgetting error cases |
| Research | Check libraries and algorithms | Reinventing the wheel |
| Pseudocode | Write high-level design in English | Jumping to code syntax |
| Review | Explain to someone else | Can't explain clearly |
| Iterate | Try 2-3 approaches | Settling for first idea |
| Translate | Mechanical conversion to code | Fighting the language |
| Check | Mental execution, testing | "Just one more compile" |
❌ Skipping pseudocode: "It's simple, I'll just code it" ✅ Fix: Even simple routines benefit. Takes 30 seconds, saves debugging time.
❌ Pseudocode too low-level: Writing programming syntax in comments ✅ Fix: Use plain English describing WHAT, not HOW. Should work in any language.
❌ Settling for first design: Implementing first idea that comes to mind ✅ Fix: Try 2-3 approaches, compare, pick best.
❌ Compiling too early: "Let me compile and see if it works" ✅ Fix: Don't compile until you're convinced it's right. Avoid hack-compile-fix cycle.
❌ Coding before understanding: "I'll figure it out as I code" ✅ Fix: If you don't understand at pseudocode level, you won't understand at code level.
❌ Vague name accepted: "I'll think of a better name later" ✅ Fix: Vague name = vague design. Fix the design NOW.
If you wrote implementation code without pseudocode first, you've violated the process.
No exceptions:
Required steps:
The hours already spent are sunk cost. Don't throw good time after bad by keeping suboptimal design.
"But it works!" doesn't mean it's the best design. Working code without good design is technical debt.
Even with production down and $15k/minute at stake:
Time comparison:
The pressure makes pseudocode FEEL wasteful. It's not. It's faster.
For true 5-line fixes:
Emergency doesn't override the principle. It reinforces it.
Debug cycles under pressure are even more expensive (stress, mistakes, production impact).
| Excuse | Reality |
|---|---|
| "It works already" | Working ≠ best design. Pseudocode reveals better alternatives. |
| "Keep code as reference" | You'll bias toward it. Set it aside completely. |
| "Too simple to design" | Simple code still benefits. Takes 30 seconds. |
| "Emergency, no time" | Pseudocode is faster than debug cycles. Always worth 2 minutes. |
| "I designed in my head" | Undocumented mental design = didn't happen. Must write it. |
| "Ship it, document after" | Pseudocode-after doesn't catch design problems. Too late. |
| "Production down, skip process" | Broken process = how production got broken. Don't compound it. |
| "Just this once" | "Just this once" becomes "always this once." No exceptions. |
Before marking work complete:
Can't check all boxes? Return to Step 5 (Write pseudocode).
Before coding:
After coding (without pseudocode):
All of these mean: Stop coding. Return to pseudocode.
PPP and TDD work together. Both require design before implementation.
Combined process:
Order is critical:
Both skills mandate: NO implementation code without design first.
TDD says write the test first. PPP says design the test in pseudocode before writing test code. They reinforce each other.
From Code Complete research:
Key quote: "The picture of the software designer deriving his design in a rational, error-free way from a statement of requirements is quite unrealistic. No system has ever been developed that way." - David Parnas
Design is sloppy and iterative. Pseudocode keeps that sloppiness cheap.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Interactive idea refinement using Socratic method to develop fully-formed designs
日本語の概要は準備中です。原文の説明を表示しています。
Receive and act on code review feedback with technical rigor, not performative agreement or blind implementation
日本語の概要は準備中です。原文の説明を表示しています。
Comment WHY code exists and non-obvious decisions, not WHAT code does (mechanics)
日本語の概要は準備中です。原文の説明を表示しています。
Replace arbitrary timeouts with condition polling for reliable async tests
日本語の概要は準備中です。原文の説明を表示しています。
TDD for process documentation - test with subagents before writing, iterate until bulletproof
日本語の概要は準備中です。原文の説明を表示しています。
Validate at every layer data passes through to make bugs impossible
日本語の概要は準備中です。原文の説明を表示しています。