Scan your whole stack
From OX Research Newsroom
Are you using @teamsparta/union-sensor?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.1.1
@teamsparta/union-sensor was last scanned on 27 Nov 2026 at version 0.1.1. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.1.1 LATEST | 27 Nov 2026 | No rules fired |
Findings for v0.1.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.1.1; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
모든 레포에서 같은 규칙으로 정적 분석을 돌리고, 결과를 고치는 방법(가이드)과 함께 돌려주는 CLI입니다.
사람은 status 표로, 코딩 에이전트는 check 요약으로 봅니다.
pnpm add -D @teamsparta/union-sensor
npx union-sensor check
Node 20.12 이상. 설정 파일이 없어도 typecheck · lint · coupling 센서로 돕니다.
| 센서 | 무엇을 보나 | 기준 |
|---|---|---|
typecheck |
레포 설치본 tsc --noEmit |
오류 0 |
lint |
내장 ESLint 규칙 (아래) | 위반 0 |
layers |
레이어 의존 방향, 슬라이스 간 import, 구조 밖 파일 | 위반 0 (설정해야 켜짐) |
coupling |
파일별 fan-out(이 파일이 import하는 파일 수), 순환 의존. fan-in(이 파일을 import하는 파일 수)은 위반이 아니라 요약·--changed 영향 범위로만 보여줌 |
fan-out ≤ 12, 순환 0 |
lint 규칙: max-params 4 · max-lines 300 · max-lines-per-function 200 · complexity 15 · @typescript-eslint/no-explicit-any · no-console(console.error·console.warn은 허용) · 예외 주석 사유 필수(require-description) · 전체 끄기 금지(no-unlimited-disable).
TanStack Query 규칙(공식 @tanstack/eslint-plugin-query): exhaustive-deps · stable-query-client · no-rest-destructuring · no-unstable-deps · infinite-query-property-order · mutation-property-order · prefer-query-options. no-void-query-fn은 타입 정보가 필요해 켜지 않습니다. queryOptions 객체 이름은 xxxQuery로 짓고, xxxQueries는 useQueries에 넘기는 묶음에만 씁니다.
union 가이드 규칙:
| 규칙 | 가이드 | 적용 |
|---|---|---|
union/no-enum |
enum 대신 as const |
전체 |
union/no-passthrough-query-hook |
useQuery(xxxQuery.detail(id)) 하나만 감싼 use* 훅을 만들지 않고 사용처에서 직접 호출. 옵션을 덧붙이는 훅은 허용 |
전체 |
@next/next/no-img-element |
<img> 대신 next/image, 반응형은 <picture>·srcset |
Next 레포 |
union/no-query-hook-in-queries |
_queries/ 안에서는 useQuery 계열 훅을 호출하지 않음 |
App Router |
union/absolute-shared-import |
앱 최상위 _shared·_global은 바깥에서 @/ 절대경로로 import |
App Router |
라우터는 package.json의 next 의존성과 app/·src/app/ 폴더로 판별합니다. 다르면 설정의 router: 'app' | 'pages' | 'none'으로 지정합니다.
임계값은 레포 설정으로 바꿀 수 없습니다. 예외는 파일 단위 주석으로, 사유를 적어서만 둡니다.
/* eslint max-lines: ["error", 400] -- 폼 스키마 정의라 분리하면 추적이 어려움 */
// eslint-disable-next-line no-console -- 배포 스크립트 진행 로그
예외 주석 수도 기록합니다. 위반을 주석으로 덮어도 "악화"로 잡힙니다.
union-sensor.config.ts 또는 .json)레포마다 다를 수밖에 없는 것만 둡니다.
import { defineConfig } from '@teamsparta/union-sensor';
export default defineConfig({
include: ['src/**/*.{ts,tsx}'],
exclude: ['**/*.generated.ts'],
tsconfig: 'tsconfig.json',
router: 'app',
typecheck: { tsconfigs: ['tsconfig.json'] },
globalGuidance: ['API 응답 타입은 src/shared/api/types.ts에서 가져올 것.'],
guidance: {
'no-console': [
{ paths: ['src/server/**'], text: '서버에서는 logger를 쓸 것.' },
{ paths: ['src/**'], text: '클라이언트 디버그 로그는 커밋 전에 지울 것.' },
],
},
layers: {
order: [
{ name: 'app', path: 'src/app' },
{ name: 'features', path: 'src/features', isolated: true },
{ name: 'shared', path: 'src/shared' },
],
forbidOutsideStructure: false,
},
coupling: { hubs: ['app/_global/_providers/**'] },
sensors: [{ name: 'stack-rules', command: 'node scripts/stack-rules.mjs', guidance: 'Stack DS 규칙' }],
});
layers.order는 위에서 아래 순서입니다. 아래 레이어는 위 레이어를 import할 수 없습니다. isolated: true인 레이어 안의 슬라이스(바로 아래 폴더)끼리도 import할 수 없습니다.guidance는 규칙별 가이드를 덮어씁니다. 배열이면 경로별로 처음 맞는 항목을 씁니다.coupling.hubs는 여러 파일을 조립하는 게 역할인 파일(프로바이더 묶음 등)을 fan-out 검사에서 뺍니다. 순환 검사는 그대로 합니다.typecheck: false, lint: false, coupling: false.union-sensor check # 에이전트용 요약. 실패하면 exit 1
union-sensor check --all # 기존 위반까지 전부
union-sensor check --changed # 커밋 안 된 변경의 영향 범위(호출자 수)
union-sensor check --base origin/main # 브랜치 전체 변경의 영향 범위
union-sensor check --fail-on threshold # 기존 위반이 있어도 실패
union-sensor check --json # 원시 결과
union-sensor review --base origin/main # 위험도 점수와 판정(리뷰 생략 가능·리뷰 필요). 항상 exit 0
union-sensor review --base origin/main --ocr ocr.json # open-code-review 결과를 합쳐서
union-sensor review --base origin/main --into body.md # PR 설명 파일 맨 위에 끼워 넣어서
union-sensor snapshot # 현재 상태를 기준점으로 저장
union-sensor status # 마지막 check 결과 표
union-sensor claude-hook # Claude Code Stop 훅
union-sensor guard-commit # Claude Code PreToolUse 훅: 커밋 훅 우회 차단
종료 코드: 0 통과 · 1 실패 또는 센서 실행 오류 · 2 설정·사용법 오류.
check는 막고, review는 보고만 합니다. 결과는 PR 설명 맨 위에 넣을 마크다운입니다. 사람이 PR 전체를 읽지 않고 여기 적힌 곳만 보는 것을 전제로 합니다.
export default defineConfig({
review: {
hard: [
{
name: '결제',
paths: ['src/payment/**'],
question: '결제 금액 계산이 바뀝니다. 의도한 변경인가요?',
checklist: '금액은 서버 응답 값만 쓴다. 클라이언트에서 다시 계산하지 않는다.',
},
],
skip: ['src/generated/**'],
logCalls: ['logEvent', 'sendLog'],
},
});
위험도 점수(0~100)를 매기고, 점수로 두 단계를 나눕니다.
| 재료 | 점수 |
|---|---|
| 로직 변경 줄 수 | 10줄 이하 0 · 50줄 이하 10 · 200줄 이하 20 · 500줄 이하 30 · 1,500줄 이하 50 · 그 초과 60 |
| 로직 파일 수 | 2개 이하 0 · 10개 이하 5 · 30개 이하 10 · 그 초과 15 |
| 새 린트 위반 | 바뀐 소스 파일에서 기준 대비 늘어난 위반이 1건이라도 있으면 25 |
| 설정·의존성처럼 소스가 아닌 파일 | 10 |
| 판정 | 조건 | PR 라벨 |
|---|---|---|
| 🔴 리뷰 필요 | 50점 이상, 또는 hard 경로의 코드를 고침 (점수와 무관) |
리뷰 필요 |
| 🟢 리뷰 생략 가능 | 50점 미만 | 리뷰 생략 가능 |
바뀐 파일이 전부 테스트 · 문서 · 스타일 · 타입 선언만 있는 파일 · 이미지·정적 파일 · skip 경로 · 삭제 · 주석과 포맷만 바뀐 파일이면 0점입니다. 줄 수와 파일 수는 include에 드는 소스 파일만 셉니다. 이런 파일, include 밖의 코드(모노레포의 백엔드 등), 설정·lock 파일은 세지 않습니다. 테스트·문서 파일은 하드 룰에서 뺍니다. lint: false면 린트 위반 점수는 붙지 않습니다.
점수표는 세 레포 PR 841건의 48시간 내 fix율로 확인했습니다(전체 줄 수 기준). 10점 미만 6% · 10~49점 9% · 50점 이상 28%이고, 레포별 AUC는 0.69 · 0.77 · 0.73입니다. 지금 기준(include 안의 소스 줄 수, 두 단계)으로는 academia 199건만 다시 확인했고, 50점 미만 10%(14/134) · 50점 이상 28%(18/65), AUC 0.71로 전체 줄 수 기준(0.72)과 비슷했습니다. 점수의 대부분은 크기입니다. 줄 수만으로도 0.66~0.75가 나오고, 500줄 이하에서 위험한 PR을 가려내는 재료는 찾지 못했습니다. 결제처럼 작아도 봐야 하는 영역은 점수가 아니라 hard로 지정합니다.
AI가 볼 규칙의 원본은 union 가이드 문서(apps/docs/contents/ground-rules/**)의 frontmatter입니다.
---
review:
enforce: ai # ai | eslint | none
severity: medium
applies_to: ['**/*.{ts,tsx}']
trigger: hook-with-multiple-queries
detect: 한 훅이 서로 다른 도메인의 서버 데이터를 함께 조회해 UI 한 곳에서 쓸 묶음으로 반환한다
do_not_flag:
- 같은 도메인의 쿼리만 묶은 훅
---
trigger는 AI를 부르기 전에 코드가 판정하는 조건입니다. 걸린 파일에만 그 가이드가 붙습니다.hook-with-multiple-queries: use* 함수가 쿼리 훅을 2개 이상 호출state-only-hook: use* 함수가 useState·useCallback·useMemo만 호출log-outside-component: 컴포넌트도 로깅 래퍼도 아닌 함수가 logCalls의 함수를 호출pnpm guides로 src/review/guides.generated.ts를 다시 만듭니다. 안 맞으면 테스트가 실패합니다.review는 파일별 규칙을 .union-sensor/cache/ocr-rule.json에 씁니다. open-code-review(OCR)에 --rule로 넘기는 형식입니다.checklist가 덧붙습니다.detect·do_not_flag·본문이 덧붙습니다.판정은 review가 규칙으로 하고, OCR은 모든 PR에서 "어디를 봐야 하는지"만 찾습니다. OCR 지적 수는 판정을 바꾸지 않습니다.
name: union-sensor-review
on: pull_request
jobs:
review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
env:
BASE: origin/${{ github.base_ref }}
OCR_LLM_URL: ${{ secrets.OCR_LLM_URL }}
OCR_LLM_TOKEN: ${{ secrets.OCR_LLM_TOKEN }}
OCR_LLM_MODEL: claude-sonnet-5-5
OCR_USE_ANTHROPIC: 'true'
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.pull_request.number }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- run: corepack enable && pnpm install --frozen-lockfile
- run: npm install -g @alibaba-group/open-code-review@1.13.6 && ocr config set language Korean
- run: pnpm exec union-sensor review --base $BASE --json > .union-sensor/cache/sensor.json
- run: ocr review --from $BASE --rule .union-sensor/cache/ocr-rule.json --format json --audience agent --max-tokens-budget 800000 -o .union-sensor/cache/ocr.json
continue-on-error: true
- run: |
if [ -f .union-sensor/cache/ocr.json ]; then OCR="--ocr .union-sensor/cache/ocr.json"; fi
gh pr view "$PR" --json body --jq .body > .union-sensor/cache/body.md
pnpm exec union-sensor review --base $BASE $OCR --into .union-sensor/cache/body.md > .union-sensor/cache/next.md
LABEL=$(jq -r .label .union-sensor/cache/sensor.json)
REMOVE=$(jq -r '[.labels[] | select(. != $label)] | join(",")' --arg label "$LABEL" .union-sensor/cache/sensor.json)
gh pr edit "$PR" --body-file .union-sensor/cache/next.md --add-label "$LABEL" --remove-label "$REMOVE"
review가 규칙 파일을 만들고, OCR이 그 규칙으로 리뷰하고, 두 번째 review --ocr가 둘을 합쳐 보고서를 냅니다.<!-- union-sensor:review:start -->, :end -->) 사이만 바꾸므로 작성자가 쓴 설명은 그대로 남고, 커밋마다 같은 자리가 갱신됩니다.리뷰 생략 가능, 리뷰 필요)는 레포에 미리 만들어 둡니다. 판정이 바뀌면 이전 라벨을 떼고 새 라벨을 붙입니다.$OCR을 빼면 됩니다. AI 호출이 없어 3초 안팎에 끝납니다..union-sensor/cache/ 아래에 둡니다. .union-sensor/ 밖에 두면 변경 파일로 잡힙니다.Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.