Skip to content

Commit ba159e9

Browse files
denelonCopilot
andcommitted
Add Copilot instructions for writing specifications
- Create .github/instructions/specs.instructions.md with detailed guidance for spec authoring: template structure, naming, required sections, areas of impact, schema versioning, interactivity modes, deprecation patterns, spelling, and PR conventions - Update .github/copilot-instructions.md to reference the new file Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7405fe0 commit ba159e9

2 files changed

Lines changed: 118 additions & 1 deletion

File tree

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void WorkflowTask(Execution::Context& context)
157157
158158
- Review `CONTRIBUTING.md` for workflow
159159
- File/discuss issues before starting work
160-
- Specs required for features (stored in `doc/specs/`)
160+
- Specs required for features (stored in `doc/specs/`); see `.github/instructions/specs.instructions.md` for detailed guidance
161161
- Follow existing code style (see `stylecop.json`)
162162
- CI runs on Azure Pipelines (`azure-pipelines.yml`)
163163
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Writing WinGet Specifications
2+
3+
These instructions apply when creating or editing files in `doc/specs/`.
4+
5+
## Template
6+
7+
All specifications must follow the template at `doc/specs/spec-template.md`. Use the YAML front matter and all required sections. Do not omit sections — if a section is not applicable, include it with a brief explanation of why.
8+
9+
## File Naming
10+
11+
Specs are named `#<issue-id> - <Short Description>.md`. The issue ID must correspond to an existing GitHub issue in this repository.
12+
13+
Example: `#3483 - UserMessages.md`
14+
15+
## Front Matter
16+
17+
Every spec must include YAML front matter with:
18+
19+
```yaml
20+
---
21+
author: <name> <github-id>
22+
created on: <yyyy-mm-dd>
23+
last updated: <yyyy-mm-dd>
24+
issue id: <github issue id>
25+
---
26+
```
27+
28+
Update `last updated` whenever the spec is modified.
29+
30+
## Required Sections
31+
32+
Follow the template structure in order:
33+
34+
1. **Title**`# Spec Title` followed by a link to the issue: `For [#NNN](https://github.com/microsoft/winget-cli/issues/NNN)`
35+
2. **Abstract** — Brief summary of what the spec proposes. 2-3 sentences.
36+
3. **Inspiration** — Why this change is needed. Reference community feedback, issues, or limitations.
37+
4. **Solution Design** — The detailed technical design. This is the largest section. Include:
38+
- Schema changes (JSON schema snippets for manifest fields)
39+
- Client behavior (CLI commands affected and how they behave)
40+
- COM API surface changes (IDL definitions)
41+
- PowerShell cmdlet changes (affected cmdlets, interactive vs. pipeline behavior, output objects)
42+
- Settings changes (new or modified settings with JSON examples and interaction tables)
43+
- Validation pipeline impact (winget-pkgs automated validation, non-interactive behavior)
44+
- Manifest examples (YAML snippets showing real-world usage)
45+
- Flow behavior matrix (table covering all commands, interactivity modes, and edge cases)
46+
5. **UI/UX Design** — What the user sees. Include terminal output examples showing exact formatting.
47+
6. **Capabilities** — Subsections for Accessibility, Security, Reliability, Compatibility, and Performance/Power/Efficiency.
48+
7. **Potential Issues** — Known risks, trade-offs, and concerns.
49+
8. **Future Considerations** — What this enables for later. Use this for ideas that are explicitly out of scope.
50+
9. **Resources** — Links to related issues, documentation, schema files, and external references.
51+
52+
## Content Guidelines
53+
54+
### Areas of Impact
55+
56+
A complete specification should address all areas the feature touches. For WinGet, this typically includes:
57+
58+
- **CLI commands**`install`, `upgrade`, `uninstall`, `show`, `validate`, `import`, `export`
59+
- **COM API**`Microsoft.Management.Deployment` interfaces and WinRT projections
60+
- **PowerShell cmdlets**`Install-WinGetPackage`, `Update-WinGetPackage`, `Uninstall-WinGetPackage`, `Repair-WinGetPackage`, `Find-WinGetPackage`, `Show-WinGetPackage`
61+
- **Settings** — User settings in `settings.json` (see `doc/Settings.md`)
62+
- **Manifest schema** — JSON schema files in `schemas/JSON/manifests/`
63+
- **Validation** — The winget-pkgs community repository validation pipeline
64+
- **WinGet Configuration / DSC** — Declarative configuration flows
65+
- **Group Policy** — Admin policy controls if applicable
66+
67+
### Schema and Versioning
68+
69+
- Manifest schema changes require a new minor version (e.g., 1.12.0 → 1.13.0).
70+
- WinGet does not make breaking changes in 1.X releases. New fields must be additive and optional.
71+
- Older clients silently ignore unknown fields. Do not rely on older clients reading new fields.
72+
- The winget-pkgs community repository enforces schema version n or n-1 for new submissions. This is the practical mechanism that drives publisher adoption of new fields.
73+
74+
### Interactivity
75+
76+
WinGet has multiple interactivity modes that specifications must account for:
77+
78+
- **Interactive** (default) — Prompts are shown and user input is accepted.
79+
- **`--disable-interactivity`** — No prompts; operations proceed automatically.
80+
- **`--silent`** — Implies non-interactive.
81+
- **COM API** — Never prompts; returns data for the consumer to handle.
82+
- **PowerShell `-Force`** — Suppresses confirmation prompts.
83+
- **WinGet Configuration** — Inherently non-interactive.
84+
85+
### GitHub Markdown Features
86+
87+
Use GitHub alert syntax for important callouts:
88+
89+
```markdown
90+
> [!NOTE]
91+
> Supplementary information.
92+
93+
> [!IMPORTANT]
94+
> Critical information users need to know.
95+
96+
> [!WARNING]
97+
> Potential risks or dangerous actions.
98+
```
99+
100+
### Deprecation
101+
102+
When proposing a replacement for an existing field or feature:
103+
104+
- Define a phased deprecation path (Introduction → Transition → Deprecation → Removal).
105+
- Make timelines conditional on adoption telemetry, not fixed dates.
106+
- Clearly state that WinGet 1.X will not make breaking changes.
107+
- Explain that the community repository schema version policy (n/n-1) is the practical driver for adoption.
108+
109+
## Spelling
110+
111+
The repository uses `check-spelling`. If your spec introduces new words (proper names, technical terms), add them to `.github/actions/spelling/expect.txt` in alphabetical order.
112+
113+
## Pull Request
114+
115+
- Spec PRs should be created as **draft** PRs.
116+
- The PR body should include a "Related Issues" section with an unordered list of related issues (do not use "Closes" or "Fixes" — a spec does not close an issue).
117+
- Specs require review and approval before implementation begins.

0 commit comments

Comments
 (0)