c24165b8bc
에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게 [공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류. 문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인). - Topic_Programming → Domain_Programming (내부 구조 보존) - Topic_Graphic → Domain_Design - Topic_Business → Domain_Product - Topic_General → Domain_General - _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning), Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing) - 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서) - 빈 폴더 정리 (memory/procedures) - 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5.4 KiB
5.4 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-husky | Husky | 10_Wiki/Topics | verified | self |
|
none | A | 0.95 | applied |
|
2026-05-10 | pending |
|
Husky
매 한 줄
"매 npm-friendly git hooks 의 facto-standard". Husky 는 매
.husky/directory 안에 매 plain shell script 로 hook 정의 — 매git config core.hooksPath으로 자동 설정. 매 v9 (2024-2026) 부터 매 거의 zero-config:npx husky init→ 매 husky/_/h prepare-commit-msg 등 매 wrapper 자동 생성. 매 lint-staged 와의 매 pairing 이 매 표준 setup.
매 핵심
매 핵심 개념
- core.hooksPath = .husky/_: Husky 가 매 이 path 로 git 을 redirect — 매 user 의 매 hook script 와 매 husky framework script 분리.
- Plain shell: 매
.husky/pre-commit의 매 첫 line shebang 없이 — Husky v9 가 매_/hwrapper 통해 실행. - Skip via env:
HUSKY=0또는HUSKY_SKIP_HOOKS=1— 매 CI 또는 emergency commit. - prepare script:
package.json의"prepare": "husky"가 매 install 시 자동 setup.
매 lint-staged 와의 결합
- 매 staged files 만 lint/format → 매 commit 속도 ↑.
- 매 prettier --write + eslint --fix + 매 자동 re-stage.
- 매 large monorepo 에서도 매 fast (only changed paths).
매 hook 우선순위 (자주 쓰는)
- pre-commit: lint-staged + type-check (changed only).
- commit-msg: commitlint (Conventional Commits 검증).
- pre-push: full test suite + build smoke.
- post-merge: pnpm install if
package.jsonchanged.
💻 패턴
Initial setup
# in repo root
pnpm add -D husky lint-staged
pnpm pkg set scripts.prepare="husky"
pnpm prepare
npx husky init # creates .husky/pre-commit with `npm test` placeholder
.husky/pre-commit (lint-staged + type-check)
npx lint-staged
pnpm exec tsc --noEmit
lint-staged config (package.json)
{
"lint-staged": {
"*.{ts,tsx,js,jsx}": [
"eslint --fix --max-warnings=0",
"prettier --write"
],
"*.{json,md,yml,yaml}": ["prettier --write"],
"*.css": ["stylelint --fix", "prettier --write"]
}
}
.husky/commit-msg (commitlint)
npx --no -- commitlint --edit "$1"
// commitlint.config.js
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'subject-max-length': [2, 'always', 100],
'scope-enum': [2, 'always', ['ui', 'api', 'docs', 'ci', 'deps']],
},
};
.husky/pre-push (test + build)
pnpm test --run --silent
pnpm build
Skip in CI / emergency
# CI: prepare script no-op when not in dev install
# package.json
{
"scripts": {
"prepare": "node -e \"if (process.env.CI) process.exit(0)\" && husky"
}
}
# Emergency commit (use sparingly)
HUSKY=0 git commit -m "hotfix: critical patch"
# or
git commit --no-verify -m "..."
Monorepo: only run hooks if relevant
# .husky/pre-commit
CHANGED=$(git diff --cached --name-only)
echo "$CHANGED" | grep -q "^apps/web/" && (cd apps/web && pnpm lint-staged)
echo "$CHANGED" | grep -q "^apps/api/" && (cd apps/api && pnpm lint-staged)
Conditional hook based on branch
# .husky/pre-push
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "$BRANCH" = "main" ]; then
pnpm test --run
pnpm build
else
pnpm test --run --bail=1
fi
Adopt in existing repo
# After cloning, dependencies need install to run 'prepare'
pnpm install # triggers `prepare` → husky sets core.hooksPath
git config --get core.hooksPath # → .husky/_
Husky + pnpm workspaces filter
# .husky/pre-commit
STAGED=$(git diff --cached --name-only)
PKGS=$(echo "$STAGED" | awk -F/ '/^packages\// {print $2}' | sort -u)
for p in $PKGS; do
pnpm --filter "@repo/$p" lint-staged
done
매 결정 기준
| 상황 | Approach |
|---|---|
| TS/JS project | Husky v9 + lint-staged |
| Polyglot (Python, Go) | pre-commit framework (multi-lang) |
| Heavy hooks (>10s) | move to pre-push, lighten pre-commit |
| Solo dev hobby | optional — lint in CI alone may suffice |
| Enterprise enforcement | husky + commitlint + branch protection |
기본값: 매 TS/JS team — Husky v9 + lint-staged + commitlint.
🔗 Graph
- 변형: pre-commit · lefthook
- 응용: Lint-Staged · Conventional Commits
- Adjacent: ESLint · Prettier · Biome
🤖 LLM 활용
언제: 매 hook script 작성, lint-staged config 생성, commitlint rule 제안, monorepo conditional logic. 언제 X: 매 binary install verification — local 환경에서 매 직접 실행.
❌ 안티패턴
- 30s pre-commit: 매 dev 가 매 --no-verify 습관화 → 매 hook 무용지물.
- Run full test in pre-commit: 매 pre-push 로 옮기기.
- No CI fallback: 매 hook 만 신뢰 → 매 --no-verify bypass 시 dirty commit.
- Husky 의 commit hook 안 비밀 커밋 검증 누락: 매 detect-secrets / gitleaks pairing.
- Per-developer husky version drift: 매 lockfile pin 필수.
🧪 검증 / 중복
- Verified (Husky v9 docs 2026, lint-staged v15+).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — Husky v9 + lint-staged + commitlint patterns |