Skip to content

Instantly share code, notes, and snippets.

View zachdaniel's full-sized avatar

Zach Daniel zachdaniel

View GitHub Profile
@zachdaniel
zachdaniel / AGENTS.md
Created July 18, 2025 16:06
A fresh project's AGENTS.md with one dependency (igniter) and builtin usage rules in-lined.

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 / ash_json_api_example.exs
Created July 11, 2024 11:37
Ash & AshJsonApi Example
Mix.install(
[
{:ash, "~> 3.0"},
{:ash_json_api, "~> 1.0"},
{:plug_cowboy, "~> 2.5"},
{:open_api_spex, "~> 3.16"}
],
consolidate_protocols: false
)
@zachdaniel
zachdaniel / classes.ex
Created July 14, 2025 15:32
A utility for conditional classes
# class={classes("bar", foo: true)}
def classes(string) when is_binary(string) do
string
end
def classes({class, condition}) do
if condition do
to_string(class)
end

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
@zachdaniel
zachdaniel / .zshrc
Last active July 13, 2025 17:10
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 "$@"
}
```elixir
defmodule Thing do
use Ash.TypedStruct
typed_struct do
field(:name, :string, allow_nil?: false)
end
end
```
@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.

Project Description

<--- -->

Working Method

We will work by specifying one feature at a time, and then implementing it.

The workflow:

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