A Claude Code / GitHub Copilot skill for writing algorithms as compact Python pseudocode with unicode math notation.
Write runnable Python with W̃, θ, ΔB, ℒ -- then auto-strip it to clean pseudocode.
# 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 settingsTeaches 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)
W̃=A @ (B+δ*ΔB)
returnW̃Instead of traditional IF...THEN...ENDIF pseudocode or verbose Python with torch.linalg.svd(W, full_matrices=False).
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.pyThe 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
| File | Purpose |
|---|---|
SKILL.md | AI skill: rules, conventions, examples |
to_pseudocode.py | Transform: runnable Python -> pseudocode |
example_full.py | Runnable example with @jaxtyped + @beartype |
- jaxtyping -- verifiable shape annotations
- einops -- self-documenting tensor transforms
- Wikipedia: Pseudocode -- "mathematical style pseudocode"