@stphang/copilot-skills-pack 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -0
- package/bin/cli.js +103 -0
- package/package.json +26 -0
- package/skills/create-skill-with-qna/SKILL.md +37 -0
- package/skills/hello-world/SKILL.md +31 -0
- package/skills/summarize-skills/SKILL.md +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Copilot Skills Pack
|
|
2
|
+
|
|
3
|
+
A shareable npm package containing VS Code Copilot agent skills.
|
|
4
|
+
|
|
5
|
+
## Install Into a Project
|
|
6
|
+
|
|
7
|
+
From the project where the skills should be installed, run:
|
|
8
|
+
|
|
9
|
+
```powershell
|
|
10
|
+
npx @stphang/copilot-skills-pack
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This copies the bundled skills into `.github/skills/` in the current project. Existing skill files are preserved by default.
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
List the bundled skills:
|
|
18
|
+
|
|
19
|
+
```powershell
|
|
20
|
+
npx @stphang/copilot-skills-pack --list
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Replace existing copies:
|
|
24
|
+
|
|
25
|
+
```powershell
|
|
26
|
+
npx @stphang/copilot-skills-pack --force
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Install into another project directory:
|
|
30
|
+
|
|
31
|
+
```powershell
|
|
32
|
+
npx @stphang/copilot-skills-pack --target C:\path\to\project
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The package exposes the `copilot-skills` executable. You can also invoke it explicitly:
|
|
36
|
+
|
|
37
|
+
```powershell
|
|
38
|
+
npx -p @stphang/copilot-skills-pack copilot-skills
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Included Skills
|
|
42
|
+
|
|
43
|
+
- `create-skill-with-qna`
|
|
44
|
+
- `hello-world`
|
|
45
|
+
- `summarize-skills`
|
|
46
|
+
|
|
47
|
+
## Publish
|
|
48
|
+
|
|
49
|
+
Choose an available npm package name in `package.json`, then publish from this directory:
|
|
50
|
+
|
|
51
|
+
```powershell
|
|
52
|
+
npm login
|
|
53
|
+
npm publish
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The package is configured for public publication, so `npm publish` will publish it without requiring a paid private-package plan. After publishing, others can install the skills with:
|
|
57
|
+
|
|
58
|
+
```powershell
|
|
59
|
+
npx @stphang/copilot-skills-pack
|
|
60
|
+
```
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const packageRoot = path.resolve(__dirname, '..');
|
|
7
|
+
const bundledSkills = path.join(packageRoot, 'skills');
|
|
8
|
+
|
|
9
|
+
function printHelp() {
|
|
10
|
+
console.log(`Usage: npx copilot-skills-pack [options]
|
|
11
|
+
|
|
12
|
+
Install the bundled skills into .github/skills in the current project.
|
|
13
|
+
|
|
14
|
+
Options:
|
|
15
|
+
--target <dir> Install into a different project directory
|
|
16
|
+
--force Replace existing skill files
|
|
17
|
+
--list List bundled skills without installing
|
|
18
|
+
--help Show this help message`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function parseArguments(argumentsList) {
|
|
22
|
+
const options = { force: false, list: false, target: process.cwd() };
|
|
23
|
+
|
|
24
|
+
for (let index = 0; index < argumentsList.length; index += 1) {
|
|
25
|
+
const argument = argumentsList[index];
|
|
26
|
+
|
|
27
|
+
if (argument === '--force') {
|
|
28
|
+
options.force = true;
|
|
29
|
+
} else if (argument === '--list') {
|
|
30
|
+
options.list = true;
|
|
31
|
+
} else if (argument === '--target') {
|
|
32
|
+
const target = argumentsList[index + 1];
|
|
33
|
+
if (!target) {
|
|
34
|
+
throw new Error('--target requires a directory path.');
|
|
35
|
+
}
|
|
36
|
+
options.target = path.resolve(target);
|
|
37
|
+
index += 1;
|
|
38
|
+
} else if (argument === '--help' || argument === '-h') {
|
|
39
|
+
options.help = true;
|
|
40
|
+
} else {
|
|
41
|
+
throw new Error(`Unknown option: ${argument}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return options;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function findSkillNames() {
|
|
49
|
+
return fs.readdirSync(bundledSkills, { withFileTypes: true })
|
|
50
|
+
.filter((entry) => entry.isDirectory())
|
|
51
|
+
.filter((entry) => fs.existsSync(path.join(bundledSkills, entry.name, 'SKILL.md')))
|
|
52
|
+
.map((entry) => entry.name)
|
|
53
|
+
.sort();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function copySkill(skillName, destinationRoot, force) {
|
|
57
|
+
const sourceFile = path.join(bundledSkills, skillName, 'SKILL.md');
|
|
58
|
+
const destinationDirectory = path.join(destinationRoot, skillName);
|
|
59
|
+
const destinationFile = path.join(destinationDirectory, 'SKILL.md');
|
|
60
|
+
|
|
61
|
+
if (fs.existsSync(destinationFile) && !force) {
|
|
62
|
+
return { skillName, status: 'skipped' };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
fs.mkdirSync(destinationDirectory, { recursive: true });
|
|
66
|
+
fs.copyFileSync(sourceFile, destinationFile);
|
|
67
|
+
return { skillName, status: 'installed' };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function main() {
|
|
71
|
+
const options = parseArguments(process.argv.slice(2));
|
|
72
|
+
const skillNames = findSkillNames();
|
|
73
|
+
|
|
74
|
+
if (options.help) {
|
|
75
|
+
printHelp();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (options.list) {
|
|
80
|
+
console.log(skillNames.join('\n'));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const destinationRoot = path.join(options.target, '.github', 'skills');
|
|
85
|
+
const results = skillNames.map((skillName) => copySkill(skillName, destinationRoot, options.force));
|
|
86
|
+
const installed = results.filter((result) => result.status === 'installed');
|
|
87
|
+
const skipped = results.filter((result) => result.status === 'skipped');
|
|
88
|
+
|
|
89
|
+
console.log(`Installed ${installed.length} skill(s) into ${destinationRoot}.`);
|
|
90
|
+
if (installed.length > 0) {
|
|
91
|
+
console.log(` ${installed.map((result) => result.skillName).join(', ')}`);
|
|
92
|
+
}
|
|
93
|
+
if (skipped.length > 0) {
|
|
94
|
+
console.log(`Skipped ${skipped.length} existing skill(s). Use --force to replace them.`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
try {
|
|
99
|
+
main();
|
|
100
|
+
} catch (error) {
|
|
101
|
+
console.error(`Error: ${error.message}`);
|
|
102
|
+
process.exitCode = 1;
|
|
103
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stphang/copilot-skills-pack",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Shareable VS Code Copilot agent skills for project workspaces.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"copilot-skills": "bin/cli.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin",
|
|
10
|
+
"skills",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"keywords": [
|
|
14
|
+
"github-copilot",
|
|
15
|
+
"copilot",
|
|
16
|
+
"agent-skills",
|
|
17
|
+
"vscode"
|
|
18
|
+
],
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=14"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-skill-with-qna
|
|
3
|
+
description: 'Create a reusable VS Code agent skill through a concise requirements interview. Use when defining a skill from scratch, gathering its purpose, scenarios, workflow, inputs, outputs, constraints, or prompt examples.'
|
|
4
|
+
argument-hint: 'Describe the skill you want to create.'
|
|
5
|
+
user-invocable: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Create Skill With Q&A
|
|
9
|
+
|
|
10
|
+
Guide the user through a short, structured interview and synthesize the answers into a valid, reusable skill file.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- Creating a new skill from scratch.
|
|
15
|
+
- Defining a skill's purpose and intended outcomes.
|
|
16
|
+
- Capturing usage scenarios, workflow steps, inputs, outputs, and constraints.
|
|
17
|
+
- Reviewing a generated skill before using it.
|
|
18
|
+
|
|
19
|
+
## Procedure
|
|
20
|
+
|
|
21
|
+
1. Ask for the skill name.
|
|
22
|
+
2. Ask for the primary purpose and desired outcome.
|
|
23
|
+
3. Ask for intended usage scenarios.
|
|
24
|
+
4. Ask for the workflow or steps the skill should follow.
|
|
25
|
+
5. Ask for expected inputs, outputs, and constraints.
|
|
26
|
+
6. Ask whether prompt templates or examples are wanted; include them only when explicitly requested or provided.
|
|
27
|
+
7. Check whether the target skill already exists. Ask before overwriting an existing file.
|
|
28
|
+
8. Generate `.github/skills/<skill-name>/SKILL.md` with matching folder and frontmatter names.
|
|
29
|
+
9. Include a meaningful description, a `When to Use` section, and a clear step-by-step procedure.
|
|
30
|
+
10. Validate the frontmatter and present a concise summary of the generated skill.
|
|
31
|
+
|
|
32
|
+
## Interview Rules
|
|
33
|
+
|
|
34
|
+
- Ask one concise question at a time.
|
|
35
|
+
- Do not invent requirements, prompts, templates, or examples.
|
|
36
|
+
- Normalize the filename to lowercase kebab-case while preserving the intended display name in the heading.
|
|
37
|
+
- Keep the final skill focused and reusable.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hello-world
|
|
3
|
+
description: 'Introduce programming by printing Hello World. Use for a first coding lesson or to verify that a compiler, interpreter, runtime, or project setup works.'
|
|
4
|
+
argument-hint: 'Specify the programming language or runtime to use.'
|
|
5
|
+
user-invocable: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Hello World
|
|
9
|
+
|
|
10
|
+
Create the smallest useful program that prints `Hello World` and confirms the selected development environment can run it.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- Starting a first programming lesson.
|
|
15
|
+
- Testing compiler or interpreter installation.
|
|
16
|
+
- Verifying a project entry point and runtime command.
|
|
17
|
+
|
|
18
|
+
## Procedure
|
|
19
|
+
|
|
20
|
+
1. Identify the requested programming language and runtime.
|
|
21
|
+
2. Create the conventional entry-point file for that language.
|
|
22
|
+
3. Print exactly `Hello World` using the language's standard output API.
|
|
23
|
+
4. Run the program with the project's normal command.
|
|
24
|
+
5. Confirm the output and report the command used.
|
|
25
|
+
|
|
26
|
+
## Review Checklist
|
|
27
|
+
|
|
28
|
+
- Does the file use valid syntax for the selected language?
|
|
29
|
+
- Does execution produce `Hello World` without extra output?
|
|
30
|
+
- Is the documented run command appropriate for the current project?
|
|
31
|
+
- Are setup failures reported clearly instead of being hidden?
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: summarize-skills
|
|
3
|
+
description: 'Summarize the skills available in .github/skills by counting valid skill folders and explaining each skill purpose. Use for repository skill discovery, onboarding, documentation, or checking skill organization.'
|
|
4
|
+
argument-hint: 'Optionally specify a skills directory or filtering criterion.'
|
|
5
|
+
user-invocable: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Summarize Skills
|
|
9
|
+
|
|
10
|
+
## Description
|
|
11
|
+
Summarize all valid skills defined under `.github/skills/` by listing how many there are and what each skill does.
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
- Provide a quick overview of available skills
|
|
15
|
+
- Help users understand the role of each skill
|
|
16
|
+
- Make it easier to discover and reuse skills
|
|
17
|
+
|
|
18
|
+
## Usage Scenarios
|
|
19
|
+
- Reviewing skills in a repository
|
|
20
|
+
- Teaching beginners how skills are organized
|
|
21
|
+
- Creating documentation or onboarding material
|
|
22
|
+
|
|
23
|
+
## Procedure
|
|
24
|
+
|
|
25
|
+
1. Scan `.github/skills/` for skill directories containing a `SKILL.md` file.
|
|
26
|
+
2. Read each file's YAML frontmatter and collect its `name` and `description`.
|
|
27
|
+
3. Confirm that each frontmatter `name` matches its parent folder name.
|
|
28
|
+
4. Count the valid skills and summarize each purpose in a concise list or table.
|
|
29
|
+
5. Report invalid or incomplete skill folders separately without silently treating them as valid skills.
|
|
30
|
+
|
|
31
|
+
## Output Format
|
|
32
|
+
|
|
33
|
+
Present:
|
|
34
|
+
|
|
35
|
+
- the total number of valid skills
|
|
36
|
+
- each skill name and its purpose
|
|
37
|
+
- any folders missing `SKILL.md` or required frontmatter
|
|
38
|
+
|
|
39
|
+
Prefer a compact Markdown table for the valid skills.
|
|
40
|
+
|
|
41
|
+
## Review Checklist
|
|
42
|
+
|
|
43
|
+
- Were only folders containing `SKILL.md` counted as skills?
|
|
44
|
+
- Were `name` and `description` read from frontmatter rather than inferred from headings?
|
|
45
|
+
- Does every reported skill name match its folder name?
|
|
46
|
+
- Are invalid or incomplete entries clearly identified?
|