Agent skill

Structural Edits

by Zfinix in Zfinix/aster

Structural search and rewrite with the astgrep and astedit tools.

Apache-2.0Auto-check passedDevelopment

Install Structural Edits

skills CLI
$ npx skills add Zfinix/aster --skill structural-edits -a claude-code

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

GitHub CLI
$ gh skill install Zfinix/aster structural-edits --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/Zfinix/aster.git skills-src && mkdir -p .claude/skills && cp -r skills-src/crates/aster-skills/builtins/internal/structural-edits .claude/skills/structural-edits && 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
structural-edits
GitHub stars
112
Token cost
~537 tokens
SKILL.md length
295 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
Apache-2.0

At a glance

Structural search and rewrite with the astgrep and astedit tools.

  • Works in 7 steps: ast_grep over search_files when syntax… → ast_edit over repeated edit_file when… → Metavariables carry the capture. $X… → …
  • The same pattern appears in many places
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Text search matches comments

What it does

Structural Edits is an agent skill from Zfinix/aster. Structural search and rewrite with the astgrep and astedit tools. Use when the same pattern appears in many places, when text search matches comments or strings, or when a rename or codemod spans multiple files.

Its SKILL.md is about 540 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 Code migrations. The repository describes itself as: An open-source agent harness for software work. The licence is Apache-2.0.

When your agent uses it

  • The same pattern appears in many places
  • Text search matches comments
  • Codemod spans multiple files

Example prompts

  • “/structural-edits”

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. ast_grep over search_files when syntax matters. ast_grep with a
  2. ast_edit over repeated edit_file when the same change repeats. One
  3. Metavariables carry the capture. $X captures a single node,
  4. Patterns must parse as the target language. A pattern that is not
  5. Patterns exclude trailing semicolons. A pattern for dbg!($X)
  6. Run ast_grep first when unsure. A dry search with the same pattern
  7. Read the diff at approval time. A too-broad pattern rewrites code you

What it can do on your machine

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

    No scripts in the folder and no shell commands in SKILL.md.

    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

Structural Edits loads about 537 tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 295 words of instructions outside code blocks.

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

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 Zfinix/aster at commit 3fbb67c, republished under its Apache-2.0 licence (© Zfinix). 295 words, ~537 tokens.

Download SKILL.mdSave it as .claude/skills/structural-edits/SKILL.md (or your agent's skills folder).
name
structural-edits
description
Structural search and rewrite with the ast_grep and ast_edit tools. Use when the same pattern appears in many places, when text search matches comments or strings, or when a rename or codemod spans multiple files.

Structural edits

  1. ast_grep over search_files when syntax matters. ast_grep with a pattern like dbg!($X) or fn $NAME($$$ARGS) matches real code, not comments or string literals. Plain text search is fine for identifiers that appear nowhere else. Scope with path to one directory when the change is local.
  2. ast_edit over repeated edit_file when the same change repeats. One pattern plus rewrite applies everywhere at once and returns a diff. Three or more identical edits means ast_edit; one or two means edit_file. Example: pattern dbg!($X) with rewrite eprintln!("{:?}", $X) removes every debug print in the scope in one approval.
  3. Metavariables carry the capture. $X captures a single node, $$$ARGS captures a list. Reuse the same name in the rewrite; a name that appears only in the rewrite is an error, not an insertion.
  4. Patterns must parse as the target language. A pattern that is not valid syntax in the file's language matches nothing, silently. Write the pattern in the language you are editing, and keep it narrow with context ($OBJ.foo($$$ARGS) rather than foo($$$ARGS)) so unrelated calls do not match.
  5. Patterns exclude trailing semicolons. A pattern for dbg!($X) matches the call, not the ; after it. Do not put a semicolon in the pattern or the rewrite unless the statement itself is the target.
  6. Run ast_grep first when unsure. A dry search with the same pattern shows exactly what ast_edit would touch, with no approval needed. If the match list surprises you, fix the pattern before rewriting.
  7. Read the diff at approval time. A too-broad pattern rewrites code you did not intend, and the diff is the only place you will see that. Every changed file goes through the same approval as edit_file; a Deny on one file stops the whole batch.

© Zfinix, Apache-2.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 crates/aster-skills/builtins/internal/structural-edits of Zfinix/aster.

Open the folder on GitHubat commit 3fbb67c

Compare with similar skills

Structural Edits 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.

Structural Edits compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Structural Edits this skillZfinix/aster112—~537Automated safety check: PassApache-2.0
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0
Migrate Internal Package into GhostTryGhost/Ghost55k—~3.8kAutomated safety check: PassMIT
Next Cache Components Adoptionvercel/next.js143k6 repos~8.3kAutomated safety check: PassMIT
Deprecate R Functions and Argumentstidyverse/dplyr5.1k1 repos~1.2kAutomated safety check: PassCustom licence
Rust Path Typesopeninterpreter/openinterpreter69k2 repos~605Automated safety check: PassApache-2.0

Similar skills

  • 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
  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    55k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Official

    Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces.

    143k GitHub starsUsed in 6 repos~8.3k tokens
    DevelopmentAuto-check passed
  • Walks through deprecating an R function or argument in a package: lifecycle warning, silenced tests, a new snapshot test, documentation badge and NEWS entry.

    5.1k GitHub starsUsed in 1 repo~1.2k tokens
    DevelopmentAuto-check passed
  • Rust Path Types

    openinterpreter/openinterpreter

    Rules for choosing Rust types for filesystem paths in new Codex code, covering protocol types, internal use and model tool arguments.

    69k GitHub starsUsed in 2 repos~605 tokens
    DevelopmentAuto-check passed
  • ast-grep Structural Search

    code-yeongyu/oh-my-openagent

    Searches and rewrites code by syntax-tree shape across 25 languages with ast-grep, for codemods, structural queries and YAML lint rules, using a Python wrapper script.

    70k GitHub stars~3.3k tokensUpdated today
    DevelopmentAuto-check passed

More from Zfinix/aster

All 19 skills in this repo
  • Artifact Design

    Zfinix/aster

    Designing and building any user-facing surface: a web page, landing page, dashboard, report, HTML document, email, or a component inside an existing app.

    112 GitHub stars~2.8k tokensUpdated 2 days ago
    Auto-check passed
  • Drive aster chat programmatically and manage sessions and memory: one-shot --print/--json answers, --messages-json for caller-owned history, --continue and --session persistence, --allow-edits…

    112 GitHub stars~591 tokensUpdated 2 days ago
    Auto-check passed
  • Aster CLI

    Zfinix/aster

    Guidance for using the aster CLI to work in a codebase with an AI agent: chat and edit code, run AI code reviews, apply fixes, and manage sessions, memory, and skills.

    112 GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed
  • Aster Config

    Zfinix/aster

    Reference for aster.yaml, covering review models, analyzers, focus areas, include/exclude globs, minconfidence, and the permissions block that gates edits.

    112 GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed
  • Aster Fix Workflow

    Zfinix/aster

    Pipe aster review findings into aster fix to generate and apply patches safely, using review --json, fix --findings-json, dry-run inspection, --apply, and permission gating.

    112 GitHub stars~534 tokensUpdated 2 days ago
    Auto-check passed
  • Aster Planning

    Zfinix/aster

    Create and execute structured plans for multi-step tasks. An agent skill from Zfinix/aster.

    112 GitHub stars~1k tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about Structural Edits

What does Structural Edits do?

Structural search and rewrite with the astgrep and astedit tools. Structural Edits is an agent skill from Zfinix/aster. Structural search and rewrite with the astgrep and astedit tools.

When should I use Structural Edits?

Structural Edits fits situations like: the same pattern appears in many places; text search matches comments; codemod spans multiple files.

How do I install Structural Edits in Claude Code?

Run `npx skills add Zfinix/aster --skill structural-edits -a claude-code`. Or copy the skill folder (crates/aster-skills/builtins/internal/structural-edits in Zfinix/aster) into .claude/skills/structural-edits in your project. Claude Code loads it when a task matches its description.

How do I install Structural Edits in Codex?

Run `npx skills add Zfinix/aster --skill structural-edits -a codex`. Or copy the skill folder (crates/aster-skills/builtins/internal/structural-edits in Zfinix/aster) into .agents/skills/structural-edits in your project. Codex loads it when a task matches its description.

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

What does Structural Edits need to run?

SKILL.md names no scripts, command-line tools or credentials: Structural Edits is instructions for the agent only.

Does Structural Edits 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 Structural Edits 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 Structural Edits use?

Structural Edits is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Structural Edits use?

About 537 tokens (SKILL.md is roughly 2.1k 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 Structural Edits?

Skills that share tags, products or a category with Structural Edits: Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars), Migrate Internal Package into Ghost (TryGhost/Ghost, 55k stars), Next Cache Components Adoption (vercel/next.js, 143k stars) and Deprecate R Functions and Arguments (tidyverse/dplyr, 5.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Structural Edits?

Zfinix (a GitHub user) maintains it in Zfinix/aster, which has 112 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 6, 2026.

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