9thlevelsoftware/legion/github-sync
- community
Checking that the SKILL.md file is still in the repository.
GitHub integration — issue tracking, PR creation, milestone sync, and status readback via gh CLI
Install
npx vskill@latest install 9thlevelsoftware/legion/github-syncSKILL.md
GitHub Sync
GitHub operations engine for Legion. Provides issue creation linked to phases, PR creation after phase execution, milestone synchronization with ROADMAP.md, and live status readback for the dashboard. All operations require the gh CLI and a GitHub remote, and all operations degrade gracefully when unavailable.
References:
- State File Locations from
workflow-common.md(state paths, degradation pattern) - Commit Conventions from
execution-tracker.md(commit format, phase lifecycle) - Milestone format from
milestone-tracker.md(milestone naming, phase ranges) .planning/STATE.md— stores GitHub linking metadata (issue/PR numbers per phase)
Section 1: Prerequisites & Detection
How to check if GitHub operations are available. This check MUST be run before ANY GitHub operation in a session.
Constants
These values are used throughout all GitHub operations:
The label color 7B68EE (medium slate blue) provides a distinct visual marker in the GitHub issue tracker, making Legion-created issues easy to identify at a glance.
Session Caching
Once the prerequisites check passes, cache the following values for the duration of the command run:
| Cached Value | Source | Example | |
|---|---|---|---|
github_available | Steps 1-2 result | true | |
REPO_SLUG | Step 3 first token | user/legion | |
DEFAULT_BRANCH | Step 3 second token | main |
Do NOT re-run the prerequisites check within the same command invocation. The cached values are valid for the entire session.
Section 2: Issue Management (GH-01)
Creating and managing GitHub issues linked to Legion phases. Each phase gets one tracking issue with a checklist of its plans.
2.1: Ensure Label Exists
Before the first issue creation in a session, ensure the "legion" label exists on the repository:
This command is idempotent — if the label already exists, gh returns a non-zero exit code but creates nothing. The 2>/dev/null suppresses the "already exists" error message. Do not check for the label's existence first; the create command handles both cases.
Run this once per session, before the first gh issue create call. Track with a session flag to avoid re-running on subsequent issue creations within the same command.
2.2: Create Phase Issue
Creates a GitHub issue that tracks all plans within a phase.
The --milestone flag is only included if a GitHub milestone has already been created for the corresponding ROADMAP milestone (see Section 4). If no milestone exists on GitHub, omit the flag entirely — do not create the milestone as a side effect of issue creation.
2.3: Close Phase Issue
Closes a phase issue after the phase passes review.
The comment should summarize the phase outcome. Typical format:
If the issue is already closed (e.g., closed manually by the user), gh issue close is a no-op. Do not treat this as an error.
2.4: Update Issue Checklist
After a plan completes during /legion:build, update the phase issue's checklist to reflect progress.
The checklist update is a progress indicator, not a critical operation. Build execution must never block or fail because a checklist update did not succeed.
Section 3: PR Creation (GH-02)
Creating pull requests after phase execution completes. PRs are created against the default branch and reference the phase issue if one exists.
3.1: Branch Management
Ensure the current work is on an appropriate branch before creating a PR.
3.2: Create Phase PR
Creates the pull request with a structured body that summarizes the phase.
The Closes #{issue_number} line uses GitHub's automatic issue closing — when the PR is merged, the referenced issue is closed automatically. Only include this line if a phase issue exists.
3.3: PR Creation Timing
PRs are created at specific points in the Legion workflow:
| Trigger | When | Condition | |
|---|---|---|---|
After /legion:build | All plans in phase executed | At least one plan succeeded | |
After /legion:review | Review cycle passes | PR not already created for this phase | |
Manual via /legion:quick | User requests PR | Current branch has unpushed commits |
Do NOT create a PR if all plans in the phase failed. A PR with only failed work is not useful. Instead, log a note and let the user decide.
Section 4: Milestone Sync (GH-03)
Mapping ROADMAP.md milestones to GitHub milestones. This provides a high-level view of project progress directly in the GitHub interface.
4.1: Create GitHub Milestone
Creates a GitHub milestone corresponding to a ROADMAP milestone.
Milestone names should match ROADMAP.md milestone names exactly. This enables lookup by name when assigning issues to milestones.
4.2: Close GitHub Milestone
Closes a GitHub milestone when all its phases are complete.
4.3: Milestone-Issue Association
When creating a phase issue (Section 2.2), associate it with the correct milestone:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 93 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/github-sync/SKILL.md
Popularity
- Repository stars
- 62
- Repository forks
- 7
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/9thlevelsoftware/legion/github-sync)