@el-j/magic-helix-plugins 4.0.0-beta.2 → 4.0.0-beta.4

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 (120) hide show
  1. package/dist/architecture/codeowners.md +123 -0
  2. package/dist/architecture/monorepo.md +146 -0
  3. package/dist/architecture/nx.md +122 -0
  4. package/dist/architecture/turborepo.md +114 -0
  5. package/dist/ci/github-actions.md +268 -0
  6. package/dist/ci/gitlab-ci.md +330 -0
  7. package/dist/containers/docker-multistage.md +120 -0
  8. package/dist/containers/kubernetes-deploy.md +210 -0
  9. package/dist/cpp/index.cjs +79 -0
  10. package/dist/cpp/index.mjs +209 -0
  11. package/dist/csharp/index.cjs +2 -2
  12. package/dist/csharp/{index.js → index.mjs} +17 -11
  13. package/dist/csharp/templates/framework-aspnetcore.md +205 -0
  14. package/dist/csharp/templates/framework-blazor.md +271 -0
  15. package/dist/csharp/templates/lang-csharp.md +162 -0
  16. package/dist/devops/docker-compose.md +111 -0
  17. package/dist/devops/docker-dockerfile.md +94 -0
  18. package/dist/devops/github-actions.md +160 -0
  19. package/dist/devops/gitlab-ci.md +210 -0
  20. package/dist/generic/lang-typescript.md +57 -0
  21. package/dist/generic/state-redux.md +21 -0
  22. package/dist/generic/state-rxjs.md +6 -0
  23. package/dist/generic/style-mui.md +23 -0
  24. package/dist/generic/style-tailwind.md +76 -0
  25. package/dist/generic/test-cypress.md +21 -0
  26. package/dist/generic/test-jest.md +20 -0
  27. package/dist/generic/test-playwright.md +21 -0
  28. package/dist/generic/test-vitest.md +131 -0
  29. package/dist/go/index.cjs +3 -3
  30. package/dist/go/{index.js → index.mjs} +18 -15
  31. package/dist/go/templates/lang-go.md +571 -0
  32. package/dist/index.cjs +1 -1
  33. package/dist/index.mjs +24 -0
  34. package/dist/java/index.cjs +2 -2
  35. package/dist/java/{index.js → index.mjs} +25 -19
  36. package/dist/java/templates/build-gradle.md +102 -0
  37. package/dist/java/templates/build-maven.md +86 -0
  38. package/dist/java/templates/framework-spring-boot.md +179 -0
  39. package/dist/java/templates/lang-java.md +78 -0
  40. package/dist/java/templates/lang-kotlin.md +88 -0
  41. package/dist/meta/magic-helix-meta.md +213 -0
  42. package/dist/meta/meta-debug.md +459 -0
  43. package/dist/meta/meta-implement.md +450 -0
  44. package/dist/meta/meta-roadmap.md +265 -0
  45. package/dist/nodejs/templates/angular-core.md +19 -0
  46. package/dist/nodejs/templates/lang-typescript.md +57 -0
  47. package/dist/nodejs/templates/nestjs-core.md +7 -0
  48. package/dist/nodejs/templates/react-core.md +677 -0
  49. package/dist/nodejs/templates/react-zustand.md +7 -0
  50. package/dist/nodejs/templates/state-redux.md +21 -0
  51. package/dist/nodejs/templates/state-rxjs.md +6 -0
  52. package/dist/nodejs/templates/style-primevue.md +6 -0
  53. package/dist/nodejs/templates/style-quasar.md +22 -0
  54. package/dist/nodejs/templates/style-tailwind.md +76 -0
  55. package/dist/nodejs/templates/test-cypress.md +21 -0
  56. package/dist/nodejs/templates/test-jest.md +20 -0
  57. package/dist/nodejs/templates/test-playwright.md +21 -0
  58. package/dist/nodejs/templates/test-vitest.md +131 -0
  59. package/dist/nodejs/templates/vue-core.md +108 -0
  60. package/dist/nodejs/templates/vue-pinia.md +5 -0
  61. package/dist/patterns/architecture/clean-architecture.md +469 -0
  62. package/dist/patterns/architecture/dependency-injection.md +517 -0
  63. package/dist/patterns/architecture/domain-driven-design.md +621 -0
  64. package/dist/patterns/architecture/layered-architecture.md +382 -0
  65. package/dist/patterns/architecture/repository-pattern.md +408 -0
  66. package/dist/patterns/domain-expertise/nextjs-rules.md +115 -0
  67. package/dist/patterns/domain-expertise/react-patterns.md +181 -0
  68. package/dist/patterns/domain-expertise/server-components.md +212 -0
  69. package/dist/patterns/domain-expertise/shadcn-ui.md +52 -0
  70. package/dist/patterns/domain-expertise/tailwind-patterns.md +52 -0
  71. package/dist/patterns/environment/container-awareness.md +17 -0
  72. package/dist/patterns/environment/ide-features.md +17 -0
  73. package/dist/patterns/environment/os-commands.md +17 -0
  74. package/dist/patterns/organization/heading-hierarchy.md +103 -0
  75. package/dist/patterns/organization/sequential-workflows.md +102 -0
  76. package/dist/patterns/organization/xml-rule-groups.md +64 -0
  77. package/dist/patterns/reasoning/agent-loop.md +151 -0
  78. package/dist/patterns/reasoning/confirmation-gates.md +141 -0
  79. package/dist/patterns/reasoning/dependency-analysis.md +132 -0
  80. package/dist/patterns/reasoning/one-tool-per-iteration.md +152 -0
  81. package/dist/patterns/reasoning/preview-before-action.md +194 -0
  82. package/dist/patterns/reasoning/reflection-checkpoints.md +166 -0
  83. package/dist/patterns/reasoning/result-verification.md +157 -0
  84. package/dist/patterns/reasoning/subtask-breakdown.md +131 -0
  85. package/dist/patterns/reasoning/thinking-tags.md +100 -0
  86. package/dist/patterns/role-definition/capability-declarations.md +72 -0
  87. package/dist/patterns/role-definition/expert-identity.md +45 -0
  88. package/dist/patterns/role-definition/scope-boundaries.md +61 -0
  89. package/dist/patterns/safety/code-safety-rules.md +17 -0
  90. package/dist/patterns/safety/credential-handling.md +17 -0
  91. package/dist/patterns/safety/destructive-warnings.md +17 -0
  92. package/dist/patterns/safety/refusal-messages.md +17 -0
  93. package/dist/patterns/tone/adaptive-tone.md +17 -0
  94. package/dist/patterns/tone/concise-communication.md +17 -0
  95. package/dist/patterns/tone/forbidden-phrases.md +17 -0
  96. package/dist/patterns/tool-guidelines/function-schemas.md +143 -0
  97. package/dist/patterns/tool-guidelines/parameter-examples.md +137 -0
  98. package/dist/patterns/tool-guidelines/usage-policies.md +105 -0
  99. package/dist/php/index.cjs +2 -2
  100. package/dist/php/{index.js → index.mjs} +12 -6
  101. package/dist/php/templates/framework-laravel.md +112 -0
  102. package/dist/php/templates/lang-php.md +94 -0
  103. package/dist/python/index.cjs +4 -4
  104. package/dist/python/{index.js → index.mjs} +10 -7
  105. package/dist/python/templates/lang-python.md +508 -0
  106. package/dist/ruby/index.cjs +2 -2
  107. package/dist/ruby/{index.js → index.mjs} +16 -10
  108. package/dist/ruby/templates/framework-rails.md +309 -0
  109. package/dist/ruby/templates/framework-sinatra.md +227 -0
  110. package/dist/ruby/templates/lang-ruby.md +216 -0
  111. package/dist/rust/index.cjs +3 -3
  112. package/dist/rust/{index.js → index.mjs} +24 -18
  113. package/dist/rust/templates/lang-rust.md +89 -0
  114. package/dist/swift/index.cjs +32 -0
  115. package/dist/swift/index.mjs +112 -0
  116. package/dist/swift/templates/framework-vapor.md +352 -0
  117. package/dist/swift/templates/lang-swift.md +291 -0
  118. package/package.json +31 -21
  119. package/dist/index.js +0 -20
  120. /package/dist/nodejs/{index.js → index.mjs} +0 -0
