파이프라인

입력 파일 하나가 그대로 다시 쓰입니다 — Mode A 는 파일을 씁니다.

입력 lint_docs_filenames.sh
80 lines / echo 4개
스킬 /authoring:ux-guidelines
Mode A, 파일을 씀
출력 lint_docs_filenames.sh
122 lines / ux_* 12개
01

실행한 명령

/authoring:ux-guidelines [target]
/authoring:ux-guidelines .../scratchpad/ux-demo/lint_docs_filenames.sh
02

입력

.../scratchpad/ux-demo/lint_docs_filenames.sh — ~/dotfiles/scripts/lint_docs_filenames.sh 의 폐기용 사본. 80 lines, #!/bin/sh, set -eu.

docs/ 하위 *.md 파일명이 kebab-case 인지 검사하고 docs/adr · docs/requirement 는 강제(exit 1), 나머지는 warn-only 로 처리한다.

리팩터링 전 raw echo 4개(L23 not-found, L68 FAIL, L71 warn, L78 summary), ux_* 0개.

03

결과

본문의 raw 출력이 전부 semantic 호출로 바뀌었습니다.

본문 raw echo / printf
40

본문에서 완전히 제거

ux_* 호출
012

7종 사용 — ux_header ux_info ux_section ux_bullet ux_success ux_warning ux_error

파일 길이
80122

lines

파일 전체 grep 은 왜 echo 를 7개로 세는가

파일 전체 grep -c 로는 echo 가 7개 잡히지만 전부 ux_lib 부재 시를 위한 폴백 스텁 정의부(L37-43)다.

검증

bash -n OK zsh -n OK dash -n OK shellcheck -s sh clean

실행 동등성도 확인 — fixture 에서 sh 실행 시 전후 모두 errors=1 / warnings=1, exit=1.

04

치환 예시

ux_error 가 자체적으로 stderr 로 쓰므로 >&2 는 제거해도 라우팅이 유지된다.

BEFORE · raw echo
- echo "FAIL $file — 파일명이 kebab-case 가 아닙니다 (강제 범위)." >&2 -echo "lint-docs: errors=${errors} warnings=${warnings} (enforced: ${ENFORCED_DIRS})"
AFTER · ux_lib
+ ux_error "FAIL $file — 파일명이 kebab-case 가 아닙니다 (강제 범위)." +ux_section "Summary" +ux_bullet "errors ${errors}"