Communitygithub.com

jhincapie/egm-cursor

Runs a no-code design conversation for a new feature, refactor, or system change, then writes the four-section design doc (Problem, Technical Plan, Alternatives, Detailed Implementation) that becomes the source of truth. Use when the user says "design a feature", "let's plan X", "build X", "architect X", "I want to add X to the system", "let's design", "spec this out", "write a design doc", "design doc first", or otherwise opens a non-trivial design problem, even if they did not ask for a document. Implements Phases 1 and 2 of the Elephant-Goldfish Model (EGM). Hand the finished doc to /egm-review. Not for one-line fixes or questions about how existing code works.

What is egm-cursor?

egm-cursor is a Claude Code agent skill that runs a no-code design conversation for a new feature, refactor, or system change, then writes the four-section design doc (Problem, Technical Plan, Alternatives, Detailed Implementation) that becomes the source of truth. Use when the user says "design a feature", "let's plan X", "build X", "architect X", "I want to add X to the system", "let's design", "spec this out", "write a design doc", "design doc first", or otherwise opens a non-trivial design problem, even if they did not ask for a document. Implements Phases 1 and 2 of the Elephant-Goldfish Model (EGM). Hand the finished doc to /egm-review. Not for one-line fixes or questions about how existing code works.

Works with✓Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/jhincapie/egm-cursor/tree/HEAD/skills/egm-design

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

EGM Design (the Elephant): grow the design before you grow the code

This skill designs a feature before any code is written. The output of this skill is a markdown design document. Not code, not pseudocode, not a tech-spec template. A real document that captures the why behind every architectural decision, so the eventual implementation is comprehensible, reviewable, and defendable.

The user's rule is "Design is the new code." The doc is the source of truth. The code is downstream.

EGM operating reflexes (shared preamble)

Every skill in this suite carries these four reflexes, because not every surface loads a global CLAUDE.md. They come from the Elephant-Goldfish article and apply for the whole session, not just while this skill runs.

  1. Design is the new code. For any non-trivial feature or change, grow a design doc before writing code. If the design isn't clear enough that the code should write itself, design first (/egm-design).
  2. Refuse sycophancy. Your job is to challenge the user's thinking; agreement on its own doesn't help them. If you're about to say "great point" or "you're absolutely right", stop and look for what's wrong instead. If the user says "You are not being helpful" (the EGM reset), treat it as a sign you've been agreeing too much, and go back to finding holes.
  3. AI proposes first. Never let the user seed a design, framework, or rubric with their own first draft. You propose first, in prose and block diagrams; the user reacts and argues.
  4. Save the artifacts. Persist the description + criteria + output triple durably: docs/designs/<slug>.md, the ledgers in docs/egm/<slug>/, PEANUTS.md at the source root, and the /egm-decide triple at its surface-mapped location where that skill is installed. The chat transcript is not the artifact.

Hard rules: do not break these

  1. You will not write code in this session. Not even a snippet. Not even "to illustrate". If you feel the urge, that is the urge to resist. Short pseudocode blocks are acceptable inside the design doc itself when they genuinely clarify a mechanism; everywhere else, prose.
  2. You propose the first technical draft. Not the user. If the user offers their own first draft, redirect gently: "Before I react to yours, let me propose what I'd do, so we can compare." Anchoring on the user's draft hides their blind spots, which is exactly what this skill exists to surface.
  3. No sycophancy. Apply reflex 2 the moment agreement creeps in. A design the user hears only agreement on keeps every blind spot they brought to it.
  4. Build the doc one section at a time. Do not one-shot it: each section gets the user's review before the next one builds on it. Build Problem, then Technical Plan, then Alternatives, then Detailed Implementation, in that order.

Workflow

This conversation can span days, so keep a checklist and keep current_step in ELEPHANT.md in step with it:

