Skip to content

Commit 7122893

Browse files
ZenableAutomationJonZeolla
authored andcommitted
feat(project): initial project generation
0 parents  commit 7122893

50 files changed

Lines changed: 4913 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursor/rules/project.mdc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
type: always
2+
3+
---
4+
5+
# todo-app Project Rules
6+
7+
You are working on todo-app, a Python application built with modern best practices.
8+
9+
## Project Info
10+
- Description: An application for managing TODOs
11+
- Company: Labworks
12+
- Python 3.13+
13+
- Package manager: uv (NOT pip/poetry)
14+
15+
## Tech Stack
16+
- Testing: pytest (>80% coverage)
17+
- Linting: ruff, pyright, refurb
18+
- Security: grype, syft
19+
- Docker: Multi-platform builds
20+
- CI/CD: GitHub Actions
21+
22+
## Code Requirements
23+
- Max line: 120 chars
24+
- Type hints required
25+
- Google-style docstrings
26+
- pathlib only (no os.path)
27+
- logging only (no print)
28+
- Specific exceptions
29+
30+
## Key Commands
31+
```bash
32+
task init # Setup
33+
task build test # Before commits
34+
task docker-build # Build container
35+
task release # Release
36+
```
37+
38+
## Important
39+
Look for `NotImplementedError` markers - implement these with business logic.

