|
| 1 | +# Contributing to GitHub Copilot Template |
| 2 | + |
| 3 | +Thank you for your interest in contributing to this repository! This document provides clear guidelines on what contributions we accept and how to submit them. |
| 4 | + |
| 5 | +## Purpose of This Repository |
| 6 | + |
| 7 | +This repository is an **educational GitHub Template** created by Capgemini's AI & Software Engineering team. It provides practical, portable, and thoroughly documented examples of GitHub Copilot configuration for real-world projects. |
| 8 | + |
| 9 | +**Key Principle**: All prompt content must be thoroughly commented to explain the prompting techniques, design rationale, and expected behaviors. |
| 10 | + |
| 11 | +## What We Accept |
| 12 | + |
| 13 | +We welcome the following types of contributions: |
| 14 | + |
| 15 | +### ✅ New Custom Prompts (Educational Examples Only) |
| 16 | + |
| 17 | +- **Accepted**: New custom prompts, chat modes, or instructions that demonstrate prompting techniques and repository setup patterns |
| 18 | +- **Required**: Comprehensive inline comments explaining: |
| 19 | + - The prompting technique being demonstrated |
| 20 | + - Design rationale and reinforcement strategies |
| 21 | + - Expected behavior and outcomes |
| 22 | + - Example usage scenarios |
| 23 | +- **Not Accepted**: Generic prompt libraries without educational value or thorough documentation |
| 24 | + |
| 25 | +**Example**: A new chat mode that demonstrates a specific prompting pattern (e.g., chain-of-thought reasoning) with detailed comments explaining how and why it works. |
| 26 | + |
| 27 | +### ✅ Corrections to Existing Configuration/Prompts |
| 28 | + |
| 29 | +- Typo fixes in documentation or prompts |
| 30 | +- Corrections for changes in GitHub Copilot functionality |
| 31 | +- Bug fixes in example code or configurations |
| 32 | +- Clarity improvements in comments or explanations |
| 33 | + |
| 34 | +### ✅ Enhancements to Existing Configuration/Prompts |
| 35 | + |
| 36 | +- Improved prompting techniques with clear documentation |
| 37 | +- Better reinforcement strategies with explanations |
| 38 | +- Additional examples demonstrating edge cases |
| 39 | +- Performance or clarity improvements |
| 40 | +- Enhanced comments and educational content |
| 41 | + |
| 42 | +### ✅ Documentation Enhancements |
| 43 | + |
| 44 | +- Improvements to README files |
| 45 | +- Better explanations of existing features |
| 46 | +- Additional usage examples |
| 47 | +- Clearer architectural documentation |
| 48 | +- Updates to align with current GitHub Copilot features |
| 49 | + |
| 50 | +### ✅ Repository Configuration Enhancements |
| 51 | + |
| 52 | +- Improvements to GitHub Actions workflows |
| 53 | +- Better CI/CD processes |
| 54 | +- Enhanced development tooling |
| 55 | +- Improved repository templates and structures |
| 56 | + |
| 57 | +## What We Don't Accept |
| 58 | + |
| 59 | +### ❌ Undocumented Prompts |
| 60 | + |
| 61 | +Prompts without thorough inline comments explaining the techniques used will not be accepted. |
| 62 | + |
| 63 | +### ❌ Generic Prompt Libraries |
| 64 | + |
| 65 | +This is not a collection of general-purpose prompts. We only accept prompts that serve as educational examples demonstrating specific techniques. |
| 66 | + |
| 67 | +### ❌ Breaking Changes Without Discussion |
| 68 | + |
| 69 | +Major changes to existing configurations should be discussed in an issue before submission. |
| 70 | + |
| 71 | +## How to Contribute |
| 72 | + |
| 73 | +### 1. Before You Start |
| 74 | + |
| 75 | +- **Check existing issues**: Look for related issues or discussions |
| 76 | +- **Review documentation**: Familiarize yourself with the repository structure and existing patterns |
| 77 | +- **Read SSOT files**: Understand the authoritative guidelines in: |
| 78 | + - `.github/copilot-instructions.md` - Core policies and workflow |
| 79 | + - `.github/instructions/docs.instructions.md` - Documentation standards |
| 80 | + - `.github/chatmodes/README.md` - Chat mode authoring guide |
| 81 | + - `README.md` - Repository overview and SSOT source map |
| 82 | + |
| 83 | +### 2. Create an Issue (Recommended) |
| 84 | + |
| 85 | +For significant contributions: |
| 86 | + |
| 87 | +1. Create an issue describing your proposed contribution |
| 88 | +2. Wait for feedback from maintainers |
| 89 | +3. Proceed once you have general agreement |
| 90 | + |
| 91 | +For minor fixes (typos, small corrections): |
| 92 | + |
| 93 | +- You can proceed directly to creating a pull request |
| 94 | + |
| 95 | +### 3. Development Workflow |
| 96 | + |
| 97 | +Follow the repository's trunk-based development workflow: |
| 98 | + |
| 99 | +#### Branch Creation |
| 100 | + |
| 101 | +Create a feature branch following our naming conventions: |
| 102 | + |
| 103 | +```bash |
| 104 | +git checkout -b <type>/<brief-description> |
| 105 | +``` |
| 106 | + |
| 107 | +**Branch Types**: |
| 108 | + |
| 109 | +- `feature/` - New features or enhancements |
| 110 | +- `fix/` - Bug fixes |
| 111 | +- `docs/` - Documentation updates |
| 112 | +- `refactor/` - Code refactoring |
| 113 | +- `test/` - Test additions or modifications |
| 114 | +- `chore/` - Maintenance tasks |
| 115 | + |
| 116 | +**Examples**: |
| 117 | + |
| 118 | +- `feature/add-security-chatmode` |
| 119 | +- `fix/typo-in-developer-mode` |
| 120 | +- `docs/improve-contributing-guide` |
| 121 | + |
| 122 | +#### Making Changes |
| 123 | + |
| 124 | +1. **Keep changes focused**: One logical change per pull request |
| 125 | +2. **Small commits**: Make frequent, small commits with clear messages |
| 126 | +3. **Follow conventions**: Use conventional commit format: |
| 127 | + |
| 128 | + ```text |
| 129 | + <type>: <subject> |
| 130 | + |
| 131 | + [optional body] |
| 132 | + |
| 133 | + [optional footer] |
| 134 | + ``` |
| 135 | + |
| 136 | +**Commit Types**: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore` |
| 137 | + |
| 138 | +**Examples**: |
| 139 | + |
| 140 | +- `feat: Add security-focused chat mode with threat modeling` |
| 141 | +- `fix: Correct typo in Developer.chatmode.md` |
| 142 | +- `docs: Improve explanation of prompting techniques` |
| 143 | + |
| 144 | +#### Adding Comments to Prompts |
| 145 | + |
| 146 | +When creating or modifying prompts, **always include**: |
| 147 | + |
| 148 | +```markdown |
| 149 | +<!-- |
| 150 | +PURPOSE: [What this section accomplishes] |
| 151 | +PROMPTING TECHNIQUE: [The technique being demonstrated] |
| 152 | +REINFORCEMENT STRATEGY: [How the instruction is reinforced] |
| 153 | +DESIGN RATIONALE: [Why this approach was chosen] |
| 154 | +--> |
| 155 | +``` |
| 156 | + |
| 157 | +**Example**: |
| 158 | + |
| 159 | +```markdown |
| 160 | +<!-- |
| 161 | +PURPOSE: Ensure consistent error handling across the codebase |
| 162 | +PROMPTING TECHNIQUE: XML semantic tags for critical requirements |
| 163 | +REINFORCEMENT STRATEGY: |
| 164 | +1. Bold formatting for emphasis |
| 165 | +2. Concrete examples with ✅/❌ markers |
| 166 | +3. Cross-references to SSOT documentation |
| 167 | +DESIGN RATIONALE: Machine-parseable blocks enable AI to recognize |
| 168 | +non-negotiable requirements while maintaining human readability |
| 169 | +--> |
| 170 | +``` |
| 171 | + |
| 172 | +### 4. Submit a Pull Request |
| 173 | + |
| 174 | +1. **Push your branch**: `git push origin <type>/<brief-description>` |
| 175 | +2. **Create PR**: Open a pull request with a clear title matching your branch name format |
| 176 | +3. **Complete PR template**: Fill out all sections of the pull request template |
| 177 | +4. **Link issues**: Reference any related issues using `Fixes #123` or `Closes #456` |
| 178 | + |
| 179 | +#### Pull Request Requirements |
| 180 | + |
| 181 | +Your PR must include: |
| 182 | + |
| 183 | +- **Clear description**: Explain what changed and why |
| 184 | +- **Educational value**: For new prompts, explain what technique is demonstrated |
| 185 | +- **Documentation**: Update relevant README files or documentation |
| 186 | +- **No duplication**: Link to SSOT files instead of duplicating content |
| 187 | +- **Thorough comments**: All prompt content must be well-commented |
| 188 | +- **Small scope**: Keep PRs focused (target ≤ 400 lines when possible) |
| 189 | + |
| 190 | +### 5. Review Process |
| 191 | + |
| 192 | +1. **Automated checks**: Ensure all CI checks pass (markdown lint, link checker, etc.) |
| 193 | +2. **Maintainer review**: At least one maintainer approval required |
| 194 | +3. **Address feedback**: Respond to review comments and make requested changes |
| 195 | +4. **Approval**: Once approved, your PR will be merged |
| 196 | + |
| 197 | +## Code Review Standards |
| 198 | + |
| 199 | +Reviewers will evaluate: |
| 200 | + |
| 201 | +- **Educational quality**: Are prompting techniques well-explained? |
| 202 | +- **Documentation**: Are comments thorough and helpful? |
| 203 | +- **Consistency**: Does the contribution align with existing patterns? |
| 204 | +- **SSOT adherence**: Are references used instead of duplication? |
| 205 | +- **Functionality**: For configurations, do they work as intended? |
| 206 | + |
| 207 | +For detailed review criteria, see `docs/engineering/code-review-guidelines.md`. |
| 208 | + |
| 209 | +## Contribution Types Reference |
| 210 | + |
| 211 | +### Priority Levels |
| 212 | + |
| 213 | +When contributing, consider these priority levels: |
| 214 | + |
| 215 | +- **High**: Corrections to broken functionality, critical documentation fixes |
| 216 | +- **Medium**: Enhancements to existing features, new educational examples |
| 217 | +- **Low**: Nice-to-have improvements, additional documentation |
| 218 | + |
| 219 | +## Getting Help |
| 220 | + |
| 221 | +- **Questions**: Open an issue with the `question` label |
| 222 | +- **Discussions**: Use GitHub Discussions for broader topics |
| 223 | +- **Bugs**: Open an issue with the `bug` label |
| 224 | +- **Feature requests**: Open an issue with the `enhancement` label |
| 225 | + |
| 226 | +## Repository Structure |
| 227 | + |
| 228 | +Familiarize yourself with the repository organization: |
| 229 | + |
| 230 | +```text |
| 231 | +.github/ |
| 232 | +├── chatmodes/ # Custom chat mode definitions |
| 233 | +├── instructions/ # Domain-specific instruction files |
| 234 | +├── prompts/ # Reusable prompt templates |
| 235 | +└── workflows/ # GitHub Actions workflows |
| 236 | +
|
| 237 | +docs/ |
| 238 | +├── ADRs/ # Architectural Decision Records |
| 239 | +├── PRDs/ # Product Requirements Documents |
| 240 | +├── design/ # Design documentation |
| 241 | +└── engineering/ # Engineering guidelines |
| 242 | +
|
| 243 | +plans/ # Project planning documents |
| 244 | +``` |
| 245 | + |
| 246 | +## Style Guidelines |
| 247 | + |
| 248 | +### Documentation |
| 249 | + |
| 250 | +- Use clear, concise language |
| 251 | +- Include concrete examples |
| 252 | +- Follow the structure in `.github/instructions/docs.instructions.md` |
| 253 | +- Use proper Markdown formatting |
| 254 | +- Avoid emojis in formal documentation (except in this guide for visual clarity) |
| 255 | + |
| 256 | +### Prompts and Chat Modes |
| 257 | + |
| 258 | +- Include comprehensive HTML comments |
| 259 | +- Explain prompting techniques explicitly |
| 260 | +- Provide both positive and negative examples |
| 261 | +- Use consistent formatting and structure |
| 262 | +- Reference SSOT files instead of duplicating content |
| 263 | + |
| 264 | +### Code Examples |
| 265 | + |
| 266 | +- Follow the language-specific guidelines in `.github/instructions/` |
| 267 | +- Include comments explaining non-obvious logic |
| 268 | +- Provide context for why the example demonstrates the concept |
| 269 | + |
| 270 | +## Attribution |
| 271 | + |
| 272 | +We appreciate all contributors! Your contributions will be recognized in: |
| 273 | + |
| 274 | +- Git commit history |
| 275 | +- Release notes (for significant contributions) |
| 276 | +- GitHub's contributor tracking |
| 277 | + |
| 278 | +## License |
| 279 | + |
| 280 | +By contributing, you agree that your contributions will be licensed under the same license as this repository. |
| 281 | + |
| 282 | +## Questions? |
| 283 | + |
| 284 | +If you have questions about contributing, please: |
| 285 | + |
| 286 | +1. Check this guide and the referenced SSOT documents |
| 287 | +2. Review existing contributions for examples |
| 288 | +3. Open an issue with your question |
| 289 | + |
| 290 | +Thank you for helping make this repository a valuable educational resource! |
0 commit comments