Building with AI for human benefit. Sharing how it's done.
Navigating multi-section applications with Claude.
Complex forms are labyrinths:
Users get lost. AI gets confused by context length.
Instead of feeding the entire form to Claude, treat it like a Choose Your Own Adventure book:
class FormCopilot:
def __init__(self, config):
self.sections = config["sections"]
self.current = 0
self.answers = {}
def next_section(self):
section = self.sections[self.current]
if self.should_skip(section):
self.current += 1
return self.next_section()
return section
def should_skip(self, section):
condition = section.get("skip_if")
if condition:
return eval(condition, self.answers)
return False
{
"sections": [
{
"id": "business_type",
"prompt": "What type of business are you?",
"options": ["sole_prop", "llc", "corp"]
},
{
"id": "corp_details",
"skip_if": "business_type != 'corp'",
"prompt": "Enter corporation details..."
}
]
}
Turn left to Section 7B. Turn right to skip to Schedule C.