Claude Skills Guide

Claude Code Cold Fusion Modernization Workflow Guide

Legacy ColdFusion applications often present significant challenges for development teams. Years of ad-hoc development, deprecated tags, and tightly coupled logic can make maintenance a nightmare. This guide demonstrates how Claude Code transforms ColdFusion modernization from a painful manual process into an automated, intelligent workflow that preserves business logic while migrating to modern architectures.

Understanding the ColdFusion Modernization Challenge

ColdFusion markup language (CFML) powered countless enterprise applications since the late 1990s. While ColdFusion itself has evolved significantly, many organizations still run legacy codebases written in older syntax patterns that create technical debt. The typical modernization project involves:

Claude Code excels at this transformation because it understands both the source and target architectures, can analyze code patterns at scale, and generates safe, reversible refactoring operations.

Setting Up Your Modernization Environment

Begin by installing Claude Code and configuring a dedicated skill for ColdFusion analysis:

# Place cold-fusion-analyzer.md in .claude/ then invoke: /cold-fusion-analyzer
# Place cfml-to-modern-cfml.md in .claude/ then invoke: /cfml-to-modern-cfml

Create a project-specific configuration that defines your modernization targets:

{
  "modernization": {
    "sourceVersion": "ColdFusion 9",
    "targetVersion": "ColdFusion 2021",
    "framework": "FW/1",
    "database": "PostgreSQL",
    "includeTests": true
  }
}

This configuration guides Claude’s refactoring decisions throughout the modernization process.

Phase One: Code Analysis and Inventory

Before making any changes, Claude scans your codebase to create a comprehensive inventory. The analyzer skill identifies:

Run the analysis with specific scope constraints:

Analyze the /components directory for ColdFusion 9 compatibility issues. 
Generate a CSV report with file paths, line numbers, issue types, and 
estimated effort for remediation. Exclude /components/cfc generated 
from older frameworks.

Claude produces structured output that your team can prioritize. The analysis typically reveals that 60-70% of issues fall into predictable patterns that automated refactoring can address safely.

Phase Two: Automated Refactoring Patterns

With analysis complete, Claude applies systematic refactoring using safe transformation patterns. Each change preserves original functionality while modernizing syntax.

Converting Deprecated Tags

ColdFusion 9 applications frequently use deprecated tags that behave inconsistently in modern engines. Claude converts these systematically:

<!--- Before: Legacy query --->
<cfquery name="getUsers" datasource="myDSN">
    SELECT * FROM users WHERE active = 1
</cfquery>

<!--- After: Parameterized query with queryExecute --->
<cfscript>
    getUsers = queryExecute(
        "SELECT * FROM users WHERE active = :active",
        { active: 1 },
        { datasource: "myDSN" }
    );
</cfscript>

The transformation extracts inline SQL into parameterized queries, eliminating SQL injection vulnerabilities while maintaining exact functional equivalence.

Component Modernization

Legacy CFCs often mix business logic with data access. Claude restructures these into separated concerns:

Refactor /components/userService.cfc to follow FW/1 conventions. 
Extract the getUserById method into a separate userGateway.cfc. 
Apply dependency injection for database references. Keep the 
original method as a facade that delegates to the gateway.

This pattern preserves API compatibility while enabling testability and maintainability.

View Layer Extraction

Older ColdFusion applications frequently embed business logic in CFM templates. Claude identifies these patterns and suggests extraction points:

In /views/user/profile.cfm, identify any CFML logic that should 
reside in the controller layer. Create corresponding controller 
methods in /handlers/user.cfc and replace with view variables 
initialized in the controller.

Phase Three: Testing and Validation

Modernization without testing risks introducing regressions. Claude integrates testing throughout the workflow:

Test Generation

For legacy code lacking test coverage, Claude generates comprehensive unit tests:

Generate WireBox mock tests for all methods in 
/components/userService.cfc. Use the existing test framework 
(MXUnit) and follow the pattern established in /tests/model/.

Regression Prevention

After each refactoring batch, run the full test suite to verify functionality:

# Run ColdFusion test suite
box testbox run runner=tests/index.cfm

# Claude reviews any failures and suggests corrections
claude "Analyze the test failures in test-results.xml. Identify 
whether failures indicate regressions from the modernization 
or pre-existing test issues. Propose fixes for any legitimate 
regressions."

Phase Four: Containerization and Deployment

With code modernized, Claude assists containerizing the application for cloud deployment:

Create a Dockerfile for the modernized ColdFusion application.
Use the official ortus-coldfusion:2021 base image. Configure 
multi-stage build with the application WAR in the final stage.
Include health check endpoints and JVM tuning for containerized 
execution.

The generated Dockerfile includes best practices for ColdFusion in containers:

# Build stage
FROM ortus-coldfusion:2021-build as builder
WORKDIR /app
COPY source/ ./source/
RUN box package war

# Production stage  
FROM ortus-coldfusion:2021
COPY --from=builder /app/*.war /opt/coldfusion2021/cfusion.ear/
ENV JAVA_OPTS="-Xms512m -Xmx2048m -XX:+UseG1GC"
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s \
  CMD curl -f http://localhost:8080/health || exit 1

Workflow Best Practices

Successful ColdFusion modernization requires disciplined process adherence:

Start Small: Begin with isolated components that have minimal dependencies. This builds confidence in Claude’s refactoring patterns before tackling core business logic.

Commit Frequently: Modernization generates many small changes. Each refactoring batch should produce a focused commit with clear description:

cfml: Parameterize user query in userService.getActive()

- Convert cfquery to queryExecute with named parameters
- Preserve original query logic exactly
- No functional changes intended

Review Changes: Claude generates safe transformations, but domain expertise remains valuable. Use pull request reviews to validate business logic preservation.

Measure Progress: Track modernization metrics throughout the project:

Metric Initial Current Target
Deprecated tags 847 312 0
Parameterized queries 124 412 512
Test coverage 23% 58% 80%

Conclusion

Claude Code transforms ColdFusion modernization from an error-prone manual effort into an automated, measurable process. By using Claude’s understanding of both legacy CFML and modern architectures, teams can safely migrate decades of business logic while reducing risk and accelerating timeline. The key lies in systematic application: analyze comprehensively, refactor methodically, test continuously, and deploy confidently.

Start your modernization journey today by installing the cold-fusion-analyzer skill and running your first inventory scan. Your legacy codebase contains years of business value—Claude helps you unlock it for the next generation of application architecture.

Built by theluckystrike — More at zovo.one