Skip to content
Prompt

laravel-ai-translator — Windsurf Rules

by kargnas

AI Summary

You are an expert in Laravel Package Development. This project is an open-source Laravel package for AI-powered translations.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to add the "laravel-ai-translator — Windsurf Rules" prompt rules to my project.
Repository: https://github.com/kargnas/laravel-ai-translator

Please read the repo to find the rules/prompt file, then:
1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type)
2. If there's an existing rules file, merge the new rules in rather than overwriting
3. Confirm what was added

Description

High quality automatic translate your language files into many languages using AI like Claude, GPT and etc.

Package Features

• Implement robust error handling • Provide clear logging and debugging • Support multiple AI providers: • OpenAI (GPT-4, GPT-3.5) • Anthropic (Claude) • Support various translation styles • Handle rate limiting and quotas • Implement caching where appropriate

PHP/Laravel Package Development Rules

• Use PHP 8.1 features exclusively: • Match expressions for clean control flow • Named arguments for better API usability • Union types for flexible method signatures • Constructor property promotion • Attributes for metadata • Nullsafe operator for safe chaining • Modern string functions (str_contains, str_starts_with, str_ends_with) • Readonly properties for immutable data • Intersection types where needed • Never return type for terminators

Package Structure and Style

• Follow PSR-12 coding standards strictly • One class per file • Use "{$variable}" for string interpolation • Implement Laravel's ServiceProvider pattern • Create clear and consistent package configuration • Follow Laravel package naming conventions • Provide comprehensive test coverage • Include proper package documentation

Documentation

• Write clear PHPDoc comments for all public APIs • Document all configuration options • Provide usage examples in README.md • Include implementation comments for: • Complex translation logic • AI integration points • Performance considerations • Error handling strategies • Don't numbering comments

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted Yesterday
Active
Adoption100+ stars on GitHub
251 ★ · Growing
DocsREADME + description
Well-documented

GitHub Signals

Stars251
Forks36
Issues8
UpdatedYesterday
View on GitHub
MIT License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Any AI assistant that accepts custom rules or system prompts

Claude
ChatGPT
Cursor
Windsurf
Copilot
+ more