Skip to content

Commit 9d0deb0

Browse files
williabyclaude
andcommitted
fix(template): resolve linting and quality check issues
- Fix Jinja2 syntax in pyproject.toml for semantic release config using string concatenation (~) instead of problematic escaping - Extend ruff per-file-ignores for tests, scripts, fuzz, and .claude - Simplify qlty.toml to use only available plugins (ruff) - Make qlty pre-commit hook gracefully skip when CLI not installed - Fix G201: use logger.exception() instead of .error(exc_info=True) - Fix EM101: assign error message to variable before raising Also adds: - Claude skills for project planning and PR preparation - CodeRabbit configuration - GitHub issue/PR templates - Planning document templates (vision, roadmap, tech-spec) - Copilot instructions Tested with generated project: - All ruff checks pass - BasedPyright: 0 errors - Pytest: 100% coverage (21 tests) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d662862 commit 9d0deb0

44 files changed

Lines changed: 6506 additions & 397 deletions

Some content is hidden

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

.claude/.mcp.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"mcpServers": {
3+
"zen": {
4+
"command": "/home/byron/dev/zen-mcp-server/zen-mcp-server",
5+
"args": [],
6+
"cwd": "/home/byron/dev/zen-mcp-server"
7+
},
8+
"context7": {
9+
"command": "npx",
10+
"args": ["-y", "@upstash/context7-mcp"]
11+
},
12+
"sonarqube": {
13+
"command": "docker",
14+
"args": [
15+
"run",
16+
"-i",
17+
"--rm",
18+
"-e",
19+
"SONARQUBE_TOKEN",
20+
"-e",
21+
"SONARQUBE_ORG",
22+
"mcp/sonarqube"
23+
],
24+
"env": {
25+
"SONARQUBE_ORG": "williaby",
26+
"SONARQUBE_TOKEN": "8c2df211fe3e165cabb8e8bdf330f4f6ff147051"
27+
}
28+
}
29+
}
30+
}

