| name | coldfusion-validator |
| description | Comprehensive ColdFusion (CFML) syntax validation and best practices verification. Use when validating ColdFusion code, checking for security vulnerabilities (SQL injection, proper cfqueryparam usage), ensuring proper variable scoping, verifying code quality standards, or reviewing ColdFusion applications for senior developer best practices. |
ColdFusion Syntax Validation Skill
Overview
This skill provides comprehensive ColdFusion (CFML) syntax validation and best practices verification based on senior developer standards. It helps ensure code quality, security, and maintainability.
Tools and Validation Methods
1. CFLint - Primary Validation Tool
CFLint is the standard tool for ColdFusion syntax validation and best practices checking.
Installation: ```bash
Install via npm
npm install -g cflint
Or download standalone JAR from GitHub
wget https://github.com/cflint/CFLint/releases/latest/download/cflint-assembly-1.5.0.jar ```
Basic Usage: ```bash
Validate a single file
cflint -file path/to/file.cfm
Validate entire directory
cflint -folder /path/to/project -html -htmlfile report.html
JSON output for programmatic parsing
cflint -folder /path/to/project -json -jsonfile report.json ```
2. Configuration File (.cflintrc)
Create a `.cflintrc` configuration file for project-specific rules including checks for SQL injection, missing cfqueryparam, nested cfoutput, and proper documentation.
Senior Developer Standards
Critical Security Rules
1. SQL Injection Prevention
Always use `cfqueryparam` for dynamic SQL:
❌ Bad:
```cfml
✅ Good:
```cfml
2. Variable Scoping
Always scope variables properly:
❌ Bad:
```cfml
✅ Good:
```cfml
Code Quality Standards
3. Component Documentation
Always provide hints for components, functions, and arguments:
✅ Good:
```cfml
4. Use CFScript for Logic
Modern ColdFusion prefers script syntax for business logic with proper error handling.
Validation Process
When validating ColdFusion code:
- Install CFLint if not already available
- Run validation using cflint command
- Parse results and highlight critical security issues
- Check for:
- SQL injection vulnerabilities
- Missing cfqueryparam
- SELECT * usage
- Variable scoping issues
- Missing documentation
- Nested cfoutput tags
- Provide specific fixes with before/after examples
- Explain reasoning behind each best practice
Manual Review Checklist
Security
- All SQL queries use cfqueryparam
- No direct form/URL variable usage in queries
- Sensitive data is encrypted
- File upload paths are validated
Performance
- Queries specify columns (no SELECT *)
- Appropriate query caching
- Indexes exist for queried columns
Code Quality
- Variables properly scoped (var/local)
- Functions have hints/documentation
- No nested cfoutput tags
- Proper error handling (try/catch)
Maintainability
- Consistent naming conventions
- DRY principle followed
- Separation of concerns (MVC/layered)