Agent skill

Pseudocode To Python Code

by ArabelaTso in ArabelaTso/Skills-4-SE

Convert pseudocode, algorithm descriptions, or specifications into complete, executable Python code.

Apache-2.0Auto-check passedDevelopment

Install Pseudocode To Python Code

skills CLI
$ npx skills add ArabelaTso/Skills-4-SE --skill pseudocode-to-python-code -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ArabelaTso/Skills-4-SE pseudocode-to-python-code --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/pseudocode-to-python-code .claude/skills/pseudocode-to-python-code && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pseudocode-to-python-code
GitHub stars
253
Token cost
~2.6k tokens
SKILL.md length
740 words
Files
4 (incl. references, assets)
Skills in repo
151
Repo updated
First seen
Licence
Apache-2.0

At a glance

Convert pseudocode, algorithm descriptions, or specifications into complete, executable Python code.

  • Works in 8 steps: Understand the Input → Analyze Algorithm Structure → Map to Python Constructs → …
  • Convert pseudocode to Python
  • SKILL.md covers Workflow, Common Patterns, Important Notes and Resources
  • Runs Python scripts from its folder

What it does

Pseudocode To Python Code is an agent skill from ArabelaTso/Skills-4-SE. Convert pseudocode, algorithm descriptions, or specifications into complete, executable Python code. Handles natural language descriptions, structured pseudocode, and formal algorithm specifications. Generates production-ready code with type hints, docstrings, error handling, and test cases. Use when users need to (1) convert pseudocode to Python, (2) implement algorithms from descriptions, (3) translate algorithm specifications to code, (4) generate Python implementations from textbook pseudocode, or (5) create…

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files and assets (for example `assets/template.py`, `references/pseudocode-patterns.md` and `references/python-idioms.md`).

It sits in Development, covering Technical documentation, Type safety and Test generation. It works with Python. The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.

When your agent uses it

  • Convert pseudocode to Python
  • Implement algorithms from descriptions
  • Translate algorithm specifications to code
  • Generate Python implementations from textbook pseudocode

Example prompts

  • “/pseudocode-to-python-code”

Requirements

  • Python 3

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Understand the Input
  2. Analyze Algorithm Structure
  3. Map to Python Constructs
  4. Generate Python Code
  5. Apply Python Idioms
  6. Add Error Handling
  7. Create Comprehensive Tests
  8. Provide Mapping Summary

What it can do on your machine

Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Pseudocode To Python Code loads about 2.6k tokens when it runs, and up to ~6.3k if it reads all its reference files. Until then it costs about 149 tokens; SKILL.md has 740 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~149
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 740 words, ~2,578 tokens.

Download SKILL.mdSave it as .claude/skills/pseudocode-to-python-code/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
pseudocode-to-python-code
description
Convert pseudocode, algorithm descriptions, or specifications into complete, executable Python code. Handles natural language descriptions, structured pseudocode, and formal algorithm specifications. Generates production-ready code with type hints, docstrings, error handling, and test cases. Use when users need to (1) convert pseudocode to Python, (2) implement algorithms from descriptions, (3) translate algorithm specifications to code, (4) generate Python implementations from textbook pseudocode, or (5) create executable code from high-level algorithm designs.

Pseudocode to Python Code

Convert pseudocode and algorithm descriptions into complete, executable Python code with proper structure, documentation, and tests.

Workflow

1. Understand the Input

Identify the input format and extract the algorithm logic:

Natural language description:

  • Example: "Sort an array using bubble sort"
  • Extract: Algorithm name, input/output, basic steps

Structured pseudocode:

  • Example: "FOR i FROM 0 TO n-1 DO..."
  • Parse: Control structures, data operations, logic flow

Algorithm specification:

  • Example: "Precondition: array is non-empty. Postcondition: array is sorted"
  • Identify: Constraints, requirements, expected behavior

Mixed format:

  • Combine natural language with pseudocode keywords
  • Extract both high-level intent and specific logic
2. Analyze Algorithm Structure

Break down the algorithm into components:

  1. Identify data structures: Arrays, dictionaries, sets, queues, stacks, trees, graphs
  2. Identify control flow: Loops (for, while), conditionals (if/else), recursion
  3. Identify operations: Sorting, searching, insertion, deletion, traversal
  4. Identify edge cases: Empty input, single element, duplicates, boundaries
  5. Identify complexity: Time and space complexity considerations
3. Map to Python Constructs

