segment-create

segment-create is a skill for Claude Code, Codex from JanDeDobbeleer/oh-my-posh. It costs 45 tokens per session (1,259 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).

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 ↓
Install with agentmods
npx agentmods add skills/jandedobbeleer/oh-my-posh/segment-create
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,435 stars · on GitHub · ohmyposh.dev

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.

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

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 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,259 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.00045 $0.01259
Opus 5 $0.00023 $0.00629
Sonnet 5 $0.00009 $0.00252
Haiku 4.5 $0.00005 $0.00126

Measured 9d ago against content hash f69c2f8d92b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 9d 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 · 170 lines

How it starts

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

Segment scaffolding instructions

Goal

  • Given user inputs (segment id, Go type name, title, category, description, properties, template), generate all required code and docs to add a new segment end-to-end, following repo conventions.

Inputs

  • id: kebab/slug used as type and docs filename (e.g., new)
  • goType: PascalCase name for the Go struct (e.g., New)
  • title: human readable (e.g., New)
  • category: one of cli|cloud|health|languages|music|scm|system|web
  • description: one-line description
  • properties: list of { key, type, title, description, default }
  • template: default template string (e.g., {{.Text}})

Contract

  • Idempotent: do not duplicate registrations, constants, map entries, sidebar links, or schema entries.
  • Alphabetical insertions where applicable.
  • Compile-ready Go code, formatted.
  • Docs lint clean according to the markdown skill (.github/skills/markdown/SKILL.md).

Implementation steps

  1. Create Go writer file: src/segments/<id>.go
  • If file exists, skip creation.
  • Use this template; include property consts for each property key.
package segments

import (
    "github.com/jandedobbeleer/oh-my-posh/src/segments/options"
    "github.com/jandedobbeleer/oh-my-posh/src/runtime"
)

type {{goType}} struct {
    Base

    // computed fields used in template
    Text string
}

// properties
const (
{{#each properties}}
    // {{this.title}}: {{this.description}}
    {{ pascalCase this.key }} options.Property = "{{this.key}}"
{{/each}})

func (s *{{goType}}) Enabled() bool {
    // set up data for the template, using defaults from properties
    {{#if (propExists properties "text")}}
    s.Text = s.props.GetString({{ pascalCase "text" }}, {{ defaultFor "text" }})
    {{else}}
    s.Text = s.props.GetString({{ pascalCase (firstKey properties) }}, "")
    {{/if}}
    return true
}

func (s *{{goType}}) Template() string {
    return {{ printf "%q" template }}
}
  1. Register in src/config/segment_types.go
  • Ensure in init() there is gob.Register(&segments.{{goType}}{}) exactly once.
  • Add constant: {{ upper id }} SegmentType = "{{id}}" in the alphabetical block.
  • Add to var Segments = map[SegmentType]func() SegmentWriter{} with key {{ upper id }} mapping to &segments.{{goType}}{}.
  • Keep lists alphabetically sorted. If not sorted, insert at correct position.
  1. Documentation file
  • Consult the segment-docs skill (.github/skills/segment-docs/SKILL.md) for the Go-to-documentation type mapping and rules for extracting options and template properties.
  • Path: website/docs/segments/{{category}}/{{id}}.mdx.
  • If file exists, skip. Else create with this template:
---
id: {{id}}
title: {{title}}
sidebar_label: {{title}}
---

## What

{{description}}

## Sample Configuration

import Config from '@site/src/components/Config.js';

<Config data={{
  "type": "{{id}}",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#193549",
  "background": "#ffeb3b",
  "options": {
{{#each option}}
    "{{this.key}}": {{ json this.default }},
{{/each}}
  }
}}/>

## Options

| Name | Type | Description | Default |
| ---- | ---- | ----------- | ------- |
{{#each option}}| `{{this.key}}` | `{{this.type}}` | {{this.description}} | `{{ stringify this.default }}` |
{{/each}}
  1. Sidebar
  • Update website/sidebars.js under the correct category array to include "segments/{{category}}/{{id}}".
  • Insert alphabetically; if already present, do nothing.
  1. JSON Schema
  • File: themes/schema.json.
  • Add "{{id}}" to #/definitions/segment/properties/type/enum if missing.
  • Add an allOf entry for this segment guarded by { properties: { type: { const: "{{id}}" } } } that declares each property as defined by inputs. Use appropriate JSON Schema types and include title, description, default.
  • Keep the allOf array in a stable order by type name if feasible; otherwise append if not present.

Validation

  • After changes, run go build (task: build oh-my-posh). Ensure no compile errors.
  • Check markdown formatting; respect 120-char line length and fenced blocks with language.

Read the full file on GitHub · 170 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. 9d 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,435 stars, last pushed today), licensed MIT. It adds 45 tokens to every session and 1,259 once invoked, about $0.0002 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.

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