plasticode-telegram-api-cursorrules-prompt-file — Cursor rule for PHP
A Cursor rule that points the assistant at PHP 7.4, Plasticode and the Telegram Bot API. Useful when your bot is built on Plasticode and you want PSR-12 code.
.cursor/rules/plasticode-telegram-api-cursorrules-prompt-file.mdcWhat plasticode-telegram-api-cursorrules-prompt-file does
Drop this rule into Cursor and the assistant takes on the role of a PHP, Plasticode and Telegram Bot API expert. Answers come back short and technical, with PHP examples instead of general advice.
The rule spells out how code should look: object-oriented with SOLID in mind, modular instead of duplicated, descriptive names for variables and methods, dependency injection and DI containers. It also pins PHP 7.4, PSR-12, proper error handling and try-catch around expected exceptions. Dependencies named are Plasticode and Composer.
The rule does not apply on its own. alwaysApply is set to false while globs cover **/*, so Cursor will not pick it up until you attach it yourself. That is the part people miss. The file lives at .cursor/rules/plasticode-telegram-api-cursorrules-prompt-file.mdc.
What it helps with
- keep assistant output within PSR-12 and PHP 7.4
- get PHP examples instead of abstract suggestions
- split bot code into modules without duplication
- wire dependency injection and a DI container into Plasticode
- handle expected exceptions with try-catch
Example prompts for the agent
- Write a Telegram bot command handler in Plasticode using dependency injection
- Refactor this class to follow SOLID and PSR-12
- Add try-catch for expected exceptions in this method
How to install plasticode-telegram-api-cursorrules-prompt-file
Manually: put the files in place
.cursor/rules/plasticode-telegram-api-cursorrules-prompt-file.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/plasticode-telegram-api-cursorrules-prompt-file.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/plasticode-telegram-api-cursorrules-prompt-file.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/plasticode-telegram-api-cursorrules-prompt-file.mdManually: put the files in place
.clinerules/plasticode-telegram-api-cursorrules-prompt-file.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about plasticode-telegram-api-cursorrules-prompt-file
How do I install plasticode-telegram-api-cursorrules-prompt-file in Cursor?
Create .cursor/rules/plasticode-telegram-api-cursorrules-prompt-file.mdc in your project and paste the rule contents into it.
What does this rule do?
It steers Cursor toward PHP, Plasticode and the Telegram Bot API: concise answers with PHP examples, OOP with SOLID, PSR-12, error handling and dependency injection.
Does the rule apply to every file automatically?
No. It ships with alwaysApply: false, so you attach it manually even though globs are set to **/*.
Source text
plasticode-telegram-api-cursorrules-prompt-file.mdc · CC0-1.0
--- description: "Cursor rules for Plasticode development with Telegram API integration." globs: **/* alwaysApply: false --- You are an expert in PHP, Plasticode, Telegram Bot API and related web development technologies. Key Principles - Write concise, technical responses with accurate PHP examples. - Use object-oriented programming with a focus on SOLID principles. - Prefer iteration and modularization over duplication. - Use descriptive variable and method names. - Favor dependency injection and DI containers. PHP - Use PHP 7.4 features when appropriate. - Follow PSR-12 coding standards. - Implement proper error handling. - Use try-catch blocks for expected exceptions. Dependencies - Plasticode - Composer for dependency management
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules