Agent skill

Analyzing Code Structure

by SebastienDegodez in SebastienDegodez/copilot-instructions

A skill your agent uses when editing code structure with text matching ambiguity, handling "oldstring not unique" problems, or performing formatting-independent pattern matching across function…

Apache-2.0Auto-check passedDevelopment

Install Analyzing Code Structure

skills CLI
$ npx skills add SebastienDegodez/copilot-instructions --skill analyzing-code-structure -a claude-code

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

GitHub CLI
$ gh skill install SebastienDegodez/copilot-instructions analyzing-code-structure --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/SebastienDegodez/copilot-instructions.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/minimal-context-tools/skills/analyzing-code-structure .claude/skills/analyzing-code-structure && 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
analyzing-code-structure
GitHub stars
197
Token cost
~998 tokens
SKILL.md length
399 words
Files
2
Skills in repo
19
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when editing code structure with text matching ambiguity, handling "oldstring not unique" problems, or performing formatting-independent pattern matching across function…

  • Editing code structure with text matching ambiguity
  • SKILL.md covers Default Strategy, When to Use…, Key Decision Rule and Detailed Reference, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Handling oldstring not unique problems

What it does

Analyzing Code Structure is an agent skill from SebastienDegodez/copilot-instructions. Use when editing code structure with text matching ambiguity, handling "oldstring not unique" problems, or performing formatting-independent pattern matching across function signatures, method calls, and class structures

Its SKILL.md is about 1000 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `reference/ast-grep-guide.md`).

It sits in Development. The repository describes itself as: A comprehensive codebase of best practices, coding rules, and workflow automation for AI-assisted development with GitHub Copilot. Includes DDD, Clean Architecture, testing… The licence is Apache-2.0.

When your agent uses it

  • Editing code structure with text matching ambiguity
  • Handling oldstring not unique problems
  • Performing formatting-independent pattern matching across function signatures
  • Class structures

Example prompts

  • “oldstring not unique”
  • “/analyzing-code-structure”

What it can do on your machine

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

Analyzing Code Structure loads about 998 tokens when it runs. Until then it costs about 62 tokens; SKILL.md has 399 words of instructions outside code blocks.

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

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 SebastienDegodez/copilot-instructions at commit 0f0dccf, republished under its Apache-2.0 licence (© SebastienDegodez). 399 words, ~998 tokens.

Download SKILL.mdSave it as .claude/skills/analyzing-code-structure/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
analyzing-code-structure
description
Use when editing code structure with text matching ambiguity, handling "old_string not unique" problems, or performing formatting-independent pattern matching across function signatures, method calls, and class structures

ast-grep: Structural Code Search and Editing

Always invoke the ast-grep skill for structural code search and refactoring - do not execute bash commands directly.

Default Strategy

Invoke analyzing-code-structure skill for structural code search and refactoring. Use when:

  • Text-based Edit tool fails with "old_string not unique"
  • Need formatting-independent pattern matching
  • Performing structural changes across code

Common workflow: Invoke extracting-code-structure skill first, then analyzing-code-structure skill for structural modifications.

Use ast-grep to solve the "old_string not unique" problem by matching code structure instead of exact text. This enables refactoring across formatting variations and structural patterns.

When to Use analyzing-code-structure vs Text Tools

Use analyzing-code-structure when:
  • Structural code changes - Refactoring function signatures, method calls, class structures
  • Formatting-independent matching - Need to find code regardless of whitespace/line breaks
  • Pattern variations - Matching similar structures with different variable names/arguments
  • "old_string not unique" problem - Edit tool fails because text appears in multiple contexts
  • Complex queries - Finding nested structures, specific AST patterns
Use text tools (Edit/Grep) when:
  • Simple, unique string replacement - The exact text appears once or in consistent format
  • Non-code files - Markdown, configs, data files
  • Comment/documentation edits - Content that isn't code structure
  • Very small changes - Single line, obvious context, no ambiguity

Key Decision Rule

If editing code structure and there's any ambiguity in text matching → use analyzing-code-structure.

ast-grep's primary value: Solves the "old_string not unique" problem by matching structure instead of exact text.

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

Detailed Reference

For comprehensive patterns, syntax, metavariables, common use cases, language-specific tips, and best practices, load analyzing-code-structure guide when needing:

  • Complex pattern matching with metavariables
  • Language-specific syntax variations
  • Advanced refactoring workflows
  • Integration with other tools
  • Common pitfalls and solutions

The reference includes:

  • Pattern syntax and metavariables ($VAR, $$$ARGS, $$STMT)
  • Recommended workflow (search, verify, apply, validate)
  • Common use cases with examples (function calls, imports, method renames)
  • Language-specific tips (JavaScript/TypeScript, Python, Go, Rust)
  • Best practices and pitfalls to avoid
  • Integration strategies with Edit tool

Skill Combinations

For Discovery Phase
  • extracting-code-structure → analyzing-code-structure: Get code outline first, then perform structural refactoring
  • searching-text → analyzing-code-structure: Search text patterns to locate areas needing structural changes
  • finding-files → analyzing-code-structure: Find files of specific type, then apply structural modifications