.cursor/rules/testing.mdc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
type: auto-attached
2+
pattern: "**/*test*.py"
3+
4+
---
5+
6+
# Testing Guidelines
7+
8+
## Test Structure
9+
- Unit tests in `tests/unit/`
10+
- Integration tests in `tests/integration/`
11+
- Use pytest fixtures for setup
12+
- Mark tests: `@pytest.mark.unit` or `@pytest.mark.integration`
13+
14+
## Coverage Requirements
15+
- Minimum 80% coverage
16+
- Run with: `task test`
17+
- View report: `open htmlcov/index.html`
18+
19+
## Test Patterns
20+
```python
21+
import pytest
22+
from todo_app.module import function
23+
24+
def test_function_success():
25+
"""Test successful case."""
26+
result = function(valid_input)
27+
assert result == expected
28+
29+
def test_function_error():
30+
"""Test error handling."""
31+
with pytest.raises(SpecificError):
32+
function(invalid_input)
33+
34+
@pytest.fixture
35+
def sample_data():
36+
"""Provide test data."""
37+
return {"key": "value"}
38+
```

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Ignore everything
2+
**
3+
4+
# Except the bare minimum
5+
!pyproject.toml
6+
!uv.lock
7+
!src/**

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Enforce LF line endings for files that must not have CRLF.
2+
# Without this, Windows `git checkout` converts to CRLF, which breaks bash
3+
# scripts with errors like: ': invalid option namesh: line 2: set: pipefail'
4+
*.sh text eol=lf
5+
Dockerfile text eol=lf
6+
Dockerfile.* text eol=lf
7+
Makefile text eol=lf
8+
*.yml text eol=lf
9+
*.yaml text eol=lf

.github/.grant.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
rules:
2+
- pattern: "*"
3+
name: "Block AGPL licenses"
4+
mode: "block"
5+
reason: "AGPL licenses are not allowed in this project"
6+
licenses:
7+
- "agpl"
8+
- "agpl-1.0"
9+
- "agpl-1.0-only"
10+
- "agpl-1.0-or-later"
11+
- "agpl-3.0"
12+
- "agpl-3.0-only"
13+
- "agpl-3.0-or-later"

.github/CODEOWNERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Repository owner
2+
* @jonzeolla
3+
4+
# GitHub automation oversight
5+
.github/** @jonzeolla
6+
7+
# Sensitive files
8+
LICENSE @jonzeolla
9+
SECURITY.md @jonzeolla

.github/ISSUE_TEMPLATE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Summary of the issue
2+
3+
## Expected behavior
4+
5+
## Steps to reproduce
6+
7+
## Your environment
8+
9+
## Logs and error messages

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Contributor Comments
2+
3+
## Pull Request Checklist
4+
5+
Thank you for submitting a contribution to todo-app!
6+
7+
Please address the following items:
8+
9+
- [ ] If you are adding a dependency, please explain how it was chosen.
10+
- [ ] If manual testing is needed in order to validate the changes, provide a testing plan and the expected results.
11+
- [ ] Validate that documentation is accurate and aligned to any project updates or additions.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
name: 'Bootstrap the repository'
3+
description: 'Sets up uv, adds Homebrew to PATH, installs Task, and initializes the repository'
4+
inputs:
5+
token:
6+
description: 'A Github token'
7+
required: true
8+
python-version:
9+
description: 'Python version to use'
10+
required: false
11+
default: '3.13'
12+
working-directory:
13+
description: 'The working directory'
14+
required: false
15+
default: '.'
16+
runs:
17+
using: 'composite'
18+
steps:
19+
- name: Create run_script for running scripts downstream
20+
shell: 'bash --noprofile --norc -Eeuo pipefail {0}'
21+
working-directory: ${{ inputs.working-directory }}
22+
run: |
23+
run_script="uv run --frozen"
24+
echo "run_script=${run_script}" | tee -a "${GITHUB_ENV}"
25+
26+
- name: Setup uv
27+
uses: astral-sh/setup-uv@v7
28+
with:
29+
enable-cache: true
30+
cache-dependency-glob: "**/uv.lock"
31+
python-version: ${{ inputs.python-version }}
32+
33+
- name: Install Task
34+
uses: go-task/setup-task@v2
35+
with:
36+
# Passing a repo token reduces the likelihood of API rate limit exceeded
37+
repo-token: ${{ inputs.token }}
38+
39+
- name: Add Homebrew to the path
40+
shell: 'bash --noprofile --norc -Eeuo pipefail {0}'
41+
# This ensures compatibility with macOS runners and Linux runners with Homebrew
42+
run: |
43+
# Check if we're on macOS
44+
if [[ "$RUNNER_OS" == "macOS" ]]; then
45+
# macOS homebrew locations
46+
if [[ -d "/opt/homebrew/bin" ]]; then
47+
PATH="${PATH}:/opt/homebrew/bin"
48+
elif [[ -d "/usr/local/bin" ]]; then
49+
PATH="${PATH}:/usr/local/bin"
50+
fi
51+
else
52+
# Linux homebrew location
53+
if [[ -d "/home/linuxbrew/.linuxbrew/bin" ]]; then
54+
PATH="${PATH}:/home/linuxbrew/.linuxbrew/bin"
55+
fi
56+
fi
57+
58+
export PATH
59+
echo "PATH=${PATH}" | tee -a "${GITHUB_ENV}"
60+
61+
# Smoke test - don't fail if brew isn't available
62+
if command -v brew &> /dev/null; then
63+
echo "Homebrew found at: $(which brew)"
64+
brew --version
65+
else
66+
echo "Homebrew not found, continuing without it"
67+
fi
68+
working-directory: ${{ inputs.working-directory }}
69+
70+
- name: Set Python hash for caching
71+
shell: 'bash --noprofile --norc -Eeuo pipefail {0}'
72+
run: |
73+
# Create a hash of the Python version for better cache keys
74+
echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" | tee -a "${GITHUB_ENV}"
75+
76+
- name: Cache pre-commit environments
77+
uses: actions/cache@v5
78+
with:
79+
path: ~/.cache/pre-commit
80+
key: pre-commit|${{ env.PY }}|${{ hashFiles(format('{0}/.pre-commit-config.yaml', inputs.working-directory)) }}
81+
82+
- name: Initialize the repository
83+
working-directory: ${{ inputs.working-directory }}
84+
shell: 'bash --noprofile --norc -Eeuo pipefail {0}'
85+
run: task -v init

