Class: RosettAi::Compiler::Backends::AgentsMdBackend

Inherits:
RosettAi::Compiler::Backend show all
Defined in:
lib/rosett_ai/compiler/backends/agents_md_backend.rb

Overview

Compiler backend for AGENTS.md (AAIF standard format).

Renders behaviour configuration into idiomatic AGENTS.md files compatible with Claude Code, Goose, Cursor, and other AAIF-aligned tools. Output is valid Markdown without YAML frontmatter, following the AGENTS.md v0.1.0 specification.

Author:

  • hugo

  • claude

Constant Summary collapse

MARKER_PREFIX =
'<!-- rosett-ai-agents-md-managed'

Constants inherited from RosettAi::Compiler::Backend

RosettAi::Compiler::Backend::BUILTIN_BACKENDS

Instance Attribute Summary

Attributes inherited from RosettAi::Compiler::Backend

#profile

Instance Method Summary collapse

Methods inherited from RosettAi::Compiler::Backend

#file_extension, for, #initialize, #managed_file?

Constructor Details

This class inherits a constructor from RosettAi::Compiler::Backend

Instance Method Details

#generated_markerString

Returns marker prefix for managed file detection.

Returns:

  • (String)

    marker prefix for managed file detection



34
35
36
# File 'lib/rosett_ai/compiler/backends/agents_md_backend.rb', line 34

def generated_marker
  MARKER_PREFIX
end

#render(data) ⇒ String

Renders behaviour data into AGENTS.md format.

Parameters:

  • data (Hash)

    parsed YAML behaviour data

Returns:

  • (String)

    rendered Markdown content



25
26
27
28
29
30
31
# File 'lib/rosett_ai/compiler/backends/agents_md_backend.rb', line 25

def render(data)
  lines = build_header(data)
  lines.concat(build_description(data))
  lines.concat(build_rules(data))
  lines << ''
  lines.join("\n")
end