You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(skills): mandate unit testing and document language support (#636)
## Description
Added unit testing requirements with an 80% code coverage minimum for
skill contributions and documented supported programming languages.
Tests use a co-located `tests/` directory pattern inside each skill,
keeping skills self-contained. Updated Pester coverage configuration and
extension packaging to support the new test structure.
- feat(skills): added "Untested Skills" rejection criterion requiring
unit tests with 80% code coverage
- feat(skills): added Unit Testing Requirements section with test file
layout, PowerShell and Python conventions, and packaging exclusion notes
- feat(skills): added Supported Languages table documenting PowerShell
(full CI) and Python (planned CI) with tooling expectations
- feat(skills): added Testing checklist to the pre-submission
verification section and `npm run test:ps` to automated validation
- feat(skills): updated file structure diagram to include `tests/`
subdirectory
- feat(extension): added co-located `tests/` directory exclusion from
VSIX packaging in `Package-Extension.ps1`
- feat(scripts): extended Pester coverage configuration to discover and
report on skill scripts from `.github/skills/`
- docs(architecture): added Skills Testing section to
`docs/architecture/testing.md` covering co-located test pattern,
coverage integration, and packaging exclusion
- docs(contributing): added paragraph in `CONTRIBUTING.md` explaining
skill test co-location pattern with link to Skills Guide
- feat(skills): added Programming Language dropdown (PowerShell, Python,
Other) to skill request issue template with clarified cross-platform
description
- fix(skills): added `pyproject` to cspell word list
- fix(skills): fixed table alignment in Supported Languages table
- fix(templates): added "Other" option to skill request language
dropdown to match documentation reference
## Related Issue(s)
Closes#634
## Type of Change
Select all that apply:
**Code & Documentation:**
- [ ] Bug fix (non-breaking change fixing an issue)
- [x] New feature (non-breaking change adding functionality)
- [ ] Breaking change (fix or feature causing existing functionality to
change)
- [x] Documentation update
**Infrastructure & Configuration:**
- [ ] GitHub Actions workflow
- [ ] Linting configuration (markdown, PowerShell, etc.)
- [ ] Security configuration
- [ ] DevContainer configuration
- [ ] Dependency update
**AI Artifacts:**
- [ ] Reviewed contribution with `prompt-builder` agent and addressed
all feedback
- [ ] Copilot instructions (`.github/instructions/*.instructions.md`)
- [ ] Copilot prompt (`.github/prompts/*.prompt.md`)
- [ ] Copilot agent (`.github/agents/*.agent.md`)
- [ ] Copilot skill (`.github/skills/*/SKILL.md`)
> **Note for AI Artifact Contributors**:
>
> - **Agents**: Research, indexing/referencing other project (using
standard VS Code GitHub Copilot/MCP tools), planning, and general
implementation agents likely already exist. Review `.github/agents/`
before creating new ones.
> - **Skills**: Must include PowerShell scripts for cross-platform
support. See [Skills](../docs/contributing/skills.md).
> - **Model Versions**: Only contributions targeting the **latest
Anthropic and OpenAI models** will be accepted. Older model versions
(e.g., GPT-3.5, Claude 3) will be rejected.
> - See [Agents Not
Accepted](../docs/contributing/custom-agents.md#agents-not-accepted) and
[Model Version
Requirements](../docs/contributing/ai-artifacts-common.md#model-version-requirements).
**Other:**
- [x] Script/automation (`.ps1`, `.sh`, `.py`)
- [ ] Other (please describe):
## Sample Prompts (for AI Artifact Contributions)
## Testing
- All four linters pass clean: `lint:md`, `lint:yaml`,
`lint:frontmatter`, `lint:ps`
- All 228 Pester tests pass (pre-existing `LASTEXITCODE: -1` leak from
subprocess invocations is unrelated)
- No new skill scripts exist yet, so skill coverage path resolution
executes the `Test-Path` guard without error
## Checklist
### Required Checks
- [x] Documentation is updated (if applicable)
- [x] Files follow existing naming conventions
- [x] Changes are backwards compatible (if applicable)
- [x] Tests added for new functionality (if applicable)
### AI Artifact Contributions
- [ ] Used `/prompt-analyze` to review contribution
- [ ] Addressed all feedback from `prompt-builder` review
- [ ] Verified contribution follows common standards and type-specific
requirements
### Required Automated Checks
The following validation commands must pass before merging:
- [x] Markdown linting: `npm run lint:md`
- [x] Spell checking: `npm run spell-check`
- [x] Frontmatter validation: `npm run lint:frontmatter`
- [ ] Link validation: `npm run lint:md-links`
- [x] PowerShell analysis: `npm run lint:ps`
## Security Considerations
- [x] This PR does not contain any sensitive or NDA information
- [ ] Any new dependencies have been reviewed for security issues
- [x] Security-related scripts follow the principle of least privilege
## Additional Notes
- Bash was intentionally excluded from the Supported Languages table; it
may be added in a future iteration
- The 80% code coverage threshold applies to skill scripts only; the
repository-wide informational baseline remains at 18%
- No GHCP artifacts (instructions, prompts, agents, skills) were
modified in this PR
🧪 - Generated by Copilot
---------
Co-authored-by: Katrien De Graeve <katriendg@users.noreply.github.com>
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -308,6 +308,8 @@ CI reports coverage at an 18% informational baseline; focus on meaningful covera
308
308
| Naming |`*.Tests.ps1` suffix matching source script name |
309
309
| Framework | Pester 5.x |
310
310
311
+
Skill scripts use a different test location. Skill tests are co-located inside each skill directory at `.github/skills/<skill-name>/tests/` rather than mirrored under `scripts/tests/`. See [Skills Guide](./docs/contributing/skills.md#unit-testing-requirements) for details.
Skill scripts use a co-located test pattern instead of the mirror directory structure used by `scripts/`. Each skill contains its own `tests/` subdirectory:
177
+
178
+
```text
179
+
.github/skills/<skill-name>/
180
+
├── scripts/
181
+
│ ├── convert.ps1
182
+
│ └── convert.sh
183
+
└── tests/
184
+
└── convert.Tests.ps1
185
+
```
186
+
187
+
### Coverage Integration
188
+
189
+
The Pester configuration at `scripts/tests/pester.config.ps1` resolves skill scripts from the repository root for code coverage analysis. When you include a skill `tests/` directory in an `Invoke-Pester -Path` argument or test run configuration, Pester discovers the skill test files through the `.Tests.ps1` naming convention.
190
+
191
+
Coverage path resolution for skills uses the repository root rather than `$scriptRoot` (which points to `scripts/`):
Co-located `tests/` directories are excluded from the VSIX extension package by `Package-Extension.ps1`. After copying a skill directory, the packaging script removes any `tests/` subdirectories from the destination.
203
+
174
204
🤖 *Crafted with precision by ✨Copilot following brilliant human instruction, then carefully refined by our team of discerning human reviewers.*
Copy file name to clipboardExpand all lines: docs/contributing/skills.md
+78-4Lines changed: 78 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,7 @@ The following skill types will likely be **rejected**:
43
43
***Duplicate Skills**: Skills that replicate functionality of existing tools or skills
44
44
***Single-Platform Skills**: Skills that only work on one operating system
45
45
***Undocumented Utilities**: Scripts without comprehensive SKILL.md documentation
46
+
***Untested Skills**: Skills that lack unit tests or fail to achieve 80% code coverage
46
47
47
48
## File Structure Requirements
48
49
@@ -53,10 +54,13 @@ All skill files **MUST** be placed in:
53
54
```text
54
55
.github/skills/<skill-name>/
55
56
├── SKILL.md # Main skill definition (required)
56
-
├── convert.sh # Bash script (required for cross-platform)
57
-
├── convert.ps1 # PowerShell script (required for cross-platform)
58
-
└── examples/
59
-
└── README.md # Usage examples (recommended)
57
+
├── scripts/
58
+
│ ├── convert.ps1 # PowerShell script (required for cross-platform)
59
+
│ └── convert.sh # Bash script (required for cross-platform)
60
+
├── examples/
61
+
│ └── README.md # Usage examples (recommended)
62
+
└── tests/
63
+
└── convert.Tests.ps1 # Pester unit tests (required for PowerShell)
60
64
```
61
65
62
66
### Naming Convention
@@ -257,6 +261,69 @@ PowerShell scripts **MUST**:
257
261
* Check for required dependencies
258
262
* Use proper error handling
259
263
264
+
## Unit Testing Requirements
265
+
266
+
All skill scripts MUST include unit tests that achieve a minimum of 80% code coverage. Tests are co-located inside the skill directory to keep each skill self-contained.
267
+
268
+
### Test File Location
269
+
270
+
Place test files in a `tests/` subdirectory within the skill directory:
* Use `.Tests.ps1` suffix matching the source script name
283
+
* Follow the same conventions as `scripts/tests/` (see [Testing Architecture](../architecture/testing.md))
284
+
* Pester configuration is defined at `scripts/tests/pester.config.ps1`; co-located skill tests run when their `tests/` directories are included in the Pester run paths (for example via CI or explicit test invocation)
285
+
286
+
Minimal example:
287
+
288
+
```powershell
289
+
Describe 'Convert-VideoToGif' {
290
+
It 'Validates input file exists' {
291
+
{ ./convert.ps1 -InputPath 'nonexistent.mp4' } | Should -Throw
292
+
}
293
+
}
294
+
```
295
+
296
+
### Python Tests
297
+
298
+
Python skill scripts require pytest:
299
+
300
+
* Use `test_<script_name>.py` naming convention
301
+
* Place tests in the `tests/` subdirectory alongside PowerShell tests
302
+
* Configure pytest and ruff in a `pyproject.toml` at the skill root
303
+
304
+
### Packaging Note
305
+
306
+
Co-located `tests/` directories are automatically excluded from the VSIX extension package. No additional contributor action is needed.
307
+
308
+
## Supported Languages
309
+
310
+
Skills may include scripts in any of these supported languages. Each language has specific tooling and CI expectations.
311
+
312
+
| Language | Script Extension | Test Framework | Linter / Analyzer | CI Coverage |
0 commit comments