Skip to content

Commit 69680c5

Browse files
committed
docs(docs): add initial docs baseline
1 parent 2a41b22 commit 69680c5

16 files changed

Lines changed: 426 additions & 42 deletions

.cursor/rules/python-template.mdc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@ type: always
77
You are working on a cookiecutter template for generating modern Python projects.
88

99
## Critical Context
10-
This is a TEMPLATE GENERATOR. Files in `{{cookiecutter.project_name}}/` contain Jinja2 variables that must be preserved exactly as written.
10+
11+
This is a TEMPLATE GENERATOR. Files in `{{cookiecutter.project_name ...}}/` contain Jinja2 variables that must be preserved exactly as written.
1112

1213
## Tech Stack
14+
1315
- Python 3.13+ with uv package manager (NOT pip/poetry)
1416
- pytest with >80% coverage requirement
1517
- Pre-commit: ruff, pyright, refurb
1618
- Security: grype, syft
1719
- CI/CD: GitHub Actions
18-
- Versioning: CalVer or SemVer-ish
20+
21+
6. Update documentation in the docs/ directory as features are added or changed
1922

2023
## Code Standards
24+
2125
- Max line length: 120
2226
- Type hints required
2327
- Google-style docstrings
@@ -26,6 +30,7 @@ This is a TEMPLATE GENERATOR. Files in `{{cookiecutter.project_name}}/` contain
2630
- Specific exception handling
2731

2832
## Key Commands
33+
2934
```bash
3035
task init # Setup environment
3136
task build # Build project
@@ -34,7 +39,8 @@ task lint # Check code quality
3439
```
3540

3641
## Template Testing
42+
3743
```bash
38-
uvx cookiecutter . # Generate project
44+
uvx --with gitpython cookiecutter . # Generate project
3945
pytest tests/ # Test template
4046
```
File renamed without changes.

.github/copilot-instructions.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ built-in.
66
## Context
77

88
- This is a **template generator**, not a regular Python project
9-
- Files in `{{cookiecutter.project_name}}` directory contain Jinja2 template variables
9+
- Files in the `{{cookiecutter.project_name ... }}` directory contain Jinja2 template variables
1010
- The project uses `uv` as the package manager (not pip or poetry)
11-
- Python 3.13+ is the minimum requirement
12-
- The template uses python-semantic-release for automated versioning
1311

1412
## Code Conventions
1513

@@ -60,7 +58,7 @@ Common tasks are automated via Taskfile:
6058
3. Follow the established project structure
6159
4. Include appropriate error handling
6260
5. Add tests for new functionality
63-
6. Update documentation as needed
61+
6. Update documentation in the docs/ directory as features are added or changed
6462

6563
## Template-Specific Guidelines
6664

.github/etc/dictionary.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
allstar
2+
anchore
3+
buildx
24
cookiecutter
35
dependabot
46
digestabot
7+
dockerhub
8+
envrc
9+
htmlcov
10+
pylance
11+
pythonpath
512
refurb
613
skopeo
714
syft

CLAUDE.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,10 @@ This is a **template generator** that creates Python projects with:
5555
task init
5656

5757
# Run tests and linting
58-
task build test
58+
task lint build test
5959