Use references/pseudocode-patterns.md for common mappings:

Control structures:

  • IF/ELSE → if/elif/else
  • FOR loops → for i in range() or for item in collection
  • WHILE loops → while condition:
  • REPEAT-UNTIL → while True: with break

Data structures:

  • Arrays → list
  • Hash maps → dict
  • Sets → set
  • Stacks → list with append()/pop()
  • Queues → collections.deque
  • Priority queues → heapq

Common operations:

  • Swap → a, b = b, a
  • Min/Max → min(), max()
  • Sort → sorted() or list.sort()
  • Search → in operator, list.index(), or binary search
4. Generate Python Code

Follow this structure using assets/template.py as a base:

Module header:

python
#!/usr/bin/env python3
"""
Brief description of what this module does.

Implements [algorithm name] with [key features].
"""

from typing import List, Dict, Optional, Tuple, Set, Any

Main function:

python
def algorithm_name(param1: type1, param2: type2) -> return_type:
    """Brief description.

    Detailed explanation of the algorithm, including approach and complexity.

    Args:
        param1: Description with constraints
        param2: Description with constraints

    Returns:
        Description of return value

    Raises:
        ValueError: When input is invalid
        TypeError: When input type is wrong

    Examples:
        >>> algorithm_name([3, 1, 2])
        [1, 2, 3]
    """
    # Input validation
    if not param1:
        raise ValueError("param1 cannot be empty")

    # Main algorithm implementation
    # Use clear variable names and comments for complex logic
    result = implementation_here

    return result

Helper functions:

  • Extract complex logic into separate functions
  • Each function should have a single responsibility
  • Include type hints and docstrings

Test cases:

python
def test_algorithm_name():
    """Test algorithm_name with various inputs."""
    # Test 1: Normal case
    assert algorithm_name([3, 1, 2]) == [1, 2, 3]

    # Test 2: Edge case - empty
    try:
        algorithm_name([])
        assert False, "Should raise ValueError"
    except ValueError:
        pass

    # Test 3: Edge case - single element
    assert algorithm_name([1]) == [1]

    # Test 4: Edge case - duplicates
    assert algorithm_name([2, 1, 2]) == [1, 2, 2]

    # Test 5: Edge case - already sorted
    assert algorithm_name([1, 2, 3]) == [1, 2, 3]

    print("✓ All tests passed!")

Main block:

python
if __name__ == "__main__":
    # Run tests
    test_algorithm_name()

    # Example usage
    example_input = [3, 1, 4, 1, 5, 9, 2, 6]
    result = algorithm_name(example_input)
    print(f"Input: {example_input}")
    print(f"Output: {result}")
5. Apply Python Idioms

Consult references/python-idioms.md for best practices:

Use list comprehensions:

python
# Instead of loops
result = [transform(x) for x in items if condition(x)]

Use built-in functions:

python
# Instead of manual loops
total = sum(items)
maximum = max(items)

Use enumerate and zip:

python
for i, item in enumerate(items):
    process(i, item)

for a, b in zip(list1, list2):
    process(a, b)

Use appropriate data structures:

  • collections.defaultdict for counting/grouping
  • collections.Counter for frequency counting
  • collections.deque for queues
  • heapq for priority queues
6. Add Error Handling

Include appropriate error handling:

python
def function(param):
    """Function with error handling."""
    # Validate input
    if param is None:
        raise ValueError("param cannot be None")

    if not isinstance(param, expected_type):
        raise TypeError(f"Expected {expected_type}, got {type(param)}")

    # Check constraints
    if param < 0:
        raise ValueError("param must be non-negative")

    # Implementation
    try:
        result = risky_operation(param)
    except SpecificError as e:
        # Handle or re-raise with context
        raise RuntimeError(f"Operation failed: {e}") from e

    return result
7. Create Comprehensive Tests

Generate test cases covering:

  1. Normal cases: Typical inputs with expected outputs
  2. Edge cases:
    • Empty input ([], "", None)
    • Single element
    • Two elements
    • Large input
  3. Boundary conditions:
    • Minimum/maximum values
    • First/last elements
  4. Special cases:
    • Duplicates
    • Negative numbers
    • Zero
    • Already sorted/processed
  5. Error cases:
    • Invalid input types
    • Out-of-range values
    • Constraint violations
8. Provide Mapping Summary

After generating code, provide a summary:

Pseudocode to Python Mapping Summary:
======================================

