Skip to content

Instantly share code, notes, and snippets.

@emyller
Last active August 4, 2026 22:39
Show Gist options
  • Select an option

  • Save emyller/1f0871f0d010577e6e850e392e3edffa to your computer and use it in GitHub Desktop.

Select an option

Save emyller/1f0871f0d010577e6e850e392e3edffa to your computer and use it in GitHub Desktop.
dot files
[alias]
st = status
br = branch
co = checkout
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --abbrev
[core]
editor = vim
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true
[merge]
conflictstyle = zdiff3
[diff]
noprefix = true
[commit]
gpgsign = true
[user]
name = Evandro Myller
email = evandro.myller@flagsmith.com
signingkey = 735F9B497135A4C054F564A7C739EDD5AC9B854F
source $VIMRUNTIME/defaults.vim
set mouse-=a
syntax on
# Core plugins
# Need to install antidote: brew install antidote
# Learn more: https://getantidote.github.io
source /opt/homebrew/opt/antidote/share/antidote/antidote.zsh
source <(antidote init)
antidote bundle ohmyzsh/ohmyzsh
antidote bundle ohmyzsh/ohmyzsh path:plugins/aws
antidote bundle zdharma-continuum/fast-syntax-highlighting
# Theme
antidote bundle ohmyzsh/ohmyzsh path:themes/refined.zsh-theme
# Aliases
alias pac=yay
alias g=git
alias run=./bin/run
alias dc=docker-compose
alias kc=kubectl
alias kx=kubectx
alias t="bin/run pytest --sw --pdb"
# Functions
git-main-branch () { remote=$(git remote); echo ${remote}/$(git remote show ${remote} | awk '/HEAD branch/ {print $NF}') }
gprunesquashmerged () { main=$(git-main-branch); git checkout -q $main && git for-each-ref refs/heads/ "--format=%(refname:short)" | while read branch; do mergeBase=$(git merge-base $main $branch) && [[ $(git cherry $main $(git commit-tree $(git rev-parse "$branch^{tree}") -p $mergeBase -m _)) == "-"* ]] && git branch -D $branch; done }
gc () { git branch --merged $(git-main-branch) | grep -v '*' | xargs git branch -d }
pr () { hub pull-request -fpm $(git branch --show-current) -b $(basename $(git-main-branch)) } # Open PR
prd () { hub pull-request -fdpm $(git branch --show-current) -b $(basename $(git-main-branch)) } # Open PR as draft
pri () { hub pull-request -fdpi $1 } # Open PR converting an issue
gf () { git fetch -p $(git remote) }
gb () { gf; git checkout --no-track $(git-main-branch) -B $1 }
yay-autoremove () { yay -Rcs $(yay -Qdtq) }
dotenv () { test -f $1 && export $(cat $1 | grep -v '^#' | xargs) }
# Tilix fix
[[ $TILIX_ID ]] && source /etc/profile.d/vte.sh
# Add my SSH keys to the agent
for file in ~/.ssh/*; do; if cat "$file" | grep -q "BEGIN OPENSSH PRIVATE KEY"; then;
ssh-add "$file" > /dev/null
fi; done
# GPG
export GPG_TTY=$(tty)
# Atuin
ATUIN_NOBIND=t antidote bundle ellie/atuin
bindkey '^[[A' history-substring-search-up
bindkey '^r' _atuin_search_widget
# AWS vault
if [[ $(command -v aws-vault) ]]; then
antidote bundle blimmer/zsh-aws-vault
eval "$(aws-vault --completion-script-zsh)"
[[ -n "$AWS_VAULT" ]] && PS1="%{$fg[yellow]%}[aws::$AWS_VAULT]%{$reset_color%} $PS1"
fi
# Virtualenvwrapper
if [[ $(command -v virtualenvwrapper.sh) ]]; then
source virtualenvwrapper.sh
fi
# Extra path
export PATH="$PATH":"$HOME/.pub-cache/bin"

Agents

Human interaction

  • HI1: Always respond with a numbered list, having each item as terse as possible. Long items or loose paragraphs tend to be ignored by humans.
  • HI2: When making a reference to code, use a full relative file path + LoC. Example: api/accounts/models/user.py:36.

Scope

  • S1: Do exactly what is asked. Nothing more, nothing less. Do not add features, refactor surrounding code, "improve" things, or remove things that were not part of the request. Unsolicited changes are forbidden.

Honesty

  • H1: No flattery. No sycophancy. Ever. User wrong = say wrong. Unsure = say unsure.
  • H2: Do not underestimate the human's capacity to read code when it's well-architected. Avoid overexplaining, and overcommenting code. Only add comments that explain why, not what, when they are not obvious. If the code is too complex to need a comment, it probably needs more clarity in its engineering, and comments if any explaining is still necessary to avoid raised eyebrows in human reviews.

Comments

  • CM1: A comment never describes the code. Readable code describes itself. If a comment restates what the code already says, delete it and clarify the code instead. Docstrings for public functions and classes are the exception.
  • CM2: A comment exists only to reveal context that is not in the code — a dependency's behaviour, a spec, an upstream bug, an external constraint, a business rule. It reveals that context as it is, never how the code came to be. Keep it terse and one-line. Good: "Float sums drift on large totals."; "Webhooks may arrive out of order."; "Clock can jump backwards; use a monotonic source."
  • CM3: No deictic comments — never reference anything that exists only in the work session, the conversation, or a draft, rather than in the code. These are deixis and are forbidden: a situation ("fixes the failing test in CI"), a debugging session ("was returning stale segments here"), team dynamics ("remove before shipping to production"), a decision process ("Decision 3: evaluate in the view"), a prior draft ("switched from offset pagination"), a discarded approach ("we no longer recompute this"). A future reader has none of that context.

Verify

  • V1: NEVER GUESS. Be eager to obtain fresh information from reliable sources — such as local code and dependencies code, or Internet documentation — about any approach, or statement, or idea, before presenting or executing it. Assumptions are strictly forbidden.
  • V2: Show evidence. Every claim needs proof. Run command. Read file. Fetch URL. "Search results say" is not evidence.
  • V3: Verify before act. Check a thing exists before saying it exists. Test before commit.

Correctness

  • C1: Do it right, not fast. No template-paste. No skimming. No batching for speed. Read fully. Think fully. Act once, act right. "Good enough" is not good enough.
  • C2: Fix the source, not the symptom. When a problem appears, remove its cause so it stops occurring. Workarounds, suppressions, and conditional hides are forbidden unless the root cause is genuinely out of reach and the workaround is documented as such.
  • C3: Fail loud on impossible failures. If something the program cannot function without is missing — a bundled asset, an internal invariant, a computed value the next line consumes — abort or push_error rather than substituting a default and continuing. Silent fallbacks hide bugs and ship corrupted state; loud failures surface root causes. Guard inputs from outside the program (user input, network, file system entries the user controls), not against internal conditions that "cannot happen".

Documentation

  • D1: Always read the full documentation at docs/. Except for experimenting, only work from information present in the documentation, or propose a dialogue to update it.

Libraries

  • L1: Resist writing custom code. There is usually a known, efficient algorithm to solve the problem, often implemented in a library. Use it instead of writing your own.

Tests

  • T1: Two categories. Black-box integration tests live in tests/integration/ and only invoke public interfaces — HTTP endpoints, exported scene or module APIs — and verify their output. Tests for individual modules, classes, and functions live in tests/unit/. Never mix the two.

  • T2: Avoid class-based tests. Manage test lifecycle and dependencies through framework features — fixtures, markers, parametrisation, hooks. Read the project's shared fixture file (conftest.py in Python, GUT helpers in GDScript) before adding new tests.

  • T3: Name every test with the template test_{subject}__{condition}__{expected_outcome}. Example: test_get_version__valid_file_contents__returns_version_number. Double underscores separate the three parts.

  • T4: Use bare # Given + # When + # Then, or # Given / When + # Then (when setup is empty or implicit) comments to structure every test body. Do not include extra comments or narrative.

  • T5: Test-Driven Development. Add or modify tests ahead of writing the code they cover.

  • T6: 100% diff coverage on every PR. Every new or modified line must be reached by a test. Verify with the project's coverage tool before opening the PR.

  • T7: Verify log output. When code emits a log event that matters for product or operations, the test must assert the event was emitted with the expected attributes (caplog in Pytest; equivalent capture in GDScript).

  • T8: Tests assert the externally-observable contract, understandable by a reader who has only the merged code. A test's existence, name, and shape must never be motivated by the development process, a just-fixed bug, an internal branch you added, or an off-code decision. One behaviour → one test; never split tests to cover implementation branches. If a test only makes sense to someone who watched it being written, delete it or rewrite it to state the contract plainly. This is CM3 applied to tests.

Artifacts

  • A1: Artifacts stand alone. No pointing to chat context. No "this", "here", "now" that require the conversation to make sense. Commit messages, PRs, code comments, docs — the reader has no chat. Could be read in decades. Must make full sense alone.
  • A2: No reviewer-directed text in artifacts. Any sentence, comment, or caveat whose function is to justify the change to whoever reviews it — provenance notes ("captured from a live run"), verification claims ("validated against X"), or defences of a prior correction — is slop. Evidence and justification belong in the conversation; the artifact serves only its future reader.

Issues and PRs

  • P1: Issues and PRs explain WHY, never HOW. The reader is a product person, not a machine. No file names. No implementation details.

  • P2: New issues follow the template below.

    title: short defect or goal — WHY, not HOW
    
    <One paragraph explaining the problem or desired outcome.>
    
    ## Acceptance criteria
    
    - <Each item describes a desired result, not an implementation step.>
    - <Written so a product person can verify completion.>
    
  • P3: New PRs follow the template below. Title prefix is fix(<Context>): for defects, feat(<Context>): for features. See Conventional Commits for other prefixes.

    title: "fix(UI): <issue title>" or "feat(Users): <goal>" — WHY, not HOW
    
    <One paragraph: why these changes exist. Not what files changed.>
    
    ## Changes
    
    - [ ] <High-level change, understandable by a product person.>
    - [ ] <Check items as work progresses.>
    - [ ] <No file names. No implementation details.>
    
    Closes / Contributes to <issue URL>
    
    Review effort: N/5
    

Git

  • G1: Commit messages are a single line, 60 characters or less. Start with a verb — or adverb preceding a verb — that explains why the change exists, never how. Add Claude/model co-authorship. Never mix scopes in one commit. One concern per commit.
  • G2: A commit must be a product deliverable, never an implementation detail. If the change does not deliver a user-facing result, it does not deserve its own commit. The commit message is a headline that will appear in user-facing changelogs.
  • G3: Do not assume the remote name is origin. The user might use multiple remotes.
  • G4: Do not expect the local main branch to be up to date. It will most likely be stale.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment