ColdFusion Coding Standards for CFC Files
ColdFusion Coding Standards for CFC component and application patterns
At a glance
- Kind
- Instruction · Ananke
prompt - Reference
awesome-copilot/coldfusion-cfc·ananke://prompt/awesome-copilot/coldfusion-cfc@1.0.0- Applies to
**/*.cfc- Files
- 1 · 1.4 KB
- How it's used
- Instructions apply automatically to files matching their applyTo glob in GitHub Copilot. For Claude Code, reference the file from CLAUDE.md.
Where it fits
- Lifecycle phase
- Implementation
- Role
- Developer
- Platform
- Ananke PlexusGitHub Copilot
- Needs
- Nothing (text only)
Facets suggested from the item's own text and tags, not yet reviewed. Facets say where an item is relevant, not that it will run in your setup. How facets work
Checked by Dex
Verified, not self-reported: dex-trove 0.3.16 installed this item into each layout and checked that the tool can load it. Dex collects no download or usage data.
- GitHub Copilot ✓ loads
Upstream metadata
Self-reported by the item's author; Dex shows it as written.
applyTo | **/*.cfc |
|---|
Documentation
View upstream ↗- Use CFScript where possible for cleaner syntax.
- Avoid using deprecated tags and functions.
- Follow consistent naming conventions for variables and components.
- Use
cfqueryparamto prevent SQL injection. - Escape CSS hash symbols inside blocks using ##
Additional Best Practices
-
Use
thisscope 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/cfcatchfor 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
cfcomponentattributes that are deprecated or unnecessary. -
Use ternary operators where possible
-
Ensure consistent tab alignment.