Agent skill

Code Structure

by vvedantb in vvedantb/eva

A skill your agent uses when multiple workflows duplicate the same operational logic, when deciding what belongs in actions vs shared services, or when refactoring repeated operational blocks across…

MITAuto-check passedDevelopment

Install Code Structure

skills CLI
$ npx skills add vvedantb/eva --skill code-structure -a claude-code

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

GitHub CLI
$ gh skill install vvedantb/eva 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/vvedantb/eva.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/code-structure .claude/skills/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
code-structure
GitHub stars
101
Used in
2 other repos
Token cost
~1.1k tokens
SKILL.md length
363 words
Files
1
Skills in repo
23
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when multiple workflows duplicate the same operational logic, when deciding what belongs in actions vs shared services, or when refactoring repeated operational blocks across…

  • Works in 6 steps: Write the flow in action code first… → Mark repeated operational chunks across… → Extract only repeated, non-domain chunks… → …
  • Multiple workflows duplicate the same operational logic
  • SKILL.md covers Overview, When to Use, Core Pattern and Quick Reference, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Code Structure is an agent skill from vvedantb/eva. Use when multiple workflows duplicate the same operational logic, when deciding what belongs in actions vs shared services, or when refactoring repeated operational blocks across domain flows. Use when adding new features that share mechanics with existing ones.

Its SKILL.md is about 1.1k 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 Refactoring. The repository describes itself as: Orchestrate sandboxed agents that run in the cloud while you work. The licence is MIT.

When your agent uses it

  • Multiple workflows duplicate the same operational logic
  • Deciding what belongs in actions vs shared services
  • Refactoring repeated operational blocks across domain flows
  • Adding new features that share mechanics with existing ones

Example prompts

  • “/code-structure”

Workflow steps

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

  1. Write the flow in action code first (clear behavior)
  2. Mark repeated operational chunks across callers
  3. Extract only repeated, non-domain chunks to service
  4. Replace one caller → verify → replace remaining callers
  5. Keep domain policy in actions (auth, status transitions, error classification)
  6. Run verification: typecheck, lint, confirm all flows still work

What it can do on your machine

Read from SKILL.md and the folder at commit 166d464. 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 (its code samples are typescript).

    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

Code Structure loads about 1.1k tokens when it runs. Until then it costs about 69 tokens; SKILL.md has 363 words of instructions outside code blocks.

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

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 vvedantb/eva at commit 166d464, republished under its MIT licence (© vvedantb). 363 words, ~1,124 tokens.