.claude/commands/pr.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Prepare Pull Request
2+
3+
Analyze the current branch and prepare a PR description for template changes.
4+
5+
## Instructions
6+
7+
1. **Gather context** by running these commands:
8+
- `git status` - see uncommitted changes
9+
- `git log $(git merge-base HEAD main)..HEAD --oneline` - commits on this branch
10+
- `git diff $(git merge-base HEAD main)..HEAD --stat` - files changed summary
11+
12+
2. **Analyze the changes**:
13+
- What template components were modified?
14+
- Does this affect `cookiecutter.json`, hooks, or generated files?
15+
- Are there breaking changes for existing template users?
16+
- What testing was done?
17+
18+
3. **Generate PR description** using this template:
19+
20+
```markdown
21+
## Summary
22+
23+
<!-- Brief description: what changed and why -->
24+
25+
## Changes
26+
27+
- **Component**: What changed and why
28+
29+
## Scope
30+
31+
- [ ] `cookiecutter.json` (template variables)
32+
- [ ] `hooks/` (generation hooks)
33+
- [ ] `{{cookiecutter.project_slug}}/` (generated project files)
34+
- [ ] Documentation
35+
36+
## Impact
37+
38+
-[Key benefit]
39+
- ✅ No breaking changes to existing template users
40+
41+
## Testing
42+
43+
- [ ] Template generates with default options
44+
- [ ] Template generates with features enabled
45+
- [ ] Generated project passes `uv run pytest`
46+
47+
## Notes
48+
49+
<!-- Optional: known issues, follow-up work -->
50+
```
51+
52+
4. **Output the PR description** ready to copy-paste.
53+
54+
5. **Suggest a PR title** following conventional commits:
55+
- `feat(template):` for new template features
56+
- `fix(hooks):` for hook fixes
57+
- `docs:` for documentation
58+
- `chore(config):` for cookiecutter.json changes
59+
60+
## Scope Guidance
61+
62+
| Files Changed | Scope |
63+
|--------------|-------|
64+
| `cookiecutter.json` | config |
65+
| `hooks/*.py` | hooks |
66+
| `{{cookiecutter.project_slug}}/**` | template |
67+
| `README.md`, `CLAUDE.md` | docs |
68+
| `.github/workflows/**` | ci |
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
---
2+
name: commit-prepare
3+
description: "Prepare git commit messages for template changes following conventional commits. Activates on: commit, prepare commit, commit this, commit message, ready to commit"
4+
---
5+
6+
# Commit Preparation Skill
7+
8+
Automatically prepare commit messages for template changes following conventional commits.
9+
10+
## Activation
11+
12+
This skill activates on keywords:
13+
- "commit", "prepare commit", "commit this"
14+
- "commit message", "write commit"
15+
- "stage and commit", "commit changes"
16+
- "what should I commit", "ready to commit"
17+
18+
## Workflow
19+
20+
When activated, follow these steps:
21+
22+
### 1. Gather Context
23+
24+
```bash
25+
git status
26+
git diff --cached --stat
27+
git diff --cached
28+
```
29+
30+
### 2. Analyze Template Changes
31+
32+
Determine:
33+
- **Type**: feat, fix, docs, refactor, chore
34+
- **Scope**: template, hooks, config, ci, docs
35+
- **Impact**: Breaking changes for template users?
36+
37+
### 3. Generate Commit Message
38+
39+
#### Template-Specific Scopes
40+
41+
| Scope | Files | Example |
42+
|-------|-------|---------|
43+
| `template` | `{{cookiecutter.project_slug}}/**` | `feat(template): add health checks` |
44+
| `hooks` | `hooks/*.py` | `fix(hooks): handle Windows paths` |
45+
| `config` | `cookiecutter.json` | `chore(config): add new variable` |
46+
| `ci` | `.github/workflows/**` | `ci: add template validation` |
47+
| `docs` | `*.md`, `docs/**` | `docs: update installation guide` |
48+
49+
#### Format
50+
51+
```
52+
<type>(<scope>): <subject>
53+
54+
<body>
55+
56+
<footer>
57+
```
58+
59+
#### Type Reference
60+
61+
| Type | When to Use |
62+
|------|-------------|
63+
| `feat` | New template feature |
64+
| `fix` | Bug fix |
65+
| `docs` | Documentation |
66+
| `refactor` | Code restructuring |
67+
| `chore` | Maintenance |
68+
| `ci` | CI/CD changes |
69+
70+
### 4. Handle Staging
71+
72+
Ask about unstaged changes:
73+
- Stage all? (`git add .`)
74+
- Stage specific files?
75+
- Review first?
76+
77+
### 5. Execute Commit
78+
79+
Use HEREDOC for multi-line:
80+
81+
```bash
82+
git commit -m "$(cat <<'EOF'
83+
feat(template): add CodeRabbit integration
84+
85+
Add .coderabbit.yaml configuration for AI code reviews.
86+
Includes path-specific review instructions and auto-labeling.
87+
88+
🤖 Generated with [Claude Code](https://claude.ai/code)
89+
90+
Co-Authored-By: Claude <noreply@anthropic.com>
91+
EOF
92+
)"
93+
```
94+
95+
### 6. Post-Commit
96+
97+
- Show `git log -1`
98+
- Suggest push if ready
99+
- Note remaining changes
100+
101+
## Example Interactions
102+
103+
### Template Change
104+
105+
**User**: "commit this"
106+
107+
**Claude**: Staged changes:
108+
- `{{cookiecutter.project_slug}}/.coderabbit.yaml` (new)
109+
- `cookiecutter.json` (modified)
110+
- `hooks/post_gen_project.py` (modified)
111+
112+
**Suggested commit**:
113+
```
114+
feat(template): add CodeRabbit AI code review integration
115+
116+
- Add .coderabbit.yaml with assertive profile
117+
- Add include_coderabbit feature flag
118+
- Add cleanup logic in post-gen hook
119+
```
120+
121+
---
122+
123+
### Hook Fix
124+
125+
**User**: "ready to commit"
126+
127+
**Claude**: Staged: `hooks/post_gen_project.py`
128+
129+
**Suggested commit**:
130+
```
131+
fix(hooks): handle missing directory gracefully
132+
133+
Check if directory exists before attempting removal.
134+
Prevents error when optional features are disabled.
135+
```
136+
137+
---
138+
139+
### Multiple Scopes
140+
141+
**User**: "commit these changes"
142+
143+
**Claude**: Changes span multiple areas:
144+
1. `cookiecutter.json` - new variables
145+
2. `hooks/post_gen_project.py` - cleanup logic
146+
3. `README.md` - documentation
147+
148+
Recommend separate commits:
149+
1. `chore(config): add Linear integration variables`
150+
2. `feat(hooks): add Linear cleanup logic`
151+
3. `docs: document Linear integration`
152+
153+
Or single combined commit:
154+
```
155+
feat: add Linear project management integration
156+
157+
- Add include_linear and linear_team_key variables
158+
- Add cleanup logic for Linear files
159+
- Document setup in README
160+
```
161+
162+
Which approach?
163+
164+
## Attribution
165+
166+
Always include:
167+
```
168+
🤖 Generated with [Claude Code](https://claude.ai/code)
169+
170+
Co-Authored-By: Claude <noreply@anthropic.com>
171+
```
172+
173+
## Safety Rules
174+
175+
- **Never** amend pushed commits
176+
- **Never** skip hooks without explicit request
177+
- **Always** show message before executing
178+
- **Check** for hardcoded paths/usernames
179+
- **Verify** Jinja2 syntax in template files

0 commit comments

Comments
 (0)