For Analysis Phase
  • analyzing-code-structure → viewing-files: Preview changes with syntax highlighting before committing
  • analyzing-code-structure → searching-text: Verify no unintended occurrences remain
  • analyzing-code-structure → extracting-code-structure: Validate structural changes against code outline
For Refactoring Phase
  • analyzing-code-structure → analyzing-code: Measure changes impact on code statistics
  • analyzing-code-structure → replacing-text: Follow structural changes with text-based replacements if needed
  • analyzing-code-structure → querying-json/querying-yaml: Update configuration files related to code changes

© SebastienDegodez, 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

SKILL.md and 1 other file in plugins/minimal-context-tools/skills/analyzing-code-structure of SebastienDegodez/copilot-instructions.

  • SKILL.md
  • reference/ast-grep-guide.md

Open the folder on GitHubat commit 0f0dccf

Compare with similar skills

Analyzing Code Structure 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.

Analyzing Code Structure compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Analyzing Code Structure this skillSebastienDegodez/copilot-instructions197—~998Automated safety check: PassApache-2.0
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k24 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
Greplooponyx-dot-app/onyx32k4 repos~3.3kAutomated 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
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 24 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed
  • Guidelines

    akash-network/node

    Behavioral guidelines to reduce common LLM coding mistakes. An agent skill from akash-network/node.

    1.1k GitHub starsUsed in 22 repos~577 tokens
    DevelopmentAuto-check passed

More from SebastienDegodez/copilot-instructions

All 19 skills in this repo
  • Setup Husky Dotnet

    SebastienDegodez/copilot-instructions

    A skill your agent uses when configuring Git hooks in .NET projects before team commits occur, to enforce commit message standards and code formatting automatically

    197 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Clean Architecture Dotnet

    SebastienDegodez/copilot-instructions

    A skill your agent uses when domain logic leaks into API/Infrastructure, project references violate layer boundaries, or you need to decide between CQS (always), CQRS bus (complex domains), and DDD…

    197 GitHub stars~5.1k tokensUpdated today
    Auto-check passed
  • Outside In TDD

    SebastienDegodez/copilot-instructions

    A skill your agent uses when writing tests from the outside-in, defining behavior before code, or any feature where tests should start from observable business behavior and let internal design emerge

    197 GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Creating Dotnet MCP Servers

    SebastienDegodez/copilot-instructions

    A skill your agent uses when building Model Context Protocol (MCP) servers in .NET, configuring tools, transports (SSE/stdio), JSON serialization for AOT, or testing MCP endpoints

    197 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Generate Microcks Openapi Samples

    SebastienDegodez/copilot-instructions

    A skill your agent uses when creating OpenAPI mock examples for Microcks, setting up request/response routing with dispatchers, or mapping request fields to mock responses

    197 GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Analyzing Code

    SebastienDegodez/copilot-instructions

    A skill your agent uses when understanding project composition by language, measuring code change impact, or generating code statistics for CI/CD metrics

    197 GitHub stars~1k tokensUpdated today
    Auto-check passed

Categories

Questions about Analyzing Code Structure

What does Analyzing Code Structure do?

A skill your agent uses when editing code structure with text matching ambiguity, handling "oldstring not unique" problems, or performing formatting-independent pattern matching across function…. Analyzing Code Structure is an agent skill from SebastienDegodez/copilot-instructions.

When should I use Analyzing Code Structure?

Analyzing Code Structure fits situations like: editing code structure with text matching ambiguity; handling oldstring not unique problems; performing formatting-independent pattern matching across function signatures; class structures.

How do I install Analyzing Code Structure in Claude Code?

Run `npx skills add SebastienDegodez/copilot-instructions --skill analyzing-code-structure -a claude-code`. Or copy the skill folder (plugins/minimal-context-tools/skills/analyzing-code-structure in SebastienDegodez/copilot-instructions) into .claude/skills/analyzing-code-structure in your project. Claude Code loads it when a task matches its description.

How do I install Analyzing Code Structure in Codex?

Run `npx skills add SebastienDegodez/copilot-instructions --skill analyzing-code-structure -a codex`. Or copy the skill folder (plugins/minimal-context-tools/skills/analyzing-code-structure in SebastienDegodez/copilot-instructions) into .agents/skills/analyzing-code-structure in your project. Codex loads it when a task matches its description.

Can I use Analyzing Code Structure 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 SebastienDegodez/copilot-instructions --skill analyzing-code-structure -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/analyzing-code-structure, .gemini/skills/analyzing-code-structure, .github/skills/analyzing-code-structure and .opencode/skills/analyzing-code-structure in your project.

What does Analyzing Code Structure need to run?

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

Does Analyzing Code Structure 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 Analyzing Code Structure 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 Analyzing Code Structure use?

Analyzing Code Structure 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 Analyzing Code Structure use?

About 998 tokens (SKILL.md is roughly 4k 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 Analyzing Code Structure?

Skills that share tags, products or a category with Analyzing Code Structure: Finishing a Development Branch (obra/superpowers, 296k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars), PR Babysitter (openinterpreter/openinterpreter, 69k stars) and Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Analyzing Code Structure?

SebastienDegodez (a GitHub user) maintains it in SebastienDegodez/copilot-instructions, which has 197 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 6, 2026.

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