Agent skill

Logging Best Practices

by nperez0111 in nperez0111/bookhive

Logging best practices focused on wide events (canonical log lines) for powerful debugging and analytics

MITAuto-check passedDevelopment

Install Logging Best Practices

skills CLI
$ npx skills add nperez0111/bookhive --skill logging-best-practices -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install nperez0111/bookhive logging-best-practices --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/nperez0111/bookhive.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/logging-best-practices .claude/skills/logging-best-practices && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
logging-best-practices
GitHub stars
164
Used in
2 other repos
Token cost
~1.2k tokens
SKILL.md length
445 words
Files
5
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Logging best practices focused on wide events (canonical log lines) for powerful debugging and analytics

  • Works in 7 steps: Wide Events (CRITICAL) → High Cardinality & Dimensionality… → Business Context (CRITICAL) → …
  • Development work in your project
  • SKILL.md covers Purpose, When to Apply, Core Principles and Anti-Patterns to Avoid, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Logging Best Practices is an agent skill from nperez0111/bookhive. Logging best practices focused on wide events (canonical log lines) for powerful debugging and analytics

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files (for example `rules/context.md`, `rules/pitfalls.md` and `rules/structure.md`).

It sits in Development. It works with Bluesky. The repository describes itself as: Track your books, share your shelves, see what others are reading. The licence is MIT.

When your agent uses it

  • Development work in your project

Example prompts

  • “/logging-best-practices”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Wide Events (CRITICAL)
  2. High Cardinality & Dimensionality (CRITICAL)
  3. Business Context (CRITICAL)
  4. Environment Characteristics (CRITICAL)
  5. Single Logger (HIGH)
  6. Middleware Pattern (HIGH)
  7. Structure & Consistency (HIGH)

What it can do on your machine

Read from SKILL.md and the folder at commit baa4d1b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • loggingsucks.com
    • boristane.com
    • stripe.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Logging Best Practices loads about 1.2k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 445 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~32
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from nperez0111/bookhive at commit baa4d1b, republished under its MIT licence (© nperez0111). 445 words, ~1,166 tokens.

Download SKILL.mdSave it as .claude/skills/logging-best-practices/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
logging-best-practices
description
Logging best practices focused on wide events (canonical log lines) for powerful debugging and analytics
license
MIT
metadata.author
boristane
metadata.version
1.0.0

Logging Best Practices Skill

Version: 1.0.0

Purpose

This skill provides guidelines for implementing effective logging in applications. It focuses on wide events (also called canonical log lines) - a pattern where you emit a single, context-rich event per request per service, enabling powerful debugging and analytics.

When to Apply

Apply these guidelines when:

  • Writing or reviewing logging code
  • Adding console.log, logger.info, or similar
  • Designing logging strategy for new services
  • Setting up logging infrastructure

Core Principles

1. Wide Events (CRITICAL)

Emit one context-rich event per request per service. Instead of scattering log lines throughout your handler, consolidate everything into a single structured event emitted at request completion.

typescript
const wideEvent: Record<string, unknown> = {
  method: "POST",
  path: "/checkout",
  requestId: c.get("requestId"),
  timestamp: new Date().toISOString(),
};

try {
  const user = await getUser(c.get("userId"));
  wideEvent.user = { id: user.id, subscription: user.subscription };

  const cart = await getCart(user.id);
  wideEvent.cart = { total_cents: cart.total, item_count: cart.items.length };

  wideEvent.status_code = 200;
  wideEvent.outcome = "success";
  return c.json({ success: true });
} catch (error) {
  wideEvent.status_code = 500;
  wideEvent.outcome = "error";
  wideEvent.error = { message: error.message, type: error.name };
  throw error;
} finally {
  wideEvent.duration_ms = Date.now() - startTime;
  logger.info(wideEvent);
}
2. High Cardinality & Dimensionality (CRITICAL)

Include fields with high cardinality (user IDs, request IDs - millions of unique values) and high dimensionality (many fields per event). This enables querying by specific users and answering questions you haven't anticipated yet.

3. Business Context (CRITICAL)

Always include business context: user subscription tier, cart value, feature flags, account age. The goal is to know "a premium customer couldn't complete a $2,499 purchase" not just "checkout failed."

4. Environment Characteristics (CRITICAL)

Include environment and deployment info in every event: commit hash, service version, region, instance ID. This enables correlating issues with deployments and identifying region-specific problems.

5. Single Logger (HIGH)

Use one logger instance configured at startup and import it everywhere. This ensures consistent formatting and automatic environment context.

6. Middleware Pattern (HIGH)

Use middleware to handle wide event infrastructure (timing, status, environment, emission). Handlers should only add business context.

7. Structure & Consistency (HIGH)
  • Use JSON format consistently
  • Maintain consistent field names across services
  • Simplify to two log levels: info and error
  • Never log unstructured strings
Show full SKILL.md (169 more words)Show less

Anti-Patterns to Avoid

  1. Scattered logs: Multiple console.log() calls per request
  2. Multiple loggers: Different logger instances in different files
  3. Missing environment context: No commit hash or deployment info
  4. Missing business context: Logging technical details without user/business data
  5. Unstructured strings: console.log('something happened') instead of structured data
  6. Inconsistent schemas: Different field names across services

Guidelines

Wide Events (rules/wide-events.md)
  • Emit one wide event per service hop
  • Include all relevant context
  • Connect events with request ID
  • Emit at request completion in finally block
