summaryrefslogtreecommitdiff
path: root/examples/plain_ruby/agents.rb
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-14 09:56:52 +0200
committerPaul Buetow <paul@buetow.org>2026-03-14 09:56:52 +0200
commit818ed50e2a54b40ccf7a7771bebe0312dc01a8b5 (patch)
tree16bfb301c1192a1d301d50388eb33a52ecdc7e69 /examples/plain_ruby/agents.rb
parent63607f415c45a8670cd2eb4d346e448dceb5422f (diff)
Add agent-backed file processing DSL
Diffstat (limited to 'examples/plain_ruby/agents.rb')
-rwxr-xr-xexamples/plain_ruby/agents.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/examples/plain_ruby/agents.rb b/examples/plain_ruby/agents.rb
new file mode 100755
index 0000000..e04da98
--- /dev/null
+++ b/examples/plain_ruby/agents.rb
@@ -0,0 +1,40 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+# Example: Plain Ruby script using agent-backed file processing.
+#
+# Run with:
+# ruby agents.rb --dry # dry run, no changes made
+# ruby agents.rb --debug # verbose output
+# ruby agents.rb # apply configuration
+#
+# Requires rcm to be installed as a gem, or adjust the path below:
+# require_relative '../../lib/dsl'
+begin
+ require 'rcm'
+rescue LoadError
+ require_relative '../../lib/dsl'
+end
+
+configure do
+ agent hexai do
+ 'hexai PROMPT'
+ end
+
+ prompt fix english do
+ 'Correct English spellings and grammar. Improve clarity of the text. Dont introduce any new text or headers'
+ end
+
+ # Draft a rough note, then let hexai polish the language in place.
+ file example notes draft do
+ path 'agents_example.txt'
+ manage directory
+ 'this are a short note with bad english and unclear wording.'
+ end
+
+ file example notes polished do
+ path 'agents_example.txt'
+ requires file example notes draft
+ agent hexai fix english
+ end
+end