Skip to main content

REFLEX — Reflexive Evidence-based Loop for UI Development

Project description

iil-reflex

REFLEX — Reflexive Evidence-based Loop for UI Development

Evidence-based UI development methodology with LLM-powered domain agent, UC quality checker, and failure classifier. Pure Python — no Django dependency.

Architecture

reflex/
├── agent.py       # DomainAgent (variable domain, LLM-powered)
├── quality.py     # UC Quality Checker (11 criteria, rule-based)
├── classify.py    # Failure Classifier (decision tree + LLM)
├── config.py      # ReflexConfig from reflex.yaml
├── providers.py   # KnowledgeProvider, DocumentProvider (Protocol)
├── types.py       # Dataclasses (Results, Questions, Entries)
└── templates/     # promptfw .jinja2 templates (6 templates)

Installation

pip install iil-reflex
# Optional: Playwright for Zirkel 2
pip install iil-reflex[playwright]

Quick Start

from reflex.agent import DomainAgent
from reflex.config import ReflexConfig
from reflex.quality import UCQualityChecker

# 1. Load hub config
config = ReflexConfig.from_yaml("reflex.yaml")

# 2. UC Quality Check (rule-based, no LLM needed)
checker = UCQualityChecker(config)
result = checker.check(uc_text="...", uc_slug="sds-upload")
print(f"Score: {result.score_percent}%, Passed: {result.passed}")

# 3. Domain Agent (LLM-powered)
agent = DomainAgent(
    config=config,
    llm=your_llm_provider,
    knowledge=your_knowledge_provider,  # optional
    documents=your_document_provider,   # optional
)
research = agent.research("SDS Upload Pipeline")
questions = agent.generate_interview(research)
kb = agent.distill_kb(research, expert_answers={...})

Hub Configuration (reflex.yaml)

hub_name: risk-hub
vertical: chemical_safety
domain_keywords: ["SDS", "CAS", "GHS", "REACH"]
quality:
  min_acceptance_criteria: 2
  max_uc_steps: 7
  require_error_cases: true
viewports:
  - {name: mobile, width: 375, height: 812}
  - {name: desktop, width: 1280, height: 800}
htmx_patterns:
  banned: ["hx-boost"]
  required_on_forms: ["hx-indicator"]
permissions_matrix:
  /substances/: {anonymous: 302, viewer: 200, admin: 200}

Provider Pattern

All external dependencies use Protocols (Dependency Inversion):

from reflex.providers import KnowledgeProvider, LLMProvider

class OutlineProvider(KnowledgeProvider):
    def search(self, query, limit=5):
        return mcp3_search_knowledge(query, limit=limit)

class GroqProvider(LLMProvider):
    def complete(self, messages, action_code=""):
        return groq_client.chat(messages=messages)

Mock providers included for testing: MockKnowledgeProvider, MockDocumentProvider, MockLLMProvider

REFLEX Methodology

Three quality circles — no artifact without evidence:

  1. Zirkel 0 — Domain KB (DomainAgent + Expert sign-off)
  2. Zirkel 1 — UC Quality (11 criteria, 100% score required)
  3. Zirkel 2 — Playwright Tests (1 test per acceptance criterion)

Failure Classification:

  • UC_PROBLEM → UC needs revision (Zirkel 1 restart)
  • UI_PROBLEM → Wireframe needs fix
  • INFRA_PROBLEM → Server/browser/network issue

Dependencies

  • iil-promptfw>=0.7.0 — prompt template rendering
  • pyyaml>=6.0 — config file parsing
  • Optional: playwright — for Zirkel 2 test execution

Related

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iil_reflex-0.2.0.tar.gz (34.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iil_reflex-0.2.0-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file iil_reflex-0.2.0.tar.gz.

File metadata

  • Download URL: iil_reflex-0.2.0.tar.gz
  • Upload date:
  • Size: 34.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for iil_reflex-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1afdd81d6f9dc595c233ae96a9a16d9ee6191ced853a351d8ea0c276273e8e33
MD5 c56c53d64ee24b42d322b12fd66323ac
BLAKE2b-256 086576b5bdb3ef8910876433dfc3a8e814a649a2a2521df15d153becd31d73a4

See more details on using hashes here.

File details

Details for the file iil_reflex-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: iil_reflex-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for iil_reflex-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f9ec986bc16b0b9824a37c46e6658a0bd7d5617d56ab344517b6800fa004243
MD5 d280d9780bd0e413192122f9b11f0783
BLAKE2b-256 43356b6b122dcecce3a88abf261c0f15e48dbd25f72fbcd62b5e1310a980ea92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page