Context (rules/context.md)
  • Support high cardinality fields (user_id, request_id)
  • Include high dimensionality (many fields)
  • Always include business context
  • Always include environment characteristics (commit_hash, version, region)
Structure (rules/structure.md)
  • Use a single logger throughout the codebase
  • Use middleware for consistent wide events
  • Use JSON format
  • Maintain consistent schema
  • Simplify to info and error levels
  • Never log unstructured strings
Common Pitfalls (rules/pitfalls.md)
  • Avoid multiple log lines per request
  • Design for unknown unknowns
  • Always propagate request IDs across services

References:

© nperez0111, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files in .agents/skills/logging-best-practices of nperez0111/bookhive.

  • SKILL.md
  • rules/context.md
  • rules/pitfalls.md
  • rules/structure.md
  • rules/wide-events.md

Open the folder on GitHubat commit baa4d1b

Used in 2 other repositories

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in nperez0111/bookhive, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Logging Best Practices next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Logging Best Practices compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Logging Best Practices this skillnperez0111/bookhive1642 repos~1.2kAutomated safety check: PassMIT
Postdanium/lateral-thinking321—~1.7kAutomated safety check: PassMIT
Scrapecreators APIScrapeCreators/social-media-research-skills3.4k—~4kAutomated safety check: NotesMIT
Downstream Syncmrchantey/beet135—~1.1kAutomated safety check: PassApache-2.0
Social CLIletta-ai/skills149—~1.6kAutomated safety check: NotesMIT
Simplified SocialLeoYeAI/openclaw-master-skills2.2k—~4.8kAutomated safety check: PassMIT

Similar skills

  • Post

    danium/lateral-thinking

    A skill your agent uses when writing a social post on a topic or a reply to someone's post — X/Twitter, LinkedIn, Bluesky, Threads — and the obvious take is not good enough.

    321 GitHub stars~1.7k tokensUpdated 27 days ago
    DevelopmentAuto-check passed
  • Scrapecreators API

    ScrapeCreators/social-media-research-skills

    Scrape and extract public data from 27+ social media platforms using the ScrapeCreators REST API.

    3.4k GitHub stars~4k tokensUpdated 1 mo ago
    Backend & APIsAuto-check: notes
  • Downstream Sync

    mrchantey/beet

    Refresh every downstream repo (beetatproto, beetconnect, beetegress, beetesp, beeteval) with beet's AGENTS.md marker block, its MIT/Apache licenses and shared config files.

    135 GitHub stars~1.1k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Social CLI

    letta-ai/skills

    Agent-optimized CLI for Bluesky (ATProto) and X (Twitter). An agent skill from letta-ai/skills.

    149 GitHub stars~1.6k tokensUpdated 8 days ago
    Agent WorkflowsAuto-check: notes
  • Simplified Social

    LeoYeAI/openclaw-master-skills

    Manage your entire social media from AI — post, schedule, and analyze across Facebook, Instagram, TikTok, YouTube, LinkedIn, Pinterest, Threads, Bluesky and Google Business

    2.2k GitHub stars~4.8k tokensUpdated 2 mo ago
    Agent WorkflowsAuto-check passed
  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 58 repos~726 tokens
    DevelopmentAuto-check passed

Works with

Categories

Questions about Logging Best Practices

What does Logging Best Practices do?

Logging best practices focused on wide events (canonical log lines) for powerful debugging and analytics. Logging Best Practices is an agent skill from nperez0111/bookhive.

When should I use Logging Best Practices?

Logging Best Practices fits situations like: development work in your project.

How do I install Logging Best Practices in Claude Code?

Run `npx skills add nperez0111/bookhive --skill logging-best-practices -a claude-code`. Or copy the skill folder (.agents/skills/logging-best-practices in nperez0111/bookhive) into .claude/skills/logging-best-practices in your project. Claude Code loads it when a task matches its description.

How do I install Logging Best Practices in Codex?

Run `npx skills add nperez0111/bookhive --skill logging-best-practices -a codex`. Or copy the skill folder (.agents/skills/logging-best-practices in nperez0111/bookhive) into .agents/skills/logging-best-practices in your project. Codex loads it when a task matches its description.

Can I use Logging Best Practices in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nperez0111/bookhive --skill logging-best-practices -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/logging-best-practices, .gemini/skills/logging-best-practices, .github/skills/logging-best-practices and .opencode/skills/logging-best-practices in your project.

What does Logging Best Practices need to run?

SKILL.md names no scripts, command-line tools or credentials: Logging Best Practices is instructions for the agent only.

Does Logging Best Practices access the network?

SKILL.md names 3 domains. As links in the text: loggingsucks.com, boristane.com and stripe.com. This is read from the text; nothing was executed.

Is Logging Best Practices safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Logging Best Practices use?

Logging Best Practices is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Logging Best Practices use?

About 1.2k tokens (SKILL.md is roughly 4.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Logging Best Practices?

Skills that share tags, products or a category with Logging Best Practices: Post (danium/lateral-thinking, 321 stars), Scrapecreators API (ScrapeCreators/social-media-research-skills, 3.4k stars), Downstream Sync (mrchantey/beet, 135 stars) and Social CLI (letta-ai/skills, 149 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Logging Best Practices?

nperez0111 (a GitHub user) maintains it in nperez0111/bookhive, which has 164 GitHub stars. The repository was last updated on October 5, 2026.

Source: nperez0111/bookhive on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.