analyzing-options
Analyzing different approaches for a task or problem with structured comparisons, effort…
Mapping a Go service's Service -> Module -> Resource hierarchy for dispatch-layer registration: detects modules and per-module PostgreSQL/MongoDB/RabbitMQ resources, database names, and shared databases, generates MongoDB index migration pairs (.up.json/.down.json), detects
$ npx -y skills add LerianStudio/ring --skill mapping-service-resources --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/mapping-service-resourcesContext preview
The summary Claude sees to decide when to auto-load this skill.
Mapping a Go service's Service -> Module -> Resource hierarchy for dispatch-layer registration: detects modules and per-module PostgreSQL/MongoDB/RabbitMQ resources, database names, and shared databases, generates MongoDB index migration pairs (.up.json/.down.json), detects
name: ring:mapping-service-resources description: "Mapping a Go service's Service -> Module -> Resource hierarchy for dispatch-layer registration: detects modules and per-module PostgreSQL/MongoDB/RabbitMQ resources, database names, and shared databases, generates MongoDB index migration pairs (.up.json/.down.json), detects existing Postgres migrations, emits an HTML report, and offers opt-in S3 upload. Use before ring:adding-multi-tenancy on a new service. Skip for non-Go projects."
**Complementary:** ring:adding-multi-tenancy, ring:implementing-tasks
Scans Go project to produce dispatch layer registration data. Orchestrator executes all detection phases directly.
# Service name grep "ApplicationName\|ServiceName" internal/bootstrap/config.go 2>/dev/null | head -5 cat .env.example 2>/dev/null | grep -i "APPLICATION_NAME\|SERVICE_NAME" | head -3 # Service type test -f go.mod && cat go.mod | head -3 # module path hints service purpose ls internal/adapters/ 2>/dev/null # adapters reveal type # Unified service check ls components/ 2>/dev/null # multiple components = unified service
Output:
service_name: "my-service"
is_unified: true | false
components: [{name, path, applicationName}] # if unified# Strategy A: Explicit WithModule calls (preferred)
grep -rn "WithModule(" internal/ components/ 2>/dev/null
# Extract string arg: WithModule("onboarding") → module "onboarding"
# Strategy B: Component-based (if no WithModule found)
ls components/ # each component = one module
# module_name = component's ApplicationName
# Strategy C: Single-component fallback
# module_name = service ApplicationNameMerge: Strategy A → B fills gaps → C fallback.
For each module, scan `{component_path}/internal/adapters/`:
# PostgreSQL: subdirectory existence
ls {base_path}postgres/ 2>/dev/null
# MongoDB
ls {base_path}mongodb/ 2>/dev/null || ls {base_path}mongo/ 2>/dev/null
# RabbitMQ
ls {base_path}rabbitmq/ 2>/dev/null
grep -l "producer\|Producer" {base_path}rabbitmq/ 2>/dev/null
grep -l "consumer\|Consumer" {base_path}rabbitmq/ 2>/dev/null
# Redis (informational only — NOT a dispatch layer resource)
ls {base_path}redis/ 2>/dev/null# From bootstrap config
grep -E 'env:"POSTGRES_NAME|env:"DB_.*_NAME|env:"MONGO_NAME|env:"MONGO_.*_NAME' \
{component_path}/internal/bootstrap/config.go
# From .env.example (actual values)
grep -E "POSTGRES_NAME=|DB_.*_NAME=|MONGO_NAME=|MONGO_.*_NAME=" {component_path}/.env.example
# External datasources
grep -E "DATASOURCE_.*_DATABASE=" {component_path}/.env.exampleCross-reference across modules: same database name in 2+ modules = shared (provision once).
**Only execute if MongoDB was detected in any module during Phase 3.**
Execute the procedure in `references/mongodb-index-detection.md` — Steps 1, 2, 3, 4 only. (Detection and local generation only; S3 upload is handled in Phase 6.)
1. **Step 1** — Detect in-code index definitions (`EnsureIndexes`, `IndexModel`, `CreateIndex`) per module. 2. **Step 2** — Detect existing local migration files in `{component_path}/scripts/mongodb/*.up.json` + `*.down.json` (fallback legacy `*.js`). LOCAL ONLY — no S3 lookup. 3. **Step 3** — Cross-reference code vs. local migration files, classify each as `covered` / `missing_migration` / `migration_only`. 4. **Step 4** — Generate one `.up.json` + `.down.json` file pair per missing index (atomic per index, NOT grouped by collection):
**Format reminder:** the dispatch layer reads `.up.json` / `.down.json` from S3 and applies indexes on tenant provisioning. The service does NOT execute these files. Legacy `.js` scripts are NOT uploaded — only JSON migrations.
**Only execute if PostgreSQL was detected in any module during Phase 3.**
Detection only — Postgres migrations are written by developers; this skill does NOT generate `.sql` files.
# Common golang-migrate locations (per module path resolved in Phase 3)
ls {component_path}/scripts/postgres/*.up.sql 2>/dev/null
ls {component_path}/scripts/postgresql/*.up.sql 2>/dev/null
ls {component_path}/db/migrations/*.up.sql 2>/dev/null
ls {component_path}/migrations/*.up.sql 2>/dev/nullFor each `.up.sql` file found:
Store: `module.postgres_migrations = [{up_file, down_file, sequence, description}]`
If a `.up.sql` exists without `.down.sql` → flag in Phase 5 HTML report (golang-migrate requires pairs).
Dispatch `ring:visualizing
Proven engineering practices, enforced through skills. Ring is a comprehensive skills library and workflow system for AI agents that transforms how AI assistants approach software development.
Repo: LerianStudio/ring
Analyzing different approaches for a task or problem with structured comparisons, effort…
Auditing a service's production readiness against Ring engineering standards across base…
Cleaning redundant and obvious comments following clean code principles while preserving…
Commit changes with scope allowlist enforcement, atomic grouping, GPG-signed conventional…
Creating a handoff document that captures session state (completed work, decisions, open…
Creating an isolated git worktree for parallel branch work: selects the directory by priority…