Skip to content

Instantly share code, notes, and snippets.

@jjenzz
jjenzz / SKILL.md
Last active October 9, 2026 22:43
Root cause solution skill
name root-cause-solution
description Use when implementing features or fixing bugs to define the intended behavior from first principles, trace where the current code diverges from it, generate and score several candidate solutions, and propose the most correct one.

Root-cause solution

Treat any proposed solution as one candidate, whether it comes from an issue, a review, the user or your own first idea. Being proposed proves nothing about whether it is right. Preserve the user's intended outcome and any explicit constraints.

Never propose the first solution you think of. First ideas tend to accept the existing structure and adjust it locally. Work through the steps below before you choose.

@jjenzz
jjenzz / comp-design-rules.md
Last active May 23, 2025 15:36
comp-design-rules.md

React Component Design

Compound Component Pattern

  • Build custom components using the compound component pattern (like Radix UI).
  • APIs should be declarative, composable, and expose clearly named parts.
  • Favor composition via children over bundling multiple elements into one.

Semantic Markup

  • Use semantic HTML elements (table, tr, dl, ul, li, etc.) for structure.
  • Do not use divs where a semantic element is appropriate (e.g., don’t use div for tables or lists).
@jjenzz
jjenzz / machine.js
Created October 4, 2019 08:30
Generated by XState Viz: https://xstate.js.org/viz
const dismissMachine = Machine(
{
id: 'dismissMachine',
initial: 'load',
context: {
resolutions: [],
selectedRisksCount: 1,
resolutionId: undefined,
reason: undefined,
},
@jjenzz
jjenzz / machine.js
Last active September 29, 2019 16:19
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@jjenzz
jjenzz / schema.js
Last active June 23, 2018 10:33
I can't seem to figure out where I'm going wrong here. Querying `stats` returns `null` and the resolvers aren't called. Whyyyy? 🙈https://launchpad.graphql.com/w5q78w4zrz
const typeDefs = `
schema {
query: Query
}
type Query {
stats: Stats
}
type Stats {