Automate cleanup of completed issue specs in docs/issues with a non-interactive script

未关闭
#1,774 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
54/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
github, rust
领域
tooling

调研方向

Read .github/skills/dev/planning/cleanup-completed-issues/SKILL.md and inspect the existing docs/issues/open/ and docs/issues/closed/ layout to understand the documented Stage 1 workflow. Start by locating the project’s conventions for scripts and tests; the issue does not name a specific implementation language or test location. Done means the Stage 1 archive flow is non-interactive, verifies GitHub issue state, defaults to dry-run, emits JSON results with diagnostics on stderr, and has basic validation for key paths.

由索引模型根据 Issue 内容生成。

描述

- Developer - Automation

Summary

Create an automation script for the skill at .github/skills/dev/planning/cleanup-completed-issues/SKILL.md to reduce manual work and mistakes when cleaning completed issues.

The script should support the two-stage lifecycle already documented:

  1. Stage 1: move closed issue specs from docs/issues/open/ to docs/issues/closed/
  2. Stage 2: delete old specs from docs/issues/closed/ only when no longer referenced

Motivation

The current process is repetitive and easy to get wrong in batch operations.
Automating it would make maintenance faster and safer while keeping behavior aligned with the skill.

Proposed scope (phase 1)

Implement a script for Stage 1 archive with a strict, agent-friendly interface:

  • Non-interactive CLI only (no prompts)
  • Verify issue state on GitHub before moving
  • Support dry run by default
  • Support apply mode for real changes
  • Produce structured JSON on stdout
  • Send diagnostics to stderr
  • Return meaningful non-zero exit codes on failure

Suggested flags:

  • --issues 1042,1178,...
  • --all-closed-in-open (optional)
  • --dry-run (default)
  • --apply
  • --json

Proposed scope (phase 2)

Add Stage 2 delete with stronger safeguards:

  • Check references before delete (filename and issue references in docs)
  • Refuse deletion if references are found unless explicit override is provided
  • Keep --dry-run default and require explicit confirmation flag for destructive actions

Acceptance criteria

  • Script is added under the cleanup skill folder (for example scripts/)
  • SKILL.md documents the script(s), usage, examples, and prerequisites
  • Stage 1 move flow is fully automated and idempotent
  • Script never blocks on interactive input
  • Output is parseable JSON for results; diagnostics are separate
  • Dry-run behavior is default
  • Errors are explicit and actionable (invalid issue, open issue, missing file, ambiguous file)
  • Basic tests or fixture-based validation for key paths are included

Notes

Reference guidance used for script design:

Key recommendations to follow:

  • avoid interactive prompts
  • provide clear --help
  • use structured output
  • separate stdout data from stderr diagnostics
  • use safe defaults (--dry-run)
  • support idempotent retries
主要语言
Rust
星标
532
派生
56
平均合并
11 小时 20 分钟
30 天内合并 PR
282

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

torrust/torrust-tracker 的其他 Issue

查看 torrust/torrust-tracker 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。