Class: Woods::Formatting::ClaudeAdapter
- Defined in:
- lib/woods/formatting/claude_adapter.rb
Overview
Formats assembled context as XML for Claude models.
Produces structured XML with:
-
‘<codebase-context>` root element
-
‘<meta>` tag with token usage and budget
-
‘<content>` section with indented context text
-
‘<sources>` section with self-closing `<source>` elements
Instance Method Summary collapse
-
#format(assembled_context) ⇒ String
Format assembled context as XML for Claude.
Instance Method Details
#format(assembled_context) ⇒ String
Format assembled context as XML for Claude.
25 26 27 28 29 30 31 32 33 |
# File 'lib/woods/formatting/claude_adapter.rb', line 25 def format(assembled_context) parts = [] parts << '<codebase-context>' parts << " <meta tokens=\"#{assembled_context.tokens_used}\" budget=\"#{assembled_context.budget}\" />" parts << format_content(assembled_context.context) parts << format_sources(assembled_context.sources) parts << '</codebase-context>' parts.join("\n") end |