oh-my-posh AGENTS.md

Project instructions for contributing to Oh My Posh, a Go program that displays information in command-line prompts.

In plain words
What is it for?
Use them before changing the codebase to find the right files and run the relevant Go, documentation, and lint checks.
Why use it?
They give coding agents the project's structure, tools, conventions, and validation commands so their changes fit the repository.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/jandedobbeleer/oh-my-posh/agents-md
Clone the repo
git clone --depth 1 https://github.com/JanDeDobbeleer/oh-my-posh

Made for: Codex, OpenCode.

Per session 1,987 This file is loaded in full into every session.
When invoked 1,987 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01987 $0.01987
Opus 5 $0.00993 $0.00993
Sonnet 5 $0.00397 $0.00397
Haiku 4.5 $0.00199 $0.00199

Measured yesterday against content hash adac1bbddb43, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

oh-my-posh AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 188 lines

How it starts

The opening of the file, as written. The whole thing — 188 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Instructions

General coding guidelines, commit conventions, and agent workflows for this repository.

Project Overview

Oh My Posh is a cross-shell prompt theme engine written in Go. It renders prompt segments by querying an Environment abstraction that wraps all OS/shell interactions.

Tech Stack

Layer Technology
Core engine Go (module root: src/)
Documentation site Docusaurus (MDX) - website/
Themes JSON - themes/
Config format TOML / JSON / YAML
Package/installer scripts packages/
Build scripts build/

Key Commands

# Go - run from src/
go test ./...
go test ./segments/... -run TestFoo  # single test
golangci-lint run

# Docs - run from website/
npm run start    # local dev server
npm run build    # validate before opening a docs PR

Codebase Exploration

Always explore the actual codebase before planning or writing code. Do not rely on memory or assumptions. Use the file system tools to read relevant files first - the codebase evolves and the feature you're asked to add may already exist.

Repository Layout

src/
  segments/   # One Go file + one _test.go per segment
  prompt/     # Core rendering engine
  runtime/    # OS/shell abstraction layer
themes/       # Bundled JSON theme files
website/      # Docusaurus docs site (MDX pages, sidebar config, JSON schema)
packages/     # Installer/package manifests
build/        # CI build helpers

Key paths inside src/:

Path Purpose
src/segments/ One .go + one _test.go per segment
src/config/segment_types.go Segment type registry (gob + string constants)
src/cli/ CLI commands (cmdtree); root.go is the entry point
src/prompt/engine.go Segment rendering loop
src/cache/ Existing TTL/file/command-path cache infrastructure
src/runtime/ Environment abstraction + mock

Read the full file on GitHub · 188 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 188 lines · 1,987 tokens per session scan A adac1bbddb43

Subscribe to this mod's changes

oh-my-posh AGENTS.md is an instructions file published in the GitHub repository JanDeDobbeleer/oh-my-posh (23,372 stars, last pushed yesterday), licensed MIT. It adds 1,987 tokens to every session, about $0.0099 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.