Skip to content

Commit 42c0f6e

Browse files
committed
feat: add release automation, commit linting, template sync, and update to latest APIs
1 parent 5e6358c commit 42c0f6e

File tree

12 files changed

+510
-88
lines changed

12 files changed

+510
-88
lines changed

.githooks/commit-msg

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
# Git commit-msg hook to enforce Conventional Commits
3+
# Install via: ./scripts/setup-hooks.sh
4+
5+
commit_msg_file="$1"
6+
commit_msg=$(head -1 "$commit_msg_file")
7+
8+
# Skip merge commits
9+
if echo "$commit_msg" | grep -qE "^Merge "; then
10+
exit 0
11+
fi
12+
13+
# Skip [skip ci] only commits
14+
if echo "$commit_msg" | grep -qE "^\[skip ci\]$"; then
15+
exit 0
16+
fi
17+
18+
# Conventional Commits pattern
19+
pattern='^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?(!)?: .+'
20+
21+
if ! echo "$commit_msg" | grep -qE "$pattern"; then
22+
echo ""
23+
echo "❌ Commit message does not follow Conventional Commits format!"
24+
echo ""
25+
echo " Your message: $commit_msg"
26+
echo ""
27+
echo " Required format: <type>(<optional scope>): <description>"
28+
echo ""
29+
echo " Allowed types:"
30+
echo " feat - A new feature"
31+
echo " fix - A bug fix"
32+
echo " docs - Documentation only"
33+
echo " style - Formatting, no code change"
34+
echo " refactor - Code restructuring"
35+
echo " perf - Performance improvement"
36+
echo " test - Adding/updating tests"
37+
echo " build - Build system changes"
38+
echo " ci - CI configuration changes"
39+
echo " chore - Maintenance tasks"
40+
echo " revert - Reverting a previous commit"
41+
echo ""
42+
echo " Examples:"
43+
echo " feat: add new copilot skill for debugging"
44+
echo " fix(agents): correct yaml frontmatter parsing"
45+
echo " docs: update contributing guidelines"
46+
echo " feat!: redesign skill format (BREAKING CHANGE)"
47+
echo ""
48+
exit 1
49+
fi

.github/agents/copilot-customization-builder.agent.md

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
description: Create and maintain Copilot customizations (agents, prompt files, instructions, skills, MCP) for VS Code and GitHub Copilot
33
name: Copilot Customization Builder
44
tools: ['search', 'fetch', 'editFiles', 'runCommand', 'runSubagent']
5-
infer: true
5+
user-invokable: true
6+
disable-model-invocation: false
67
---
78
# Copilot Customization Builder
89

@@ -39,7 +40,7 @@ When a user asks for a new customization, do this:
3940
- Match naming, tool naming, and tone.
4041

4142
3. **Design before writing files**
42-
- Draft the frontmatter: `name`, `description`, `tools`, optional `model`, optional `infer`, optional `target`, optional `handoffs`.
43+
- Draft the frontmatter: `name`, `description`, `tools`, optional `model`, optional `user-invokable`, optional `disable-model-invocation`, optional `agents`, optional `target`, optional `handoffs`.
4344
- Keep tool lists small; if omitted, the agent gets *all* tools (avoid that unless explicitly requested).
4445

4546
4. **Implement incrementally**
@@ -60,12 +61,20 @@ When a user asks for a new customization, do this:
6061
- The filename should be a stable slug.
6162

6263
Frontmatter guidelines:
64+
6365
- `description` is required.
6466
- `name` is strongly recommended.
6567
- `tools` is recommended to be explicit.
68+
- `agents` controls which agents can be used as subagents (use `*` for all, `[]` for none).
69+
- `user-invokable` (default `true`) controls visibility in the agents dropdown. Set to `false` for subagent-only agents.
70+
- `disable-model-invocation` (default `false`) prevents the agent from being invoked as a subagent.
71+
- `argument-hint` provides hint text in the chat input field.
6672
- `target` can be `vscode` or `github-copilot` to restrict availability; omit to allow both.
73+
- `mcp-servers` can specify MCP server configs for GitHub Copilot coding agent.
6774
- Agent prompt text must remain under the applicable limits (keep it tight and modular).
6875

