Skip to main content
rule official · GitHub

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.

Install into GitHub Copilot · Manually: put the files in place All methods and platforms ↓
.github/instructions/coldfusion-cfm.instructions.md
Open on GitHub

What 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.cfm against the ColdFusion standards and fix the issues.
  • Update the query in users.cfm to protect user-controlled values with cfqueryparam.
  • 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.md

The applyTo field sets which files it applies to

Step 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

Similar IDE rules

All IDE rules for Programming languages →

From the same set732

The whole set →
convert-cassandra-to-spring-data-cosmos Step-by-step instructions for converting Spring Boot Cassandra projects to Azure Cosmos DB with spring-data-cosmos. Applies to Java code, build files, and application properties. ★ 40,418repo stars context7 This rule brings Context7 into tasks that depend on current, version-specific API documentation. It is useful when the workspace does not contain the needed external reference. ★ 40,418repo stars context-engineering A GitHub Copilot rule on file layout, types and comments, so suggestions match your project instead of drifting into generic answers. ★ 40,418repo stars containerization-docker-best-practices Guides Docker image creation with rules for multi-stage builds, process isolation, environment portability, and minimal runtime footprints. ★ 40,418repo stars coldfusion-cfc A Copilot rule that sets coding standards for ColdFusion components: CFScript, cfqueryparam, clean getters and setters. Useful when your repo has .cfc files. ★ 40,418repo stars codexer Instructs GitHub Copilot to act as a strict Python research assistant, enforcing PEP 8, pytest suites, isolated envs, and Context 7 MCP documentation lookups. ★ 40,418repo stars code-review-generic A rule that gives Copilot a review order: security and correctness first, then code quality, tests and performance. ★ 40,418repo stars cmake-vcpkg A rule that gives Copilot the context of a C++ project: vcpkg in manifest mode, settings through CMakePresets.json, builds for MSVC, Clang and GCC. ★ 40,418repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor