diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index e9bdc3d..16f6be3 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "github", - "version": "1.2.1", + "version": "1.3.0", "description": "GitHub CI/CD automation plugin for auto-detecting, analyzing, and fixing CI/CD failures on any branch", "author": { "name": "Ladislav Martincik", diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f742a7..e0e7908 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,38 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.3.0] - 2024-11-16 + +### Added + +- **New `/github:create-issue-from-plan` command** - Converts plans into GitHub Issues + - Parses plan YAML frontmatter (title, type, research, etc.) + - Extracts Implementation Phases as checklist items + - Creates Issue with plan Overview as summary + - Includes Validation Commands section + - Links research files from plan frontmatter + - Updates plan frontmatter with Issue number after creation + - Commits Issue linkage back to plan file + +### Enhanced + +- `/create-pr` command now extracts and links plan information + - Extracts plan type from frontmatter for PR labels + - Links plan file in PR body: `See plans/file.md for full design` + - Includes research file links from plan metadata + - Generates Review Focus from Implementation Plan phases + - Automatically references Testing Strategy from plan + - Generates PR title with plan type: `: # - Title` + +### Benefits + +- Complete Plan → Issue → PR traceability chain +- Plans drive Issue creation automatically +- PR body automatically linked to source documentation +- Single source of truth: Plan = specification +- Reduced manual linking and documentation duplication + +## [1.2.1] - 2024-11-16 ### Enhanced diff --git a/README.md b/README.md index 0a5f2f4..3f98470 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,56 @@ https://github.com/user/repo/pull/456 See `research/pr-description-best-practices.md` for research-backed guidance and authoritative sources. +### `/create-issue-from-plan` + +Convert implementation plans into GitHub Issues with automatic checkboxes and linking. + +**Usage:** +```bash +/create-issue-from-plan plans/feature-name.md +``` + +**What it does:** + +1. **Parses plan file**: Reads YAML frontmatter and markdown structure +2. **Extracts content**: + - Overview section → Issue body summary + - Implementation Phases → Checklist items + - Validation Commands → Issue section + - Acceptance Criteria → Issue checklist + - Research files → Linked in Issue body +3. **Creates Issue**: Generates GitHub Issue with: + - Title: `: ` + - Body: Complete implementation checklist with all phases + - Labels: `status:planning` + type label (feat, bug, chore, etc.) +4. **Updates plan file**: Adds Issue number to plan frontmatter (`issue: #123`) +5. **Commits linkage**: Saves Issue reference in plan file via git commit + +**Plan Frontmatter:** +```yaml +--- +title: "Feature Description" +type: Feature # Bug|Feature|Chore|Refactor|Enhancement|Documentation +issue: null # Auto-populated with Issue #123 after creation +research: + - research/related-research.md +status: Draft +created: 2024-11-16 +--- +``` + +**Example:** +```bash +$ /create-issue-from-plan plans/add-oauth2-auth.md + +✅ Issue #456 created from plan +📝 Updated plan frontmatter: issue: 456 +🔗 Linked research files in Issue body +💾 Committed Issue linkage to plan file + +Issue: https://github.com/user/repo/issues/456 +``` + ### `/address-pr-comments` Interactive or autonomous workflow for addressing PR review comments with AI-powered confidence scoring. diff --git a/commands/create-issue-from-plan.md b/commands/create-issue-from-plan.md new file mode 100644 index 0000000..f500bef --- /dev/null +++ b/commands/create-issue-from-plan.md @@ -0,0 +1,119 @@ +--- +description: Create GitHub Issue from plan file +--- + +# Create Issue from Plan + +Based on the plan file provided, create a GitHub Issue with the implementation phases as checkboxes. Then update the plan file with the Issue number. + +## Variables + +plan_file: $1 + +## Instructions + +### 1. Parse Plan File + +Read the plan file and extract: +- **Frontmatter**: `title`, `type`, `created` +- **Overview**: Problem statement, goals +- **Implementation Plan**: All phases with their tasks +- **Validation Commands**: From the Validation Commands section +- **Acceptance Criteria**: From the Acceptance Criteria section +- **Research links**: From frontmatter `research` field (if present) + +### 2. Generate Issue Body + +Structure the Issue body as: + +```markdown +## Summary + +[Extract from plan Overview > Problem Statement and Goals] + +--- + +## Implementation Phases + +### Phase 1: [Title from plan] +**Complexity**: [from plan] | **Priority**: [from plan] + +- [ ] [Task 1] +- [ ] [Task 2] + +### Phase 2: [Title from plan] +... + +[Continue for all phases] + +--- + +## Validation Commands + +[Extract the bash commands from plan's Validation Commands section] + +--- + +## Acceptance Criteria + +- [ ] [From plan] +- [ ] [From plan] + +--- + +## Related Research + +[If research files listed in frontmatter, include links] + +--- + +**Plan Document**: plans/[filename].md +**Issue Type**: [type from frontmatter] +**Created**: [from frontmatter] +``` + +### 3. Create the Issue + +1. Determine issue type label from plan `type` field: + - `Feature` → `type:feature` + - `Bug` → `type:bug` + - `Chore` → `type:chore` + - `Refactor` → `type:refactor` + - `Enhancement` → `type:enhancement` + - `Documentation` → `type:documentation` + +2. Create Issue via `gh issue create`: + ```bash + gh issue create \ + --title "[type]: [Plan Title]" \ + --body "[generated body above]" \ + --label "status:planning" \ + --label "[type_label]" + ``` + +3. Capture Issue number from output (will be `#123`) + +### 4. Update Plan File with Issue Number + +1. Parse plan YAML frontmatter +2. Update `issue: null` → `issue: 123` +3. Update `status: Draft` → `status: In Progress` +4. Write updated plan back to file +5. Commit: `git add plans/[filename].md && git commit -m "chore: link plan to Issue #123"` + +## Run + +1. Validate plan file exists: `test -f "$plan_file"` or error +2. Read and parse plan file (extract sections above) +3. Generate Issue body using template +4. Create Issue: `gh issue create --title "..." --body "..." --label "..."` +5. Extract Issue number from output +6. Update plan frontmatter with Issue number +7. Commit update to plan file +8. Return: "Issue #123 created from plan. Updated plan frontmatter." + +## Report + +Return the Issue URL created: +- Format: `https://github.com///issues/` +- Example: `https://github.com/iamladi/my-project/issues/123` diff --git a/commands/create-pr.md b/commands/create-pr.md index dfe2a06..343af99 100644 --- a/commands/create-pr.md +++ b/commands/create-pr.md @@ -70,9 +70,20 @@ Example Review Focus: #### 3. References - **Reference to the issue**: `Closes #` (automatic PR-to-issue linking) -- **Link to implementation plan** (if applicable): Path to planning document (e.g., `See plans/implement-auth.md for detailed design`) +- **Link to implementation plan**: Extract from plan file parameter + - If plan file provided: Include "See `plans/filename.md` for full implementation design" + - Extract research links from plan frontmatter if available - **Related PRs or documentation**: Link to dependent PRs or relevant docs +**Example:** +``` +## Plan & Design +See [`plans/add-oauth2-auth.md`](../plans/add-oauth2-auth.md) for full implementation design and validation criteria. + +Related research: +- [`research/auth-flow.md`](../research/auth-flow.md) +``` + #### 4. Testing Notes (Optional - Only if Non-Obvious) **Include ONLY if there are testing scenarios beyond what CI automation covers.** @@ -125,10 +136,22 @@ Keep PR descriptions concise—they should be **shorter than the actual code cha ## Run -1. Run `git log origin/main..HEAD --oneline` to understand the commits being included -2. Run `git push -u origin ` to push the branch -3. Run `gh pr create --title "" --body "" --base main` to create the PR -4. Capture the PR URL from the output +1. **Fetch Issue details**: `gh issue view --json number,title,body,labels` +2. **Read plan file** (if provided): + - Parse YAML frontmatter to extract `type`, `research` fields + - Extract key sections: Overview, Implementation Plan phases +3. **Generate PR title**: `: # - ` + - Use type from plan frontmatter (defaults to issue labels if not in plan) +4. **Generate PR body**: + - Summary: From plan's Overview section + - Review Focus: Key decisions from Implementation Plan + - Plan & Design: Link to plan file + research files + - References: `Closes #` + plan link + - Testing Notes: Only if non-obvious (from plan's Testing Strategy) +5. Run `git log origin/main..HEAD --oneline` to understand the commits being included +6. Run `git push -u origin ` to push the branch +7. Run `gh pr create --title "" --body "" --base main` to create the PR +8. Capture the PR URL from the output ## Report diff --git a/package.json b/package.json index c5847be..c6e28ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-plugin", - "version": "1.2.1", + "version": "1.3.0", "description": "GitHub CI/CD automation plugin for Claude Code", "private": true, "type": "module",