AutoMaintainer-bot is a GitHub App bot designed to help developers automatically manage TODOs in code.
Every time you push code, it scans your diffs and extracts TODO comments.
- Scans for
TODOcomments on everypush. - Creates a GitHub Issue per TODO if it doesn't already exist.
- Issues include file path, line number, and commit reference.
- Supports single-line, block, and multi-line TODOs
- Avoids duplicates with content hashing
- Adds contextual labels to issues based on keywords (e.g.,
bug,feature,enhancement). - Adds labels to pull requests based on PR title (
chore,refactor,docs, etc.). - Ensures labels exist before applying them β creates them with color and description if missing.
- Organized in modules:
events,utils,config. - Easily extendable with new features or GitHub event handlers.
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run the bot (in development)
npm startCreate a .env file in the project root or set these variables in your environment:
APP_IDβ Your GitHub App's IDPRIVATE_KEYβ The private key for your GitHub App (PEM format, can usePRIVATE_KEY_PATHinstead)WEBHOOK_SECRETβ (Optional) Webhook secret for your GitHub App
Example .env:
APP_ID=12345
PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n..."
WEBHOOK_SECRET=yoursecret
# 1. Build container
docker build -t automaintainer .
# 2. Start container
docker run -e APP_ID=<app-id> -e PRIVATE_KEY="<pem-value>" automaintainer.
βββ src/
β βββ index.ts # Entry point and main app logic
β βββ events/ # GitHub event handlers (e.g., issues, PRs, push)
β β βββ issues.ts
β β βββ pullRequests.ts
β β βββ push.ts
β βββ utils/ # Utilities (e.g., TODO processor, label manager)
β β βββ todoProcessor.ts
β β βββ labelManager.ts
β βββ config/
β βββ labelColors.ts # Label colors definition
βββ .env # Environment variables (optional)
βββ Dockerfile # Docker container definition
βββ package.json # Project metadata and scripts
βββ README.md # Project documentation
To customize the bot, create a .github/auto-maintainer.yml file in your repository:
todoMarkers:
- TODO:
- FIXME:
defaultLabels:
- triage
- needs-review
autoCloseResolved: trueTo add new features or event handlers:
- Add a new handler in
src/events/. - Register it in
src/index.ts. - Add any utility functions to
src/utils/.
Contributions are welcome! If you have suggestions, bug reports, or want to add features:
- Open an issue or pull request.
- See the Contributing Guide for more details.
ISC Β© 2025 Alwil17
Q: How do I create a GitHub App for this?
A: See Probot's docs for step-by-step instructions.
Q: Can I customize TODO detection?
A: Not yet, but planned for future releases.
Q: Where do I add new event handlers?
A: In src/events/ and register them in src/index.ts.