Convert roadmaps to GitHub issues
Project description
Gitscaffold – Generate GitHub Issues from Markdown Roadmaps
Gitscaffold is a command-line tool and GitHub Action that converts Markdown-based roadmaps into GitHub issues and milestones using AI-driven extraction and enrichment.
Key Features
- AI-Powered Issue Extraction: Convert free-form Markdown documents into structured GitHub issues using OpenAI.
- Roadmap Synchronization (
sync): Compare your Markdown roadmap with an existing GitHub repository and interactively create missing issues to keep them aligned. - Bulk Delete Closed Issues (
delete-closed): Clean up your repository by permanently removing all closed issues, with dry-run and confirmation steps. - Cleanup Issue Titles (
sanitize): Strip leading Markdown header characters from existing GitHub issue titles, with preview and confirmation. - Deduplicate Issues (
deduplicate): Find and close duplicate open issues based on their title. - AI Enrichment: Enhance issue descriptions with AI-generated content for clarity and context.
- Show Next Action Items (
next): Display open issues for the earliest active milestone. - Show Next Task (
next-task): Display or select your next open task for the current roadmap phase, with optional random pick and browser opening. - Diff Local Roadmap vs GitHub Issues (
diff): Compare your local Markdown roadmap file against your repository’s open and closed issues. - Flexible Authentication: Supports GitHub tokens and OpenAI keys via environment variables,
.envfiles, or command-line options.
Installation
pip install gitscaffold
Authentication and API Keys
gitscaffold requires a GitHub Personal Access Token (PAT) for interacting with GitHub and an OpenAI API key for AI-driven features.
You can provide these keys in a few ways:
- Environment Variables: Set
GITHUB_TOKENandOPENAI_API_KEYin your shell. .envfile: Create a.envfile in your project's root directory.gitscaffoldwill automatically load it.GITHUB_TOKEN="your_github_personal_access_token" OPENAI_API_KEY="your_openai_api_key"- GitHub Token (
GITHUB_TOKEN):- You'll need a Personal Access Token (PAT).
- For operations on existing repositories (e.g.,
gitscaffold create,gitscaffold import-md), the token primarily needs theissues:writepermission. - If you use commands that create new repositories (e.g.,
gitscaffold setup-repositoryfrom thescaffold.clior./gitscaffold.py setup), your PAT will need thereposcope (which includespublic_repoandrepo:status).
- OpenAI API Key (
OPENAI_API_KEY): This is your standard API key from OpenAI. - Important: Add your
.envfile to your.gitignoreto prevent accidentally committing your secret keys.
- GitHub Token (
- Command-line Options: Pass them directly, e.g.,
--token YOUR_GITHUB_TOKEN.
If a token/key is provided via a command-line option, it will take precedence over environment variables or .env file settings. If not provided via an option, environment variables are checked next, followed by the .env file. Some commands like gitscaffold create may prompt for the GitHub token if it's not found.
Getting Started: A Basic Workflow
Here's how to use gitscaffold to populate a new repository with issues from a roadmap:
-
Create a Roadmap File
Create a file named
ROADMAP.mdand add your project structure. You can start with a simple structured format like this:{ "name": "My New Project", "milestones": [ { "name": "v1.0: Launch", "due_date": "2025-12-31" } ], "features": [ { "title": "Setup initial project structure", "milestone": "v1.0: Launch", "labels": ["setup", "chore"] }, { "title": "Implement user authentication", "milestone": "v1.0: Launch", "labels": ["feature", "auth"], "tasks": [ { "title": "Add login page" }, { "title": "Add registration page" } ] } ] }
-
Sync with GitHub
Run the
synccommand to create the milestones and issues in your repository.gitscaffoldwill show you a plan and ask for confirmation before making any changes.# Make sure you have set GITHUB_TOKEN gitscaffold sync ROADMAP.md --repo your-github-name/your-repo
That's it! Your repository is now populated based on your roadmap.
CLI Usage
Use sync to create and update GitHub issues from a structured roadmap file. It compares the roadmap with the repository and creates any missing milestones or issues.
# Sync with a structured roadmap file (e.g., ROADMAP.md containing JSON)
gitscaffold sync ROADMAP.md --repo owner/repo
# To enrich descriptions of new issues with AI during sync
gitscaffold sync ROADMAP.md --repo owner/repo --ai-enrich
# Simulate the sync operation without making changes
gitscaffold sync ROADMAP.md --repo owner/repo --dry-run
Delete closed issues
Use delete-closed to permanently remove all closed issues from a specified repository. This action is irreversible and requires confirmation.
# List closed issues that would be deleted (dry run)
gitscaffold delete-closed --repo owner/repo --token $GITHUB_TOKEN --dry-run
# Delete all closed issues (will prompt for confirmation)
gitscaffold delete-closed --repo owner/repo --token $GITHUB_TOKEN
Sanitize Issue Titles
Use sanitize to remove leading Markdown header markers (e.g., #) from existing issue titles in a repository.
# Dry-run: list titles that need cleanup
gitscaffold sanitize --repo owner/repo --token $GITHUB_TOKEN --dry-run
# Apply fixes (will prompt for confirmation)
gitscaffold sanitize --repo owner/repo --token $GITHUB_TOKEN
Show Next Action Items
Use next to view all open issues from the earliest active milestone in your repository.
gitscaffold next --repo owner/repo --token $GITHUB_TOKEN
Show Next Task for Current Phase
Use next-task to pick your next open task for the current roadmap phase. By default, the oldest task is shown; use --pick to choose randomly and --browse to open it in your browser.
gitscaffold next-task ROADMAP_FILE --repo owner/repo --token $GITHUB_TOKEN [--pick] [--browse]
Diff Roadmap and GitHub Issues
Use diff to compare a local roadmap file against GitHub issues. It lists items present in your roadmap but missing on GitHub, and issues on GitHub not in your roadmap.
gitscaffold diff ROADMAP.md --repo owner/repo --token $GITHUB_TOKEN
From the source checkout
You can clone this repository and use the top-level gitscaffold.py script:
## Setup GitHub labels, milestones, and project board
./gitscaffold.py setup owner/repo --phase phase-1 --create-project
## Delete all closed issues in a repository
./gitscaffold.py delete-closed owner/repo
## Enrich a single issue or batch
./gitscaffold.py enrich owner/repo --issue 123 --path ROADMAP.md --apply
./gitscaffold.py enrich owner/repo --batch --path ROADMAP.md --csv out.csv --interactive
## Import from unstructured Markdown (via AI)
./gitscaffold.py import-md owner/repo markdown_roadmap.md --heading-level 2 --token $GITHUB_TOKEN
Audit Repository (cleanup, deduplicate, diff)
Use the provided scripts/audit.sh to run cleanup, deduplicate, and diff in one go. It will prompt for your GitHub repo, token, and local roadmap file.
bash scripts/audit.sh
GitHub Action Usage
name: Sync Roadmap to Issues
on: workflow_dispatch
jobs:
scaffold:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Gitscaffold CLI
uses: your-org/gitscaffold-action@vX.Y.Z
with:
roadmap-file: docs/example_roadmap.md
repo: ${{ github.repository }}
github-token: ${{ secrets.GITHUB_TOKEN }}
dry-run: 'true'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gitscaffold-0.1.9.tar.gz.
File metadata
- Download URL: gitscaffold-0.1.9.tar.gz
- Upload date:
- Size: 39.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73169113d6f2b3c5491ec0ea3bc655cdcbbf1093d81cb70aa8718a384e21cc7f
|
|
| MD5 |
f3fc213395623d856d6c29cb17ca5565
|
|
| BLAKE2b-256 |
c765889bd46a3bf568af8633ea6cb5fddf8e96dbee457552aec16a56e34253cf
|
File details
Details for the file gitscaffold-0.1.9-py3-none-any.whl.
File metadata
- Download URL: gitscaffold-0.1.9-py3-none-any.whl
- Upload date:
- Size: 34.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd9ea93e19ec8a22f438e876b6d6f2d743668ffb20deac4195437a13e9b11f2d
|
|
| MD5 |
3d9ccc4aefc193b9f4ff406c11a9f588
|
|
| BLAKE2b-256 |
d26adb440726069710dd11c645d1e25101d1b4e1d1ef6cbe4953ff0418a31b6d
|