scaffold-utils
Add or wire pure helpers/utils, preferring ArchiPy utils (datetime, JWT, password, file, string). Use for "add a helper/util function", "format dates", "hash passwords", or "generate tokens".
- License 许可
- MIT
- 最近更新
- 2026-11-07
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- scaffold-utils
- description
- Add or wire pure helpers/utils, preferring ArchiPy utils (datetime, JWT, password, file, string). Use for "add a helper/util function", "format dates", "hash passwords", or "generate tokens".
03 SKILL.md 正文
Scaffold ArchiPy Utils
Scope
Only helpers/utils/. Do not create decorators or interceptors here.
Read first
Read these plugin rules in full before generating files (paths relative to this skill directory; Claude Code: ${CLAUDE_SKILL_DIR}/../../rules/):
../../rules/using-archipy-utils.mdc
Before writing files
- Inspect existing helpers and installed ArchiPy version for a matching utility.
- Infer project naming and function/class style.
- Ask only for an unresolved purpose or behavior. Prefer an ArchiPy utility whenever it fits.
- Preserve existing helper modules; do not overwrite.
Prefer ArchiPy
If an ArchiPy util fits, show import + usage example and stop — do not duplicate. See ../archipy-docs/reference/helpers.md
(Utils section), resolved relative to this SKILL.md's directory in the plugin installation — not the app workspace.
Custom util
Create helpers/utils/<name>_utils.py:
from __future__ import annotations
class SlugUtils:
"""Pure string helpers for URL-safe slugs — no I/O."""
@staticmethod
def slugify(value: str) -> str:
"""Return a lowercase hyphenated slug.
Args:
value: Raw display string.
Returns:
Slug suitable for path segments.
"""
cleaned = "".join(ch.lower() if ch.isalnum() else "-" for ch in value.strip())
while "--" in cleaned:
cleaned = cleaned.replace("--", "-")
return cleaned.strip("-")
- Pure functions/classes — no I/O, no DB, no adapters
- Google-style docstrings + full type hints
- Lazy-import optional deps inside functions when needed
- Brief usage snippet in the reply
Do not
- No adapter construction at module level; lazy-import optional deps inside functions when needed.
Verify
Run the repository's formatter, linter, and focused unit tests. Report the reused ArchiPy API or files created, plus commands run.
Docs
- https://syntaxarc.github.io/ArchiPy/tutorials/helpers/
- https://syntaxarc.github.io/ArchiPy/api_reference/
- Bundled skill reference:
../archipy-docs/reference/helpers.md(Utils section)
04 同仓库更多 Skills
scaffold-service
Scaffold a thin FastAPI router or gRPC servicer under services/{domain}/v{n}/ with AppUtils bootstrap. Use for "add an endpoint/route/API", "expose via REST/gRPC", or "new API version".
scaffold-observability
Configure ArchiPy 5.x OpenTelemetry traces, metrics, logs, and instrumentation. Use for "add tracing/metrics/OTel", "Prometheus/Pushgateway", or migrating off Sentry, Elastic APM, or old Prometheus.
scaffold-models
Scaffold ArchiPy models under models/: domain/repository DTOs, errors, optional entities and types. Use for "add DTO/schema/request/response model", "new error type", or "SQLAlchemy entity".
scaffold-logic
Scaffold an ArchiPy logic (use case) under logics/{domain}/ with a unit-of-work decorator and DTO I/O. Use for "add business logic", "new use case", "transactional operation", or "service layer method".
scaffold-interceptor
Add or wire cross-cutting FastAPI/gRPC interceptors or middleware, preferring ArchiPy's. Use for "add middleware", "request ID/logging/auth interceptor", or "gRPC interceptor".
scaffold-health-checks
Scaffold FastAPI/gRPC liveness, readiness, and startup health checks, graceful shutdown, and optional Kubernetes probes. Use for "health endpoint", "readiness/liveness probe", or "k8s probes".