Consult this skill when implementing usage logging and audit trails. Use when implementing audit trails, tracking costs, collecting usage analytics, managing session logging. Do not use when simple operations without logging needs.
Implements structured audit trails and usage analytics for tracking operations and costs.
/plugin marketplace add athola/claude-night-market/plugin install leyline@claude-night-marketThis skill inherits all available tools. When active, it can use any tool Claude has access to.
modules/log-formats.mdmodules/session-patterns.mdSession-aware logging infrastructure for tracking operations across plugins. Provides structured JSONL logging with automatic session management for audit trails and analytics.
Sessions group related operations:
{
"timestamp": "2025-12-05T10:30:00Z",
"session_id": "session_1733394600",
"service": "my-service",
"operation": "analyze_files",
"tokens": 5000,
"success": true,
"duration_seconds": 2.5,
"metadata": {}
}
Verification: Run the command with --help flag to verify availability.
from leyline.usage_logger import UsageLogger
logger = UsageLogger(service="my-service")
Verification: Run the command with --help flag to verify availability.
logger.log_usage(
operation="analyze_files",
tokens=5000,
success=True,
duration=2.5,
metadata={"files": 10}
)
Verification: Run the command with --help flag to verify availability.
# Recent operations
recent = logger.get_recent_operations(hours=24)
# Usage summary
summary = logger.get_usage_summary(days=7)
print(f"Total tokens: {summary['total_tokens']}")
print(f"Total cost: ${summary['estimated_cost']:.2f}")
# Recent errors
errors = logger.get_recent_errors(count=10)
Verification: Run the command with --help flag to verify availability.
# In your skill's frontmatter
dependencies: [leyline:usage-logging]
Verification: Run the command with --help flag to verify availability.
Standard integration flow:
Default location: ~/.claude/leyline/usage/{service}.jsonl
# View recent logs
tail -20 ~/.claude/leyline/usage/my-service.jsonl | jq .
# Query by date
grep "2025-12-05" ~/.claude/leyline/usage/my-service.jsonl
Verification: Run the command with --help flag to verify availability.
modules/session-patterns.md for session managementmodules/log-formats.md for structured formatsCommand not found Ensure all dependencies are installed and in PATH
Permission errors Check file permissions and run with appropriate privileges
Unexpected behavior
Enable verbose logging with --verbose flag
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.