Перейти к содержанию
Skillpedia
Автоматизации40k · #7091

batch-script-progress

Что он делает

Этот инструмент помогает добавить в скрипты, которые обрабатывают много элементов (файлов или данных), информацию о ходе выполнения. Он показывает, что происходит, что уже сделано и не случилось ли ошибок, при этом не меняя основной вывод скрипта.

Когда использовать

  • ✓Когда создаёте скрипты, которые обрабатывают много файлов пакетами.
  • ✓Когда нужно отслеживать ход длительных операций.
  • ✓Когда нужно понять, какие элементы не обработались в большой операции.

Ссылка на скилл

https://github.com/github/awesome-copilot/blob/main/skills/batch-script-progress/SKILL.md

Скопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.

Как использовать

Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.

Готовое сообщение для вставки

Используй этот скилл, чтобы помочь мне: https://github.com/github/awesome-copilot/blob/main/skills/batch-script-progress/SKILL.md Прочитай файл SKILL.md по этой ссылке и следуй его инструкциям в моей задаче.
Хотите, чтобы ваш ИИ сам находил такие скиллы?Установите бесплатный MCP Skillpedia: одна строка, и перед каждой задачей он ищет среди 15 000+ скиллов.Установить за 1 минуту →

Пример запроса к вашему ИИ

“Добавь вывод прогресса в этот 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
Обновлён
15.10.2026

Полезен ли этот скилл?

0

Войдите , чтобы голосовать.

Комментарии

  • …

Другие скиллы из этого репозитория

Похожие скиллы