Skip to content

layout-development skill incorrectly documents html.renderAssets() as a companion to html.addAsset() #45

@edyionescu

Description

@edyionescu

What are the steps to reproduce this issue?

  1. Install the layout-development skill via coldbox-cli AI integration
  2. In a ColdBox layout file, follow the skill's documented pattern of pairing html.addAsset() with html.renderAssets():
#html.addAsset( "/css/custom.css" )#
#html.renderAssets( "css" )#
  1. Load the page in a browser and inspect the rendered HTML

What happens?

html.renderAssets("css") does not exist in HTMLHelper.cfc. The call hits onMissingMethod(), which treats the method name as an HTML tag name and outputs a literal <renderAssets>css</renderAssets> tag in the page, which is invalid HTML that has no effect.

More critically, the skill document teaches AI agents incorrect behavior. During a code review session, the agent (Claude) read this skill and confidently flagged working code as broken, stating:

"html.addAsset() queues an asset for later rendering via html.renderAssets() — it doesn't output anything inline where you call it. Since there's no #html.renderAssets()# call anywhere, those assets are queued but never rendered."

The agent then suggested adding #html.renderAssets("css")# and #html.renderAssets("js")# calls, which would have introduced the spurious <renderAssets>css</renderAssets> tag into the page. Working code would have been broken by following the skill's guidance.

What were you expecting to happen?

html.addAsset() already handles its own output in one of two ways, depending on the sendToHeader argument:

  • sendToHeader=true (default) - injects the <link> or <script> tag into the HTML <head> via cfhtmlhead(). No flush step is needed.
  • sendToHeader=false - returns the HTML string inline at the call site.

There is no separate "queue and flush" mechanism requiring renderAssets(). The skill doc should not reference it at all.

Any logs, error output, etc?

Inspecting the rendered HTML source reveals the spurious tag:

<renderAssets>css</renderAssets>

Any other comments?

The skill document at templates/ai/skills/core/coldbox/layout-development.md contains two occurrences of this incorrect pattern, one in the Basic Layout Structure example and one in the Admin Layout example:

#html.renderAssets( "css" )#  <!-- in <head> -->
...
#html.renderAssets( "js" )#   <!-- before </body> -->

Suggested fix: remove all html.renderAssets() calls from the skill doc and add a comment clarifying the two modes of html.addAsset(), for example:

<!-- Inject into <head> automatically via cfhtmlhead (default behavior) -->
#html.addAsset( "/css/custom.css" )#

<!-- OR output inline at call site -->
#html.addAsset( asset="/css/custom.css", sendToHeader=false )#

What versions are you using?

Operating System: Windows 11 Pro 25H2
Package Version: coldbox-cli 8.8.0+25

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions