Skip to main content
rule official · GitHub

coldfusion-cfc — GitHub Copilot rule: CFC coding standards

A Copilot rule that sets coding standards for ColdFusion components: CFScript, cfqueryparam, clean getters and setters. Useful when your repo has .cfc files.

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

What coldfusion-cfc does

The rule attaches to files matching **/*.cfc and tells the agent how to write components. Core asks: prefer CFScript over tags, skip deprecated tags and functions, keep naming consistent for variables and components. For SQL injection protection, use cfqueryparam. Inside <cfoutput> blocks, escape CSS hash symbols with ##.

Then come component-level practices. Properties and methods live in the this scope, functions get access modifiers (public, private, package, remote), and components collaborate through dependency injection. Getters and setters stay simple, with no business logic inside. Input parameters in public and remote methods get validated and sanitized, and errors are handled with cftry/cfcatch. Configuration and credentials stay out of CFCs.

Indentation is 2 spaces, ternary operators are welcome, and related methods sit together. Every function is documented with its purpose, parameters and return value. The file goes to .github/instructions/coldfusion-cfc.instructions.md — without it the rule never loads.

What it helps with

  • bring .cfc components to one coding style
  • close SQL injection holes with cfqueryparam
  • strip deprecated tags and functions from the codebase
  • document functions with parameters and return values
  • move configuration and credentials out of components

Example prompts for the agent

  • write a new CFC for order handling following the project standards
  • check this .cfc for deprecated tags and add cfqueryparam to the queries
  • refactor the getters and setters and drop the business logic from them

How to install coldfusion-cfc

Manually: put the files in place

.github/instructions/coldfusion-cfc.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-cfc

How do I install coldfusion-cfc in GitHub Copilot?

Create .github/instructions/coldfusion-cfc.instructions.md in your repository and copy the rule content into it. Copilot picks it up for files matching **/*.cfc.

What does coldfusion-cfc do?

It sets standards for ColdFusion components: CFScript, access modifiers, dependency injection, input validation and error handling.

Do I need a ColdFusion project for the rule to work?

The rule targets .cfc files, so it only matters in a project with ColdFusion components. In other repos it simply finds nothing to apply to.

Source text

coldfusion-cfc.instructions.md · MIT
---
description: 'ColdFusion Coding Standards for CFC component and application patterns'
applyTo: "**/*.cfc"
---

# ColdFusion Coding Standards for CFC Files

- 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 ##

# Additional Best Practices

- Use `this` scope for component properties and methods when appropriate.
- Document all functions with purpose, parameters, and return values (use Javadoc or similar style).
- Use access modifiers (`public`, `private`, `package`, `remote`) for functions and variables.
- Prefer dependency injection for component collaboration.
- Avoid business logic in setters/getters; keep them simple.
- Validate and sanitize all input parameters in public/remote methods.
- Use `cftry`/`cfcatch` for error handling within methods as needed.
- Avoid hardcoding configuration or credentials in CFCs.
- Use consistent indentation (2 spaces, as per global standards).
- Group related methods logically within the component.
- Use meaningful, descriptive names for methods and properties.
- Avoid using `cfcomponent` attributes that are deprecated or unnecessary.

- 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 →

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