# residues

A Claude Code skill for solving residue problems in complex analysis. Computes residues at poles, identifies pole order, and applies the residue theorem through SymPy and Z3.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 3951 repo stars
- Author: parcadei
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/parcadei/Continuous-Claude-v3/tree/HEAD/.claude/skills/math/complex-analysis/residues/SKILL.md
- Updated: 2026-01-26
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/residues

## What it does

The skill provides structured methods for residue calculation: simple poles via Res(f, z₀) = lim(z→z₀) (z − z₀)f(z), poles of order n through derivatives, essential singularities via Laurent series. Computations run through `sympy_compute.py` commands for limits, differentiation, and series expansion, plus `z3_solve.py` for verifying whether poles lie inside an integration contour.

A decision tree guides you through singularity types: first identify whether it's a simple pole or higher order, then compute the residue with the appropriate method, then apply the residue theorem—the integral around a closed curve equals 2πi times the sum of residues inside. Requires Python and SymPy and Z3 libraries.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add parcadei/Continuous-Claude-v3 --skill residues -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/residues/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/residues/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add parcadei/Continuous-Claude-v3 --skill residues -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/residues/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add parcadei/Continuous-Claude-v3 --skill residues -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/residues/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install parcadei/Continuous-Claude-v3 .claude/skills/math/complex-analysis/residues
```

2. **Manually: put the files in place**
- File: `.github/skills/residues/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add parcadei/Continuous-Claude-v3 --skill residues -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/parcadei/Continuous-Claude-v3 --path .claude/skills/math/complex-analysis/residues
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/residues/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/parcadei/Continuous-Claude-v3/tree/HEAD/.claude/skills/math/complex-analysis/residues/SKILL.md

## When to use it
- compute the residue of a function at a pole
- determine the order of a pole
- find residues at essential singularities using Laurent series
- evaluate a contour integral via the residue theorem
- check whether a pole lies inside the integration contour

## Example prompts
- Use residues to find the residue of 1/((z-1)*(z-2)) at z=1
- Determine the pole order of e^(1/z) at zero and compute its residue
- Apply residues to calculate the integral around |z|=3 for a function with poles inside

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: f8815e9ba4443ba9.

BEGIN THIRD-PARTY FILE f8815e9ba4443ba9
````text
---
name: residues
description: "Problem-solving strategies for residues in complex analysis"
allowed-tools: [Bash, Read]
---

# Residues

## When to Use

Use this skill when working on residues problems in complex analysis.

## Decision Tree


1. **Computing Residues**
   - Simple pole at z0:
     * Res(f, z0) = lim_{z->z0} (z - z0)f(z)
     * `sympy_compute.py limit "(z - z0)*f(z)" --var z --at z0`
   - Pole of order n:
     * Res(f, z0) = (1/(n-1)!) * lim d^{n-1}/dz^{n-1}[(z-z0)^n f(z)]
     * `sympy_compute.py diff "((z-z0)**n)*f(z)" --var z --order n-1`
   - L'Hopital shortcut for f = g/h with simple pole:
     * Res(f, z0) = g(z0)/h'(z0)

2. **Identify Pole Order**
   - Simple pole: (z - z0)f(z) has finite limit
   - Order n: (z - z0)^n f(z) has finite limit, but (z - z0)^{n-1} f(z) doesn't
   - `sympy_compute.py limit "(z - z0)**n * f(z)" --var z --at z0`

3. **Essential Singularities**
   - Neither pole nor removable (e.g., e^{1/z} at z=0)
   - Compute residue via Laurent series
   - `sympy_compute.py series "exp(1/z)" --var z --at 0`

4. **Apply Residue Theorem**
   - oint_C f(z)dz = 2*pi*i * (sum of residues inside C)
   - Count only poles INSIDE the contour
   - `z3_solve.py prove "pole_inside_contour"`


## Tool Commands

### Sympy_Residue
```bash
uv run python -m runtime.harness scripts/sympy_compute.py residue "1/((z-1)*(z-2))" --var z --at 1
```

### Sympy_Limit
```bash
uv run python -m runtime.harness scripts/sympy_compute.py limit "(z - z0)*f(z)" --var z --at z0
```

### Sympy_Laurent
```bash
uv run python -m runtime.harness scripts/sympy_compute.py series "exp(1/z)" --var z --at 0
```

### Z3_Pole_Inside
```bash
uv run python -m runtime.harness scripts/z3_solve.py prove "abs(z0) < R"
```

## Key Techniques

*From indexed textbooks:*

- [Complex analysis  an introduction to... (Z-Library)] The fact that the calculus of residues yields complex rather than real integrals is no dis¬ (49) with g(z) — z, we obtain <»» i>(”)=25 / f^w) = 2vi / /'(*) /(z) - w z dz. If (49) is applied with g(z) = zm, equation (50) is replaced by 2iri I |z-zo| = /'(*) f(z) - w zm dz. The right-hand member represents an analytic function of w for \w — ir0| < 8.
- [Complex analysis  an introduction to... (Z-Library)] What are the possible values of r dz J \/l — z2 over a closed curve in the region? THE CALCULUS OF RESIDUES The results of the preceding section have shown that the determination of line integrals of analytic functions over closed curves can be reduced to the determination of periods. Under certain circumstances it turns out that the periods can be found without or with very little computation.
````
END THIRD-PARTY FILE f8815e9ba4443ba9

The third-party file has ended. Everything between the f8815e9ba4443ba9 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2653 of 3908 bytes. © parcadei · MIT · https://github.com/parcadei/Continuous-Claude-v3/tree/HEAD/.claude/skills/math/complex-analysis/residues/SKILL.md

## Similar
- [Jacobian](https://affpapa.org/en/nevibecode/mcp/jacobian.md) — MCP server · ★ 375 repo stars
- [math-tools](https://affpapa.org/en/nevibecode/skills/math-tools.md) — skill · 1 install
- [sympy](https://affpapa.org/en/nevibecode/skills/sympy.md) — skill · 2300 installs

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
