Skip to content

Instantly share code, notes, and snippets.

@rstacruz
rstacruz / 0-keeping-up-with-a-changelog.md
Created August 24, 2025 23:36
Keeping up with a changelog

Keeping up with a changelog

Got a fast-moving changelog like in https://github.com/sst/opencode/releases ? OpenCode itself can help you keep track.

  1. Add this file

    • Add opencode_changes.md below into your Notes and snippets git repo
    • You have a notes repo, don't you? If not, start a repo where you dump random Markdown files. It's useful for a lot of things
  2. Ask OpenCode to update it

Copy file path to clipboard

Here's a simple way to integrate Neovim with OpenCode or Claude Code.

  1. Select some text
  2. Press <leader>fyr
  3. Paste it into the LLM agent of your choice

This copies the file path into your clipboard in a format like @lib/keymaps.lua#L24-36. This mimics what the Claude Code VS Code extension would do (Alt+Cmd+K).

One-step quick commit

Commit and push in one step with opencode.

$ oc-commit
.
.

feat(bin): update help formatting and clarify LLM agent usage

OpenCode notification plugin

Shows desktop notifications with a summary of what the agent last said:

Screenshot

  • Place AGENTS.md in ~/.config/opencode/AGENTS.md
  • Place notification.ts in ~/.config/opencode/plugin/notification.ts
@rstacruz
rstacruz / 0-readme.md
Last active August 15, 2025 12:39
Structured vibe-coding

Spec mode guidelines

You are a senior software engineer assisting a user in defining and planning a new feature. Your goal is to guide the user through a structured process, resulting in a clear set of documents that can be handed off for implementation.

Guiding principles

  • Planner, not doer:
    • Your primary role is to create planning artifacts (requirements.md, design.md, tasks.md).
    • You MUST NOT write the implementation code yourself.
  • Phased approach:
@rstacruz
rstacruz / aider-plan.md
Last active July 9, 2025 14:30
Stop letting Aider code blindly - try this first

Stop letting Aider code blindly - try this first

Using Aider's /ask and /architect commands to approach larger tasks.

Aider is one of the best AI coding tools available today (in my opinion!). It's a brilliant AI coding assistant that integrates with any LLM, in any code editor.

However, Aider can often feel very eager to make changes. It jumps right into coding after I type anything. I noticed a pattern:

  • I would describe what I wanted
  • Aider would start coding right away
@rstacruz
rstacruz / gist:4e301b59a1c9642ecdca1e63dc210bfd
Last active April 7, 2025 02:03
Test storybook stories in Vitest + React testing library

Test storybook stories in Vitest + React testing library

Let's say you have these files:

  • Chat.tsx
  • Chat.stories.tsx
  • Chat.test.tsx

The test file can be written to use Storybook stories:

@rstacruz
rstacruz / prompt-pr.sh
Created March 3, 2025 06:00
Use LLMs to generate a PR summary
#!/usr/bin/env bash
# Generates a prompt for a PR summary and copies it to clipboard.
#
# Usage: prompt-pr.sh 1234
#
# Paste into Claude and watch it generate a PR summary.
#
# Try following up with these questions:
#
# - given the PR description and this plan, is there anything in this PR that may need changing?
@rstacruz
rstacruz / launcher.lua
Last active January 23, 2025 04:41
Rico's hammerspoon launcher config
-- Rico's hammerspoon launcher config
--
-- usage:
-- * press `ctrl-cmd-w` to switch-or-launch Firefox
-- * update the shortcuts below to your liking
--
-- installation:
-- * save as ~/.hammerspoon/mods/launcher.lua
-- * add this to ~/.hammerspoon/init.lua: `require("mods.launcher").setup()`
--