agentleFS
SolaceProductsSolaceProducts/solace-broker-mcp/.claude/skills/check-logs/SKILL.md

check-logs

Skill18 starsChanged 4 months agoApache-2.0View on GitHub

Scan Go code for logging violations — credential leaks, missing LogValuer, raw structs, stdout usage, unsafe patterns

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. NVIDIA/kumo-engine★ 78same name
    2. Conzel/personal-claude-code-skills★ 2same name
    3. pilotmain/AethOS★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository6 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After adding logging to a file

    line 14
  2. Distinctive:

    When reviewing someone else's changes

    line 16
  3. Very specific:

    Read the secure logging rules at docs/_internal/secure-logging-rules.md in the project root.

    line 28
  4. Very specific:

    No args: scan all .go files under cmd/ and internal/

    line 33
  5. Distinctive:

    All clear: "No violations found.

    line 106
  6. Distinctive:

    If you're unsure whether something is a violation, flag it as MEDIUM with a note explaining the uncertainty

    line 114
  7. Very specific:

    Never modify code during a check — only report.

    line 115

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Check Logs

Scan Go code for logging security violations and compliance issues. Invoked with /check-logs.

When to use

  • Before committing code
  • After adding logging to a file
  • As a periodic audit of the codebase
  • When reviewing someone else's changes

Usage

  • /check-logs — scan the entire codebase
  • /check-logs <file_path> — scan a specific file
  • /check-logs staged — scan only git-staged files

Steps

Step 1: Read the rules

Read the secure logging rules at docs/_internal/secure-logging-rules.md in the project root. These are the rules you're checking against.

Step 2: Identify files to scan

Based on the invocation:

  • No args: scan all .go files under cmd/ and internal/
  • File path: scan that file
  • staged: run git diff --cached --name-only -- '*.go' and scan those files

Step 3: Run violation checks

For each file, check for the following violations in order of severity:

CRITICAL — Credential exposure

  • C-01: Credentials in log calls — Any log call that includes Password, Username, Token, Secret, or Authorization field values
  • C-02: Raw struct logging — slog.Any("key", someStruct) or log.Printf("%+v", someStruct) where the struct is or contains a credential-carrying type (BrokerConfig, AuthConfig, ServerConfig, HTTPClient)
  • C-03: Config map logging — Logging map[string]*BrokerConfig or the full ServerConfig.Brokers map
  • C-04: Raw Authorization header — Logging the value of an Authorization HTTP header
  • C-05: URL with credentials — Logging a URL that matches ://.*:.*@ pattern

HIGH — Missing protections

  • H-01: Missing LogValuer — Credential-carrying types (AuthConfig, BrokerConfig, and any struct with password/token/secret fields) that don't implement slog.LogValuer
  • H-02: Missing ReplaceAttr — slog handler created without ReplaceAttr safety net
  • H-03: Stdout logging — Any log output directed to os.Stdout instead of os.Stderr
  • H-04: Old log package — Usage of log.Printf, log.Println, log.Fatalf, log.Fatal instead of slog

MEDIUM — Unsafe patterns

  • M-01: fmt.Sprintf in message — slog.Info(fmt.Sprintf(...)) or similar — variable data should be in structured fields, not the message
  • M-02: Raw external errors — slog.String("error", err.Error()) where the error comes from SEMP, HTTP, or external systems that might include credentials in error messages
  • M-03: String concatenation in message — slog.Info("action: " + userInput) — use structured fields instead

LOW — Best practice

  • L-01: Missing required fields — Tool invocation logs without all required fields (tool, broker, outcome, duration)
  • L-02: Unstructured fmt.Print — Any fmt.Printf, fmt.Println used for logging purposes

Step 4: Report findings

Present findings grouped by severity with file path, line number, the offending code, and a fix suggestion.

Output format

Log Security Check Results
==========================

Files scanned: 14
Violations found: 3

CRITICAL:
- internal/config/config.go:94 — H-04: Uses log.Printf (old log package)
  Code: log.Printf("WARNING: env_prefix naming convention...")
  Fix: Replace with slog.Warn("env_prefix naming convention is provisional")

HIGH:
- internal/config/config.go — H-01: AuthConfig does not implement slog.LogValuer
  Fix: Add LogValue() method that exposes only Method field

MEDIUM:
- (none)

LOW:
- cmd/server/main.go:35 — L-01: Startup log missing auth_mode field
  Code: log.Printf("Loaded config with %d broker(s)", len(cfg.Brokers))
  Fix: slog.Info("config loaded", slog.Int("broker_count", len(cfg.Brokers)), slog.String("auth_mode", "basic"))

Clean:
- internal/composite/ — no violations
- internal/registry/ — no violations
- internal/semp/sempv2/ — no violations

Step 5: Summary

End with a one-line summary:

  • All clear: "No violations found. Logging is compliant."
  • Issues found: "Found N violations (X critical, Y high, Z medium). Fix critical and high before committing."

Rules

  • CRITICAL violations must be fixed before any commit — no exceptions
  • HIGH violations should be fixed before commit
  • MEDIUM and LOW are recommendations — flag them but don't block
  • If you're unsure whether something is a violation, flag it as MEDIUM with a note explaining the uncertainty
  • Never modify code during a check — only report. Use /add-logs to fix.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.