본문 바로가기
C.W.K.
Stream
Lesson 05 of 07 · published

스크립트 — Skill 안의 결정적 실행부

~14 min · skills, scripts, deterministic, shell

Level 0🌱 입문자
0 XP0/70 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

판단은 모델이 하고, 반드시 같은 결과가 나와야 하는 일은 스크립트가 해

Skill 폴더에는 Bash, Python, Node 스크립트를 함께 둘 수 있어. 테스트 실행, 데이터 정규화, 서비스 조회처럼 절차와 결과가 정해져야 하는 부분은 스크립트에 맡기고, 모델은 언제 어떤 스크립트를 쓸지 판단하게 해.

모델은 상황을 읽고 선택하는 데 강하지만 열두 명령을 오타 없이 늘 같은 순서로 실행하는 데는 셸보다 못해. 빌드·테스트·결과 정리 순서를 스크립트 하나로 고정하면 매 호출의 흔들림이 줄어. 스크립트 결과도 자유 텍스트보다 JSON으로 내보내 모델이 구조적으로 읽게 해.

모델에게 12개 명령의 순서와 철자를 매번 맡기기보다 스크립트 하나로 고정하는 편이 훨씬 안정적이야.

직접 확인할 항목: npm install, npm run build, npm test.

Code

자체 스크립트를 호출하는 Skill·markdown
---
name: bench-and-report
description: Run the project's benchmark suite and write a report.
invocation: explicit
paths:
  - scripts/run-bench.sh
  - templates/report.md
---

You are running performance benchmarks.

1. Execute scripts/run-bench.sh; capture stdout (machine-readable JSON)
2. Read templates/report.md
3. Fill in the template with bench results
4. Write the report to ./bench-report-$(date +%F).md
5. Highlight any regressions vs the previous report (if found in repo root)
scripts/run-bench.sh·bash
#!/usr/bin/env bash
set -euo pipefail
cd "$(git rev-parse --show-toplevel)"

# Run the actual bench (deterministic — same inputs, same outputs)
npm run bench -- --json > /tmp/bench-out.json

# Emit machine-readable JSON for the model to consume
jq '{
  ts: now | todate,
  results: .results,
  total_ms: .total_ms
}' /tmp/bench-out.json

External links

Exercise

Skill에서 결과가 정확히 정해져야 하는 부분을 맡을 스크립트를 추가해 봐. 도구 실행, 서비스 조회, 데이터 정규화 같은 작업이면 좋아. 본문에서 스크립트를 호출하고 결과를 사용하게 만든 뒤, 모델의 표현이 달라져도 Skill이 안정적으로 작동하는지 확인해.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.