← ClaudeAtlas

ape-write-pseudocodelisted

Guidelines for writing pseudocode for functions and algorithms. Use this skill whenever the user asks to write pseudocode, sketch out an algorithm, or describe the logic of a function at a high level. Trigger on phrases like "write pseudocode", "sketch this algorithm", "pseudocode for this function", or "describe the logic".
arpitbbhayani/ape-skills · ★ 15 · Code & Development · score 78
Install: claude install-skill arpitbbhayani/ape-skills
# Pseudocode Style Guide ## Structure of a Function Every pseudocode function has exactly three parts: input, output, and body. Use Python-like syntax: `def` for the function signature, a docstring-style comment block for input and output, and indented body lines. ``` def function_name(param1, param2, ...): # input: <what each param represents> # output: <what the function returns or produces> <body> ``` ## Body Rules The body is the core of the pseudocode. Each line describes one logical step at a very high level -- what the step takes as input and what it produces as output. Do not write code. Do not spell out implementation details. - One line per logical step. - Each line states what it receives and what it produces or decides. - No variable declarations, no type annotations, no language syntax. - No method chains, no intermediate variable names unless a name is essential to connect two steps. - Never more than one idea per line. ## Control Flow Use `if`, `elif`, `else`, and loops sparingly and only when the branching or iteration is the point of the logic. Use Python-like keywords and colon-terminated headers. ``` if <condition>: <what happens> else: <what happens instead> for each <item> in <collection>: <what is done with item> while <condition>: <what is repeated> ``` Keep conditions at the same high level as the rest of the body -- describe the condition in plain words, not code. ## What to Write on Each Line Each line shou