Agent skill

Newop

by PyLops in PyLops/pylops

Create a new PyLops linear operator following docs/source/adding.rst - class file, docstring, tests, docs entry and example.

LGPL-3.0Auto-check passedDevelopment

Install Newop

skills CLI
$ npx skills add PyLops/pylops --skill newop -a claude-code

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

GitHub CLI
$ gh skill install PyLops/pylops newop --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/PyLops/pylops.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/newop .claude/skills/newop && 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
newop
GitHub stars
539
Token cost
~1.6k tokens
SKILL.md length
733 words
Files
3
Skills in repo
2
Repo updated
First seen
Licence
LGPL-3.0

At a glance

Create a new PyLops linear operator following docs/source/adding.rst - class file, docstring, tests, docs entry and example.

  • Works in 7 steps: Get the source material → Place the file → Write the class → …
  • The user asks to add/implement/port a new operator into PyLops
  • SKILL.md covers 0. Get the source material, 1. Place the file, 2. Write the class and 3. Add tests, plus 3 more sections
  • Runs Python scripts from its folder; calls make and uv

What it does

Newop is an agent skill from PyLops/pylops. Create a new PyLops linear operator following docs/source/adding.rst - class file, docstring, tests, docs entry and example. Use when the user asks to add/implement/port a new operator into PyLops, including porting an existing non-PyLops forward/adjoint implementation from a URL or a local file (e.g. "add a Foo operator", "turn this script into a PyLops operator", "port the operator at <link").

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `reference/operator_template.py` and `reference/test_template.py`).

It sits in Development, covering Technical documentation. It works with Python. The repository describes itself as: PyLops – A Linear-Operator Library for Python. The licence is LGPL-3.0.