@@ -0,0 +1,105 @@
1
+ # Usage Policies Pattern
2
+
3
+ ## Purpose
4
+ Define when and how to use tools, including restrictions. From **Cline** and **ChatGPT** patterns.
5
+
6
+ ## Template
7
+
8
+ ```markdown
9
+ ## {TOOL_NAME} Usage Policy
10
+
11
+ ### When to Use
12
+ - {USE_CASE_1}
13
+ - {USE_CASE_2}
14
+ - {USE_CASE_3}
15
+
16
+ ### When NOT to Use
17
+ - {ANTI_PATTERN_1}
18
+ - {ANTI_PATTERN_2}
19
+ - {ANTI_PATTERN_3}
20
+
21
+ ### Restrictions
22
+ - {RESTRICTION_1}
23
+ - {RESTRICTION_2}
24
+ - {RESTRICTION_3}
25
+
26
+ ### Preferred Alternatives
27
+ If {CONDITION}, use {ALTERNATIVE_TOOL} instead because {REASON}.
28
+ ```
29
+
30
+ ## Examples
31
+
32
+ ### Cline (Terminal Commands)
33
+ ```markdown
34
+ ## run_in_terminal Usage Policy
35
+
36
+ ### When to Use
37
+ - Installing packages (npm, pip, brew)
38
+ - Running build commands (npm run build)
39
+ - Git operations (commit, push, pull)
40
+ - Executing test suites
41
+
42
+ ### When NOT to Use
43
+ - Running Python code snippets (use pylance_runCodeSnippet instead)
44
+ - Reading file contents (use read_file instead)
45
+ - Making file edits (use replace_string_in_file instead)
46
+ - Parallel execution (terminal doesn't support concurrent commands)
47
+
48
+ ### Restrictions
49
+ - Run one command at a time (wait for output before next)
50
+ - Use absolute paths to avoid navigation issues
51
+ - Disable paging (--no-pager, | cat) to prevent truncation
52
+ - Filter output with grep/awk for large results (>1000 lines)
53
+
54
+ ### Preferred Alternatives
55
+ If running Python code, use `pylance_runCodeSnippet` instead because it:
56
+ - Uses correct workspace interpreter automatically
57
+ - Avoids shell escaping/quoting problems
58
+ - Provides clean, formatted output
59
+ ```
60
+
61
+ ### ChatGPT (Image Generation)
62
+ ```markdown
63
+ ## generate_image Usage Policy
64
+
65
+ ### When to Use
66
+ - User explicitly requests an image
67
+ - Visual aid would enhance understanding
68
+ - Demonstrating design concepts
69
+ - Creating illustrations for explanations
70
+
71
+ ### When NOT to Use
72
+ - User asked for text description only
73
+ - Depicting real people (use generic descriptions)
74
+ - Generating logos/brands (copyright concerns)
75
+ - Creating images of copyrighted characters
76
+
77
+ ### Restrictions
78
+ - NEVER generate images of named real people (living or deceased)
79
+ - NEVER create content that is harmful, hateful, or violent
80
+ - NEVER generate trademarked characters or logos
81
+ - NEVER include recognizable brand names or products
82
+
83
+ ### Preferred Alternatives
84
+ If user wants a person, describe generic attributes instead:
85
+ ❌ "Generate an image of Taylor Swift"
86
+ ✅ "Generate an image of a young woman with curly blonde hair performing on stage"
87
+ ```
88
+
89
+ ## Variables
90
+ - `{TOOL_NAME}`: Tool/function name
91
+ - `{USE_CASE_X}`: Appropriate scenarios
92
+ - `{ANTI_PATTERN_X}`: Inappropriate scenarios
93
+ - `{RESTRICTION_X}`: Hard constraints
94
+ - `{CONDITION}`: Circumstance triggering alternative
95
+ - `{ALTERNATIVE_TOOL}`: Better tool for scenario
96
+ - `{REASON}`: Why alternative is better
97
+
98
+ ## Best Practices
99
+ 1. Start with positive use cases (what to do)
100
+ 2. Follow with anti-patterns (what not to do)
101
+ 3. Use concrete examples (✅/❌ pairs)
102
+ 4. Explain reasoning behind restrictions
103
+ 5. Suggest alternatives when rejecting patterns
104
+ 6. Include edge cases and gotchas
105
+ 7. Benefits: Prevents misuse, improves efficiency, reduces errors
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../BasePlugin-odQJAKA-.cjs");class t extends i.BasePlugin{constructor(){super(...arguments),this.name="php",this.displayName="PHP",this.version="3.0.0",this.priority=65}async detect(e){if(!this.fileExists(e,"composer.json"))return null;const s=this.readJSON(e,"composer.json");if(!s)return{language:"PHP",name:this.getProjectName(e),dependencies:{},manifestFile:"composer.json",projectPath:e};const n={...s.require,...s["require-dev"]};return{language:"PHP",name:s.name||this.getProjectName(e),description:s.description,dependencies:n,manifestFile:"composer.json",projectPath:e}}getTemplates(){return[{name:"php-core",tags:["php"],content:`# PHP Development Guidelines
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("node:path"),i=require("../BasePlugin-odQJAKA-.cjs");function o(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const a=o(r);class p extends i.BasePlugin{constructor(){super(...arguments),this.name="php",this.displayName="PHP",this.version="3.0.0",this.priority=65}async detect(e){if(!this.fileExists(e,"composer.json"))return null;const t=this.readJSON(e,"composer.json");if(!t)return{language:"PHP",name:this.getProjectName(e),dependencies:{},manifestFile:"composer.json",projectPath:e};const s={...t.require,...t["require-dev"]};return{language:"PHP",name:t.name||this.getProjectName(e),description:t.description,dependencies:s,manifestFile:"composer.json",projectPath:e}}getTemplates(){return[{name:"php-core",tags:["php"],content:()=>this.loadTemplateFromFile(a.join(__dirname,"templates/lang-php.md")).then(e=>e||this.getPHPFallbackTemplate())}]}getPHPFallbackTemplate(){return`# PHP Development Guidelines
2
2
 
3
3
  This project uses PHP.
4
4
 
@@ -15,4 +15,4 @@ This project uses PHP.
15
15
  ## Testing
16
16
  - Write PHPUnit tests
17
17
  - Use proper assertions
18
- - Aim for good coverage`}]}getDependencyTagMap(){return{"laravel/framework":"laravel","symfony/symfony":"symfony","phpunit/phpunit":"phpunit"}}}exports.PHPPlugin=t;
18
+ - Aim for good coverage`}getDependencyTagMap(){return{"laravel/framework":"laravel","symfony/symfony":"symfony","phpunit/phpunit":"phpunit"}}}exports.PHPPlugin=p;
@@ -1,5 +1,6 @@
1
+ import * as t from "node:path";
1
2
  import { B as i } from "../BasePlugin-6wv0hYJ9.js";
2
- class t extends i {
3
+ class a extends i {
3
4
  constructor() {
4
5
  super(...arguments), this.name = "php", this.displayName = "PHP", this.version = "3.0.0", this.priority = 65;
5
6
  }
@@ -33,7 +34,14 @@ class t extends i {
33
34
  {
34
35
  name: "php-core",
35
36
  tags: ["php"],
36
- content: `# PHP Development Guidelines
37
+ content: () => this.loadTemplateFromFile(
38
+ t.join(__dirname, "templates/lang-php.md")
39
+ ).then((e) => e || this.getPHPFallbackTemplate())
40
+ }
41
+ ];
42
+ }
43
+ getPHPFallbackTemplate() {
44
+ return `# PHP Development Guidelines
37
45
 
38
46
  This project uses PHP.
39
47
 
@@ -50,9 +58,7 @@ This project uses PHP.
50
58
  ## Testing
51
59
  - Write PHPUnit tests
52
60
  - Use proper assertions
53
- - Aim for good coverage`
54
- }
55
- ];
61
+ - Aim for good coverage`;
56
62
  }
57
63
  getDependencyTagMap() {
58
64
  return {
@@ -63,5 +69,5 @@ This project uses PHP.
63
69
  }
64
70
  }
65
71
  export {
66
- t as PHPPlugin
72
+ a as PHPPlugin
67
73
  };
@@ -0,0 +1,112 @@
1
+ # Laravel Framework Guidelines
2
+
3
+ ## Overview
4
+ This project uses Laravel framework. Follow Laravel conventions and best practices.
5
+
6
+ ## Artisan Commands
7
+ - Serve application: `php artisan serve`
8
+ - Run migrations: `php artisan migrate`
9
+ - Create migration: `php artisan make:migration <name>`
10
+ - Create model: `php artisan make:model <name>`
11
+ - Create controller: `php artisan make:controller <name>`
12
+ - Clear cache: `php artisan cache:clear`
13
+ - List routes: `php artisan route:list`
14
+
15
+ ## Directory Structure
16
+ - `app/` - Application core code
17
+ - `app/Http/Controllers/` - Controllers
18
+ - `app/Models/` - Eloquent models
19
+ - `app/Services/` - Business logic services
20
+ - `routes/` - Route definitions
21
+ - `database/migrations/` - Database migrations
22
+ - `resources/views/` - Blade templates
23
+ - `config/` - Configuration files
24
+
25
+ ## Eloquent ORM
26
+ - Use Eloquent models for database interactions
27
+ - Define relationships in models
28
+ - Use query scopes for reusable queries
29
+ - Use accessors and mutators for attribute transformation
30
+ - Eager load relationships to avoid N+1 queries
31
+
32
+ ## Routing
33
+ - Define routes in `routes/web.php` or `routes/api.php`
34
+ - Use resource controllers: `Route::resource('posts', PostController::class)`
35
+ - Use route model binding for automatic model injection
36
+ - Group related routes with middleware
37
+ - Name your routes for easier URL generation
38
+
39
+ ## Controllers
40
+ - Keep controllers thin - delegate to services
41
+ - Use single action controllers for simple endpoints
42
+ - Return views or JSON responses appropriately
43
+ - Use form requests for validation
44
+ - Use resource controllers for CRUD operations
45
+
46
+ ## Blade Templates
47
+ - Use Blade templating engine
48
+ - Extend layouts: `@extends('layouts.app')`
49
+ - Define sections: `@section('content') ... @endsection`
50
+ - Include partials: `@include('partials.header')`
51
+ - Use components for reusable UI elements
52
+ - Escape output: `{{ $variable }}` (automatic)
53
+ - Raw output (use cautiously): `{!! $html !!}`
54
+
55
+ ## Validation
56
+ - Use Form Requests for complex validation
57
+ - Define rules in controller or Form Request
58
+ - Use built-in validation rules
59
+ - Create custom validation rules when needed
60
+ - Return validation errors automatically
61
+
62
+ ## Database
63
+ - Use migrations for schema changes
64
+ - Use seeders for test data
65
+ - Use factories for model generation
66
+ - Write raw queries only when necessary
67
+ - Use database transactions for multiple operations
68
+
69
+ ## Authentication
70
+ - Use Laravel Breeze or Jetstream for scaffolding
71
+ - Use middleware for route protection: `auth`, `guest`
72
+ - Use gates and policies for authorization
73
+ - Hash passwords with `Hash::make()`
74
+ - Use sanctum for API authentication
75
+
76
+ ## Testing
77
+ - Write Feature tests in `tests/Feature/`
78
+ - Write Unit tests in `tests/Unit/`
79
+ - Use `php artisan test` to run tests
80
+ - Use factories for test data generation
81
+ - Use `RefreshDatabase` trait for database tests
82
+
83
+ ## Queues & Jobs
84
+ - Use queues for slow operations
85
+ - Create jobs: `php artisan make:job <name>`
86
+ - Dispatch jobs: `dispatch(new JobName())`
87
+ - Run queue worker: `php artisan queue:work`
88
+ - Use different queues for priority
89
+
90
+ ## Events & Listeners
91
+ - Use events for decoupled communication
92
+ - Create events: `php artisan make:event <name>`
93
+ - Create listeners: `php artisan make:listener <name>`
94
+ - Register in `EventServiceProvider`
95
+ - Dispatch events: `event(new EventName())`
96
+
97
+ ## API Development
98
+ - Use API resources for JSON responses
99
+ - Version your API routes
100
+ - Use rate limiting middleware
101
+ - Return proper HTTP status codes
102
+ - Use Sanctum or Passport for authentication
103
+
104
+ ## Best Practices
105
+ - Use dependency injection in constructors
106
+ - Keep business logic in service classes
107
+ - Use repository pattern for complex data access
108
+ - Follow single responsibility principle
109
+ - Write tests for all features
110
+ - Use environment variables for configuration
111
+ - Never commit `.env` file
112
+ - Use Laravel's built-in features before third-party packages
@@ -0,0 +1,94 @@
1
+ # PHP Development Guidelines
2
+
3
+ ## Overview
4
+ This project uses PHP. Follow modern PHP standards (PSR-12) and best practices.
5
+
6
+ ## Code Style
7
+ - Follow PSR-12 coding standards
8
+ - Use 4 spaces for indentation
9
+ - Use `declare(strict_types=1);` at the top of files
10
+ - Use type declarations for all parameters and return types
11
+ - Use `final` for classes that shouldn't be extended
12
+
13
+ ## PHP Standards Recommendations (PSR)
14
+ - PSR-1: Basic Coding Standard
15
+ - PSR-4: Autoloading Standard
16
+ - PSR-7: HTTP Message Interface
17
+ - PSR-12: Extended Coding Style Guide
18
+ - PSR-15: HTTP Handlers
19
+
20
+ ## Composer Commands
21
+ - Install dependencies: `composer install`
22
+ - Update dependencies: `composer update`
23
+ - Autoload optimization: `composer dump-autoload -o`
24
+ - Run scripts: `composer run-script <script-name>`
25
+ - Validate composer.json: `composer validate`
26
+
27
+ ## Type Safety
28
+ - Use strict types: `declare(strict_types=1);`
29
+ - Add type hints to all parameters
30
+ - Add return type declarations
31
+ - Use union types in PHP 8+: `string|int`
32
+ - Use nullable types: `?string`
33
+
34
+ ## Error Handling
35
+ - Use exceptions for error handling
36
+ - Create custom exception classes
37
+ - Catch specific exceptions, not generic `\Exception`
38
+ - Use `finally` blocks for cleanup
39
+ - Log errors appropriately
40
+
41
+ ## Object-Oriented Programming
42
+ - Follow SOLID principles
43
+ - Use dependency injection
44
+ - Favor composition over inheritance
45
+ - Use interfaces for contracts
46
+ - Use abstract classes for shared behavior
47
+
48
+ ## Modern PHP Features (8.x)
49
+ - Named arguments: `function(param: $value)`
50
+ - Constructor property promotion
51
+ - Match expressions instead of switch
52
+ - Nullsafe operator: `$obj?->method()`
53
+ - Attributes instead of annotations
54
+
55
+ ## Security
56
+ - Always validate and sanitize user input
57
+ - Use prepared statements for database queries
58
+ - Escape output to prevent XSS
59
+ - Use CSRF tokens for forms
60
+ - Keep dependencies updated
61
+ - Use environment variables for sensitive data
62
+
63
+ ## Testing
64
+ - Write PHPUnit tests for all classes
65
+ - Aim for high code coverage
66
+ - Use data providers for multiple test cases
67
+ - Mock external dependencies
68
+ - Run tests: `vendor/bin/phpunit`
69
+
70
+ ## Code Quality Tools
71
+ - PHPStan: Static analysis - `vendor/bin/phpstan analyse`
72
+ - Psalm: Static analysis - `vendor/bin/psalm`
73
+ - PHP_CodeSniffer: Code style - `vendor/bin/phpcs`
74
+ - PHP-CS-Fixer: Auto-fix style - `vendor/bin/php-cs-fixer fix`
75
+
76
+ ## Documentation
77
+ - Use PHPDoc blocks for all classes, methods, and properties
78
+ - Include `@param`, `@return`, and `@throws` tags
79
+ - Document complex logic with inline comments
80
+ - Keep documentation up-to-date
81
+
82
+ ## Performance
83
+ - Use opcode caching (OPcache)
84
+ - Profile with Xdebug or Blackfire
85
+ - Optimize database queries
86
+ - Use caching (Redis, Memcached)
87
+ - Consider asynchronous processing for heavy tasks
88
+
89
+ ## Common Patterns
90
+ - Repository pattern for data access
91
+ - Service layer for business logic
92
+ - Factory pattern for object creation
93
+ - Observer pattern for events
94
+ - Dependency injection containers
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../BasePlugin-odQJAKA-.cjs");class l extends p.BasePlugin{constructor(){super(...arguments),this.name="python",this.displayName="Python",this.version="3.0.0",this.priority=85}async detect(e){return this.fileExists(e,"pyproject.toml")?this.detectFromPyproject(e):this.fileExists(e,"requirements.txt")?this.detectFromRequirements(e):this.fileExists(e,"setup.py")?{language:"Python",name:this.getProjectName(e),dependencies:{},manifestFile:"setup.py",projectPath:e}:null}getTemplates(){return[{name:"python-core",tags:["python"],content:this.getPythonTemplate()}]}getDependencyTagMap(){return{django:"django",flask:"flask",fastapi:"fastapi",pytest:"pytest",numpy:"numpy",pandas:"pandas"}}detectFromPyproject(e){const t=this.readFile(e,"pyproject.toml");if(!t)return{language:"Python",name:this.getProjectName(e),dependencies:{},manifestFile:"pyproject.toml",projectPath:e};const o=t.match(/name\s*=\s*["']([^"']+)["']/),n=t.match(/description\s*=\s*["']([^"']+)["']/),s={},i=t.match(/\[tool\.poetry\.dependencies\]([\s\S]*?)(?:\n\[|$)/);if(i){const a=i[1].split(`
2
- `);for(const c of a){const r=c.match(/^([a-zA-Z0-9_-]+)\s*=\s*["']([^"']+)["']/);r&&r[1]!=="python"&&(s[r[1]]=r[2])}}return{language:"Python",name:o?.[1]||this.getProjectName(e),description:n?.[1],dependencies:s,manifestFile:"pyproject.toml",projectPath:e}}detectFromRequirements(e){const t=this.readFile(e,"requirements.txt"),o={};if(t){for(const n of t.split(`
3
- `))if(n.trim()&&!n.startsWith("#")){const s=n.split(/[=<>]/),i=s[0].trim(),a=s[1]?.trim()||"*";i&&(o[i]=a)}}return{language:"Python",name:this.getProjectName(e),dependencies:o,manifestFile:"requirements.txt",projectPath:e}}getPythonTemplate(){return`# Python Development Guidelines
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("node:path"),m=require("../BasePlugin-odQJAKA-.cjs");function u(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const d=u(p);class y extends m.BasePlugin{constructor(){super(...arguments),this.name="python",this.displayName="Python",this.version="3.0.0",this.priority=85}async detect(e){return this.fileExists(e,"pyproject.toml")?this.detectFromPyproject(e):this.fileExists(e,"requirements.txt")?this.detectFromRequirements(e):this.fileExists(e,"setup.py")?{language:"Python",name:this.getProjectName(e),dependencies:{},manifestFile:"setup.py",projectPath:e}:null}getTemplates(){return[{name:"python-core",tags:["python"],content:()=>this.loadTemplateFromFile(d.join(__dirname,"templates/lang-python.md")).then(e=>e||this.getPythonFallbackTemplate())}]}getDependencyTagMap(){return{django:"django",flask:"flask",fastapi:"fastapi",pytest:"pytest",numpy:"numpy",pandas:"pandas"}}detectFromPyproject(e){const t=this.readFile(e,"pyproject.toml");if(!t)return{language:"Python",name:this.getProjectName(e),dependencies:{},manifestFile:"pyproject.toml",projectPath:e};const n=t.match(/name\s*=\s*["']([^"']+)["']/),i=t.match(/description\s*=\s*["']([^"']+)["']/),o={},r=t.match(/\[tool\.poetry\.dependencies\]([\s\S]*?)(?:\n\[|$)/);if(r){const c=r[1].split(`
2
+ `);for(const l of c){const a=l.match(/^([a-zA-Z0-9_-]+)\s*=\s*["']([^"']+)["']/);a&&a[1]!=="python"&&(o[a[1]]=a[2])}}return{language:"Python",name:n?.[1]||this.getProjectName(e),description:i?.[1],dependencies:o,manifestFile:"pyproject.toml",projectPath:e}}detectFromRequirements(e){const t=this.readFile(e,"requirements.txt"),n={};if(t){for(const i of t.split(`
3
+ `))if(i.trim()&&!i.startsWith("#")){const o=i.split(/[=<>]/),r=o[0].trim(),c=o[1]?.trim()||"*";r&&(n[r]=c)}}return{language:"Python",name:this.getProjectName(e),dependencies:n,manifestFile:"requirements.txt",projectPath:e}}getPythonFallbackTemplate(){return`# Python Development Guidelines
4
4
 
5
5
  This project uses Python.
6
6
 
@@ -27,4 +27,4 @@ This project uses Python.
27
27
  ## Best Practices
28
28
  - Handle exceptions properly
29
29
  - Use context managers for resources
30
- - Follow Pythonic idioms`}}exports.PythonPlugin=l;
30
+ - Follow Pythonic idioms`}}exports.PythonPlugin=y;
@@ -1,5 +1,6 @@
1
- import { B as p } from "../BasePlugin-6wv0hYJ9.js";
2
- class d extends p {
1
+ import * as c from "node:path";
2
+ import { B as m } from "../BasePlugin-6wv0hYJ9.js";
3
+ class u extends m {
3
4
  constructor() {
4
5
  super(...arguments), this.name = "python", this.displayName = "Python", this.version = "3.0.0", this.priority = 85;
5
6
  }
@@ -17,7 +18,9 @@ class d extends p {
17
18
  {
18
19
  name: "python-core",
19
20
  tags: ["python"],
20
- content: this.getPythonTemplate()
21
+ content: () => this.loadTemplateFromFile(
22
+ c.join(__dirname, "templates/lang-python.md")
23
+ ).then((e) => e || this.getPythonFallbackTemplate())
21
24
  }
22
25
  ];
23
26
  }
@@ -48,8 +51,8 @@ class d extends p {
48
51
  if (i) {
49
52
  const a = i[1].split(`
50
53
  `);
51
- for (const c of a) {
52
- const r = c.match(/^([a-zA-Z0-9_-]+)\s*=\s*["']([^"']+)["']/);
54
+ for (const p of a) {
55
+ const r = p.match(/^([a-zA-Z0-9_-]+)\s*=\s*["']([^"']+)["']/);
53
56
  r && r[1] !== "python" && (s[r[1]] = r[2]);
54
57
  }
55
58
  }
@@ -80,7 +83,7 @@ class d extends p {
80
83
  projectPath: e
81
84
  };
82
85
  }
83
- getPythonTemplate() {
86
+ getPythonFallbackTemplate() {
84
87
  return `# Python Development Guidelines
85
88
 
86
89
  This project uses Python.
@@ -112,5 +115,5 @@ This project uses Python.
112
115
  }
113
116
  }
114
117
  export {
115
- d as PythonPlugin
118
+ u as PythonPlugin
116
119
  };