fix(meta-compile): default bare String to String(10), fix SKILL.md examples

Bare `String` type (without length qualifier) now defaults to String(10)
instead of String(0) — matching 1C Designer behavior. String(0) means
unlimited length (NTEXT in SQL), which is rarely intended.

Also fixes SKILL.md: removes misleading `"synonym": "авто"` from JSON
example, clarifies synonym auto-generation from CamelCase name.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-03-08 17:18:29 +03:00
parent c0255c71d0
commit 730daf1089
4 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -29,17 +29,17 @@ powershell.exe -NoProfile -File .claude/skills/meta-compile/scripts/meta-compile
### Общая структура
```json
{ "type": "Catalog", "name": "Номенклатура", "synonym": "авто", ...свойства типа... }
{ "type": "Catalog", "name": "Номенклатура", ...свойства типа... }
```
`type` и `name` — обязательные. `synonym` генерируется из `name` автоматически.
`type` и `name` — обязательные. `synonym` генерируется из `name` автоматически (CamelCase → слова через пробел). Можно задать явно: `"synonym": "Мой синоним"`.
### Shorthand реквизитов
Используется в `attributes`, `dimensions`, `resources`, `tabularSections`:
```
"ИмяРеквизита" → String без квалификаторов
"ИмяРеквизита" → String(10) по умолчанию
"ИмяРеквизита: Тип" → с типом
"ИмяРеквизита: Тип | req, index" → с флагами
```
@@ -239,7 +239,7 @@ function Emit-TypeContent {
# String or String(N)
if ($typeStr -match '^String(\((\d+)\))?$') {
$len = if ($Matches[2]) { $Matches[2] } else { "0" }
$len = if ($Matches[2]) { $Matches[2] } else { "10" }
X "$indent<v8:Type>xs:string</v8:Type>"
X "$indent<v8:StringQualifiers>"
X "$indent`t<v8:Length>$len</v8:Length>"
@@ -244,7 +244,7 @@ def emit_type_content(indent, type_str):
# String or String(N)
m = re.match(r'^String(\((\d+)\))?$', type_str)
if m:
length = m.group(2) if m.group(2) else '0'
length = m.group(2) if m.group(2) else '10'
X(f'{indent}<v8:Type>xs:string</v8:Type>')
X(f'{indent}<v8:StringQualifiers>')
X(f'{indent}\t<v8:Length>{length}</v8:Length>')
+1 -1
View File
@@ -112,7 +112,7 @@ JSON DSL для описания объектов метаданных конф
### 4.1 Строковая форма
```
"ИмяРеквизита" → String (без квалификаторов)
"ИмяРеквизита" → String(10) по умолчанию
"ИмяРеквизита: Тип" → с типом
"ИмяРеквизита: Тип | req, index" → с флагами
```