Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

segment-create

/segment-create

Wylicza pliki do zmiany przy dodawaniu nowego segmentu Oh My Posh, wskazuje wzorzec do skopiowania i sposób weryfikacji.

Repozytorium
oh-my-posh ↗
Licencja
MIT
Ostatnia zmiana repozytorium
21.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 21.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Wylicza pliki do zmiany przy dodawaniu nowego segmentu Oh My Posh, wskazuje wzorzec do skopiowania i sposób weryfikacji.

Oryginalny opis (EN)

Checklist for adding a new Oh My Posh segment. Use when asked to add or create a new segment: lists every file to touch, the existing segment to copy, and how to verify.

Jak działa

  1. Template
  2. Checklist
  3. Verify
Sekcje z nagłówków SKILL.md, w oryginale · 47 linii, 293 słów
Podgląd SKILL.md
---
name: segment-create
description: >
  Checklist for adding a new Oh My Posh segment. Use when asked to add or create a new segment:
  lists every file to touch, the existing segment to copy, and how to verify.
---

## 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`.
1. `src/config/segment_types.go`: add the constant `<ID> SegmentType = "<id>"`.
1. `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.
1. `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.
1. `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.
1. `website/sidebars.js`: add `"segments/<category>/<id>"` to that category's `items`.
1. `website/segment_data.json`: add sample data under `<id>`, shaped like the `taskwarrior` entry.
1. `website/plugins/segments/registry.json`: generated. The first `go test ./config/...` run
   rewrites it and fails; rerun to confirm, then keep the file.
1. Credentials needed? Add the doc id to `AUTH_TIERS` in `website/plugins/segments/data.js`.

## Verify

From `src/`:

```shell
go test ./segments/... -run Test<GoType>
go test ./config/...
```

Run `npm run build` in `website/` only when docs changed.

Wersje

W bazie nie ma innych skilli o nazwie segment-create.

Migawka bazy z 13.11.2026 · wersja paczki b4dda561b75f (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100segment-docs
    Mapuje kod źródłowy segmentów Oh My Posh na dokumentację MDX, pomagając pisać i audytować opcje oraz typy.
  • 100segment-webhooks
    Odbiera i weryfikuje webhooki Twilio Segment, w tym nagłówek X-Signature (HMAC-SHA1) i błędy weryfikacji przy dostawach wsadowych, oraz obsługuje wywołania track, identify, page, screen, group i alias.
  • 90component-checklist
    Wylicza pliki do zmiany przy dodawaniu komponentu ECS, polecenia MCP lub funkcji silnika w Ruście i warstwie webowej.
  • 100segment-setup
    Instaluje CLI segment, prowadzi przez logowanie do przestrzeni Segment i sprawdza token, region oraz uprawnienia.
  • 100segment-wizard
    Prowadzi osoby bez technicznego przygotowania przez budowę segmentu klientów, z walidacją i podglądem wyników.
  • 90posh-compliance-advisor
    Ocenia zgodność z indyjską ustawą POSH o zapobieganiu molestowaniu seksualnemu w pracy: komisję wewnętrzną, politykę, procedurę skarg i raportowanie.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.