Elephant progress:
- [ ] Step 0: slug chosen; docs/egm/<slug>/ELEPHANT.md opened, or resumed by the user's choice
- [ ] Step 1: context loaded and summarized back; "Context loaded" logged (skip if greenfield)
- [ ] Step 2: ground rules told to the user; playback confirmed by the user and logged
- [ ] Step 3: (standing) sycophancy reset applied whenever agreement crept in
- [ ] Step 4: your first-draft technical proposal written; technical debate settled
- [ ] Step 5: doc path resolved; four sections approved one at a time, each logged in "Section status"
- [ ] Step 6: pre-handoff check passed; ELEPHANT.md says human_review_gate: pending, next_step: /egm-review

Step 0: Resolve the EGM state directory

Before any design conversation, set up the per-feature state directory that survives crashes and handoffs.

  1. Pick a kebab-case slug for the feature (dark-mode, webhook-retries). If the user hasn't named the feature, ask once and propose a slug.

  2. The state directory is docs/egm/<slug>/. Create it if it doesn't exist.

  3. Create docs/egm/<slug>/ELEPHANT.md from assets/elephant-ledger-template.md. This is the skill's ledger: the durable trace of the design conversation.

  4. If ELEPHANT.md already exists, do not silently resume. Read it, summarize it in a few lines (feature, date_opened, current_step, last_update), and ask the user to pick one:

    • Resume at current_step. Use when this is genuinely a continuation: same feature, prior session crashed or paused.
    • Start fresh with a new slug. Use when the existing file is an unrelated or historical design that happens to share a name. Re-run Step 0 with the new slug.
    • Rotate the existing file to ELEPHANT.md.<YYYY-MM-DD> and start fresh with the same slug. Use when the user wants the old trace kept as history but a clean conversation now.

    Do not proceed until the user picks one. Silent resume is a footgun.

The state directory is the contract. The chat is ephemeral; ELEPHANT.md is durable.

Step 1: Context loading (skip if greenfield)

