Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install dependencies
run: yarn install

- name: Run tests with coverage
run: yarn vitest run --coverage

# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v5
# with:
# files: coverage/coverage-final.json
# token: ${{ secrets.CODECOV_TOKEN }} # optional if public repo
23 changes: 22 additions & 1 deletion .github/workflows/todo.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Smart TODO Check
name: Smart TODO Tracker

on:
push:
Expand All @@ -7,6 +7,10 @@ on:
jobs:
smart-todo:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write

steps:
- uses: actions/checkout@v3

Expand All @@ -22,3 +26,20 @@ jobs:
uses: ./
with:
repo-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
issue-title-template: src/templates/issueTitle.txt
issue-body-template: src/templates/issueBody.md
report: true

- name: Upload TODO report
uses: actions/upload-artifact@v3
with:
name: todo-report
path: TODO_REPORT.md

- name: Commit TODO report
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add TODO_REPORT.md
git commit -m "chore(report): update TODO report" || echo "No changes"
git push
3 changes: 3 additions & 0 deletions .github/workflows/todo/issueBody.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
🗂 **File:** `{{file}}:{{line}}`

📝 **Content:**
1 change: 1 addition & 0 deletions .github/workflows/todo/issueTitle.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{{tag}}] {{text}}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
node_modules/
dist/
.env
.env


TODO_REPORT.md
139 changes: 138 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,138 @@
# smart-todo-action
# 🧠 smart-todo-action

A GitHub Action that scans your codebase for inline TODOs, FIXMEs, and BUG comments, and automatically creates GitHub Issues — with support for labels, metadata parsing, and semantic enrichment.

---

## 🚀 Features

- ✅ Detects `TODO`, `FIXME`, `BUG`, and `HACK` comments
- ✅ Supports multiple languages: `.ts`, `.js`, `.py`, `.go`, `.html`, etc.
- ✅ Extracts metadata like `priority`, `due`, etc.
- ✅ Automatically labels issues based on type and metadata
- ✅ Creates labels on the fly if they don't exist

---

## ⚙️ Usage

### 1. Add the Action to your workflow

```yaml
name: Smart TODO Tracker

on:
push:
branches: [main]

jobs:
smart-todo:
runs-on: ubuntu-latest
permissions:
issues: write

steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- run: yarn install
- run: yarn prepare

- name: Run Smart TODO Action
uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
```

## 📝 Example TODOs

```ts
// TODO(priority=high, due=2025-06-01): Refactor this method for performance
// FIXME: Handle null input properly
// BUG: This causes a crash when file is empty
```

## 🏷️ Automatic Labels

Based on your TODO comment, the following labels will be applied:

| Tag | Label(s) |
|--------|-----------------------------------------------|
| TODO | `enhancement`, `priority:high`, `due:2025-06-01` |
| FIXME | `bug` |
| BUG | `bug` |
| HACK | `technical-debt` |

If a label like `priority:high` or `due:2025-06-01` doesn't exist, it will be automatically created.

---

## 📌 Notes

- Max **5 issues** are created per run to avoid rate limiting
- **Duplicate detection** is not yet implemented _(coming soon)_
- All labels are **auto-created with default colors** if missing

---

## 📤 Coming Soon

- ✅ Issue deduplication
- ✅ Custom templates for issue bodies
- ✅ CLI usage outside GitHub
- ✅ LLM-powered summarization and classification
- ✅ Support for more languages and comment styles
- ✅ Customizable label creation and management
- ✅ Integration with project management tools (e.g., Jira, Trello)
- ✅ Support for multiple repositories in a single run
- ✅ Rate limiting and error handling improvements
- ✅ Customizable issue creation frequency (e.g., daily, weekly)
- ✅ Support for user-defined metadata tags
- ✅ Customizable issue assignment (e.g., to specific users or teams)
- ✅ Support for issue templates and custom fields
- ✅ Integration with CI/CD pipelines for automated issue tracking
- ✅ Support for issue comments and discussions
- ✅ Customizable notification settings (e.g., email, Slack)
- ✅ Support for issue closing and resolution tracking
- ✅ Customizable issue lifecycle management (e.g., open, in progress, closed)


```plaintext
smart-todo-action/
├── .github/
│ └── workflows/
│ └── todo.yml
├── dist/
│ └── index.js
├── src/
│ ├── core/
│ │ ├── issueManager.ts
│ │ ├── labelManager.ts # 🆕 Label logic (static + metadata + creation)
│ │ ├── report.ts
│ │ ├── todoUtils.ts
│ │ └── __tests__/ # (opcional) unit tests
│ ├── parser/
│ │ ├── extractTodosFromDir.ts
│ │ ├── extractTodosFromFile.ts
│ │ └── types.ts
│ ├── templates/
│ │ ├── issueTitle.txt
│ │ ├── issueBody.md
│ │ └── utils.ts
│ └── ActionMain.ts
├── .gitignore
├── action.yml
├── package.json
├── tsconfig.json
└── README.md
```
103 changes: 3 additions & 100 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ A smart GitHub Action that detects, classifies, and transforms inline TODOs in y

