Skip to content

Commit 4dea8a1

Browse files
committed
docs: small tweaks to copilot instructions
1 parent 91c2ee5 commit 4dea8a1

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

.github/copilot-instructions.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# Copilot instructions
22

3-
## scripts in the `gh-cli` and `scripts` directories
3+
## Scripts in the `gh-cli` and `scripts` directories
44

55
When creating or modifying scripts in the `gh-cli` and `scripts` directories:
66

77
- Ensure the script has input parameters
88
- Include input validation and meaningful error messages
99
- Ensure the script has a basic description and usage examples at the top
10-
- Make sure to paginate (`--paginate` and/or `octokit.paginate`) when retrieving results
1110
- Note any special permissions/token requirements
1211
- If modifying input parameters to a script, make sure to update the respective `README.md` in the script directory (if applicable)
1312
- Use only `2` spaces for indentation - not `4`
1413
- Do not leave any trailing whitespace at the end of lines
15-
- With `gh api` commands, prefer `--jq` versus piping to `jq` when possible
14+
- Make sure to paginate (`--paginate` and/or `octokit.paginate`) when retrieving results in any script
15+
- Prefer `--jq` flag with `gh api` over piping to `jq` when possible
1616
- Include the header `-H "X-Github-Next-Global-ID: 1"` in GraphQL queries to retrieve the new global ID format - see the [GitHub migration guide for global node IDs](https://docs.github.com/en/graphql/guides/migrating-graphql-global-node-ids) for details
1717
- Complex scripts in the `./scripts` directory should have its own folder (so a `package.json` can be included for example)
1818

19-
## README.md documentation
19+
## Documentation in README.md files
2020

2121
When adding new scripts to any directory:
2222

@@ -25,29 +25,27 @@ When adding new scripts to any directory:
2525
- Include a clear description, usage examples, and any prerequisites/notes
2626
- We don't need both usage AND an example of running the script - just one please
2727
- Use proper kebab-case naming convention for script files
28-
- Avoid short words like "repo" (use "repository"), "org" (use "organization")
29-
- Test that the entry passes `lint-readme.js` validation
28+
- Avoid abbreviations like "repo" (use "repository"), "org" (use "organization")
29+
- Test that the entry passes `lint-readme.js` validation before committing (after staging)
3030
- Don't be too verbose - keep descriptions and usage instructions concise and to the point
3131
- Don't use periods after bullet points for consistency
3232

33-
## script naming and structure
33+
## Script naming and structure
3434

3535
- Use kebab-case for all script filenames (e.g., `get-organization-repositories.sh`)
3636
- Include appropriate file extensions (.sh, .ps1, .js, .py)
3737
- Make shell scripts executable with `chmod +x`
3838
- Add shebang lines at the top of scripts (e.g., `#!/bin/bash`)
39-
- Include error handling and parameter validation
4039

41-
## API and authentication patterns
40+
## Authentication / permissions patterns
4241

43-
- Use `gh api --paginate` for GitHub CLI API calls
44-
- Include proper error handling for API rate limits and permissions
42+
- Include proper error handling for API rate limits and permission errors
4543
- Document required scopes and permissions in script comments
4644
- Use environment variables or parameters for sensitive data (never hardcode tokens)
4745
- For scripts requiring special permissions, mention this in both script comments and README
4846
- Add hostname support for GitHub Enterprise instances / ghe.com when applicable
4947

50-
## commit messages
48+
## Commit messages
5149

5250
Prefer the Conventional Commits specification:
5351

0 commit comments

Comments
 (0)