-
Notifications
You must be signed in to change notification settings - Fork 153
Add shared report-issue skill for all plugins #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Priyanshu Agrawal (priyanshu92)
merged 9 commits into
main
from
users/priyanshuag/add-report-issue-shared-skill
Apr 20, 2026
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
471f0a7
Add shared report-issue skill for all plugins
priyanshu92 208a4a8
Remove hardcoded plugin allow-list from workflow
priyanshu92 95097e9
Add canvas-apps plugin support
bd18ad4
Merge remote-tracking branch 'origin/main' into users/priyanshuag/add…
006af91
Remove sync-shared-skills workflow and script
ee4cf2f
Merge remote-tracking branch 'origin/main' into users/priyanshuag/add…
17f083b
Auto-add plugin version check to SKILL.md files
github-actions[bot] 03ff670
Remove unused config.json for shared skills
dfe286f
Add report-issue skill wrapper for mcp-apps
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: sync-shared-skills | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "plugins/**" | ||
| - "shared/skills/**" | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| sync-shared-skills: | ||
| name: sync-shared-skills | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: generate app token | ||
| id: app-token | ||
| uses: actions/create-github-app-token@v1 | ||
| with: | ||
| app-id: 3189942 | ||
| private-key: ${{ secrets.POWER_PLATFORM_SKILLS_APP_PRIVATE_KEY }} | ||
|
|
||
| - name: checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.head_ref }} | ||
| token: ${{ steps.app-token.outputs.token }} | ||
|
|
||
|
priyanshu92 marked this conversation as resolved.
Outdated
|
||
| - name: setup-node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - name: sync shared skills to all plugins | ||
| run: node scripts/sync-shared-skills.js | ||
|
|
||
|
priyanshu92 marked this conversation as resolved.
Outdated
|
||
| - name: commit and push if changed | ||
| run: | | ||
| git diff --quiet && exit 0 | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git add "plugins/*/skills/*/SKILL.md" | ||
| git commit -m "Auto-sync shared skill wrappers to new plugins" | ||
| git push | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| name: report-issue | ||
| description: > | ||
| Use this skill when the user wants to "report a bug", "file an issue", | ||
| "report an issue", "submit a bug report", or report any problem | ||
| with the code-apps plugin to the GitHub repository. | ||
| user-invocable: true | ||
| argument-hint: "[optional: brief description of the bug]" | ||
| allowed-tools: Read, Bash, Glob, Grep, AskUserQuestion, TaskCreate, TaskUpdate, TaskList | ||
| model: sonnet | ||
| --- | ||
|
|
||
| **Shared workflow: [report-issue-workflow.md](${CLAUDE_PLUGIN_ROOT}/../../shared/skills/report-issue/report-issue-workflow.md)** — Read and follow all phases defined in that file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| name: report-issue | ||
| description: > | ||
| Use this skill when the user wants to "report a bug", "file an issue", | ||
| "report an issue", "submit a bug report", or report any problem | ||
| with the model-apps plugin to the GitHub repository. | ||
| user-invocable: true | ||
| argument-hint: "[optional: brief description of the bug]" | ||
| allowed-tools: Read, Bash, Glob, Grep, AskUserQuestion, TaskCreate, TaskUpdate, TaskList | ||
| model: sonnet | ||
| --- | ||
|
|
||
| **Shared workflow: [report-issue-workflow.md](${CLAUDE_PLUGIN_ROOT}/../../shared/skills/report-issue/report-issue-workflow.md)** — Read and follow all phases defined in that file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| name: report-issue | ||
| description: > | ||
| Use this skill when the user wants to "report a bug", "file an issue", | ||
| "report an issue", "submit a bug report", or report any problem | ||
| with the power-pages plugin to the GitHub repository. | ||
| user-invocable: true | ||
| argument-hint: "[optional: brief description of the bug]" | ||
| allowed-tools: Read, Bash, Glob, Grep, AskUserQuestion, TaskCreate, TaskUpdate, TaskList | ||
| model: sonnet | ||
| --- | ||
|
|
||
| **Shared workflow: [report-issue-workflow.md](${CLAUDE_PLUGIN_ROOT}/../../shared/skills/report-issue/report-issue-workflow.md)** — Read and follow all phases defined in that file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| /** | ||
| * Syncs shared skills to targeted plugins. | ||
| * | ||
| * Each shared skill in shared/skills/<skill-name>/ has a config.json that | ||
| * specifies which plugins it applies to: | ||
| * { "plugins": "*" } — all plugins (default if no config) | ||
| * { "plugins": ["power-pages", "code-apps"] } — only listed plugins | ||
| * | ||
| * For each targeted plugin, copies SKILL.template.md → plugins/<plugin>/skills/<skill-name>/SKILL.md | ||
| * with {{PLUGIN_NAME}} replaced by the plugin's name from plugin.json. | ||
| * | ||
| * Modes: | ||
| * --check Report missing wrappers and exit 1 if any are found (CI mode). | ||
| * (default) Generate missing wrappers in place. | ||
| * | ||
| * Usage: | ||
| * node scripts/sync-shared-skills.js # auto-generate missing wrappers | ||
| * node scripts/sync-shared-skills.js --check # CI: fail if any are missing | ||
| */ | ||
|
|
||
| const fs = require("fs"); | ||
| const path = require("path"); | ||
|
|
||
| const ROOT = path.resolve(__dirname, ".."); | ||
| const PLUGINS_DIR = path.join(ROOT, "plugins"); | ||
| const SHARED_SKILLS_DIR = path.join(ROOT, "shared", "skills"); | ||
|
|
||
| const checkOnly = process.argv.includes("--check"); | ||
|
|
||
| function getDirectories(dir) { | ||
| if (!fs.existsSync(dir)) return []; | ||
| return fs | ||
| .readdirSync(dir, { withFileTypes: true }) | ||
| .filter((d) => d.isDirectory()) | ||
| .map((d) => d.name); | ||
| } | ||
|
|
||
| // Read plugin name from plugin.json | ||
| function getPluginName(plugin) { | ||
| const pluginJsonPath = path.join(PLUGINS_DIR, plugin, ".claude-plugin", "plugin.json"); | ||
| if (fs.existsSync(pluginJsonPath)) { | ||
| try { | ||
| const pluginJson = JSON.parse(fs.readFileSync(pluginJsonPath, "utf-8")); | ||
| return pluginJson.name || plugin; | ||
| } catch { | ||
| return plugin; | ||
| } | ||
| } | ||
| return plugin; | ||
| } | ||
|
|
||
| // Read config.json for a shared skill to determine target plugins | ||
| function getTargetPlugins(skill, allPlugins) { | ||
| const configPath = path.join(SHARED_SKILLS_DIR, skill, "config.json"); | ||
| if (fs.existsSync(configPath)) { | ||
| try { | ||
| const config = JSON.parse(fs.readFileSync(configPath, "utf-8")); | ||
| if (config.plugins === "*") { | ||
| return allPlugins; | ||
| } | ||
| if (Array.isArray(config.plugins)) { | ||
| // Match by plugin directory name or plugin.json name | ||
| return allPlugins.filter((plugin) => { | ||
| const pluginName = getPluginName(plugin); | ||
| return config.plugins.includes(plugin) || config.plugins.includes(pluginName); | ||
| }); | ||
| } | ||
| } catch { | ||
| // Fall through to default | ||
| } | ||
| } | ||
| // Default: all plugins | ||
| return allPlugins; | ||
| } | ||
|
|
||
| const sharedSkills = getDirectories(SHARED_SKILLS_DIR); | ||
| if (sharedSkills.length === 0) { | ||
| console.log("No shared skills found in shared/skills/. Nothing to sync."); | ||
| process.exit(0); | ||
| } | ||
|
|
||
| const allPlugins = getDirectories(PLUGINS_DIR); | ||
| if (allPlugins.length === 0) { | ||
| console.log("No plugins found in plugins/. Nothing to sync."); | ||
| process.exit(0); | ||
| } | ||
|
|
||
| const missing = []; | ||
|
|
||
| for (const skill of sharedSkills) { | ||
| const targetPlugins = getTargetPlugins(skill, allPlugins); | ||
| for (const plugin of targetPlugins) { | ||
| const targetPath = path.join(PLUGINS_DIR, plugin, "skills", skill, "SKILL.md"); | ||
| if (!fs.existsSync(targetPath)) { | ||
| missing.push({ plugin, skill, targetPath }); | ||
|
priyanshu92 marked this conversation as resolved.
Outdated
|
||
| } | ||
| } | ||
|
priyanshu92 marked this conversation as resolved.
Outdated
|
||
| } | ||
|
|
||
| if (missing.length === 0) { | ||
| console.log( | ||
| `All plugins are in sync for all ${sharedSkills.length} shared skill(s).` | ||
| ); | ||
| process.exit(0); | ||
| } | ||
|
|
||
| if (checkOnly) { | ||
| console.error("Shared skill sync check failed!\n"); | ||
| console.error("The following plugins are missing shared skill wrappers:\n"); | ||
| for (const { plugin, skill } of missing) { | ||
| console.error(` - Plugin "${plugin}" is missing shared skill "${skill}"`); | ||
| } | ||
| console.error("\nRun 'node scripts/sync-shared-skills.js' to auto-generate them."); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| // Generate missing wrappers | ||
| for (const { plugin, skill, targetPath } of missing) { | ||
| const templatePath = path.join(SHARED_SKILLS_DIR, skill, "SKILL.template.md"); | ||
| if (!fs.existsSync(templatePath)) { | ||
| console.error( | ||
| ` SKIP: No SKILL.template.md found for shared skill "${skill}" — expected at shared/skills/${skill}/SKILL.template.md` | ||
| ); | ||
| continue; | ||
| } | ||
|
|
||
| const pluginName = getPluginName(plugin); | ||
| const template = fs.readFileSync(templatePath, "utf-8"); | ||
| const content = template.replace(/\{\{PLUGIN_NAME\}\}/g, pluginName); | ||
| const targetDir = path.dirname(targetPath); | ||
| fs.mkdirSync(targetDir, { recursive: true }); | ||
| fs.writeFileSync(targetPath, content, "utf-8"); | ||
| console.log(` CREATED: plugins/${plugin}/skills/${skill}/SKILL.md (plugin: ${pluginName})`); | ||
| } | ||
|
|
||
| console.log(`\nSynced ${missing.length} shared skill wrapper(s).`); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| name: report-issue | ||
| description: > | ||
| Use this skill when the user wants to "report a bug", "file an issue", | ||
| "report an issue", "submit a bug report", or report any problem | ||
| with the {{PLUGIN_NAME}} plugin to the GitHub repository. | ||
| user-invocable: true | ||
| argument-hint: "[optional: brief description of the bug]" | ||
| allowed-tools: Read, Bash, Glob, Grep, AskUserQuestion, TaskCreate, TaskUpdate, TaskList | ||
| model: sonnet | ||
| --- | ||
|
|
||
| **Shared workflow: [report-issue-workflow.md](${CLAUDE_PLUGIN_ROOT}/../../shared/skills/report-issue/report-issue-workflow.md)** — Read and follow all phases defined in that file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "plugins": "*" | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.