| name | cleanup-completed-issues |
| description | Guide for cleaning up completed and closed issues in the torrust-tracker-deployer project. Covers removing issue documentation files, updating the roadmap, and syncing the GitHub roadmap issue. Supports single issue cleanup or batch cleanup. Use when cleaning up closed issues, removing issue docs, updating roadmap after PR merge, or maintaining docs/issues/ folder. Triggers on "cleanup issue", "remove issue", "clean completed issues", "delete closed issue", "update roadmap after merge". |
| metadata | {"author":"torrust","version":"1.0"} |
Cleaning Up Completed Issues
This skill guides you through cleaning up completed and closed issues in the Torrust Tracker Deployer project.
When to Clean Up
- Immediately after PR merge: Remove the specific issue file when its PR is merged
- Batch cleanup: Periodically clean up multiple closed issues during maintenance
- Before releases: Clean up documentation before major releases
- After completing epics: Clean up when a major milestone is finished
Cleanup Approaches
Option 1: Single Issue Cleanup (Recommended)
Use this approach when a PR is merged and you want to remove the issue immediately.
Process:
- Verify the issue is closed on GitHub
- Remove the issue file from
docs/issues/
- Remove any manual test documentation from
docs/issues/manual-tests/
- Update
docs/roadmap.md if the issue is a roadmap item
- Update GitHub roadmap issue #1 if roadmap was modified
- Commit and push changes
Option 2: Batch Cleanup
Use this when you want to clean up multiple closed issues at once during maintenance.
Process:
- List all issue files in
docs/issues/
- Check status of each issue on GitHub using GitHub CLI
- Identify all closed issues
- Remove all closed issue files and their manual test docs
- Update
docs/roadmap.md for all removed roadmap items
- Update GitHub roadmap issue #1
- Commit and push changes with detailed message
Step-by-Step Process
Step 1: Verify Issue is Closed on GitHub
For single issue:
gh issue view {issue-number} --json state --jq .state
Expected output: CLOSED
For batch cleanup:
ls docs/issues/ | grep -E '^[0-9]+-' | sed 's/-.*$//'
for issue in 21 22 23 24; do
state=$(gh issue view $issue --json state --jq .state 2>/dev/null || echo "NOT_FOUND")
echo "$issue:$state"
done
Step 2: Remove Issue Documentation File
Single issue:
git rm docs/issues/339-provide-config-examples-and-questionnaire-for-ai-agents.md
Batch cleanup:
git rm docs/issues/21-fix-e2e-infrastructure-preservation.md \
docs/issues/22-rename-app-commands-to-command-handlers.md \
docs/issues/23-add-clap-subcommand-configuration.md \
docs/issues/24-add-user-documentation.md
Important: Never delete template files:
EPIC-TEMPLATE.md
GITHUB-ISSUE-TEMPLATE.md
SPECIFICATION-TEMPLATE.md
Step 3: Check for Manual Test Documentation
Some issues may have manual test results in docs/issues/manual-tests/:
ls docs/issues/manual-tests/ | grep "^{issue-number}-"
Remove manual test files if they exist:
git rm docs/issues/manual-tests/339-*.md
git rm docs/issues/manual-tests/21-*.md \
docs/issues/manual-tests/22-*.md \
docs/issues/manual-tests/23-*.md
Step 4: Update Roadmap (If Applicable)
Check if the closed issue(s) are mentioned in docs/roadmap.md.
Identify roadmap items:
grep -n "#339" docs/roadmap.md
Update roadmap status:
For completed roadmap items, ensure they are marked with [x] and have completion indicators:
# Before:
- [ ] **X.Y** Task description - [Issue #339](...)
# After:
- [x] **X.Y** Task description - [Issue #339](...) ✅ Completed
Note: Do NOT remove completed items from the roadmap—mark them as completed instead. The roadmap serves as a historical record of progress.
Step 5: Update GitHub Roadmap Issue #1
IMPORTANT: Whenever you modify docs/roadmap.md, you must also update the mirrored roadmap issue on GitHub.
The roadmap issue is: https://github.com/torrust/torrust-tracker-deployer/issues/1
Process:
- Read the updated
docs/roadmap.md content
- Navigate to issue #1 on GitHub
- Click "Edit" on the issue description
- Replace the body with the updated roadmap content
- Click "Update comment" to save
Why this is necessary:
- The roadmap issue #1 serves as the central tracking point for all project progress
- It provides a single source of truth visible on GitHub
- Epic and task issues link back to it
- Keeping it synchronized ensures accurate project visibility
Step 6: Commit Changes
Single issue commit message format:
git commit -m "docs: remove completed issue #{number}
The PR #{pr-number} has been merged to main. The issue tracking file is no longer needed."
Example:
git add docs/issues/ docs/roadmap.md
git commit -m "docs: remove completed issue #339
The PR #345 has been merged to main. The issue tracking file is no longer needed."
Batch cleanup commit message format:
git commit -m "chore: remove closed issue documentation files
Removed X closed issue documentation files from docs/issues/:
- #21: fix-e2e-infrastructure-preservation
- #22: rename-app-commands-to-command-handlers
- #23: add-clap-subcommand-configuration
- #24: add-user-documentation
Also removed associated manual test documentation from docs/issues/manual-tests/.
Updated roadmap to mark completed items.
All these issues have been closed on GitHub and no longer need
local documentation files.
Remaining open issues: #16, #17, #18, #19, #34"
Step 7: Push Changes
git push origin main
Complete Example: Single Issue Cleanup
User says: "The PR #339 has been merged. Clean up the issue."
Actions:
gh issue view 339 --json state --jq .state
git rm docs/issues/339-provide-config-examples-and-questionnaire-for-ai-agents.md
ls docs/issues/manual-tests/ | grep "^339-"
grep -n "#339" docs/roadmap.md
git add docs/issues/ docs/roadmap.md
git commit -m "docs: remove completed issue #339
The PR #345 has been merged to main. The issue tracking file is no longer needed."
git push origin main
Complete Example: Batch Cleanup
User says: "Clean up all closed issues."
Actions:
for file in docs/issues/[0-9]*.md; do
issue=$(echo $file | grep -oP '\d+' | head -1)
state=$(gh issue view $issue --json state --jq .state 2>/dev/null || echo "NOT_FOUND")
echo "$issue:$state:$file"
done
git rm docs/issues/21-fix-e2e-infrastructure.md \
docs/issues/22-rename-commands.md \
docs/issues/23-add-clap-config.md
git rm docs/issues/manual-tests/21-*.md docs/issues/manual-tests/22-*.md 2>/dev/null || true
git add docs/issues/ docs/roadmap.md
git commit -m "chore: remove closed issue documentation files
Removed 3 closed issue documentation files from docs/issues/:
- #21: fix-e2e-infrastructure
- #22: rename-commands
- #23: add-clap-config
Updated roadmap to mark completed items.
All these issues have been closed on GitHub and no longer need
local documentation files.
Remaining open issues: #34, #35, #36"
git push origin main
Verification Checklist
After cleanup, verify:
Common Mistakes to Avoid
❌ Don't delete template files (EPIC-TEMPLATE.md, GITHUB-ISSUE-TEMPLATE.md, SPECIFICATION-TEMPLATE.md)
❌ Don't forget manual test documentation in docs/issues/manual-tests/
❌ Don't remove roadmap items from docs/roadmap.md—mark them as completed instead
❌ Don't forget to update GitHub roadmap issue #1 when modifying docs/roadmap.md
❌ Don't delete issues that are still open on GitHub
✅ Do verify issue status before deletion
✅ Do update roadmap for roadmap items
✅ Do sync GitHub issue #1 with roadmap changes
✅ Do check for associated manual tests
✅ Do use descriptive commit messages
References
- Detailed cleanup guide:
docs/contributing/roadmap-issues.md (Section: "Cleaning Up Closed Issues")
- Roadmap document:
docs/roadmap.md
- GitHub roadmap issue: Issue #1
- Commit conventions:
docs/contributing/commit-process.md
GitHub CLI Quick Reference
gh issue view {number} --json state --jq .state
gh issue view {number} --json state,title --jq '{state: .state, title: .title}'
gh issue list --state closed --limit 100
Pro Tips
- Clean up regularly: Don't let
docs/issues/ accumulate too many closed issues
- Clean immediately after merge: Easier than batch cleanup later
- Keep roadmap synchronized: Always update both
docs/roadmap.md and GitHub issue #1
- Document removals: Use clear commit messages listing removed issues
- Git history: Deleted files remain in git history if needed for reference