lutherwaves/spellcasting/casting-a-service-layer

Claude Code and agent skill by lutherwaves/spellcasting

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when adding domain logic (types + service interface + implementation) for a resource without HTTP — typically because the route is handled differently (worker, scheduled job, internal-only)

Install

npx vskill@latest install lutherwaves/spellcasting/casting-a-service-layer

SKILL.md

The same SKILL.md was published earlier as lutherwaves/spellcasting/casting-a-service-layer.

casting-a-service-layer

Emits the domain layer for a resource — types DTO + service interface + storage-backed implementation + table-driven test. No HTTP wiring.

Prerequisites

  • Existing magic service at cwd (cmd/server.go imports magic middlewares).
  • pkg/features/ exists; if not, create it: mkdir -p pkg/features pkg/types.

Inputs

InputTypeExample
RESOURCElowercase singulartodo

Derived: Resource, RESOURCES, Resources as in casting-a-feature.

Procedure

1. Copy templates
bash
cp "${CLAUDE_PLUGIN_ROOT}/templates/service-layer/pkg/types/RESOURCE.go" \
"pkg/types/${RESOURCE}.go"
mkdir -p "pkg/features/${RESOURCE}"
cp "${CLAUDE_PLUGIN_ROOT}/templates/service-layer/pkg/features/RESOURCE/service.go" \
"pkg/features/${RESOURCE}/service.go"
cp "${CLAUDE_PLUGIN_ROOT}/templates/service-layer/pkg/features/RESOURCE/service_test.go" \
"pkg/features/${RESOURCE}/service_test.go"
2. Substitute placeholders
bash
find "pkg/types/${RESOURCE}.go" "pkg/features/${RESOURCE}" -type f -name '*.go' \
-exec sed -i.bak \
-e "s/RESOURCETABLE/${RESOURCETABLE}/g" \
-e "s/Resources/${RESOURCES_CAP}/g" \
-e "s/RESOURCES/${RESOURCES}/g" \
-e "s/Resource/${RESOURCE_CAP}/g" \
-e "s/RESOURCE/${RESOURCE}/g" \
-e "s/SERVICENAME/${SERVICENAME}/g" {} \;
find pkg -name '*.go.bak' -delete

Note: order matters in the sed — replace the longest tokens first (RESOURCETABLE, Resources) before the shorter prefixes (Resource, RESOURCE).

3. Vet + test
bash
go vet ./pkg/types/... ./pkg/features/${RESOURCE}/...
go test ./pkg/features/${RESOURCE}/...
4. Commit
bash
git add pkg/types/${RESOURCE}.go pkg/features/${RESOURCE}/
git commit -m "feat: add ${RESOURCE} service layer"

Capability boundary

Service layer uses storage.StorageAdapter only (no project-specific storage helpers). Lucene filters pass through to storage.Search — the adapter parses and evaluates the raw Lucene string. Use mql.NewParser(input).Parse() only when you need in-process AST evaluation (validation, transformation, inspection). See magic-capabilities.

Doc references

  • storage.StorageAdapter: https://pkg.go.dev/github.com/tink3rlabs/magic@v0.17.3/storage#StorageAdapter
  • storage.StorageAdapter.Search (Lucene passthrough): https://pkg.go.dev/github.com/tink3rlabs/magic@v0.17.3/storage#StorageAdapter
  • mql.NewParser (in-process AST parsing only): https://pkg.go.dev/github.com/tink3rlabs/magic@v0.17.3/mql#NewParser

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/lutherwaves/spellcasting/casting-a-service-layer/badge)](https://verified-skill.com/skills/lutherwaves/spellcasting/casting-a-service-layer)

Something wrong with this skill or its page? Tell us.