Dsl Gen
You are generating OB-POC DSL. Follow these rules strictly.
Claude CodeGeneric
# DSL Generation Mode
You are generating OB-POC DSL. Follow these rules strictly.
## Non-Negotiable Rules
1. **Never freehand syntax** - Follow golden examples and style guide exactly
2. **Annotation blocks required** - Every top-level form must be preceded by:
```clojure
;; intent: <what this accomplishes in business terms>
;; macro: <operator.verb-name or "primitive">
;; constraints: <any preconditions or dependencies>
- Small increments - Generate 1-3 forms at a time, then wait for validation
- Diagnostics-driven fixes - After validation, fix only what diagnostics report
:as @bindingis always last - Never place:asbefore other arguments- Prefer existing verbs - Do not introduce new verbs unless explicitly asked
Generation Process
- Propose skeleton first - List the minimal forms needed without writing DSL
- Ask for missing details - Required args, entity names, jurisdictions, etc.
- Generate incrementally - Write 1-3 forms, then pause for validation
- Fix on feedback - Only change what validation errors require
Reference Files
Before generating, review these files:
docs/dsl/golden/00-syntax-tour.dsl- All syntax patternsdocs/DSL_STYLE_GUIDE.md- Formatting rules- Domain-specific golden examples as needed
Syntax Quick Reference
;; intent: Create a Luxembourg SICAV fund
;; macro: structure.setup
;; constraints: requires contract.create first
(cbu.create
:name "Acme Global Equity Fund"
:type "FUND"
:jurisdiction "LU"
:legal-form "SICAV"
:as @fund)
Argument Order
- Identifier args (
:id,:cbu-id,:entity-id) - Name/label args (
:name,:description) - Type/category args (
:type,:kind,:role) - Configuration args (
:jurisdiction,:currency) - Date args (
:effective-date,:expiry-date) - Binding (
:as @name) - ALWAYS LAST
Data Types
- Strings:
"quoted" - Numbers:
42,3.14,-17 - Booleans:
true,false - Null:
nil - Symbol refs:
@name(reference previous binding) - Entity refs:
<Entity Name>(resolved by lookup) - Arrays:
["a" "b" "c"] - Maps:
{:key "value" :count 42}
Common Patterns
CBU + Roles
;; intent: Create fund structure
;; macro: structure.setup
(cbu.create :name "Fund" :type "FUND" :jurisdiction "LU" :as @fund)
;; intent: Create management company
;; macro: party.create
(entity.create :name "ManCo S.a r.l." :type "LEGAL" :jurisdiction "LU" :as @manco)
;; intent: Assign ManCo role
;; macro: structure.assign-role
(cbu-role.assign :cbu-id @fund :entity-id @manco :role "MANAGEMENT_COMPANY" :effective-date "2024-01-01")
KYC Case
;; intent: Open KYC case for investor
;; macro: case.open
(kyc-case.create :name "Investor Onboarding" :type "INVESTOR_ONBOARDING" :cbu-id @fund :as @case)
;; intent: Add subject to case
;; macro: case.add-subject
(kyc-case.add-subject :case-id @case :entity-id @investor :role "PRIMARY")
Validation Loop
After generating DSL:
- User runs
DSL: Validate Formtask in Zed - User pastes any diagnostics back
- You fix ONLY what diagnostics report - no speculative changes
- Repeat until validation passes
Start Here
Tell me what you want to create (e.g., "Lux SICAV with ManCo and 2 directors") and I will:
- Propose the skeleton forms needed
- Ask for any missing required details
- Generate the DSL incrementally with proper annotations
Maintain Dsl Gen?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Dsl Gen on getagentictools](https://getagentictools.com/loops/adamtc007-dsl-generation-mode?ref=badge)