76+
> **Deprecated:** `infer` is deprecated. Use `user-invokable` and `disable-model-invocation` instead.
77+
6978
### Prompt files
7079

7180
- Stored as `.prompt.md` in `.github/prompts/`.
@@ -88,10 +97,12 @@ Agent Skills are portable folders of instructions, scripts, and resources that A
8897
- Personal skills: `~/.copilot/skills/<skill-name>/SKILL.md` (recommended) or `~/.claude/skills/<skill-name>/SKILL.md` (legacy)
8998

9099
SKILL.md frontmatter:
100+
91101
- `name` (required): Unique identifier, lowercase with hyphens, max 64 chars (e.g., `webapp-testing`)
92102
- `description` (required): What the skill does and when to use it, max 1024 chars. Be specific to help Copilot decide when to load.
93103

94104
Skill body should include:
105+
95106
- What the skill accomplishes
96107
- When to use it (specific triggers and use cases)
97108
- Step-by-step procedures
@@ -117,7 +128,7 @@ VS Code supports **context-isolated subagents** via the `runSubagent` tool. To u
117128

118129
- Ensure `runSubagent` is enabled (either via the tools picker, or via `tools: [...]` in the agent/prompt frontmatter).
119130
- If you want a subagent to run as a *specific custom agent*, enable the experimental setting `chat.customAgentInSubagent.enabled`.
120-
- A custom agent can be blocked from subagent usage by setting `infer: false` in its `*.agent.md` frontmatter.
131+
- A custom agent can be blocked from subagent usage by setting `disable-model-invocation: true` in its `*.agent.md` frontmatter.
121132

122133
### Handoffs (VS Code)
123134

@@ -127,39 +138,43 @@ VS Code custom agents support a `handoffs:` frontmatter property to guide users
127138

128139
Some frontmatter fields have different behavior depending on where the agent runs.
129140

130-
- `infer`:
131-
- In **VS Code**, `infer` controls whether the agent can be used as a subagent (defaults to `true`).
132-
- In **GitHub Copilot coding agent**, `infer: false` disables automatic agent selection (the agent must be chosen manually).
141+
- `user-invokable` / `disable-model-invocation`:
142+
- In **VS Code**, these separately control picker visibility and subagent availability.
143+
- In **GitHub Copilot coding agent**, `disable-model-invocation: true` disables automatic agent selection.
133144
- `handoffs`:
134-
- Supported in **VS Code**.
135-
- Currently **ignored** by **GitHub Copilot coding agent** for compatibility.
145+
- Supported in **VS Code**.
146+
- Currently **ignored** by **GitHub Copilot coding agent** for compatibility.
147+
- `mcp-servers`:
148+
- Used by **GitHub Copilot coding agent** (`target: github-copilot`) to configure MCP servers.
149+
- In **VS Code**, MCP servers are configured via `mcp.json` or VS Code settings.
136150

137151
## Reference docs
138152

