robyn-config-backend-best-practices
Robyn backend scaffolding and architecture guidance for projects using robyn-config. Use when creating or evolving Robyn services, choosing DDD vs MVC, choosing SQLAlchemy vs Tortoise, adding entities with robyn-config add, scaffolding admin panel with robyn-config adminpanel, adding observability stack with robyn-config monitoring, auditing Robyn backend quality, or authoring and improving skill markdown for Robyn engineering workflows.
install
source · Clone the upstream repo
git clone https://github.com/Lehsqa/robyn-config-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/Lehsqa/robyn-config-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/robyn-config-backend-best-practices" ~/.claude/skills/lehsqa-robyn-config-skills-robyn-config-backend-best-practices && rm -rf "$T"
manifest:
skills/robyn-config-backend-best-practices/SKILL.mdsource content
Robyn Config Backend Best Practices
Overview and intent
Use this skill to work effectively with
robyn-config and production-oriented Robyn backend patterns.
This skill is optimized for seven task groups:
- scaffold a new service with
robyn-config create - extend an existing service with
robyn-config add - scaffold admin panel with
robyn-config adminpanel - add observability stack with
robyn-config monitoring - keep local skill installation synchronized with latest
package releasesrobyn-config - audit and improve architecture and operational readiness
- author high-quality skill files for Robyn engineering work
Do not load every reference file by default. Load only the files required for the current task.
Fast triage workflow
- Detect project metadata in
:pyproject.toml
([tool.robyn-config].design
orddd
)mvc
([tool.robyn-config].orm
orsqlalchemy
)tortoise
([tool.robyn-config].package_manager
oruv
)poetry
- Classify requested work:
- bootstrap
- extension
- adminpanel scaffolding
- monitoring stack setup
- package release sync
- architecture or operations audit
- skill authoring
- Select references from the routing table in this file.
- Produce branch-specific guidance for design, ORM, and package manager.
- End with a validation checklist and concrete commands.
Workflow A: bootstrap from robyn-config create
robyn-config create- Select stack options: design, ORM, package manager.
- Generate service:
robyn-config create <service-name> --design <ddd|mvc> --orm <sqlalchemy|tortoise> --package-manager <uv|poetry> <destination>
- Confirm output baseline:
containspyproject.toml[tool.robyn-config]
layout matches selected designsrc/app- lock file matches package manager (
oruv.lock
)poetry.lock
- Execute ORM-specific migration bootstrap before app start.
- Run lint, type checks, and tests, then report exact failures with file paths.
Workflow B: evolve project with robyn-config add
robyn-config add- Ensure target project is a
project by checkingrobyn-config
.[tool.robyn-config] - Read optional path overrides under
.[tool.robyn-config.add] - Add module:
robyn-config add <entity-name> <project-path>
- Verify generated updates:
- new files in expected layer paths
- route registration inserted in the right registry file
- repository exports and tables updated
- no duplicate symbols or broken imports
- Regenerate migrations if schema changed.
- Run checks and confirm command rollback behavior if failures occur.
Workflow C: add admin panel with robyn-config adminpanel
robyn-config adminpanel- Ensure target project is a
project by checkingrobyn-config
.[tool.robyn-config] - Check whether
already exists; if yes, account for update confirmation behavior.[tool.robyn-config.adminpanel].created = true - Run command:
robyn-config adminpanel [-u <admin-username>] [-p <admin-password>] <project-path>
- Verify generated behavior:
- admin module exists for the selected design and is registered in app startup.
UI supports dark/light themes./admin- project models are auto-discovered and listed under
./admin/models - CRUD flows are available for discovered model tables.
- admin auth bootstrap is configured for default or provided superadmin credentials.
- Verify dependencies and metadata updates in
:pyproject.toml- required dependencies:
,jinja2
,aiosqlite
,pandasopenpyxl [tool.robyn-config.adminpanel].created = true
- required dependencies:
- Run checks and confirm command rollback behavior if failures occur.
Workflow D: add observability with robyn-config monitoring
robyn-config monitoring- Ensure target project is a
project by checkingrobyn-config
.[tool.robyn-config] - Run command:
robyn-config monitoring <project-path>
- Verify generated artifacts:
at project root.docker-compose.monitoring.yml
— Docker log discovery + Prometheus scrape withcompose/monitoring/alloy/config.alloy
.job_name = "app"
— minimal Prometheus config.compose/monitoring/prometheus/prometheus.yml
andcompose/monitoring/grafana/datasources/loki.yaml
— provisioned datasources with fixed UIDs (prometheus.yaml
,uid: loki
).uid: prometheus
— dashboard provisioning config.compose/monitoring/grafana/provisioning/dashboards.yaml
— Loki logs dashboard with search bar.compose/monitoring/grafana/dashboards/logs.json
— Prometheus metrics dashboard.compose/monitoring/grafana/dashboards/metrics.json
injected into the presentation layer and registered asmetrics.py
.GET /metrics
- Verify
was installed (or added toprometheus-client
dependencies as fallback).pyproject.toml - Start the observability stack alongside the app:
docker compose up -d docker compose -f docker-compose.monitoring.yml up -d
- Validate:
returns Prometheus text output.http://localhost:8000/metrics- Grafana at
loads both dashboards without errors.http://localhost:3000 - Logs panel shows data within 30 seconds of app activity.
- Metrics panel shows data within one scrape interval (15 s).
Workflow E: review and improve architecture and ops readiness
- Validate architecture boundaries for selected design.
- Validate runtime safety:
- settings and env overrides
- auth, session, CORS behavior
- transaction boundaries and error mapping
- Validate operations:
- migration startup order
- compose and local parity
- logging and debug posture
- Prioritize recommendations:
- P0 correctness and security
- P1 reliability and consistency
- P2 maintainability and performance
- Provide file-targeted, diff-ready changes.
Workflow F: author and update skill files for Robyn engineering
- Keep
concise and procedural.SKILL.md - Put deep detail into
and load on demand.references/ - Write frontmatter with explicit trigger contexts.
- Reuse rule patterns from
where useful.react-best-practices - Validate skill structure before delivering:
- no placeholder markers
- all referenced files exist
- no extra docs such as README or changelog inside skill folder
Workflow G: sync skills after a robyn-config
package release
robyn-config- Run:
./skills/robyn-config-backend-best-practices/scripts/update-if-new-robyn-config.sh
- Script behavior:
- checks installed
version vs latest PyPI versionrobyn-config - if newer version exists, runs
python -m pip install --upgrade robyn-config - then runs
npx skills update - if already up to date, exits without changes
- checks installed
Reference routing table
Open only the file needed for the task:
references/robyn-config-src-analysis.md- Use for
internals and generation/injection behavior, including therobyn-config
command.monitoring
- Use for
references/robyn-backend-best-practices.md- Use for prioritized engineering guidance and review criteria.
references/robyn-config-workflows.md- Use for operator playbooks and command sequences, including monitoring stack setup and validation.
references/architecture-ddd-vs-mvc.md- Use for architecture selection and refactor planning.
references/orm-sqlalchemy-vs-tortoise.md- Use for ORM tradeoffs and migration/session behavior.
references/skill-authoring-patterns.md- Use for writing and validating high-quality skill markdown.
references/react-style-rule-system.md- Use for reusable rule-library design patterns and taxonomy.
scripts/update-if-new-robyn-config.sh- Use to check for a newer
release and update local skills only when needed.robyn-config
- Use to check for a newer
Output requirements
Always:
- Include concrete executable commands.
- Include design and ORM branch-specific instructions.
- Include package-manager-aware instructions (
anduv
).poetry - Include a validation checklist covering structure, behavior, and checks.
- State assumptions explicitly when repository context is incomplete.