Lux.Company.DSL (Lux v0.5.0)
View SourceA simple DSL for defining companies with a CEO, custom roles, and objectives.
Example
defmodule MyApp.Companies.ContentTeam do
use Lux.Company
company do
name "Content Creation Team"
mission "Create engaging content efficiently"
# Every company has a CEO
has_ceo "Content Director" do
agent MyApp.Agents.ContentDirector
goal "Direct content creation and review"
can "plan"
can "review"
can "approve"
end
# Group member roles together
members do
has_role "Lead Researcher" do
agent {"researcher-123", :research_hub}
goal "Research and analyze topics"
can "research"
can "analyze"
can "summarize"
end
has_role "Senior Writer" do
agent MyApp.Agents.Writer
goal "Create and edit content"
can "write"
can "edit"
can "draft"
end
end
# Define objectives
objective :create_blog_post do
description "Create a well-researched blog post"
success_criteria "Published post with >1000 views"
steps [
"Research the topic",
"Create an outline",
"Write first draft",
"Review and edit",
"Publish"
]
end
end
end