Agent skill

New Example

by joselado in joselado/dmrgpy

Add or revise a script under examples/ in dmrgpy. An agent skill from joselado/dmrgpy.

GPL-3.0Auto-check passedDevelopment

Install New Example

skills CLI
$ npx skills add joselado/dmrgpy --skill new-example -a claude-code

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

GitHub CLI
$ gh skill install joselado/dmrgpy new-example --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/joselado/dmrgpy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/new-example .claude/skills/new-example && 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
new-example
GitHub stars
114
Token cost
~1.2k tokens
SKILL.md length
572 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
GPL-3.0

At a glance

Add or revise a script under examples/ in dmrgpy. An agent skill from joselado/dmrgpy.

  • Asks for an example
  • SKILL.md covers Where it goes, The script and Run it before declaring it done
  • Calls python3 and python
  • A script showing how to use a feature

What it does

New Example is an agent skill from joselado/dmrgpy. Add or revise a script under examples/ in dmrgpy. Use this whenever the user asks for an example, a demo, a script showing how to use a feature, a backend-versus-backend comparison, or a regression script in the spirit of tests/, and also when a new feature has just landed and an example for it is the natural next step. The examples tree has rules that are easy to miss (it must plot, it must pin its own sweep schedule, it must import this worktree and not site-packages) and an audit found 105 scripts that had…

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git worktrees. The repository describes itself as: DMRGPy is a Python library to compute quasi-one-dimensional spin chains and fermionic systems using matrix product states with DMRG as implemented in ITensor. Most of the… The licence is GPL-3.0.

When your agent uses it

  • Asks for an example
  • A script showing how to use a feature
  • A backend-versus-backend comparison
  • A regression script in the spirit of tests/

Example prompts

  • “/new-example”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 7373fce. 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

    Shell commands in SKILL.md call:

    • python3
    • python

    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

New Example loads about 1.2k tokens when it runs. Until then it costs about 140 tokens; SKILL.md has 572 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~140
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

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 joselado/dmrgpy at commit 7373fce, republished under its GPL-3.0 licence (© joselado). 572 words, ~1,183 tokens.