139-
- VS Code Copilot overview: https://code.visualstudio.com/docs/copilot/overview
140-
- Customize chat overview: https://code.visualstudio.com/docs/copilot/customization/overview
141-
- Custom agents (VS Code): https://code.visualstudio.com/docs/copilot/customization/custom-agents
142-
- Prompt files (VS Code): https://code.visualstudio.com/docs/copilot/customization/prompt-files
143-
- Custom instructions (VS Code): https://code.visualstudio.com/docs/copilot/customization/custom-instructions
144-
- Agent Skills (VS Code): https://code.visualstudio.com/docs/copilot/customization/agent-skills
145-
- Agent Skills standard: https://agentskills.io/
146-
- Language models (VS Code): https://code.visualstudio.com/docs/copilot/customization/language-models
147-
- MCP servers (VS Code): https://code.visualstudio.com/docs/copilot/customization/mcp-servers
148-
- Chat tools & approvals (VS Code): https://code.visualstudio.com/docs/copilot/chat/chat-tools
149-
- Chat sessions (VS Code): https://code.visualstudio.com/docs/copilot/chat/chat-sessions
150-
- Manage context (VS Code): https://code.visualstudio.com/docs/copilot/chat/copilot-chat-context
151-
- Copilot feature reference / cheat sheet (VS Code): https://code.visualstudio.com/docs/copilot/reference/copilot-vscode-features
152-
- Agents overview (local/background/cloud): https://code.visualstudio.com/docs/copilot/agents/overview
153-
- Background agents: https://code.visualstudio.com/docs/copilot/agents/background-agents
154-
- Cloud agents: https://code.visualstudio.com/docs/copilot/agents/cloud-agents
155-
- Context engineering guide: https://code.visualstudio.com/docs/copilot/guides/context-engineering-guide
156-
- Prompt engineering guide: https://code.visualstudio.com/docs/copilot/guides/prompt-engineering-guide
157-
- Security considerations (VS Code): https://code.visualstudio.com/docs/copilot/security
158-
- Subagents / chat sessions (VS Code): https://code.visualstudio.com/docs/copilot/chat/chat-sessions
153+
- VS Code Copilot overview: <https://code.visualstudio.com/docs/copilot/overview>
154+
- Customize chat overview: <https://code.visualstudio.com/docs/copilot/customization/overview>
155+
- Custom agents (VS Code): <https://code.visualstudio.com/docs/copilot/customization/custom-agents>
156+
- Prompt files (VS Code): <https://code.visualstudio.com/docs/copilot/customization/prompt-files>
157+
- Custom instructions (VS Code): <https://code.visualstudio.com/docs/copilot/customization/custom-instructions>
158+
- Agent Skills (VS Code): <https://code.visualstudio.com/docs/copilot/customization/agent-skills>
159+
- Agent Skills standard: <https://agentskills.io/>
160+
- Language models (VS Code): <https://code.visualstudio.com/docs/copilot/customization/language-models>
161+
- MCP servers (VS Code): <https://code.visualstudio.com/docs/copilot/customization/mcp-servers>
162+
- Chat tools & approvals (VS Code): <https://code.visualstudio.com/docs/copilot/chat/chat-tools>
163+
- Chat sessions (VS Code): <https://code.visualstudio.com/docs/copilot/chat/chat-sessions>
164+
- Manage context (VS Code): <https://code.visualstudio.com/docs/copilot/chat/copilot-chat-context>
165+
- Copilot feature reference / cheat sheet (VS Code): <https://code.visualstudio.com/docs/copilot/reference/copilot-vscode-features>
166+
- Agents overview (local/background/cloud): <https://code.visualstudio.com/docs/copilot/agents/overview>
167+
- Background agents: <https://code.visualstudio.com/docs/copilot/agents/background-agents>
168+
- Cloud agents: <https://code.visualstudio.com/docs/copilot/agents/cloud-agents>
169+
- Context engineering guide: <https://code.visualstudio.com/docs/copilot/guides/context-engineering-guide>
170+
- Prompt engineering guide: <https://code.visualstudio.com/docs/copilot/guides/prompt-engineering-guide>
171+
- Security considerations (VS Code): <https://code.visualstudio.com/docs/copilot/security>
172+
- Subagents / chat sessions (VS Code): <https://code.visualstudio.com/docs/copilot/chat/chat-sessions>
159173

160174
GitHub Copilot (cloud) custom agents:
161-
- Creating custom agents (GitHub docs): https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents
162-
- Custom agents configuration (GitHub reference): https://docs.github.com/en/copilot/reference/custom-agents-configuration
175+
176+
- Creating custom agents (GitHub docs): <https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents>
177+
- Custom agents configuration (GitHub reference): <https://docs.github.com/en/copilot/reference/custom-agents-configuration>
163178

