02loveslollipop/opencrow/sagemath

Claude Code and agent skill by 02loveslollipop/opencrow

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Run SageMath through an explicit override, a detected environment named `sage`, or a PATH-resolved command. Use for CTF and cryptography work involving asymmetric cryptography, finite fields, elliptic curves, lattices, polynomial algebra, modular arithmetic, discrete logs, small-root attacks, or PRNG cryptanalysis.

Install

npx vskill@latest install 02loveslollipop/opencrow/sagemath

SKILL.md

The same SKILL.md was published earlier as 02loveslollipop/opencrow/sagemath.

OpenCROW Runner - SageMath

Runtime preflight

Probe required commands with command -v and Python modules with importlib.util.find_spec before use. Prefer a PATH-resolved OpenCROW MCP helper or the ctf/sage environment when available, then the managed helper or system Python. If a capability is missing, stop that path safely and report the exact missing command or module.

Use this skill to execute SageMath reliably from the best detected Sage runtime.

Quick Start

Use the bundled runner:

bash
python3 scripts/run_sage.py --code 'print(factor(2^20 - 1))'

Or execute an existing .sage file:

bash
python3 scripts/run_sage.py --file /absolute/path/to/script.sage

Workflow

  1. Decide whether the task is best expressed as inline code or a .sage file.
  2. For small one-off computations, pass the code with --code.
  3. For longer programs or reusable work, create a .sage file and pass it with --file.
  4. For CTF crypto tasks, prefer Sage when the problem involves polynomial rings, finite fields, matrices over modular domains, lattices, or symbolic number theory operations.
  5. Review stdout/stderr from SageMath and report the meaningful result back to the user.

Runner Notes

  • The runner probes OPENCROW_SAGE, a Conda environment named sage, and then a PATH-resolved sage command. If all are missing it reports that exact capability gap.
  • For --code, the runner writes the code into a temporary .sage file first. This avoids quoting issues and keeps behavior aligned with file execution.
  • Pass --timeout SECONDS when a computation may hang or run too long.
  • Pass --keep-temp only when debugging generated Sage code.

Patterns

For inline calculations:

bash
python3 scripts/run_sage.py --code '
R.<x> = QQ[]
f = x^4 - 1
print(f.factor())
'

For file-based workflows:

  1. Create a .sage file in the workspace.
  2. Run it with the bundled runner.
  3. If the script generates files, verify the outputs before replying.

For CTF cryptography workflows:

  • Use Sage integer and modular arithmetic for RSA attacks, CRT reconstruction, inverses, and exponent relations.
  • Use polynomial rings and small_roots() for Coppersmith-style attacks when the instance is suitable.
  • Use GF(p) or extension fields for ECC, finite-field equations, and structured algebraic recovery.
  • Use Matrix, vector, and LLL for lattice-based recovery problems and hidden-number style attacks.
  • Use recurrence solving, modular equations, and matrix lifting for LCG, xorshift, and related PRNG state recovery when Sage algebra is useful.

References

  • For CTF-oriented patterns and starter snippets, read references/ctf-crypto.md when the task involves RSA, ECC, lattices, or PRNG cryptanalysis.

Templates

Resource

scripts/run_sage.py

Use this script instead of calling SageMath manually unless there is a specific reason not to. It standardizes environment selection, timeout handling, and inline-code execution.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/02loveslollipop/opencrow/sagemath/badge)](https://verified-skill.com/skills/02loveslollipop/opencrow/sagemath)

Something wrong with this skill or its page? Tell us.