Download SKILL.mdSave it as .claude/skills/new-example/SKILL.md (or your agent's skills folder).
name
new-example
description
Add or revise a script under examples/ in dmrgpy. Use this whenever the user asks for an example, a demo, a script showing how to use a feature, a backend-versus-backend comparison, or a regression script in the spirit of tests/, and also when a new feature has just landed and an example for it is the natural next step. The examples tree has rules that are easy to miss (it must plot, it must pin its own sweep schedule, it must import this worktree and not site-packages) and an audit found 105 scripts that had quietly broken the first of them.

Adding an example

examples/ is the second regression surface, and the thing that separates it from tests/ is that a human is expected to look at the result. That is the premise behind most of the rules below.

Where it goes

examples/<theme>/<name>/main.py, one self-contained script per folder. The themes are groundstate, staticcorrelators, dynamical_correlator, spin_models, fermion_models, boson_models, time_evolution, excited_states, entanglement, topological, kondo, non_hermitian, finite_temperature, magnetization, idmrg, backend_comparison, algebra, parity, pyitensor, utilities and readme_examples. Pick the one that matches the physics, not the backend, except for a script whose whole point is comparing backends. A comparison of the two compiled backends is named v2_VS_v3_<thing> and lives in its theme folder. A script that mirrors a snippet from README.md goes in readme_examples/ and has to stay in step with the README.

The script

Open with the path line the tree already uses, which is depth three:

python
# Add the root path of the dmrgpy library
import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src')

Then a short comment saying what the script demonstrates and, where the script is meant as a regression guard, what it is guarding. Build the smallest system that shows the effect, and put the physics before the mechanics.

Pin the sweep schedule. Set nsweeps, maxm and any tolerance explicitly rather than inheriting the library defaults, and assert at a tolerance the pinned schedule actually reaches. boson_models/v2_VS_v3_boson inherited the defaults and its assert then fired non-deterministically on a clean tree, in two runs of five for one reader and five of seven for another: the two backends were converging to the same answer, just not far enough to be compared where it compared them. It now pins nsweeps=80, maxm=100 and asserts at 1e-5.

Plot what you computed. Any script that produces a sequence of values ends with a matplotlib figure of it: a quantity against time, site, frequency or a coupling; two backends overlaid; an error or timing curve. Save it next to main.py under the folder's own name and then show it:

python
plt.savefig("<folder_name>.png",dpi=150)
plt.show()

A script whose entire output is one scalar is the single exception, and it is a last resort rather than a default: before taking it, look for the cheap axis that is almost always already there, such as chain length, a field or coupling, time, bond dimension, site index, or ED against DMRG. The audit that found 105 print-only scripts found that most of them had already computed the array and simply never drew it.

Show full SKILL.md (182 more words)Show less

Assert where the script is a regression guard. Several examples carry real asserts and are meant as tests in the same spirit as tests/, for instance time_evolution/tdvp_VS_ED_time_evolution, backend_comparison/backend_switch_consistency, staticcorrelators/static_correlator_VS_ED and entanglement/entanglement_entropy_VS_ED. Those are the templates to copy. The assert stays as the pass or fail guard and the plot goes in after it, so the one script serves as an automated check and as a visual sanity check when run by hand.

Run it before declaring it done

From the example's own directory, with threads pinned, this worktree's src forced onto the path, and a non-interactive backend so plt.show() does not block:

bash
cd examples/<theme>/<name>
MKL_NUM_THREADS=1 OMP_NUM_THREADS=1 MPLBACKEND=Agg \
  PYTHONPATH=<this worktree>/src python3 main.py

The PYTHONPATH is not belt and braces. The script's own line appends to sys.path, and site-packages/dmrgpy is typically a symlink into one specific checkout, so a plain python3 main.py from another worktree silently exercises the wrong code with no error at all.

Afterwards run python clean.py from the repo root, which removes the generated working directories and stray ERROR/*.OUT files the run leaves behind.

Say what the numbers came out as when you report back, not just that it ran.

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

Files

Just SKILL.md in .claude/skills/new-example of joselado/dmrgpy.

Open the folder on GitHubat commit 7373fce

Compare with similar skills

New Example 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.

New Example compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
New Example this skilljoselado/dmrgpy114—~1.2kAutomated safety check: PassGPL-3.0
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0
Finishing A Development Branchfarm-fe/farm5.6k34 repos~1.8kAutomated safety check: PassMIT
Git Worktree Cleanuplobehub/lobehub83k—~2.8kAutomated safety check: PassCustom licence
Keep Codex Fastvibeforge1111/keep-codex-fast1.6k—~3.1kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    42k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…

    5.6k GitHub starsUsed in 34 repos~1.8k tokens
    DevelopmentAuto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Keep Codex Fast

    vibeforge1111/keep-codex-fast

    A skill your agent uses when Codex feels slow or bloated, when local sessions/logs/worktrees/config have grown over time, or when a user wants safe maintenance for Codex Desktop/CLI state.

    1.6k GitHub stars~3.1k tokensUpdated 5 mo ago
    DevelopmentAuto-check passed
  • Pre-Release PR Triage

    jamiepine/voicebox

    Sorts a backlog of open pull requests into must-merge, candidate, superseded and deferred, writes a triage doc and works the merge loop before a release.

    57k GitHub stars~3.1k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from joselado/dmrgpy

  • Docs Sync

    joselado/dmrgpy

    Update docs/userguide.{md,tex} and docs/documentation.{md,tex} together after a change to dmrgpy, keeping the Markdown and LaTeX versions of each in step and verifying the .tex still compiles under…

    114 GitHub stars~926 tokensUpdated 12 days ago
    Auto-check passed
  • Hole Hunt

    joselado/dmrgpy

    Run a multi-lens hole hunt (audit) of the dmrgpy Python layer, or add a lens, a finding or a fix cluster to an existing one.

    114 GitHub stars~3.4k tokensUpdated 12 days ago
    Auto-check passed

Categories

Questions about New Example

What does New Example do?

Add or revise a script under examples/ in dmrgpy. An agent skill from joselado/dmrgpy. New Example is an agent skill from joselado/dmrgpy. Add or revise a script under examples/ in dmrgpy.

When should I use New Example?

New Example fits situations like: asks for an example; A script showing how to use a feature; A backend-versus-backend comparison; A regression script in the spirit of tests/.

How do I install New Example in Claude Code?

Run `npx skills add joselado/dmrgpy --skill new-example -a claude-code`. Or copy the skill folder (.claude/skills/new-example in joselado/dmrgpy) into .claude/skills/new-example in your project. Claude Code loads it when a task matches its description.

How do I install New Example in Codex?

Run `npx skills add joselado/dmrgpy --skill new-example -a codex`. Or copy the skill folder (.claude/skills/new-example in joselado/dmrgpy) into .agents/skills/new-example in your project. Codex loads it when a task matches its description.

Can I use New Example 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 joselado/dmrgpy --skill new-example -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/new-example, .gemini/skills/new-example, .github/skills/new-example and .opencode/skills/new-example in your project.

What does New Example need to run?

Going by SKILL.md and its folder, New Example needs the command-line tools its instructions call (python3 and python). Our summary lists: Python 3.

Does New Example 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 New Example 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 New Example use?

New Example is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does New Example use?

About 1.2k tokens (SKILL.md is roughly 4.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to New Example?

Skills that share tags, products or a category with New Example: Finishing a Development Branch (obra/superpowers, 296k stars), Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars), Finishing A Development Branch (farm-fe/farm, 5.6k stars) and Git Worktree Cleanup (lobehub/lobehub, 83k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains New Example?

joselado (a GitHub user) maintains it in joselado/dmrgpy, which has 114 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on September 26, 2026.

Source: joselado/dmrgpy on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.