appkit-commons

Implements configuration, service registry, repositories, entities, and schedulers for appkit-commons applications.

Updated Jun 13, 2026
One-click install
npx skills add https://github.com/jenreh/project-kit-template --skill appkit-commons-jenreh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: appkit-commons
Source: https://github.com/jenreh/project-kit-template/tree/main/.agents/agent-skills/skills/appkit-commons
Command: npx skills add https://github.com/jenreh/project-kit-template --skill appkit-commons-jenreh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers building features on the appkit-commons framework need consistent patterns for configuration loading, dependency injection, database access, and background scheduling, and mistakes like module-level registry calls or autogenerated Alembic migrations cause subtle runtime failures. ## Core Features & Use Cases - Configuration Management: YAML profiles with environment overrides, nested config auto-registration, and secret resolution via Azure Key Vault or local environment. - Persistence Layer: BaseRepository async CRUD, Entity mixins with auto timestamps, EncryptedString and ArrayType custom columns, and manual Alembic migration conventions. - Scheduling & DI: Service registry singletons plus APScheduler and PGQueuer backends with cron, interval, and calendar triggers for distributed-safe background jobs. - Use Case: When adding a new feature with a database table and a nightly cleanup job, apply this Skill to scaffold the config class, entity, repository, and ScheduledService following framework conventions. ## Quick Start Apply the appkit-commons patterns to add a new feature with a configured service, a database entity with repository, and a scheduled cleanup job.

Frequently Asked Questions about appkit-commons

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure an appkit-commons application with YAML profiles?

Define a cached configure() function calling service_registry().configure() with your BaseConfig class. BaseConfig loads config.yaml first, then merges config.<profile>.yaml selected via the PROFILE environment variable, with __-delimited env vars overriding nested values.

How do I create a repository with async CRUD in appkit-commons?

Subclass BaseRepository[T], implement the model_class property, and add only custom query methods. The base provides create, find_by_id, find_all, save, update, and delete operations using get_asyncdb_session(), which auto-commits on exit.

APScheduler vs PGQueuer for scheduled tasks in appkit-commons?

APScheduler is the default backend and is distributed-safe, coordinating via the SQL datastore so each job runs on only one node. PGQueuerScheduler is the alternative backend; both accept CronTrigger, IntervalTrigger, and CalendarIntervalTrigger definitions.

Why should I avoid rx.asession() in Reflex background tasks?

rx.asession() breaks in background tasks and callbacks outside the Reflex request lifecycle. Use get_asyncdb_session() from appkit_commons instead, which manages the session lifecycle independently and auto-commits on context exit.

Can I use Alembic autogenerate for appkit-commons migrations?

No, migrations must be written manually without --autogenerate. Set down_revision to the revision string from the previous migration file, not its filename, and keep the Revises docstring comment matching down_revision.

How does EncryptedString column encryption work in appkit-commons?

EncryptedString encrypts values at rest using Fernet, reading the cipher key from DatabaseConfig.encryption_key via the service registry at runtime. ArrayType similarly provides dialect-agnostic arrays, using native ARRAY on PostgreSQL and JSON on SQLite.