Skip to content

Instantly share code, notes, and snippets.

@spilist
spilist / log-prompt-context.md
Last active August 19, 2025 23:18
Agent Rule (custom command) for Prompt & Context Version Control

/log-prompt-context

Record AI development context in /__prompts/ directory.

When to Use

  • After completing any project-related conversation (code changes, discussions, analysis, questions)
  • Before the user leaves a conversation session
  • For simple tasks: record immediately after task completion
  • For complex tasks with TodoWrite: record before marking final todo as complete
  • Even for CLAUDE.md modifications or meta-discussions about the project/rules
@spilist
spilist / gist:9231aa4e53e29fecce6f575918b9c3d5
Last active July 30, 2025 06:38
Rule for ShadCN MCP usage
## General Rule
When a task requires building or modifying a user interface, you must use the tools available in the `shadcn-ui` MCP server.
## Planning Rule
When planning a UI build using `shadcn`:
1. Discover Assets: First, use `list_components()` and `list_blocks()` to see all available assets in the MCP server.
2. Map Request to Assets: Analyze the user's request and map the required UI elements to the available components and blocks.
3. Prioritize Blocks: You should prioritize using blocks (`get_block`) wherever possible for common, complex UI patterns (e.g., login pages, calendars, dashboards). Blocks provide more structure and accelerate development. Use individual components (`get_component`) for smaller, more specific needs.
@spilist
spilist / gist:e4446565f1bdeed68f3d1a20debfe605
Created July 7, 2025 00:55
Cursor rules for step-by-step and TDD principle
---
description:
globs:
alwaysApply: true
---
# TDD-Integrated Development Workflow
## Core Directive
You are a senior software engineer AI assistant following Kent Beck's Test-Driven Development (TDD) and Tidy First principles. For EVERY task request, you MUST follow the three-phase TDD-integrated process below in exact order. Each phase must be completed with expert-level precision and detail.
Always follow the instructions in plan.md. When I say "go", find the next unmarked test in plan.md, implement the test, then implement only enough code to make that test pass.
# ROLE AND EXPERTISE
You are a senior software engineer who follows Kent Beck's Test-Driven Development (TDD) and Tidy First principles. Your purpose is to guide development following these methodologies precisely.
# CORE DEVELOPMENT PRINCIPLES
- Always follow the TDD cycle: Red → Green → Refactor
- Write the simplest failing test first
@spilist
spilist / gist:6b065cda20c0e75436d018e147f0cad9
Last active August 11, 2025 10:42
Custom command to open Claude Code with optimized configurations.
# .bashrc version. Source: https://bagerbach.com/blog/how-i-use-claude-code#running-claude-code
function ccv() {
local env_vars=(
"ENABLE_BACKGROUND_TASKS=true"
"FORCE_AUTO_BACKGROUND_TASKS=true"
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=true"
"CLAUDE_CODE_ENABLE_UNIFIED_READ_TOOL=true"
)
local claude_args=()
@spilist
spilist / bookmaklet
Created January 5, 2022 10:04
github 모든 resolved comments 열고, 코멘트 이동 가능한 상태면 해당 코멘트로 이동하는 bookmaklet
javascript: let count = 0; let elemtnsLength = 0; function loadAllCommentsAndShowResolved() { let e = !1; let elements = Array.from( document.querySelectorAll("button, .btn-link.Details-content--closed") ); elementsLength = elements.length; elements.forEach((o) => { o.classList.contains("ajax-pagination-btn") ? o.hasAttribute("disabled") || "Load more…" !== o.innerText ? o.hasAttribute("disabled") && "Loading…" === o.innerText ? (console.log("waiting", o), (e = !0)) : console.log("unrecognized %27Load more%27 button", o) : (console.log("found", o), (e = !0), o.dispatchEvent( new MouseEvent("click", { bubbles: !0, cancelable: !0 }) )) : o.classList.contains("Details-content--closed") && "Show resolved" === o.innerText && o.dispatchEvent( new MouseEvent("click", { bubbles: !0, cancelable: !0 }) ); count++; }), e ? setTimeout(loadAllCommentsAndShowResolved, 200) : () => {}; } function moveToDiscussion() { if (location.hash === '') { return; } if (count !== elemtnsLength) { setTimeout(moveToDiscussion, 200); } le
@spilist
spilist / url.rb
Last active November 2, 2018 05:34
module Url
def self.integrations(source = nil, token = nil)
@path = "/integrations"
if source and token
add source
add token.key
end
Integrations.new(self)
end
[core]
excludesfile = /Users/spilist/.gitignore_global
editor = "atom -n -w"
eol = lf
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true