Set of instructions for setting up community health files in a GitHub repository using a Python script.
- Copy the provided template-todo.md file to your repository.
- Use your preferred text editor to fill in the placeholders in the template file with your project's specific information, such as project name, owner name, contact email, etc.
- Tell your agent to create a Python script named setup_repo.py using the provided code instructions.
- Run the setup_repo.py script in your repository's root directory to automatically generate the necessary community health files and GitHub workflows.
- Verify that the files have been created correctly and contain the appropriate information for your project.
- Commit and push the changes to your GitHub repository to make the community health files available to contributors and users, if your agent is unable to do so.
- If needed, customize the generated files further to better fit your project's needs.
Ensure you have Python installed on your system to run the setup_repo.py script, and that you have the necessary permissions to create files in the repository. This is a work in progress and may require adjustments based on your specific project requirements and environment.
If you need further assistance, feel free to ask! If you are really grateful, consider leaving a tip: https://paypal.me/darkflib or github.com/sponsors/darkflib
Example run:
I'll help you execute this template spec in the `template-test/` directory.
First, let me check the current state of that directory and then implement the template creation.
Read [](file:///c%3A/Users/mike/template-test)
Great! The directory is empty. Now I'll create a Python script to execute the template spec.
This will be easier than trying to do everything manually. Let me create an implementation script:
Created [](file:///c%3A/Users/mike/template-test/setup_repo.py)
Now let me run the script to set up all the community health files:
Ran terminal command: cd /mnt/c/Users/mike/template-test && python3 setup_repo.py
Perfect! 🎉 The setup has been completed successfully. Let me show you what was created:
Ran terminal command: cd /mnt/c/Users/mike/template-test && tree -L 3 -a
Excellent! Let me also show you what's in the git commit:
Ran terminal command: cd /mnt/c/Users/mike/template-test &&
git log --oneline && echo -e "\n--- Files created ---" && git ls-files
Perfect! 🎉 The template has been successfully executed!
Here's what was created in `template-test/`:
## ✅ Successfully Created (24 files):
### 📄 Root Documentation
* LICENSE - MIT license
* README.md - Main project documentation with badges
* CODE_OF_CONDUCT.md - Contributor Covenant v2.1
* CONTRIBUTING.md - Contribution guidelines
* SECURITY.md - Security policy and vulnerability reporting
* SUPPORT.md - Support and help resources
* CHANGELOG.md - Keep a Changelog format
* CITATION.cff - Academic citation metadata
### 🔧 Configuration Files
* .editorconfig - Editor configuration
* .gitattributes - Git attributes for line endings
* .gitignore - Python-specific gitignore
* pyproject.toml - Python project configuration with uv support
### 📁 .github/ Directory
**Issue Templates:**
* `bug_report.yml` - Structured bug report form
* `feature_request.yml` - Feature request form
* `config.yml` - Issue template configuration
**Other:**
* `CODEOWNERS` - Code ownership rules
* `FUNDING.yml` - Funding/sponsorship links
* `PULL_REQUEST_TEMPLATE.md` - PR template
* `dependabot.yml` - Dependabot configuration
* `release-drafter.yml` - Release notes automation config
**Workflows:**
* `ci.yml` - CI pipeline (lint, format, test)
* `codeql.yml` - Security scanning
* `release-drafter.yml` - Automated release notes
### 🧪 Tests
* test_smoke.py - Basic smoke tests
### 🚀 Git Repository
* Initialized with `main` branch
* All files committed with message: `chore: add community files and secure defaults`
## 📋 Next Steps:
1. **Review the generated files** - All templates have been populated with your configuration
2. **Create GitHub repository** (if not already done):
```bash
gh repo create Darkflib/template-test --public --source=. --remote=origin
```
3. **Push to GitHub**:
```bash
git push -u origin main
```
4. **Apply GitHub security settings** (run these commands):
```bash
export OWNER=Darkflib
export REPO=template-test
# Enable security features
gh api -X PUT repos/${OWNER}/${REPO}/vulnerability-alerts
gh api -X PATCH repos/${OWNER}/${REPO} \
-f "security_and_analysis[secret_scanning][status]=enabled" \
-f "security_and_analysis[secret_scanning_push_protection][status]=enabled"
# Configure merge settings
gh api -X PATCH repos/${OWNER}/${REPO} \
-f allow_squash_merge=true \
-f allow_merge_commit=false \
-f allow_rebase_merge=false \
-f delete_branch_on_merge=true
```
All files follow the spec from your template-todo.md file! 🎯