coldfusion-cfm — GitHub Copilot rule: what it does, how to install
This rule sets ColdFusion conventions for *.cfm files, including query safety, application structure, and HTMX output handling. It applies while editing matching files.
.github/instructions/coldfusion-cfm.instructions.mdWhat coldfusion-cfm does
The rule targets files matching **/*.cfm. It recommends CFScript where possible, consistent names for variables and components, and current tags and functions instead of deprecated ones. Shared logic belongs in reusable CFCs, application settings and request handling go in Application.cfc, and shared templates can use cfinclude without circular includes.
Security guidance covers cfqueryparam for SQL queries, validation and sanitization of user input, and keeping credentials out of source files. Errors should be handled and logged with cftry/cfcatch. Inside <cfoutput>, CSS and HTMX hash symbols must be written as ##. An HTMX target file must start with <cfsetting showDebugOutput = "false">.
The rule also sets 2-space indentation, consistent tab alignment, comments for complex logic, and function documentation with purpose and parameters. A query that uses user-controlled values without cfqueryparam breaks the stated standard.
What it helps with
- format a ColdFusion file with consistent conventions
- protect SQL queries with
cfqueryparam - handle and log errors through
cftry/cfcatch - escape
#inside<cfoutput>blocks - move shared logic into reusable CFCs
Example prompts for the agent
- Review
profile.cfmagainst the ColdFusion standards and fix the issues. - Update the query in
users.cfmto protect user-controlled values withcfqueryparam. - Create an HTMX target file and put
<cfsetting showDebugOutput = "false">on its first line.
How to install coldfusion-cfm
Manually: put the files in place
.github/instructions/coldfusion-cfm.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.claude/rules/coldfusion-cfm.mdThe paths frontmatter field limits the files: move applyTo from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/coldfusion-cfm.mdcFrontmatter: description, globs, alwaysApply. Move applyTo from the source into globs, or the rule will not attach on its own
Manually: put the files in place
.devin/rules/coldfusion-cfm.mdManually: put the files in place
.clinerules/coldfusion-cfm.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about coldfusion-cfm
How do I install coldfusion-cfm in GitHub Copilot?
Add the file at .github/instructions/coldfusion-cfm.instructions.md in your project. GitHub Copilot will apply it to files matching **/*.cfm.
What does coldfusion-cfm do?
It sets coding standards for ColdFusion files, covering CFScript, CFC organization, Application.cfc, input handling, error handling, and safer SQL queries with cfqueryparam.
How should # be written for HTMX inside <cfoutput>?
Write the hash as ## so ColdFusion does not treat it as variable interpolation. An HTMX target file must also begin with <cfsetting showDebugOutput = "false">.
Source text
coldfusion-cfm.instructions.md · MIT
--- description: 'ColdFusion cfm files and application patterns' applyTo: "**/*.cfm" --- # ColdFusion Coding Standards - Use CFScript where possible for cleaner syntax. - Avoid using deprecated tags and functions. - Follow consistent naming conventions for variables and components. - Use `cfqueryparam` to prevent SQL injection. - Escape CSS hash symbols inside <cfoutput> blocks using ## - When using HTMX inside <cfoutput> blocks, escape hash symbols (#) by using double hashes (##) to prevent unintended variable interpolation. - If you are in a HTMX target file then make sure the top line is: <cfsetting showDebugOutput = "false"> # Additional Best Practices - Use `Application.cfc` for application settings and request handling. - Organize code into reusable CFCs (components) for maintainability. - Validate and sanitize all user input. - Use `cftry`/`cfcatch` for error handling and logging. - Avoid hardcoding credentials or sensitive data in source files. - Use consistent indentation (2 spaces, as per global standards). - Comment complex logic and document functions with purpose and parameters. - Prefer `cfinclude` for shared templates, but avoid circular includes. - Use ternary operators where possible - Ensure consistent tab alignment.
© github · MIT · github/awesome-copilot