sharp-edges

Solid

Identify dangerous API footguns, surprising default behaviors, and sharp edges in codebases and dependencies. Adapted from Trail of Bits. Use during code review to catch APIs that are easy to misuse, configurations that surprise, and abstractions that leak.

AI & Automation 501 stars 42 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
90
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Sharp Edges Detection Sharp edges are APIs, configurations, and patterns that are easy to use incorrectly. They work in the happy path but break in subtle, dangerous ways. ## Three Adversary Types When evaluating sharp edges, consider three types of users: ### 1. The Naive Developer - Uses the API without reading docs carefully - Copies examples from Stack Overflow - Assumes defaults are safe - **Question**: "Will this API hurt someone who doesn't know its quirks?" ### 2. The Malicious User - Intentionally sends unexpected input - Exploits race conditions and edge cases - Chains small issues into big exploits - **Question**: "Can someone deliberately trigger the bad behavior?" ### 3. The Future Maintainer - Modifies code without full context - Refactors without understanding invariants - Doesn't know why something was done a certain way - **Question**: "Will a reasonable change to this code introduce a bug?" ## Sharp Edge Categories ### 1. Surprising Default Behavior APIs whose defaults do something unexpected: ```typescript // SHARP: parseInt without radix parseInt("08") // 0 in old engines (octal), 8 in modern parseInt("08", 10) // Always 8 // SHARP: Array.sort() without comparator [10, 2, 1].sort() // [1, 10, 2] -- sorts as strings! [10, 2, 1].sort((a, b) => a - b) // [1, 2, 10] // SHARP: JSON.parse reviver runs bottom-up JSON.parse('{"a": {"b": 1}}', (key, val) => { // 'b' fires before 'a' -- counterintuitive }) // SHARP: fetch() doesn't reject on H...

Details

Author
vibeeval
Repository
vibeeval/vibecosystem
Created
3 months ago
Last Updated
2 days ago
Language
C#
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category