Skip to content

Commit cfd466f

Browse files
authored
docs: rewrite README for v3 workflow (3 roles, 6 steps, no setup_project.py) (#50)
1 parent 024e755 commit cfd466f

File tree

1 file changed

+106
-198
lines changed

1 file changed

+106
-198
lines changed

README.md

Lines changed: 106 additions & 198 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,14 @@
55
[![Stargazers][stars-shield]][stars-url]
66
[![Issues][issues-shield]][issues-url]
77
[![MIT License][license-shield]][license-url]
8-
[![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen?style=for-the-badge)](docs/coverage/index.html)
8+
[![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen?style=for-the-badge)](https://nullhack.github.io/python-project-template/coverage/)
99

1010
[![CI](https://img.shields.io/github/actions/workflow/status/nullhack/python-project-template/ci.yml?style=for-the-badge&label=CI)](https://github.com/nullhack/python-project-template/actions/workflows/ci.yml)
1111
[![Python](https://img.shields.io/badge/python-3.13-blue?style=for-the-badge)](https://www.python.org/downloads/)
1212

13-
> Python template with some awesome tools to quickstart any Python project
13+
> Python template to quickstart any project with production-ready workflow, quality tooling, and AI-assisted development.
1414
15-
**🚀 Enterprise Python Project Template** - AI-enhanced development template with TDD workflows, quality standards, and zero-config tooling.
16-
17-
## ⚡ Quick Start
18-
19-
### Using This Template
15+
## Quick Start
2016

2117
```bash
2218
# 1. Clone the template
@@ -26,238 +22,150 @@ cd python-project-template
2622
# 2. Install UV package manager (if not installed)
2723
curl -LsSf https://astral.sh/uv/install.sh | sh
2824

29-
# 3. **IMPORTANT**: Customize the template for your project
30-
python setup_project.py
31-
# This interactive script will:
32-
# - Rename directories from 'app' to your package name
33-
# - Update pyproject.toml with your project details
34-
# - Fix Docker configuration paths
35-
# - Replace all template placeholders
36-
37-
# 4. Follow the Git configuration commands shown by setup_project.py
38-
# Example: git remote set-url origin https://github.com/yourname/yourproject
39-
40-
# 5. Setup development environment
25+
# 3. Set up the development environment
4126
uv venv && uv pip install -e '.[dev]'
4227

43-
# 6. Validate everything works
44-
task test && task lint && task static-check
28+
# 4. Customize template placeholders for your project
29+
opencode && @setup-project
4530

46-
# 7. Initialize AI development environment (optional)
47-
opencode && /init
31+
# 5. Validate everything works
32+
task test && task lint && task static-check && timeout 10s task run
4833
```
4934

50-
**⚠️ Template State Notice**: This project is currently in "template state" with placeholder values. The `setup_project.py` script **must** be run to properly configure Docker, package paths, and project metadata before development.
51-
52-
**Requirements**: Python 3.13+ and UV package manager are required.
35+
## What This Template Provides
5336

54-
## 🎯 What This Template Provides
37+
### Development Workflow
5538

56-
This template creates a production-ready Python project with:
39+
A **6-step Kanban workflow** with WIP=1 (one feature at a time), enforced by the filesystem:
5740

58-
### 🔧 **Project Setup & Customization**
59-
- **Automated setup script** (`setup_project.py`) - Interactive customization with your project details
60-
- **Smart folder renaming** - Automatically renames `app/` directory to match your project
61-
- **Docker path fixing** - Updates Docker configuration to match your project structure
62-
- **Git configuration** - Provides ready-to-use Git commands for remotes and user setup
63-
- **Template processing** - Replaces all placeholders in pyproject.toml and configuration files
64-
65-
### 🤖 **AI-Enhanced Development Workflow**
66-
- **Multi-session continuity** - Projects span multiple AI sessions with shared state in `TODO.md`
67-
- **Specialized agents** - Built-in agents for architecture, development, QA, and repository management
68-
- **Skills system** - Modular workflows for TDD, feature definition, prototyping, and releases
69-
70-
### 🏗️ **Enterprise Architecture & Quality**
71-
- **SOLID principles** - Enforced through AI architecture reviews via OpenCode agents
72-
- **Object Calisthenics** - Clean, behavior-rich code patterns enforced by QA workflows
73-
- **100% test coverage** - TDD workflows with acceptance criteria docstrings and property-based testing (Hypothesis)
74-
- **Mutation testing** - mutmut integration for test quality validation
75-
- **Zero-config tooling** - UV, taskipy, Ruff, PyTest, Hypothesis, PyRight pre-configured
76-
77-
## 🤖 AI-Powered Development
41+
```
42+
docs/features/backlog/ ← features waiting to be worked on
43+
docs/features/in-progress/ ← exactly one feature being built
44+
docs/features/completed/ ← accepted and shipped features
45+
```
7846

79-
This project includes built-in AI agents to accelerate your development.
47+
**3 roles, 6 steps:**
8048

81-
### Multi-Session Development
49+
| Step | Role | What happens |
50+
|------|------|-------------|
51+
| 1. SCOPE | Product Owner | User stories + UUID acceptance criteria |
52+
| 2. BOOTSTRAP + ARCH | Developer | Build system, module structure, ADRs |
53+
| 3. TEST FIRST | Developer | Failing tests mapped 1:1 to UUID criteria |
54+
| 4. IMPLEMENT | Developer | Red→Green→Refactor, commit per green test |
55+
| 5. VERIFY | Reviewer | Run all commands, code review, UUID traceability |
56+
| 6. ACCEPT | Product Owner | Demo, validate, merge, tag |
8257

83-
Complex projects are developed across multiple AI sessions. `TODO.md` at the root acts as the shared state — any AI agent can pick up exactly where the last session stopped.
58+
### AI Agents
8459

8560
```bash
86-
# Start any session: read state, orient, continue
87-
@developer /skill session-workflow
88-
89-
# End any session: update TODO.md, commit progress, hand off
90-
@developer /skill session-workflow
61+
@product-owner # Defines features, picks from backlog, accepts deliveries
62+
@developer # Architecture, tests, code, git, releases
63+
@reviewer # Runs commands, reviews code — read+bash only
64+
@setup-project # One-time template initialization
9165
```
9266

93-
### Feature Development Workflow
67+
### Skills
9468

9569
```bash
96-
# Define new features with SOLID principles
97-
@developer /skill feature-definition
98-
99-
# Create prototypes and validate concepts
100-
@developer /skill prototype-script
101-
102-
# Write comprehensive tests first (TDD)
103-
@developer /skill tdd
104-
105-
# Get architecture review before implementing
106-
@architect
107-
108-
# Implement with guided TDD workflow
109-
@developer /skill implementation
110-
111-
# Create releases with smart versioning
112-
@repo-manager /skill git-release
70+
/skill session-workflow # Read TODO.md, continue, hand off cleanly
71+
/skill scope # Write user stories + acceptance criteria
72+
/skill tdd # TDD: file naming, docstring format, markers
73+
/skill implementation # Red-Green-Refactor, architecture, ADRs
74+
/skill code-quality # ruff, pyright, coverage, complexity limits
75+
/skill verify # Step 5 verification checklist
76+
/skill pr-management # Branch naming, PR template, squash merge
77+
/skill git-release # Hybrid calver versioning, themed naming
78+
/skill create-skill # Add new skills to the system
11379
```
11480

115-
## 🏗️ Architecture & Standards
116-
117-
- **🎯 SOLID Principles** - Single responsibility, dependency inversion, clean interfaces
118-
- **🔧 Object Calisthenics** - No primitives, small classes, behavior-rich objects
119-
- **🧪 TDD Testing** - Acceptance criteria format with Given/When/Then docstrings, 100% coverage requirement
120-
- **🔬 Property-Based Testing** - Hypothesis integration for robust edge case validation
121-
- **🧬 Mutation Testing** - mutmut for genetic algorithm-based test quality assurance
122-
- **⚡ Modern Toolchain** - UV, taskipy, Ruff, PyTest, Hypothesis, PyRight
123-
- **🚀 Smart Releases** - Hybrid major.minor.calver versioning with AI-generated themed names
124-
125-
## 📋 Development Commands
126-
127-
This project uses **taskipy** for task automation (configured in `pyproject.toml`):
81+
## Development Commands
12882

12983
```bash
130-
# Core development workflow
131-
task run # Execute version module (demo command)
132-
task test # Run comprehensive test suite with coverage
133-
task test-fast # Run fast tests only (skip slow tests)
134-
task test-slow # Run only slow tests (marked with @pytest.mark.slow)
135-
task lint # Format and lint code with ruff
136-
task static-check # Type safety validation with pyright
137-
138-
# Documentation
139-
task doc-serve # Live pdoc documentation server (localhost:8080)
140-
task doc-build # Build static pdoc API docs to docs/api/
141-
task doc-publish # Publish API docs to GitHub Pages
142-
143-
# Quality assurance
144-
task test-report # Detailed coverage report (included in task test)
145-
task mut # Mutation testing with mutmut
146-
task mut-clean # Reset mutation testing cache
84+
task run # Run the application (humans)
85+
timeout 10s task run # Run with timeout (agents — exit 124 = hung = FAIL)
86+
task test # Full test suite with coverage report
87+
task test-fast # Tests without coverage (faster iteration)
88+
task test-slow # Only slow tests
89+
task lint # ruff check + format
90+
task static-check # pyright type checking
91+
task doc-build # Generate API docs + coverage + test reports
92+
task doc-publish # Publish unified docs site to GitHub Pages
93+
task doc-serve # Live API doc server at localhost:8080
14794
```
14895

149-
## 🐳 Docker Usage
150-
151-
**⚠️ Important**: Run `python setup_project.py` first to configure the template before using Docker.
152-
153-
Docker provides development environment with hot reload and integrated tooling:
154-
155-
```bash
156-
# Development environment with hot reload
157-
docker-compose up # Main application (ports 8000, 8080, 5678)
158-
159-
# Specialized services (use profiles)
160-
docker-compose --profile test up # Run complete test suite
161-
docker-compose --profile docs up # Documentation server (localhost:8080)
162-
docker-compose --profile quality up # Code quality checks (lint + typecheck)
163-
164-
# Build standalone image
165-
docker build -t your-project-name . # Build development image
96+
## Code Quality Standards
97+
98+
| Standard | Target |
99+
|----------|--------|
100+
| Coverage | 100% |
101+
| Type checking | pyright, 0 errors |
102+
| Linting | ruff, 0 issues, Google docstrings |
103+
| Function length | ≤ 20 lines |
104+
| Class length | ≤ 50 lines |
105+
| Max nesting | 2 levels |
106+
| Principles | YAGNI > KISS > DRY > SOLID > Object Calisthenics |
107+
108+
## Test Conventions
109+
110+
```python
111+
def test_<condition>_should_<outcome>():
112+
"""a1b2c3d4-e5f6-7890-abcd-ef1234567890: Short description ending with a period.
113+
114+
Given: precondition
115+
When: action
116+
Then: single observable outcome
117+
"""
118+
# Given
119+
...
120+
# When
121+
...
122+
# Then
123+
...
166124
```
167125

168-
**Current Docker Configuration:**
169-
- **Main service**: Hot reload development with volume mounts
170-
- **Test profile**: Full test suite execution
171-
- **Docs profile**: Live documentation server
172-
- **Quality profile**: Linting and type checking
173-
174-
**Note**: The Docker configuration currently references template paths and requires `setup_project.py` to be run for proper functionality.
175-
126+
**Markers**: `@pytest.mark.unit` · `@pytest.mark.integration` · `@pytest.mark.slow`
176127

177-
178-
## 🔧 Technology Stack
128+
## Technology Stack
179129

180130
| Category | Tools |
181131
|----------|-------|
182-
| **Package Management** | UV (blazing fast pip/poetry replacement) |
183-
| **Task Automation** | taskipy (configured in pyproject.toml) |
184-
| **Code Quality** | Ruff (linting + formatting), PyRight (type checking) |
185-
| **Testing** | PyTest + Hypothesis (property-based testing), pytest-html (acceptance criteria reports) |
186-
| **Mutation Testing** | mutmut (genetic algorithm-based mutation testing) |
187-
| **Coverage** | pytest-cov (100% coverage requirement) |
188-
| **AI Integration** | OpenCode agents and skills for development automation |
189-
| **Documentation** | pdoc with search functionality and GitHub Pages publishing |
190-
| **Containerization** | Docker development environment with hot reload and service profiles |
191-
192-
## 📈 Quality Metrics
193-
194-
-**100% Test Coverage** - pytest-cov with fail-under=100 requirement
195-
-**Static Type Safety** - PyRight type checking with full type hints
196-
-**Zero Linting Issues** - Ruff automated formatting and Google-style conventions
197-
-**Property-Based Testing** - Hypothesis integration for robust validation
198-
-**Mutation Testing** - mutmut for genetic algorithm-based test quality validation
199-
-**Acceptance Criteria Format** - Given/When/Then docstrings with pytest-html reporting
200-
-**Architecture Compliance** - AI-enforced SOLID principles through OpenCode agents
201-
202-
## 🚀 Deployment Ready
203-
204-
Projects generated from this template include Docker support for development:
132+
| Package management | uv |
133+
| Task automation | taskipy |
134+
| Linting + formatting | Ruff |
135+
| Type checking | PyRight |
136+
| Testing | pytest + Hypothesis |
137+
| Coverage | pytest-cov (100% required) |
138+
| Documentation | pdoc + ghp-import |
139+
| AI development | OpenCode agents + skills |
205140

206-
```bash
207-
# After running setup_project.py in your configured project
208-
docker build -t your-project-name .
209-
docker run -p 8000:8000 your-project-name
210-
211-
# Docker Compose development environment
212-
docker-compose up # Development environment with hot reload
213-
docker-compose --profile test up # Run test suite
214-
docker-compose --profile docs up # Documentation server
215-
docker-compose --profile quality up # Code quality checks
216-
217-
# API documentation
218-
task doc-build # Generates docs/api/index.html
219-
task doc-serve # http://localhost:8080 (live server)
220-
```
141+
## Documentation Site
221142

222-
## 🤝 Contributing
143+
Published at [nullhack.github.io/python-project-template](https://nullhack.github.io/python-project-template):
144+
- **API Reference** — pdoc-generated from source docstrings
145+
- **Coverage Report** — line-by-line coverage breakdown
146+
- **Test Results** — full pytest run results
223147

224-
Help improve this template for the entire Python community:
148+
## Release Versioning
225149

226-
### Template Improvements
150+
Format: `v{major}.{minor}.{YYYYMMDD}`
227151

228-
```bash
229-
# Fork and improve the template
230-
git clone https://github.com/your-username/python-project-template
231-
cd python-project-template
152+
Each release gets a unique **adjective-animal** name generated from the commit/PR content.
232153

233-
# Test your changes
234-
python setup_project.py --dry-run --github-username testuser --yes
154+
## Contributing
235155

236-
# Add new skills, agents, or template features
237-
# Submit pull request with improvements
156+
```bash
157+
git clone https://github.com/nullhack/python-project-template
158+
uv venv && uv pip install -e '.[dev]'
159+
task test && task lint
238160
```
239161

240-
### Areas for Contribution
241-
- **New Skills** - Add specialized workflows (deployment, security, performance)
242-
- **Agent Enhancements** - Improve existing agents or add new specialized ones
243-
- **Template Updates** - Better project structures, additional tooling, improved defaults
244-
- **Documentation** - Usage guides, examples, best practices
245-
246-
## 📄 License
247-
248-
Distributed under the MIT License. See [LICENSE](LICENSE) for details.
249-
250-
## 🙏 Built With
162+
## License
251163

252-
- [Python Project Template](https://github.com/nullhack/python-project-template) - Enterprise-grade Python project template
253-
- [OpenCode](https://opencode.ai) - AI-powered development platform
254-
- [UV](https://astral.sh/uv/) - Modern Python package manager
255-
- [Ruff](https://astral.sh/ruff/) - Extremely fast Python linter
164+
MIT — see [LICENSE](LICENSE).
256165

257166
---
258167

259-
**Author:** eol ([@nullhack](https://github.com/nullhack))
260-
**Project:** [python-project-template](https://github.com/nullhack/python-project-template)
168+
**Author:** eol ([@nullhack](https://github.com/nullhack))
261169
**Documentation:** [nullhack.github.io/python-project-template](https://nullhack.github.io/python-project-template)
262170

263171
<!-- MARKDOWN LINKS & IMAGES -->
@@ -270,4 +178,4 @@ Distributed under the MIT License. See [LICENSE](LICENSE) for details.
270178
[issues-shield]: https://img.shields.io/github/issues/nullhack/python-project-template.svg?style=for-the-badge
271179
[issues-url]: https://github.com/nullhack/python-project-template/issues
272180
[license-shield]: https://img.shields.io/badge/license-MIT-green?style=for-the-badge
273-
[license-url]: https://github.com/nullhack/python-project-template/blob/main/LICENSE
181+
[license-url]: https://github.com/nullhack/python-project-template/blob/main/LICENSE

0 commit comments

Comments
 (0)