Package Exports
- auto-fix-workflow
- auto-fix-workflow/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (auto-fix-workflow) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
auto-fix-workflow
English | ํ๊ตญ์ด
MCP (Model Context Protocol) server for automated GitHub issue management and code fixing workflows.
Features
- GitHub Integration: Manage issues, pull requests, and labels
- Asana Integration: Sync tasks and analyze for auto-fix suitability
- Git Worktree Management: Isolated development environments for parallel fixes
- Code Quality Checks: Run typecheck, lint, and tests with configurable order
- Workflow Orchestration: Group issues, plan fix strategies, create PRs
Installation
npm install auto-fix-workflowInitial Setup
Run the init command to configure the project:
npx auto-fix-workflow initThis will:
- Create
.mcp.jsonwith MCP server configuration - Create
.auto-fix.yamlwith workflow settings and tokens - Add
.auto-fix.yamlto.gitignorefor security
Options:
--non-interactive: Read tokens from GITHUB_TOKEN and ASANA_TOKEN environment variables--force: Overwrite existing configuration files--skip-validation: Skip token validation
For detailed setup instructions, see Setup Guide.
Quick Start
As MCP Server
After running npx auto-fix-workflow init, the following files are created:
.mcp.json (MCP server configuration - can be committed):
{
"mcpServers": {
"auto-fix-workflow": {
"command": "npx",
"args": ["auto-fix-workflow"],
"env": {}
}
}
}.auto-fix.yaml (workflow settings + tokens - gitignored):
# Tokens (this file is added to .gitignore)
tokens:
github: "your-github-token"
asana: "your-asana-token"
github:
owner: your-org
repo: your-repo
baseBranch: main
asana:
projectId: "1234567890"
workspaceId: "0987654321"
checks:
order:
- typecheck
- lint
- test
timeout: 300000
failFast: true
worktree:
baseDir: .worktrees
cleanupOnSuccess: trueAvailable Tools
GitHub Tools
| Tool | Description |
|---|---|
github_get_issue |
Fetch issue details by number |
github_list_issues |
List and filter repository issues |
github_create_issue |
Create new issues with labels |
github_update_issue |
Update issue state and content |
github_create_pr |
Create pull requests |
Asana Tools
| Tool | Description |
|---|---|
asana_get_task |
Fetch task details |
asana_list_tasks |
List project tasks |
asana_update_task |
Update task status |
asana_analyze_task |
Analyze task for auto-fix suitability |
Git Tools
| Tool | Description |
|---|---|
git_create_worktree |
Create isolated worktree |
git_remove_worktree |
Remove worktree with cleanup |
git_list_worktrees |
List active worktrees |
Check Tools
| Tool | Description |
|---|---|
run_checks |
Execute typecheck, lint, test |
Workflow Tools
| Tool | Description |
|---|---|
group_issues |
Group related issues by component |
triage |
Prioritize and categorize issues |
autofix |
Execute full auto-fix workflow |
Commands
Init Command
Initialize project configuration:
npx auto-fix-workflow initOptions:
--non-interactive: Read tokens from environment variables--force: Overwrite existing files--skip-validation: Skip token validation
Triage Command
Analyze and prioritize issues for processing:
npx auto-fix-workflow triage --label auto-fix --limit 10Options:
--label: Filter by label--state: Filter by state (open/closed)--limit: Maximum issues to process--dry-run: Preview without making changes
Autofix Command
Execute automated fix workflow:
npx auto-fix-workflow autofix --issues 1,2,3Options:
--issues: Comma-separated issue numbers--group-by: Grouping strategy (component/file/none)--fail-fast: Stop on first failure--dry-run: Preview operations
Environment Variables
| Variable | Description | Required |
|---|---|---|
GITHUB_TOKEN |
GitHub personal access token | Yes |
ASANA_TOKEN |
Asana personal access token | For Asana features |
AUTO_FIX_CONFIG |
Custom config file path | No |
LOG_LEVEL |
Logging level (debug/info/warn/error) | No |
API Token Scopes
GitHub Token
Create a Personal Access Token with the following scopes:
| Scope | Required | Description |
|---|---|---|
repo |
Yes | Full control of private repositories |
public_repo |
Yes (for public repos) | Access public repositories |
read:org |
Optional | Read org membership (for org repos) |
For fine-grained tokens (recommended):
- Repository access: Select specific repositories
- Permissions:
- Issues: Read and write
- Pull requests: Read and write
- Contents: Read and write
- Metadata: Read-only
Asana Token
Create a Personal Access Token in Asana Developer Console:
| Permission | Description |
|---|---|
| Read tasks | View task details and list tasks |
| Write tasks | Update task status, add comments |
| Read projects | Access project information |
Workflow Examples
Example 1: Triage Asana Tasks
Analyze Asana tasks and convert them to GitHub Issues:
User: /triage
Claude: ๐ Scanning Asana tasks in "To Triage" section...
๐ Found 3 tasks to analyze:
Task #12345: "Save button error"
โโโ โ
Reproduction steps: Clear
โโโ โ
Error message: TypeError - id property access error
โโโ โ
Related file: src/components/Editor.tsx (handleSave function)
โโโ โ
Root cause: document object accessed before initialization
โโโ ๐ซ GitHub Issue #45 created
Task #12346: "App is slow"
โโโ โ Reproduction steps: Unclear
โโโ โ Specific symptoms: Unclear
โโโ ๐ Added "needs-more-info" tag to Asana
Task #12347: "Export PDF fails"
โโโ โ
Reproduction steps: Clear
โโโ โ
Error message: Found
โโโ ๐ซ GitHub Issue #46 created
๐ Results:
- โ
Converted: 2 tasks
- โณ Needs more info: 1 taskExample 2: Auto-Fix Issues
Automatically fix GitHub issues with the auto-fix label:
User: /autofix
Claude: ๐ Fetching issues with auto-fix label...
๐ Pending Issues (5):
Group 1: canvas-core (3 issues)
- #123: TypeError in handleSave
- #124: Null reference in renderPage
- #125: Missing validation in exportPDF
Group 2: ui (1 issue)
- #130: Button disabled state not working
Group 3: editor (1 issue)
- #132: Keyboard shortcut conflict
Select issues to process:
1. All issues (5 issues, 3 worktrees)
2. Select specific groups
3. Select specific issues
User: 1
Claude:
๐ Starting auto-fix...
[Worktree 1/3] fix/issue-123-124-125 (canvas-core)
โโโ ๐ Worktree created
โโโ ๐ Analyzing issues...
โโโ โ๏ธ Applying fixes...
โโโ ๐งช Running checks...
โ โโโ โ
typecheck (passed)
โ โโโ โ
lint (passed)
โ โโโ โ
test (passed)
โโโ ๐ค PR #201 created
โโโ ๐งน Worktree cleaned up
[Worktree 2/3] fix/issue-130 (ui)
โโโ ๐ Worktree created
โโโ ๐ Analyzing issue...
โโโ โ๏ธ Applying fix...
โโโ ๐งช Running checks...
โ โโโ โ
typecheck (passed)
โ โโโ โ
lint (passed)
โ โโโ โ
test (passed)
โโโ ๐ค PR #202 created
โโโ ๐งน Worktree cleaned up
[Worktree 3/3] fix/issue-132 (editor)
โโโ ๐ Worktree created
โโโ ๐ Analyzing issue...
โโโ โ๏ธ Applying fix...
โโโ ๐งช Running checks...
โ โโโ โ
typecheck (passed)
โ โโโ โ test (failed - shortcut conflict with existing binding)
โ โโโ ๐ Retry 1/3...
โโโ โ๏ธ Adjusting fix...
โโโ ๐งช Running checks...
โ โโโ โ
typecheck (passed)
โ โโโ โ
lint (passed)
โ โโโ โ
test (passed)
โโโ ๐ค PR #203 created
โโโ ๐งน Worktree cleaned up
๐ Results:
- โ
Success: 5 issues (PR #201, #202, #203)
- โ Failed: 0 issues
All PRs target the 'autofixing' branch for manual review.Example 3: Fix Specific Issues
Fix only specific issues:
User: /autofix --issues 123,124
Claude:
๐ Processing issues #123, #124...
[Worktree] fix/issue-123-124
โโโ ๐ Worktree created
โโโ ๐ Analyzing 2 issues...
โโโ โ๏ธ Applying fixes...
โโโ ๐งช Running checks... โ
All passed
โโโ ๐ค PR #204 created (Closes #123, #124)
โโโ ๐งน Worktree cleaned up
๐ Results:
- โ
Success: 2 issues
- PR: https://github.com/your-org/your-repo/pull/204Example 4: Dry Run Mode
Preview what would happen without making changes:
User: /autofix --dry-run
Claude:
๐ [DRY RUN] Analyzing auto-fix issues...
๐ Would process 3 issues:
Group: canvas-core
โโโ #123: TypeError in handleSave
โ โโโ Fix: Add null check for document object
โโโ #124: Null reference in renderPage
โ โโโ Fix: Initialize page state before render
โโโ #125: Missing validation in exportPDF
โโโ Fix: Add input validation for PDF options
Planned actions:
1. Create worktree: fix/issue-123-124-125
2. Apply 3 fixes
3. Run checks: typecheck, lint, test
4. Create PR targeting 'autofixing' branch
5. Clean up worktree
No changes made (dry run mode).Development
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Type check
npm run type-check
# Lint
npm run lintSpec-Driven Development
This project was developed using sdd-tool for spec management.
# Validate all specs
npx sdd-tool validate
# List specs
npx sdd-tool listSpecs are located in .sdd/specs/ directory.
Architecture
src/
โโโ common/ # Shared types, utilities, logging
โโโ github/ # GitHub API integration
โโโ asana/ # Asana API integration
โโโ git/ # Git worktree management
โโโ checks/ # Code quality checks
โโโ analyzer/ # Task analysis and code location
โโโ workflow/ # Issue grouping and fix strategies
โโโ commands/ # CLI commands (triage, autofix)
โโโ index.ts # MCP server entry pointDocumentation
- Setup Guide - Initial setup for GitHub, Asana, and Sentry integration
License
MIT