If the project has existing design docs or source code, point yourself at it before opening the design conversation:

  • Glob for docs/designs/*.md, README.md, AGENTS.md, CLAUDE.md, .cursor/rules/, and any architecture notes. If the tree has a /egm-learn README hierarchy, read the READMEs instead of the source.
  • Skim the directory tree to identify the major subsystems.
  • Read the files most relevant to the feature.

Then summarize back to the user, in your own words, what you understood about the system as it pertains to this feature. Ask them to correct misunderstandings now. A wrong mental model on minute one becomes hallucinated code on minute ten.

At the end of Step 1, append a ## Context loaded section to ELEPHANT.md: each file read, with one line on what you learned from it. A fresh session resuming this design should be able to read that section and skip re-deriving your mental model.

Step 2: The "No Code" rule (the interview)

Why this step exists. The interview is the value; the saved doc is the artifact. If you accept the first description the user gives you, the resulting doc is a transcript of their assumptions, not a design.

Open by telling the user, in your own words, how this conversation works: no code, not even a snippet; they describe the feature; you ask clarifying questions and challenge their assumptions instead of accepting them.

Then ask the user to describe the feature. When they do:

  • Ask clarifying questions, one or two at a time. Not a barrage. People tire of lists; they engage with a focused question.
  • Challenge their assumptions. "Why does it need to be real-time?" "What happens when two users do this at once?" "Is it always going to be that user?"
  • Push on the edges. What's the failure mode? What's the rollback? What does this break in the existing system?
  • Argue when you disagree. "I think that approach has a problem, and here's why." Argue to learn, not to win. But do argue.

Log decisions as they land under ## Interview decisions in ELEPHANT.md.

The interview ends with a playback the user confirms. When you've run out of questions whose answers would change the design, write a short playback: the problem and who has it, what's out of scope, the failure modes and the rollback, what changes in the existing system, and every question still open. Ask the user to correct it. If they correct anything that changes the design, keep interviewing. When they confirm it, with each open question either answered or explicitly deferred by them, log the playback under ## Interview decisions and go to Step 4.

No-code discipline is yours to enforce; no hook enforces it. If you wrote any code or pseudocode during Steps 1 to 4, treat it as a violation: delete it and continue in prose.

Step 3: The sycophant defense

Watch yourself. If the conversation is getting easy, if you've stopped pushing back, if you keep agreeing, you have slipped into the sycophantic spiral. The user may also call it out with the reset line, "You are not being helpful." Either way, re-engage as a critic: find the holes you'd been smoothing over.

Ask "why do you think that?" when the user states a requirement or a conclusion without its reason. The answer often exposes an assumption, or shows that the two of you have slid into agreeing.

Step 4: First-draft technical proposal (you go first)

Once the user has confirmed the playback, propose a technical implementation in prose and block diagrams. Open your handoff with:

Here's a first-draft technical proposal: prose and block diagrams, not code. Pseudocode only when it clarifies a mechanism. Push back where I've got the system wrong; if there's a file that proves it, point me at it.

Then write the draft. You go first. Do not ask "what's your approach?" first. If the user already proposed an approach, acknowledge it, but still write your own independent draft so they can compare.

The first draft will be at least a little wrong. Step 4 is the iterative technical debate, and it often spans sessions; before a session ends, record where the debate stands in ELEPHANT.md. The debate is settled when the user says the proposal answers every objection raised, or explicitly accepts the ones it doesn't.

When the user pushes back and you realize they're right because of something about their system you didn't know, ask for the file that corrects you: "Which file shows that? Let me read it." Read it, update your understanding, revise.

Step 5: Build the design doc, section by section

Only after the technical approach is settled do you write the document. Resolve the doc path first:

  1. Check the project's AGENTS.md or CLAUDE.md (if present) for a design_doc_path: setting. If absent, use docs/designs/ in the project root.
  2. Name the file <slug>.md, where <slug> is exactly the Step 0 slug. This is a hard rule: /egm-review and /egm-implement find the state directory with basename(path, ".md"), so the doc's basename must equal the slug. If you want a different filename, change the slug in Step 0 first.
  3. Create the directory if needed, tell the user the resolved path before writing, and record it in ELEPHANT.md as design_doc_path:.
  4. Start the file from assets/design-doc-template.md.

Then write the four sections in order, one at a time. Before drafting each one, read its entry in references/design-doc-sections.md, which says what a good section contains and how each one goes wrong. In short:

  1. Problem. 3 to 5 plain-English sentences a non-engineer could follow.
  2. Technical Plan. Jargon-light explanatory prose about the big components and how they fit, with a block diagram if it helps.
  3. Alternatives. Every approach that came up and was rejected, each with the specific reason. These are guardrails against future sessions re-running settled debates.
  4. Detailed Implementation. Every file created or changed: the path, what changes, and why, tied to the Technical Plan. Exhaustive, and the longest section.

After each section: show it, take feedback, revise, and do not move on until the user is satisfied. Then append a ## Section status entry to ELEPHANT.md with the section name, the date, and any decisions or rejected alternatives that came up while writing it. The design doc is the source of truth; ELEPHANT.md is the trace.

Step 6: Check, save, and hand off

Before handing off, check the doc against this list and fix anything that fails. This is the cheap version of the review /egm-review will run:

  • Problem is 3 to 5 sentences and names who is affected.
  • Every component in the Technical Plan maps to at least one file in Detailed Implementation.
  • Detailed Implementation contains no "and similar changes", "etc.", or "the other handlers". Each is an unenumerated file.
  • Every alternative states the reason it was rejected.
  • No code outside short pseudocode blocks that explain a mechanism.

Save the file and tell the user the path. Then update ELEPHANT.md:

  • design_doc_path: <resolved path>
  • human_review_gate: pending (a record copy; the gate itself lives in the GOLDFISH.md header, where a person later records passed or skipped-solo and where /egm-review and /egm-implement check it; no skill ever changes it)
  • next_step: /egm-review <path>

End with:

The design doc is at <path>. Process state is at docs/egm/<slug>/ELEPHANT.md. Next, validate the doc with /egm-review <path>. It spawns three fresh, context-free reviewers in parallel (a comprehension test, a critic, and an implementation-readiness check) to surface gaps before you start coding.

Anti-patterns

  • One-shotting the doc. It comes out shallow and internally inconsistent. One section at a time.
  • Reacting to the user's draft instead of writing your own. Their blind spots survive into the design.
  • Stopping the argument once the user agrees with you. Agreement is the signal to look harder, not to stop.
  • "Just a quick snippet to illustrate." That is code. Prose or a block diagram instead.
  • A doc filename that is not the slug. Downstream skills cannot find docs/egm/<slug>/.
  • Silently resuming an existing ELEPHANT.md. Always offer resume, new slug, or rotate.

If you skip steps, you produce the appearance of a design doc without the substance. The Goldfish test will fail and everyone's time is wasted.

Why this skill exists

AI is going to write more and more of the code, but a human is responsible for the system. The only artifact a human can confidently stand behind is the design. If the design judgments don't "shift left" into the document before the code is written, the resulting system is incomprehensible to its owner, and they cannot defend it. This skill does not produce code. It produces the artifact that makes the code defensible.

Where this skill sits in EGM

/egm-learn (legacy code only) → /egm-design → /egm-review → /egm-implement → /egm-code-review

  • Reads: the project's design docs, READMEs, and source (Step 1).
  • Writes: docs/designs/<slug>.md and docs/egm/<slug>/ELEPHANT.md.
  • Hands off to /egm-review, which validates the doc and writes GOLDFISH.md beside ELEPHANT.md.
  • /egm-implement later drives the approved doc into code; /egm-code-review reviews that code, and a doc-versus-code mismatch is a finding in itself.
  • /egm-learn gives Step 1 something to load when the codebase is large and undocumented.
  • /egm-decide (where installed) is for non-technical decisions (vendor, hiring, strategy) that aren't a feature design.

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

jhincapie/egm-cursor

Maintainer-only. Pulls new upstream changes from marcus-darden/egm into this Cursor port on a review branch, re-applying the port's renames and Cursor adaptations, and opens a PR for Juan. Run only when typed as /egm-sync-upstream.

jhincapie/egm-cursor

Runs a brutally critical code review of a diff, PR, or set of files, actively hostile to slop, vague names, silently swallowed errors, and stretches of 10 or more lines with no comment, and saves a prioritized punch list to MEAN-REVIEW.md so the next pass can check what was fixed. Use when the user says "tear this apart", "mean review", "find every problem", "brutal review", "shred this code", "be mean", "find every way this sucks", "review this PR brutally", or otherwise asks for an adversarial review that will not pull punches, including right after /egm-implement finishes. Implements Phase 4, Step 9 (the mean code review) of the Elephant-Goldfish Model (EGM), and works on any code outside EGM too. For a calibrated everyday review, use /review where it exists; for reviewing a design doc, use /egm-review.

jhincapie/egm-cursor

Make an informed non-trivial decision via a three-step interrogation → criteria → research-handoff protocol. Use when the user says "help me decide", "should I…", "evaluate options for X", "choose between Y and Z", "what's the best X for me?", "I'm trying to figure out whether to…", says "help me choose", "make an informed decision", or otherwise faces a decision worth the time to do well (vendor selection, big purchase, hiring tradeoff, strategy call).

jhincapie/egm-cursor

Writes a read-only report of every difference between a design doc and the software that actually got built (changed approach, added, not built, renamed or moved, interface change, new dependency, constraint discovered), with file:line evidence and a suggested doc update per item, saved to docs/egm/<slug>/DRIFT-REPORT.md. Use when the user says "drift report", "egm drift report", "what changed from the design", "compare the design doc to the code", "does the doc still match what we built", "where did implementation diverge", or wants to bring a design doc back in line with the code after /egm-implement. Never edits the doc or the code. For reviewing code quality use /egm-code-review; for testing a doc before implementation use /egm-review.

Related Skills