code-structure

Identify duplicated operational logic and separate actions from the service layer.

99|6|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/vvedantb/eva --skill code-structure-vvedantb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-structure
Source: https://github.com/vvedantb/eva/tree/main/.agents/skills/code-structure
Command: npx skills add https://github.com/vvedantb/eva --skill code-structure-vvedantb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Two-layer architecture helps teams avoid duplicating operational logic across workflows by clarifying what belongs in actions vs the shared service layer.

Core Features & Use Cases

  • Clear separation: Actions orchestrate domain rules, while the service layer centralizes reusable mechanics.
  • Reduction of duplication: Encourages extracting repeated blocks into shared services to ensure consistent behavior.
  • Refactoring guidance: Provides criteria for when to extract logic and how to migrate callers to the service layer.

Quick Start

Describe a concrete workflow duplication issue and ask for a mapping of repeated blocks to actions versus a shared service layer.

Frequently Asked Questions about code-structure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor duplicated operational logic across multiple workflows?

To refactor duplicated operational logic, separate workflow actions from the service layer by identifying repeated low-level blocks and extracting them into shared services. This consolidation ensures consistent behavior and establishes clear boundaries between orchestration and implementation.

What is the difference between actions and the service layer in a two-layer architecture?

In a two-layer architecture, actions orchestrate domain rules and workflow logic, while the service layer centralizes reusable mechanics and low-level operations. This separation clarifies boundaries, ensuring consistent behavior by preventing repeated operational blocks across multiple workflows.

When should I extract repeated code blocks into a shared service layer?

Extract repeated code blocks into a shared service layer when you identify duplicated operational logic across multiple workflows. This refactoring centralizes reusable mechanics, ensuring consistent behavior and reducing maintenance overhead by migrating callers to the shared service layer.

What is the best way to reduce code duplication in workflow orchestration?

The best way to reduce code duplication in workflow orchestration is applying a two-layer architecture that separates actions from the service layer. This approach identifies repeated low-level operations and extracts them into shared services, achieving modular design and consistent behavior.

Can I use this refactoring approach for projects with repeated low-level operations?

Yes, this approach specifically targets projects with repeated low-level operations and duplicated workflow logic. It guides refactoring by providing criteria for extracting logic into shared services and migrating callers, satisfying guidelines for explicit inputs, outputs, and modular design.

Why does separating actions from the service layer improve code structure?

Separating actions from the service layer improves code structure by clarifying boundaries between orchestration and implementation. Actions handle domain rules while the service layer centralizes reusable mechanics, eliminating duplicated operational logic and ensuring consistent behavior across workflows.