handle-errors-and-logging
Skill0 starsChanged 53 days agoApache-2.0View on GitHub
Designs error handling and logs that make failures visible and diagnosable. Use when writing code that can fail.
In this repository33 other files it gives its agents.
- algorithmsSkill
- break-down-workSkill
- ci-cdSkill
- clarify-requirementsSkill
- concurrencySkill
- containers-and-deploySkill
- data-analysisSkill
- data-durabilitySkill
- debugSkill
- dependenciesSkill
- design-apiSkill
- design-architectureSkill
- estimate-and-risksSkill
- explain-codeSkill
- git-workflowSkill
- implement-featureSkill
- incident-responseSkill
- ml-experimentSkill
- model-dataSkill
- observabilitySkill
- performanceSkill
- refactorSkill
- research-and-compareSkill
- review-codeSkill
- security-reviewSkill
- write-adrSkill
- write-cliSkill
- write-docsSkill
- write-goSkill
- write-pythonSkill
- write-sqlSkill
- write-testsSkill
- write-typescriptSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Ensure errors carry context.
- Very specific: line 9
Use log levels consistently.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Steps
- Fail loudly at the boundary. Never swallow errors.
- Ensure errors carry context. Include the operation name and the exact input.
- Use log levels consistently. Apply
INFO,WARNING,ERRORby severity. Output structured JSON logs. - Exclude secrets and personal data from logs. Mask tokens, keys, and emails with
[REDACTED]. - Limit retries to transient errors. Apply exponential backoff and a hard attempt limit.
- Configure logging once, at program start. Write logs to
stderr; for services, let the service manager (systemd, Docker) collect them.
Checklist
- Exceptions propagate to the top-level handler without silent catches
- Error messages include operation name and input values
- Log levels match severity; services log structured lines (JSON)
- Sensitive fields are masked or removed before logging
- Retry logic targets only transient errors with backoff and a max count
- All log statements pass through the configured logger instance
- No raw secrets or PII appear in any log output
Output
- Code with boundary exception handling and context-rich error messages
- Structured logging configuration and usage examples
- Retry wrapper with backoff and failure limits
- Checklist verification notes
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
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.

