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

style-guide

TypeScript and test style conventions for the testmex monorepo. Use when writing or reviewing TypeScript types, interfaces, core domain models, or tests in this repository.

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

설치 방법 보기

포함된 파일(1)

  • SKILL.md3.8 KB

SKILL.md(원문)

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

Style Guide

Module layout: main types first

Put the main exported types and functions at the top of the file. Place the types and helper functions they depend on below, ordered from outer to inner.

// ✅
export class ProgressReporterFake { /* … */ }

export interface PhaseState {
  steps: readonly StepState[];
}

export interface StepState {
  subSteps: readonly SubStepState[];
}

export interface SubStepState {
  message: string;
}

interface MutablePhaseState { /* … */ }

// ❌ — leaf types before the class that exposes them
export interface SubStepState { /* … */ }
export interface StepState { /* … */ }
export class ProgressReporterFake { /* … */ }

Object shapes: prefer interface

Use interface for object shapes. Use type only when interface cannot express the shape (unions, intersections, mapped types, branded primitives).

// ✅
export interface Workspace {
  info: WorkspaceState;
  tree: Tree;
}

// ❌
export type Workspace = { info: WorkspaceState; tree: Tree };

Branded strings

Use a branded string plus a factory function for domain primitives that must not be confused with plain strings.

export type RelativePath = string & { readonly [__relativePathBrand]: true };

export function relativePath(path: string): RelativePath {
  return path as RelativePath;
}

declare const __relativePathBrand: unique symbol;

Apply the same pattern to FindingType and similar domain strings. Use findingType() at call sites.

Module-level constants

Use UPPER_SNAKE_CASE for module-level constant bindings (arrays, config objects, magic strings shared within a file).

// ✅
const EXCLUDED_CODE_FILE_NAMES = [
  'jest.config.ts',
  'vitest.config.ts',
] as const;

// ❌
const excludedCodeFileNames = ['jest.config.ts', 'vitest.config.ts'] as const;

Test names

Start test descriptions in lower case: it('staged write is visible…').

Use Class or function for describe suite names — do not use Class.name or function.name (e.g. describe(Vitestify, …) not describe(Vitestify.name, …)).

Do not use it.each (or describe.each). Repeat the test case with a separate it for each input.

// ✅
it('returns true for src/app.spec.ts', () => {
  expect(isTestFile(relativePath('src/app.spec.ts'))).toBe(true);
});

it('returns true for src/app.test.ts', () => {
  expect(isTestFile(relativePath('src/app.test.ts'))).toBe(true);
});

// ❌
it.each(['src/app.spec.ts', 'src/app.test.ts'])(
  'returns true for %s',
  (path) => {
    expect(isTestFile(relativePath(path))).toBe(true);
  },
);

Assertions

Prefer inlined expected values over variables — the assertion should read as a self-contained statement of what the test checks.

// ✅
expect(await tree.maybeReadFile(mainPath)).toBe('console.log("hello");');
expect(tree.changes()).toEqual([{ type: 'delete', path: 'the/main/path.ts' }]);

// ❌
const expectedContent = 'console.log("hello");';
const expectedChanges = [{ type: 'delete', path: mainPath }];
expect(await tree.maybeReadFile(mainPath)).toBe(expectedContent);
expect(tree.changes()).toEqual(expectedChanges);

When a test has more than one expect, use expect.soft so every assertion runs and failures are reported together.

// ✅
expect.soft(await tree.maybeReadFile(mainPath)).toBeNull();
expect
  .soft(tree.changes())
  .toEqual([{ type: 'delete', path: 'the/main/path.ts' }]);

// ❌
expect(await tree.maybeReadFile(mainPath)).toBeNull();
expect(tree.changes()).toEqual([{ type: 'delete', path: mainPath }]);

A single expect in a test may use plain expect.

리뷰

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

댓글

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

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

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

0 / 1,000자

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

같은 저장소의 스킬

Continues Charted Coding work for a PR by routing to scaffold, red, or green based on design doc progress. Use when resuming work on a PR, continuing TDD after a break, or when the user invokes charted continue with a design doc and PR number.

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

testmex/testmex42026년 7월 23일 업데이트

Interviews the user section by section to collaboratively produce design documents. Use when creating a design doc, starting feature design, or when the user invokes the design command.

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

testmex/testmex42026년 7월 23일 업데이트

Progressively activates todo tests one at a time, updates implementation code until each passes (verified via Wallaby), checks off matching design doc progress, then moves to the next—following the design doc as the single source of truth.

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

testmex/testmex42026년 7월 23일 업데이트

Runs Charted Coding iterations in a loop — route via charted-continue, batch red or green work for an entire test file, commit, then repeat until the PR is complete. Infers design doc and PR number when omitted. Use when the user invokes charted loop, wants batch TDD for a PR test file, or asks to continue charted work with commits.

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

testmex/testmex42026년 7월 23일 업데이트

Writes the next failing test based on provided design doc and existing todo tests

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

testmex/testmex42026년 7월 23일 업데이트

Reviews a design doc with expert sub-agents

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

testmex/testmex42026년 7월 23일 업데이트

testmex의 스킬 모두 보기

이 스킬의 문제 신고