
cohesion
Use when 한 기능 수정 시 여러 디렉토리를 건드리거나, 같은 숫자/상수가 여러 파일에 흩어져 있거나, import 경로가 ../../..처럼 길어질 때
- Installs
- 52
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/toss/frontend-fundamentals --skill cohesion- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads cohesion automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
응집도
함께 수정되는 코드는 함께 있어야 한다.
핵심 패턴
함께 수정되는 파일을 같은 디렉토리에 두기
❌ 종류별 분리 (의존 관계 파악 어려움):
src/
├── components/UserForm.tsx
├── hooks/useUserValidation.ts
├── types/userTypes.ts
└── api/userApi.ts
✅ 도메인별 배치:
src/
├── components/ # 전역 공유
└── domains/User/ # User 관련 코드 모음
├── UserForm.tsx
├── useUserValidation.ts
├── types.ts
└── api.ts
매직 넘버 제거
같은 숫자가 여러 곳에 있으면 한쪽만 수정되어 버그 발생.
❌ 분산:
// Pagination.tsx
const pages = Math.ceil(total / 20);
// useItems.ts
const offset = (page - 1) * 20;
✅ 상수로 통합:
export const PAGE_SIZE = 20;
import { PAGE_SIZE } from './constants';
빠른 참조
| 코드 냄새 | 개선 방법 |
|---|---|
| 같은 매직 넘버 3곳 이상 | 공유 상수로 추출 |
기능이 components/, hooks/, types/ 모두 수정 | domains/featureName/으로 배치 |
긴 상대 경로 ../../.. | 파일들을 가까이 배치 |
| 타입 정의가 사용처와 멀리 떨어짐 | 사용하는 코드와 함께 배치 |
예외: 중복이 나은 경우
- 두 기능이 다르게 발전할 가능성이 높을 때
- 공유 시 원치 않는 의존성이 생길 때
- 공유 코드가 5줄 미만으로 단순할 때
참고: https://frontend-fundamentals.com/code-quality/cohesive/
FAQ
What does the cohesion skill do?
Use when 한 기능 수정 시 여러 디렉토리를 건드리거나, 같은 숫자/상수가 여러 파일에 흩어져 있거나, import 경로가 ../../..처럼 길어질 때
How do I install cohesion?
Run npx skills add https://github.com/toss/frontend-fundamentals --skill cohesion in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/cohesion/ (personal) or .claude/skills/cohesion/ (project).
Which AI agents can use cohesion?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is cohesion safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains cohesion?
It is published by toss in toss/frontend-fundamentals. It has 52 recorded installs.
More from toss/frontend-fundamentals
coupling
toss/frontend-fundamentals
Use when props가 3개 이상 컴포넌트 계층을 통과하거나, 하나의 Hook이 5개 이상 값을 반환하거나, A 수정 시 관련 없는 B가 깨질 때
readability
toss/frontend-fundamentals
Open the skill to read its SKILL.md instructions.
predictability
toss/frontend-fundamentals
Open the skill to read its SKILL.md instructions.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.