When your agent uses it

  • The user asks to add/implement/port a new operator into PyLops
  • Including porting an existing non-PyLops forward/adjoint implementation from a URL
  • A local file (e.g

Example prompts

  • “add a Foo operator”
  • “turn this script into a PyLops operator”
  • “port the operator at <link”
  • “/newop”

Requirements

  • Python 3

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Get the source material
  2. Place the file
  3. Write the class
  4. Add tests
  5. Run
  6. Document
  7. Final checklist (from docs/source/adding.rst)

What it can do on your machine

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

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • make
    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    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

Newop loads about 1.6k tokens when it runs. Until then it costs about 101 tokens; SKILL.md has 733 words of instructions outside code blocks.

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

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 PyLops/pylops at commit 2f06397, republished under its LGPL-3.0 licence (© PyLops). 733 words, ~1,580 tokens.

Download SKILL.mdSave it as .claude/skills/newop/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
newop
description
Create a new PyLops linear operator following docs/source/adding.rst - class file, docstring, tests, docs entry and example. Use when the user asks to add/implement/port a new operator into PyLops, including porting an existing non-PyLops forward/adjoint implementation from a URL or a local file (e.g. "add a Foo operator", "turn this script into a PyLops operator", "port the operator at <link>").

Goal: add a new, PyLops-compliant LinearOperator to the library, complete with docstring, registration, tests, docs entry and a gallery example, following docs/source/adding.rst (the authoritative guide - read it if unsure).

The operator may be written from scratch (from a mathematical description) or ported from an existing non-PyLops implementation supplied as a web link or a local file. Ask for the operator name and the source only if neither is inferable from the invocation.

0. Get the source material

  • Web link: fetch it with WebFetch (or the browser tools if the page needs JS). Extract the actual forward/adjoint code, not the prose.
  • Local file: read it in full.
  • Neither: work from the user's mathematical description, and state the assumed definition of the operator before writing code.

Then write down explicitly, before touching pylops/:

  • what the forward map does, and its input/output shapes;
  • whether the source's "adjoint" is a true adjoint ((\mathbf{A}^H)) or merely an inverse/transpose/approximation - this is the most common porting bug;
  • which source parameters become __init__ arguments, which become derived members, and which are irrelevant (e.g. plotting, I/O, CLI args);
  • whether the operator is real- or complex-linear, and whether it is explicit.

If the source adjoint is not the true adjoint, say so and implement the correct adjoint - the dot-test in step 4 will fail otherwise. Never relax the dot-test tolerance to make a wrong adjoint pass.

1. Place the file

  • One class per file; file named after the class but lowercase (pylops/basicoperators/diagonal.py holds Diagonal). Choose the subpackage by theme: basicoperators, signalprocessing, waveeqprocessing, optimization, etc. Create a new subpackage only if nothing fits.
  • If the operator is just a composition of existing operators, write a function returning the composed operator instead of a class (see pylops.Laplacian).
  • Start the file with __all__ = ["<Operator>"].
  • Register it: add the import/__all__ entry in the subpackage __init__.py (and its module-level summary table), plus the top-level pylops/__init__.py if the operator is meant to be user-facing as pylops.<Operator>.

2. Write the class

Use reference/operator_template.py as the skeleton. Key rules:

  • Inherit from pylops.LinearOperator and initialize via super().__init__(dtype=np.dtype(dtype), dims=dims, dimsd=dimsd, name=name). Prefer dims/dimsd over setting shape directly; shape is derived. Set explicit=True only when the operator also exposes a dense matrix A.
  • Decorate _matvec/_rmatvec with @reshaped when the operator is n-dimensional, so x arrives shaped as dims (dimsd for _rmatvec) and the return value is flattened for you.
  • Use the backend helpers rather than raw NumPy so CuPy/JAX work: pylops.utils.backend.get_array_module, to_cupy_conditional, and friends. Do not import numpy for array creation inside _matvec/_rmatvec.
  • Type-annotate with pylops.utils.typing (NDArray, DTypeLike, InputDimsLike).
  • Keep a name argument (default a short string) for pylops.utils.describe.
  • Write the numpydoc docstring with, at minimum: one-line summary, expanded description, Parameters, Attributes (when non-obvious), Raises (when the __init__ validates inputs), and a Notes section giving the maths of forward and adjoint in .. math:: blocks. Match the level of detail of neighbouring operators.
Show full SKILL.md (262 more words)Show less

3. Add tests

Add to the existing pytests/test_*.py matching the subpackage, or create a new one following the same header (the TEST_CUPY_PYLOPS / backend guard block). Follow reference/test_template.py:

  • module-level par* dicts, parametrized with @pytest.mark.parametrize("par", [...]) covering real/complex and, where relevant, square/over-/under-determined;
  • an assert dottest(Op, nr, nc, rtol=..., complexflag=0 if par["imag"] == 0 else 3, backend=backend) in every test of a new configuration;
  • a forward check against an independently computed expected result (e.g. Op.todense() @ x, or the original source implementation's output);
  • an inversion round-trip with lsqr / Op / y and assert_array_almost_equal when the operator is invertible;
  • error-path tests for anything the __init__ raises.

4. Run

Always use uv:

bash
uv run pytest pytests/test_<file>.py -k <Operator> -q
make lint_uv

Iterate until the dot-test and all assertions pass cleanly.

5. Document

  • Add the operator name to the right autosummary block in docs/source/api/index.rst.
  • Add a gallery example examples/plot_<operator>.py (or a tutorial in tutorials/ for a heavier workflow), following the sphinx-gallery format of examples/plot_diagonal.py: r""" title/underline/description """ header, then ###... comment blocks separating narrative from code, and matplotlib figures showing forward and adjoint (and inversion, if relevant).

6. Final checklist (from docs/source/adding.rst)

Report back confirming each item:

  • single class (or function) in its own file, in a suitable pylops subpackage
  • __init__, _matvec, _rmatvec implemented (plus todense/matrix if cheap)
  • operator exported from the subpackage and top-level __init__.py
  • numpydoc docstring with Parameters and a mathematical Notes section
  • test added, dottest passes, forward/inverse checked
  • listed in docs/source/api/index.rst
  • used in at least one examples/ script or tutorials/ script
  • make lint_uv clean

When porting, close with a short note on what differed between the source implementation and the PyLops version (adjoint correction, shape/flattening conventions, dtype handling, removed I/O).

© PyLops, LGPL-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

SKILL.md and 2 other files in .claude/skills/newop of PyLops/pylops.

  • SKILL.md
  • reference/operator_template.py
  • reference/test_template.py

Open the folder on GitHubat commit 2f06397

Compare with similar skills

Newop 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.

Newop compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Newop this skillPyLops/pylops539—~1.6kAutomated safety check: PassLGPL-3.0
Adk Sample Creatorgoogle/adk-python22k—~1.3kAutomated safety check: PassApache-2.0
Crafting Effective Readmescumbucadev/cinemaempoa1465 repos~669Automated safety check: PassGPL-3.0
Acquire Codebase Knowledgegithub/awesome-copilot40k1 repos~2.3kAutomated safety check: PassMIT
Docs Conventionsflet-dev/flet17k—~1.6kAutomated safety check: PassApache-2.0
DDNS Provider DevelopmentNewFuture/DDNS4.7k—~558Automated safety check: PassMIT

Similar skills

  • Adk Sample Creator

    google/adk-python

    Official

    Creates a new sample agent in the ADK Python repository — the sample directory, its agent.py, and its README.md — following the conventions the existing samples already use.

    22k GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Crafting Effective Readmes

    cumbucadev/cinemaempoa

    A skill your agent uses when writing or improving README files.

    146 GitHub starsUsed in 5 repos~669 tokens
    DevelopmentAuto-check passed
  • Acquire Codebase Knowledge

    github/awesome-copilot

    Official

    Maps an unfamiliar codebase into seven evidence-backed documents in docs/codebase/, using a scan script and templates, for onboarding or architecture write-ups.

    40k GitHub starsUsed in 1 repo~2.3k tokens
    DevelopmentAuto-check passed
  • Docs Conventions

    flet-dev/flet

    A skill your agent uses when writing or reviewing Flet documentation, including Python docstrings (Google style, reST roles, admonitions), Markdown docs (cross-references, images, code examples)…

    17k GitHub stars~1.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Adds or changes a DNS provider in the DDNS project while keeping its code, schemas, tests and Chinese and English docs consistent.

    4.7k GitHub stars~558 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Mkdocs

    jeka-dev/jeka

    MkDocs documentation project reference covering CLI commands, mkdocs.yml configuration, Material theme setup, and plugin integration.

    176 GitHub stars~2k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed

More from PyLops/pylops

  • Optest

    PyLops/pylops

    Raise a PyLops operator's test coverage above a threshold (default 90%) by adding or modifying tests.

    539 GitHub stars~729 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Newop

What does Newop do?

Create a new PyLops linear operator following docs/source/adding.rst - class file, docstring, tests, docs entry and example. Newop is an agent skill from PyLops/pylops.rst - class file, docstring, tests, docs entry and example.

When should I use Newop?

Newop fits situations like: the user asks to add/implement/port a new operator into PyLops; including porting an existing non-PyLops forward/adjoint implementation from a URL; A local file (e.g.

How do I install Newop in Claude Code?

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

How do I install Newop in Codex?

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

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

What does Newop need to run?

Going by SKILL.md and its folder, Newop needs Python for the scripts in its folder and the command-line tools its instructions call (make and uv). Our summary lists: Python 3.

Does Newop access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Newop 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 Newop use?

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

How many tokens does Newop use?

About 1.6k tokens (SKILL.md is roughly 6.3k 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 Newop?

Skills that share tags, products or a category with Newop: Adk Sample Creator (google/adk-python, 22k stars), Crafting Effective Readmes (cumbucadev/cinemaempoa, 146 stars), Acquire Codebase Knowledge (github/awesome-copilot, 40k stars) and Docs Conventions (flet-dev/flet, 17k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Newop?

PyLops (a GitHub organization) maintains it in PyLops/pylops, which has 539 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 7, 2026.

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