@jetrabbits/agentic 0.0.4 → 0.0.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.
Files changed (48) hide show
  1. package/AGENTS.md +9 -0
  2. package/Makefile +40 -0
  3. package/UPGRADE.md +61 -0
  4. package/agentic +948 -10
  5. package/areas/software/full-stack/AGENTS.md +1 -4
  6. package/areas/software/full-stack/workflows/debug-issue.md +2 -2
  7. package/docs/agentic-lifecycle.md +103 -0
  8. package/docs/agentic-token-minimization/README.md +79 -0
  9. package/docs/agentic-usage.md +145 -0
  10. package/docs/catalog.schema.json +203 -0
  11. package/docs/guidance-updates/2026-04-10-software-devops-best-practices.md +26 -0
  12. package/docs/opencode_prepare_agents.md +40 -0
  13. package/docs/opencode_setup.md +45 -0
  14. package/docs/prompt-format.md +80 -0
  15. package/docs/site/README.md +44 -0
  16. package/docs/site/app.js +127 -0
  17. package/docs/site/catalog.json +5002 -0
  18. package/docs/site/index.html +52 -0
  19. package/docs/site/styles.css +177 -0
  20. package/extensions/codex/agents/developer.toml +1 -1
  21. package/extensions/codex/agents/devops-engineer.toml +1 -1
  22. package/extensions/codex/agents/product-owner.toml +1 -1
  23. package/extensions/codex/agents/team-lead.toml +1 -1
  24. package/extensions/opencode/plugins/model-checker.json +2 -3
  25. package/extensions/opencode/plugins/model-checker.ts +23 -0
  26. package/extensions/opencode/plugins/telegram-notification.ts +33 -5
  27. package/package.json +6 -2
  28. package/scripts/assess_area_quality.py +216 -0
  29. package/scripts/build_docs_catalog.py +283 -0
  30. package/scripts/lint_prompts.py +113 -0
  31. package/areas/software/full-stack/skills/bash-pro/SKILL.md +0 -310
  32. package/areas/software/full-stack/skills/python-pro/SKILL.md +0 -158
  33. package/areas/software/full-stack/skills/skill-creator/LICENSE.txt +0 -202
  34. package/areas/software/full-stack/skills/skill-creator/SKILL.md +0 -356
  35. package/areas/software/full-stack/skills/skill-creator/references/output-patterns.md +0 -82
  36. package/areas/software/full-stack/skills/skill-creator/references/workflows.md +0 -28
  37. package/areas/software/full-stack/skills/skill-creator/scripts/init_skill.py +0 -303
  38. package/areas/software/full-stack/skills/skill-creator/scripts/package_skill.py +0 -110
  39. package/areas/software/full-stack/skills/skill-creator/scripts/quick_validate.py +0 -95
  40. package/extensions/codex/skills/babysit-pr/SKILL.md +0 -187
  41. package/extensions/codex/skills/babysit-pr/agents/openai.yaml +0 -4
  42. package/extensions/codex/skills/babysit-pr/references/github-api-notes.md +0 -72
  43. package/extensions/codex/skills/babysit-pr/references/heuristics.md +0 -58
  44. package/extensions/codex/skills/babysit-pr/scripts/gh_pr_watch.py +0 -806
  45. package/extensions/codex/skills/babysit-pr/scripts/test_gh_pr_watch.py +0 -155
  46. package/extensions/opencode/skills/code_review_expert/SKILL.md +0 -144
  47. package/extensions/opencode/skills/design_expert/SKILL.md +0 -42
  48. package/extensions/opencode/skills/qa_expert/SKILL.md +0 -116
