Przejdź do treści
Biblioteka skilli
Programowanie · Nauka i wyjaśnianie

neon-format

/neon-format

Dostarcza składnię NEON i konwencje konfiguracji Nette przed tworzeniem lub zmianą plików .neon: encje, ciągi wieloliniowe, zapis inline, konwersję z YAML oraz parsowanie.

Repozytorium
agent-plugins ↗
Licencja
MIT
Ostatnia zmiana repozytorium
25.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 25.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

Dostarcza składnię NEON i konwencje konfiguracji Nette przed tworzeniem lub zmianą plików .neon: encje, ciągi wieloliniowe, zapis inline, konwersję z YAML oraz parsowanie.

Oryginalny opis (EN)

Invoke before creating or modifying .neon files. Provides NEON syntax and Nette configuration conventions. Use when writing or editing .neon config files, asking about NEON syntax (entities, multiline strings, inline notation, special values, escaping), converting YAML to NEON, parsing or encoding NEON in PHP (Neon::decode, Neon::encode), running neon-lint, or debugging NEON syntax errors. For phpstan.neon, use the phpstan-analysis skill (from nette-dev plugin) instead. Do not trigger for Nette DI concepts like autowiring and service registration without .neon file context.

Jak działa

  1. NEON Format
  2. PHP API
Sekcje z nagłówków SKILL.md, w oryginale · 215 linii, 511 słów
Podgląd SKILL.md
---
name: neon-format
description: Invoke before creating or modifying .neon files. Provides NEON syntax and Nette configuration conventions. Use when writing or editing .neon config files, asking about NEON syntax (entities, multiline strings, inline notation, special values, escaping), converting YAML to NEON, parsing or encoding NEON in PHP (Neon::decode, Neon::encode), running neon-lint, or debugging NEON syntax errors. For phpstan.neon, use the phpstan-analysis skill (from nette-dev plugin) instead. Do not trigger for Nette DI concepts like autowiring and service registration without .neon file context.
---

## NEON Format

NEON (Nette Object Notation) is a human-readable data format used for configuration files in Nette. Similar to YAML but with support for entities and tab indentation.

```shell
composer require nette/neon
```

### Mappings

Key-value pairs with required space after colon:

```neon
street: 742 Evergreen Terrace
city: Springfield
country: USA
```

Inline notation with braces:

```neon
{street: 742 Evergreen Terrace, city: Springfield, country: USA}
```

### Sequences

Indexed arrays with hyphen and space:

```neon
- Cat
- Dog
- Goldfish
```

Inline notation with brackets:

```neon
[Cat, Dog, Goldfish]
```

### Nesting

Indentation defines structure:

```neon
pets:
	- Cat
	- Dog
cars:
	- Volvo
	- Skoda
```

Block and inline can be combined:

```neon
pets: [Cat, Dog]
cars:
	- Volvo
	- Skoda
```

### Strings

Unquoted, single-quoted, or double-quoted:

```neon
- An unquoted string
- 'Single-quoted string'
- "Double-quoted with \t escapes"
```

Quote strings containing: `# " ' , : = - [ ] { } ( )`

Double a quote to include it: `'It''s working'`

Multiline strings with triple quotes:

```neon
'''
	first line
		second line
	third line
'''
```

### Special Values

```neon
# Numbers
count: 12
price: 12.3
scientific: +1.2e-34
binary: 0b11010
octal: 0o666
hex: 0x7A

# Null
value: null
empty:

# Booleans
enabled: true
disabled: false
active: yes
inactive: no

# Dates (auto-converted to DateTimeImmutable)
date: 2016-06-03
datetime: 2016-06-03 19:00:00
with_tz: 2016-06-03 19:00:00 +02:00
```

### Entities

Function-like structures for DI configuration:

```neon
Column(type: int, nulls: yes)
```

Chained entities:

```neon
Column(type: int) Field(id: 1)
```

Multiline entity:

```neon
Column(
	type: int
	nulls: yes
)
```

### Comments

```neon
# This line is ignored
street: 742 Evergreen Terrace  # inline comment
```

### Block vs Inline Notation

Use **inline** for short, simple values (up to ~3 items):
```neon
extensions: [foo, bar]
roles: {admin: true, user: false}
```

Use **block** for anything complex, nested, or long:
```neon
services:
	- App\Model\UserService
	- App\Model\OrderService
```

### Key Rules

- Space after `:` is required (`key: value`, not `key:value`)
- Use **tabs** for indentation. Spaces are valid too (`Neon::encode()` just defaults to tabs);
  unlike YAML, NEON accepts either, so never "fix" space-indented NEON
- Block notation cannot be nested inside inline notation
- Unquoted strings cannot start/end with spaces or look like numbers/booleans/dates

## PHP API

```php
use Nette\Neon\Neon;
```

### encode(mixed $value, bool $blockMode=false, string $indentation="\t"): string

Converts PHP value to NEON. Pass `true` to `$blockMode` for multiline output.

```php
Neon::encode($value);       // inline NEON
Neon::encode($value, true); // multiline NEON
```

### decode(string $neon): mixed

Parses NEON string to PHP value. Dates become `DateTimeImmutable`, entities become `Nette\Neon\Entity`.

```php
Neon::decode('hello: world'); // ['hello' => 'world']
```

### decodeFile(string $file): mixed

Parses NEON file to PHP value (removes BOM).

```php
Neon::decodeFile('config.neon');
```

All methods throw `Nette\Neon\Exception` on error.

### Lint Command

Check syntax errors in `.neon` files:

```shell
vendor/bin/neon-lint <path>
```

### Documentation

The full Nette documentation for this topic is bundled with the plugin. Read a page when you need details beyond this skill:

- [NEON Format](../../docs/neon/format.md) – the complete syntax
- [Nette NEON](../../docs/neon/index.md) – `Neon::encode()`, `Neon::decode()`, the linter

Wersje

W bazie nie ma innych skilli o nazwie neon-format.

Identyczna treść występuje jeszcze w 1 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.

Migawka bazy z 13.11.2026 · wersja paczki 8ef17b128017 (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

  • 100nette-configuration
    Opisuje konfigurację Nette DI: rejestrację usług, autowiring, auto-discovery, fabryki, metody setup, parametry, sekcję decorator i organizację plików .neon.
  • 100phpstan-analysis
    Pomaga usuwać błędy PHPStan: strategię naprawy, typowe wzorce Nette, zarządzanie baseline i testy typów.
  • 100wp-phpstan-review
    Przegląda konfigurację PHPStan w WordPressie: phpstan.neon, baseline, poziomy, rozszerzenia i wdrożenie w CI.
  • 100wp-phpstan
    Konfiguruje i naprawia PHPStan w projekcie WordPressa z Acorn: phpstan.neon, baseline, stubami i poziomami analizy.
  • 100wp-phpstan
    Konfiguruje, uruchamia i naprawia analizę statyczną PHPStan w wtyczkach, motywach i witrynach WordPressa.
  • 100php-quality
    Prowadzi analizę statyczną, styl kodu i idiomy PHP 8.3-8.5: phpstan.neon i baseline, PHPStan lub Psalm, PHP-CS-Fixer lub PHP_CodeSniffer, PER-CS, PSR-12 i zestawy Rector.

Uwagi i zgłoszenia

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