Skip to content

Commit 91c2ee5

Browse files
docs: update copilot instructions (#131)
* docs: update copilot instructions * docs: update copilot instructions * docs: clarify pagination instructions in copilot guidelines * docs: add note about folder structure for complex scripts in copilot instructions
1 parent 3c68761 commit 91c2ee5

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

.github/copilot-instructions.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22

33
## scripts in the `gh-cli` and `scripts` directories
44

5-
When creating or modifying scripts in the `gh-cli` directory, ensure:
5+
When creating or modifying scripts in the `gh-cli` and `scripts` directories:
66

7-
- The script has input parameters
8-
- The script has a basic description and usage examples at the top
9-
- We make sure to paginate (`--paginate`) when retrieving results
7+
- Ensure the script has input parameters
8+
- Include input validation and meaningful error messages
9+
- 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
1011
- Note any special permissions/token requirements
1112
- If modifying input parameters to a script, make sure to update the respective `README.md` in the script directory (if applicable)
1213
- Use only `2` spaces for indentation - not `4`
1314
- Do not leave any trailing whitespace at the end of lines
15+
- With `gh api` commands, prefer `--jq` versus piping to `jq` when possible
16+
- 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
17+
- Complex scripts in the `./scripts` directory should have its own folder (so a `package.json` can be included for example)
1418

1519
## README.md documentation
1620

@@ -23,8 +27,10 @@ When adding new scripts to any directory:
2327
- Use proper kebab-case naming convention for script files
2428
- Avoid short words like "repo" (use "repository"), "org" (use "organization")
2529
- Test that the entry passes `lint-readme.js` validation
30+
- Don't be too verbose - keep descriptions and usage instructions concise and to the point
31+
- Don't use periods after bullet points for consistency
2632

27-
## Script naming and structure
33+
## script naming and structure
2834

2935
- Use kebab-case for all script filenames (e.g., `get-organization-repositories.sh`)
3036
- Include appropriate file extensions (.sh, .ps1, .js, .py)
@@ -39,3 +45,27 @@ When adding new scripts to any directory:
3945
- Document required scopes and permissions in script comments
4046
- Use environment variables or parameters for sensitive data (never hardcode tokens)
4147
- For scripts requiring special permissions, mention this in both script comments and README
48+
- Add hostname support for GitHub Enterprise instances / ghe.com when applicable
49+
50+
## commit messages
51+
52+
Prefer the Conventional Commits specification:
53+
54+
- Format: `<type>(<scope>): <description>`
55+
- Types:
56+
- `feat`: New feature
57+
- `fix`: Bug fix
58+
- `refactor`: Code change that neither fixes a bug nor adds a feature
59+
- `docs`: Documentation only changes
60+
- `chore`: Changes to build process or auxiliary tools
61+
- `ci`: Changes to CI configuration files and scripts
62+
- `style`: Code style changes (formatting, missing semicolons, etc.)
63+
- `test`: Adding or updating tests
64+
- Scopes (optional):
65+
- `scripts`: Changes in the scripts directory
66+
- `gh-cli`: Changes in the gh-cli directory
67+
- `ci`: Changes to CI/linting tools
68+
- Description: Short, imperative tense summary (e.g., "add feature" not "added feature")
69+
- Body (optional): Provide additional context with bullet points
70+
- Keep it concise but descriptive
71+
- Append `!` to the type if it's a breaking change (e.g., `feat!: add additional required input parameters`)

0 commit comments

Comments
 (0)