Skip to content

Commit 3ce8256

Browse files
authored
docs(docs): add initial docs baseline (#43)
1 parent 2a41b22 commit 3ce8256

16 files changed

Lines changed: 438 additions & 44 deletions

.cursor/rules/python-template.mdc

Lines changed: 11 additions & 4 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,9 @@ task lint # Check code quality
3439
```
3540

3641
## Template Testing
42+
3743
```bash
38-
uvx cookiecutter . # Generate project
39-
pytest tests/ # Test template
44+
uvx --with gitpython cookiecutter . --no-input # Generate a default project
45+
cd $(ls -td * | head -1)
46+
task init test # Test the template
4047
```
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Contributing
22

3-
To contribute to this project, please fork the repository and open a pull request with your changes.
3+
To contribute to this project, please consider starting by [opening an issue](https://github.com/Zenable-io/ai-native-python/issues/new) to discuss the feature
4+
and its design, and reviewing our Contributors Code of Conduct [here](./.github/CODE_OF_CONDUCT.md).
45

5-
Also, see our Contributors Code of Conduct [here](./.github/CONTRIBUTING.md).
6+
Once you are ready to submit your contribution, please fork the repository and open a pull request with your changes.
67

78
## Updating the dependencies
89

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

docs/ci-cd.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
[← Back to Documentation Index](index.md)
6+
7+
## Included Workflows
8+
9+
### CI Pipeline (`.github/workflows/ci.yml`)
10+
11+
Runs on every push and pull request:
12+
13+
1. **Linting** - Python (Ruff), YAML/JSON, shell scripts, GitHub Actions
14+
2. **Testing** - Unit and integration tests with >80% coverage requirement, as well as docker builds on each supported platform
15+
3. **Security** - Vulnerability scanning (Grype), SBOM generation (Syft), secret detection
16+
17+
### Release Pipeline (`.github/workflows/release.yml`)
18+
19+
Automates semantic versioning and publishing:
20+
21+
1. Analyzes commit messages to determine version bump
22+
2. Updates version in `pyproject.toml`
23+
3. Generates changelog
24+
4. Creates GitHub release
25+
5. Pushes Docker images to Docker Hub (if enabled)
26+
27+
### PR Validation (`.github/workflows/pr.yml`)
28+
29+
Ensures pull request quality:
30+
31+
- Validates PR title follows conventional commit format
32+
- Checks all commit messages
33+
- Look for deprecations or warnings and adds them to the finalizer
34+
35+
## Configuration
36+
37+
For GitHub Actions configuration and required secrets, see the [Configuration Guide](configuration.md#post-generation-configuration).
38+
39+
### Dependency Updates
40+
41+
The generated project includes multiple dependency update mechanisms. See the [Configuration Guide](configuration.md#post-generation-configuration) for details
42+
on customizing these tools.
43+
44+
## Customization
45+
46+
Add new workflows in `.github/workflows/` for specific needs like deployment or scheduled tasks.

docs/configuration.md

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

0 commit comments

Comments
 (0)