6060
# Generate a project from template
61-
uvx cookiecutter .
62-
63-
# Test template with default values
64-
pytest tests/
61+
uvx --with gitpython cookiecutter .
6562
```
6663

6764
## When Making Changes
@@ -71,6 +68,7 @@ pytest tests/
7168
3. **Test Thoroughly**: Both template and generated projects
7269
4. **Document Changes**: Update relevant documentation
7370
5. **Security First**: No hardcoded secrets, follow OWASP guidelines
71+
6. **Maintain Documentation**: When making changes to features, update the corresponding documentation in the `docs/` folder
7472

7573
## Template Variables
7674

@@ -134,6 +132,10 @@ def test_template_generation(cookies):
134132
4. Keep dependencies updated
135133
5. Follow principle of least privilege
136134

135+
## Documentation Structure
136+
137+
The project documentation is organized in the `docs/` folder. When modifying any feature documented above, ensure the corresponding documentation is updated.
138+
137139
## Helpful Context
138140

139141
- The template is designed for "vibe coding" - AI assistants should understand patterns without verbose prompts

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
To contribute to this project, please fork the repository and open a pull request with your changes.
44

5-
Also, see our Contributors Code of Conduct [here](./.github/CONTRIBUTING.md).
5+
Also, see our Contributors Code of Conduct [here](./.github/CODE_OF_CONDUCT.md).
66

77
## Updating the dependencies
88

README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Make your tools meet every requirement on the first pass, letting you ship faste
1919
- 📦 Ensure usability across all major platforms with multi-platform Docker builds
2020
- 🔄 Automated versioning and releasing with `python-semantic-release`
2121

22-
For FAQs including release workflow troubleshooting, see our [FAQ documentation](./FAQ.md)
22+
For more details, see our [documentation](docs/index.md).
2323

2424
## Getting Started
2525

@@ -61,13 +61,3 @@ git checkout -b initial-content
6161
# Check for `NotImplementedError`s and address them as a part of adding your business logic
6262
grep -r NotImplementedError *
6363
```
64-
65-
### Optional setup
66-
67-
If you'd like to support license file checking locally, you will need to install `grant` and put it in your `PATH`
68-
69-
Additionally, if you'd like to use SSH instead of HTTPS to connect to the `ai-native-python` project, use this command instead:
70-
71-
```bash
72-
uvx --with gitpython cookiecutter git+ssh://git@github.com/zenable-io/ai-native-python.git
73-
```

docs/ai-ide-support.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# AI IDE Support
2+
3+
The AI-Native Python template includes configuration files to work seamlessly with AI-powered development tools.
4+
5+
## Tool-agnostic configurations
6+
7+
### .mcp.json
8+
9+
Model Context Protocol configuration pre-set to integrate with:
10+
11+
- [Zenable](https://zenable.io)'s MCP server
12+
- [Context7](https://context7.com/)'s MCP server
13+
14+
## Specific IDE configurations
15+
16+
### Claude Code
17+
18+
Every generated project includes a `CLAUDE.md` file with:
19+
20+
- Project-specific context and guidelines
21+
- Technology stack information
22+
- Code style rules and patterns
23+
- Common tasks and workflows
24+
25+
### GitHub Copilot Configuration
26+
27+
The template includes `.github/copilot-instructions.md` with:
28+
29+
- Project-specific context for GitHub Copilot
30+
- Code conventions and patterns
31+
- Testing requirements and workflow
32+
- Security considerations
33+
- Common code patterns and examples
34+
- Task automation commands
35+
36+
### Cursor IDE Configuration
37+
38+
The template includes `.cursor/rules/` directory with:
39+
40+
- `project.mdc`: Always-active rules with project info, tech stack, and key commands
41+
- `testing.mdc`: Auto-attached rules for test files with testing guidelines and patterns
42+
43+
For more details on testing configuration and practices, see the [Testing Guide](testing.md).

docs/ci-cd.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# CI/CD Workflows
2+
3+
The AI-Native Python template includes GitHub Actions workflows for automated testing, security scanning, and release management.
4+
5+
## Included Workflows
6+
7+
### CI Pipeline (`.github/workflows/ci.yml`)
8+
9+
Runs on every push and pull request:
10+
11+
1. **Linting** - Python (Ruff), YAML/JSON, shell scripts, GitHub Actions
12+
2. **Testing** - Unit and integration tests with >80% coverage requirement
13+
3. **Security** - Vulnerability scanning (Grype), SBOM generation (Syft), secret detection
14+
4. **Docker** - Optional multi-platform builds with security scanning
15+
16+
### Release Pipeline (`.github/workflows/release.yml`)
17+
18+
Automates semantic versioning and publishing:
19+
20+
1. Analyzes commit messages to determine version bump
21+
2. Updates version in `pyproject.toml`
22+
3. Generates changelog
23+
4. Creates GitHub release
24+
5. Pushes Docker images (if enabled)
25+
26+
### PR Validation (`.github/workflows/pr.yml`)
27+
28+
Ensures pull request quality:
29+
- Validates PR title follows conventional commit format
30+
- Checks all commit messages
31+
- Enforces branch protection rules
32+
33+
## Configuration
34+
35+
For GitHub Actions configuration and required secrets, see the [Configuration Guide](configuration.md#post-generation-configuration).
36+
37+
For Docker Hub setup specifically, if enabled during project generation, you'll need to set:
38+
- `DOCKERHUB_USERNAME`
39+
- `DOCKERHUB_PAT`
40+
41+
### Dependency Updates
42+
43+
The generated project includes multiple dependency update mechanisms. See the [Configuration Guide](configuration.md#post-generation-configuration) for details
44+
on customizing these tools.
45+
46+
## Customization
47+
48+
### Custom Workflows
49+
50+
Add new workflows in `.github/workflows/` for specific needs like deployment or scheduled tasks.

docs/configuration.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Configuration Guide
2+
3+
This guide covers the configuration options available in the AI-Native Python cookiecutter template.
4+
5+
## Cookiecutter Variables
6+
7+
When generating a new project, you'll be prompted for the following configuration options:
8+
9+
### Basic Project Information
10+
11+
| Variable | Description | Default | Example |
12+
| --------------------------- | -------------------------------- | -------------- | --------------------------- |
13+
| `project_name` | Human-readable project name | (required) | "My Awesome Project" |
14+
| `project_slug` | Python package name (snake_case) | Auto-generated | "my_awesome_project" |
15+
| `project_short_description` | Brief project description | (required) | "A tool for awesome things" |
16+
17+
### Organization Details
18+
19+
| Variable | Description | Default | Example |
20+
| ------------------------------- | ------------------------------- | ---------- | ----------- |
21+
| `company_name` | Your organization's name | (required) | "Acme Corp" |
22+
| `company_domain` | Your organization's domain | (required) | "acme.com" |
23+
| `github_org` | GitHub organization or username | (required) | "acme-corp" |
24+
| `project_owner_github_username` | Project owner's GitHub username | (required) | "johndoe" |
25+
26+
### Technical Options
27+
28+
| Variable | Description | Default | Options |
29+
| ---------------- | ---------------------------- | ------- | ----------------------------- |
30+
| `python_version` | Minimum Python version | "3.13" | "3.11", "3.12", "3.13" |
31+
| `dockerhub` | Enable Docker Hub publishing | "no" | "yes", "no" |
32+
| `public` | Make repository public | "yes" | "yes", "no" |
33+
| `license` | Project license | "NONE" | "NONE", "MIT", "BSD-3-Clause" |
34+
35+
## Post-Generation Configuration
36+
37+
After your project is generated, you are able to make any changes you'd like. Here are some common modifications:
38+
39+
### Environment Variables
40+
41+
Create or modify the `.envrc` file in your project root:
42+
43+
```bash
44+
# API Keys
45+
export ZENABLE_API_KEY="your-api-key-here"
46+
47+
# Development settings
48+
export PYTHONPATH="${PWD}/src:${PYTHONPATH}"
49+
export UV_PYTHON_PREFERENCE="only-system"
50+
```
51+
52+
### Task Configuration
53+
54+
The `Taskfile.yml` in your project defines common development tasks. You can customize anything you'd like, such as:
55+
56+
- Python versions
57+
- Linting and cleanup tasks
58+
- Build configurations
59+
60+
Example task customization:
61+
62+
```yaml
63+
vars:
64+
IMAGE_NAME: "abc123" # Change the name of the docker image
65+
PYTHON_VERSION: "3.13" # Change default Python version
66+
```
67+
68+
### Pre-commit Hooks
69+
70+
For detailed information about pre-commit hooks configuration and available hooks, see the [Hooks Guide](hooks.md#pre-commit-hooks).
71+
72+
### GitHub Actions Configuration
73+
74+
For detailed information about CI/CD workflows and customization options, see the [CI/CD Guide](ci-cd.md).
75+
76+
#### Required Secrets
77+
78+
If you enabled Docker Hub publishing:
79+
- `DOCKERHUB_USERNAME`
80+
- `DOCKERHUB_PAT`
81+
82+
These will be printed as a reminder after project generation.

0 commit comments

Comments
 (0)