segment-create

segment-create is a skill for Claude Code, Codex from JanDeDobbeleer/oh-my-posh. It costs 42 tokens per session (685 once invoked), scanned A, original, MIT.

A step-by-step recipe for adding a new Oh My Posh prompt segment. Oh My Posh is a tool that shows information such as the current folder or Git status in a command-line prompt.

In plain words
What is it for?
Use it to generate the Go code, documentation, sidebar entry, and JSON schema entry for a new segment.
Why use it?
It removes the need to remember every file and registration change required for a new segment, while keeping the additions consistent with the project.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is go test ./segments/... -run Test<GoType>.

Good fit Use it to generate the Go code, documentation, sidebar entry, and JSON schema entry for a new segment.

Compare 6 skills from other repositories ↓
About the project

oh-my-posh is a customizable prompt theme engine that renders command-line prompts across shells and platforms. Developers and terminal users use it to configure primary, secondary, right, and transient prompts in shells such as PowerShell, zsh, Bash, and cmd. The catalogue entries provide skills, instructions, agents, and an MCP integration for working with oh-my-posh.

JanDeDobbeleer/oh-my-posh · 23,638 stars · on GitHub · ohmyposh.dev

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/JanDeDobbeleer/oh-my-posh
agentmods
npx agentmods add skills/jandedobbeleer/oh-my-posh/segment-create

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for segment-create

README.md
[![agentmods](https://agentmods.dev/badge/skills/jandedobbeleer/oh-my-posh/segment-create/github.svg)](https://agentmods.dev/skills/jandedobbeleer/oh-my-posh/segment-create)
Your own site
<a href="https://agentmods.dev/skills/jandedobbeleer/oh-my-posh/segment-create"><img src="https://agentmods.dev/badge/skills/jandedobbeleer/oh-my-posh/segment-create/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for segment-create

Your own site · 80×15
<a href="https://agentmods.dev/skills/jandedobbeleer/oh-my-posh/segment-create"><img src="https://agentmods.dev/badge/skills/jandedobbeleer/oh-my-posh/segment-create.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 685 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Snyk pass 7 Sept 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Agent Snooping · line 33
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
  • medium Agent Snooping · line 91
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
How audits are shown
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.1 $0.00042 $0.00685
Opus 5.5 $0.00017 $0.00274
Sonnet 5.5 $0.00008 $0.00137
Haiku 4.5 $0.00004 $0.00068

Measured 13d ago against content hash e46665219cdb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

segment-create 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 13d ago.

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/skills/segment-create/SKILL.md · 53 lines

How it starts

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

Template

Copy src/segments/taskwarrior.go and src/segments/taskwarrior_test.go: two options, a Template()/Enabled() pair, and every shell call going through the mocked environment.

  • Embed Base first in the struct; its exported fields are the template properties.
  • Declare options as options.Option constants; read them with s.options.String(...), s.options.Bool(...), s.options.KeyValueMap(...) and so on, passing the default there.
  • Reach the OS, shell, files and network only through s.env so tests can mock it.
  • Override Activation() only for a cheap precondition such as a project file (see src/segments/dvc.go); Base defaults to always active.
  • Tests are table-driven: a mock.Environment from src/runtime/mock, options as an options.Map, then Init(props, env) and assertions on Enabled() and the exported fields.

Checklist

Keep every list sorted alphabetically.

  1. src/segments/<id>.go and src/segments/<id>_test.go.
  2. src/config/segment_types.go: add the constant <ID> SegmentType = "<id>".
  3. src/config/segment_registry.go: add gob.Register(&segments.<GoType>{}) to init() and <ID>: func() SegmentWriter { return &segments.<GoType>{} } to Segments. A missing map entry fails silently at runtime: the segment never renders.
  4. themes/schema.json: add <id> to definitions.segment.properties.type.enum and an if/then block to definitions.segment.allOf declaring every option. Copy the taskwarrior block; its unevaluatedProperties: false rejects undeclared options.
  5. website/docs/segments/<category>/<id>.mdx, where category is one of agents, cli, cloud, health, languages, music, scm, system or web. Follow the segment-docs skill, and keep a ## What paragraph: the segment catalog plugin reads it.
  6. website/sidebars.js: add "segments/<category>/<id>" to that category's items.
  7. website/segment_data.json: add sample data under <id>, shaped like the taskwarrior entry.
  8. website/plugins/segments/registry.json: generated. The first go test ./config/... run rewrites it and fails; rerun to confirm, then keep the file.
  9. Credentials needed? Add the doc id to AUTH_TIERS in website/plugins/segments/data.js.

Read the full file on GitHub · 53 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. 13d ago Changed · -117 lines · -3 tokens per session e46665219cdb
  2. 1mo ago Changed d7dd1185d80c
  3. 1mo ago First seen · 170 lines · 45 tokens per session scan A f69c2f8d92b3

Subscribe to this mod's changes

segment-create is a skill published in the GitHub repository JanDeDobbeleer/oh-my-posh (23,638 stars, last pushed 3d ago), licensed MIT. It adds 42 tokens to every session and 685 once invoked, about $0.0002 per session on Opus 5.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.

Related

Other skills, from other repositories

golang-style

Go conventions specific to this author. Use before writing or editing any Go (.go) file.

fredrikaverpil/dotfiles · 23 tokens

robotgo

Use when automating desktop GUI operations in Go — mouse/keyboard control, screen capture, image recognition via OpenCV, global hotkeys via gohook. RobotGo: cross-platform Go desktop automation (RPA) library for macOS, Windows, and Linux.

znlgis/opengis-skills · 56 tokens

scaffold-go

Scaffold a complete Go project with CI/CD, release pipeline, Makefile, sr.yaml, .envrc, and standard files. Uses go toolchain and make as the native build system. Loads on top of scaffold-project (run that first for cross-language standard files). Use when creating a new Go CLI, service, or module, or when the user…

urmzd/dotfiles · 116 tokens

golang-spf13-cobra

Golang CLI command tree library using spf13/cobra — cobra.Command, RunE vs Run, PersistentPreRunE hook chain, Args validators (NoArgs, ExactArgs, MatchAll, custom), persistent vs local flags, command groups, ValidArgsFunction, RegisterFlagCompletionFunc, ShellCompDirective, usage/help template customization, man-page…

aiskillstore/marketplace · 180 tokens

cmd/gerp

Performs native command line terminal operations for gerp subsystem. Use when doing matrix cli executions, or when the user mentions cobra, terminal operators, viper configs, or the gerp binary.

quantDIY/GERP · 44 tokens

java-clean-comments

Enforces comment and Javadoc hygiene in Java — no commented-out code, no author or ticket metadata, no comments restating the code, and Javadoc that documents contracts rather than repeating signatures. Use when writing or reviewing Java comments and Javadoc, and when the code shows commented-out blocks, TODO or FIXME…

CasLubbers/code-design-skills · 88 tokens