prag-matt-ic/threenix-plugin

threenix-clean-code

Review and refactor TypeScript and React code for readability.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/prag-matt-ic/threenix-plugin --skill threenix-clean-code

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Task

Begin first by identifying any violations of the checklist items. Then, refactor the code to address these issues.


Full Documentation


Checklist

  • [ ] Use meaningful names – variable and function names should clearly communicate what the code does. Avoid abbreviations or cryptic identifiers; clear naming makes the code self‑documenting. Boolean variables should be named to imply true/false (e.g. isVisible, hasItems). Don't add unecessary prefixes or suffixes - e.g do not add 'Ref' to a useRef variable.
  • [ ] Be consistent – use the same vocabulary for the same type of entity (e.g. always call the current player position playerPos instead of mixing currentPos, position, and pos).
  • [ ] Write small, pure functions – each function should have a single responsibility. Break complex logic into smaller helpers rather than nesting conditionals.
  • [ ] If a function has 3 or more parameters, use an object to group them - this makes it easier to understand what each parameter means.
  • [ ] Prefer early returns over deep nesting – return early to avoid if/else pyramids.
  • [ ] Prefer immutability – never mutate objects or arrays directly. When updating state, return new objects instead of modifying existing ones.
  • [ ] Avoid magic numbers and strings – declare constants (e.g. LANE_COUNT = 3) so that values are descriptive and changeable. The exception to this rule is animation timing values (e.g. duration: 0.5, delay: 0.2) and inline copy which can be left inline.
  • [ ] Comment judiciously – write code that is self‑explanatory. When comments are needed, make them precise and consider using // TODO to mark work that should be improved later.
  • [ ] Avoid creating expensive objects/classes in loops or animation frames - reuse objects where sensible to reduce garbage collection. For example: never create a new Vector3() inside useFrame().
  • [ ] Review imports and ensure that types/interfaces are imported as types (e.g. import { type MyType } from '...'). Classes should not be marked as types. Remove any unused imports.
  • [ ] React arrow function components should be declared as type FC from react.
  • [ ] In React 19+ ref can be passed as a prop. So remove forwardRef and define the ref as a normal prop. e.g:
tsx
type Props = {
  ref?: React.RefObject<HTMLElement | null>
}
  • [ ] Prefer 'type' over 'interface' for defining object shapes (and props) unless you need declaration merging.

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills