code-structure
Separate orchestration from reusable mechanics while preserving transactions.
Skill by michaelshimeles
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/jaydubya818-code-structure
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/code-structure
What's inside
- Skill name
code-structure- Description
- Separate orchestration from reusable mechanics while preserving transactions. Use when workflows duplicate operational logic.
- License
- MIT
- Metadata
- risk: low · owner: software-factory · author: michaelshimeles · version: 2.0.0 · capabilities: architecture,refactoring
- Instructions
- 120 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- openai.yaml · agents/
SKILL.md (first lines)
# Service Layer Architecture
## Overview
This collection prefers a two-layer separation: actions orchestrate domain
rules, while services implement reusable operations. Use it where the project
has no established convention. Preserve existing domain services, repositories,
transaction boundaries, and framework patterns when they already fit the task.
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
Avoid extraction that adds indirection without a concrete benefit. Repetition
is a useful signal, but a single caller can justify a boundary for testing,
provider isolation, transactions, or complex logic.
## 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 Principle | Do | Don't |
|---|---|---|
| API shape | Composable capability blocks | One giant "do everything" method |
| Inputs/outputs | Explicit dependencies and meaningful results | Hidden global state or undocumented side effects |
| Migration | Extract one block, replace one caller, verify, then migrate rest | Refactor everything at once |
| Domain logic | Put policy and transactions in the project's established owner | Scatter the same policy across callers |
| Extraction trigger | Repeated mechanics or a concrete boundary benefit | Speculative abstractions with no current benefit |
## 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 }`)
- Inject database or repository access when the service owns persistence under
the project's architecture. State writes and transaction boundaries explicitly.
- Make failure explicit through typed results or documented exceptions
This lets callers choose strict vs relaxed behavior per flow.
## Migration Checklist
When extracting shared logic:
1. Identify the existing owners of policy, persistence, and transactions
2. Mark repeated operations or boundaries with a concrete current benefit
3. Extract a cohesive operation consistent with those owners
4. Replace one caller → verify → replace remaining callers
5. Preserve auth, status transitions, error handling, and transaction behavior
6. Run verification: typecheck, lint, confirm all flows still work
## Anti-Patterns
| Anti-Pattern | Problem |
|---|---|
| **God service** | One huge function hides all control flow |
| **Leaky service** | Hidden state changes or unclear transaction ownership |
| **Inconsistent API** | Each function uses different argument styles and error semantics |
| **Over-abstraction** | Indirection with no reuse, testability, or boundary benefit |
## 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
```
Existing architecture? → Follow its boundaries
No convention? → Prefer actions for orchestration and services for operations
Extraction? → Name its concrete benefit before adding another layer
```
Keep responsibilities clear, dependencies explicit, and side effects visible.From jaydubya818/MissionControl, MIT.
More from jaydubya818/MissionControl
- 0.599score
mission-control-agent-integration
jaydubya818
Umbrella skill for integrating an agent with Mission Control, the orchestration and observability control plane.
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
agent-watchdog
jaydubya818
Use when asked to watch, babysit, audit, review, compare, or fix another agent's work from a Codex session ID, Claude Code session/transcript, chat/thread…
SkillAFreshness: A★ 2Claude Code +9 - 0.563score
evidence-driven-testing
michaelshimeles
Capture observable runtime proof with video, screenshots, or measured output.
SkillBFreshness: B★ 2Claude Code +9 - 0.563score
before-and-after
vercel-labs
Capture before/after screenshots of pages, elements, or images.
SkillBFreshness: B★ 2Claude Code +9 - 0.561score
create-verification-skill
jstack-maintainers
Use when a repository needs a repeatable driver that proves real UI, CLI, or service behavior.
SkillBFreshness: B★ 2Claude Code +9 - 0.557score
architect
jstack-maintainers
Use when a non-trivial change needs types and module boundaries designed before code.
SkillBFreshness: B★ 2Claude Code +9 - 0.556score
automate-me
jstack-maintainers
Use when the user wants working preferences captured in a reusable mode skill.
SkillBFreshness: B★ 2Claude Code +9 - 0.556score
babysit
jstack-maintainers
Use when an authorized pull request needs ongoing CI and review follow-through.
SkillBFreshness: B★ 2Claude Code +9 - 0.556score
blast-radius
jstack-maintainers
Use when a change needs downstream risks traced and its key safety assumption proved.
SkillBFreshness: B★ 2Claude Code +9 - 0.552score
arena
jstack-maintainers
Use when an important artifact needs independent solutions compared and synthesized.
SkillBFreshness: B★ 2Claude Code +9 - 0.551score
deslop
jstack-maintainers
Use when code needs generated clutter removed and structure simplified without behavior changes.
SkillBFreshness: B★ 2Claude Code +9 - 0.526score
bro
jstack-maintainers
Use when the previous technical answer needs a direct, jargon-free restatement.
SkillBFreshness: B★ 2Claude Code +9
Signals
- Stars
- 2
- Forks
- 1
- Open issues
- 4
- Last commit (this folder)
- Sep 22, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 2.0.0
- License
- MIT
- Repository
- github.com/jaydubya818/MissionControl
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from michaelshimeles
Cite this page
code-structure skill. Agent Mart. https://agentmart.dev/skills/jaydubya818-code-structure (last updated 2026-10-24)