164179
## Deliverables style
165180

.github/copilot-instructions.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copilot Instructions
2+
3+
These instructions are automatically applied to every Copilot Chat session in this workspace.
4+
5+
## Project Context
6+
7+
This is a **GitHub Copilot Customization Blueprint** — a template repository for bootstrapping
8+
Copilot agents, prompt files, instructions, and skills in any project.
9+
10+
## Conventions
11+
12+
- All customization files live under `.github/` (agents, prompts, skills, instructions)
13+
- Use **Conventional Commits** for all commit messages: `<type>(<scope>): <description>`
14+
- Allowed types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`
15+
- Agent files: `.agent.md` with YAML frontmatter (`name`, `description`, `tools` required)
16+
- Prompt files: `.prompt.md` with YAML frontmatter (`name`, `description` required)
17+
- Skill files: `SKILL.md` in a named directory under `.github/skills/<name>/`
18+
- Use `user-invokable` and `disable-model-invocation` instead of the deprecated `infer` field
19+
20+
## File Structure
21+
22+
```
23+
.github/
24+
├── agents/ # Custom agent profiles (.agent.md)
25+
├── prompts/ # Prompt templates (.prompt.md)
26+
├── skills/ # Agent Skills (each in its own directory with SKILL.md)
27+
├── workflows/ # GitHub Actions (release, validate, commit-lint)
28+
└── copilot-instructions.md # This file
29+
```
30+
31+
## Code Style
32+
33+
- Markdown: ATX-style headings, fenced code blocks with language identifiers
34+
- YAML frontmatter: quote strings that contain special characters
35+
- Shell scripts: use `set -e`, add color output, include usage help
36+
- Keep lines under 120 characters where practical

.github/workflows/commit-lint.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Validate Commit Messages
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types: [opened, synchronize, reopened, edited]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: read
12+
13+
jobs:
14+
commit-lint:
15+
name: Conventional Commits Check
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v6
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Validate commit messages
24+
run: |
25+
echo "## 📋 Commit Message Validation" >> $GITHUB_STEP_SUMMARY
26+
echo "" >> $GITHUB_STEP_SUMMARY
27+
28+
# Conventional commit regex pattern
29+
PATTERN='^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?(!)?: .+'
30+
31+
ERROR_COUNT=0
32+
TOTAL_COUNT=0
33+
34+
# Get commits in this PR
35+
COMMITS=$(git log origin/${{ github.base_ref }}..HEAD --pretty=format:"%H %s")
36+
37+
if [ -z "$COMMITS" ]; then
38+
echo "ℹ️ No commits to validate" >> $GITHUB_STEP_SUMMARY
39+
exit 0
40+
fi
41+
42+
while IFS= read -r line; do
43+
HASH=$(echo "$line" | cut -d' ' -f1)
44+
MSG=$(echo "$line" | cut -d' ' -f2-)
45+
SHORT_HASH=$(echo "$HASH" | cut -c1-7)
46+
TOTAL_COUNT=$((TOTAL_COUNT + 1))
47+
48+
# Skip merge commits
49+
if echo "$MSG" | grep -qE "^Merge "; then
50+
echo "⏭️ \`$SHORT_HASH\` - Merge commit (skipped)" >> $GITHUB_STEP_SUMMARY
51+
continue
52+
fi
53+
54+
if echo "$MSG" | grep -qE "$PATTERN"; then
55+
echo "✅ \`$SHORT_HASH\` - $MSG" >> $GITHUB_STEP_SUMMARY
56+
else
57+
echo "❌ \`$SHORT_HASH\` - $MSG" >> $GITHUB_STEP_SUMMARY
58+
ERROR_COUNT=$((ERROR_COUNT + 1))
59+
fi
60+
done <<< "$COMMITS"
61+
62+
echo "" >> $GITHUB_STEP_SUMMARY
63+
echo "---" >> $GITHUB_STEP_SUMMARY
64+
65+
if [ $ERROR_COUNT -gt 0 ]; then
66+
echo "### ❌ $ERROR_COUNT of $TOTAL_COUNT commit(s) do not follow Conventional Commits" >> $GITHUB_STEP_SUMMARY
67+
echo "" >> $GITHUB_STEP_SUMMARY
68+
echo "**Required format:** \`<type>(<optional scope>): <description>\`" >> $GITHUB_STEP_SUMMARY
69+
echo "" >> $GITHUB_STEP_SUMMARY
70+
echo "**Allowed types:** \`feat\`, \`fix\`, \`docs\`, \`style\`, \`refactor\`, \`perf\`, \`test\`, \`build\`, \`ci\`, \`chore\`, \`revert\`" >> $GITHUB_STEP_SUMMARY
71+
echo "" >> $GITHUB_STEP_SUMMARY
72+
echo "**Examples:**" >> $GITHUB_STEP_SUMMARY
73+
echo "- \`feat: add new copilot skill for debugging\`" >> $GITHUB_STEP_SUMMARY
74+
echo "- \`fix(agents): correct yaml frontmatter parsing\`" >> $GITHUB_STEP_SUMMARY
75+
echo "- \`docs: update contributing guidelines\`" >> $GITHUB_STEP_SUMMARY
76+
echo "- \`feat!: redesign skill file format (BREAKING)\`" >> $GITHUB_STEP_SUMMARY
77+
exit 1
78+
else
79+
echo "### ✅ All $TOTAL_COUNT commit(s) follow Conventional Commits!" >> $GITHUB_STEP_SUMMARY
80+
fi
81+
82+
pr-title-lint:
83+
name: PR Title Check
84+
runs-on: ubuntu-latest
85+
steps:
86+
- name: Validate PR title
87+
run: |
88+
PR_TITLE="${{ github.event.pull_request.title }}"
89+
PATTERN='^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?(!)?: .+'
90+
91+
echo "## 📋 PR Title Validation" >> $GITHUB_STEP_SUMMARY
92+
echo "" >> $GITHUB_STEP_SUMMARY
93+
echo "**Title:** $PR_TITLE" >> $GITHUB_STEP_SUMMARY
94+
echo "" >> $GITHUB_STEP_SUMMARY
95+
96+
if echo "$PR_TITLE" | grep -qE "$PATTERN"; then
97+
echo "### ✅ PR title follows Conventional Commits format" >> $GITHUB_STEP_SUMMARY
98+
else
99+
echo "### ❌ PR title does not follow Conventional Commits format" >> $GITHUB_STEP_SUMMARY
100+
echo "" >> $GITHUB_STEP_SUMMARY
101+
echo "**Required format:** \`<type>(<optional scope>): <description>\`" >> $GITHUB_STEP_SUMMARY
102+
echo "" >> $GITHUB_STEP_SUMMARY
103+
echo "**Allowed types:** \`feat\`, \`fix\`, \`docs\`, \`style\`, \`refactor\`, \`perf\`, \`test\`, \`build\`, \`ci\`, \`chore\`, \`revert\`" >> $GITHUB_STEP_SUMMARY
104+
exit 1
105+
fi

.github/workflows/release.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,10 @@ jobs:
217217
218218
- name: Create Release
219219
if: steps.check_release.outputs.needs_release == 'true'
220-
uses: actions/create-release@v1
221-
env:
222-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
220+
uses: softprops/action-gh-release@v2
223221
with:
224222
tag_name: ${{ steps.new_version.outputs.new_version }}
225-
release_name: Release ${{ steps.new_version.outputs.new_version }}
223+
name: Release ${{ steps.new_version.outputs.new_version }}
226224
body: ${{ steps.changelog.outputs.changelog }}
227225
draft: false
228226
prerelease: false

0 commit comments

Comments
 (0)