Agent skill
winston-logging-on-change
Add, repair, and standardize concise Winston logging in changed NestJS backend code that already uses a shared LoggerService. Use when modifying controllers/services/guards/interceptors/strategies/handlers, improving observability quality, or enforcing safe logging that excludes secrets, tokens, and raw sensitive payloads.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/nestjs-winston-logging
SKILL.md
Winston Logging On Change
Apply high-signal, low-noise Winston logs when changing NestJS application logic in projects that already have Winston wiring.
Workflow
-
Preflight project logger availability.
- Confirm the project already uses a shared
LoggerService(or equivalent injected logger wrapper). - If logger wiring is missing and the user did not ask for installation, stop and report that this skill only augments existing logging.
- Confirm the project already uses a shared
-
Locate code touched by the requested change.
- Focus on changed NestJS runtime units: controllers, services, guards, interceptors, strategies, handlers, and background processors.
- Do not add logs in unrelated files.
-
Identify meaningful log points introduced or affected by the change.
- Add logs around operation outcomes, important branch decisions, external dependency calls, retries, and failures.
- Skip trivial method entry/exit logs and passthrough helper noise.
-
Insert logs with consistent context and level selection.
- Keep one stable class context per class (for example
AuthService). - Use levels intentionally:
log/infofor successful outcomes,warnfor degraded but handled states,errorfor failures,debug/verboseonly for targeted diagnostics.
- Keep one stable class context per class (for example
-
Enforce sensitive-data safety before finalizing.
- Never log passwords, hashes, secrets, API keys, JWTs, refresh tokens, cookies, raw request/response bodies, or raw PII.
- Prefer bounded metadata such as IDs, counts, booleans, operation names, and status codes.
-
Validate final diff quality.
- Remove duplicate/noisy logs.
- Ensure each added log helps triage or audit behavior.
- Confirm no unsafe fields were introduced.
Logger Usage Contract
Use project conventions for injection and method signatures. Expected common shape:
log(message, context?, meta?)orinfo(message, context?, meta?)warn(message, context?, meta?)error(message, trace?, context?, meta?)debug(message, context?, meta?)orverbose(message, context?, meta?)
When logging errors, include a trace/stack string only when it materially improves diagnosis.
Output Expectations
When applying this skill during a task:
- Report which files received logging changes.
- Summarize why each added log is high-signal.
- Explicitly confirm sensitive fields were excluded.
- Note any intentional omissions (for example, skipped noisy entry/exit logs).
Deterministic Guardrails
- Do not introduce a new logging framework in this skill.
- Do not refactor unrelated business logic while adding logs.
- Keep edits minimal and localized to changed behavior paths.
- If logger APIs differ from expected signatures, adapt to project conventions without forcing a rewrite.
Edit Checklist
- Confirm shared logger exists before edits
- Inject/use logger according to project convention
- Add only high-signal logs tied to changed behavior
- Include actionable failure logs where relevant
- Exclude secrets/tokens/raw sensitive payloads
- Verify final diff for noise and duplication
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?