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.1.tar.gz (35.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.1-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iil_reflex-0.2.1.tar.gz
  • Upload date:
  • Size: 35.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.1.tar.gz
Algorithm Hash digest
SHA256 59064952a986e5c3eda8103372eab0e01ffa296db174de529b13fc3361c8d0e9
MD5 b8703924ba9076fec236fb3a2e2b1a61
BLAKE2b-256 ac782517f489d1b01850409e2b272490853e765061950d8e816a4b70e163be41

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iil_reflex-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 35.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12cac00d81c15702d4cb30ce7d751bf45a22e2e80e476a8ef3edf57aa7992241
MD5 9a03ed4dd66080b3e40d236795b11768
BLAKE2b-256 36f14d52c15fe5add1fadc41e2f9b38f4ca06c5303a3202a50194e7cb6842008

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