Here is an overview of the main files created by the script, with a focus on those fundamental for collaboration and advanced use of Copilot/AI:
-
.github/copilot-instructions.md:
- Contains rules, conventions, and example prompts to guide Copilot and other AI agents in generating code and documentation.
- Recommended structure:
# Instructions for Copilot/AI ## Project objectives - Clearly and concisely describe what the project should do. ## Style conventions - List formatting rules, variable names, function/class structure, etc. ## Example prompts - Provide examples of comments or requests that lead to quality code generation. - Example: ```python # Write a function that calculates the average of a list of numbers ``` ## Documentation rules - How docstrings, comments, README, etc. should be written. ## Best practices for using Copilot - Tips on how to get useful suggestions and how to validate generated code.
-
.github/COMMIT_CONVENTION.md: Rules for commit messages (e.g., Conventional Commits).
-
.github/CONTRIBUTING.md: Guidelines for contributing to the project.
-
.github/PULL_REQUEST_TEMPLATE.md: Template for pull requests.
-
.github/SECURITY.md: How to report security vulnerabilities.
-
.github/CODEOWNERS: Defines code review owners.
-
.github/ISSUE_TEMPLATE/: Templates for bug reports and feature requests.
-
.gitignore: Excludes common files and folders from version control.
-
CHANGELOG.md: History of relevant changes.
-
LICENSE: Project license (e.g., MIT).
-
package.json: Base configuration for Node.js projects.
-
README.md: Main project documentation.
-
jest.config.js, setupTests.js: Configuration and setup for JavaScript/React tests.
-
pytest.ini, requirements-dev.txt: Configuration and dependencies for Python testing and development.
-
.editorconfig, .prettierrc, .eslintrc.json, .flake8: Formatting and linting rules for various languages.
Customize these files according to your team's and project's needs to get the most out of Copilot and collaboration.
This repository is designed as a template to quickly start new projects, leveraging the capabilities of GitHub Copilot.
src/— Folder for project source codedocs/— Documentation and guides.gitignore— File to exclude common files/foldersinit.sh— Automatic initialization script for the project structure and base files (see below)
The init.sh script automates the creation of the repository's base structure and all fundamental files for a new project. Specifically:
- Creates the
.github/folder with templates for issues, pull requests, contribution guidelines, security, commit conventions, and Copilot/AI instructions. - Generates common configuration files such as
.gitignore,LICENSE,CHANGELOG.md,package.json,README.md, test files (jest.config.js,setupTests.js,pytest.ini), and configuration files for formatting and linting (.editorconfig,.prettierrc,.eslintrc.json,.flake8). - Prepares templates for issues and feature requests in
.github/ISSUE_TEMPLATE/. - Creates files for managing development dependencies (
requirements-dev.txt).
Purpose: to speed up the startup of a new project by providing a complete and customizable base, ready to be adapted to specific needs.
How to use:
- Run
bash init.shfrom the repository root. - Customize the generated files according to your project's needs.
Note: You can modify the script to add/remove files or change default content.
- Click on "Use this template" on GitHub to create a new repository based on this one.
- Customize the structure according to your needs.
- Start writing code in the
src/folder.
- Write clear comments: Copilot generates better code if comments are detailed.
- Leverage suggestions: Press
Tabto accept,Escto ignore, andCtrl+Spaceto see more options. - Request complex functions: Describe what you want to achieve, Copilot can generate entire functions or classes.
- Refactoring: Use Copilot to improve existing code, not just to write new code.
- Documentation: Ask Copilot to generate docstrings or comments for your code.
# src/example.py
"""Example function generated with Copilot"""
def add(a, b):
"""Returns the sum of two numbers"""
return a + bFor questions or suggestions, open an issue!