Algorithm: [Name]
Complexity: Time O(...), Space O(...)

Key Mappings:
1. FOR i FROM 1 TO n → for i in range(1, n + 1)
2. ARRAY[n] → list of size n
3. IF condition THEN → if condition:
4. SWAP(a, b) → a, b = b, a

Data Structures Used:
- Input: List[int]
- Auxiliary: Dict[str, int] for tracking

Functions Generated:
- main_function(): Main algorithm implementation
- helper_function(): Helper for [specific task]

Test Cases: 5 tests covering normal and edge cases

Common Patterns

Pattern 1: Simple Algorithm Translation

User provides clear pseudocode:

FOR i FROM 0 TO n-1
    FOR j FROM 0 TO n-i-1
        IF array[j] > array[j+1]
            SWAP array[j] and array[j+1]
  1. Identify: Bubble sort with nested loops
  2. Map: FOR → for, SWAP → tuple unpacking
  3. Generate: Complete function with type hints
  4. Add: Input validation and tests
  5. Provide: Mapping summary
Show full SKILL.md (321 more words)Show less
Pattern 2: Natural Language Description

User describes algorithm in English: "Create a function that finds the longest common subsequence of two strings"

  1. Understand: LCS problem, dynamic programming
  2. Design: 2D DP table approach
  3. Implement: DP solution with proper structure
  4. Test: Multiple test cases including edge cases
  5. Document: Explain approach in docstring
Pattern 3: Algorithm Specification

User provides formal specification: "Precondition: Binary tree is not empty. Find the lowest common ancestor of two nodes."

  1. Parse: Constraints and requirements
  2. Choose: Appropriate algorithm (recursive traversal)
  3. Implement: With precondition checks
  4. Validate: Test with various tree structures
  5. Document: Complexity and approach
Pattern 4: Class-Based Design

User describes object-oriented algorithm: "Implement a stack with min() operation in O(1)"

  1. Design: Class structure with required methods
  2. Implement: Using auxiliary stack pattern
  3. Add: __init__, push, pop, min, is_empty
  4. Test: Class methods with various scenarios
  5. Document: Class and method docstrings

Important Notes

Code Quality Standards
  • Type hints: Always include for parameters and return values
  • Docstrings: Google-style for all functions and classes
  • Error handling: Validate inputs and handle edge cases
  • Testing: Minimum 3-5 test cases covering normal and edge cases
  • Comments: Explain complex logic, not obvious code
  • Naming: Use descriptive names following PEP 8
Python Version
  • Target Python 3.7+ for compatibility
  • Use modern features: f-strings, type hints, dataclasses
  • Avoid deprecated features
Performance Considerations
  • Use built-in functions when possible (faster)
  • Choose appropriate data structures
  • Consider time/space complexity
  • Avoid premature optimization
  • Document complexity in docstrings
When to Use Helper Functions

Extract helper functions when:

  • Logic is complex or repeated
  • Function exceeds ~50 lines
  • Separate concern improves clarity
  • Testing individual components is beneficial
Testing Philosophy
  • Tests should be simple and readable
  • Use descriptive test names
  • Test one thing per test case
  • Include assertion messages for clarity
  • Run tests in if __name__ == "__main__" block

Resources

© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references, assets) in skills/pseudocode-to-python-code of ArabelaTso/Skills-4-SE.

  • SKILL.md
  • assets/template.py
  • references/pseudocode-patterns.md
  • references/python-idioms.md

Open the folder on GitHubat commit 4f38503

Compare with similar skills

Pseudocode To Python Code next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Pseudocode To Python Code compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pseudocode To Python Code this skillArabelaTso/Skills-4-SE253—~2.6kAutomated safety check: PassApache-2.0
Diataxis Docs Writercalf-ai/calfkit-sdk1491 repos~3kAutomated safety check: PassApache-2.0
Python Patternskurealnum/dotfiles2908 repos~4.1kAutomated safety check: PassNone
Strict Programming Practicescode-yeongyu/oh-my-openagent70k—~9.5kAutomated safety check: PassCustom licence
Adk Stylegoogle/adk-python22k—~748Automated safety check: PassApache-2.0
Python Best PracticesTaoidle/plan-cascade133—~463Automated safety check: PassMIT