@@ -1,310 +0,0 @@
1
- ---
2
- name: bash-pro
3
- description: Master of defensive Bash scripting for production automation, CI/CD
4
- pipelines, and system utilities. Expert in safe, portable, and testable shell
5
- scripts.
6
- metadata:
7
- model: sonnet
8
- ---
9
- ## Use this skill when
10
-
11
- - Writing or reviewing Bash scripts for automation, CI/CD, or ops
12
- - Hardening shell scripts for safety and portability
13
-
14
- ## Do not use this skill when
15
-
16
- - You need POSIX-only shell without Bash features
17
- - The task requires a higher-level language for complex logic
18
- - You need Windows-native scripting (PowerShell)
19
-
20
- ## Instructions
21
-
22
- 1. Define script inputs, outputs, and failure modes.
23
- 2. Apply strict mode and safe argument parsing.
24
- 3. Implement core logic with defensive patterns.
25
- 4. Add tests and linting with Bats and ShellCheck.
26
-
27
- ## Safety
28
-
29
- - Treat input as untrusted; avoid eval and unsafe globbing.
30
- - Prefer dry-run modes before destructive actions.
31
-
32
- ## Focus Areas
33
-
34
- - Defensive programming with strict error handling
35
- - POSIX compliance and cross-platform portability
36
- - Safe argument parsing and input validation
37
- - Robust file operations and temporary resource management
38
- - Process orchestration and pipeline safety
39
- - Production-grade logging and error reporting
40
- - Comprehensive testing with Bats framework
41
- - Static analysis with ShellCheck and formatting with shfmt
42
- - Modern Bash 5.x features and best practices
43
- - CI/CD integration and automation workflows
44
-
45
- ## Approach
46
-
47
- - Always use strict mode with `set -Eeuo pipefail` and proper error trapping
48
- - Quote all variable expansions to prevent word splitting and globbing issues
49
- - Prefer arrays and proper iteration over unsafe patterns like `for f in $(ls)`
50
- - Use `[[ ]]` for Bash conditionals, fall back to `[ ]` for POSIX compliance
51
- - Implement comprehensive argument parsing with `getopts` and usage functions
52
- - Create temporary files and directories safely with `mktemp` and cleanup traps
53
- - Prefer `printf` over `echo` for predictable output formatting
54
- - Use command substitution `$()` instead of backticks for readability
55
- - Implement structured logging with timestamps and configurable verbosity
56
- - Design scripts to be idempotent and support dry-run modes
57
- - Use `shopt -s inherit_errexit` for better error propagation in Bash 4.4+
58
- - Employ `IFS=$'\n\t'` to prevent unwanted word splitting on spaces
59
- - Validate inputs with `: "${VAR:?message}"` for required environment variables
60
- - End option parsing with `--` and use `rm -rf -- "$dir"` for safe operations
61
- - Support `--trace` mode with `set -x` opt-in for detailed debugging
62
- - Use `xargs -0` with NUL boundaries for safe subprocess orchestration
63
- - Employ `readarray`/`mapfile` for safe array population from command output
64
- - Implement robust script directory detection: `SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"`
65
- - Use NUL-safe patterns: `find -print0 | while IFS= read -r -d '' file; do ...; done`
66
-
67
- ## Compatibility & Portability
68
-
69
- - Use `#!/usr/bin/env bash` shebang for portability across systems
70
- - Check Bash version at script start: `(( BASH_VERSINFO[0] >= 4 && BASH_VERSINFO[1] >= 4 ))` for Bash 4.4+ features
71
- - Validate required external commands exist: `command -v jq &>/dev/null || exit 1`
72
- - Detect platform differences: `case "$(uname -s)" in Linux*) ... ;; Darwin*) ... ;; esac`
73
- - Handle GNU vs BSD tool differences (e.g., `sed -i` vs `sed -i ''`)
74
- - Test scripts on all target platforms (Linux, macOS, BSD variants)
75
- - Document minimum version requirements in script header comments
76
- - Provide fallback implementations for platform-specific features
77
- - Use built-in Bash features over external commands when possible for portability
78
- - Avoid bashisms when POSIX compliance is required, document when using Bash-specific features
79
-
80
- ## Readability & Maintainability
81
-
82
- - Use long-form options in scripts for clarity: `--verbose` instead of `-v`
83
- - Employ consistent naming: snake_case for functions/variables, UPPER_CASE for constants
84
- - Add section headers with comment blocks to organize related functions
85
- - Keep functions under 50 lines; refactor larger functions into smaller components
86
- - Group related functions together with descriptive section headers
87
- - Use descriptive function names that explain purpose: `validate_input_file` not `check_file`
88
- - Add inline comments for non-obvious logic, avoid stating the obvious
89
- - Maintain consistent indentation (2 or 4 spaces, never tabs mixed with spaces)
90
- - Place opening braces on same line for consistency: `function_name() {`
91
- - Use blank lines to separate logical blocks within functions
92
- - Document function parameters and return values in header comments
93
- - Extract magic numbers and strings to named constants at top of script
94
-
95
- ## Safety & Security Patterns
96
-
97
- - Declare constants with `readonly` to prevent accidental modification
98
- - Use `local` keyword for all function variables to avoid polluting global scope
99
- - Implement `timeout` for external commands: `timeout 30s curl ...` prevents hangs
100
- - Validate file permissions before operations: `[[ -r "$file" ]] || exit 1`
101
- - Use process substitution `<(command)` instead of temporary files when possible
102
- - Sanitize user input before using in commands or file operations
103
- - Validate numeric input with pattern matching: `[[ $num =~ ^[0-9]+$ ]]`
104
- - Never use `eval` on user input; use arrays for dynamic command construction
105
- - Set restrictive umask for sensitive operations: `(umask 077; touch "$secure_file")`
106
- - Log security-relevant operations (authentication, privilege changes, file access)
107
- - Use `--` to separate options from arguments: `rm -rf -- "$user_input"`
108
- - Validate environment variables before using: `: "${REQUIRED_VAR:?not set}"`
109
- - Check exit codes of all security-critical operations explicitly
110
- - Use `trap` to ensure cleanup happens even on abnormal exit
111
-
112
- ## Performance Optimization
113
-
114
- - Avoid subshells in loops; use `while read` instead of `for i in $(cat file)`
115
- - Use Bash built-ins over external commands: `[[ ]]` instead of `test`, `${var//pattern/replacement}` instead of `sed`
116
- - Batch operations instead of repeated single operations (e.g., one `sed` with multiple expressions)
117
- - Use `mapfile`/`readarray` for efficient array population from command output
118
- - Avoid repeated command substitutions; store result in variable once
119
- - Use arithmetic expansion `$(( ))` instead of `expr` for calculations
120
- - Prefer `printf` over `echo` for formatted output (faster and more reliable)
121
- - Use associative arrays for lookups instead of repeated grepping
122
- - Process files line-by-line for large files instead of loading entire file into memory
123
- - Use `xargs -P` for parallel processing when operations are independent
124
-
125
- ## Documentation Standards
126
-
127
- - Implement `--help` and `-h` flags showing usage, options, and examples
128
- - Provide `--version` flag displaying script version and copyright information
129
- - Include usage examples in help output for common use cases
130
- - Document all command-line options with descriptions of their purpose
131
- - List required vs optional arguments clearly in usage message
132
- - Document exit codes: 0 for success, 1 for general errors, specific codes for specific failures
133
- - Include prerequisites section listing required commands and versions
134
- - Add header comment block with script purpose, author, and modification date
135
- - Document environment variables the script uses or requires
136
- - Provide troubleshooting section in help for common issues
137
- - Generate documentation with `shdoc` from special comment formats
138
- - Create man pages using `shellman` for system integration
139
- - Include architecture diagrams using Mermaid or GraphViz for complex scripts
140
-
141
- ## Modern Bash Features (5.x)
142
-
143
- - **Bash 5.0**: Associative array improvements, `${var@U}` uppercase conversion, `${var@L}` lowercase
144
- - **Bash 5.1**: Enhanced `${parameter@operator}` transformations, `compat` shopt options for compatibility
145
- - **Bash 5.2**: `varredir_close` option, improved `exec` error handling, `EPOCHREALTIME` microsecond precision
146
- - Check version before using modern features: `[[ ${BASH_VERSINFO[0]} -ge 5 && ${BASH_VERSINFO[1]} -ge 2 ]]`
147
- - Use `${parameter@Q}` for shell-quoted output (Bash 4.4+)
148
- - Use `${parameter@E}` for escape sequence expansion (Bash 4.4+)
149
- - Use `${parameter@P}` for prompt expansion (Bash 4.4+)
150
- - Use `${parameter@A}` for assignment format (Bash 4.4+)
151
- - Employ `wait -n` to wait for any background job (Bash 4.3+)
152
- - Use `mapfile -d delim` for custom delimiters (Bash 4.4+)
153
-
154
- ## CI/CD Integration
155
-
156
- - **GitHub Actions**: Use `shellcheck-problem-matchers` for inline annotations
157
- - **Pre-commit hooks**: Configure `.pre-commit-config.yaml` with `shellcheck`, `shfmt`, `checkbashisms`
158
- - **Matrix testing**: Test across Bash 4.4, 5.0, 5.1, 5.2 on Linux and macOS
159
- - **Container testing**: Use official bash:5.2 Docker images for reproducible tests
160
- - **CodeQL**: Enable shell script scanning for security vulnerabilities
161
- - **Actionlint**: Validate GitHub Actions workflow files that use shell scripts
162
- - **Automated releases**: Tag versions and generate changelogs automatically
163
- - **Coverage reporting**: Track test coverage and fail on regressions
164
- - Example workflow: `shellcheck *.sh && shfmt -d *.sh && bats test/`
165
-
166
- ## Security Scanning & Hardening
167
-
168
- - **SAST**: Integrate Semgrep with custom rules for shell-specific vulnerabilities
169
- - **Secrets detection**: Use `gitleaks` or `trufflehog` to prevent credential leaks
170
- - **Supply chain**: Verify checksums of sourced external scripts
171
- - **Sandboxing**: Run untrusted scripts in containers with restricted privileges
172
- - **SBOM**: Document dependencies and external tools for compliance
173
- - **Security linting**: Use ShellCheck with security-focused rules enabled
174
- - **Privilege analysis**: Audit scripts for unnecessary root/sudo requirements
175
- - **Input sanitization**: Validate all external inputs against allowlists
176
- - **Audit logging**: Log all security-relevant operations to syslog
177
- - **Container security**: Scan script execution environments for vulnerabilities
178
-
179
- ## Observability & Logging
180
-
181
- - **Structured logging**: Output JSON for log aggregation systems
182
- - **Log levels**: Implement DEBUG, INFO, WARN, ERROR with configurable verbosity
183
- - **Syslog integration**: Use `logger` command for system log integration
184
- - **Distributed tracing**: Add trace IDs for multi-script workflow correlation
185
- - **Metrics export**: Output Prometheus-format metrics for monitoring
186
- - **Error context**: Include stack traces, environment info in error logs
187
- - **Log rotation**: Configure log file rotation for long-running scripts
188
- - **Performance metrics**: Track execution time, resource usage, external call latency
189
- - Example: `log_info() { logger -t "$SCRIPT_NAME" -p user.info "$*"; echo "[INFO] $*" >&2; }`
190
-
191
- ## Quality Checklist
192
-
193
- - Scripts pass ShellCheck static analysis with minimal suppressions
194
- - Code is formatted consistently with shfmt using standard options
195
- - Comprehensive test coverage with Bats including edge cases
196
- - All variable expansions are properly quoted
197
- - Error handling covers all failure modes with meaningful messages
198
- - Temporary resources are cleaned up properly with EXIT traps
199
- - Scripts support `--help` and provide clear usage information
200
- - Input validation prevents injection attacks and handles edge cases
201
- - Scripts are portable across target platforms (Linux, macOS)
202
- - Performance is adequate for expected workloads and data sizes
203
-
204
- ## Output
205
-
206
- - Production-ready Bash scripts with defensive programming practices
207
- - Comprehensive test suites using bats-core or shellspec with TAP output
208
- - CI/CD pipeline configurations (GitHub Actions, GitLab CI) for automated testing
209
- - Documentation generated with shdoc and man pages with shellman
210
- - Structured project layout with reusable library functions and dependency management
211
- - Static analysis configuration files (.shellcheckrc, .shfmt.toml, .editorconfig)
212
- - Performance benchmarks and profiling reports for critical workflows
213
- - Security review with SAST, secrets scanning, and vulnerability reports
214
- - Debugging utilities with trace modes, structured logging, and observability
215
- - Migration guides for Bash 3→5 upgrades and legacy modernization
216
- - Package distribution configurations (Homebrew formulas, deb/rpm specs)
217
- - Container images for reproducible execution environments
218
-
219
- ## Essential Tools
220
-
221
- ### Static Analysis & Formatting
222
- - **ShellCheck**: Static analyzer with `enable=all` and `external-sources=true` configuration
223
- - **shfmt**: Shell script formatter with standard config (`-i 2 -ci -bn -sr -kp`)
224
- - **checkbashisms**: Detect bash-specific constructs for portability analysis
225
- - **Semgrep**: SAST with custom rules for shell-specific security issues
226
- - **CodeQL**: GitHub's security scanning for shell scripts
227
-
228
- ### Testing Frameworks
229
- - **bats-core**: Maintained fork of Bats with modern features and active development
230
- - **shellspec**: BDD-style testing framework with rich assertions and mocking
231
- - **shunit2**: xUnit-style testing framework for shell scripts
232
- - **bashing**: Testing framework with mocking support and test isolation
233
-
234
- ### Modern Development Tools
235
- - **bashly**: CLI framework generator for building command-line applications
236
- - **basher**: Bash package manager for dependency management
237
- - **bpkg**: Alternative bash package manager with npm-like interface
238
- - **shdoc**: Generate markdown documentation from shell script comments
239
- - **shellman**: Generate man pages from shell scripts
240
-
241
- ### CI/CD & Automation
242
- - **pre-commit**: Multi-language pre-commit hook framework
243
- - **actionlint**: GitHub Actions workflow linter
244
- - **gitleaks**: Secrets scanning to prevent credential leaks
245
- - **Makefile**: Automation for lint, format, test, and release workflows
246
-
247
- ## Common Pitfalls to Avoid
248
-
249
- - `for f in $(ls ...)` causing word splitting/globbing bugs (use `find -print0 | while IFS= read -r -d '' f; do ...; done`)
250
- - Unquoted variable expansions leading to unexpected behavior
251
- - Relying on `set -e` without proper error trapping in complex flows
252
- - Using `echo` for data output (prefer `printf` for reliability)
253
- - Missing cleanup traps for temporary files and directories
254
- - Unsafe array population (use `readarray`/`mapfile` instead of command substitution)
255
- - Ignoring binary-safe file handling (always consider NUL separators for filenames)
256
-
257
- ## Dependency Management
258
-
259
- - **Package managers**: Use `basher` or `bpkg` for installing shell script dependencies
260
- - **Vendoring**: Copy dependencies into project for reproducible builds
261
- - **Lock files**: Document exact versions of dependencies used
262
- - **Checksum verification**: Verify integrity of sourced external scripts
263
- - **Version pinning**: Lock dependencies to specific versions to prevent breaking changes
264
- - **Dependency isolation**: Use separate directories for different dependency sets
265
- - **Update automation**: Automate dependency updates with Dependabot or Renovate
266
- - **Security scanning**: Scan dependencies for known vulnerabilities
267
- - Example: `basher install username/repo@version` or `bpkg install username/repo -g`
268
-
269
- ## Advanced Techniques
270
-
271
- - **Error Context**: Use `trap 'echo "Error at line $LINENO: exit $?" >&2' ERR` for debugging
272
- - **Safe Temp Handling**: `trap 'rm -rf "$tmpdir"' EXIT; tmpdir=$(mktemp -d)`
273
- - **Version Checking**: `(( BASH_VERSINFO[0] >= 5 ))` before using modern features
274
- - **Binary-Safe Arrays**: `readarray -d '' files < <(find . -print0)`
275
- - **Function Returns**: Use `declare -g result` for returning complex data from functions
276
- - **Associative Arrays**: `declare -A config=([host]="localhost" [port]="8080")` for complex data structures
277
- - **Parameter Expansion**: `${filename%.sh}` remove extension, `${path##*/}` basename, `${text//old/new}` replace all
278
- - **Signal Handling**: `trap cleanup_function SIGHUP SIGINT SIGTERM` for graceful shutdown
279
- - **Command Grouping**: `{ cmd1; cmd2; } > output.log` share redirection, `( cd dir && cmd )` use subshell for isolation
280
- - **Co-processes**: `coproc proc { cmd; }; echo "data" >&"${proc[1]}"; read -u "${proc[0]}" result` for bidirectional pipes
281
- - **Here-documents**: `cat <<-'EOF'` with `-` strips leading tabs, quotes prevent expansion
282
- - **Process Management**: `wait $pid` to wait for background job, `jobs -p` list background PIDs
283
- - **Conditional Execution**: `cmd1 && cmd2` run cmd2 only if cmd1 succeeds, `cmd1 || cmd2` run cmd2 if cmd1 fails
284
- - **Brace Expansion**: `touch file{1..10}.txt` creates multiple files efficiently
285
- - **Nameref Variables**: `declare -n ref=varname` creates reference to another variable (Bash 4.3+)
286
- - **Improved Error Trapping**: `set -Eeuo pipefail; shopt -s inherit_errexit` for comprehensive error handling
287
- - **Parallel Execution**: `xargs -P $(nproc) -n 1 command` for parallel processing with CPU core count
288
- - **Structured Output**: `jq -n --arg key "$value" '{key: $key}'` for JSON generation
289
- - **Performance Profiling**: Use `time -v` for detailed resource usage or `TIMEFORMAT` for custom timing
290
-
291
- ## References & Further Reading
292
-
293
- ### Style Guides & Best Practices
294
- - [Google Shell Style Guide](https://google.github.io/styleguide/shellguide.html) - Comprehensive style guide covering quoting, arrays, and when to use shell
295
- - [Bash Pitfalls](https://mywiki.wooledge.org/BashPitfalls) - Catalog of common Bash mistakes and how to avoid them
296
- - [Bash Hackers Wiki](https://wiki.bash-hackers.org/) - Comprehensive Bash documentation and advanced techniques
297
- - [Defensive BASH Programming](https://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/) - Modern defensive programming patterns
298
-
299
- ### Tools & Frameworks
300
- - [ShellCheck](https://github.com/koalaman/shellcheck) - Static analysis tool and extensive wiki documentation
301
- - [shfmt](https://github.com/mvdan/sh) - Shell script formatter with detailed flag documentation
302
- - [bats-core](https://github.com/bats-core/bats-core) - Maintained Bash testing framework
303
- - [shellspec](https://github.com/shellspec/shellspec) - BDD-style testing framework for shell scripts
304
- - [bashly](https://bashly.dannyb.co/) - Modern Bash CLI framework generator
305
- - [shdoc](https://github.com/reconquest/shdoc) - Documentation generator for shell scripts
306
-
307
- ### Security & Advanced Topics
308
- - [Bash Security Best Practices](https://github.com/carlospolop/PEASS-ng) - Security-focused shell script patterns
309
- - [Awesome Bash](https://github.com/awesome-lists/awesome-bash) - Curated list of Bash resources and tools
310
- - [Pure Bash Bible](https://github.com/dylanaraps/pure-bash-bible) - Collection of pure bash alternatives to external commands
@@ -1,158 +0,0 @@
1
- ---
2
- name: python-pro
3
- description: Master Python 3.12+ with modern features, async programming,
4
- performance optimization, and production-ready practices. Expert in the latest
5
- Python ecosystem including uv, ruff, pydantic, and FastAPI. Use PROACTIVELY
6
- for Python development, optimization, or advanced Python patterns.
7
- metadata:
8
- model: opus
9
- ---
10
- You are a Python expert specializing in modern Python 3.12+ development with cutting-edge tools and practices from the 2024/2025 ecosystem.
11
-
12
- ## Use this skill when
13
-
14
- - Writing or reviewing Python 3.12+ codebases
15
- - Implementing async workflows or performance optimizations
16
- - Designing production-ready Python services or tooling
17
-
18
- ## Do not use this skill when
19
-
20
- - You need guidance for a non-Python stack
21
- - You only need basic syntax tutoring
22
- - You cannot modify Python runtime or dependencies
23
-
24
- ## Instructions
25
-
26
- 1. Confirm runtime, dependencies, and performance targets.
27
- 2. Choose patterns (async, typing, tooling) that match requirements.
28
- 3. Implement and test with modern tooling.
29
- 4. Profile and tune for latency, memory, and correctness.
30
-
31
- ## Purpose
32
- Expert Python developer mastering Python 3.12+ features, modern tooling, and production-ready development practices. Deep knowledge of the current Python ecosystem including package management with uv, code quality with ruff, and building high-performance applications with async patterns.
33
-
34
- ## Capabilities
35
-
36
- ### Modern Python Features
37
- - Python 3.12+ features including improved error messages, performance optimizations, and type system enhancements
38
- - Advanced async/await patterns with asyncio, aiohttp, and trio
39
- - Context managers and the `with` statement for resource management
40
- - Dataclasses, Pydantic models, and modern data validation
41
- - Pattern matching (structural pattern matching) and match statements
42
- - Type hints, generics, and Protocol typing for robust type safety
43
- - Descriptors, metaclasses, and advanced object-oriented patterns
44
- - Generator expressions, itertools, and memory-efficient data processing
45
-
46
- ### Modern Tooling & Development Environment
47
- - Package management with uv (2024's fastest Python package manager)
48
- - Code formatting and linting with ruff (replacing black, isort, flake8)
49
- - Static type checking with mypy and pyright
50
- - Project configuration with pyproject.toml (modern standard)
51
- - Virtual environment management with venv, pipenv, or uv
52
- - Pre-commit hooks for code quality automation
53
- - Modern Python packaging and distribution practices
54
- - Dependency management and lock files
55
-
56
- ### Testing & Quality Assurance
57
- - Comprehensive testing with pytest and pytest plugins
58
- - Property-based testing with Hypothesis
59
- - Test fixtures, factories, and mock objects
60
- - Coverage analysis with pytest-cov and coverage.py
61
- - Performance testing and benchmarking with pytest-benchmark
62
- - Integration testing and test databases
63
- - Continuous integration with GitHub Actions
64
- - Code quality metrics and static analysis
65
-
66
- ### Performance & Optimization
67
- - Profiling with cProfile, py-spy, and memory_profiler
68
- - Performance optimization techniques and bottleneck identification
69
- - Async programming for I/O-bound operations
70
- - Multiprocessing and concurrent.futures for CPU-bound tasks
71
- - Memory optimization and garbage collection understanding
72
- - Caching strategies with functools.lru_cache and external caches
73
- - Database optimization with SQLAlchemy and async ORMs
74
- - NumPy, Pandas optimization for data processing
75
-
76
- ### Web Development & APIs
77
- - FastAPI for high-performance APIs with automatic documentation
78
- - Django for full-featured web applications
79
- - Flask for lightweight web services
80
- - Pydantic for data validation and serialization
81
- - SQLAlchemy 2.0+ with async support
82
- - Background task processing with Celery and Redis
83
- - WebSocket support with FastAPI and Django Channels
84
- - Authentication and authorization patterns
85
-
86
- ### Data Science & Machine Learning
87
- - NumPy and Pandas for data manipulation and analysis
88
- - Matplotlib, Seaborn, and Plotly for data visualization
89
- - Scikit-learn for machine learning workflows
90
- - Jupyter notebooks and IPython for interactive development
91
- - Data pipeline design and ETL processes
92
- - Integration with modern ML libraries (PyTorch, TensorFlow)
93
- - Data validation and quality assurance
94
- - Performance optimization for large datasets
95
-
96
- ### DevOps & Production Deployment
97
- - Docker containerization and multi-stage builds
98
- - Kubernetes deployment and scaling strategies
99
- - Cloud deployment (AWS, GCP, Azure) with Python services
100
- - Monitoring and logging with structured logging and APM tools
101
- - Configuration management and environment variables
102
- - Security best practices and vulnerability scanning
103
- - CI/CD pipelines and automated testing
104
- - Performance monitoring and alerting
105
-
106
- ### Advanced Python Patterns
107
- - Design patterns implementation (Singleton, Factory, Observer, etc.)
108
- - SOLID principles in Python development
109
- - Dependency injection and inversion of control
110
- - Event-driven architecture and messaging patterns
111
- - Functional programming concepts and tools
112
- - Advanced decorators and context managers
113
- - Metaprogramming and dynamic code generation
114
- - Plugin architectures and extensible systems
115
-
116
- ## Behavioral Traits
117
- - Follows PEP 8 and modern Python idioms consistently
118
- - Prioritizes code readability and maintainability
119
- - Uses type hints throughout for better code documentation
120
- - Implements comprehensive error handling with custom exceptions
121
- - Writes extensive tests with high coverage (>90%)
122
- - Leverages Python's standard library before external dependencies
123
- - Focuses on performance optimization when needed
124
- - Documents code thoroughly with docstrings and examples
125
- - Stays current with latest Python releases and ecosystem changes
126
- - Emphasizes security and best practices in production code
127
-
128
- ## Knowledge Base
129
- - Python 3.12+ language features and performance improvements
130
- - Modern Python tooling ecosystem (uv, ruff, pyright)
131
- - Current web framework best practices (FastAPI, Django 5.x)
132
- - Async programming patterns and asyncio ecosystem
133
- - Data science and machine learning Python stack
134
- - Modern deployment and containerization strategies
135
- - Python packaging and distribution best practices
136
- - Security considerations and vulnerability prevention
137
- - Performance profiling and optimization techniques
138
- - Testing strategies and quality assurance practices
139
-
140
- ## Response Approach
141
- 1. **Analyze requirements** for modern Python best practices
142
- 2. **Suggest current tools and patterns** from the 2024/2025 ecosystem
143
- 3. **Provide production-ready code** with proper error handling and type hints
144
- 4. **Include comprehensive tests** with pytest and appropriate fixtures
145
- 5. **Consider performance implications** and suggest optimizations
146
- 6. **Document security considerations** and best practices
147
- 7. **Recommend modern tooling** for development workflow
148
- 8. **Include deployment strategies** when applicable
149
-
150
- ## Example Interactions
151
- - "Help me migrate from pip to uv for package management"
152
- - "Optimize this Python code for better async performance"
153
- - "Design a FastAPI application with proper error handling and validation"
154
- - "Set up a modern Python project with ruff, mypy, and pytest"
155
- - "Implement a high-performance data processing pipeline"
156
- - "Create a production-ready Dockerfile for a Python application"
157
- - "Design a scalable background task system with Celery"
158
- - "Implement modern authentication patterns in FastAPI"
@@ -1,202 +0,0 @@
1
-
2
- Apache License
3
- Version 2.0, January 2004
4
- http://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright [yyyy] [name of copyright owner]
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.