본문으로 건너뛰기
cccskills
무료GitHub에 공개

code-structure

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md4.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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 PrincipleDoDon't
API shapeComposable capability blocksOne giant "do everything" method
Inputs/outputsExplicit dependencies and meaningful resultsHidden global state or undocumented side effects
MigrationExtract one block, replace one caller, verify, then migrate restRefactor everything at once
Domain logicPut policy and transactions in the project's established ownerScatter the same policy across callers
Extraction triggerRepeated mechanics or a concrete boundary benefitSpeculative abstractions with no current benefit

Designing Service Functions

Design as capability blocks, not monoliths:

// 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-PatternProblem
God serviceOne huge function hides all control flow
Leaky serviceHidden state changes or unclear transaction ownership
Inconsistent APIEach function uses different argument styles and error semantics
Over-abstractionIndirection with no reuse, testability, or boundary benefit

Example: Email Service (Simple)

// 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.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Captures before/after screenshots of web pages or elements for visual comparison. Use when user says "take before and after", "screenshot comparison", "visual diff", "PR screenshots", "compare old and new", or needs to document UI changes. Accepts two URLs (file://, http://, https://) or two image paths.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

michaelshimeles/skills1.4천2026년 10월 19일 업데이트

Records visual proof while testing UI behavior — the agent tests the app hands-on via computer use while a screen recording with structured test/assertion annotations captures the session — then posts the video and a results summary to the requested destination. Use when changed runtime behavior needs observable verification, including headless environments (scripted screenshots and probes) and non-UI changes (measured numbers, output pairs).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

michaelshimeles/skills1.4천2026년 10월 19일 업데이트

greploop

무료

Address Greptile feedback on a PR, MR, or shelved changelist through bounded review and fix cycles. Use when the task includes a Greptile review loop. Supports the alternate @greptile-apps trigger for large PRs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

michaelshimeles/skills1.4천2026년 10월 19일 업데이트

Run the greploop workflow with the @greptile-apps trigger when the normal trigger refuses a large PR. Requires the greploop skill installed alongside this entrypoint.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

michaelshimeles/skills1.4천2026년 10월 19일 업데이트

Isolate repository edits in a Git worktree before starting a feature, fix, or documentation change. Preserve a worktree already assigned to the same task. Read-only reviews and investigations do not need a new worktree.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

michaelshimeles/skills1.4천2026년 10월 19일 업데이트

unslop

무료

Cut AI tells from text you write or edit for a human reader (commit messages, PR titles and bodies, docs, code comments, replies). Apply before committing, posting, or sending; leave prose you didn't touch alone.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

michaelshimeles/skills1.4천2026년 10월 19일 업데이트

michaelshimeles의 스킬 모두 보기

이 스킬의 문제 신고