Similar skills

  • Diataxis Docs Writer

    calf-ai/calfkit-sdk

    Write or improve software documentation using the Diátaxis framework — four documentation types (tutorials, how-to guides, reference, explanation), each serving a different user need.

    149 GitHub starsUsed in 1 repo~3k tokens
    DevelopmentAuto-check passed
  • Python Patterns

    kurealnum/dotfiles

    Pythonic idioms, PEP 8 standards, type hints, and best practices for building robust, efficient, and maintainable Python applications.

    290 GitHub starsUsed in 8 repos~4.1k tokens
    DevelopmentAuto-check passed
  • Strict Programming Practices

    code-yeongyu/oh-my-openagent

    Applies strict, type-first coding rules for Python, Rust, TypeScript and Go, loading the matching language reference before the agent writes or edits any code.

    70k GitHub stars~9.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Adk Style

    google/adk-python

    Official

    Python style and codebase conventions for ADK (Agent Development Kit): private-by-default file visibility, imports, type hints, Pydantic v2 models, formatting, docstrings, logging, async I/O, file…

    22k GitHub stars~748 tokensUpdated today
    DevelopmentAuto-check passed
  • Python Best Practices

    Taoidle/plan-cascade

    Python coding best practices. An agent skill from Taoidle/plan-cascade.

    133 GitHub stars~463 tokensUpdated 6 mo ago
    DevelopmentAuto-check passed
  • Python Anti Patterns

    wshobson/agents

    A skill your agent uses when reviewing Python code for common anti-patterns to avoid.

    40k GitHub stars~2k tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from ArabelaTso/Skills-4-SE

All 151 skills in this repo
  • Framework Migration Assistant

    ArabelaTso/Skills-4-SE

    Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).

    253 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Metamorphic Test Generator

    ArabelaTso/Skills-4-SE

    Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.

    253 GitHub stars~798 tokensUpdated 1 mo ago
    Auto-check passed
  • Reproduction Trace Instrumenter

    ArabelaTso/Skills-4-SE

    Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.

    253 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Spring Mvc To Boot Migrator

    ArabelaTso/Skills-4-SE

    Automatically migrate Spring MVC applications to Spring Boot.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed
  • State Snapshot Instrumenter

    ArabelaTso/Skills-4-SE

    Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Categories

Questions about Pseudocode To Python Code

What does Pseudocode To Python Code do?

Convert pseudocode, algorithm descriptions, or specifications into complete, executable Python code. Pseudocode To Python Code is an agent skill from ArabelaTso/Skills-4-SE. Convert pseudocode, algorithm descriptions, or specifications into complete, executable Python code.

When should I use Pseudocode To Python Code?

Pseudocode To Python Code fits situations like: convert pseudocode to Python; implement algorithms from descriptions; translate algorithm specifications to code; generate Python implementations from textbook pseudocode.

How do I install Pseudocode To Python Code in Claude Code?

Run `npx skills add ArabelaTso/Skills-4-SE --skill pseudocode-to-python-code -a claude-code`. Or copy the skill folder (skills/pseudocode-to-python-code in ArabelaTso/Skills-4-SE) into .claude/skills/pseudocode-to-python-code in your project. Claude Code loads it when a task matches its description.

How do I install Pseudocode To Python Code in Codex?

Run `npx skills add ArabelaTso/Skills-4-SE --skill pseudocode-to-python-code -a codex`. Or copy the skill folder (skills/pseudocode-to-python-code in ArabelaTso/Skills-4-SE) into .agents/skills/pseudocode-to-python-code in your project. Codex loads it when a task matches its description.

Can I use Pseudocode To Python Code in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill pseudocode-to-python-code -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pseudocode-to-python-code, .gemini/skills/pseudocode-to-python-code, .github/skills/pseudocode-to-python-code and .opencode/skills/pseudocode-to-python-code in your project.

What does Pseudocode To Python Code need to run?

Going by SKILL.md and its folder, Pseudocode To Python Code needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Pseudocode To Python Code access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Pseudocode To Python Code safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Pseudocode To Python Code use?

Pseudocode To Python Code is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Pseudocode To Python Code use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.7k tokens, read only when the agent opens those files.

What are the alternatives to Pseudocode To Python Code?

Skills that share tags, products or a category with Pseudocode To Python Code: Diataxis Docs Writer (calf-ai/calfkit-sdk, 149 stars), Python Patterns (kurealnum/dotfiles, 290 stars), Strict Programming Practices (code-yeongyu/oh-my-openagent, 70k stars) and Adk Style (google/adk-python, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Pseudocode To Python Code?

ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 151 skills in this directory. The repository was last updated on August 21, 2026.

Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.