From 103eea252c22428724189a45e1d2227b98c64b0a Mon Sep 17 00:00:00 2001 From: Thaddaeus Chua Date: Tue, 27 Jan 2026 12:51:37 +0800 Subject: [PATCH 01/12] Add initial skill version --- .github/skills/create-pull-request/SKILL.md | 196 ++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 .github/skills/create-pull-request/SKILL.md diff --git a/.github/skills/create-pull-request/SKILL.md b/.github/skills/create-pull-request/SKILL.md new file mode 100644 index 0000000000..5e488ca36b --- /dev/null +++ b/.github/skills/create-pull-request/SKILL.md @@ -0,0 +1,196 @@ +--- +name: create-pull-request +description: Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, and PR creation using the gh CLI tool. +--- + +# Create Pull Request + +This skill guides you through creating a well-structured GitHub pull request that follows project conventions and best practices. + +## Prerequisites Check + +Before proceeding, verify the following: + +### 1. Check if `gh` CLI is installed + +```bash +gh --version +``` + +If not installed, inform the user: +> The GitHub CLI (`gh`) is required but not installed. Please install it: +> - macOS: `brew install gh` +> - Other: https://cli.github.com/ + +### 2. Check if authenticated with GitHub + +```bash +gh auth status +``` + +If not authenticated, guide the user to run `gh auth login`. + +### 3. Verify clean working directory + +```bash +git status +``` + +If there are uncommitted changes, ask the user whether to: +- Commit them as part of this PR +- Stash them temporarily +- Discard them (with caution) + +## Gather Context + +### 1. Identify the current branch + +```bash +git branch --show-current +``` + +Ensure you're not on `main` or `master`. If so, ask the user to create or switch to a feature branch. + +### 2. Find the base branch + +```bash +git remote show origin | grep "HEAD branch" +``` + +This is typically `main` or `master`. + +### 3. Analyze recent commits relevant to this PR + +```bash +git log origin/main..HEAD --oneline --no-decorate +``` + +Review these commits to understand: +- What changes are being introduced +- The scope of the PR (single feature/fix or multiple changes) +- Whether commits should be squashed or reorganized + +### 4. Review the diff + +```bash +git diff origin/main..HEAD --stat +``` + +This shows which files changed and helps identify the type of change. + +## Information Gathering + +Before creating the PR, you need the following information. Check if it can be inferred from: +- Commit messages +- Branch name (e.g., `fix/issue-123`, `feature/new-login`) +- Changed files and their content + +If any critical information is missing, use `ask_followup_question` to ask the user: + +### Required Information + +1. **Related Issue Number**: Look for patterns like `#123`, `fixes #123`, or `closes #123` in commit messages +2. **Description**: What problem does this solve? Why were these changes made? +3. **Type of Change**: Bug fix, new feature, breaking change, refactor, cosmetic, documentation, or workflow +4. **Test Procedure**: How was this tested? What could break? + +### Example clarifying question + +If the issue number is not found: +> I couldn't find a related issue number in the commit messages or branch name. What GitHub issue does this PR address? (Enter the issue number, e.g., "123" or "N/A" for small fixes) + +## Git Best Practices + +Before creating the PR, consider these best practices: + +### Commit Hygiene + +1. **Atomic commits**: Each commit should represent a single logical change +2. **Clear commit messages**: Follow conventional commit format when possible +3. **No merge commits**: Prefer rebasing over merging to keep history clean + +### Branch Management + +1. **Rebase on latest main** (if needed): + ```bash + git fetch origin + git rebase origin/main + ``` + +2. **Squash if appropriate**: If there are many small "WIP" commits, consider interactive rebase: + ```bash + git rebase -i origin/main + ``` + Only suggest this if commits appear messy and the user is comfortable with rebasing. + +### Push Changes + +Ensure all commits are pushed: +```bash +git push origin HEAD +``` + +If the branch was rebased, you may need: +```bash +git push origin HEAD --force-with-lease +``` + +## Create the Pull Request + +**IMPORTANT**: Read and use the PR template at `.github/pull_request_template.md`. The PR body format must **strictly match** the template structure. Do not deviate from the template format. + +When filling out the template: +- Replace `#XXXX` with the actual issue number, or keep as `#XXXX` if no issue exists (for small fixes) +- Fill in all sections with relevant information gathered from commits and context +- Mark the appropriate "Type of Change" checkbox(es) +- Complete the "Pre-flight Checklist" items that apply + +### Create PR with gh CLI + +```bash +gh pr create --title "PR_TITLE" --body "PR_BODY" --base main +``` + +Alternatively, create as draft if the user wants review before marking ready: +```bash +gh pr create --title "PR_TITLE" --body "PR_BODY" --base main --draft +``` + +## Post-Creation + +After creating the PR: + +1. **Display the PR URL** so the user can review it +2. **Remind about CI checks**: Tests and linting will run automatically +3. **Suggest next steps**: + - Add reviewers if needed: `gh pr edit --add-reviewer USERNAME` + - Add labels if needed: `gh pr edit --add-label "bug"` + +## Error Handling + +### Common Issues + +1. **No commits ahead of main**: The branch has no changes to submit + - Ask if the user meant to work on a different branch + +2. **Branch not pushed**: Remote doesn't have the branch + - Push the branch first: `git push -u origin HEAD` + +3. **PR already exists**: A PR for this branch already exists + - Show the existing PR: `gh pr view` + - Ask if they want to update it instead + +4. **Merge conflicts**: Branch conflicts with base + - Guide user through resolving conflicts or rebasing + +## Summary Checklist + +Before finalizing, ensure: +- [ ] `gh` CLI is installed and authenticated +- [ ] Working directory is clean +- [ ] All commits are pushed +- [ ] Branch is up-to-date with base branch +- [ ] Related issue number is identified, or placeholder is used +- [ ] PR description follows the template exactly +- [ ] Appropriate type of change is selected +- [ ] Pre-flight checklist items are addressed \ No newline at end of file From 3b024d4ef3dc8a45892230a48729359bf7a368de Mon Sep 17 00:00:00 2001 From: Thaddaeus Chua Date: Tue, 27 Jan 2026 13:01:24 +0800 Subject: [PATCH 02/12] Edit skill for upstream PR specifically --- .github/skills/create-pull-request/SKILL.md | 34 +++++++++++++-------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/skills/create-pull-request/SKILL.md b/.github/skills/create-pull-request/SKILL.md index 5e488ca36b..e2c90b2a20 100644 --- a/.github/skills/create-pull-request/SKILL.md +++ b/.github/skills/create-pull-request/SKILL.md @@ -3,7 +3,7 @@ name: create-pull-request description: Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, and PR creation using the gh CLI tool. --- -# Create Pull Request +# Create Pull Request (Fork-to-Upstream Version) This skill guides you through creating a well-structured GitHub pull request that follows project conventions and best practices. @@ -51,18 +51,28 @@ git branch --show-current Ensure you're not on `main` or `master`. If so, ask the user to create or switch to a feature branch. -### 2. Find the base branch +### 2. Identify the Upstream Remote ```bash -git remote show origin | grep "HEAD branch" +git remote -v ``` -This is typically `main` or `master`. +If 'upstream' is missing, instruct the user to add it: git remote add upstream `https://github.com/ORIGINAL_OWNER/REPO_NAME.git` -### 3. Analyze recent commits relevant to this PR +### 3. Find the base branch on Upstream ```bash -git log origin/main..HEAD --oneline --no-decorate +# First, get the actual owner/repo string for the upstream remote +UPSTREAM_REPO=$(git remote get-url upstream | sed 's/.*github.com[\/:]//;s/\.git$//') + +# Then use that string to get the default branch +gh repo view "$UPSTREAM_REPO" --json defaultBranchRef -q .defaultBranchRef.name +``` + +### 4. Analyze recent commits relevant to this PR from the Upstream + +```bash +git log upstream/main..HEAD --oneline --no-decorate ``` Review these commits to understand: @@ -70,10 +80,10 @@ Review these commits to understand: - The scope of the PR (single feature/fix or multiple changes) - Whether commits should be squashed or reorganized -### 4. Review the diff +### 5. Review the diff ```bash -git diff origin/main..HEAD --stat +git diff upstream/main..HEAD --stat ``` This shows which files changed and helps identify the type of change. @@ -113,8 +123,8 @@ Before creating the PR, consider these best practices: 1. **Rebase on latest main** (if needed): ```bash - git fetch origin - git rebase origin/main + git fetch upstream + git rebase upstream/main ``` 2. **Squash if appropriate**: If there are many small "WIP" commits, consider interactive rebase: @@ -137,7 +147,7 @@ git push origin HEAD --force-with-lease ## Create the Pull Request -**IMPORTANT**: Read and use the PR template at `.github/pull_request_template.md`. The PR body format must **strictly match** the template structure. Do not deviate from the template format. +**IMPORTANT**: Read and use the PR template at `.github/PULL_REQUEST_TEMPLATE`. The PR body format must **strictly match** the template structure. Do not deviate from the template format. When filling out the template: - Replace `#XXXX` with the actual issue number, or keep as `#XXXX` if no issue exists (for small fixes) @@ -148,7 +158,7 @@ When filling out the template: ### Create PR with gh CLI ```bash -gh pr create --title "PR_TITLE" --body "PR_BODY" --base main +gh pr create --repo upstream_owner/repo_name --base main --head your_username:your_branch --title "PR_TITLE" --body "PR_BODY" ``` Alternatively, create as draft if the user wants review before marking ready: From 6b5fd9a7661d9d6ed435ee54481ceca356703738 Mon Sep 17 00:00:00 2001 From: Thaddaeus Chua Date: Tue, 27 Jan 2026 13:07:12 +0800 Subject: [PATCH 03/12] Add credit to original author & modifications made --- .github/skills/create-pull-request/SKILL.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/skills/create-pull-request/SKILL.md b/.github/skills/create-pull-request/SKILL.md index e2c90b2a20..c2001836fc 100644 --- a/.github/skills/create-pull-request/SKILL.md +++ b/.github/skills/create-pull-request/SKILL.md @@ -1,6 +1,9 @@ --- name: create-pull-request description: Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, and PR creation using the gh CLI tool. +Credit: This skill was adapted from the original `create-pull-request` skill developed by the **[Cline](https://github.com/cline/cline)** team. +- **Original Source**: [cline/cline/.cline/skills/create-pull-request](https://github.com/cline/cline/blob/main/.cline/skills/create-pull-request/SKILL.md) +Modification: Modified to support **Fork-to-Upstream** workflows and automated upstream remote detection. --- # Create Pull Request (Fork-to-Upstream Version) From a2d386eb43410f89e60d1468d06ddf3fa9e67932 Mon Sep 17 00:00:00 2001 From: Thaddaeus Chua Date: Tue, 27 Jan 2026 15:23:31 +0800 Subject: [PATCH 04/12] Improve specificity of PR drafting --- .github/skills/create-pull-request/SKILL.md | 37 +++++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/.github/skills/create-pull-request/SKILL.md b/.github/skills/create-pull-request/SKILL.md index c2001836fc..3039ccdf33 100644 --- a/.github/skills/create-pull-request/SKILL.md +++ b/.github/skills/create-pull-request/SKILL.md @@ -130,12 +130,6 @@ Before creating the PR, consider these best practices: git rebase upstream/main ``` -2. **Squash if appropriate**: If there are many small "WIP" commits, consider interactive rebase: - ```bash - git rebase -i origin/main - ``` - Only suggest this if commits appear messy and the user is comfortable with rebasing. - ### Push Changes Ensure all commits are pushed: @@ -150,13 +144,34 @@ git push origin HEAD --force-with-lease ## Create the Pull Request -**IMPORTANT**: Read and use the PR template at `.github/PULL_REQUEST_TEMPLATE`. The PR body format must **strictly match** the template structure. Do not deviate from the template format. +**IMPORTANT**: Read and use the PR template at `.github/PULL_REQUEST_TEMPLATE`. The PR body format must **strictly match** the template structure. Do not deviate from the template format. + +- Notify the user if the PR template missing before asking if they would like to proceed. When filling out the template: -- Replace `#XXXX` with the actual issue number, or keep as `#XXXX` if no issue exists (for small fixes) -- Fill in all sections with relevant information gathered from commits and context -- Mark the appropriate "Type of Change" checkbox(es) -- Complete the "Pre-flight Checklist" items that apply +1. **Purpose Checklist**: Based on the file changes detected (e.g., `.md` for Documentation, `test/` for Features), check the relevant boxes under **"What is the purpose of this pull request?"**. If it doesn't fit the main categories, use the "Others" box and provide a 1-sentence explanation. + - **Linking Issues**: Search for issue numbers in your commits. If found, use keywords like "Fixes #123" or "Resolves #123" in the comment block provided. + +2. **Overview of changes**: Provide a high-level, 1-2 sentence summary of what this PR achieves. + +3. **Highlight/Discuss**: Elaborate on the technical implementation. Explain *how* you changed the code or documentation and point out any specific logic or layout choices you want the reviewer to notice. + +4. **Testing instructions**: Identify any manual testing steps. + - *Example: "Run `markbind serve`, navigate to /docs/plugin, and verify the new warning component renders correctly."* + - If no special steps are needed beyond automated tests, leave this blank or state "No special instructions." + +5. **Proposed commit message**: Generate a high-quality commit message: + - **Title**: Maximum 50 characters. + - **Body**: Wrap lines at 72 characters. + - Follow the [SE-Education standards](https://se-education.org/guides/conventions/git.html) referenced in the template. + +6. **Checklist**: Analyze the changes to check the appropriate boxes: + - Check "Updated documentation" if `.md` files in the docs folder were modified. + - Check "Added tests" if files in `test` or `spec` files were add or modified. + - Check "Linked all related issues" if you identified an issue number. + - Check "No unrelated changes" after verifying the diff doesn't contain stray edits. + +7. **Reviewer Section**: Leave the **Reviewer checklist** and **SEMVER** sections **unchecked** and unmodified. These are for the maintainers to fill out during review. ### Create PR with gh CLI From 99a92cd3ff5dbe806341293e9012cffa1cb83ed2 Mon Sep 17 00:00:00 2001 From: Thaddaeus Chua Date: Tue, 27 Jan 2026 15:34:04 +0800 Subject: [PATCH 05/12] Add note to specify that PR was generated using skill --- .github/skills/create-pull-request/SKILL.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/skills/create-pull-request/SKILL.md b/.github/skills/create-pull-request/SKILL.md index 3039ccdf33..c2ec558cf1 100644 --- a/.github/skills/create-pull-request/SKILL.md +++ b/.github/skills/create-pull-request/SKILL.md @@ -153,6 +153,7 @@ When filling out the template: - **Linking Issues**: Search for issue numbers in your commits. If found, use keywords like "Fixes #123" or "Resolves #123" in the comment block provided. 2. **Overview of changes**: Provide a high-level, 1-2 sentence summary of what this PR achieves. + - **Mandatory Note**: Append this exact line to the end of this section: This PR was generated using the `create-pull-request` skill. 3. **Highlight/Discuss**: Elaborate on the technical implementation. Explain *how* you changed the code or documentation and point out any specific logic or layout choices you want the reviewer to notice. From e2f2bc285169f4819d0acc0a96593fa6497f5335 Mon Sep 17 00:00:00 2001 From: Thaddaeus Chua Date: Tue, 27 Jan 2026 15:39:28 +0800 Subject: [PATCH 06/12] Add PR body content for create-pull-request skill --- pr-body-content.md | 89 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 pr-body-content.md diff --git a/pr-body-content.md b/pr-body-content.md new file mode 100644 index 0000000000..b09006e466 --- /dev/null +++ b/pr-body-content.md @@ -0,0 +1,89 @@ +**What is the purpose of this pull request?** + +- [x] Documentation update +- [ ] Bug fix +- [x] Feature addition or enhancement +- [ ] Code maintenance +- [ ] DevOps +- [x] Improve developer experience +- [ ] Others, please explain: + + + +**Overview of changes:** + +Add a new GitHub skill for creating pull requests that follows MarkBind project conventions and supports fork-to-upstream workflows. + +**Anything you'd like to highlight/discuss:** + +This skill was adapted from Cline's original create-pull-request skill with modifications to support fork-to-upstream workflows and automated upstream remote detection. The skill provides comprehensive guidance for PR creation including prerequisite checks, context gathering, git best practices, and template-based PR generation. + +**Testing instructions:** + +Test the skill by running it on a feature branch with changes. Verify that it correctly: +- Detects gh CLI installation and authentication +- Identifies upstream remotes and base branches +- Analyzes commits and diffs +- Generates PR descriptions following the MarkBind template +- Handles common error scenarios + +**Proposed commit message: (wrap lines at 72 characters)** + + + +Add create-pull-request GitHub skill + +Add a comprehensive GitHub skill for creating pull requests that follows +MarkBind project conventions. The skill supports fork-to-upstream workflows, +automated upstream remote detection, and template-based PR generation. +Adapted from Cline's original skill with MarkBind-specific modifications. + +--- + +**Checklist:** :ballot_box_with_check: + + + +- [x] Updated the documentation for feature additions and enhancements +- [ ] Added tests for bug fixes or features +- [ ] Linked all related issues +- [x] No unrelated changes + + + +--- + +**Reviewer checklist:** + +Indicate the [SEMVER](https://semver.org/) impact of the PR: +- [ ] Major (when you make incompatible API changes) +- [ ] Minor (when you add functionality in a backward compatible manner) +- [ ] Patch (when you make backward compatible bug fixes) + +At the end of the review, please label the PR with the appropriate label: `r.Major`, `r.Minor`, `r.Patch`. + +Breaking change release note preparation (if applicable): +- To be included in the release note for any feature that is made obsolete/breaking + +> Give a brief explanation note about: +> - what was the old feature that was made obsolete +> - any replacement feature (if any), and +> - how the author should modify his website to migrate from the old feature to the replacement feature (if possible). \ No newline at end of file From 97887e2eeeb55aec1c99064189a2aeae4777d438 Mon Sep 17 00:00:00 2001 From: Thaddaeus Chua Date: Tue, 27 Jan 2026 15:43:26 +0800 Subject: [PATCH 07/12] Revert "Add PR body content for create-pull-request skill" This reverts commit e2f2bc285169f4819d0acc0a96593fa6497f5335. --- pr-body-content.md | 89 ---------------------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 pr-body-content.md diff --git a/pr-body-content.md b/pr-body-content.md deleted file mode 100644 index b09006e466..0000000000 --- a/pr-body-content.md +++ /dev/null @@ -1,89 +0,0 @@ -**What is the purpose of this pull request?** - -- [x] Documentation update -- [ ] Bug fix -- [x] Feature addition or enhancement -- [ ] Code maintenance -- [ ] DevOps -- [x] Improve developer experience -- [ ] Others, please explain: - - - -**Overview of changes:** - -Add a new GitHub skill for creating pull requests that follows MarkBind project conventions and supports fork-to-upstream workflows. - -**Anything you'd like to highlight/discuss:** - -This skill was adapted from Cline's original create-pull-request skill with modifications to support fork-to-upstream workflows and automated upstream remote detection. The skill provides comprehensive guidance for PR creation including prerequisite checks, context gathering, git best practices, and template-based PR generation. - -**Testing instructions:** - -Test the skill by running it on a feature branch with changes. Verify that it correctly: -- Detects gh CLI installation and authentication -- Identifies upstream remotes and base branches -- Analyzes commits and diffs -- Generates PR descriptions following the MarkBind template -- Handles common error scenarios - -**Proposed commit message: (wrap lines at 72 characters)** - - - -Add create-pull-request GitHub skill - -Add a comprehensive GitHub skill for creating pull requests that follows -MarkBind project conventions. The skill supports fork-to-upstream workflows, -automated upstream remote detection, and template-based PR generation. -Adapted from Cline's original skill with MarkBind-specific modifications. - ---- - -**Checklist:** :ballot_box_with_check: - - - -- [x] Updated the documentation for feature additions and enhancements -- [ ] Added tests for bug fixes or features -- [ ] Linked all related issues -- [x] No unrelated changes - - - ---- - -**Reviewer checklist:** - -Indicate the [SEMVER](https://semver.org/) impact of the PR: -- [ ] Major (when you make incompatible API changes) -- [ ] Minor (when you add functionality in a backward compatible manner) -- [ ] Patch (when you make backward compatible bug fixes) - -At the end of the review, please label the PR with the appropriate label: `r.Major`, `r.Minor`, `r.Patch`. - -Breaking change release note preparation (if applicable): -- To be included in the release note for any feature that is made obsolete/breaking - -> Give a brief explanation note about: -> - what was the old feature that was made obsolete -> - any replacement feature (if any), and -> - how the author should modify his website to migrate from the old feature to the replacement feature (if possible). \ No newline at end of file From 4801c313a1413bf447bcfa44e18446abd616221a Mon Sep 17 00:00:00 2001 From: Thaddaeus Chua Date: Tue, 27 Jan 2026 16:00:01 +0800 Subject: [PATCH 08/12] Add more specifics when filling template --- .github/skills/create-pull-request/SKILL.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/skills/create-pull-request/SKILL.md b/.github/skills/create-pull-request/SKILL.md index c2ec558cf1..9d7b266c66 100644 --- a/.github/skills/create-pull-request/SKILL.md +++ b/.github/skills/create-pull-request/SKILL.md @@ -149,7 +149,11 @@ git push origin HEAD --force-with-lease - Notify the user if the PR template missing before asking if they would like to proceed. When filling out the template: -1. **Purpose Checklist**: Based on the file changes detected (e.g., `.md` for Documentation, `test/` for Features), check the relevant boxes under **"What is the purpose of this pull request?"**. If it doesn't fit the main categories, use the "Others" box and provide a 1-sentence explanation. +1. **Purpose Checklist**: Based on the file changes detected check the relevant boxes under **"What is the purpose of this pull request?"**. + - Check **Documentation update** ONLY if files within the `docs/` directory were modified. + - Check **Feature addition or enhancement** if new logic is added to `src/` or core components. + - Check **Bug fix** if the commit messages or code diff indicate a correction. + - If it doesn't fit the main categories, use the "Others" box and provide a 1-sentence explanation. - **Linking Issues**: Search for issue numbers in your commits. If found, use keywords like "Fixes #123" or "Resolves #123" in the comment block provided. 2. **Overview of changes**: Provide a high-level, 1-2 sentence summary of what this PR achieves. @@ -167,7 +171,7 @@ When filling out the template: - Follow the [SE-Education standards](https://se-education.org/guides/conventions/git.html) referenced in the template. 6. **Checklist**: Analyze the changes to check the appropriate boxes: - - Check "Updated documentation" if `.md` files in the docs folder were modified. + - Check "Updated documentation" ONLY if changes are detected in the `docs/` folder. - Check "Added tests" if files in `test` or `spec` files were add or modified. - Check "Linked all related issues" if you identified an issue number. - Check "No unrelated changes" after verifying the diff doesn't contain stray edits. From 55570c59311cd104d5ef0263cee5954361e1842d Mon Sep 17 00:00:00 2001 From: Thaddaeus Chua Date: Wed, 28 Jan 2026 21:07:24 +0800 Subject: [PATCH 09/12] Add more specifics to diff analysis & create pr --- .github/skills/create-pull-request/SKILL.md | 25 ++++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/skills/create-pull-request/SKILL.md b/.github/skills/create-pull-request/SKILL.md index 9d7b266c66..2bbabeeb2a 100644 --- a/.github/skills/create-pull-request/SKILL.md +++ b/.github/skills/create-pull-request/SKILL.md @@ -43,6 +43,7 @@ If there are uncommitted changes, ask the user whether to: - Commit them as part of this PR - Stash them temporarily - Discard them (with caution) +- **Important** Do not stage any uncomitted changes without explict request/reply by the user ## Gather Context @@ -89,7 +90,13 @@ Review these commits to understand: git diff upstream/main..HEAD --stat ``` -This shows which files changed and helps identify the type of change. +This shows which files changed and helps identify the type of change. Use this to perform a **Deep Diff Analysis** which will be crucial in understanding how to classify these changes when creating the PR.: +- Impact Surface Area: + - Identify which directory the changes were made (e.g. `packages/`, `docs/`). + - Note any changes to `package.json` or lockfiles (e.g., `package-lock.json`). +- Logic: + - Distinguish between actual logic changes in `.js`, `.ts` files versus configuration changes (`.yml`, `.json`, etc). + - Understand the context of these changes and if or how they link to one another. ## Information Gathering @@ -98,7 +105,7 @@ Before creating the PR, you need the following information. Check if it can be i - Branch name (e.g., `fix/issue-123`, `feature/new-login`) - Changed files and their content -If any critical information is missing, use `ask_followup_question` to ask the user: +If any critical information is missing, ask the user clarifying questions: ### Required Information @@ -151,8 +158,15 @@ git push origin HEAD --force-with-lease When filling out the template: 1. **Purpose Checklist**: Based on the file changes detected check the relevant boxes under **"What is the purpose of this pull request?"**. - Check **Documentation update** ONLY if files within the `docs/` directory were modified. - - Check **Feature addition or enhancement** if new logic is added to `src/` or core components. - - Check **Bug fix** if the commit messages or code diff indicate a correction. + - Check **Feature addition or enhancement** ONLY if + - **Code Diff Profile**: + - Creation of new logic is added to files within the `packages/` directory (specifically NOT refactored or fixed logic refer to bug fixes section below). + - Addition of new exported functions or classes. + - Check **Bug fix** ONLY if the commit messages or code diff in the `packages/` directory indicate a correction. + - **Logic Indicators**: Look for "Fix", "Patch", "Hotfix", "Close", or "Resolve" in commit messages. + - Check **Developer Experience** ONLY if + - Changes in the `packages/` directory focus on code quality (e.g., commit messages include "refactor", "improve", "cleanup", or "optimize"). + - The changes are indirect tools or scripts specifically designed to improve the development workflow (e.g., CI/CD improvements, linting rules, or internal dev-tooling). - If it doesn't fit the main categories, use the "Others" box and provide a 1-sentence explanation. - **Linking Issues**: Search for issue numbers in your commits. If found, use keywords like "Fixes #123" or "Resolves #123" in the comment block provided. @@ -186,7 +200,7 @@ gh pr create --repo upstream_owner/repo_name --base main --head your_username:yo Alternatively, create as draft if the user wants review before marking ready: ```bash -gh pr create --title "PR_TITLE" --body "PR_BODY" --base main --draft +gh pr create --repo upstream_owner/repo_name --base main --head your_username:your_branch --title "PR_TITLE" --body "PR_BODY" --draft ``` ## Post-Creation @@ -221,7 +235,6 @@ After creating the PR: Before finalizing, ensure: - [ ] `gh` CLI is installed and authenticated - [ ] Working directory is clean -- [ ] All commits are pushed - [ ] Branch is up-to-date with base branch - [ ] Related issue number is identified, or placeholder is used - [ ] PR description follows the template exactly From 40339473207e2759c9bd5e0f9a2d5213851559f5 Mon Sep 17 00:00:00 2001 From: Thaddaeus Chua Date: Wed, 28 Jan 2026 21:14:53 +0800 Subject: [PATCH 10/12] Move skill to .opencode directory --- {.github => .opencode}/skills/create-pull-request/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {.github => .opencode}/skills/create-pull-request/SKILL.md (98%) diff --git a/.github/skills/create-pull-request/SKILL.md b/.opencode/skills/create-pull-request/SKILL.md similarity index 98% rename from .github/skills/create-pull-request/SKILL.md rename to .opencode/skills/create-pull-request/SKILL.md index 2bbabeeb2a..9ec6e21aab 100644 --- a/.github/skills/create-pull-request/SKILL.md +++ b/.opencode/skills/create-pull-request/SKILL.md @@ -43,7 +43,7 @@ If there are uncommitted changes, ask the user whether to: - Commit them as part of this PR - Stash them temporarily - Discard them (with caution) -- **Important** Do not stage any uncomitted changes without explict request/reply by the user +- **Important** Do not stage any uncommitted changes without explict request/reply by the user ## Gather Context @@ -168,7 +168,7 @@ When filling out the template: - Changes in the `packages/` directory focus on code quality (e.g., commit messages include "refactor", "improve", "cleanup", or "optimize"). - The changes are indirect tools or scripts specifically designed to improve the development workflow (e.g., CI/CD improvements, linting rules, or internal dev-tooling). - If it doesn't fit the main categories, use the "Others" box and provide a 1-sentence explanation. - - **Linking Issues**: Search for issue numbers in your commits. If found, use keywords like "Fixes #123" or "Resolves #123" in the comment block provided. + - **Linking Issues**: Search for issue numbers in your commits. If found, use keywords like "Fixes #123" or "Resolves #123" in the comment block provided. Skip if missing or if user replies "N/A". 2. **Overview of changes**: Provide a high-level, 1-2 sentence summary of what this PR achieves. - **Mandatory Note**: Append this exact line to the end of this section: This PR was generated using the `create-pull-request` skill. From 85ce686794914dc1462dd8913caa902e4bb57714 Mon Sep 17 00:00:00 2001 From: Thaddaeus Chua Date: Wed, 28 Jan 2026 21:31:18 +0800 Subject: [PATCH 11/12] Add dry run option for local PR creation --- .opencode/skills/create-pull-request/SKILL.md | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.opencode/skills/create-pull-request/SKILL.md b/.opencode/skills/create-pull-request/SKILL.md index 9ec6e21aab..abc3d4151b 100644 --- a/.opencode/skills/create-pull-request/SKILL.md +++ b/.opencode/skills/create-pull-request/SKILL.md @@ -9,6 +9,7 @@ Modification: Modified to support **Fork-to-Upstream** workflows and automated u # Create Pull Request (Fork-to-Upstream Version) This skill guides you through creating a well-structured GitHub pull request that follows project conventions and best practices. +**Important**: Follow each step closely. Do not default to a more direct approach. ## Prerequisites Check @@ -194,15 +195,20 @@ When filling out the template: ### Create PR with gh CLI -```bash -gh pr create --repo upstream_owner/repo_name --base main --head your_username:your_branch --title "PR_TITLE" --body "PR_BODY" -``` +**Standard PR**: + ```bash + gh pr create --repo upstream_owner/repo_name --base main --head your_username:your_branch --title "PR_TITLE" --body "PR_BODY" + ``` -Alternatively, create as draft if the user wants review before marking ready: -```bash -gh pr create --repo upstream_owner/repo_name --base main --head your_username:your_branch --title "PR_TITLE" --body "PR_BODY" --draft -``` +**Draft PR (For early feedback)**: + ```bash + gh pr create --repo upstream_owner/repo_name --base main --head your_username:your_branch --title "PR_TITLE" --body "PR_BODY" --draft + ``` +**Dry Run (To preview the PR locally without creating it)**: + ```bash + gh pr create --repo upstream_owner/repo_name --base main --head your_username:your_branch --title "PR_TITLE" --body "PR_BODY" --dry-run + ``` ## Post-Creation After creating the PR: From d14888b7340060d3b8f2768152dae1eba3bfc897 Mon Sep 17 00:00:00 2001 From: Thaddaeus Chua Date: Wed, 28 Jan 2026 22:17:49 +0800 Subject: [PATCH 12/12] Add opencode.json and more explicit steps in skill --- .opencode/skills/create-pull-request/SKILL.md | 7 +++++-- opencode.json | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 opencode.json diff --git a/.opencode/skills/create-pull-request/SKILL.md b/.opencode/skills/create-pull-request/SKILL.md index abc3d4151b..8e05127c3a 100644 --- a/.opencode/skills/create-pull-request/SKILL.md +++ b/.opencode/skills/create-pull-request/SKILL.md @@ -1,9 +1,10 @@ --- name: create-pull-request description: Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, and PR creation using the gh CLI tool. -Credit: This skill was adapted from the original `create-pull-request` skill developed by the **[Cline](https://github.com/cline/cline)** team. +compatibility: opencode +credit: This skill was adapted from the original `create-pull-request` skill developed by the **[Cline](https://github.com/cline/cline)** team. - **Original Source**: [cline/cline/.cline/skills/create-pull-request](https://github.com/cline/cline/blob/main/.cline/skills/create-pull-request/SKILL.md) -Modification: Modified to support **Fork-to-Upstream** workflows and automated upstream remote detection. +modification: Modified to support **Fork-to-Upstream** workflows and automated upstream remote detection. --- # Create Pull Request (Fork-to-Upstream Version) @@ -195,6 +196,8 @@ When filling out the template: ### Create PR with gh CLI +**Important**: If the user did not specify one of the following options in their request, ask the user which they would like before proceeding. Do not assume which option without explicit confirmation from the user. + **Standard PR**: ```bash gh pr create --repo upstream_owner/repo_name --base main --head your_username:your_branch --title "PR_TITLE" --body "PR_BODY" diff --git a/opencode.json b/opencode.json new file mode 100644 index 0000000000..1378daa246 --- /dev/null +++ b/opencode.json @@ -0,0 +1,5 @@ +{ + "permission": { + "skill": "allow" + } +} \ No newline at end of file