appkit: Skill for Claude Code

.claude/skills/reflex-state-and-architecture/SKILL.md

reflex-state-and-architecture is a skill for Claude Code from jenreh/appkit. It costs 36 tokens per session (4,345 once invoked), scanned A, original, MIT.

An architecture and development guide for Reflex, a Python framework for building web applications. It explains how to organize features, state, user-interface components, database access, services, and configuration.

In plain words
What is it for?
Use it when adding Reflex features, designing state and event handlers, building forms and pages, connecting databases, or organizing reusable feature packages.
Why use it?
It gives the project a consistent structure and keeps application logic, web-interface code, and database code in appropriate places. It also documents patterns for validation, background tasks, and data access.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is jenreh/appkit's own configuration. It tells Claude Code how to work on appkit itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything appkit configures →

Reuse

Borrowing it

Nothing to install: this file belongs to jenreh/appkit. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/jenreh/appkit/main/.claude/skills/reflex-state-and-architecture/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/jenreh/appkit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for reflex-state-and-architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/jenreh/appkit/reflex-state-and-architecture/github.svg)](https://agentmods.dev/skills/jenreh/appkit/reflex-state-and-architecture)
Your own site
<a href="https://agentmods.dev/skills/jenreh/appkit/reflex-state-and-architecture"><img src="https://agentmods.dev/badge/skills/jenreh/appkit/reflex-state-and-architecture/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for reflex-state-and-architecture

Your own site · 80×15
<a href="https://agentmods.dev/skills/jenreh/appkit/reflex-state-and-architecture"><img src="https://agentmods.dev/badge/skills/jenreh/appkit/reflex-state-and-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,345 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.04345
Opus 5 $0.00018 $0.02173
Sonnet 5 $0.00007 $0.00869
Haiku 4.5 $0.00004 $0.00434

Measured 9d ago against content hash abc76d20dd7d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

reflex-state-and-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (examples/background_task_example.py, examples/components_example.py, examples/form_validation_example.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/reflex-state-and-architecture/SKILL.md · 548 lines

How it starts

The opening of the file, as written. The whole thing — 548 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Reflex Best Practices

This skill guides development in this Reflex.dev project. Read it before writing any new feature.


1. Project Architecture

Every feature lives in its own workspace package under components/alloq-<name>/. The main app/ is the shell that assembles packages into a running application.

components/alloq-<feature>/
└── src/alloq_<feature>/
    ├── __init__.py          # public exports only
    ├── configuration.py     # Pydantic config schemas
    ├── backend/             # or backend.py — pure Python, no Reflex
    │   ├── models.py        # SQLModel table + UI models
    │   ├── repository.py    # async DB access
    │   └── services/        # business logic
    ├── state/               # or state.py — rx.State subclasses
    ├── components/          # or components.py — UI functions
    └── pages.py             # page factory functions

app/
├── app.py                   # assembles packages, creates rx.App
├── configuration.py         # root AppConfig + configure()
├── roles.py                 # Role definitions for RBAC
├── styles.py                # global style dicts + stylesheets
├── states/                  # app-level states (HomeState, etc.)
├── components/              # app-level reusable components
└── pages/                   # app-level pages

Rule: business logic belongs in backend/, reactive state in state/, UI in components/, routing in pages.py. Never mix concerns.


2. State Management

Base class

All states inherit from rx.State. When you need the authenticated user, inherit from UserSession (from appkit_user):

import reflex as rx
from appkit_user.authentication.states import UserSession

class MyFeatureState(rx.State):  # no auth needed
    ...

class MyFeatureState(UserSession):  # auth needed
    user = await self.authenticated_user

State variable conventions

class MyFeatureState(rx.State):
    # Data — typed, always with a default
    items: list[MyModel] = []
    selected_item: MyModel | None = None

    # Loading / UI flags
    is_loading: bool = False
    is_saving: bool = False

    # Filters / form fields
    search_query: str = ""
    selected_month: int = datetime.now(UTC).month

    # Private (not serialized to frontend) — prefix with _
    _initialized: bool = False

    # Browser-persisted — use rx.LocalStorage
    selected_tab: str = rx.LocalStorage("default", name="my-tab", sync=True)

Read the full file on GitHub · 548 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 548 lines · 36 tokens per session scan A abc76d20dd7d

Subscribe to this mod's changes

reflex-state-and-architecture is a skill published in the GitHub repository jenreh/appkit (4 stars, last pushed 2d ago), licensed MIT. It adds 36 tokens to every session and 4,345 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

sql-reporting

Conventions and review steps for writing analytics SQL against the warehouse. Use whenever the task involves querying tables, building a report, or aggregating metrics.

apache/airflow · 34 tokens

schema-exploration

Lists tables, describes columns and data types, identifies foreign key relationships, and maps entity relationships in a database. Use when the user asks about database schema, table structure, column types, what tables exist, ERD, foreign keys, or how entities relate.

langchain-ai/deepagents · 57 tokens

deepagents-thread-inspector

Inspect and explain conversations in the local Deep Agents Code SQLite session store. Use as a fallback when LangSmith trace tooling is unavailable, for offline or untraced sessions, or when asked to identify or summarize a local dcode thread, inspect checkpoint metadata, list recent local threads, or parse…

langchain-ai/deepagents · 82 tokens

query-writing

Writes and executes SQL queries from simple SELECTs to complex multi-table JOINs, aggregations, and subqueries. Use when the user asks to query a database, write SQL, run a SELECT statement, retrieve data, filter records, or generate reports from database tables.

langchain-ai/deepagents · 57 tokens

cocoindex

This skill should be used when building data processing pipelines with CocoIndex, a Python library for incremental data transformation. Use when the task involves processing files/data into databases, creating vector embeddings, building knowledge graphs, ETL workflows, or any data pipeline requiring automatic change…

cocoindex-io/cocoindex · 88 tokens

deepeval-tracing

Instrument an AI application with DeepEval's native tracing so its behavior is visible in Confident AI. TRIGGER when the user wants to add DeepEval tracing or @observe to an LLM app, agent, RAG pipeline, or chatbot; wire a framework, model-provider, or vector-database integration (LangGraph, LangChain, OpenAI Agents…

confident-ai/deepeval · 208 tokens