@mytechtoday/augment-extensions 0.2.0 → 0.5.0
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/README.md +614 -39
- package/augment-extensions/coding-standards/bash/README.md +196 -0
- package/augment-extensions/coding-standards/bash/module.json +163 -0
- package/augment-extensions/coding-standards/bash/rules/naming-conventions.md +336 -0
- package/augment-extensions/coding-standards/bash/rules/universal-standards.md +289 -0
- package/augment-extensions/coding-standards/css/README.md +40 -0
- package/augment-extensions/coding-standards/css/examples/css-examples.css +550 -0
- package/augment-extensions/coding-standards/css/module.json +44 -0
- package/augment-extensions/coding-standards/css/rules/css-modern-features.md +448 -0
- package/augment-extensions/coding-standards/css/rules/css-standards.md +492 -0
- package/augment-extensions/coding-standards/html/README.md +40 -0
- package/augment-extensions/coding-standards/html/examples/html-examples.html +267 -0
- package/augment-extensions/coding-standards/html/examples/responsive-layout.html +505 -0
- package/augment-extensions/coding-standards/html/module.json +44 -0
- package/augment-extensions/coding-standards/html/rules/html-standards.md +349 -0
- package/augment-extensions/coding-standards/html-css-js/README.md +194 -0
- package/augment-extensions/coding-standards/html-css-js/examples/async-examples.js +487 -0
- package/augment-extensions/coding-standards/html-css-js/examples/css-examples.css +550 -0
- package/augment-extensions/coding-standards/html-css-js/examples/dom-examples.js +667 -0
- package/augment-extensions/coding-standards/html-css-js/examples/html-examples.html +267 -0
- package/augment-extensions/coding-standards/html-css-js/examples/javascript-examples.js +612 -0
- package/augment-extensions/coding-standards/html-css-js/examples/responsive-layout.html +505 -0
- package/augment-extensions/coding-standards/html-css-js/module.json +48 -0
- package/augment-extensions/coding-standards/html-css-js/rules/async-patterns.md +515 -0
- package/augment-extensions/coding-standards/html-css-js/rules/css-modern-features.md +448 -0
- package/augment-extensions/coding-standards/html-css-js/rules/css-standards.md +492 -0
- package/augment-extensions/coding-standards/html-css-js/rules/dom-manipulation.md +439 -0
- package/augment-extensions/coding-standards/html-css-js/rules/html-standards.md +349 -0
- package/augment-extensions/coding-standards/html-css-js/rules/javascript-standards.md +486 -0
- package/augment-extensions/coding-standards/html-css-js/rules/performance.md +463 -0
- package/augment-extensions/coding-standards/html-css-js/rules/tooling.md +543 -0
- package/augment-extensions/coding-standards/js/README.md +46 -0
- package/augment-extensions/coding-standards/js/examples/async-examples.js +487 -0
- package/augment-extensions/coding-standards/js/examples/dom-examples.js +667 -0
- package/augment-extensions/coding-standards/js/examples/javascript-examples.js +612 -0
- package/augment-extensions/coding-standards/js/module.json +49 -0
- package/augment-extensions/coding-standards/js/rules/async-patterns.md +515 -0
- package/augment-extensions/coding-standards/js/rules/dom-manipulation.md +439 -0
- package/augment-extensions/coding-standards/js/rules/javascript-standards.md +486 -0
- package/augment-extensions/coding-standards/js/rules/performance.md +463 -0
- package/augment-extensions/coding-standards/js/rules/tooling.md +543 -0
- package/augment-extensions/coding-standards/php/README.md +248 -0
- package/augment-extensions/coding-standards/php/examples/api-endpoint-example.php +204 -0
- package/augment-extensions/coding-standards/php/examples/cli-command-example.php +206 -0
- package/augment-extensions/coding-standards/php/examples/legacy-refactoring-example.php +234 -0
- package/augment-extensions/coding-standards/php/examples/web-application-example.php +211 -0
- package/augment-extensions/coding-standards/php/examples/woocommerce-extension-example.php +215 -0
- package/augment-extensions/coding-standards/php/examples/wordpress-plugin-example.php +189 -0
- package/augment-extensions/coding-standards/php/module.json +166 -0
- package/augment-extensions/coding-standards/php/rules/api-development.md +480 -0
- package/augment-extensions/coding-standards/php/rules/category-configuration.md +332 -0
- package/augment-extensions/coding-standards/php/rules/cli-tools.md +472 -0
- package/augment-extensions/coding-standards/php/rules/cms-integration.md +561 -0
- package/augment-extensions/coding-standards/php/rules/code-quality.md +402 -0
- package/augment-extensions/coding-standards/php/rules/documentation.md +425 -0
- package/augment-extensions/coding-standards/php/rules/ecommerce.md +627 -0
- package/augment-extensions/coding-standards/php/rules/error-handling.md +336 -0
- package/augment-extensions/coding-standards/php/rules/legacy-migration.md +677 -0
- package/augment-extensions/coding-standards/php/rules/naming-conventions.md +279 -0
- package/augment-extensions/coding-standards/php/rules/performance.md +392 -0
- package/augment-extensions/coding-standards/php/rules/psr-standards.md +186 -0
- package/augment-extensions/coding-standards/php/rules/security.md +358 -0
- package/augment-extensions/coding-standards/php/rules/testing.md +403 -0
- package/augment-extensions/coding-standards/php/rules/type-declarations.md +331 -0
- package/augment-extensions/coding-standards/php/rules/web-applications.md +426 -0
- package/augment-extensions/coding-standards/powershell/README.md +154 -0
- package/augment-extensions/coding-standards/powershell/examples/admin-example.ps1 +272 -0
- package/augment-extensions/coding-standards/powershell/examples/automation-example.ps1 +173 -0
- package/augment-extensions/coding-standards/powershell/examples/cloud-example.ps1 +243 -0
- package/augment-extensions/coding-standards/powershell/examples/cross-platform-example.ps1 +297 -0
- package/augment-extensions/coding-standards/powershell/examples/dsc-example.ps1 +224 -0
- package/augment-extensions/coding-standards/powershell/examples/legacy-migration-example.ps1 +340 -0
- package/augment-extensions/coding-standards/powershell/examples/module-example.psm1 +255 -0
- package/augment-extensions/coding-standards/powershell/module.json +165 -0
- package/augment-extensions/coding-standards/powershell/rules/administrative-tools.md +439 -0
- package/augment-extensions/coding-standards/powershell/rules/automation-scripts.md +240 -0
- package/augment-extensions/coding-standards/powershell/rules/cloud-orchestration.md +384 -0
- package/augment-extensions/coding-standards/powershell/rules/configuration-schema.md +383 -0
- package/augment-extensions/coding-standards/powershell/rules/cross-platform-scripts.md +482 -0
- package/augment-extensions/coding-standards/powershell/rules/dsc-configurations.md +296 -0
- package/augment-extensions/coding-standards/powershell/rules/error-handling.md +314 -0
- package/augment-extensions/coding-standards/powershell/rules/legacy-migrations.md +466 -0
- package/augment-extensions/coding-standards/powershell/rules/modules-functions.md +244 -0
- package/augment-extensions/coding-standards/powershell/rules/naming-conventions.md +266 -0
- package/augment-extensions/coding-standards/powershell/rules/performance-optimization.md +209 -0
- package/augment-extensions/coding-standards/powershell/rules/security-practices.md +314 -0
- package/augment-extensions/coding-standards/powershell/rules/testing-guidelines.md +268 -0
- package/augment-extensions/coding-standards/powershell/rules/universal-standards.md +197 -0
- package/augment-extensions/coding-standards/python/README.md +12 -8
- package/augment-extensions/coding-standards/python/examples/best-practices.py +373 -0
- package/augment-extensions/coding-standards/python/module.json +8 -4
- package/augment-extensions/coding-standards/python/rules/async-patterns.md +884 -0
- package/augment-extensions/coding-standards/python/rules/documentation.md +831 -0
- package/augment-extensions/coding-standards/python/rules/error-handling.md +855 -68
- package/augment-extensions/coding-standards/python/rules/testing.md +409 -0
- package/augment-extensions/coding-standards/python/rules/tooling.md +446 -0
- package/augment-extensions/coding-standards/python/rules/type-hints.md +115 -50
- package/augment-extensions/collections/html-css-js/README.md +82 -0
- package/augment-extensions/collections/html-css-js/collection.json +41 -0
- package/augment-extensions/domain-rules/database/README.md +161 -0
- package/augment-extensions/domain-rules/database/examples/flat-database-example.md +793 -0
- package/augment-extensions/domain-rules/database/examples/hybrid-database-example.md +1132 -0
- package/augment-extensions/domain-rules/database/examples/nosql-document-example.md +868 -0
- package/augment-extensions/domain-rules/database/examples/nosql-graph-example.md +805 -0
- package/augment-extensions/domain-rules/database/examples/relational-schema-example.md +621 -0
- package/augment-extensions/domain-rules/database/examples/vector-database-example.md +965 -0
- package/augment-extensions/domain-rules/database/module.json +28 -0
- package/augment-extensions/domain-rules/database/rules/flat-databases.md +624 -0
- package/augment-extensions/domain-rules/database/rules/nosql-databases.md +588 -0
- package/augment-extensions/domain-rules/database/rules/nosql-document-stores.md +856 -0
- package/augment-extensions/domain-rules/database/rules/nosql-graph-databases.md +778 -0
- package/augment-extensions/domain-rules/database/rules/nosql-key-value-stores.md +963 -0
- package/augment-extensions/domain-rules/database/rules/performance-optimization.md +1076 -0
- package/augment-extensions/domain-rules/database/rules/relational-databases.md +697 -0
- package/augment-extensions/domain-rules/database/rules/relational-indexing.md +671 -0
- package/augment-extensions/domain-rules/database/rules/relational-query-optimization.md +607 -0
- package/augment-extensions/domain-rules/database/rules/relational-schema-design.md +907 -0
- package/augment-extensions/domain-rules/database/rules/relational-transactions.md +783 -0
- package/augment-extensions/domain-rules/database/rules/security-standards.md +980 -0
- package/augment-extensions/domain-rules/database/rules/universal-best-practices.md +485 -0
- package/augment-extensions/domain-rules/database/rules/vector-databases.md +521 -0
- package/augment-extensions/domain-rules/database/rules/vector-embeddings.md +858 -0
- package/augment-extensions/domain-rules/database/rules/vector-indexing.md +934 -0
- package/augment-extensions/domain-rules/design/color/themes/catppuccin-latte/README.md +23 -0
- package/augment-extensions/domain-rules/design/color/themes/catppuccin-latte/module.json +26 -0
- package/augment-extensions/domain-rules/design/color/themes/catppuccin-mocha/README.md +23 -0
- package/augment-extensions/domain-rules/design/color/themes/catppuccin-mocha/module.json +26 -0
- package/augment-extensions/domain-rules/design/color/themes/dracula/README.md +23 -0
- package/augment-extensions/domain-rules/design/color/themes/dracula/module.json +26 -0
- package/augment-extensions/domain-rules/design/color/themes/gruvbox-dark/README.md +23 -0
- package/augment-extensions/domain-rules/design/color/themes/gruvbox-dark/module.json +26 -0
- package/augment-extensions/domain-rules/design/color/themes/gruvbox-light/README.md +23 -0
- package/augment-extensions/domain-rules/design/color/themes/gruvbox-light/module.json +26 -0
- package/augment-extensions/domain-rules/design/color/themes/high-contrast/README.md +27 -0
- package/augment-extensions/domain-rules/design/color/themes/high-contrast/module.json +26 -0
- package/augment-extensions/domain-rules/design/color/themes/monokai/README.md +23 -0
- package/augment-extensions/domain-rules/design/color/themes/monokai/module.json +26 -0
- package/augment-extensions/domain-rules/design/color/themes/nord/README.md +23 -0
- package/augment-extensions/domain-rules/design/color/themes/nord/module.json +26 -0
- package/augment-extensions/domain-rules/design/color/themes/one-dark/README.md +23 -0
- package/augment-extensions/domain-rules/design/color/themes/one-dark/module.json +26 -0
- package/augment-extensions/domain-rules/design/color/themes/one-light/README.md +23 -0
- package/augment-extensions/domain-rules/design/color/themes/one-light/module.json +26 -0
- package/augment-extensions/domain-rules/design/color/themes/solarized-dark/README.md +23 -0
- package/augment-extensions/domain-rules/design/color/themes/solarized-dark/module.json +26 -0
- package/augment-extensions/domain-rules/design/color/themes/solarized-light/README.md +23 -0
- package/augment-extensions/domain-rules/design/color/themes/solarized-light/module.json +26 -0
- package/augment-extensions/domain-rules/design/color/themes/tokyo-night/README.md +23 -0
- package/augment-extensions/domain-rules/design/color/themes/tokyo-night/module.json +26 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/README.md +136 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/SCHEMA-VALIDATION-REPORT.md +216 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/examples/brand-kit-example.yaml +292 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/examples/campaign-brief-example.yaml +389 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/examples/content-calendar-example.yaml +643 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/examples/email-newsletter-example.md +376 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/examples/landing-page-example.md +934 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/examples/ppc-ad-copy-example.md +301 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/examples/seo-blog-post-example.md +347 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/examples/social-media-campaign-example.md +606 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/module.json +50 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/rules/affiliate-influencer-marketing.md +593 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/rules/asset-management.md +418 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/rules/brand-consistency.md +210 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/rules/content-marketing.md +337 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/rules/conversion-optimization.md +455 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/rules/direct-sales.md +499 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/rules/email-marketing.md +439 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/rules/legal-compliance.md +227 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/rules/ppc-advertising.md +569 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/rules/seo-optimization.md +470 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/rules/social-media-marketing.md +414 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/rules/universal-marketing.md +177 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/schemas/asset-inventory.schema.json +247 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/schemas/brand-kit.schema.json +326 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/schemas/campaign-brief.schema.json +342 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/schemas/color-palette.schema.json +223 -0
- package/augment-extensions/domain-rules/marketing-standards/seo-sales-marketing/schemas/content-template.schema.json +383 -0
- package/augment-extensions/domain-rules/mcp/README.md +150 -0
- package/augment-extensions/domain-rules/mcp/examples/compressed-example.md +522 -0
- package/augment-extensions/domain-rules/mcp/examples/graph-augmented-example.md +520 -0
- package/augment-extensions/domain-rules/mcp/examples/hybrid-example.md +570 -0
- package/augment-extensions/domain-rules/mcp/examples/state-based-example.md +427 -0
- package/augment-extensions/domain-rules/mcp/examples/token-based-example.md +435 -0
- package/augment-extensions/domain-rules/mcp/examples/vector-based-example.md +502 -0
- package/augment-extensions/domain-rules/mcp/module.json +49 -0
- package/augment-extensions/domain-rules/mcp/rules/compressed-mcp.md +595 -0
- package/augment-extensions/domain-rules/mcp/rules/configuration.md +345 -0
- package/augment-extensions/domain-rules/mcp/rules/graph-augmented-mcp.md +687 -0
- package/augment-extensions/domain-rules/mcp/rules/hybrid-mcp.md +636 -0
- package/augment-extensions/domain-rules/mcp/rules/state-based-mcp.md +484 -0
- package/augment-extensions/domain-rules/mcp/rules/testing-validation.md +360 -0
- package/augment-extensions/domain-rules/mcp/rules/token-based-mcp.md +393 -0
- package/augment-extensions/domain-rules/mcp/rules/universal-rules.md +194 -0
- package/augment-extensions/domain-rules/mcp/rules/vector-based-mcp.md +625 -0
- package/augment-extensions/workflows/beads/module.json +4 -3
- package/augment-extensions/workflows/beads-integration/IMPLEMENTATION-STATUS.md +145 -0
- package/augment-extensions/workflows/beads-integration/README.md +143 -0
- package/augment-extensions/workflows/beads-integration/config/defaults.json +32 -0
- package/augment-extensions/workflows/beads-integration/config/schema.json +140 -0
- package/augment-extensions/workflows/beads-integration/examples/basic-task-generation.md +293 -0
- package/augment-extensions/workflows/beads-integration/module.json +75 -0
- package/augment-extensions/workflows/beads-integration/rules/core-rules.md +219 -0
- package/augment-extensions/workflows/beads-integration/rules/effectiveness-standards.md +256 -0
- package/augment-extensions/workflows/beads-integration/rules/task-generation.md +607 -0
- package/augment-extensions/workflows/database/README.md +195 -0
- package/augment-extensions/workflows/database/ai-prompt-testing.md +295 -0
- package/augment-extensions/workflows/database/examples/migration-example.md +498 -0
- package/augment-extensions/workflows/database/examples/optimization-example.md +496 -0
- package/augment-extensions/workflows/database/examples/schema-design-example.md +444 -0
- package/augment-extensions/workflows/database/module.json +42 -0
- package/augment-extensions/workflows/database/rules/data-migration.md +249 -0
- package/augment-extensions/workflows/database/rules/documentation-standards.md +339 -0
- package/augment-extensions/workflows/database/rules/migration-workflow.md +352 -0
- package/augment-extensions/workflows/database/rules/optimization-workflow.md +435 -0
- package/augment-extensions/workflows/database/rules/schema-design-workflow.md +535 -0
- package/augment-extensions/workflows/database/rules/testing-patterns.md +305 -0
- package/augment-extensions/workflows/database/rules/workflow.md +458 -0
- package/augment-extensions/workflows/openspec/module.json +4 -3
- package/augment-extensions/writing-standards/screenplay/README.md +300 -0
- package/augment-extensions/writing-standards/screenplay/_templates/README.md +121 -0
- package/augment-extensions/writing-standards/screenplay/_templates/genre-template.md +153 -0
- package/augment-extensions/writing-standards/screenplay/_templates/style-template.md +243 -0
- package/augment-extensions/writing-standards/screenplay/_templates/theme-template.md +213 -0
- package/augment-extensions/writing-standards/screenplay/examples/aaa-hollywood-scene.fountain +164 -0
- package/augment-extensions/writing-standards/screenplay/examples/beat-sheet-example.yaml +95 -0
- package/augment-extensions/writing-standards/screenplay/examples/character-profile-example.yaml +116 -0
- package/augment-extensions/writing-standards/screenplay/examples/commercial-30sec.fountain +151 -0
- package/augment-extensions/writing-standards/screenplay/examples/independent-monologue.fountain +67 -0
- package/augment-extensions/writing-standards/screenplay/examples/news-segment.fountain +142 -0
- package/augment-extensions/writing-standards/screenplay/examples/plot-outline-example.yaml +184 -0
- package/augment-extensions/writing-standards/screenplay/examples/tv-episode-teaser.fountain +204 -0
- package/augment-extensions/writing-standards/screenplay/genres/README.md +181 -0
- package/augment-extensions/writing-standards/screenplay/genres/examples/.gitkeep +2 -0
- package/augment-extensions/writing-standards/screenplay/genres/module.json +70 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/.gitkeep +2 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/action.md +399 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/adventure.md +407 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/animation.md +293 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/biographical.md +293 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/comedy.md +401 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/documentary.md +293 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/drama.md +409 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/fantasy.md +293 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/historical.md +293 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/horror.md +268 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/musical.md +294 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/mystery.md +293 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/noir.md +294 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/romance.md +293 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/sci-fi.md +289 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/superhero.md +293 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/thriller.md +294 -0
- package/augment-extensions/writing-standards/screenplay/genres/rules/western.md +293 -0
- package/augment-extensions/writing-standards/screenplay/module.json +124 -0
- package/augment-extensions/writing-standards/screenplay/rules/aaa-hollywood-films.md +339 -0
- package/augment-extensions/writing-standards/screenplay/rules/ai-integration-testing.md +329 -0
- package/augment-extensions/writing-standards/screenplay/rules/character-development.md +169 -0
- package/augment-extensions/writing-standards/screenplay/rules/commercials.md +437 -0
- package/augment-extensions/writing-standards/screenplay/rules/dialogue-writing.md +263 -0
- package/augment-extensions/writing-standards/screenplay/rules/diversity-inclusion.md +261 -0
- package/augment-extensions/writing-standards/screenplay/rules/examples-guide.md +315 -0
- package/augment-extensions/writing-standards/screenplay/rules/formatting-validation.md +413 -0
- package/augment-extensions/writing-standards/screenplay/rules/fountain-format.md +372 -0
- package/augment-extensions/writing-standards/screenplay/rules/independent-films.md +374 -0
- package/augment-extensions/writing-standards/screenplay/rules/live-tv-productions.md +443 -0
- package/augment-extensions/writing-standards/screenplay/rules/narrative-structures.md +207 -0
- package/augment-extensions/writing-standards/screenplay/rules/news-broadcasts.md +444 -0
- package/augment-extensions/writing-standards/screenplay/rules/pacing-timing.md +331 -0
- package/augment-extensions/writing-standards/screenplay/rules/quality-review-checklist.md +334 -0
- package/augment-extensions/writing-standards/screenplay/rules/quick-reference.md +299 -0
- package/augment-extensions/writing-standards/screenplay/rules/screen-continuity.md +263 -0
- package/augment-extensions/writing-standards/screenplay/rules/streaming-content.md +412 -0
- package/augment-extensions/writing-standards/screenplay/rules/trope-management.md +370 -0
- package/augment-extensions/writing-standards/screenplay/rules/tv-series.md +374 -0
- package/augment-extensions/writing-standards/screenplay/rules/universal-formatting.md +339 -0
- package/augment-extensions/writing-standards/screenplay/rules/vscode-integration.md +277 -0
- package/augment-extensions/writing-standards/screenplay/rules/web-content.md +393 -0
- package/augment-extensions/writing-standards/screenplay/schemas/beat-sheet.json +332 -0
- package/augment-extensions/writing-standards/screenplay/schemas/character-profile.json +247 -0
- package/augment-extensions/writing-standards/screenplay/schemas/feature-selection.json +200 -0
- package/augment-extensions/writing-standards/screenplay/schemas/plot-outline.json +233 -0
- package/augment-extensions/writing-standards/screenplay/schemas/screenplay-config.json +245 -0
- package/augment-extensions/writing-standards/screenplay/schemas/trope-inventory.json +221 -0
- package/augment-extensions/writing-standards/screenplay/styles/README.md +159 -0
- package/augment-extensions/writing-standards/screenplay/styles/examples/.gitkeep +2 -0
- package/augment-extensions/writing-standards/screenplay/styles/examples/style-applications.md +1449 -0
- package/augment-extensions/writing-standards/screenplay/styles/module.json +64 -0
- package/augment-extensions/writing-standards/screenplay/styles/rules/.gitkeep +2 -0
- package/augment-extensions/writing-standards/screenplay/styles/rules/dialogue-centric.md +520 -0
- package/augment-extensions/writing-standards/screenplay/styles/rules/ensemble.md +499 -0
- package/augment-extensions/writing-standards/screenplay/styles/rules/epic.md +497 -0
- package/augment-extensions/writing-standards/screenplay/styles/rules/experimental.md +492 -0
- package/augment-extensions/writing-standards/screenplay/styles/rules/flashback.md +509 -0
- package/augment-extensions/writing-standards/screenplay/styles/rules/linear.md +490 -0
- package/augment-extensions/writing-standards/screenplay/styles/rules/minimalist.md +499 -0
- package/augment-extensions/writing-standards/screenplay/styles/rules/non-linear.md +501 -0
- package/augment-extensions/writing-standards/screenplay/styles/rules/poetic.md +499 -0
- package/augment-extensions/writing-standards/screenplay/styles/rules/realistic.md +498 -0
- package/augment-extensions/writing-standards/screenplay/styles/rules/satirical.md +499 -0
- package/augment-extensions/writing-standards/screenplay/styles/rules/surreal.md +508 -0
- package/augment-extensions/writing-standards/screenplay/styles/rules/voice-over.md +500 -0
- package/augment-extensions/writing-standards/screenplay/themes/README.md +158 -0
- package/augment-extensions/writing-standards/screenplay/themes/examples/.gitkeep +2 -0
- package/augment-extensions/writing-standards/screenplay/themes/examples/common-mistakes-and-fixes.md +643 -0
- package/augment-extensions/writing-standards/screenplay/themes/examples/complete-scene-example.md +311 -0
- package/augment-extensions/writing-standards/screenplay/themes/examples/individual-theme-examples.md +562 -0
- package/augment-extensions/writing-standards/screenplay/themes/examples/multi-theme-weaving.md +538 -0
- package/augment-extensions/writing-standards/screenplay/themes/examples/theme-application-guide.md +432 -0
- package/augment-extensions/writing-standards/screenplay/themes/examples/theme-integration-across-acts.md +637 -0
- package/augment-extensions/writing-standards/screenplay/themes/module.json +66 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/.gitkeep +2 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/ambition.md +458 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/betrayal.md +490 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/environment.md +458 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/fate.md +459 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/friendship.md +491 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/growth.md +491 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/identity.md +490 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/isolation.md +464 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/justice.md +461 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/love.md +489 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/power.md +494 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/redemption.md +483 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/revenge.md +489 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/survival.md +496 -0
- package/augment-extensions/writing-standards/screenplay/themes/rules/technology.md +463 -0
- package/cli/MODULES.md +302 -0
- package/cli/dist/cli.js +168 -10
- package/cli/dist/cli.js.map +1 -1
- package/cli/dist/commands/catalog.d.ts +13 -0
- package/cli/dist/commands/catalog.d.ts.map +1 -0
- package/cli/dist/commands/catalog.js +104 -0
- package/cli/dist/commands/catalog.js.map +1 -0
- package/cli/dist/commands/gui.d.ts +6 -0
- package/cli/dist/commands/gui.d.ts.map +1 -0
- package/cli/dist/commands/gui.js +211 -0
- package/cli/dist/commands/gui.js.map +1 -0
- package/cli/dist/commands/init.d.ts.map +1 -1
- package/cli/dist/commands/init.js +12 -0
- package/cli/dist/commands/init.js.map +1 -1
- package/cli/dist/commands/install-rules.d.ts +14 -0
- package/cli/dist/commands/install-rules.d.ts.map +1 -0
- package/cli/dist/commands/install-rules.js +127 -0
- package/cli/dist/commands/install-rules.js.map +1 -0
- package/cli/dist/commands/link.d.ts.map +1 -1
- package/cli/dist/commands/link.js +9 -11
- package/cli/dist/commands/link.js.map +1 -1
- package/cli/dist/commands/list.d.ts.map +1 -1
- package/cli/dist/commands/list.js +11 -28
- package/cli/dist/commands/list.js.map +1 -1
- package/cli/dist/commands/mcp.d.ts +48 -0
- package/cli/dist/commands/mcp.d.ts.map +1 -0
- package/cli/dist/commands/mcp.js +229 -0
- package/cli/dist/commands/mcp.js.map +1 -0
- package/cli/dist/commands/self-remove.d.ts +7 -0
- package/cli/dist/commands/self-remove.d.ts.map +1 -0
- package/cli/dist/commands/self-remove.js +179 -0
- package/cli/dist/commands/self-remove.js.map +1 -0
- package/cli/dist/commands/show.d.ts +19 -0
- package/cli/dist/commands/show.d.ts.map +1 -1
- package/cli/dist/commands/show.js +478 -63
- package/cli/dist/commands/show.js.map +1 -1
- package/cli/dist/commands/skill.d.ts +67 -0
- package/cli/dist/commands/skill.d.ts.map +1 -0
- package/cli/dist/commands/skill.js +513 -0
- package/cli/dist/commands/skill.js.map +1 -0
- package/cli/dist/commands/unlink.d.ts +6 -0
- package/cli/dist/commands/unlink.d.ts.map +1 -0
- package/cli/dist/commands/unlink.js +115 -0
- package/cli/dist/commands/unlink.js.map +1 -0
- package/cli/dist/commands/validate.d.ts +6 -0
- package/cli/dist/commands/validate.d.ts.map +1 -0
- package/cli/dist/commands/validate.js +159 -0
- package/cli/dist/commands/validate.js.map +1 -0
- package/cli/dist/types/gui.d.ts +62 -0
- package/cli/dist/types/gui.d.ts.map +1 -0
- package/cli/dist/types/gui.js +30 -0
- package/cli/dist/types/gui.js.map +1 -0
- package/cli/dist/utils/catalog-sync.d.ts +22 -0
- package/cli/dist/utils/catalog-sync.d.ts.map +1 -0
- package/cli/dist/utils/catalog-sync.js +157 -0
- package/cli/dist/utils/catalog-sync.js.map +1 -0
- package/cli/dist/utils/character-count.d.ts +56 -0
- package/cli/dist/utils/character-count.d.ts.map +1 -0
- package/cli/dist/utils/character-count.js +190 -0
- package/cli/dist/utils/character-count.js.map +1 -0
- package/cli/dist/utils/documentation-validator.d.ts +18 -0
- package/cli/dist/utils/documentation-validator.d.ts.map +1 -0
- package/cli/dist/utils/documentation-validator.js +233 -0
- package/cli/dist/utils/documentation-validator.js.map +1 -0
- package/cli/dist/utils/gui-helpers.d.ts +23 -0
- package/cli/dist/utils/gui-helpers.d.ts.map +1 -0
- package/cli/dist/utils/gui-helpers.js +159 -0
- package/cli/dist/utils/gui-helpers.js.map +1 -0
- package/cli/dist/utils/install-rules.d.ts +32 -0
- package/cli/dist/utils/install-rules.d.ts.map +1 -0
- package/cli/dist/utils/install-rules.js +375 -0
- package/cli/dist/utils/install-rules.js.map +1 -0
- package/cli/dist/utils/mcp-integration.d.ts +70 -0
- package/cli/dist/utils/mcp-integration.d.ts.map +1 -0
- package/cli/dist/utils/mcp-integration.js +292 -0
- package/cli/dist/utils/mcp-integration.js.map +1 -0
- package/cli/dist/utils/module-system.d.ts +232 -0
- package/cli/dist/utils/module-system.d.ts.map +1 -0
- package/cli/dist/utils/module-system.js +900 -0
- package/cli/dist/utils/module-system.js.map +1 -0
- package/cli/dist/utils/modules-catalog.d.ts +33 -0
- package/cli/dist/utils/modules-catalog.d.ts.map +1 -0
- package/cli/dist/utils/modules-catalog.js +163 -0
- package/cli/dist/utils/modules-catalog.js.map +1 -0
- package/cli/dist/utils/rule-install-hooks.d.ts +19 -0
- package/cli/dist/utils/rule-install-hooks.d.ts.map +1 -0
- package/cli/dist/utils/rule-install-hooks.js +224 -0
- package/cli/dist/utils/rule-install-hooks.js.map +1 -0
- package/cli/dist/utils/skill-system.d.ts +95 -0
- package/cli/dist/utils/skill-system.d.ts.map +1 -0
- package/cli/dist/utils/skill-system.js +313 -0
- package/cli/dist/utils/skill-system.js.map +1 -0
- package/modules.md +559 -105
- package/package.json +17 -6
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
# Python Development Tooling
|
|
2
|
+
|
|
3
|
+
Essential tools for Python development: Black, mypy, and Ruff.
|
|
4
|
+
|
|
5
|
+
## Black - Code Formatter
|
|
6
|
+
|
|
7
|
+
Black is an opinionated code formatter that enforces consistent style.
|
|
8
|
+
|
|
9
|
+
### Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install black
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Configuration
|
|
16
|
+
|
|
17
|
+
```toml
|
|
18
|
+
# pyproject.toml
|
|
19
|
+
[tool.black]
|
|
20
|
+
line-length = 88
|
|
21
|
+
target-version = ['py310']
|
|
22
|
+
include = '\.pyi?$'
|
|
23
|
+
extend-exclude = '''
|
|
24
|
+
/(
|
|
25
|
+
# directories
|
|
26
|
+
\.eggs
|
|
27
|
+
| \.git
|
|
28
|
+
| \.hg
|
|
29
|
+
| \.mypy_cache
|
|
30
|
+
| \.tox
|
|
31
|
+
| \.venv
|
|
32
|
+
| build
|
|
33
|
+
| dist
|
|
34
|
+
)/
|
|
35
|
+
'''
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Usage
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Format a file
|
|
42
|
+
black myfile.py
|
|
43
|
+
|
|
44
|
+
# Format a directory
|
|
45
|
+
black src/
|
|
46
|
+
|
|
47
|
+
# Check without modifying
|
|
48
|
+
black --check src/
|
|
49
|
+
|
|
50
|
+
# Show diff
|
|
51
|
+
black --diff src/
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Pre-commit Hook
|
|
55
|
+
|
|
56
|
+
```yaml
|
|
57
|
+
# .pre-commit-config.yaml
|
|
58
|
+
repos:
|
|
59
|
+
- repo: https://github.com/psf/black
|
|
60
|
+
rev: 23.12.1
|
|
61
|
+
hooks:
|
|
62
|
+
- id: black
|
|
63
|
+
language_version: python3.10
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## mypy - Static Type Checker
|
|
67
|
+
|
|
68
|
+
mypy performs static type checking based on type hints.
|
|
69
|
+
|
|
70
|
+
### Installation
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pip install mypy
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Configuration
|
|
77
|
+
|
|
78
|
+
```toml
|
|
79
|
+
# pyproject.toml
|
|
80
|
+
[tool.mypy]
|
|
81
|
+
python_version = "3.10"
|
|
82
|
+
warn_return_any = true
|
|
83
|
+
warn_unused_configs = true
|
|
84
|
+
disallow_untyped_defs = true
|
|
85
|
+
disallow_any_unimported = false
|
|
86
|
+
no_implicit_optional = true
|
|
87
|
+
warn_redundant_casts = true
|
|
88
|
+
warn_unused_ignores = true
|
|
89
|
+
warn_no_return = true
|
|
90
|
+
check_untyped_defs = true
|
|
91
|
+
strict_equality = true
|
|
92
|
+
|
|
93
|
+
# Per-module options
|
|
94
|
+
[[tool.mypy.overrides]]
|
|
95
|
+
module = "tests.*"
|
|
96
|
+
disallow_untyped_defs = false
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Usage
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Check a file
|
|
103
|
+
mypy myfile.py
|
|
104
|
+
|
|
105
|
+
# Check a package
|
|
106
|
+
mypy src/
|
|
107
|
+
|
|
108
|
+
# Check with specific config
|
|
109
|
+
mypy --config-file mypy.ini src/
|
|
110
|
+
|
|
111
|
+
# Show error codes
|
|
112
|
+
mypy --show-error-codes src/
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Common Type Checking Patterns
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
# Ignore specific line
|
|
119
|
+
result = some_function() # type: ignore
|
|
120
|
+
|
|
121
|
+
# Ignore specific error
|
|
122
|
+
result = some_function() # type: ignore[arg-type]
|
|
123
|
+
|
|
124
|
+
# Assert type for mypy
|
|
125
|
+
from typing import cast
|
|
126
|
+
value = cast(str, some_value)
|
|
127
|
+
|
|
128
|
+
# Reveal type (for debugging)
|
|
129
|
+
reveal_type(my_variable) # mypy will show the inferred type
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Ruff - Fast Python Linter
|
|
133
|
+
|
|
134
|
+
Ruff is an extremely fast Python linter written in Rust, replacing Flake8, isort, and more.
|
|
135
|
+
|
|
136
|
+
### Installation
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
pip install ruff
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Configuration
|
|
143
|
+
|
|
144
|
+
```toml
|
|
145
|
+
# pyproject.toml
|
|
146
|
+
[tool.ruff]
|
|
147
|
+
# Same as Black
|
|
148
|
+
line-length = 88
|
|
149
|
+
indent-width = 4
|
|
150
|
+
|
|
151
|
+
# Python version
|
|
152
|
+
target-version = "py310"
|
|
153
|
+
|
|
154
|
+
# Exclude directories
|
|
155
|
+
exclude = [
|
|
156
|
+
".bzr",
|
|
157
|
+
".direnv",
|
|
158
|
+
".eggs",
|
|
159
|
+
".git",
|
|
160
|
+
".git-rewrite",
|
|
161
|
+
".hg",
|
|
162
|
+
".mypy_cache",
|
|
163
|
+
".nox",
|
|
164
|
+
".pants.d",
|
|
165
|
+
".pytype",
|
|
166
|
+
".ruff_cache",
|
|
167
|
+
".svn",
|
|
168
|
+
".tox",
|
|
169
|
+
".venv",
|
|
170
|
+
"__pypackages__",
|
|
171
|
+
"_build",
|
|
172
|
+
"buck-out",
|
|
173
|
+
"build",
|
|
174
|
+
"dist",
|
|
175
|
+
"node_modules",
|
|
176
|
+
"venv",
|
|
177
|
+
]
|
|
178
|
+
|
|
179
|
+
[tool.ruff.lint]
|
|
180
|
+
# Enable rules
|
|
181
|
+
select = [
|
|
182
|
+
"E", # pycodestyle errors
|
|
183
|
+
"W", # pycodestyle warnings
|
|
184
|
+
"F", # pyflakes
|
|
185
|
+
"I", # isort
|
|
186
|
+
"B", # flake8-bugbear
|
|
187
|
+
"C4", # flake8-comprehensions
|
|
188
|
+
"UP", # pyupgrade
|
|
189
|
+
"ARG", # flake8-unused-arguments
|
|
190
|
+
"SIM", # flake8-simplify
|
|
191
|
+
]
|
|
192
|
+
|
|
193
|
+
# Ignore specific rules
|
|
194
|
+
ignore = [
|
|
195
|
+
"E501", # line too long (handled by Black)
|
|
196
|
+
"B008", # do not perform function calls in argument defaults
|
|
197
|
+
]
|
|
198
|
+
|
|
199
|
+
# Allow fix for all enabled rules
|
|
200
|
+
fixable = ["ALL"]
|
|
201
|
+
unfixable = []
|
|
202
|
+
|
|
203
|
+
# Allow unused variables when underscore-prefixed
|
|
204
|
+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
|
205
|
+
|
|
206
|
+
[tool.ruff.format]
|
|
207
|
+
# Use Black-compatible formatting
|
|
208
|
+
quote-style = "double"
|
|
209
|
+
indent-style = "space"
|
|
210
|
+
skip-magic-trailing-comma = false
|
|
211
|
+
line-ending = "auto"
|
|
212
|
+
|
|
213
|
+
[tool.ruff.lint.per-file-ignores]
|
|
214
|
+
# Ignore imports in __init__.py
|
|
215
|
+
"__init__.py" = ["F401"]
|
|
216
|
+
# Ignore unused arguments in tests
|
|
217
|
+
"tests/**/*.py" = ["ARG"]
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Usage
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# Lint files
|
|
224
|
+
ruff check .
|
|
225
|
+
|
|
226
|
+
# Lint and auto-fix
|
|
227
|
+
ruff check --fix .
|
|
228
|
+
|
|
229
|
+
# Format code (alternative to Black)
|
|
230
|
+
ruff format .
|
|
231
|
+
|
|
232
|
+
# Check specific rules
|
|
233
|
+
ruff check --select E,F .
|
|
234
|
+
|
|
235
|
+
# Show rule explanations
|
|
236
|
+
ruff rule E501
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Common Ruff Rules
|
|
240
|
+
|
|
241
|
+
```python
|
|
242
|
+
# E501: Line too long
|
|
243
|
+
# Handled by Black, usually ignored
|
|
244
|
+
|
|
245
|
+
# F401: Imported but unused
|
|
246
|
+
import os # ruff: noqa: F401
|
|
247
|
+
|
|
248
|
+
# F841: Local variable assigned but never used
|
|
249
|
+
result = calculate() # ruff: noqa: F841
|
|
250
|
+
|
|
251
|
+
# B006: Mutable default argument
|
|
252
|
+
def process(items=[]): # Bad
|
|
253
|
+
pass
|
|
254
|
+
|
|
255
|
+
def process(items=None): # Good
|
|
256
|
+
if items is None:
|
|
257
|
+
items = []
|
|
258
|
+
|
|
259
|
+
# C4: Unnecessary comprehension
|
|
260
|
+
# Bad
|
|
261
|
+
list([x for x in items])
|
|
262
|
+
# Good
|
|
263
|
+
list(items)
|
|
264
|
+
|
|
265
|
+
# UP: Use modern Python syntax
|
|
266
|
+
# Bad (Python 3.9-)
|
|
267
|
+
from typing import List
|
|
268
|
+
def process(items: List[str]) -> None:
|
|
269
|
+
pass
|
|
270
|
+
|
|
271
|
+
# Good (Python 3.10+)
|
|
272
|
+
def process(items: list[str]) -> None:
|
|
273
|
+
pass
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Integrated Workflow
|
|
277
|
+
|
|
278
|
+
### pyproject.toml Complete Example
|
|
279
|
+
|
|
280
|
+
```toml
|
|
281
|
+
[tool.black]
|
|
282
|
+
line-length = 88
|
|
283
|
+
target-version = ['py310']
|
|
284
|
+
|
|
285
|
+
[tool.mypy]
|
|
286
|
+
python_version = "3.10"
|
|
287
|
+
warn_return_any = true
|
|
288
|
+
warn_unused_configs = true
|
|
289
|
+
disallow_untyped_defs = true
|
|
290
|
+
no_implicit_optional = true
|
|
291
|
+
warn_redundant_casts = true
|
|
292
|
+
warn_unused_ignores = true
|
|
293
|
+
check_untyped_defs = true
|
|
294
|
+
strict_equality = true
|
|
295
|
+
|
|
296
|
+
[tool.ruff]
|
|
297
|
+
line-length = 88
|
|
298
|
+
target-version = "py310"
|
|
299
|
+
|
|
300
|
+
[tool.ruff.lint]
|
|
301
|
+
select = ["E", "W", "F", "I", "B", "C4", "UP", "ARG", "SIM"]
|
|
302
|
+
ignore = ["E501"]
|
|
303
|
+
fixable = ["ALL"]
|
|
304
|
+
|
|
305
|
+
[tool.pytest.ini_options]
|
|
306
|
+
testpaths = ["tests"]
|
|
307
|
+
python_files = ["test_*.py"]
|
|
308
|
+
python_classes = ["Test*"]
|
|
309
|
+
python_functions = ["test_*"]
|
|
310
|
+
addopts = [
|
|
311
|
+
"--strict-markers",
|
|
312
|
+
"--strict-config",
|
|
313
|
+
"--cov=src",
|
|
314
|
+
"--cov-report=term-missing",
|
|
315
|
+
]
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Pre-commit Configuration
|
|
319
|
+
|
|
320
|
+
```yaml
|
|
321
|
+
# .pre-commit-config.yaml
|
|
322
|
+
repos:
|
|
323
|
+
- repo: https://github.com/psf/black
|
|
324
|
+
rev: 23.12.1
|
|
325
|
+
hooks:
|
|
326
|
+
- id: black
|
|
327
|
+
language_version: python3.10
|
|
328
|
+
|
|
329
|
+
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
|
330
|
+
rev: v0.1.9
|
|
331
|
+
hooks:
|
|
332
|
+
- id: ruff
|
|
333
|
+
args: [--fix, --exit-non-zero-on-fix]
|
|
334
|
+
|
|
335
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
336
|
+
rev: v1.8.0
|
|
337
|
+
hooks:
|
|
338
|
+
- id: mypy
|
|
339
|
+
additional_dependencies: [types-requests]
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### Makefile for Common Tasks
|
|
343
|
+
|
|
344
|
+
```makefile
|
|
345
|
+
.PHONY: format lint type-check test all
|
|
346
|
+
|
|
347
|
+
format:
|
|
348
|
+
black src/ tests/
|
|
349
|
+
ruff check --fix src/ tests/
|
|
350
|
+
|
|
351
|
+
lint:
|
|
352
|
+
ruff check src/ tests/
|
|
353
|
+
|
|
354
|
+
type-check:
|
|
355
|
+
mypy src/
|
|
356
|
+
|
|
357
|
+
test:
|
|
358
|
+
pytest tests/ --cov=src --cov-report=term-missing
|
|
359
|
+
|
|
360
|
+
all: format lint type-check test
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### CI/CD Integration (GitHub Actions)
|
|
364
|
+
|
|
365
|
+
```yaml
|
|
366
|
+
# .github/workflows/ci.yml
|
|
367
|
+
name: CI
|
|
368
|
+
|
|
369
|
+
on: [push, pull_request]
|
|
370
|
+
|
|
371
|
+
jobs:
|
|
372
|
+
test:
|
|
373
|
+
runs-on: ubuntu-latest
|
|
374
|
+
steps:
|
|
375
|
+
- uses: actions/checkout@v3
|
|
376
|
+
|
|
377
|
+
- name: Set up Python
|
|
378
|
+
uses: actions/setup-python@v4
|
|
379
|
+
with:
|
|
380
|
+
python-version: '3.10'
|
|
381
|
+
|
|
382
|
+
- name: Install dependencies
|
|
383
|
+
run: |
|
|
384
|
+
pip install -e ".[dev]"
|
|
385
|
+
|
|
386
|
+
- name: Format check
|
|
387
|
+
run: black --check src/ tests/
|
|
388
|
+
|
|
389
|
+
- name: Lint
|
|
390
|
+
run: ruff check src/ tests/
|
|
391
|
+
|
|
392
|
+
- name: Type check
|
|
393
|
+
run: mypy src/
|
|
394
|
+
|
|
395
|
+
- name: Test
|
|
396
|
+
run: pytest tests/ --cov=src --cov-report=xml
|
|
397
|
+
|
|
398
|
+
- name: Upload coverage
|
|
399
|
+
uses: codecov/codecov-action@v3
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
## Best Practices
|
|
403
|
+
|
|
404
|
+
### DO
|
|
405
|
+
|
|
406
|
+
✅ Use Black for consistent formatting
|
|
407
|
+
✅ Enable strict mypy settings for new projects
|
|
408
|
+
✅ Use Ruff for fast linting and auto-fixes
|
|
409
|
+
✅ Configure tools in pyproject.toml
|
|
410
|
+
✅ Set up pre-commit hooks
|
|
411
|
+
✅ Run tools in CI/CD pipeline
|
|
412
|
+
✅ Fix warnings incrementally in existing projects
|
|
413
|
+
|
|
414
|
+
### DON'T
|
|
415
|
+
|
|
416
|
+
❌ Disable type checking without good reason
|
|
417
|
+
❌ Ignore linter warnings without understanding them
|
|
418
|
+
❌ Use `# type: ignore` excessively
|
|
419
|
+
❌ Skip formatting checks in CI
|
|
420
|
+
❌ Mix different formatting styles
|
|
421
|
+
❌ Commit code without running formatters/linters
|
|
422
|
+
|
|
423
|
+
## Editor Integration
|
|
424
|
+
|
|
425
|
+
### VS Code
|
|
426
|
+
|
|
427
|
+
```json
|
|
428
|
+
// .vscode/settings.json
|
|
429
|
+
{
|
|
430
|
+
"python.formatting.provider": "black",
|
|
431
|
+
"python.linting.enabled": true,
|
|
432
|
+
"python.linting.ruffEnabled": true,
|
|
433
|
+
"python.linting.mypyEnabled": true,
|
|
434
|
+
"editor.formatOnSave": true,
|
|
435
|
+
"editor.codeActionsOnSave": {
|
|
436
|
+
"source.organizeImports": true
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
### PyCharm
|
|
442
|
+
|
|
443
|
+
- Settings → Tools → Black → Enable "On save"
|
|
444
|
+
- Settings → Tools → External Tools → Add Ruff
|
|
445
|
+
- Settings → Editor → Inspections → Enable mypy
|
|
446
|
+
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
# Python Type Hints
|
|
2
2
|
|
|
3
|
-
Use type hints extensively for better code quality and IDE support.
|
|
3
|
+
Use type hints extensively for better code quality and IDE support. Follow PEP 484, PEP 585, and PEP 604 for modern Python 3.10+ syntax.
|
|
4
4
|
|
|
5
5
|
## Basic Type Hints
|
|
6
6
|
|
|
7
7
|
```python
|
|
8
|
-
from typing import List, Dict, Set, Tuple, Optional, Union
|
|
9
|
-
|
|
10
8
|
# Function parameters and return types
|
|
11
9
|
def greet(name: str) -> str:
|
|
12
10
|
return f"Hello, {name}"
|
|
@@ -14,71 +12,100 @@ def greet(name: str) -> str:
|
|
|
14
12
|
def add_numbers(a: int, b: int) -> int:
|
|
15
13
|
return a + b
|
|
16
14
|
|
|
17
|
-
def get_user_age(user_id: int) ->
|
|
15
|
+
def get_user_age(user_id: int) -> int | None:
|
|
18
16
|
"""Returns age or None if user not found"""
|
|
19
17
|
pass
|
|
20
18
|
```
|
|
21
19
|
|
|
22
|
-
## Collection Types
|
|
20
|
+
## Modern Collection Types (Python 3.10+, PEP 585)
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
from typing import List, Dict, Set, Tuple
|
|
22
|
+
Use built-in collection types instead of importing from `typing`.
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
```python
|
|
25
|
+
# Lists - Use list[T] instead of List[T]
|
|
26
|
+
def process_items(items: list[str]) -> list[int]:
|
|
29
27
|
return [len(item) for item in items]
|
|
30
28
|
|
|
31
|
-
# Dictionaries
|
|
32
|
-
def get_user_data() ->
|
|
29
|
+
# Dictionaries - Use dict[K, V] instead of Dict[K, V]
|
|
30
|
+
def get_user_data() -> dict[str, str]:
|
|
33
31
|
return {"name": "John", "email": "john@example.com"}
|
|
34
32
|
|
|
35
|
-
# Sets
|
|
36
|
-
def get_unique_ids() ->
|
|
33
|
+
# Sets - Use set[T] instead of Set[T]
|
|
34
|
+
def get_unique_ids() -> set[int]:
|
|
37
35
|
return {1, 2, 3, 4, 5}
|
|
38
36
|
|
|
39
|
-
# Tuples
|
|
40
|
-
def get_coordinates() ->
|
|
37
|
+
# Tuples - Use tuple[T, ...] instead of Tuple[T, ...]
|
|
38
|
+
def get_coordinates() -> tuple[float, float]:
|
|
41
39
|
return (10.5, 20.3)
|
|
40
|
+
|
|
41
|
+
# Variable-length tuples
|
|
42
|
+
def get_values() -> tuple[int, ...]:
|
|
43
|
+
return (1, 2, 3, 4, 5)
|
|
42
44
|
```
|
|
43
45
|
|
|
44
|
-
##
|
|
46
|
+
## Union Types (Python 3.10+, PEP 604)
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
from typing import Optional, Union
|
|
48
|
+
Use `X | Y` syntax instead of `Union[X, Y]`.
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
```python
|
|
51
|
+
# Union with None (replaces Optional[T])
|
|
52
|
+
def find_user(user_id: int) -> User | None:
|
|
51
53
|
"""Returns User or None if not found"""
|
|
52
54
|
pass
|
|
53
55
|
|
|
54
|
-
# Union
|
|
55
|
-
def process_value(value:
|
|
56
|
+
# Union of multiple types
|
|
57
|
+
def process_value(value: int | str) -> str:
|
|
56
58
|
return str(value)
|
|
57
59
|
|
|
58
60
|
# Multiple optional parameters
|
|
59
61
|
def create_user(
|
|
60
62
|
name: str,
|
|
61
63
|
email: str,
|
|
62
|
-
age:
|
|
63
|
-
phone:
|
|
64
|
+
age: int | None = None,
|
|
65
|
+
phone: str | None = None
|
|
64
66
|
) -> User:
|
|
65
67
|
pass
|
|
68
|
+
|
|
69
|
+
# Complex unions
|
|
70
|
+
def parse_config(value: str | int | float | bool) -> dict[str, str | int]:
|
|
71
|
+
pass
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Legacy Syntax (Python 3.9 and earlier)
|
|
75
|
+
|
|
76
|
+
For compatibility with older Python versions, use `typing` module imports.
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
from typing import Optional, Union, List, Dict, Set, Tuple
|
|
80
|
+
|
|
81
|
+
# Optional (value or None)
|
|
82
|
+
def find_user(user_id: int) -> Optional[User]:
|
|
83
|
+
pass
|
|
84
|
+
|
|
85
|
+
# Union (multiple possible types)
|
|
86
|
+
def process_value(value: Union[int, str]) -> str:
|
|
87
|
+
return str(value)
|
|
88
|
+
|
|
89
|
+
# Collections
|
|
90
|
+
def process_items(items: List[str]) -> List[int]:
|
|
91
|
+
return [len(item) for item in items]
|
|
66
92
|
```
|
|
67
93
|
|
|
68
94
|
## Generic Types
|
|
69
95
|
|
|
70
96
|
```python
|
|
71
|
-
from typing import TypeVar, Generic
|
|
97
|
+
from typing import TypeVar, Generic
|
|
72
98
|
|
|
73
99
|
T = TypeVar('T')
|
|
74
100
|
|
|
101
|
+
# Modern syntax (Python 3.10+)
|
|
75
102
|
class Stack(Generic[T]):
|
|
76
103
|
def __init__(self) -> None:
|
|
77
|
-
self._items:
|
|
78
|
-
|
|
104
|
+
self._items: list[T] = []
|
|
105
|
+
|
|
79
106
|
def push(self, item: T) -> None:
|
|
80
107
|
self._items.append(item)
|
|
81
|
-
|
|
108
|
+
|
|
82
109
|
def pop(self) -> T:
|
|
83
110
|
return self._items.pop()
|
|
84
111
|
|
|
@@ -90,13 +117,13 @@ str_stack: Stack[str] = Stack()
|
|
|
90
117
|
## Callable Types
|
|
91
118
|
|
|
92
119
|
```python
|
|
93
|
-
from
|
|
120
|
+
from collections.abc import Callable
|
|
94
121
|
|
|
95
|
-
# Function that takes a callback
|
|
122
|
+
# Function that takes a callback (modern syntax)
|
|
96
123
|
def process_data(
|
|
97
|
-
data:
|
|
124
|
+
data: list[int],
|
|
98
125
|
callback: Callable[[int], str]
|
|
99
|
-
) ->
|
|
126
|
+
) -> list[str]:
|
|
100
127
|
return [callback(item) for item in data]
|
|
101
128
|
|
|
102
129
|
# Function that returns a function
|
|
@@ -109,22 +136,22 @@ def create_multiplier(factor: int) -> Callable[[int], int]:
|
|
|
109
136
|
## Class Type Hints
|
|
110
137
|
|
|
111
138
|
```python
|
|
112
|
-
from typing import ClassVar
|
|
139
|
+
from typing import ClassVar
|
|
113
140
|
from dataclasses import dataclass
|
|
114
141
|
|
|
115
142
|
class User:
|
|
116
143
|
# Class variable
|
|
117
144
|
user_count: ClassVar[int] = 0
|
|
118
|
-
|
|
145
|
+
|
|
119
146
|
def __init__(self, name: str, age: int) -> None:
|
|
120
147
|
self.name: str = name
|
|
121
148
|
self.age: int = age
|
|
122
149
|
User.user_count += 1
|
|
123
|
-
|
|
124
|
-
def get_info(self) ->
|
|
150
|
+
|
|
151
|
+
def get_info(self) -> dict[str, str | int]:
|
|
125
152
|
return {"name": self.name, "age": self.age}
|
|
126
153
|
|
|
127
|
-
# Using dataclasses
|
|
154
|
+
# Using dataclasses (recommended)
|
|
128
155
|
@dataclass
|
|
129
156
|
class Product:
|
|
130
157
|
name: str
|
|
@@ -157,32 +184,70 @@ class Shape(ABC):
|
|
|
157
184
|
## Type Aliases
|
|
158
185
|
|
|
159
186
|
```python
|
|
160
|
-
|
|
161
|
-
|
|
187
|
+
# Modern syntax (Python 3.10+)
|
|
162
188
|
# Simple aliases
|
|
163
189
|
UserId = int
|
|
164
190
|
UserName = str
|
|
165
|
-
Coordinates =
|
|
191
|
+
Coordinates = tuple[float, float]
|
|
166
192
|
|
|
167
193
|
# Complex aliases
|
|
168
|
-
UserData =
|
|
169
|
-
Matrix =
|
|
194
|
+
UserData = dict[str, str | int | list[str]]
|
|
195
|
+
Matrix = list[list[float]]
|
|
170
196
|
|
|
171
197
|
def get_user(user_id: UserId) -> UserName:
|
|
172
198
|
pass
|
|
173
199
|
|
|
174
200
|
def process_matrix(matrix: Matrix) -> Matrix:
|
|
175
201
|
pass
|
|
202
|
+
|
|
203
|
+
# Type alias with TypeAlias annotation (Python 3.10+)
|
|
204
|
+
from typing import TypeAlias
|
|
205
|
+
|
|
206
|
+
Vector: TypeAlias = list[float]
|
|
207
|
+
ConnectionOptions: TypeAlias = dict[str, str | int | bool]
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Mypy Type Checking (PEP 484)
|
|
211
|
+
|
|
212
|
+
Configure mypy for strict type checking.
|
|
213
|
+
|
|
214
|
+
```ini
|
|
215
|
+
# mypy.ini or setup.cfg
|
|
216
|
+
[mypy]
|
|
217
|
+
python_version = 3.10
|
|
218
|
+
warn_return_any = True
|
|
219
|
+
warn_unused_configs = True
|
|
220
|
+
disallow_untyped_defs = True
|
|
221
|
+
disallow_any_unimported = True
|
|
222
|
+
no_implicit_optional = True
|
|
223
|
+
warn_redundant_casts = True
|
|
224
|
+
warn_unused_ignores = True
|
|
225
|
+
warn_no_return = True
|
|
226
|
+
check_untyped_defs = True
|
|
227
|
+
strict_equality = True
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
```python
|
|
231
|
+
# Run mypy
|
|
232
|
+
# $ mypy myproject/
|
|
233
|
+
|
|
234
|
+
# Ignore specific lines
|
|
235
|
+
result = legacy_function() # type: ignore
|
|
236
|
+
|
|
237
|
+
# Ignore specific error codes
|
|
238
|
+
result = legacy_function() # type: ignore[no-untyped-call]
|
|
176
239
|
```
|
|
177
240
|
|
|
178
241
|
## Best Practices
|
|
179
242
|
|
|
180
|
-
1. **
|
|
181
|
-
2. **Use
|
|
182
|
-
3. **
|
|
183
|
-
4. **Use
|
|
184
|
-
5. **Use
|
|
185
|
-
6. **
|
|
186
|
-
7. **
|
|
187
|
-
8. **
|
|
243
|
+
1. **Use modern syntax** - Prefer `list[str]` over `List[str]` (Python 3.10+)
|
|
244
|
+
2. **Use union operator** - Prefer `str | None` over `Optional[str]` (Python 3.10+)
|
|
245
|
+
3. **Always use type hints** - For all function parameters and return values
|
|
246
|
+
4. **Use specific types** - Avoid `Any` when possible
|
|
247
|
+
5. **Use TypeVar** - For generic functions and classes
|
|
248
|
+
6. **Use Protocol** - For duck typing and structural subtyping
|
|
249
|
+
7. **Run mypy** - Use mypy or pyright for static type checking
|
|
250
|
+
8. **Use dataclasses** - For simple data containers with type hints
|
|
251
|
+
9. **Document complex types** - Add comments for complex type annotations
|
|
252
|
+
10. **Follow PEP 484, 585, 604** - Stay current with Python typing standards
|
|
188
253
|
|