Synchronise task lists with GitHub Projects using the gh CLI. Use this skill when users want to add tasks, to-dos, or action items to a GitHub repository's project board...
Synchronise task lists with GitHub Projects by creating issues and adding them to project boards.
Use this skill when:
Before using this skill, verify:
gh CLI installation: Check if gh CLI is installed and authenticated
gh auth status
If not authenticated, inform user to run: gh auth login
Git repository: For auto-detection, ensure the user is in a git repository with a GitHub remote
Identify where tasks are coming from:
From markdown file with checkboxes:
- [ ] Implement user authentication
- [ ] Add database migrations
- [x] Set up CI/CD (skip completed)
From user message: "I need to add these tasks: implement login, fix bug #123, update documentation"
From structured data: User provides JSON or explicit list of tasks.
Parse tasks into a structured format. Each task needs:
title (required): The task descriptionbody (optional): Additional detailslabels (optional): Array of label namesCheck if user specified a repository:
If not specified, attempt auto-detection:
# Use the sync_tasks.py script's auto-detection
# It checks 'origin' remote first, then falls back to first available remote
If auto-detection fails, ask user: "Which GitHub repository should these tasks be added to? (Format: owner/repo)"
Check if user specified a project:
If not specified, use first available project:
# The script will automatically find the first project
# This works for most single-project repositories
If no projects exist, ask user: "No projects found for this repository. Would you like me to:
Run the sync script based on the task source:
For markdown file:
python3 scripts/sync_tasks.py --tasks-file /path/to/tasks.md [--repo owner/repo] [--project-number N]
For individual tasks:
python3 scripts/sync_tasks.py --task "Task 1" --task "Task 2" [--repo owner/repo] [--project-number N]
For JSON tasks:
python3 scripts/sync_tasks.py --json-tasks '[{"title":"Task 1","body":"Details"}]' [--repo owner/repo] [--project-number N]
Script behaviour:
--repo not provided--project-number not providedParse the script output and present results clearly:
results = {
"success": true,
"repo": "owner/repo",
"project_number": 1,
"synced_tasks": [
{
"task": {"title": "Task 1"},
"issue_url": "https://github.com/owner/repo/issues/42"
}
],
"failed_tasks": []
}
Present to user:
Error: gh CLI not installed or not authenticated
Action: Inform user to run gh auth login and offer to help with setup.
Error: Could not determine GitHub repository
Action: Ask user to specify repository with --repo owner/repo or navigate to git repository.
Error: No projects found for owner/repo
Action:
gh project list --owner OWNERIf GitHub API rate limits are hit, inform user and suggest:
User: "Sync the tasks in todos.md to my project"
- [ ] itemspython3 scripts/sync_tasks.py --tasks-file todos.mdUser: "Add these tasks to myorg/webapp project 2: fix login bug, update README"
python3 scripts/sync_tasks.py --task "Fix login bug" --task "Update README" --repo myorg/webapp --project-number 2User: "Create issues for: refactor auth module, add tests"
[x] items in markdown listsFor complex task formats, parse them into the expected structure before calling the script:
tasks = [
{
"title": "Implement feature X",
"body": "- Requirement 1\n- Requirement 2",
"labels": ["enhancement", "priority:high"]
}
]
Then pass via --json-tasks parameter.
For detailed gh CLI commands and GitHub Projects API patterns, see references/gh_cli_reference.md.