Generic Constructor-Pattern agent kit for Claude Code. Zero personal data, fully English, MIT-licensed. Contents: - 34 reusable blocks (baseline, rules, stack/deploy/domain/api/scraper) - 14 cross-project agent manifests (code/ml/infra/researcher/critic/...) - 6 portable skills (/new-agent, /research, /test-gen, /debug-deep, /pr-review, /refactor) - Rust assembler (single binary, ~500 KB) - 3 hooks (auto-reassemble, pre-commit validate, no-hand-edit) - install.sh (idempotent, cargo-builds on first run) - MIT LICENSE All 6 sanity greps pass: 0 Russian text, 0 specific project names, 0 incident numbers, 0 user paths, 0 hardcoded IPs, 0 API keys. cargo check + assemble --validate: both pass on 14 manifests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.3 KiB
1.3 KiB
STACK — Rust HTTP server (axum + tokio + sqlx)
Default web stack — no language justification needed.
Versions: axum 0.7+, tokio 1.x (rt-multi-thread), sqlx 0.7+ (NOT diesel — async-first), tower 0.4+ for middleware.
App shape:
AppStatestruct →Arc<AppState>→Router::with_state(state). No globals.- Handlers take
State<Arc<AppState>>, extractors typed, returnResult<impl IntoResponse, AppError>. AppError= singlethiserrorenum withIntoResponseimpl → maps to HTTP status + JSON body.#[tokio::main]ONLY in the binary crate. Library crates never pin a runtime.
Middleware stack (order matters):
TraceLayer(tower-http) — request id + spanCorsLayer— explicit allow-list, neverAnyin prodTimeoutLayer— hard cap per routeCompressionLayer- Auth middleware (custom) — short-circuits on 401
Crypto: Ed25519 for signing (ed25519-dalek); never roll your own. Secrets from env at startup, never in code.
sqlx: queries use sqlx::query! / query_as! macros (compile-time checked against live DB). Migrations under migrations/ managed by sqlx-cli. NEVER string-concat SQL.
Forbidden: unwrap() in handler paths, sqlx::query() with runtime strings, blocking calls (std::fs::read) without spawn_blocking, #[tokio::main] in lib crates (caller chooses runtime).