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

check-code-hygiene

Check code for standardization, readability, maintenance complexity, and defensive coding practices

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

설치 방법 보기

포함된 파일(1)

  • SKILL.md3.3 KB

SKILL.md(원문)

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

Analyze the apple-fm codebase for code hygiene issues. Generate a report on standardization, readability, maintenance complexity, and defensive coding.

Scope: src/, apple-fm-helper/main.swift, and (where relevant) tests/.

Analysis Areas

1. Standardization

  • File naming: src/ is lowercase/camelCase matching the primary concept (cliArgs.ts, protocol.ts, session.ts). Flag a name that matches neither.
  • Identifier casing: camelCase values, PascalCase types, SCREAMING_SNAKE constants. Flag inconsistencies.
  • Import style: all relative imports use .js; import type for type-only imports (eslint enforces order — if lint passes, order is fine). The .js check is your responsibility.
  • Error messages: throws should be descriptive and actionable (e.g. --temp expects a number, got "abc"). Flag terse throw new Error('failed').
  • Protocol parity: the event names / error codes in src/protocol.ts, apple-fm-helper/main.swift, tests/fixtures/stub-helper.js, and docs/4-protocol.md must all agree. Flag any divergence.

2. Readability

  • File length: flag any src/*.ts over ~200 LOC.
  • Function length / nesting: flag functions over ~50 lines or nesting deeper than 3.
  • Magic numbers: defaults like the compaction threshold, keep-recent count, timeout, and chars-per-token live as named constants — flag any new inline literal that should be one.
  • Comments: house style is why, not what. Flag both noise comments and missing rationale on non-obvious code (e.g. the cumulative-partial diffing in the Swift streaming path).

3. Maintenance Complexity

  • Layering: only apple-fm-helper/main.swift may touch FoundationModels; only helper.ts spawns the process; pure logic stays in protocol.ts / session.ts / cliArgs.ts. Flag any layer violation (e.g. session.ts spawning directly instead of going through an injected GenerateFn).
  • Dependencies: package.json dependencies stays empty. Flag additions.
  • Duplicate patterns: spot-check with grep for repeated spawn/JSON idioms.

4. Defensive Coding

  • Boundary validation: parseArgs rejects unknown commands/flags and bad numbers; parseEvent throws on malformed lines; helper.ts bounds the subprocess with a timeout and captures stderr. Verify these still hold.
  • any / non-null: grep src/ for : any, as any, <any>, and ! non-null assertions (tests get a pass). House style is unknown + narrowing.
  • Subprocess safety: stdin EPIPE swallowed; timeout kills the child; nonzero exit surfaces stderr. Flag any regression.
  • Swift helper: every failure path emits an error event (not a bare crash) and exits nonzero; availability is checked before generation.

Report Format

For each finding: File (path + lines), Category (standardization | readability | maintenance | defensive), Severity (high | medium | low), Description, Suggestion.

End with a prioritized top-N (apple-fm is small — expect 0–5 in a healthy state). Suggest Hot Sheet tickets (hs-task for cleanups, hs-bug for defects) for non-trivial findings.

리뷰

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

댓글

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

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

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

0 / 1,000자

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

같은 저장소의 스킬

Run all available tests and linters, check for anti-patterns, and generate a comprehensive code quality report

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

brianwestphal/apple-fm72026년 7월 22일 업데이트

Check requirements docs against implementation and report discrepancies

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

brianwestphal/apple-fm72026년 7월 22일 업데이트

glassbox

무료

Read the latest Glassbox code review and apply all feedback annotations

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

brianwestphal/apple-fm72026년 7월 22일 업데이트

hotsheet

무료

Read the Hot Sheet worklist and work through the current priority items

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

brianwestphal/apple-fm72026년 7월 22일 업데이트

Run as a distributed worker — continuously claim, work, and release Up Next tickets

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

brianwestphal/apple-fm72026년 7월 22일 업데이트

hs-bug

무료

Create a new bug ticket in Hot Sheet

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

brianwestphal/apple-fm72026년 7월 22일 업데이트

brianwestphal의 스킬 모두 보기

이 스킬의 문제 신고