> Provide visibility into the evolution and structure of tracked TODOs.

- [ ] Markdown/HTML dashboard with summary statistics
_Total TODOs, grouped by folder, priority, author (`git blame`)_
- [X] Markdown/HTML dashboard with summary statistics
_Total TODOs, grouped by folder, priority, author (`git blame`) — **now sorted by `priority` and `due` date**_

- [ ] TODO history tracking (added/removed/modified)
- [ ] Due date notifications or PR comments

Expand All @@ -68,101 +69,3 @@ A smart GitHub Action that detects, classifies, and transforms inline TODOs in y
- Clean architecture and modularity are core principles from day one.
- LLM functionality will be optional and clearly separated from core logic.
- Built with automation, extensibility, and developer workflows in mind.

---

# 🚀 Roadmap for TODO Issue Tracker 2.0

This project aims to build an intelligent GitHub Action that scans your codebase for TODOs, classifies them, and transforms them into contextualized GitHub Issues — with semantic analysis and multi-platform integration.

---

## 🧱 Phase 1: Foundations and Parity with the Original Project

🎯 Goal: Recreate the original functionality with clean, modular, and testable code.

- [ ] Create the base project structure
- `src/` folder for source code
- Subfolders: `core/`, `parser/`, `tasks/`, `templates/`, etc.

- [ ] Implement TODO parser
- Detect `TODO`, `FIXME`, `BUG`, etc. comments
- Support for multiple languages (`.js`, `.ts`, `.py`, `.go`, etc.)

- [ ] Initial task system: GitHub Issues
- Create, update, and remove issues based on detected TODOs

- [ ] Templating system for issue creation
- Customizable titles and descriptions via templates

- [ ] Functional GitHub Action workflow
- `action.yml` definition file
- Example usage in `.github/workflows/todo.yml`

- [ ] Unit testing with Jest or Vitest

---

## 🧠 Phase 2: Intelligence and Semantics

🎯 Goal: Make the system smarter by leveraging LLMs and contextual awareness.

- [ ] Automatic TODO classification
- Use LLMs or heuristics to classify as `bug`, `enhancement`, `refactor`, etc.

- [ ] Auto-generate issue titles and descriptions using LLMs
_Example: `Review sorting algorithm` → `Optimize Sorting Algorithm for Edge Cases`_

- [ ] Extract `due date` and `priority` via inline metadata parsing
_Example: `TODO(priority=high, due=2025-06-01): improve this logic`_

---

## 🌍 Phase 3: Extended Support

🎯 Goal: Make the project adaptable to diverse environments and workflows.

- [ ] Support for multiple task management platforms
_GitHub, Jira, Notion, Trello, Linear (via APIs)_

- [ ] Internationalization (i18n)
_Detect TODOs written in different languages_

- [ ] Support for additional file types
_`.ipynb`, `.yaml`, `.md`, `.json`, `.xml`, and more_

---

## 📊 Phase 4: Analysis and Reporting

🎯 Goal: Provide visibility into the state and evolution of TODOs.

- [ ] Markdown/HTML dashboard with metrics
_Total TODOs, grouped by folder, priority, author (`git blame`)_

- [ ] TODO history tracking
_Track when TODOs are added, removed, or changed over time_

- [ ] Notifications and reminders
_Comment on PRs or issues when due dates are approaching_

---

## 🔁 Phase 5: Optimizations and Contributions

🎯 Goal: Ensure quality, performance, and ease of collaboration.

- [ ] Plugin-based modular architecture
- [ ] CLI support (standalone usage outside GitHub Actions)
- [ ] Test coverage >90%
- [ ] Full documentation with usage examples
- [ ] Publish to GitHub Marketplace as an official Action

---

## 📌 Notes

- Modularity, testability, and code clarity are priorities from day one.
- LLM integration will be optional and cleanly decoupled from core logic.
- Designed with automation, extensibility, and developer experience in mind.

16 changes: 15 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@ author: 'Diogo Ribeiro'

inputs:
repo-token:
description: 'GitHub token com permissão para criar issues'
required: true
description: GitHub token to create issues

report:
required: false
description: Whether to generate a TODO markdown report
default: 'false'

issue-title-template:
required: false
description: Optional path to custom issue title template

issue-body-template:
required: false
description: Optional path to custom issue body template

runs:
using: 'node20'
Expand All @@ -14,3 +27,4 @@ runs:
branding:
icon: 'check-circle'
color: 'blue'

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1"
"@actions/github": "^5.1.1",
"@octokit/rest": "^21.1.1"
},
"devDependencies": {
"@types/node": "^20.11.17",
Expand Down
Loading
Loading