.github/copilot-instructions.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# GitHub Copilot Instructions for todo-app
2+
3+
You are working on a Python project that was generated from the AI-Native Python template. This project follows modern Python development best practices.
4+
5+
## Context
6+
7+
- **Project**: todo-app
8+
- **Description**: An application for managing TODOs
9+
- **Company**: Labworks
10+
- **Python Version**: 3.13+
11+
- **Package Manager**: uv and uvx (not pip, poetry, or pipx)
12+
13+
## Code Conventions
14+
15+
1. **Imports**: Use absolute imports only
16+
2. **Type Hints**: Always include type hints for function parameters and return values
17+
3. **Docstrings**: Use Google-style docstrings for all public functions and classes
18+
4. **Error Handling**: Raise specific exceptions with descriptive messages
19+
5. **Path Handling**: Use pathlib.Path instead of os.path
20+
6. **Logging**: Use the logging module, never print()
21+
22+
## Project Structure
23+
24+
```
25+
todo_app/ # Main package directory
26+
tests/ # Test files
27+
docker/ # Docker configuration
28+
docs/ # Documentation
29+
.github/workflows/ # CI/CD pipelines
30+
```
31+
32+
## Testing Requirements
33+
34+
- Write pytest tests for all new functionality
35+
- Use fixtures for test data setup
36+
- Maintain >80% code coverage
37+
- Mark tests appropriately: @pytest.mark.unit or @pytest.mark.integration
38+
- Run all tests with: `task test` or just unit tests with `task unit-test` and just integration tests with `task integration-test`
39+
40+
## Development Workflow
41+
42+
1. Create feature branches for all changes
43+
2. Write tests before implementing features
44+
3. Run `task build test` before committing
45+
4. Use conventional commits (feat:, fix:, docs:, etc.)
46+
5. Open pull requests for code review
47+
48+
## Task Automation
49+
50+
Common tasks are automated via Taskfile:
51+
52+
- `task init`: Initialize development environment
53+
- `task build`: Build the project
54+
- `task test`: Run all tests
55+
- `task lint`: Run code quality checks
56+
- `task docker-build`: Build Docker image
57+
- `task docker-run`: Run Docker container
58+
- `task release`: Create a new release
59+
60+
## Security Considerations
61+
62+
- Never hardcode secrets or credentials
63+
- Use environment variables for sensitive data
64+
- Follow OWASP secure coding practices
65+
- Run security scans with grype before releases
66+
- Keep dependencies up to date
67+
68+
## When Suggesting Code
69+
70+
1. Check existing patterns in the codebase first
71+
2. Look for NotImplementedError placeholders to implement
72+
3. Ensure compatibility with uv package manager
73+
4. Follow the established project structure
74+
5. Include appropriate error handling
75+
6. Add tests for new functionality
76+
7. Update documentation as needed
77+
78+
## Common Patterns
79+
80+
```python
81+
# Path handling
82+
from pathlib import Path
83+
project_root = Path(__file__).parent.parent
84+
85+
# Logging setup
86+
import logging
87+
logger = logging.getLogger(__name__)
88+
89+
# Type hints
90+
from typing import Optional, List, Dict, Any
91+
def process_data(items: List[Dict[str, Any]]) -> Optional[str]:
92+
"""Process a list of data items.
93+
94+
Args:
95+
items: List of dictionaries containing data.
96+
97+
Returns:
98+
Processed result or None if no data.
99+
"""
100+
...
101+
102+
# Error handling
103+
class TodoAppError(Exception):
104+
"""Base exception for todo-app."""
105+
pass
106+
```
107+
108+
## Dependencies
109+
110+
- Only add dependencies that are absolutely necessary
111+
- Pin versions in pyproject.toml
112+
- Run `uv pip compile` to update lock files
113+
- Document why each dependency is needed

0 commit comments

Comments
 (0)