Skip to content

Commit a7c0409

Browse files
Naaremanclaude
andcommitted
Add examples section and polish README for public release
- Added 7 real-world usage examples showing what the skill does - Added 4 new rows to coverage table (pre-commit, CLI, monorepo, automated release) - Contributing section now links to CONTRIBUTING.md - README now tells a complete story: what → install → examples → philosophy → structure Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 83c5f06 commit a7c0409

File tree

1 file changed

+96
-31
lines changed

1 file changed

+96
-31
lines changed

README.md

Lines changed: 96 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,101 @@ cp -r python-package-development/skills/python-package-development \
3333

3434
In Claude Code, type `/python-package-development` — you should see it in the skill list.
3535

36-
## Usage
36+
## Examples
3737

38-
The skill activates automatically when you're working on Python package tasks. You can also invoke it explicitly:
38+
### Scaffold a new package from scratch
3939

4040
```
41-
/python-package-development scaffold my-new-package
42-
/python-package-development api
43-
/python-package-development test
44-
/python-package-development docs
45-
/python-package-development lifecycle
46-
/python-package-development release
47-
/python-package-development check
48-
/python-package-development pre-commit
49-
/python-package-development cli
50-
/python-package-development
41+
You: /python-package-development scaffold my-analytics-lib
5142
```
5243

53-
Or just describe what you need — the skill activates when it recognizes a Python packaging task:
44+
Claude creates the full package structure following all conventions:
5445

55-
- *"I want to make a Python library"*
56-
- *"Help me structure my code as a package"*
57-
- *"How should I name these functions?"*
58-
- *"How do I publish to PyPI?"*
46+
```
47+
my-analytics-lib/
48+
├── pyproject.toml # uv + hatchling, PEP 735 dependency-groups
49+
├── mkdocs.yml # mkdocs-material with mkdocstrings
50+
├── src/
51+
│ └── my_analytics_lib/
52+
│ ├── __init__.py # curated __all__, importlib.metadata version
53+
│ ├── py.typed # PEP 561 type marker
54+
│ ├── errors.py # base exception + typed errors
55+
│ ├── _messages.py # rich console (info, success, warn, abort)
56+
│ └── core.py # verb_noun() functions with Google docstrings
57+
├── tests/
58+
│ ├── conftest.py # shared fixtures
59+
│ └── test_core.py # happy path + error cases
60+
└── docs/
61+
├── index.md
62+
└── api.md
63+
```
64+
65+
### Review your API design
66+
67+
```
68+
You: /python-package-development api
69+
```
70+
71+
Claude reads your code and checks:
72+
- Are functions named `verb_noun()`? Are families consistent?
73+
- Are errors in `errors.py` with a proper hierarchy?
74+
- Is `_messages.py` used instead of bare `print()`?
75+
- Does every public function have a Google-style docstring?
76+
77+
### Audit for common mistakes
78+
79+
```
80+
You: /python-package-development check
81+
```
82+
83+
Claude scans your project for 30+ known anti-patterns:
84+
- `requires-python` with an upper bound?
85+
- Dev dependencies in `[project] dependencies`?
86+
- `--cov=src` instead of `--cov=my_package`?
87+
- Missing `py.typed`? `tests/__init__.py` exists?
88+
- `license = { text = "MIT" }` (deprecated)?
89+
90+
### Set up pre-commit hooks
91+
92+
```
93+
You: /python-package-development pre-commit
94+
```
95+
96+
Claude adds `.pre-commit-config.yaml` with ruff (lint + format), mypy, and standard hooks — no black, isort, or flake8 needed.
97+
98+
### Deprecate a function properly
99+
100+
```
101+
You: I need to rename parse_file() to read_csv()
102+
```
103+
104+
The skill activates automatically and walks you through the deprecation ceremony:
105+
1. Keep `parse_file()`, add `DeprecationWarning` pointing to `read_csv()`
106+
2. Set a removal timeline in the docstring and CHANGELOG
107+
3. Remove in the promised version
108+
109+
### Prepare a PyPI release
110+
111+
```
112+
You: /python-package-development release
113+
```
114+
115+
Claude walks through the release ritual:
116+
1. All tests pass? Lint clean? Types check?
117+
2. CHANGELOG updated? Version bumped?
118+
3. Git tag created? Tag pushed?
119+
4. CI publishes to PyPI automatically via trusted publishing
120+
121+
### Just ask naturally
122+
123+
The skill also activates when you describe what you need:
124+
125+
```
126+
You: I want to make a Python library for parsing config files
127+
You: Help me structure my code as a package
128+
You: How should I name these functions?
129+
You: How do I publish to PyPI?
130+
```
59131

60132
## The Philosophy (what R taught us)
61133

@@ -87,6 +159,10 @@ Before diving into details, you should see the whole thing working end-to-end.
87159
| Documentation | `roxygen2` + `pkgdown` | Google docstrings + `mkdocs-material` |
88160
| Lifecycle | `lifecycle` package | `warnings` + deprecation conventions |
89161
| Release | `devtools::release()` | GitHub Actions + PyPI |
162+
| Pre-commit | `lintr` + `styler` | ruff + mypy + pre-commit |
163+
| CLI | `Rscript` | `click` / `argparse` + entry points |
164+
| Monorepo || uv workspaces + namespace packages |
165+
| Automated release || `bump-my-version` + `git-cliff` |
90166

91167
## Plugin Structure
92168

@@ -98,26 +174,15 @@ python-package-development/
98174
├── skills/
99175
│ └── python-package-development/
100176
│ ├── SKILL.md # Main skill (philosophy + routing)
101-
│ └── references/
102-
│ ├── 01-scaffold.md # Package scaffolding
103-
│ ├── 02-api-design.md # Naming, messages, errors
104-
│ ├── 03-testing.md # pytest conventions
105-
│ ├── 04-docs.md # Docstrings + mkdocs-material
106-
│ ├── 05-lifecycle.md # Deprecation ceremony
107-
│ ├── 06-release.md # PyPI + GitHub Actions
108-
│ ├── 07-common-mistakes.md # Anti-patterns
109-
│ ├── 08-pre-commit.md # Pre-commit hooks
110-
│ ├── 09-cli-entry-points.md # CLI entry points
111-
│ ├── 10-monorepo.md # Monorepo + namespaces
112-
│ └── 11-automated-release.md # Automated releases
177+
│ └── references/ # 11 reference docs (loaded on demand)
113178
├── examples/
114179
│ └── my-package/ # Reference implementation (22/22 checks)
115180
├── scripts/
116181
│ ├── count-tokens.py # Token budget checker
117182
│ └── check-structure.py # Convention audit (22 checks)
118183
└── .github/
119184
└── workflows/
120-
└── check-budget.yml # CI: token budget on PRs
185+
└── check-budget.yml # CI: budget + example audit on PRs
121186
```
122187

123188
## Token Budget
@@ -134,4 +199,4 @@ python3 scripts/count-tokens.py skills/python-package-development/
134199

135200
## Contributing
136201

137-
This project is opinionated by design. If you think a convention is wrong, open an issue — but bring a reason, not just a preference. The goal is a *philosophy*, not a menu of options.
202+
See [CONTRIBUTING.md](CONTRIBUTING.md). This project is opinionated by designbring a reason, not just a preference.

0 commit comments

Comments
 (0)