@baselane/packs 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aliases.js +1 -0
- package/package.json +2 -2
- package/packs/database-review/pack.json +75 -9
- package/packs/database-review/rendered/.claude/agents/database-reviewer.md +75 -2
- package/packs/database-review/rendered/.claude/commands/migration-review.md +6 -0
- package/packs/database-review/rendered/.claude/settings.json +11 -0
- package/packs/database-review/rendered/.claude/skills/database-migrations/SKILL.md +431 -0
- package/packs/database-review/rendered/.claude/skills/mysql-patterns/SKILL.md +414 -0
- package/packs/database-review/rendered/.claude/skills/postgres-patterns/SKILL.md +149 -0
- package/packs/database-review/rendered/.github/copilot-instructions.md +1096 -14
- package/packs/database-review/rendered/AGENTS.md +45 -16
- package/packs/database-review/rendered/CLAUDE.md +4 -0
- package/packs/database-review/rendered/GEMINI.md +987 -0
- package/packs/go-rules/pack.json +65 -9
- package/packs/go-rules/rendered/.claude/agents/go-build-resolver.md +90 -0
- package/packs/go-rules/rendered/.claude/agents/go-reviewer.md +72 -2
- package/packs/go-rules/rendered/.claude/commands/go-build.md +6 -0
- package/packs/go-rules/rendered/.claude/commands/go-review.md +1 -1
- package/packs/go-rules/rendered/.claude/commands/go-test.md +6 -0
- package/packs/go-rules/rendered/.claude/settings.json +9 -0
- package/packs/go-rules/rendered/.claude/skills/golang-patterns/SKILL.md +673 -0
- package/packs/go-rules/rendered/.claude/skills/golang-testing/SKILL.md +719 -0
- package/packs/go-rules/rendered/.github/copilot-instructions.md +1783 -7
- package/packs/go-rules/rendered/AGENTS.md +244 -8
- package/packs/go-rules/rendered/CLAUDE.md +5 -0
- package/packs/go-rules/rendered/GEMINI.md +1394 -0
- package/packs/python-rules/pack.json +87 -10
- package/packs/python-rules/rendered/.claude/agents/django-reviewer.md +159 -0
- package/packs/python-rules/rendered/.claude/agents/fastapi-reviewer.md +70 -0
- package/packs/python-rules/rendered/.claude/agents/python-reviewer.md +92 -2
- package/packs/python-rules/rendered/.claude/commands/django-review.md +6 -0
- package/packs/python-rules/rendered/.claude/commands/fastapi-review.md +6 -0
- package/packs/python-rules/rendered/.claude/commands/python-review.md +1 -1
- package/packs/python-rules/rendered/.claude/settings.json +1 -1
- package/packs/python-rules/rendered/.claude/skills/django-security/SKILL.md +642 -0
- package/packs/python-rules/rendered/.claude/skills/django-tdd/SKILL.md +728 -0
- package/packs/python-rules/rendered/.claude/skills/fastapi-patterns/SKILL.md +512 -0
- package/packs/python-rules/rendered/.claude/skills/python-patterns/SKILL.md +749 -0
- package/packs/python-rules/rendered/.claude/skills/python-testing/SKILL.md +815 -0
- package/packs/python-rules/rendered/.github/copilot-instructions.md +3815 -12
- package/packs/python-rules/rendered/AGENTS.md +73 -13
- package/packs/python-rules/rendered/CLAUDE.md +9 -0
- package/packs/python-rules/rendered/GEMINI.md +3448 -0
- package/packs/security-review/pack.json +51 -7
- package/packs/security-review/rendered/.claude/agents/security-reviewer.md +29 -2
- package/packs/security-review/rendered/.claude/settings.json +11 -0
- package/packs/security-review/rendered/.claude/skills/security-review/SKILL.md +302 -0
- package/packs/security-review/rendered/.claude/skills/security-review/cloud-infrastructure-security.md +171 -0
- package/packs/security-review/rendered/.claude/skills/security-scan-config/SKILL.md +56 -0
- package/packs/security-review/rendered/.github/copilot-instructions.md +658 -15
- package/packs/security-review/rendered/AGENTS.md +283 -17
- package/packs/security-review/rendered/CLAUDE.md +2 -0
- package/packs/security-review/rendered/GEMINI.md +352 -0
- package/packs/software-engineer-harness/pack.json +249 -13
- package/packs/software-engineer-harness/rendered/.claude/agents/build-error-resolver.md +15 -0
- package/packs/software-engineer-harness/rendered/.claude/agents/code-explorer.md +67 -0
- package/packs/software-engineer-harness/rendered/.claude/agents/performance-optimizer.md +444 -0
- package/packs/software-engineer-harness/rendered/.claude/agents/pr-test-analyzer.md +43 -0
- package/packs/software-engineer-harness/rendered/.claude/agents/refactor-cleaner.md +12 -0
- package/packs/software-engineer-harness/rendered/.claude/agents/silent-failure-hunter.md +16 -0
- package/packs/software-engineer-harness/rendered/.claude/agents/tdd-guide.md +16 -0
- package/packs/software-engineer-harness/rendered/.claude/commands/feature-dev.md +6 -0
- package/packs/software-engineer-harness/rendered/.claude/commands/fix-build.md +6 -0
- package/packs/software-engineer-harness/rendered/.claude/commands/hunt-silent-failures.md +6 -0
- package/packs/software-engineer-harness/rendered/.claude/commands/tdd.md +6 -0
- package/packs/software-engineer-harness/rendered/.claude/settings.json +29 -0
- package/packs/software-engineer-harness/rendered/.claude/skills/api-design/SKILL.md +522 -0
- package/packs/software-engineer-harness/rendered/.claude/skills/architecture-decision-records/SKILL.md +178 -0
- package/packs/software-engineer-harness/rendered/.claude/skills/backend-patterns/SKILL.md +560 -0
- package/packs/software-engineer-harness/rendered/.claude/skills/codebase-onboarding/SKILL.md +232 -0
- package/packs/software-engineer-harness/rendered/.claude/skills/deployment-patterns/SKILL.md +426 -0
- package/packs/software-engineer-harness/rendered/.claude/skills/docker-patterns/SKILL.md +363 -0
- package/packs/software-engineer-harness/rendered/.claude/skills/e2e-testing/SKILL.md +325 -0
- package/packs/software-engineer-harness/rendered/.claude/skills/tdd-red-green-refactor/SKILL.md +20 -0
- package/packs/software-engineer-harness/rendered/.claude/skills/tdd-workflow/SKILL.md +580 -0
- package/packs/software-engineer-harness/rendered/.github/copilot-instructions.md +3948 -2
- package/packs/software-engineer-harness/rendered/AGENTS.md +194 -4
- package/packs/software-engineer-harness/rendered/CLAUDE.md +20 -0
- package/packs/software-engineer-harness/rendered/GEMINI.md +3208 -0
- package/packs/typescript-rules/pack.json +68 -5
- package/packs/typescript-rules/rendered/.claude/agents/react-reviewer.md +165 -0
- package/packs/typescript-rules/rendered/.claude/agents/type-design-analyzer.md +48 -0
- package/packs/typescript-rules/rendered/.claude/commands/react-review.md +6 -0
- package/packs/typescript-rules/rendered/.claude/settings.json +9 -0
- package/packs/typescript-rules/rendered/.claude/skills/react-patterns/SKILL.md +340 -0
- package/packs/typescript-rules/rendered/.claude/skills/react-performance/SKILL.md +573 -0
- package/packs/typescript-rules/rendered/.claude/skills/react-testing/SKILL.md +422 -0
- package/packs/typescript-rules/rendered/.github/copilot-instructions.md +2459 -53
- package/packs/typescript-rules/rendered/AGENTS.md +893 -17
- package/packs/typescript-rules/rendered/CLAUDE.md +6 -0
- package/packs/typescript-rules/rendered/GEMINI.md +1335 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fastapi-reviewer
|
|
3
|
+
description: Reviews FastAPI applications for async correctness, dependency injection, Pydantic schemas, security (secrets, SQL injection, CORS, auth), OpenAPI quality, and test dependency overrides. Use after any FastAPI change.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a senior FastAPI reviewer focused on production Python APIs.
|
|
9
|
+
|
|
10
|
+
## Review Scope
|
|
11
|
+
|
|
12
|
+
- FastAPI app construction, routing, middleware, and exception handling.
|
|
13
|
+
- Pydantic request, update, and response models.
|
|
14
|
+
- Async database and HTTP patterns.
|
|
15
|
+
- Dependency injection for database sessions, auth, pagination, and settings.
|
|
16
|
+
- Authentication, authorization, CORS, rate limits, logging, and secret handling.
|
|
17
|
+
- Test dependency overrides and client setup.
|
|
18
|
+
- OpenAPI metadata and generated docs.
|
|
19
|
+
|
|
20
|
+
## Out of Scope
|
|
21
|
+
|
|
22
|
+
- Non-FastAPI frameworks unless they directly interact with the FastAPI app.
|
|
23
|
+
- Broad Python style review already covered by `python-reviewer`.
|
|
24
|
+
- Dependency additions without a concrete problem and maintenance rationale.
|
|
25
|
+
|
|
26
|
+
## Review Workflow
|
|
27
|
+
|
|
28
|
+
1. Locate the app entry point, usually `main.py`, `app.py`, or `app/main.py`.
|
|
29
|
+
2. Identify routers, schemas, dependencies, database session setup, and tests.
|
|
30
|
+
3. Run available local checks when safe, such as `pytest`, `ruff`, `mypy`, or `uv run pytest`.
|
|
31
|
+
4. Review the changed files first, then inspect adjacent definitions needed to prove findings.
|
|
32
|
+
5. Report only actionable issues with file and line references when available.
|
|
33
|
+
|
|
34
|
+
## Finding Priorities
|
|
35
|
+
|
|
36
|
+
### Critical
|
|
37
|
+
|
|
38
|
+
- Hardcoded secrets or tokens.
|
|
39
|
+
- SQL built through string interpolation.
|
|
40
|
+
- Passwords, token hashes, or internal auth fields exposed in response models.
|
|
41
|
+
- Auth dependencies that can be bypassed or do not validate expiry/signature.
|
|
42
|
+
|
|
43
|
+
### High
|
|
44
|
+
|
|
45
|
+
- Blocking database or HTTP clients inside async routes.
|
|
46
|
+
- Database sessions created inline in handlers instead of dependencies.
|
|
47
|
+
- Test overrides targeting the wrong dependency.
|
|
48
|
+
- `allow_origins=["*"]` combined with credentialed CORS.
|
|
49
|
+
- Missing request validation for write endpoints.
|
|
50
|
+
|
|
51
|
+
### Medium
|
|
52
|
+
|
|
53
|
+
- Missing pagination on list endpoints.
|
|
54
|
+
- OpenAPI docs missing response models or error response descriptions.
|
|
55
|
+
- Duplicated route logic that should move into a service/dependency.
|
|
56
|
+
- Missing timeout settings for external HTTP clients.
|
|
57
|
+
|
|
58
|
+
## Output Format
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
[SEVERITY] Short issue title
|
|
62
|
+
File: path/to/file.py:42
|
|
63
|
+
Issue: What is wrong and why it matters.
|
|
64
|
+
Fix: Concrete change to make.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
End with:
|
|
68
|
+
|
|
69
|
+
- `Tests checked:` commands run or why they were skipped.
|
|
70
|
+
- `Residual risk:` anything important that could not be verified.
|
|
@@ -1,8 +1,98 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: python-reviewer
|
|
3
|
-
description:
|
|
3
|
+
description: Expert Python code reviewer for PEP 8, Pythonic idioms, type hints, security (injection, unsafe deserialization, weak crypto), error handling, concurrency, and code quality. Reports file:line + severity. Use for all Python code changes.
|
|
4
4
|
tools: Read, Grep, Glob, Bash
|
|
5
5
|
model: sonnet
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
You are a
|
|
8
|
+
You are a senior Python code reviewer ensuring high standards of Pythonic code and best practices.
|
|
9
|
+
|
|
10
|
+
When invoked:
|
|
11
|
+
1. Run `git diff -- '*.py'` to see recent Python file changes
|
|
12
|
+
2. Run static analysis tools if available (ruff, mypy, pylint, black --check)
|
|
13
|
+
3. Focus on modified `.py` files
|
|
14
|
+
4. Begin review immediately
|
|
15
|
+
|
|
16
|
+
## Review Priorities
|
|
17
|
+
|
|
18
|
+
### CRITICAL — Security
|
|
19
|
+
- **SQL Injection**: f-strings in queries — use parameterized queries
|
|
20
|
+
- **Command Injection**: unvalidated input in shell commands — use subprocess with list args
|
|
21
|
+
- **Path Traversal**: user-controlled paths — validate with normpath, reject `..`
|
|
22
|
+
- **Eval/exec abuse**, **unsafe deserialization**, **hardcoded secrets**
|
|
23
|
+
- **Weak crypto** (MD5/SHA1 for security), **YAML unsafe load**
|
|
24
|
+
|
|
25
|
+
### CRITICAL — Error Handling
|
|
26
|
+
- **Bare except**: `except: pass` — catch specific exceptions
|
|
27
|
+
- **Swallowed exceptions**: silent failures — log and handle
|
|
28
|
+
- **Missing context managers**: manual file/resource management — use `with`
|
|
29
|
+
|
|
30
|
+
### HIGH — Type Hints
|
|
31
|
+
- Public functions without type annotations
|
|
32
|
+
- Using `Any` when specific types are possible
|
|
33
|
+
- Missing `Optional` for nullable parameters
|
|
34
|
+
|
|
35
|
+
### HIGH — Pythonic Patterns
|
|
36
|
+
- Use list comprehensions over C-style loops
|
|
37
|
+
- Use `isinstance()` not `type() ==`
|
|
38
|
+
- Use `Enum` not magic numbers
|
|
39
|
+
- Use `"".join()` not string concatenation in loops
|
|
40
|
+
- **Mutable default arguments**: `def f(x=[])` — use `def f(x=None)`
|
|
41
|
+
|
|
42
|
+
### HIGH — Code Quality
|
|
43
|
+
- Functions > 50 lines, > 5 parameters (use dataclass)
|
|
44
|
+
- Deep nesting (> 4 levels)
|
|
45
|
+
- Duplicate code patterns
|
|
46
|
+
- Magic numbers without named constants
|
|
47
|
+
|
|
48
|
+
### HIGH — Concurrency
|
|
49
|
+
- Shared state without locks — use `threading.Lock`
|
|
50
|
+
- Mixing sync/async incorrectly
|
|
51
|
+
- N+1 queries in loops — batch query
|
|
52
|
+
|
|
53
|
+
### MEDIUM — Best Practices
|
|
54
|
+
- PEP 8: import order, naming, spacing
|
|
55
|
+
- Missing docstrings on public functions
|
|
56
|
+
- `print()` instead of `logging`
|
|
57
|
+
- `from module import *` — namespace pollution
|
|
58
|
+
- `value == None` — use `value is None`
|
|
59
|
+
- Shadowing builtins (`list`, `dict`, `str`)
|
|
60
|
+
|
|
61
|
+
## Diagnostic Commands
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
mypy . # Type checking
|
|
65
|
+
ruff check . # Fast linting
|
|
66
|
+
black --check . # Format check
|
|
67
|
+
bandit -r . # Security scan
|
|
68
|
+
pytest --cov=app --cov-report=term-missing # Test coverage
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Review Output Format
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
[SEVERITY] Issue title
|
|
75
|
+
File: path/to/file.py:42
|
|
76
|
+
Issue: Description
|
|
77
|
+
Fix: What to change
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Approval Criteria
|
|
81
|
+
|
|
82
|
+
- **Approve**: No CRITICAL or HIGH issues
|
|
83
|
+
- **Warning**: MEDIUM issues only (can merge with caution)
|
|
84
|
+
- **Block**: CRITICAL or HIGH issues found
|
|
85
|
+
|
|
86
|
+
## Framework Checks
|
|
87
|
+
|
|
88
|
+
- **Django**: `select_related`/`prefetch_related` for N+1, `atomic()` for multi-step, migrations
|
|
89
|
+
- **FastAPI**: CORS config, Pydantic validation, response models, no blocking in async
|
|
90
|
+
- **Flask**: Proper error handlers, CSRF protection
|
|
91
|
+
|
|
92
|
+
## Reference
|
|
93
|
+
|
|
94
|
+
For detailed Python patterns, security examples, and code samples, see skill: `python-patterns`.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
Review with the mindset: "Would this code pass review at a top Python shop or open-source project?"
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run the Django reviewer over the current change for ORM correctness, DRF patterns, migration safety, and security.
|
|
3
|
+
argument-hint: [base ref]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Invoke the django-reviewer subagent on the changed Django files (the diff since $ARGUMENTS, or the working tree if no ref is given). It checks ORM correctness (N+1, atomic(), bulk_create), DRF serializer/permission/pagination patterns, migration safety, and security misconfigurations (mark_safe, CSRF, DEBUG, SECRET_KEY), reporting file:line + severity. Run `python-review` too for general Python quality. Fix any CRITICAL or HIGH findings before merging.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run the FastAPI reviewer over the current change for async correctness, DI, schemas, and API security.
|
|
3
|
+
argument-hint: [base ref]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Invoke the fastapi-reviewer subagent on the changed FastAPI files (the diff since $ARGUMENTS, or the working tree if no ref is given). It checks app construction, routing, Pydantic request/response schemas, async dependency injection, auth/CORS/rate limits, and test dependency overrides, reporting file:line + severity plus `Tests checked:` and `Residual risk:`. Fix any Critical or High findings before merging.
|
|
@@ -3,4 +3,4 @@ description: Run the Python reviewer over the current change against this pack's
|
|
|
3
3
|
argument-hint: [base ref]
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Invoke the python-reviewer subagent on the changed Python files (the diff since $ARGUMENTS, or the working tree if no ref is given). It checks this pack's conventions — frozen dataclasses for value objects, Protocols for structural typing, `raise ... from`, and os.environ[] over silent .get() fallbacks — and reports file:line + severity. Style and coverage are CI's job; don't re-litigate them. Fix any
|
|
6
|
+
Invoke the python-reviewer subagent on the changed Python files (the diff since $ARGUMENTS, or the working tree if no ref is given). It checks this pack's conventions — frozen dataclasses for value objects, Protocols for structural typing, `raise ... from`, and os.environ[] over silent .get() fallbacks, plus security, type hints, and code quality — and reports file:line + severity. Style and coverage are CI's job; don't re-litigate them. Fix any CRITICAL or HIGH findings before merging.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"hooks": [
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
9
|
-
"command": "if command -v ruff >/dev/null 2>&1; then ruff check
|
|
9
|
+
"command": "if ls *.py >/dev/null 2>&1 || [ -f pyproject.toml ]; then if command -v ruff >/dev/null 2>&1; then ruff check . || echo \"ruff failing (python-rules)\"; fi; fi"
|
|
10
10
|
}
|
|
11
11
|
]
|
|
12
12
|
}
|