/encore-skills:encore-go-secretfrom encore-skills
Manages API keys, credentials, and other secrets in Encore Go using a package-level `secrets` struct. Covers declaration, access, setting values via `encore secret set`, and local overrides.
Ships in encore-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Secrets are encrypted, environment-scoped values managed by Encore. Declare them as a package-level secrets struct — Encore reads the field names and resolves each to the right value at runtime.
package email
var secrets struct {
SendGridAPIKey string
SMTPPassword string
}
func sendEmail() error {
apiKey := secrets.SendGridAPIKey
// Use the secret...
return nil
}
Secret keys are globally unique across the application — SendGridAPIKey resolves to the same value regardless of which package declares it.
# Set per environment type
encore secret set --type prod SendGridAPIKey
encore secret set --type dev SendGridAPIKey
encore secret set --type local SendGridAPIKey
Environment types: production (alias prod), development (alias dev), preview (alias pr), local.
For local development without going through encore secret set, create a .secrets.local.cue file at the repo root (gitignore it):
SendGridAPIKey: "SG.local-test-key"
GitHubAPIToken: "ghp_local_..."
package github
import (
"context"
"net/http"
)
var secrets struct {
GitHubAPIToken string
}
func callGitHub(ctx context.Context) error {
req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.github.com/user", nil)
req.Header.Set("Authorization", "token "+secrets.GitHubAPIToken)
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
return nil
}
package webhooks
var secrets struct {
StripeWebhookSecret string
}
// Verify Stripe signature using secrets.StripeWebhookSecret in a raw endpoint.
secrets struct, not as individual secret(...) calls.encore secret set.encore secret set --type <env>..secrets.local.cue for local overrides and gitignore it.encore-go-webhook skill.What SKILL.md sets; muted values are Claude Code's defaults
User wants to load a private credential into a Go service without committing it to the repo — third-party API keys (Stripe, OpenAI, Twilio, SendGrid), database passwords, signing keys, OAuth client secrets, JWT signing keys, webhook signing secrets. Covers the `var secrets struct{...}` declaration, accessing secrets as struct fields, setting values via `encore secret set`, and `.secrets.local.cue` overrides. Trigger phrases: "API key", "third-party token", "credentials", "without committing", "private key", "signing secret", "secret manager", "encore secret set".
npx claudepluginhub encoredev/skills --plugin encore-skills38 skills in this plugin
/encore-apiDefine typed API endpoints in Encore.ts using `api(...)` from `encore.dev/api`. Covers typed request/response interfaces, path/query/header/cookie params, request validation, and `APIError`. For raw endpoints (`api.raw()`) and inbound webhooks, use `encore-webhook` instead./encore-architectureDesign or revise the service architecture of an Encore.go or Encore.ts application. Covers service boundaries, data ownership, synchronous calls versus Pub/Sub, process allocation, public and private interfaces, and evolving a monolith./encore-authProtect Encore.ts endpoints with authentication and authorize callers. Covers `authHandler`, `Gateway`, `getAuthData`, and `auth: true`./encore-bucketStore unstructured files in Encore.ts using `Bucket` from `encore.dev/storage/objects` — uploads, images, documents, blobs./encore-cacheCache data in Redis from Encore.ts using `CacheCluster` and typed keyspaces from `encore.dev/storage/cache`. Type-safe key/value access with TTLs, atomic increments, and per-keyspace data shapes./encore-code-reviewReview existing Encore.ts code for best practices and common anti-patterns.Other plugins' skills for the same job