Skip to content

Instantly share code, notes, and snippets.

View zachdaniel's full-sized avatar

Zach Daniel zachdaniel

View GitHub Profile
```elixir
defmodule Thing do
use Ash.TypedStruct
typed_struct do
field(:name, :string, allow_nil?: false)
end
end
```
@zachdaniel
zachdaniel / .zshrc
Last active July 9, 2025 07:05
plz - Pipe into and out of claude code.
# get current cmd before executing
preexec() {
export PLZ_CURRENT_COMMAND="$1"
}
# so we can provide it to plz
plz() {
PLZ_FULL_CMD="$PLZ_CURRENT_COMMAND" $HOME/.dotfiles/scripts/plz "$@"
}
@zachdaniel
zachdaniel / AGENTS.md
Created July 1, 2025 12:16
agents md using link-to-folder deps

Usage Rules

IMPORTANT: Consult these usage rules early and often when working with the packages listed below. Before attempting to use any of these packages or to discover if you should use them, review their usage rules to understand the correct patterns, conventions, and best practices.

@zachdaniel
zachdaniel / AGENTS.md
Created July 1, 2025 12:13
an agents md example for a PR to Phoenix

Usage Rules

IMPORTANT: Consult these usage rules early and often when working with the packages listed below. Before attempting to use any of these packages or to discover if you should use them, review their usage rules to understand the correct patterns, conventions, and best practices.

action :analyze_sentiment, :atom do
constraints one_of: [:positive, :negative]
description """
Analyzes the sentiment of a given piece of text to determine if it is overall positive or negative.
"""
argument :text, :string do
allow_nil? false
description "The text for analysis"

GENERAL TASK WORKFLOW

PHASE 1: TASK ANALYSIS (MANDATORY)

Step 1.1: Understand the Request

YOU MUST:

  1. Parse what exactly is being asked
  2. Identify if this is a feature (use feature.md) or fix (use fix.md)
  3. If neither, continue with this workflow
  4. Break down into specific, measurable subtasks

BUG FIX WORKFLOW

THIS IS A MANDATORY WORKFLOW - ALL STEPS MUST BE COMPLETED IN ORDER

PHASE 1: UNDERSTANDING THE BUG (MANDATORY)

Step 1.1: Initial Investigation

REQUIRED ACTIONS:

  • Get exact error message/behavior description
  • Identify affected module/function using grep/glob

FEATURE IMPLEMENTATION WORKFLOW

THIS IS A MANDATORY WORKFLOW - NO STEPS CAN BE SKIPPED

PHASE 1: RESEARCH & PLANNING (MANDATORY)

Step 1.1: Initial Research

YOU MUST USE ALL AVAILABLE RESOURCES:

  • Check existing usage rules via get_usage_rules MCP tool or CLAUDE.md links
  • Use package_docs_search for ALL potentially relevant packages

Generating Code

Use list_generators to list available generators when available, otherwise mix help. If you have to run generator tasks, pass --yes. Always prefer to use generators as a basis for code generation, and then modify afterwards.

Tools

Use tidewave MCP tools when available, as they let you interrogate the running application in various useful ways.

Logs & Tests

About me

My name is Zach, I'm the author of Ash Framework. I am an expert programmer, and your first resource to use when you do not know something or do not know where to look for something.

NON NEGOTIABLE RULES THAT YOU MUST FOLLOW

  • USE gh CLI TO INTERACT WITH GITHUB.
  • NEVER COMMIT, PUSH, WRITE CODE OR ISSUES OR PRS UNLESS I TELL YOU TO.