batch-script-progress
하는 일
이 도구는 많은 항목(파일이나 데이터 등)을 처리하는 스크립트에 진행 정보를 추가하는 데 도움을 줍니다. 무엇이 진행 중인지, 무엇이 완료되었는지, 실패한 항목이 있는지를 스크립트의 주요 출력을 바꾸지 않고 보여 줍니다.
사용하는 경우
- ✓파일을 배치 단위로 처리하는 스크립트를 만들 때.
- ✓오래 걸리는 작업의 진행 상황을 알아야 할 때.
- ✓대규모 작업에서 어떤 항목이 실패했는지 알고 싶을 때.
스킬 링크
https://github.com/github/awesome-copilot/blob/main/skills/batch-script-progress/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 Python 스크립트에 폴더의 모든 파일을 처리하는 진행 상황 보고를 추가해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
도구는 스크립트를 분석해 작동 방식을 이해하고, 시작, 진행, 개별 실패, 최종 요약에 관한 메시지를 추가할 위치를 찾습니다. 이 메시지는 스크립트의 주요 출력을 방해하지 않도록 별도의 채널(보통 stderr)로 보내집니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Batch Script Progress
Make generated batch scripts observable while they run, without changing their processing contract. Design start, periodic progress, per-item failure, and final-summary output together with result streams and exit status. A progress-bar library alone does not establish this contract.
1. Fix the existing contract
Read the script, callers, and nearby tests before editing. Identify:
- Input unit, known or unknown total, and whether enumeration is lazy.
- Existing stdout format and consumers, runtime version, and interactive versus redirected execution.
- Continue-on-error or fail-fast policy, retry rules, skip rules, transaction boundaries, and cancellation behavior.
- Existing exit codes and what callers treat as success.
Preserve these decisions. Do not add retries, parallelism, dependencies, or a new failure policy just to add progress output. If partial failures currently return zero, report the partial outcome honestly while keeping that exit contract. If the contract is missing or contradictory, ask for the decision that changes behavior; do not silently make it.
2. Define the output contract before implementation
Choose a small, stable vocabulary and fields, reusing the repository logger where suitable:
- Start: operation name, total or explicit unknown, and initial counters. Emit before expensive enumeration; discovery itself may need progress.
- Progress: processed, succeeded, failed, skipped, total or unknown, and elapsed time. Add a sanitized current-item identifier only when useful.
- Item failure: safe identifier, failure category or sanitized reason, and whether processing will continue. Emit when observed, independently of the normal progress interval.
- Summary: completed, partial, failed, or cancelled; final counters; elapsed time; known unprocessed count if available; and the exit status required by the existing contract.
Define processed = succeeded + failed + skipped for items that reached a terminal outcome. Keep in-flight and not-started items separate. Count each item once; retry attempts are not additional processed items. Do not label an item successful before its required commit, write, or acknowledgement. If a transaction rolls back, report rolled-back work rather than claiming durable success.
For an unknown total, report counts without a fabricated percentage, ETA, or remaining count. Do not materialize a stream just to count it. For zero items, emit start and summary with zero counts; never divide by zero.
3. Choose output streams and cadence
Reserve stdout for the established machine-readable result, pipeline objects, or protocol. Put progress and diagnostics on a separate channel; stderr is the portable default for standalone CLI scripts. Stderr output alone does not imply failure: callers must use the agreed exit code and result contract. Verify callers that treat any stderr as failure before changing their output. If stdout is reserved and stderr is incompatible, use an existing compatible logger or sink only when the caller already supports it. Do not move progress to stdout or another stream with changed semantics. If no compatible channel exists, stop and ask whether the output contract may change, or report that progress cannot be added safely.
Use a bounded cadence, such as every configured number of items or elapsed interval, rather than unconditionally logging every item. Emit start, failures, and summary regardless of that cadence. Preserve required per-item audit records separately. Avoid unbounded in-memory failure lists and repeated stack traces. Redact credentials, query parameters, personal data, and sensitive paths before formatting; do not dump raw exceptions or whole input records by default.
Use monotonic time for intervals and duration. Ensure output is flushed or drained so notifications arrive before exit. Use plain newline-delimited records under redirection; enable terminal rewriting or colors only for an appropriate TTY. Keep log-field meanings consistent across languages, not necessarily their exact formatting or libraries.
…
자주 묻는 질문
‘처리 계약’이란 무엇인가요?
스크립트가 어떻게 작동해야 하는지에 대한 약속입니다. 입력으로 무엇을 받고, 출력으로 무엇을 만들며, 성공과 실패를 어떻게 보고하는지를 포함합니다.
일반적인 진행 막대를 쓰면 안 되나요?
시각적인 진행 막대는 사용자 인터페이스를 위한 것입니다. 이 도구는 백그라운드나 일괄 처리로 실행되는 스크립트를 위해, 스크립트가 실제로 하는 일을 바꾸지 않고 명확하고 구조화된 정보를 제공하는 데 집중합니다.
항목이 실패하면 어떻게 되나요?
도구는 어떤 항목이 왜 실패했는지, 그리고 스크립트가 계속 진행할지를 보고할 수 있습니다. 전체 작업을 멈추지 않고 특정 문제를 정확히 짚어 줍니다.
상세 정보
작성자의 원본 설명
Design and verify runtime output when creating or modifying Python, PowerShell, or Node.js scripts that process multiple files, records, or API requests. Use for batch scripts, bulk operations, silent long-running loops, progress reporting, per-item failures, final counts, stdout separation, or exit-status consistency. Not for UI progress bars, monitoring infrastructure, or progress updates in the
repo: github/awesome-copilot
인기도
- GitHub 스타
- 40k
- 순위
- #7091
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
acquire-codebase-knowledge
40k에이전트가 기존 코드 프로젝트를 이해하고 문서화하도록 돕습니다. 새 구성원을 맞이하거나 아키텍처를 개괄적으로 파악할 때 유용합니다.
acreadiness-assess
40k에이전트가 프로젝트의 AI 준비 상태를 평가하고 보고서를 만들도록 합니다. 프로젝트가 AI 도구를 쓸 준비가 얼마나 되어 있는지 이해하는 데 유용합니다.
acreadiness-generate-instructions
40k에이전트가 평가 결과를 바탕으로 AI 도구를 위한 지침을 만들도록 돕습니다. AI가 코드와 상호작용하는 방식을 개선하고 확인된 공백을 메울 때 유용합니다.
acreadiness-policy
40k에이전트가 AI 프로젝트 평가를 위한 정책을 정의하거나 적용하도록 돕습니다. 프로젝트 평가 방식을 표준화하고 규정 준수를 보장할 때 유용합니다.