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

clean-code

Apply concise coding standards when writing or reviewing code. The guide covers naming, function boundaries, useful comments, and common anti-patterns, plus checks to make before editing and verification steps to run before calling a change complete.

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

원문원문 설명 보기

Coding standards for this repo - concise, direct, no over-engineering, and no comments that carry no knowledge. Use when writing or reviewing any code here, and whenever adding a comment.

Openpanel-dev/openpanel스타 7,217(GitHub 7,217 + cccskills 0)

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Reviewing code for unnecessary abstractions or nesting
  • Choosing clearer names and function boundaries
  • Deciding whether a comment adds useful context
  • Checking dependencies and verification steps before finishing

포함된 파일(1)

  • SKILL.md5.0 KB

SKILL.md(원문)

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

Clean code

Adapted from davila7/claude-code-templates (MIT). The comment rules below are this repo's own, derived from what a 2026-09-28 cleanup actually found.

AGENTS.md and packages/core/AGENTS.md are the binding contract. Where this file and either of those disagree, they win.

Core principles

PrincipleRule
SRPOne responsibility per function. But see the size note below.
DRYAt the narrowest level that fits — the module first. Never invent a cross-module abstraction for two call sites.
KISSThe simplest thing that works.
YAGNINo abstraction, parameter or hook for a need that does not exist yet.
Boy ScoutLeave what you touch cleaner — inside the task's scope only.

Naming

ElementConvention
VariablesReveal intent: userCount, not n. No abbreviations unless universal.
FunctionsVerb + noun: getUserById(), not user().
BooleansQuestion form: isActive, hasPermission, canEdit.
ConstantsSCREAMING_SNAKE, at the top of the file or in the module's <name>.constants.ts. Never a magic number inline.

If you need a comment to explain a name, rename it.

Function size — read this before splitting anything

packages/core/AGENTS.md is explicit: "a coherent 100-line function beats twenty five-line fragments. Split where a reader benefits, not to satisfy a metric."

So: no line limit. Split when a reader benefits. Keep arguments few, prefer an options object over four positionals, use guard clauses and early returns, and avoid nesting past two levels.

Comments — the part that actually goes wrong here

Comment the why, briefly: an invariant, a non-obvious side effect, a constraint that bit someone, a reason the obvious spelling is wrong. Never narrate what the code does.

These five shapes are banned. Each one was found in bulk in this repo and deleted:

BannedWhyInstead
Restating a rule from AGENTS.md — // Isomorphic by the AGENTS.md rule: zod and nothing else.True of every file of that name, machine-enforced by the constants-stay-isomorphic cruiser rule, and visible from the imports. Zero knowledge.Nothing. Delete it.
Citing a document the repo does not contain — // Cluster note (docs/ENVIRONMENT.md): …479 ADR-nnn and ~90 doc links pointed into a checkout that never ships. An unresolvable citation reads as authority it cannot back.State the fact itself, with no citation.
Provenance — // Moved from packages/db/src/services/x.service.tsSays nothing about the file you have open, and rots the moment the path moves.Nothing. git log knows.
Referring to a system that no longer exists — // exactly as V1 does, // V1's twinJustifies current behaviour by a reference point the reader cannot check.State the rule the code follows.
Task ids — // M10-005:, // P11:Meaningless outside the tracker that issued them.Nothing.

A comment that survives those five says something a careful reader could not have got from the code. That is the bar.

Anti-patterns

Don'tDo
Comment every lineDelete the obvious ones
Helper for a one-linerInline it
Factory for two objectsConstruct them directly
A utils.ts holding one functionPut it where it is used
Deep nestingGuard clauses
Magic numbersNamed constants
God functionsSplit by responsibility, not by line count
anyunknown, then narrow
as assertionsNarrowing
console.log / debugger left behindRemove before finishing

Before editing a file

AskBecause
What imports this?They may break — grep -rn "from '.*<name>'"
What does it import?An interface change ripples
What tests cover it?Run them, not the whole suite
Is it on a package's public surface?packages/core/src/index.ts and the exports map are contracts

Edit the file and every dependent in the same change. Never leave a broken import or a half-applied rename.

Before saying it is done

Run what the change warrants, from AGENTS.md's verification table — not the whole suite for a one-line fix, and always the full one for a query or ingest change:

bun run typecheck                      # always
npx ultracite fix <files you changed>  # always; they must come out clean
bun test --isolate                     # in packages/core, for backend changes
bunx vitest run                        # in apps/start, for dashboard changes
bun run check:deps                     # if you touched a package boundary

Report what you ran and what you saw. A screenshot or a query result is evidence; "should work" is not.

리뷰

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

댓글

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

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

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

0 / 1,000자

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

같은 저장소의 스킬

merge

무료

Review a GitHub pull request’s final diff and prepare a squash commit message that captures user-visible changes and upgrade notes. It checks merge readiness and required status checks, then merges under the skill’s stated conditions.

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

  • Preparing a complete release note from a PR’s changes
  • Squash merging a reviewed GitHub pull request
  • Checking required CI results before merging
Openpanel-dev/openpanel7.2천2026년 10월 29일 업데이트

pr

무료

Use this workflow to push a branch, create or find its pull request, and work through CodeRabbit review feedback in rounds. It fixes valid issues, replies to other comments, and stops with a report when reviews or checks cannot proceed.

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

  • Opening a pull request for the current branch
  • Picking up an existing open pull request
  • Working through CodeRabbit review comments
Openpanel-dev/openpanel7.2천2026년 10월 29일 업데이트

Verify JavaScript SDK changes through a browser journey in a sample shop connected to a local API. The workflow checks that tracked events reach ClickHouse, a database for analytics, with expected paths and properties.

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

  • Checking that an SDK event is stored after a browser action
  • Verifying event paths and properties in ClickHouse
  • Testing identify, groups, revenue, or session behavior
Openpanel-dev/openpanel7.2천2026년 10월 29일 업데이트

Openpanel-dev의 스킬 모두 보기

이 스킬의 문제 신고