Skip to content

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pseudopy

A Claude Code / GitHub Copilot skill for writing algorithms as compact Python pseudocode with unicode math notation.

Write runnable Python with , θ, ΔB, -- then auto-strip it to clean pseudocode.

Installation

# Claude Code
mkdir -p ~/.claude/skills
git clone https://github.com/wassname/pseudopy.git ~/.claude/skills/pseudopy
# GitHub Copilot (VS Code)
git clone https://github.com/wassname/pseudopy.git ~/.claude/skills/pseudopy
# then add to .github/copilot-instructions.md or workspace settings

What it does

Teaches your AI assistant to write algorithms like this:

defsvd_steer(W, δ, r): # W: m×n, -> m×nU, s, Vt=svd(W)
R=init_rotation(r)
A=U @ RB=R.T @ diag(s) @ VtΔB=randn_like(B)
=A @ (B+δ*ΔB)
return

Instead of traditional IF...THEN...ENDIF pseudocode or verbose Python with torch.linalg.svd(W, full_matrices=False).

Executable pseudocode workflow

Write runnable Python using unicode notation + jaxtyping, then strip to pseudocode:

example_full.py --> to_pseudocode.py --> clean pseudocode
(runnable) (transform) (for papers/slides)
python to_pseudocode.py example_full.py

The transform auto-strips imports, annotations, defaults, decorators, docstrings, and __main__ blocks. Collapses multi-line def to one line. Extracts jaxtyping dims into inline comments.

Control the transform with comment markers:

  • # hide -- drop this line or block
  • # to `pseudocode` -- replace line with custom text

Files

FilePurpose
SKILL.mdAI skill: rules, conventions, examples
to_pseudocode.pyTransform: runnable Python -> pseudocode
example_full.pyRunnable example with @jaxtyped + @beartype

See also

About

Verifiable pseudocode in Python

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages