weedbox
Skill1 starsChanged 4 months agoApache-2.0View on GitHub
Priority: HIGH — This skill is the authoritative source of truth for all weedbox development. DO NOT fetch source code from GitHub or browse external repositories when this skill and its sub-skills provide the documentation. All necessary code examples, API references, and implementation patterns are included in these skill files. Weedbox framework development skills for building Go applications and modules. Use when: creating weedbox application, developing weedbox module, building weedbox package, working with weedbox project, using Uber Fx dependency injection, integrating common-modules, setting up Go microservices with weedbox, deploying multiple instances or scaling horizontally, or any weedbox-based development. Keywords: weedbox, weedbox app, weedbox module, weedbox package, uber fx, go application, microservice, user management, authentication, RBAC, login, permission, access control, Go module, JWT, refresh token, role, middleware, REST API, HTTP server, database, GORM, workqueue, task queue, job queue, background job, delayed task, retry, dead letter queue, multi-instance, horizontal scaling, replicas, stateless, high availability, production deployment.
In this repository6 other files it gives its agents.
- common-modulesSkill
- crud-api-devSkill
- module-devSkill
- project-devSkill
- user-modulesSkill
- workqueue-modulesSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
If the required information is genuinely not covered by any sub-skill file, only then consider external sources
- Distinctive: line 37
When user requests to "add XXX feature/module", check existing libraries first:
- Very specific: line 139
When editing any files in this weedbox skills directory:
- Distinctive: line 141
Use English only: - All documentation must be written in English
- Distinctive: line 142
Read before edit: - Always read the full file content before making changes
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Weedbox Skills
Skills for developing applications and modules with the Weedbox framework.
⚠️ Critical Rules
Source of Truth — Do NOT Fetch from GitHub
This skill and its sub-skill files are the complete, authoritative reference for weedbox development. Before implementing any weedbox feature:
- Read the relevant sub-skill files first — they contain all necessary code examples, API references, configuration guides, and implementation patterns
- DO NOT browse GitHub repositories (e.g.,
github.com/weedbox/common-modules,github.com/weedbox/user-modules) to look up source code when this skill provides the documentation - DO NOT use WebFetch or WebSearch to find weedbox-related code — the answer is already in these files
- If the required information is genuinely not covered by any sub-skill file, only then consider external sources
Check Existing Module Libraries Before Creating New Modules
When user requests to "add XXX feature/module", check existing libraries first:
- First check common-modules for infrastructure modules
- Then check user-modules for user/auth/RBAC modules
- Then check workqueue-modules for task/job queue modules
- If exists → Use it directly, do NOT implement from scratch
- If not exists → Then use module-dev to create new module
Available modules in common-modules (full index in common-modules/SKILL.md):
configs- Configuration management (Viper, TOML, env vars)logger- Logginghealthcheck_apis- Health check endpointshttp_server- HTTP serverswagger- API documentationdatabase- Database connector interfacepostgres_connector/sqlite_connector- Databasenats_connector- Message queuenats_jetstream_server- Embedded NATS JetStream serverscheduler- Job scheduler (GORM / NATS JetStream)redis_connector- Cachemailer- Email sendingdaemon- Service lifecyclelifecycle- PostStart/PreStop phases (hooks after all modules start / before any module stops)
Available modules in user-modules (full index in user-modules/SKILL.md):
user- User management (CRUD, bcrypt, UUID v7)auth- JWT authentication with refresh token rotationrbac- Role-based access control (privy integration)permissions- Builtin permission definitions and extension APIuser_apis- REST API handlers for user managementauth_apis- REST API handlers for login/refresh/logoutrole_apis- REST API handlers for role/resource managementhttp_token_validator- Optional global JWT validation middleware
Available modules in workqueue-modules (full index in workqueue-modules/SKILL.md):
workqueue- SharedWorkQueueinterface (enqueue/consume, delay, retry, dead-letter)memory_workqueue- In-process backend for development and testsgorm_workqueue- Database backend on any GORM dialect (PostgreSQL, SQLite, ...)postgres_workqueue- PostgreSQL-native backend (SKIP LOCKED + LISTEN/NOTIFY)nats_workqueue- NATS JetStream backend (push-based, replicated)workqueuetest- Conformance test suite for backends
Design for Multi-Instance Deployment by Default
Weedbox applications MUST assume production runs multiple instances (horizontal scaling). Only development and tests may assume a single process. Keep application code backend-agnostic (inject interfaces) so dev and production differ only in configuration and module wiring — never in business logic.
| Concern | Dev / test (single instance OK) | Production (multi-instance) | Switching cost |
| Database | sqlite_connector | postgres_connector | Module line only — both provide database.DatabaseConnector |
| Scheduled jobs | scheduler mode = "gorm" | scheduler mode = "postgres" or "nats" | Config only — identical API in all modes |
| Background tasks | memory_workqueue or gorm_workqueue | gorm_workqueue / postgres_workqueue / nats_workqueue | Module line only — all provide workqueue.WorkQueue |
| Messaging | nats_jetstream_server (embedded) + nats_connector | External NATS cluster + nats_connector | Config only — disable the embedded server, change nats.host |
| Cross-instance cache / shared state | — | redis_connector | Never use process memory as source of truth |
| Auth / sessions | auth (JWT + refresh tokens in DB) | Same — stateless by design | None |
| Lifecycle / health | daemon + healthcheck_apis | Same — per-instance by design | None |
Hard rules:
- Never run
schedulergormmode ormemory_workqueuewith more than one replica —gormmode fires every job on every replica;memory_workqueueis invisible to other processes. - Never keep coordination state (locks, counters, dedup sets, sessions) in process memory — put it in the database, Redis, or NATS.
- Write idempotent handlers — scheduler and workqueue backends deliver at-least-once; a duplicate execution must be harmless.
- Already on PostgreSQL? Prefer the PostgreSQL-backed modes (
schedulermode = "postgres",postgres_workqueue) — multi-instance safety with no extra infrastructure.
Details: project-dev § Multi-Instance Deployment for config-driven switching, module-dev § Multi-Instance Safety for rules when writing custom modules.
Available Skills
| Skill | Description |
| project-dev | Create and structure weedbox applications |
| module-dev | Develop weedbox modules with Uber Fx dependency injection |
| crud-api-dev | Build complete CRUD APIs with business logic and HTTP handlers |
| common-modules | Use built-in modules (HTTP, database, NATS, Redis, etc.) |
| user-modules | User management, JWT authentication, and RBAC modules |
| workqueue-modules | Task queues: background jobs, delayed tasks, retries, dead-letter queues |
When to Use
- project-dev - Creating new weedbox application, setting up project structure, configuring main.go and modules.go
- module-dev - Developing custom weedbox modules/packages, dependency injection, lifecycle hooks, configuration management, creating module skills documentation
- crud-api-dev - Building REST APIs with CRUD operations, request binding patterns, QueryHelper for pagination/search/filtering
- common-modules - Integrating configs, logger, HTTP server, database (PostgreSQL/SQLite), NATS messaging, Redis cache, or mailer
- user-modules - Adding user management, JWT authentication (login/refresh/logout), role-based access control (RBAC), or permission-protected REST APIs
- workqueue-modules - Enqueueing and consuming background tasks, delaying/scheduling delivery, retrying with backoff, handling dead-lettered tasks, or choosing a queue backend (memory/GORM/PostgreSQL/NATS)
Module Skills
Each module can have its own .skills/ directory containing development documentation. This helps Claude Code understand module-specific details.
pkg/mymodule/.skills/mymodule-development.md # Business logic docs
pkg/mymodule_apis/.skills/mymodule-apis-development.md # API docsSee module-dev for creating module skills.
Editing Guidelines (for Claude)
When editing any files in this weedbox skills directory:
- Use English only - All documentation must be written in English
- Read before edit - Always read the full file content before making changes
- Follow existing style - Match the formatting and structure of existing content
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