Download SKILL.mdSave it as .claude/skills/code-structure/SKILL.md (or your agent's skills folder).
name
code-structure
description
Use when multiple workflows duplicate the same operational logic, when deciding what belongs in actions vs shared services, or when refactoring repeated operational blocks across domain flows. Use when adding new features that share mechanics with existing ones.

Service Layer Architecture

Overview

Two-layer separation: Actions orchestrate domain rules (the "why/when"), while a service layer centralizes reusable operational mechanics (the "how").

This prevents duplicated code, inconsistent behavior, and bugs fixed in one path but not others.

When to Use

  • Multiple callers need the same low-level operation (sandbox creation, email sending, payment processing)
  • You're copy-pasting operational logic between action files
  • A bug fix in one workflow doesn't propagate to others doing the same thing
  • Adding a new feature that shares mechanics with existing flows

Don't use when: Logic is truly domain-specific and used by only one caller.

Core Pattern

Orchestration Layer (Actions)          Service Layer (Shared Mechanics)
├── owns business rules                ├── owns reusable operations
├── owns state transitions             ├── owns provider/SDK interactions
├── owns auth/ownership checks         ├── owns command execution details
├── owns failure classification        ├── owns health checks / readiness
├── owns retries / user-facing errors  └── returns structured results
└── calls service functions

Rule of thumb:

  • "What this product flow means" → keep in actions
  • "How to do this operation reliably" → move to service layer

Quick Reference

Design PrincipleDoDon't
API shapeComposable capability blocksOne giant "do everything" method
Inputs/outputsExplicit params, structured returnsHidden global state, reaching into DB
MigrationExtract one block, replace one caller, verify, then migrate restRefactor everything at once
Domain logicKeep auth, policy, error classification in actionsLet service mutate domain state directly
Extraction triggerLogic repeated across 2+ callersLogic used once (over-abstraction)

Designing Service Functions

Design as capability blocks, not monoliths:

ts
// Good: composable, each caller chooses what to use
createManagedSandbox(...)
prepareRepo(...)
detectPackageManager(...)
installDependencies(...)
runBuildCommand(...)
startSandboxRuntime(...)

Each function should:

  • Accept all required data as explicit parameters
  • Return structured outputs (e.g., { ready, previewUrl, proxyPort })
  • Never reach into database/state directly
  • Make failure explicit (structured results, not swallowed errors)

This lets callers choose strict vs relaxed behavior per flow.

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

Migration Checklist

When extracting shared logic:

  1. Write the flow in action code first (clear behavior)
  2. Mark repeated operational chunks across callers
  3. Extract only repeated, non-domain chunks to service
  4. Replace one caller → verify → replace remaining callers
  5. Keep domain policy in actions (auth, status transitions, error classification)
  6. Run verification: typecheck, lint, confirm all flows still work

Anti-Patterns

Anti-PatternProblem
God serviceOne huge function hides all control flow
Leaky serviceService mutates database tables directly
Inconsistent APIEach function uses different argument styles and error semantics
Over-abstractionExtracting logic used by only one caller

Example: Email Service (Simple)

ts
// emailService.ts — shared mechanics
export async function sendWelcomeEmail(params: { to: string; name: string }) {
  const html = `<h1>Welcome ${params.name}</h1>`;
  await emailProvider.send(params.to, "Welcome", html);
}

// userSignup.ts — orchestration (owns WHEN to send)
if (user.marketingOptIn) {
  await sendWelcomeEmail({ to: user.email, name: user.name });
}

// adminInvite.ts — orchestration (different business rule, same mechanic)
await sendWelcomeEmail({ to: invitee.email, name: invitee.name });

Mental Model

New feature? → Write in action first → See repeated ops? → Extract to service
                                      → No repetition?  → Keep in action

Your architecture in one sentence: Actions orchestrate domain rules, while the service layer centralizes reusable operational mechanics with a composable, explicit-input API.

© vvedantb, MIT. 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 .agents/skills/code-structure of vvedantb/eva.

Open the folder on GitHubat commit 166d464

Used in 2 other repositories

We found 3 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in vvedantb/eva, which our catalogue first saw on October 7, 2026.

Compare with similar skills

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.

Code Structure compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Structure this skillvvedantb/eva1012 repos~1.1kAutomated safety check: PassMIT
Guidelinesakash-network/node1.1k22 repos~577Automated safety check: PassMIT
Component Refactoringlangflow-ai/langflow156k—~3.5kAutomated safety check: PassMIT
Migrate Core Code to Submodulestinyhumansai/openhuman41k—~2.6kAutomated safety check: PassGPL-3.0
ast-grep Structural Searchcode-yeongyu/oh-my-openagent70k—~3.3kAutomated safety check: PassMIT
Systematic Code Refactoringluongnv89/claude-howto42k—~3kAutomated safety check: PassMIT

Similar skills

  • 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
  • Component Refactoring

    langflow-ai/langflow

    Refactor high-complexity React components in Langflow frontend.

    156k GitHub stars~3.5k tokensUpdated today
    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.

    41k GitHub stars~2.6k tokensUpdated today
    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
  • Systematic Code Refactoring

    luongnv89/claude-howto

    Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.

    42k GitHub stars~3k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Codex

    skills-directory/skill-codex

    A skill your agent uses when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing

    1.5k GitHub starsUsed in 3 repos~1.8k tokens
    DevelopmentAuto-check passed

More from vvedantb/eva

All 23 skills in this repo
  • Eva Feature Demo

    vvedantb/eva

    Record a real agent-browser screencast of one eva feature being used end to end, convert it to an X-ready mp4, and write a tweet for it.

    101 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Animate

    vvedantb/eva

    Build an animation from scratch, making the decisions in the order that determines whether it feels right — should it animate at all, what purpose, which tool, which properties, which curve and…

    101 GitHub starsUsed in 6 repos~2.9k tokens
    Auto-check passed
  • Design and build Convex components with clear boundaries, isolated state, and app-facing wrappers.

    101 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Grab a single clean HD screenshot of a new eva feature from the real running app (Playwright at deviceScaleFactor 2, 1280 layout captured crisp at 2560×1440, dev overlays hidden) and write a tweet…

    101 GitHub stars~3.2k tokensUpdated today
    Auto-check: notes
  • Eva Launch Video

    vvedantb/eva

    Produce polished, mobile-friendly product demo videos of the eva app with Remotion — 1280×720, snappy beat-synced hard cuts, lo-fi music that swells on every cut, and footage captured from the REAL…

    101 GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Libraries Dev

    vvedantb/eva

    Use the Libraries.dev UI effect libraries correctly and find where they fit in a project.

    101 GitHub stars~2.5k tokensUpdated today
    Auto-check passed

Categories

Questions about Code Structure

What does Code Structure do?

A skill your agent uses when multiple workflows duplicate the same operational logic, when deciding what belongs in actions vs shared services, or when refactoring repeated operational blocks across…. Code Structure is an agent skill from vvedantb/eva. Use when multiple workflows duplicate the same operational logic, when deciding what belongs in actions vs shared services, or when refactoring repeated operational blocks across domain flows.

When should I use Code Structure?

Code Structure fits situations like: multiple workflows duplicate the same operational logic; deciding what belongs in actions vs shared services; refactoring repeated operational blocks across domain flows; adding new features that share mechanics with existing ones.

How do I install Code Structure in Claude Code?

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

How do I install Code Structure in Codex?

Run `npx skills add vvedantb/eva --skill code-structure -a codex`. Or copy the skill folder (.agents/skills/code-structure in vvedantb/eva) into .agents/skills/code-structure in your project. Codex loads it when a task matches its description.

Can I use 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 vvedantb/eva --skill 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/code-structure, .gemini/skills/code-structure, .github/skills/code-structure and .opencode/skills/code-structure in your project.

What does Code Structure need to run?

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

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

Code Structure is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Structure use?

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

Skills that share tags, products or a category with Code Structure: Guidelines (akash-network/node, 1.1k stars), Component Refactoring (langflow-ai/langflow, 156k stars), Migrate Core Code to Submodules (tinyhumansai/openhuman, 41k stars) and ast-grep Structural Search (code-yeongyu/oh-my-openagent, 70k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Structure?

vvedantb (a GitHub user) maintains it in vvedantb/eva, which has 101 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on October 6, 2026.

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