Merge branch 'dev'

This commit is contained in:
Nick Shirokov
2026-02-16 20:31:52 +03:00
67 changed files with 1703 additions and 444 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ allowed-tools:
| `NoValidate` | Пропустить авто-валидацию | | `NoValidate` | Пропустить авто-валидацию |
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\cf-edit\scripts\cf-edit.ps1 -ConfigPath '<path>' -Operation modify-property -Value 'Version=1.0.0.1' powershell.exe -NoProfile -File .claude/skills/cf-edit/scripts/cf-edit.ps1 -ConfigPath '<path>' -Operation modify-property -Value 'Version=1.0.0.1'
``` ```
## Операции ## Операции
+1 -1
View File
@@ -22,7 +22,7 @@ allowed-tools:
| `OutFile` | Записать результат в файл (UTF-8 BOM) | | `OutFile` | Записать результат в файл (UTF-8 BOM) |
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\cf-info\scripts\cf-info.ps1 -ConfigPath "<путь>" powershell.exe -NoProfile -File .claude/skills/cf-info/scripts/cf-info.ps1 -ConfigPath "<путь>"
``` ```
## Три режима ## Три режима
+1 -1
View File
@@ -24,7 +24,7 @@ allowed-tools:
| `CompatibilityMode` | Режим совместимости (default: `Version8_3_24`) | | `CompatibilityMode` | Режим совместимости (default: `Version8_3_24`) |
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\cf-init\scripts\cf-init.ps1 -Name "МояКонфигурация" powershell.exe -NoProfile -File .claude/skills/cf-init/scripts/cf-init.ps1 -Name "МояКонфигурация"
``` ```
## Что создаётся ## Что создаётся
+1 -1
View File
@@ -21,7 +21,7 @@ allowed-tools:
| `OutFile` | Записать результат в файл (UTF-8 BOM) | | `OutFile` | Записать результат в файл (UTF-8 BOM) |
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\cf-validate\scripts\cf-validate.ps1 -ConfigPath "<путь>" powershell.exe -NoProfile -File .claude/skills/cf-validate/scripts/cf-validate.ps1 -ConfigPath "<путь>"
``` ```
## Выполняемые проверки ## Выполняемые проверки
+1 -2
View File
@@ -31,13 +31,12 @@ allowed-tools:
- `Document.РеализацияТоваров` — документ - `Document.РеализацияТоваров` — документ
- `Enum.ВидыОплат` — перечисление - `Enum.ВидыОплат` — перечисление
- `Catalog.X ;; CommonModule.Y ;; Enum.Z` — несколько объектов - `Catalog.X ;; CommonModule.Y ;; Enum.Z` — несколько объектов
Поддерживаются все 44 типа объектов конфигурации. Поддерживаются все 44 типа объектов конфигурации.
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\cfe-borrow\scripts\cfe-borrow.ps1 -ExtensionPath src -ConfigPath C:\cfsrc\erp -Object "Catalog.Контрагенты" powershell.exe -NoProfile -File .claude/skills/cfe-borrow/scripts/cfe-borrow.ps1 -ExtensionPath src -ConfigPath C:\cfsrc\erp -Object "Catalog.Контрагенты"
``` ```
## Примеры ## Примеры
@@ -102,6 +102,27 @@ $childTypeDirMap = @{
"CommonAttribute"="CommonAttributes"; "Style"="Styles" "CommonAttribute"="CommonAttributes"; "Style"="Styles"
} }
# --- 4b. Russian synonym → English type ---
$synonymMap = @{
"Справочник"="Catalog"; "Документ"="Document"; "Перечисление"="Enum"
"ОбщийМодуль"="CommonModule"; "ОбщаяКартинка"="CommonPicture"
"ОбщаяКоманда"="CommonCommand"; "ОбщийМакет"="CommonTemplate"
"ПланОбмена"="ExchangePlan"; "Отчет"="Report"; "Отчёт"="Report"
"Обработка"="DataProcessor"; "РегистрСведений"="InformationRegister"
"РегистрНакопления"="AccumulationRegister"
"ПланВидовХарактеристик"="ChartOfCharacteristicTypes"
"ПланСчетов"="ChartOfAccounts"; "РегистрБухгалтерии"="AccountingRegister"
"ПланВидовРасчета"="ChartOfCalculationTypes"; "РегистрРасчета"="CalculationRegister"
"БизнесПроцесс"="BusinessProcess"; "Задача"="Task"
"Подсистема"="Subsystem"; "Роль"="Role"; "Константа"="Constant"
"ФункциональнаяОпция"="FunctionalOption"; "ОпределяемыйТип"="DefinedType"
"ОбщаяФорма"="CommonForm"; "ЖурналДокументов"="DocumentJournal"
"ПараметрСеанса"="SessionParameter"; "ГруппаКоманд"="CommandGroup"
"ПодпискаНаСобытие"="EventSubscription"; "РегламентноеЗадание"="ScheduledJob"
"ОбщийРеквизит"="CommonAttribute"; "ПакетXDTO"="XDTOPackage"
"HTTPСервис"="HTTPService"; "СервисИнтеграции"="IntegrationService"
}
# --- 5. Canonical type order (44 types) --- # --- 5. Canonical type order (44 types) ---
$script:typeOrder = @( $script:typeOrder = @(
"Language","Subsystem","StyleItem","Style", "Language","Subsystem","StyleItem","Style",
@@ -519,6 +540,9 @@ foreach ($item in $items) {
$typeName = $item.Substring(0, $dotIdx) $typeName = $item.Substring(0, $dotIdx)
$objName = $item.Substring($dotIdx + 1) $objName = $item.Substring($dotIdx + 1)
# Resolve Russian synonym to English type name
if ($synonymMap.ContainsKey($typeName)) { $typeName = $synonymMap[$typeName] }
if (-not $childTypeDirMap.ContainsKey($typeName)) { if (-not $childTypeDirMap.ContainsKey($typeName)) {
Write-Error "Unknown type '${typeName}'" Write-Error "Unknown type '${typeName}'"
exit 1 exit 1
+2 -2
View File
@@ -1,6 +1,6 @@
--- ---
name: cfe-diff name: cfe-diff
description: Анализ расширения конфигурации 1С (CFE) — обзор изменений и проверка переноса. Используй для понимания что изменено в расширении или для проверки перенесены ли изменения из расширения в конфигурацию description: Анализ расширения конфигурации 1С (CFE) — состав, заимствованные объекты, перехватчики, проверка переноса. Используй когда нужно понять что содержит расширение или проверить перенесены ли вставки в конфигурацию
argument-hint: -ExtensionPath <path> -ConfigPath <path> [-Mode A|B] argument-hint: -ExtensionPath <path> -ConfigPath <path> [-Mode A|B]
allowed-tools: allowed-tools:
- Bash - Bash
@@ -23,7 +23,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\cfe-diff\scripts\cfe-diff.ps1 -ExtensionPath src -ConfigPath C:\cfsrc\erp -Mode A powershell.exe -NoProfile -File .claude/skills/cfe-diff/scripts/cfe-diff.ps1 -ExtensionPath src -ConfigPath C:\cfsrc\erp -Mode A
``` ```
## Mode A — обзор расширения ## Mode A — обзор расширения
+1 -1
View File
@@ -39,7 +39,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\cfe-init\scripts\cfe-init.ps1 -Name "МоёРасширение" powershell.exe -NoProfile -File .claude/skills/cfe-init/scripts/cfe-init.ps1 -Name "МоёРасширение"
``` ```
## Что создаётся ## Что создаётся
+1 -1
View File
@@ -51,7 +51,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\cfe-patch-method\scripts\cfe-patch-method.ps1 -ExtensionPath src -ModulePath "Catalog.Контрагенты.ObjectModule" -MethodName "ПриЗаписи" -InterceptorType Before powershell.exe -NoProfile -File .claude/skills/cfe-patch-method/scripts/cfe-patch-method.ps1 -ExtensionPath src -ModulePath "Catalog.Контрагенты.ObjectModule" -MethodName "ПриЗаписи" -InterceptorType Before
``` ```
## Примеры ## Примеры
+1 -1
View File
@@ -23,7 +23,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\cfe-validate\scripts\cfe-validate.ps1 -ExtensionPath src powershell.exe -NoProfile -File .claude/skills/cfe-validate/scripts/cfe-validate.ps1 -ExtensionPath src
``` ```
## Проверки (9 шагов) ## Проверки (9 шагов)
+20 -24
View File
@@ -28,30 +28,25 @@ allowed-tools:
Если `v8path` не задан — автоопределение: `Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort -Desc | Select -First 1` Если `v8path` не задан — автоопределение: `Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort -Desc | Select -First 1`
После создания базы предложи зарегистрировать через `/db-list add`. После создания базы предложи зарегистрировать через `/db-list add`.
## Команды ## Команда
### Файловая база ```powershell
powershell.exe -NoProfile -File .claude/skills/db-create/scripts/db-create.ps1 <параметры>
```cmd
"<v8path>\1cv8.exe" CREATEINFOBASE File="<путь>" /DisableStartupDialogs /Out "<лог>"
``` ```
### Серверная база ### Параметры скрипта
```cmd | Параметр | Обязательный | Описание |
"<v8path>\1cv8.exe" CREATEINFOBASE Srvr="<сервер>";Ref="<имя>" /DisableStartupDialogs /Out "<лог>" |----------|:------------:|----------|
``` | `-V8Path <путь>` | нет | Каталог bin платформы (или полный путь к 1cv8.exe) |
| `-InfoBasePath <путь>` | * | Путь к файловой базе |
| `-InfoBaseServer <сервер>` | * | Сервер 1С (для серверной базы) |
| `-InfoBaseRef <имя>` | * | Имя базы на сервере |
| `-UseTemplate <файл>` | нет | Создать из шаблона (.cf или .dt) |
| `-AddToList` | нет | Добавить в список баз 1С |
| `-ListName <имя>` | нет | Имя базы в списке |
### Параметры > `*` — нужен либо `-InfoBasePath`, либо пара `-InfoBaseServer` + `-InfoBaseRef`
| Параметр | Описание |
|----------|----------|
| `File="<путь>"` | Строка соединения для файловой базы |
| `Srvr="<сервер>";Ref="<имя>"` | Строка соединения для серверной базы |
| `/AddToList [<имя>]` | Добавить в список баз 1С (необязательно) |
| `/UseTemplate <файл>` | Создать из шаблона (.cf или .dt) |
| `/DisableStartupDialogs` | Подавить диалоги |
| `/Out <файл>` | Лог-файл |
## Коды возврата ## Коды возврата
@@ -69,14 +64,15 @@ allowed-tools:
## Примеры ## Примеры
```powershell ```powershell
$v8 = Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort-Object -Descending | Select-Object -First 1
# Создать файловую базу # Создать файловую базу
& $v8.FullName CREATEINFOBASE File="C:\Bases\NewDB" /DisableStartupDialogs /Out "create.log" powershell.exe -NoProfile -File .claude/skills/db-create/scripts/db-create.ps1 -InfoBasePath "C:\Bases\NewDB"
# Создать серверную базу # Создать серверную базу
& $v8.FullName CREATEINFOBASE Srvr="srv01";Ref="MyApp_Test" /DisableStartupDialogs /Out "create.log" powershell.exe -NoProfile -File .claude/skills/db-create/scripts/db-create.ps1 -InfoBaseServer "srv01" -InfoBaseRef "MyApp_Test"
# Создать из шаблона CF # Создать из шаблона CF
& $v8.FullName CREATEINFOBASE File="C:\Bases\NewDB" /UseTemplate "C:\Templates\config.cf" /DisableStartupDialogs /Out "create.log" powershell.exe -NoProfile -File .claude/skills/db-create/scripts/db-create.ps1 -InfoBasePath "C:\Bases\NewDB" -UseTemplate "C:\Templates\config.cf"
# Создать и добавить в список баз
powershell.exe -NoProfile -File .claude/skills/db-create/scripts/db-create.ps1 -InfoBasePath "C:\Bases\NewDB" -AddToList -ListName "Новая база"
``` ```
@@ -0,0 +1,163 @@
# db-create v1.0 — Create 1C information base
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
<#
.SYNOPSIS
Создание информационной базы 1С
.DESCRIPTION
Создаёт новую информационную базу 1С (файловую или серверную).
Поддерживает создание из шаблона и добавление в список баз.
.PARAMETER V8Path
Путь к каталогу bin платформы или к 1cv8.exe
.PARAMETER InfoBasePath
Путь к файловой информационной базе
.PARAMETER InfoBaseServer
Сервер 1С (для серверной базы)
.PARAMETER InfoBaseRef
Имя базы на сервере
.PARAMETER UseTemplate
Путь к файлу шаблона (.cf или .dt)
.PARAMETER AddToList
Добавить в список баз 1С
.PARAMETER ListName
Имя базы в списке
.EXAMPLE
.\db-create.ps1 -InfoBasePath "C:\Bases\NewDB"
.EXAMPLE
.\db-create.ps1 -InfoBaseServer "srv01" -InfoBaseRef "MyApp_Test"
.EXAMPLE
.\db-create.ps1 -InfoBasePath "C:\Bases\NewDB" -UseTemplate "C:\Templates\config.cf" -AddToList -ListName "Новая база"
#>
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[string]$V8Path,
[Parameter(Mandatory=$false)]
[string]$InfoBasePath,
[Parameter(Mandatory=$false)]
[string]$InfoBaseServer,
[Parameter(Mandatory=$false)]
[string]$InfoBaseRef,
[Parameter(Mandatory=$false)]
[string]$UseTemplate,
[Parameter(Mandatory=$false)]
[switch]$AddToList,
[Parameter(Mandatory=$false)]
[string]$ListName
)
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# --- Resolve V8Path ---
if (-not $V8Path) {
$found = Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" -ErrorAction SilentlyContinue | Sort-Object FullName -Descending | Select-Object -First 1
if ($found) {
$V8Path = $found.FullName
} else {
Write-Host "Error: 1cv8.exe not found. Specify -V8Path" -ForegroundColor Red
exit 1
}
} elseif (Test-Path $V8Path -PathType Container) {
$V8Path = Join-Path $V8Path "1cv8.exe"
}
if (-not (Test-Path $V8Path)) {
Write-Host "Error: 1cv8.exe not found at $V8Path" -ForegroundColor Red
exit 1
}
# --- Validate connection ---
if (-not $InfoBasePath -and (-not $InfoBaseServer -or -not $InfoBaseRef)) {
Write-Host "Error: specify -InfoBasePath or -InfoBaseServer + -InfoBaseRef" -ForegroundColor Red
exit 1
}
# --- Validate template ---
if ($UseTemplate -and -not (Test-Path $UseTemplate)) {
Write-Host "Error: template file not found: $UseTemplate" -ForegroundColor Red
exit 1
}
# --- Temp dir ---
$tempDir = Join-Path $env:TEMP "db_create_$(Get-Random)"
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
try {
# --- Build arguments ---
$arguments = @("CREATEINFOBASE")
if ($InfoBaseServer -and $InfoBaseRef) {
$arguments += "Srvr=`"$InfoBaseServer`";Ref=`"$InfoBaseRef`""
} else {
$arguments += "File=`"$InfoBasePath`""
}
# --- Template ---
if ($UseTemplate) {
$arguments += "/UseTemplate", "`"$UseTemplate`""
}
# --- Add to list ---
if ($AddToList) {
if ($ListName) {
$arguments += "/AddToList", "`"$ListName`""
} else {
$arguments += "/AddToList"
}
}
# --- Output ---
$outFile = Join-Path $tempDir "create_log.txt"
$arguments += "/Out", "`"$outFile`""
$arguments += "/DisableStartupDialogs"
# --- Execute ---
Write-Host "Running: 1cv8.exe $($arguments -join ' ')"
$process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru
$exitCode = $process.ExitCode
# --- Result ---
if ($exitCode -eq 0) {
if ($InfoBaseServer -and $InfoBaseRef) {
Write-Host "Information base created successfully: $InfoBaseServer/$InfoBaseRef" -ForegroundColor Green
} else {
Write-Host "Information base created successfully: $InfoBasePath" -ForegroundColor Green
}
} else {
Write-Host "Error creating information base (code: $exitCode)" -ForegroundColor Red
}
if (Test-Path $outFile) {
$logContent = Get-Content $outFile -Raw -ErrorAction SilentlyContinue
if ($logContent) {
Write-Host "--- Log ---"
Write-Host $logContent
Write-Host "--- End ---"
}
}
exit $exitCode
} finally {
if (Test-Path $tempDir) {
Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue
}
}
+23 -15
View File
@@ -34,22 +34,25 @@ allowed-tools:
## Команда ## Команда
```cmd ```powershell
"<v8path>\1cv8.exe" DESIGNER /F "<база>" /N"<user>" /P"<pwd>" /DumpCfg "<файл.cf>" /DisableStartupDialogs /Out "<лог>" powershell.exe -NoProfile -File .claude/skills/db-dump-cf/scripts/db-dump-cf.ps1 <параметры>
``` ```
Для серверной базы вместо `/F` используй `/S`: ### Параметры скрипта
```cmd
"<v8path>\1cv8.exe" DESIGNER /S "<server>/<ref>" /N"<user>" /P"<pwd>" /DumpCfg "<файл.cf>" /DisableStartupDialogs /Out "<лог>"
```
### Параметры | Параметр | Обязательный | Описание |
|----------|:------------:|----------|
| `-V8Path <путь>` | нет | Каталог bin платформы (или полный путь к 1cv8.exe) |
| `-InfoBasePath <путь>` | * | Файловая база |
| `-InfoBaseServer <сервер>` | * | Сервер 1С (для серверной базы) |
| `-InfoBaseRef <имя>` | * | Имя базы на сервере |
| `-UserName <имя>` | нет | Имя пользователя |
| `-Password <пароль>` | нет | Пароль |
| `-OutputFile <путь>` | да | Путь к выходному CF-файлу |
| `-Extension <имя>` | нет | Выгрузить расширение |
| `-AllExtensions` | нет | Выгрузить все расширения |
| Параметр | Описание | > `*` — нужен либо `-InfoBasePath`, либо пара `-InfoBaseServer` + `-InfoBaseRef`
|----------|----------|
| `/DumpCfg <файл>` | Путь к выходному CF-файлу |
| `-Extension <имя>` | Выгрузить расширение (вместо основной конфигурации) |
| `-AllExtensions` | Выгрузить все расширения (архив расширений) |
## Коды возврата ## Коды возврата
@@ -62,10 +65,15 @@ allowed-tools:
Прочитай лог-файл и покажи результат. Если есть ошибки — покажи содержимое лога. Прочитай лог-файл и покажи результат. Если есть ошибки — покажи содержимое лога.
## Пример ## Примеры
```powershell ```powershell
$v8 = Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort-Object -Descending | Select-Object -First 1 # Выгрузка конфигурации (файловая база)
powershell.exe -NoProfile -File .claude/skills/db-dump-cf/scripts/db-dump-cf.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -OutputFile "C:\backup\config.cf"
& $v8.FullName DESIGNER /F "C:\Bases\MyDB" /N"Admin" /P"" /DumpCfg "C:\backup\config.cf" /DisableStartupDialogs /Out "dump.log" # Серверная база
powershell.exe -NoProfile -File .claude/skills/db-dump-cf/scripts/db-dump-cf.ps1 -InfoBaseServer "srv01" -InfoBaseRef "MyApp_Dev" -UserName "Admin" -Password "secret" -OutputFile "config.cf"
# Выгрузка расширения
powershell.exe -NoProfile -File .claude/skills/db-dump-cf/scripts/db-dump-cf.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -OutputFile "ext.cfe" -Extension "МоёРасширение"
``` ```
@@ -0,0 +1,166 @@
# db-dump-cf v1.0 — Dump 1C configuration to CF file
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
<#
.SYNOPSIS
Выгрузка конфигурации 1С в CF-файл
.DESCRIPTION
Выгружает конфигурацию информационной базы в бинарный CF-файл.
Поддерживает выгрузку расширений.
.PARAMETER V8Path
Путь к каталогу bin платформы или к 1cv8.exe
.PARAMETER InfoBasePath
Путь к файловой информационной базе
.PARAMETER InfoBaseServer
Сервер 1С (для серверной базы)
.PARAMETER InfoBaseRef
Имя базы на сервере
.PARAMETER UserName
Имя пользователя 1С
.PARAMETER Password
Пароль пользователя
.PARAMETER OutputFile
Путь к выходному CF-файлу
.PARAMETER Extension
Имя расширения для выгрузки
.PARAMETER AllExtensions
Выгрузить все расширения
.EXAMPLE
.\db-dump-cf.ps1 -InfoBasePath "C:\Bases\MyDB" -OutputFile "config.cf"
.EXAMPLE
.\db-dump-cf.ps1 -InfoBasePath "C:\Bases\MyDB" -OutputFile "ext.cfe" -Extension "МоёРасширение"
#>
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[string]$V8Path,
[Parameter(Mandatory=$false)]
[string]$InfoBasePath,
[Parameter(Mandatory=$false)]
[string]$InfoBaseServer,
[Parameter(Mandatory=$false)]
[string]$InfoBaseRef,
[Parameter(Mandatory=$false)]
[string]$UserName,
[Parameter(Mandatory=$false)]
[string]$Password,
[Parameter(Mandatory=$true)]
[string]$OutputFile,
[Parameter(Mandatory=$false)]
[string]$Extension,
[Parameter(Mandatory=$false)]
[switch]$AllExtensions
)
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# --- Resolve V8Path ---
if (-not $V8Path) {
$found = Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" -ErrorAction SilentlyContinue | Sort-Object FullName -Descending | Select-Object -First 1
if ($found) {
$V8Path = $found.FullName
} else {
Write-Host "Error: 1cv8.exe not found. Specify -V8Path" -ForegroundColor Red
exit 1
}
} elseif (Test-Path $V8Path -PathType Container) {
$V8Path = Join-Path $V8Path "1cv8.exe"
}
if (-not (Test-Path $V8Path)) {
Write-Host "Error: 1cv8.exe not found at $V8Path" -ForegroundColor Red
exit 1
}
# --- Validate connection ---
if (-not $InfoBasePath -and (-not $InfoBaseServer -or -not $InfoBaseRef)) {
Write-Host "Error: specify -InfoBasePath or -InfoBaseServer + -InfoBaseRef" -ForegroundColor Red
exit 1
}
# --- Ensure output directory exists ---
$outDir = Split-Path $OutputFile -Parent
if ($outDir -and -not (Test-Path $outDir)) {
New-Item -ItemType Directory -Path $outDir -Force | Out-Null
}
# --- Temp dir ---
$tempDir = Join-Path $env:TEMP "db_dump_cf_$(Get-Random)"
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
try {
# --- Build arguments ---
$arguments = @("DESIGNER")
if ($InfoBaseServer -and $InfoBaseRef) {
$arguments += "/S", "`"$InfoBaseServer/$InfoBaseRef`""
} else {
$arguments += "/F", "`"$InfoBasePath`""
}
if ($UserName) { $arguments += "/N`"$UserName`"" }
if ($Password) { $arguments += "/P`"$Password`"" }
$arguments += "/DumpCfg", "`"$OutputFile`""
# --- Extensions ---
if ($Extension) {
$arguments += "-Extension", "`"$Extension`""
} elseif ($AllExtensions) {
$arguments += "-AllExtensions"
}
# --- Output ---
$outFile = Join-Path $tempDir "dump_cf_log.txt"
$arguments += "/Out", "`"$outFile`""
$arguments += "/DisableStartupDialogs"
# --- Execute ---
Write-Host "Running: 1cv8.exe $($arguments -join ' ')"
$process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru
$exitCode = $process.ExitCode
# --- Result ---
if ($exitCode -eq 0) {
Write-Host "Configuration dumped successfully to: $OutputFile" -ForegroundColor Green
} else {
Write-Host "Error dumping configuration (code: $exitCode)" -ForegroundColor Red
}
if (Test-Path $outFile) {
$logContent = Get-Content $outFile -Raw -ErrorAction SilentlyContinue
if ($logContent) {
Write-Host "--- Log ---"
Write-Host $logContent
Write-Host "--- End ---"
}
}
exit $exitCode
} finally {
if (Test-Path $tempDir) {
Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue
}
}
+6 -6
View File
@@ -37,7 +37,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\db-dump-xml\scripts\db-dump-xml.ps1 <параметры> powershell.exe -NoProfile -File .claude/skills/db-dump-xml/scripts/db-dump-xml.ps1 <параметры>
``` ```
### Параметры скрипта ### Параметры скрипта
@@ -81,17 +81,17 @@ powershell.exe -NoProfile -File .claude\skills\db-dump-xml\scripts\db-dump-xml.p
```powershell ```powershell
# Полная выгрузка (файловая база) # Полная выгрузка (файловая база)
powershell.exe -NoProfile -File .claude\skills\db-dump-xml\scripts\db-dump-xml.ps1 -V8Path "C:\Program Files\1cv8\8.3.25.1257\bin" -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Mode Full powershell.exe -NoProfile -File .claude/skills/db-dump-xml/scripts/db-dump-xml.ps1 -V8Path "C:\Program Files\1cv8\8.3.25.1257\bin" -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Mode Full
# Инкрементальная выгрузка # Инкрементальная выгрузка
powershell.exe -NoProfile -File .claude\skills\db-dump-xml\scripts\db-dump-xml.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Mode Changes powershell.exe -NoProfile -File .claude/skills/db-dump-xml/scripts/db-dump-xml.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Mode Changes
# Частичная выгрузка # Частичная выгрузка
powershell.exe -NoProfile -File .claude\skills\db-dump-xml\scripts\db-dump-xml.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Mode Partial -Objects "Справочник.Номенклатура,Документ.Заказ" powershell.exe -NoProfile -File .claude/skills/db-dump-xml/scripts/db-dump-xml.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Mode Partial -Objects "Справочник.Номенклатура,Документ.Заказ"
# Серверная база # Серверная база
powershell.exe -NoProfile -File .claude\skills\db-dump-xml\scripts\db-dump-xml.ps1 -InfoBaseServer "srv01" -InfoBaseRef "MyApp_Dev" -UserName "Admin" -Password "secret" -ConfigDir "C:\WS\cfsrc" -Mode Full powershell.exe -NoProfile -File .claude/skills/db-dump-xml/scripts/db-dump-xml.ps1 -InfoBaseServer "srv01" -InfoBaseRef "MyApp_Dev" -UserName "Admin" -Password "secret" -ConfigDir "C:\WS\cfsrc" -Mode Full
# Выгрузка расширения # Выгрузка расширения
powershell.exe -NoProfile -File .claude\skills\db-dump-xml\scripts\db-dump-xml.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\ext_src" -Mode Full -Extension "МоёРасширение" powershell.exe -NoProfile -File .claude/skills/db-dump-xml/scripts/db-dump-xml.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\ext_src" -Mode Full -Extension "МоёРасширение"
``` ```
+19 -18
View File
@@ -35,22 +35,25 @@ allowed-tools:
## Команда ## Команда
```cmd ```powershell
"<v8path>\1cv8.exe" DESIGNER /F "<база>" /N"<user>" /P"<pwd>" /LoadCfg "<файл.cf>" /DisableStartupDialogs /Out "<лог>" powershell.exe -NoProfile -File .claude/skills/db-load-cf/scripts/db-load-cf.ps1 <параметры>
``` ```
Для серверной базы вместо `/F` используй `/S`: ### Параметры скрипта
```cmd
"<v8path>\1cv8.exe" DESIGNER /S "<server>/<ref>" /N"<user>" /P"<pwd>" /LoadCfg "<файл.cf>" /DisableStartupDialogs /Out "<лог>"
```
### Параметры | Параметр | Обязательный | Описание |
|----------|:------------:|----------|
| `-V8Path <путь>` | нет | Каталог bin платформы (или полный путь к 1cv8.exe) |
| `-InfoBasePath <путь>` | * | Файловая база |
| `-InfoBaseServer <сервер>` | * | Сервер 1С (для серверной базы) |
| `-InfoBaseRef <имя>` | * | Имя базы на сервере |
| `-UserName <имя>` | нет | Имя пользователя |
| `-Password <пароль>` | нет | Пароль |
| `-InputFile <путь>` | да | Путь к CF-файлу |
| `-Extension <имя>` | нет | Загрузить как расширение |
| `-AllExtensions` | нет | Загрузить все расширения из архива |
| Параметр | Описание | > `*` — нужен либо `-InfoBasePath`, либо пара `-InfoBaseServer` + `-InfoBaseRef`
|----------|----------|
| `/LoadCfg <файл>` | Путь к CF-файлу |
| `-Extension <имя>` | Загрузить как расширение |
| `-AllExtensions` | Загрузить все расширения из архива |
## Коды возврата ## Коды возврата
@@ -67,14 +70,12 @@ allowed-tools:
## Примеры ## Примеры
```powershell ```powershell
$v8 = Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort-Object -Descending | Select-Object -First 1
# Файловая база # Файловая база
& $v8.FullName DESIGNER /F "C:\Bases\MyDB" /N"Admin" /LoadCfg "C:\backup\config.cf" /DisableStartupDialogs /Out "load.log" powershell.exe -NoProfile -File .claude/skills/db-load-cf/scripts/db-load-cf.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -InputFile "C:\backup\config.cf"
# Серверная база # Серверная база
& $v8.FullName DESIGNER /S "srv01/MyApp_Test" /N"Admin" /P"secret" /LoadCfg "config.cf" /DisableStartupDialogs /Out "load.log" powershell.exe -NoProfile -File .claude/skills/db-load-cf/scripts/db-load-cf.ps1 -InfoBaseServer "srv01" -InfoBaseRef "MyApp_Test" -UserName "Admin" -Password "secret" -InputFile "config.cf"
# Не забудь обновить БД после загрузки! # Загрузка расширения
& $v8.FullName DESIGNER /F "C:\Bases\MyDB" /N"Admin" /UpdateDBCfg /DisableStartupDialogs /Out "update.log" powershell.exe -NoProfile -File .claude/skills/db-load-cf/scripts/db-load-cf.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -InputFile "ext.cfe" -Extension "МоёРасширение"
``` ```
@@ -0,0 +1,166 @@
# db-load-cf v1.0 — Load 1C configuration from CF file
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
<#
.SYNOPSIS
Загрузка конфигурации 1С из CF-файла
.DESCRIPTION
Загружает конфигурацию из бинарного CF-файла в информационную базу.
Поддерживает загрузку расширений.
.PARAMETER V8Path
Путь к каталогу bin платформы или к 1cv8.exe
.PARAMETER InfoBasePath
Путь к файловой информационной базе
.PARAMETER InfoBaseServer
Сервер 1С (для серверной базы)
.PARAMETER InfoBaseRef
Имя базы на сервере
.PARAMETER UserName
Имя пользователя 1С
.PARAMETER Password
Пароль пользователя
.PARAMETER InputFile
Путь к CF-файлу для загрузки
.PARAMETER Extension
Загрузить как расширение
.PARAMETER AllExtensions
Загрузить все расширения из архива
.EXAMPLE
.\db-load-cf.ps1 -InfoBasePath "C:\Bases\MyDB" -InputFile "config.cf"
.EXAMPLE
.\db-load-cf.ps1 -InfoBasePath "C:\Bases\MyDB" -InputFile "ext.cfe" -Extension "МоёРасширение"
#>
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[string]$V8Path,
[Parameter(Mandatory=$false)]
[string]$InfoBasePath,
[Parameter(Mandatory=$false)]
[string]$InfoBaseServer,
[Parameter(Mandatory=$false)]
[string]$InfoBaseRef,
[Parameter(Mandatory=$false)]
[string]$UserName,
[Parameter(Mandatory=$false)]
[string]$Password,
[Parameter(Mandatory=$true)]
[string]$InputFile,
[Parameter(Mandatory=$false)]
[string]$Extension,
[Parameter(Mandatory=$false)]
[switch]$AllExtensions
)
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# --- Resolve V8Path ---
if (-not $V8Path) {
$found = Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" -ErrorAction SilentlyContinue | Sort-Object FullName -Descending | Select-Object -First 1
if ($found) {
$V8Path = $found.FullName
} else {
Write-Host "Error: 1cv8.exe not found. Specify -V8Path" -ForegroundColor Red
exit 1
}
} elseif (Test-Path $V8Path -PathType Container) {
$V8Path = Join-Path $V8Path "1cv8.exe"
}
if (-not (Test-Path $V8Path)) {
Write-Host "Error: 1cv8.exe not found at $V8Path" -ForegroundColor Red
exit 1
}
# --- Validate connection ---
if (-not $InfoBasePath -and (-not $InfoBaseServer -or -not $InfoBaseRef)) {
Write-Host "Error: specify -InfoBasePath or -InfoBaseServer + -InfoBaseRef" -ForegroundColor Red
exit 1
}
# --- Validate input file ---
if (-not (Test-Path $InputFile)) {
Write-Host "Error: input file not found: $InputFile" -ForegroundColor Red
exit 1
}
# --- Temp dir ---
$tempDir = Join-Path $env:TEMP "db_load_cf_$(Get-Random)"
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
try {
# --- Build arguments ---
$arguments = @("DESIGNER")
if ($InfoBaseServer -and $InfoBaseRef) {
$arguments += "/S", "`"$InfoBaseServer/$InfoBaseRef`""
} else {
$arguments += "/F", "`"$InfoBasePath`""
}
if ($UserName) { $arguments += "/N`"$UserName`"" }
if ($Password) { $arguments += "/P`"$Password`"" }
$arguments += "/LoadCfg", "`"$InputFile`""
# --- Extensions ---
if ($Extension) {
$arguments += "-Extension", "`"$Extension`""
} elseif ($AllExtensions) {
$arguments += "-AllExtensions"
}
# --- Output ---
$outFile = Join-Path $tempDir "load_cf_log.txt"
$arguments += "/Out", "`"$outFile`""
$arguments += "/DisableStartupDialogs"
# --- Execute ---
Write-Host "Running: 1cv8.exe $($arguments -join ' ')"
$process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru
$exitCode = $process.ExitCode
# --- Result ---
if ($exitCode -eq 0) {
Write-Host "Configuration loaded successfully from: $InputFile" -ForegroundColor Green
} else {
Write-Host "Error loading configuration (code: $exitCode)" -ForegroundColor Red
}
if (Test-Path $outFile) {
$logContent = Get-Content $outFile -Raw -ErrorAction SilentlyContinue
if ($logContent) {
Write-Host "--- Log ---"
Write-Host $logContent
Write-Host "--- End ---"
}
}
exit $exitCode
} finally {
if (Test-Path $tempDir) {
Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue
}
}
+6 -6
View File
@@ -38,7 +38,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\db-load-git\scripts\db-load-git.ps1 <параметры> powershell.exe -NoProfile -File .claude/skills/db-load-git/scripts/db-load-git.ps1 <параметры>
``` ```
### Параметры скрипта ### Параметры скрипта
@@ -94,17 +94,17 @@ powershell.exe -NoProfile -File .claude\skills\db-load-git\scripts\db-load-git.p
```powershell ```powershell
# Загрузить все незафиксированные изменения (файловая база) # Загрузить все незафиксированные изменения (файловая база)
powershell.exe -NoProfile -File .claude\skills\db-load-git\scripts\db-load-git.ps1 -V8Path "C:\Program Files\1cv8\8.3.25.1257\bin" -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Source All powershell.exe -NoProfile -File .claude/skills/db-load-git/scripts/db-load-git.ps1 -V8Path "C:\Program Files\1cv8\8.3.25.1257\bin" -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Source All
# Только staged # Только staged
powershell.exe -NoProfile -File .claude\skills\db-load-git\scripts\db-load-git.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Source Staged powershell.exe -NoProfile -File .claude/skills/db-load-git/scripts/db-load-git.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Source Staged
# Серверная база # Серверная база
powershell.exe -NoProfile -File .claude\skills\db-load-git\scripts\db-load-git.ps1 -InfoBaseServer "srv01" -InfoBaseRef "MyApp_Dev" -UserName "Admin" -Password "secret" -ConfigDir "C:\WS\cfsrc" -Source All powershell.exe -NoProfile -File .claude/skills/db-load-git/scripts/db-load-git.ps1 -InfoBaseServer "srv01" -InfoBaseRef "MyApp_Dev" -UserName "Admin" -Password "secret" -ConfigDir "C:\WS\cfsrc" -Source All
# Из диапазона коммитов # Из диапазона коммитов
powershell.exe -NoProfile -File .claude\skills\db-load-git\scripts\db-load-git.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Source Commit -CommitRange "HEAD~3..HEAD" powershell.exe -NoProfile -File .claude/skills/db-load-git/scripts/db-load-git.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Source Commit -CommitRange "HEAD~3..HEAD"
# Только посмотреть (DryRun) # Только посмотреть (DryRun)
powershell.exe -NoProfile -File .claude\skills\db-load-git\scripts\db-load-git.ps1 -InfoBasePath "C:\Bases\MyDB" -ConfigDir "C:\WS\cfsrc" -DryRun powershell.exe -NoProfile -File .claude/skills/db-load-git/scripts/db-load-git.ps1 -InfoBasePath "C:\Bases\MyDB" -ConfigDir "C:\WS\cfsrc" -DryRun
``` ```
+4 -4
View File
@@ -38,7 +38,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\db-load-xml\scripts\db-load-xml.ps1 <параметры> powershell.exe -NoProfile -File .claude/skills/db-load-xml/scripts/db-load-xml.ps1 <параметры>
``` ```
### Параметры скрипта ### Параметры скрипта
@@ -95,11 +95,11 @@ Documents/Заказ/Forms/ФормаДокумента.xml
```powershell ```powershell
# Полная загрузка # Полная загрузка
powershell.exe -NoProfile -File .claude\skills\db-load-xml\scripts\db-load-xml.ps1 -V8Path "C:\Program Files\1cv8\8.3.25.1257\bin" -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Mode Full powershell.exe -NoProfile -File .claude/skills/db-load-xml/scripts/db-load-xml.ps1 -V8Path "C:\Program Files\1cv8\8.3.25.1257\bin" -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Mode Full
# Частичная загрузка конкретных файлов # Частичная загрузка конкретных файлов
powershell.exe -NoProfile -File .claude\skills\db-load-xml\scripts\db-load-xml.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Mode Partial -Files "Catalogs/Номенклатура.xml,Catalogs/Номенклатура/Ext/ObjectModule.bsl" powershell.exe -NoProfile -File .claude/skills/db-load-xml/scripts/db-load-xml.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\cfsrc" -Mode Partial -Files "Catalogs/Номенклатура.xml,Catalogs/Номенклатура/Ext/ObjectModule.bsl"
# Загрузка расширения # Загрузка расширения
powershell.exe -NoProfile -File .claude\skills\db-load-xml\scripts\db-load-xml.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\ext_src" -Mode Full -Extension "МоёРасширение" powershell.exe -NoProfile -File .claude/skills/db-load-xml/scripts/db-load-xml.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -ConfigDir "C:\WS\ext_src" -Mode Full -Extension "МоёРасширение"
``` ```
+22 -29
View File
@@ -35,49 +35,42 @@ allowed-tools:
## Команда ## Команда
```cmd ```powershell
"<v8path>\1cv8.exe" ENTERPRISE /F "<база>" /N"<user>" /P"<pwd>" /DisableStartupDialogs powershell.exe -NoProfile -File .claude/skills/db-run/scripts/db-run.ps1 <параметры>
``` ```
Для серверной базы вместо `/F` используй `/S`: ### Параметры скрипта
```cmd
"<v8path>\1cv8.exe" ENTERPRISE /S "<server>/<ref>" /N"<user>" /P"<pwd>" /DisableStartupDialogs
```
### Параметры | Параметр | Обязательный | Описание |
|----------|:------------:|----------|
| `-V8Path <путь>` | нет | Каталог bin платформы (или полный путь к 1cv8.exe) |
| `-InfoBasePath <путь>` | * | Файловая база |
| `-InfoBaseServer <сервер>` | * | Сервер 1С (для серверной базы) |
| `-InfoBaseRef <имя>` | * | Имя базы на сервере |
| `-UserName <имя>` | нет | Имя пользователя |
| `-Password <пароль>` | нет | Пароль |
| `-Execute <файл.epf>` | нет | Запуск внешней обработки сразу после старта |
| `-CParam <строка>` | нет | Параметр запуска (/C) |
| `-URL <ссылка>` | нет | Навигационная ссылка (формат `e1cib/...`) |
| Параметр | Описание | > `*` — нужен либо `-InfoBasePath`, либо пара `-InfoBaseServer` + `-InfoBaseRef`
|----------|----------|
| `/Execute <файл.epf>` | Запуск внешней обработки сразу после старта |
| `/C <строка>` | Передача параметра в прикладное решение |
| `/URL <ссылка>` | Навигационная ссылка (формат `e1cib/...`) |
> При указании `/Execute` параметр `/URL` игнорируется.
## Важно ## Важно
**Запуск в фоне** — не жди завершения процесса 1С. Используй `Start-Process` без `-Wait`: Скрипт запускает 1С в фоне (`Start-Process` без `-Wait`) — управление возвращается сразу.
```powershell
Start-Process -FilePath "<v8path>\1cv8.exe" -ArgumentList 'ENTERPRISE /F "<база>" /N"<user>" /P"<pwd>" /DisableStartupDialogs'
```
Или через Bash:
```bash
"<v8path>/1cv8.exe" ENTERPRISE /F "<база>" /N"<user>" /P"<pwd>" /DisableStartupDialogs &
```
## Примеры ## Примеры
```powershell ```powershell
$v8 = Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort-Object -Descending | Select-Object -First 1
# Простой запуск # Простой запуск
Start-Process -FilePath $v8.FullName -ArgumentList 'ENTERPRISE /F "C:\Bases\MyDB" /N"Admin" /P"" /DisableStartupDialogs' powershell.exe -NoProfile -File .claude/skills/db-run/scripts/db-run.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin"
# Запуск с обработкой # Запуск с обработкой
Start-Process -FilePath $v8.FullName -ArgumentList 'ENTERPRISE /F "C:\Bases\MyDB" /N"Admin" /P"" /Execute "C:\epf\МояОбработка.epf" /DisableStartupDialogs' powershell.exe -NoProfile -File .claude/skills/db-run/scripts/db-run.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -Execute "C:\epf\МояОбработка.epf"
# Открыть по навигационной ссылке # Открыть по навигационной ссылке
Start-Process -FilePath $v8.FullName -ArgumentList 'ENTERPRISE /F "C:\Bases\MyDB" /N"Admin" /P"" /URL "e1cib/data/Справочник.Номенклатура" /DisableStartupDialogs' powershell.exe -NoProfile -File .claude/skills/db-run/scripts/db-run.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -URL "e1cib/data/Справочник.Номенклатура"
# Серверная база с параметром запуска
powershell.exe -NoProfile -File .claude/skills/db-run/scripts/db-run.ps1 -InfoBaseServer "srv01" -InfoBaseRef "MyDB" -UserName "Admin" -Password "secret" -CParam "ЗапуститьОбновление"
``` ```
+136
View File
@@ -0,0 +1,136 @@
# db-run v1.0 — Launch 1C:Enterprise
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
<#
.SYNOPSIS
Запуск 1С:Предприятие
.DESCRIPTION
Запускает информационную базу в режиме 1С:Предприятие (пользовательский режим).
Запуск в фоне — не ждёт завершения процесса.
.PARAMETER V8Path
Путь к каталогу bin платформы или к 1cv8.exe
.PARAMETER InfoBasePath
Путь к файловой информационной базе
.PARAMETER InfoBaseServer
Сервер 1С (для серверной базы)
.PARAMETER InfoBaseRef
Имя базы на сервере
.PARAMETER UserName
Имя пользователя 1С
.PARAMETER Password
Пароль пользователя
.PARAMETER Execute
Путь к внешней обработке для запуска
.PARAMETER CParam
Параметр запуска (/C)
.PARAMETER URL
Навигационная ссылка (e1cib/...)
.EXAMPLE
.\db-run.ps1 -InfoBasePath "C:\Bases\MyDB"
.EXAMPLE
.\db-run.ps1 -InfoBasePath "C:\Bases\MyDB" -Execute "C:\epf\МояОбработка.epf"
.EXAMPLE
.\db-run.ps1 -InfoBasePath "C:\Bases\MyDB" -CParam "ЗапуститьОбновление"
#>
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[string]$V8Path,
[Parameter(Mandatory=$false)]
[string]$InfoBasePath,
[Parameter(Mandatory=$false)]
[string]$InfoBaseServer,
[Parameter(Mandatory=$false)]
[string]$InfoBaseRef,
[Parameter(Mandatory=$false)]
[string]$UserName,
[Parameter(Mandatory=$false)]
[string]$Password,
[Parameter(Mandatory=$false)]
[string]$Execute,
[Parameter(Mandatory=$false)]
[string]$CParam,
[Parameter(Mandatory=$false)]
[string]$URL
)
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# --- Resolve V8Path ---
if (-not $V8Path) {
$found = Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" -ErrorAction SilentlyContinue | Sort-Object FullName -Descending | Select-Object -First 1
if ($found) {
$V8Path = $found.FullName
} else {
Write-Host "Error: 1cv8.exe not found. Specify -V8Path" -ForegroundColor Red
exit 1
}
} elseif (Test-Path $V8Path -PathType Container) {
$V8Path = Join-Path $V8Path "1cv8.exe"
}
if (-not (Test-Path $V8Path)) {
Write-Host "Error: 1cv8.exe not found at $V8Path" -ForegroundColor Red
exit 1
}
# --- Validate connection ---
if (-not $InfoBasePath -and (-not $InfoBaseServer -or -not $InfoBaseRef)) {
Write-Host "Error: specify -InfoBasePath or -InfoBaseServer + -InfoBaseRef" -ForegroundColor Red
exit 1
}
# --- Build arguments as single string ---
# Note: Start-Process without -NoNewWindow uses ShellExecute.
# Passing ArgumentList as array can corrupt Cyrillic when ShellExecute
# re-joins elements. Single string avoids this.
$argString = "ENTERPRISE"
if ($InfoBaseServer -and $InfoBaseRef) {
$argString += " /S `"$InfoBaseServer/$InfoBaseRef`""
} else {
$argString += " /F `"$InfoBasePath`""
}
if ($UserName) { $argString += " /N`"$UserName`"" }
if ($Password) { $argString += " /P`"$Password`"" }
# --- Optional params ---
if ($Execute) {
$argString += " /Execute `"$Execute`""
}
if ($CParam) {
$argString += " /C `"$CParam`""
}
if ($URL) {
$argString += " /URL `"$URL`""
}
$argString += " /DisableStartupDialogs"
# --- Execute (background, no wait) ---
Write-Host "Running: 1cv8.exe $argString"
Start-Process -FilePath $V8Path -ArgumentList $argString
Write-Host "1C:Enterprise launched" -ForegroundColor Green
+24 -22
View File
@@ -34,26 +34,27 @@ allowed-tools:
## Команда ## Команда
```cmd ```powershell
"<v8path>\1cv8.exe" DESIGNER /F "<база>" /N"<user>" /P"<pwd>" /UpdateDBCfg /DisableStartupDialogs /Out "<лог>" powershell.exe -NoProfile -File .claude/skills/db-update/scripts/db-update.ps1 <параметры>
``` ```
Для серверной базы вместо `/F` используй `/S`: ### Параметры скрипта
```cmd
"<v8path>\1cv8.exe" DESIGNER /S "<server>/<ref>" /N"<user>" /P"<pwd>" /UpdateDBCfg /DisableStartupDialogs /Out "<лог>"
```
### Параметры | Параметр | Обязательный | Описание |
|----------|:------------:|----------|
| `-V8Path <путь>` | нет | Каталог bin платформы (или полный путь к 1cv8.exe) |
| `-InfoBasePath <путь>` | * | Файловая база |
| `-InfoBaseServer <сервер>` | * | Сервер 1С (для серверной базы) |
| `-InfoBaseRef <имя>` | * | Имя базы на сервере |
| `-UserName <имя>` | нет | Имя пользователя |
| `-Password <пароль>` | нет | Пароль |
| `-Extension <имя>` | нет | Обновить расширение |
| `-AllExtensions` | нет | Обновить все расширения |
| `-Dynamic <+/->` | нет | `+` — динамическое обновление, `-` — отключить |
| `-Server` | нет | Обновление на стороне сервера |
| `-WarningsAsErrors` | нет | Предупреждения считать ошибками |
| Параметр | Описание | > `*` — нужен либо `-InfoBasePath`, либо пара `-InfoBaseServer` + `-InfoBaseRef`
|----------|----------|
| `/UpdateDBCfg` | Обновить конфигурацию БД |
| `-Dynamic+` | Динамическое обновление (без монопольного доступа) |
| `-Dynamic-` | Отключить динамическое обновление |
| `-Server` | Обновление на стороне сервера |
| `-WarningsAsErrors` | Предупреждения считать ошибками |
| `-Extension <имя>` | Обновить расширение |
| `-AllExtensions` | Обновить все расширения |
### Фоновое обновление (серверная база) ### Фоновое обновление (серверная база)
@@ -78,14 +79,15 @@ allowed-tools:
- Для серверных баз рекомендуется `-Dynamic+` для обновления без остановки - Для серверных баз рекомендуется `-Dynamic+` для обновления без остановки
- Если структура данных существенно изменилась (удаление реквизитов, изменение типов) — динамическое обновление может быть невозможно - Если структура данных существенно изменилась (удаление реквизитов, изменение типов) — динамическое обновление может быть невозможно
## Пример ## Примеры
```powershell ```powershell
$v8 = Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort-Object -Descending | Select-Object -First 1 # Обычное обновление (файловая база)
powershell.exe -NoProfile -File .claude/skills/db-update/scripts/db-update.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin"
# Обычное обновление # Динамическое обновление (серверная база)
& $v8.FullName DESIGNER /F "C:\Bases\MyDB" /N"Admin" /P"" /UpdateDBCfg /DisableStartupDialogs /Out "update.log" powershell.exe -NoProfile -File .claude/skills/db-update/scripts/db-update.ps1 -InfoBaseServer "srv01" -InfoBaseRef "MyDB" -UserName "Admin" -Password "secret" -Dynamic "+"
# Динамическое обновление # Обновление расширения
& $v8.FullName DESIGNER /S "srv01/MyDB" /N"Admin" /P"secret" /UpdateDBCfg -Dynamic+ /DisableStartupDialogs /Out "update.log" powershell.exe -NoProfile -File .claude/skills/db-update/scripts/db-update.ps1 -InfoBasePath "C:\Bases\MyDB" -UserName "Admin" -Extension "МоёРасширение"
``` ```
@@ -0,0 +1,184 @@
# db-update v1.0 — Update 1C database configuration
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
<#
.SYNOPSIS
Обновление конфигурации базы данных 1С
.DESCRIPTION
Применяет изменения основной конфигурации к конфигурации базы данных.
Поддерживает динамическое обновление, обновление расширений.
.PARAMETER V8Path
Путь к каталогу bin платформы или к 1cv8.exe
.PARAMETER InfoBasePath
Путь к файловой информационной базе
.PARAMETER InfoBaseServer
Сервер 1С (для серверной базы)
.PARAMETER InfoBaseRef
Имя базы на сервере
.PARAMETER UserName
Имя пользователя 1С
.PARAMETER Password
Пароль пользователя
.PARAMETER Extension
Имя расширения для обновления
.PARAMETER AllExtensions
Обновить все расширения
.PARAMETER Dynamic
Динамическое обновление: "+" включить, "-" отключить
.PARAMETER Server
Обновление на стороне сервера
.PARAMETER WarningsAsErrors
Предупреждения считать ошибками
.EXAMPLE
.\db-update.ps1 -InfoBasePath "C:\Bases\MyDB"
.EXAMPLE
.\db-update.ps1 -InfoBasePath "C:\Bases\MyDB" -Dynamic "+" -Extension "МоёРасширение"
#>
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[string]$V8Path,
[Parameter(Mandatory=$false)]
[string]$InfoBasePath,
[Parameter(Mandatory=$false)]
[string]$InfoBaseServer,
[Parameter(Mandatory=$false)]
[string]$InfoBaseRef,
[Parameter(Mandatory=$false)]
[string]$UserName,
[Parameter(Mandatory=$false)]
[string]$Password,
[Parameter(Mandatory=$false)]
[string]$Extension,
[Parameter(Mandatory=$false)]
[switch]$AllExtensions,
[Parameter(Mandatory=$false)]
[ValidateSet("+", "-")]
[string]$Dynamic,
[Parameter(Mandatory=$false)]
[switch]$Server,
[Parameter(Mandatory=$false)]
[switch]$WarningsAsErrors
)
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# --- Resolve V8Path ---
if (-not $V8Path) {
$found = Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" -ErrorAction SilentlyContinue | Sort-Object FullName -Descending | Select-Object -First 1
if ($found) {
$V8Path = $found.FullName
} else {
Write-Host "Error: 1cv8.exe not found. Specify -V8Path" -ForegroundColor Red
exit 1
}
} elseif (Test-Path $V8Path -PathType Container) {
$V8Path = Join-Path $V8Path "1cv8.exe"
}
if (-not (Test-Path $V8Path)) {
Write-Host "Error: 1cv8.exe not found at $V8Path" -ForegroundColor Red
exit 1
}
# --- Validate connection ---
if (-not $InfoBasePath -and (-not $InfoBaseServer -or -not $InfoBaseRef)) {
Write-Host "Error: specify -InfoBasePath or -InfoBaseServer + -InfoBaseRef" -ForegroundColor Red
exit 1
}
# --- Temp dir ---
$tempDir = Join-Path $env:TEMP "db_update_$(Get-Random)"
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
try {
# --- Build arguments ---
$arguments = @("DESIGNER")
if ($InfoBaseServer -and $InfoBaseRef) {
$arguments += "/S", "`"$InfoBaseServer/$InfoBaseRef`""
} else {
$arguments += "/F", "`"$InfoBasePath`""
}
if ($UserName) { $arguments += "/N`"$UserName`"" }
if ($Password) { $arguments += "/P`"$Password`"" }
$arguments += "/UpdateDBCfg"
# --- Options ---
if ($Dynamic) {
$arguments += "-Dynamic$Dynamic"
}
if ($Server) {
$arguments += "-Server"
}
if ($WarningsAsErrors) {
$arguments += "-WarningsAsErrors"
}
# --- Extensions ---
if ($Extension) {
$arguments += "-Extension", "`"$Extension`""
} elseif ($AllExtensions) {
$arguments += "-AllExtensions"
}
# --- Output ---
$outFile = Join-Path $tempDir "update_log.txt"
$arguments += "/Out", "`"$outFile`""
$arguments += "/DisableStartupDialogs"
# --- Execute ---
Write-Host "Running: 1cv8.exe $($arguments -join ' ')"
$process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru
$exitCode = $process.ExitCode
# --- Result ---
if ($exitCode -eq 0) {
Write-Host "Database configuration updated successfully" -ForegroundColor Green
} else {
Write-Host "Error updating database configuration (code: $exitCode)" -ForegroundColor Red
}
if (Test-Path $outFile) {
$logContent = Get-Content $outFile -Raw -ErrorAction SilentlyContinue
if ($logContent) {
Write-Host "--- Log ---"
Write-Host $logContent
Write-Host "--- End ---"
}
}
exit $exitCode
} finally {
if (Test-Path $tempDir) {
Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue
}
}
+1 -1
View File
@@ -32,7 +32,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
pwsh -NoProfile -File .claude/skills/epf-add-form/scripts/add-form.ps1 -ProcessorName "<ProcessorName>" -FormName "<FormName>" [-Synonym "<Synonym>"] [-Main] [-SrcDir "<SrcDir>"] powershell.exe -NoProfile -File .claude/skills/epf-add-form/scripts/add-form.ps1 -ProcessorName "<ProcessorName>" -FormName "<FormName>" [-Synonym "<Synonym>"] [-Main] [-SrcDir "<SrcDir>"]
``` ```
## Что создаётся ## Что создаётся
+22 -18
View File
@@ -36,21 +36,26 @@ allowed-tools:
Если `v8path` не задан — автоопределение: `Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort -Desc | Select -First 1` Если `v8path` не задан — автоопределение: `Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort -Desc | Select -First 1`
Если использованная база не зарегистрирована — после выполнения предложи добавить через `/db-list add`. Если использованная база не зарегистрирована — после выполнения предложи добавить через `/db-list add`.
## Команды ## Команда
### 1. Создать ИБ для сборки (если нет зарегистрированной базы) ```powershell
powershell.exe -NoProfile -File .claude/skills/epf-build/scripts/epf-build.ps1 <параметры>
```cmd
"<v8path>\1cv8.exe" CREATEINFOBASE File="./base"
``` ```
### 2. Сборка EPF из XML ### Параметры скрипта
Файловая база: | Параметр | Обязательный | Описание |
```cmd |----------|:------------:|----------|
"<v8path>\1cv8.exe" DESIGNER /F "<база>" /DisableStartupDialogs /LoadExternalDataProcessorOrReportFromFiles "<SrcDir>\<ProcessorName>.xml" "<OutDir>\<ProcessorName>.epf" /Out "<OutDir>\build.log" | `-V8Path <путь>` | нет | Каталог bin платформы (или полный путь к 1cv8.exe) |
``` | `-InfoBasePath <путь>` | * | Файловая база |
Серверная база — вместо `/F` используй `/S`, добавь `/N"<user>" /P"<pwd>"` при наличии учётных данных. | `-InfoBaseServer <сервер>` | * | Сервер 1С (для серверной базы) |
| `-InfoBaseRef <имя>` | * | Имя базы на сервере |
| `-UserName <имя>` | нет | Имя пользователя |
| `-Password <пароль>` | нет | Пароль |
| `-SourceFile <путь>` | да | Путь к корневому XML-файлу исходников |
| `-OutputFile <путь>` | да | Путь к выходному EPF/ERF-файлу |
> `*` — нужен либо `-InfoBasePath`, либо пара `-InfoBaseServer` + `-InfoBaseRef`
## Коды возврата ## Коды возврата
@@ -63,13 +68,12 @@ allowed-tools:
Если обработка использует ссылочные типы конфигурации (`CatalogRef.XXX`, `DocumentRef.XXX`) — сборка в пустой базе упадёт с ошибкой XDTO. Зарегистрируй базу с целевой конфигурацией через `/db-list add`. Если обработка использует ссылочные типы конфигурации (`CatalogRef.XXX`, `DocumentRef.XXX`) — сборка в пустой базе упадёт с ошибкой XDTO. Зарегистрируй базу с целевой конфигурацией через `/db-list add`.
## Пример полного цикла ## Примеры
```powershell ```powershell
# Параметры из .v8-project.json: # Сборка обработки (файловая база)
$v8path = "C:\Program Files\1cv8\8.3.25.1257\bin" # v8path powershell.exe -NoProfile -File .claude/skills/epf-build/scripts/epf-build.ps1 -InfoBasePath "C:\Bases\MyDB" -SourceFile "src\МояОбработка.xml" -OutputFile "build\МояОбработка.epf"
$base = "C:\Bases\MyDB" # databases[].path
# Собрать (база с конфигурацией — ссылочные типы резолвятся) # Серверная база
& "$v8path\1cv8.exe" DESIGNER /F $base /DisableStartupDialogs /LoadExternalDataProcessorOrReportFromFiles "src\МояОбработка.xml" "build\МояОбработка.epf" /Out "build\build.log" powershell.exe -NoProfile -File .claude/skills/epf-build/scripts/epf-build.ps1 -InfoBaseServer "srv01" -InfoBaseRef "MyDB" -UserName "Admin" -Password "secret" -SourceFile "src\МояОбработка.xml" -OutputFile "build\МояОбработка.epf"
``` ```
@@ -0,0 +1,159 @@
# epf-build v1.0 — Build external data processor or report (EPF/ERF) from XML sources
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
<#
.SYNOPSIS
Сборка внешней обработки/отчёта 1С из XML-исходников
.DESCRIPTION
Собирает EPF/ERF-файл из XML-исходников с помощью платформы 1С.
Общий скрипт для epf-build и erf-build.
.PARAMETER V8Path
Путь к каталогу bin платформы или к 1cv8.exe
.PARAMETER InfoBasePath
Путь к файловой информационной базе
.PARAMETER InfoBaseServer
Сервер 1С (для серверной базы)
.PARAMETER InfoBaseRef
Имя базы на сервере
.PARAMETER UserName
Имя пользователя 1С
.PARAMETER Password
Пароль пользователя
.PARAMETER SourceFile
Путь к корневому XML-файлу исходников
.PARAMETER OutputFile
Путь к выходному EPF/ERF-файлу
.EXAMPLE
.\epf-build.ps1 -InfoBasePath "C:\Bases\MyDB" -SourceFile "src\МояОбработка.xml" -OutputFile "build\МояОбработка.epf"
.EXAMPLE
.\epf-build.ps1 -InfoBasePath "C:\Bases\MyDB" -SourceFile "src\МойОтчёт.xml" -OutputFile "build\МойОтчёт.erf"
#>
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[string]$V8Path,
[Parameter(Mandatory=$false)]
[string]$InfoBasePath,
[Parameter(Mandatory=$false)]
[string]$InfoBaseServer,
[Parameter(Mandatory=$false)]
[string]$InfoBaseRef,
[Parameter(Mandatory=$false)]
[string]$UserName,
[Parameter(Mandatory=$false)]
[string]$Password,
[Parameter(Mandatory=$true)]
[string]$SourceFile,
[Parameter(Mandatory=$true)]
[string]$OutputFile
)
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# --- Resolve V8Path ---
if (-not $V8Path) {
$found = Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" -ErrorAction SilentlyContinue | Sort-Object FullName -Descending | Select-Object -First 1
if ($found) {
$V8Path = $found.FullName
} else {
Write-Host "Error: 1cv8.exe not found. Specify -V8Path" -ForegroundColor Red
exit 1
}
} elseif (Test-Path $V8Path -PathType Container) {
$V8Path = Join-Path $V8Path "1cv8.exe"
}
if (-not (Test-Path $V8Path)) {
Write-Host "Error: 1cv8.exe not found at $V8Path" -ForegroundColor Red
exit 1
}
# --- Validate connection ---
if (-not $InfoBasePath -and (-not $InfoBaseServer -or -not $InfoBaseRef)) {
Write-Host "Error: specify -InfoBasePath or -InfoBaseServer + -InfoBaseRef" -ForegroundColor Red
exit 1
}
# --- Validate source file ---
if (-not (Test-Path $SourceFile)) {
Write-Host "Error: source file not found: $SourceFile" -ForegroundColor Red
exit 1
}
# --- Ensure output directory exists ---
$outDir = Split-Path $OutputFile -Parent
if ($outDir -and -not (Test-Path $outDir)) {
New-Item -ItemType Directory -Path $outDir -Force | Out-Null
}
# --- Temp dir ---
$tempDir = Join-Path $env:TEMP "epf_build_$(Get-Random)"
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
try {
# --- Build arguments ---
$arguments = @("DESIGNER")
if ($InfoBaseServer -and $InfoBaseRef) {
$arguments += "/S", "`"$InfoBaseServer/$InfoBaseRef`""
} else {
$arguments += "/F", "`"$InfoBasePath`""
}
if ($UserName) { $arguments += "/N`"$UserName`"" }
if ($Password) { $arguments += "/P`"$Password`"" }
$arguments += "/LoadExternalDataProcessorOrReportFromFiles", "`"$SourceFile`"", "`"$OutputFile`""
# --- Output ---
$outFile = Join-Path $tempDir "build_log.txt"
$arguments += "/Out", "`"$outFile`""
$arguments += "/DisableStartupDialogs"
# --- Execute ---
Write-Host "Running: 1cv8.exe $($arguments -join ' ')"
$process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru
$exitCode = $process.ExitCode
# --- Result ---
if ($exitCode -eq 0) {
Write-Host "Build completed successfully: $OutputFile" -ForegroundColor Green
} else {
Write-Host "Error building (code: $exitCode)" -ForegroundColor Red
}
if (Test-Path $outFile) {
$logContent = Get-Content $outFile -Raw -ErrorAction SilentlyContinue
if ($logContent) {
Write-Host "--- Log ---"
Write-Host $logContent
Write-Host "--- End ---"
}
}
exit $exitCode
} finally {
if (Test-Path $tempDir) {
Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue
}
}
+23 -18
View File
@@ -35,21 +35,27 @@ allowed-tools:
Если `v8path` не задан — автоопределение: `Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort -Desc | Select -First 1` Если `v8path` не задан — автоопределение: `Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort -Desc | Select -First 1`
Если использованная база не зарегистрирована — после выполнения предложи добавить через `/db-list add`. Если использованная база не зарегистрирована — после выполнения предложи добавить через `/db-list add`.
## Команды ## Команда
### 1. Создать ИБ (если нет зарегистрированной базы) ```powershell
powershell.exe -NoProfile -File .claude/skills/epf-dump/scripts/epf-dump.ps1 <параметры>
```cmd
"<v8path>\1cv8.exe" CREATEINFOBASE File="./base"
``` ```
### 2. Разборка EPF в XML ### Параметры скрипта
Файловая база: | Параметр | Обязательный | Описание |
```cmd |----------|:------------:|----------|
"<v8path>\1cv8.exe" DESIGNER /F "<база>" /DisableStartupDialogs /DumpExternalDataProcessorOrReportToFiles "<OutDir>" "<EpfFile>" -Format Hierarchical /Out "<OutDir>\dump.log" | `-V8Path <путь>` | нет | Каталог bin платформы (или полный путь к 1cv8.exe) |
``` | `-InfoBasePath <путь>` | * | Файловая база |
Серверная база — вместо `/F` используй `/S`, добавь `/N"<user>" /P"<pwd>"` при наличии учётных данных. | `-InfoBaseServer <сервер>` | * | Сервер 1С (для серверной базы) |
| `-InfoBaseRef <имя>` | * | Имя базы на сервере |
| `-UserName <имя>` | нет | Имя пользователя |
| `-Password <пароль>` | нет | Пароль |
| `-InputFile <путь>` | да | Путь к EPF/ERF-файлу |
| `-OutputDir <путь>` | да | Каталог для выгрузки исходников |
| `-Format <формат>` | нет | `Hierarchical` (по умолч.) / `Plain` |
> `*` — нужен либо `-InfoBasePath`, либо пара `-InfoBaseServer` + `-InfoBaseRef`
## Коды возврата ## Коды возврата
@@ -82,13 +88,12 @@ allowed-tools:
└── Template.<ext> └── Template.<ext>
``` ```
## Пример полного цикла ## Примеры
```powershell ```powershell
# Параметры из .v8-project.json: # Разборка обработки (файловая база)
$v8path = "C:\Program Files\1cv8\8.3.25.1257\bin" # v8path powershell.exe -NoProfile -File .claude/skills/epf-dump/scripts/epf-dump.ps1 -InfoBasePath "C:\Bases\MyDB" -InputFile "build\МояОбработка.epf" -OutputDir "src"
$base = "C:\Bases\MyDB" # databases[].path
# Разобрать # Серверная база
& "$v8path\1cv8.exe" DESIGNER /F $base /DisableStartupDialogs /DumpExternalDataProcessorOrReportToFiles "src" "build\МояОбработка.epf" -Format Hierarchical /Out "build\dump.log" powershell.exe -NoProfile -File .claude/skills/epf-dump/scripts/epf-dump.ps1 -InfoBaseServer "srv01" -InfoBaseRef "MyDB" -UserName "Admin" -Password "secret" -InputFile "build\МояОбработка.epf" -OutputDir "src"
``` ```
@@ -0,0 +1,166 @@
# epf-dump v1.0 — Dump external data processor or report (EPF/ERF) to XML sources
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
<#
.SYNOPSIS
Разборка внешней обработки/отчёта 1С в XML-исходники
.DESCRIPTION
Разбирает EPF/ERF-файл во XML-исходники с помощью платформы 1С.
Общий скрипт для epf-dump и erf-dump.
.PARAMETER V8Path
Путь к каталогу bin платформы или к 1cv8.exe
.PARAMETER InfoBasePath
Путь к файловой информационной базе
.PARAMETER InfoBaseServer
Сервер 1С (для серверной базы)
.PARAMETER InfoBaseRef
Имя базы на сервере
.PARAMETER UserName
Имя пользователя 1С
.PARAMETER Password
Пароль пользователя
.PARAMETER InputFile
Путь к EPF/ERF-файлу
.PARAMETER OutputDir
Каталог для выгрузки исходников
.PARAMETER Format
Формат выгрузки: Hierarchical или Plain (по умолчанию Hierarchical)
.EXAMPLE
.\epf-dump.ps1 -InfoBasePath "C:\Bases\MyDB" -InputFile "build\МояОбработка.epf" -OutputDir "src"
.EXAMPLE
.\epf-dump.ps1 -InfoBasePath "C:\Bases\MyDB" -InputFile "build\МойОтчёт.erf" -OutputDir "src"
#>
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[string]$V8Path,
[Parameter(Mandatory=$false)]
[string]$InfoBasePath,
[Parameter(Mandatory=$false)]
[string]$InfoBaseServer,
[Parameter(Mandatory=$false)]
[string]$InfoBaseRef,
[Parameter(Mandatory=$false)]
[string]$UserName,
[Parameter(Mandatory=$false)]
[string]$Password,
[Parameter(Mandatory=$true)]
[string]$InputFile,
[Parameter(Mandatory=$true)]
[string]$OutputDir,
[Parameter(Mandatory=$false)]
[ValidateSet("Hierarchical", "Plain")]
[string]$Format = "Hierarchical"
)
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# --- Resolve V8Path ---
if (-not $V8Path) {
$found = Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" -ErrorAction SilentlyContinue | Sort-Object FullName -Descending | Select-Object -First 1
if ($found) {
$V8Path = $found.FullName
} else {
Write-Host "Error: 1cv8.exe not found. Specify -V8Path" -ForegroundColor Red
exit 1
}
} elseif (Test-Path $V8Path -PathType Container) {
$V8Path = Join-Path $V8Path "1cv8.exe"
}
if (-not (Test-Path $V8Path)) {
Write-Host "Error: 1cv8.exe not found at $V8Path" -ForegroundColor Red
exit 1
}
# --- Validate connection ---
if (-not $InfoBasePath -and (-not $InfoBaseServer -or -not $InfoBaseRef)) {
Write-Host "Error: specify -InfoBasePath or -InfoBaseServer + -InfoBaseRef" -ForegroundColor Red
exit 1
}
# --- Validate input file ---
if (-not (Test-Path $InputFile)) {
Write-Host "Error: input file not found: $InputFile" -ForegroundColor Red
exit 1
}
# --- Ensure output directory exists ---
if (-not (Test-Path $OutputDir)) {
New-Item -ItemType Directory -Path $OutputDir -Force | Out-Null
}
# --- Temp dir ---
$tempDir = Join-Path $env:TEMP "epf_dump_$(Get-Random)"
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
try {
# --- Build arguments ---
$arguments = @("DESIGNER")
if ($InfoBaseServer -and $InfoBaseRef) {
$arguments += "/S", "`"$InfoBaseServer/$InfoBaseRef`""
} else {
$arguments += "/F", "`"$InfoBasePath`""
}
if ($UserName) { $arguments += "/N`"$UserName`"" }
if ($Password) { $arguments += "/P`"$Password`"" }
$arguments += "/DumpExternalDataProcessorOrReportToFiles", "`"$OutputDir`"", "`"$InputFile`""
$arguments += "-Format", $Format
# --- Output ---
$outFile = Join-Path $tempDir "dump_log.txt"
$arguments += "/Out", "`"$outFile`""
$arguments += "/DisableStartupDialogs"
# --- Execute ---
Write-Host "Running: 1cv8.exe $($arguments -join ' ')"
$process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru
$exitCode = $process.ExitCode
# --- Result ---
if ($exitCode -eq 0) {
Write-Host "Dump completed successfully to: $OutputDir" -ForegroundColor Green
} else {
Write-Host "Error dumping (code: $exitCode)" -ForegroundColor Red
}
if (Test-Path $outFile) {
$logContent = Get-Content $outFile -Raw -ErrorAction SilentlyContinue
if ($logContent) {
Write-Host "--- Log ---"
Write-Host $logContent
Write-Host "--- End ---"
}
}
exit $exitCode
} finally {
if (Test-Path $tempDir) {
Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue
}
}
+1 -1
View File
@@ -30,7 +30,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
pwsh -NoProfile -File .claude/skills/epf-init/scripts/init.ps1 -Name "<Name>" [-Synonym "<Synonym>"] [-SrcDir "<SrcDir>"] powershell.exe -NoProfile -File .claude/skills/epf-init/scripts/init.ps1 -Name "<Name>" [-Synonym "<Synonym>"] [-SrcDir "<SrcDir>"]
``` ```
## Что создаётся ## Что создаётся
+1 -1
View File
@@ -33,7 +33,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\epf-validate\scripts\epf-validate.ps1 -ObjectPath "<путь>" powershell.exe -NoProfile -File .claude/skills/epf-validate/scripts/epf-validate.ps1 -ObjectPath "<путь>"
``` ```
## Выполняемые проверки ## Выполняемые проверки
+23 -17
View File
@@ -11,7 +11,7 @@ allowed-tools:
# /erf-build — Сборка отчёта # /erf-build — Сборка отчёта
Собирает ERF-файл из XML-исходников с помощью платформы 1С. Использует ту же команду CLI, что и `/epf-build`. Собирает ERF-файл из XML-исходников с помощью платформы 1С. Использует общий скрипт из `/epf-build`.
## Usage ## Usage
@@ -36,21 +36,28 @@ allowed-tools:
Если `v8path` не задан — автоопределение: `Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort -Desc | Select -First 1` Если `v8path` не задан — автоопределение: `Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort -Desc | Select -First 1`
Если использованная база не зарегистрирована — после выполнения предложи добавить через `/db-list add`. Если использованная база не зарегистрирована — после выполнения предложи добавить через `/db-list add`.
## Команды ## Команда
### 1. Создать ИБ для сборки (если нет зарегистрированной базы) Используй общий скрипт из epf-build:
```cmd ```powershell
"<v8path>\1cv8.exe" CREATEINFOBASE File="./base" powershell.exe -NoProfile -File .claude/skills/epf-build/scripts/epf-build.ps1 <параметры>
``` ```
### 2. Сборка ERF из XML ### Параметры скрипта
Файловая база: | Параметр | Обязательный | Описание |
```cmd |----------|:------------:|----------|
"<v8path>\1cv8.exe" DESIGNER /F "<база>" /DisableStartupDialogs /LoadExternalDataProcessorOrReportFromFiles "<SrcDir>\<ReportName>.xml" "<OutDir>\<ReportName>.erf" /Out "<OutDir>\build.log" | `-V8Path <путь>` | нет | Каталог bin платформы (или полный путь к 1cv8.exe) |
``` | `-InfoBasePath <путь>` | * | Файловая база |
Серверная база — вместо `/F` используй `/S`, добавь `/N"<user>" /P"<pwd>"` при наличии учётных данных. | `-InfoBaseServer <сервер>` | * | Сервер 1С (для серверной базы) |
| `-InfoBaseRef <имя>` | * | Имя базы на сервере |
| `-UserName <имя>` | нет | Имя пользователя |
| `-Password <пароль>` | нет | Пароль |
| `-SourceFile <путь>` | да | Путь к корневому XML-файлу исходников |
| `-OutputFile <путь>` | да | Путь к выходному ERF-файлу |
> `*` — нужен либо `-InfoBasePath`, либо пара `-InfoBaseServer` + `-InfoBaseRef`
## Коды возврата ## Коды возврата
@@ -63,13 +70,12 @@ allowed-tools:
Если отчёт использует ссылочные типы конфигурации (`CatalogRef.XXX`, `DocumentRef.XXX`) — сборка в пустой базе упадёт с ошибкой XDTO. Зарегистрируй базу с целевой конфигурацией через `/db-list add`. Если отчёт использует ссылочные типы конфигурации (`CatalogRef.XXX`, `DocumentRef.XXX`) — сборка в пустой базе упадёт с ошибкой XDTO. Зарегистрируй базу с целевой конфигурацией через `/db-list add`.
## Пример полного цикла ## Примеры
```powershell ```powershell
# Параметры из .v8-project.json: # Сборка отчёта (файловая база)
$v8path = "C:\Program Files\1cv8\8.3.25.1257\bin" # v8path powershell.exe -NoProfile -File .claude/skills/epf-build/scripts/epf-build.ps1 -InfoBasePath "C:\Bases\MyDB" -SourceFile "src\МойОтчёт.xml" -OutputFile "build\МойОтчёт.erf"
$base = "C:\Bases\MyDB" # databases[].path
# Собрать (база с конфигурацией — ссылочные типы резолвятся) # Серверная база
& "$v8path\1cv8.exe" DESIGNER /F $base /DisableStartupDialogs /LoadExternalDataProcessorOrReportFromFiles "src\МойОтчёт.xml" "build\МойОтчёт.erf" /Out "build\build.log" powershell.exe -NoProfile -File .claude/skills/epf-build/scripts/epf-build.ps1 -InfoBaseServer "srv01" -InfoBaseRef "MyDB" -UserName "Admin" -Password "secret" -SourceFile "src\МойОтчёт.xml" -OutputFile "build\МойОтчёт.erf"
``` ```
+24 -17
View File
@@ -11,7 +11,7 @@ allowed-tools:
# /erf-dump — Разборка отчёта # /erf-dump — Разборка отчёта
Разбирает ERF-файл во XML-исходники с помощью платформы 1С (иерархический формат). Использует ту же команду CLI, что и `/epf-dump`. Разбирает ERF-файл во XML-исходники с помощью платформы 1С (иерархический формат). Использует общий скрипт из `/epf-dump`.
## Usage ## Usage
@@ -35,21 +35,29 @@ allowed-tools:
Если `v8path` не задан — автоопределение: `Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort -Desc | Select -First 1` Если `v8path` не задан — автоопределение: `Get-ChildItem "C:\Program Files\1cv8\*\bin\1cv8.exe" | Sort -Desc | Select -First 1`
Если использованная база не зарегистрирована — после выполнения предложи добавить через `/db-list add`. Если использованная база не зарегистрирована — после выполнения предложи добавить через `/db-list add`.
## Команды ## Команда
### 1. Создать ИБ (если нет зарегистрированной базы) Используй общий скрипт из epf-dump:
```cmd ```powershell
"<v8path>\1cv8.exe" CREATEINFOBASE File="./base" powershell.exe -NoProfile -File .claude/skills/epf-dump/scripts/epf-dump.ps1 <параметры>
``` ```
### 2. Разборка ERF в XML ### Параметры скрипта
Файловая база: | Параметр | Обязательный | Описание |
```cmd |----------|:------------:|----------|
"<v8path>\1cv8.exe" DESIGNER /F "<база>" /DisableStartupDialogs /DumpExternalDataProcessorOrReportToFiles "<OutDir>" "<ErfFile>" -Format Hierarchical /Out "<OutDir>\dump.log" | `-V8Path <путь>` | нет | Каталог bin платформы (или полный путь к 1cv8.exe) |
``` | `-InfoBasePath <путь>` | * | Файловая база |
Серверная база — вместо `/F` используй `/S`, добавь `/N"<user>" /P"<pwd>"` при наличии учётных данных. | `-InfoBaseServer <сервер>` | * | Сервер 1С (для серверной базы) |
| `-InfoBaseRef <имя>` | * | Имя базы на сервере |
| `-UserName <имя>` | нет | Имя пользователя |
| `-Password <пароль>` | нет | Пароль |
| `-InputFile <путь>` | да | Путь к ERF-файлу |
| `-OutputDir <путь>` | да | Каталог для выгрузки исходников |
| `-Format <формат>` | нет | `Hierarchical` (по умолч.) / `Plain` |
> `*` — нужен либо `-InfoBasePath`, либо пара `-InfoBaseServer` + `-InfoBaseRef`
## Коды возврата ## Коды возврата
@@ -82,13 +90,12 @@ allowed-tools:
└── Template.<ext> └── Template.<ext>
``` ```
## Пример полного цикла ## Примеры
```powershell ```powershell
# Параметры из .v8-project.json: # Разборка отчёта (файловая база)
$v8path = "C:\Program Files\1cv8\8.3.25.1257\bin" # v8path powershell.exe -NoProfile -File .claude/skills/epf-dump/scripts/epf-dump.ps1 -InfoBasePath "C:\Bases\MyDB" -InputFile "build\МойОтчёт.erf" -OutputDir "src"
$base = "C:\Bases\MyDB" # databases[].path
# Разобрать # Серверная база
& "$v8path\1cv8.exe" DESIGNER /F $base /DisableStartupDialogs /DumpExternalDataProcessorOrReportToFiles "src" "build\МойОтчёт.erf" -Format Hierarchical /Out "build\dump.log" powershell.exe -NoProfile -File .claude/skills/epf-dump/scripts/epf-dump.ps1 -InfoBaseServer "srv01" -InfoBaseRef "MyDB" -UserName "Admin" -Password "secret" -InputFile "build\МойОтчёт.erf" -OutputDir "src"
``` ```
+1 -1
View File
@@ -31,7 +31,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\erf-init\scripts\init.ps1 -Name "<Name>" [-Synonym "<Synonym>"] [-SrcDir "<SrcDir>"] [-WithSKD] powershell.exe -NoProfile -File .claude/skills/erf-init/scripts/init.ps1 -Name "<Name>" [-Synonym "<Synonym>"] [-SrcDir "<SrcDir>"] [-WithSKD]
``` ```
## Что создаётся ## Что создаётся
+1 -1
View File
@@ -33,7 +33,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\epf-validate\scripts\epf-validate.ps1 -ObjectPath "<путь>" powershell.exe -NoProfile -File .claude/skills/epf-validate/scripts/epf-validate.ps1 -ObjectPath "<путь>"
``` ```
## Выполняемые проверки ## Выполняемые проверки
+1 -1
View File
@@ -32,7 +32,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\form-add\scripts\form-add.ps1 -ObjectPath "<ObjectPath>" -FormName "<FormName>" [-Purpose "<Purpose>"] [-Synonym "<Synonym>"] [-SetDefault] powershell.exe -NoProfile -File .claude/skills/form-add/scripts/form-add.ps1 -ObjectPath "<ObjectPath>" -FormName "<FormName>" [-Purpose "<Purpose>"] [-Synonym "<Synonym>"] [-SetDefault]
``` ```
## Purpose — назначение формы ## Purpose — назначение формы
+1 -1
View File
@@ -31,7 +31,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\form-compile\scripts\form-compile.ps1 -JsonPath "<json>" -OutputPath "<xml>" powershell.exe -NoProfile -File .claude/skills/form-compile/scripts/form-compile.ps1 -JsonPath "<json>" -OutputPath "<xml>"
``` ```
## JSON DSL — справка ## JSON DSL — справка
+1 -1
View File
@@ -29,7 +29,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\form-edit\scripts\form-edit.ps1 -FormPath "<путь>" -JsonPath "<путь>" powershell.exe -NoProfile -File .claude/skills/form-edit/scripts/form-edit.ps1 -FormPath "<путь>" -JsonPath "<путь>"
``` ```
## JSON формат ## JSON формат
+2 -2
View File
@@ -29,12 +29,12 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\form-info\scripts\form-info.ps1 -FormPath "<путь к Form.xml>" powershell.exe -NoProfile -File .claude/skills/form-info/scripts/form-info.ps1 -FormPath "<путь к Form.xml>"
``` ```
С пагинацией: С пагинацией:
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\form-info\scripts\form-info.ps1 -FormPath "<путь>" -Offset 150 powershell.exe -NoProfile -File .claude/skills/form-info/scripts/form-info.ps1 -FormPath "<путь>" -Offset 150
``` ```
## Чтение вывода ## Чтение вывода
+1 -1
View File
@@ -31,7 +31,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\form-remove\scripts\remove-form.ps1 -ObjectName "<ObjectName>" -FormName "<FormName>" [-SrcDir "<SrcDir>"] powershell.exe -NoProfile -File .claude/skills/form-remove/scripts/remove-form.ps1 -ObjectName "<ObjectName>" -FormName "<FormName>" [-SrcDir "<SrcDir>"]
``` ```
## Что удаляется ## Что удаляется
+1 -1
View File
@@ -28,7 +28,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\form-validate\scripts\form-validate.ps1 -FormPath "<путь>" powershell.exe -NoProfile -File .claude/skills/form-validate/scripts/form-validate.ps1 -FormPath "<путь>"
``` ```
## Выполняемые проверки ## Выполняемые проверки
+1 -1
View File
@@ -30,7 +30,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\help-add\scripts\add-help.ps1 -ObjectName "<ObjectName>" [-Lang "<Lang>"] [-SrcDir "<SrcDir>"] powershell.exe -NoProfile -File .claude/skills/help-add/scripts/add-help.ps1 -ObjectName "<ObjectName>" [-Lang "<Lang>"] [-SrcDir "<SrcDir>"]
``` ```
## Что создаётся ## Что создаётся
+1 -1
View File
@@ -14,5 +14,5 @@ allowed-tools:
Операции: hide, show, place, order, subsystem-order, group-order. Подробнее: `.claude/skills/interface-edit/reference.md` Операции: hide, show, place, order, subsystem-order, group-order. Подробнее: `.claude/skills/interface-edit/reference.md`
```powershell ```powershell
powershell.exe -NoProfile -File '.claude\skills\interface-edit\scripts\interface-edit.ps1' -CIPath '<path>' -Operation hide -Value '<cmd>' powershell.exe -NoProfile -File '.claude/skills/interface-edit/scripts/interface-edit.ps1' -CIPath '<path>' -Operation hide -Value '<cmd>'
``` ```
+1 -1
View File
@@ -23,7 +23,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File '.claude\skills\interface-validate\scripts\interface-validate.ps1' -CIPath '<path>' powershell.exe -NoProfile -File '.claude/skills/interface-validate/scripts/interface-validate.ps1' -CIPath '<path>'
``` ```
## Проверки (13) ## Проверки (13)
+1 -1
View File
@@ -21,7 +21,7 @@ allowed-tools:
| `OutputDir` | Корневая директория выгрузки конфигурации (где `Catalogs/`, `Documents/` и т.д.) | | `OutputDir` | Корневая директория выгрузки конфигурации (где `Catalogs/`, `Documents/` и т.д.) |
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\meta-compile\scripts\meta-compile.ps1 -JsonPath "<json>" -OutputDir "<ConfigDir>" powershell.exe -NoProfile -File .claude/skills/meta-compile/scripts/meta-compile.ps1 -JsonPath "<json>" -OutputDir "<ConfigDir>"
``` ```
`OutputDir` — директория, содержащая подпапки типов (`Catalogs/`, `Documents/`, ...) и `Configuration.xml`. `OutputDir` — директория, содержащая подпапки типов (`Catalogs/`, `Documents/`, ...) и `Configuration.xml`.
+2 -2
View File
@@ -18,13 +18,13 @@ allowed-tools:
### Inline mode (простые операции) ### Inline mode (простые операции)
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\meta-edit\scripts\meta-edit.ps1 -ObjectPath "<path>" -Operation <op> -Value "<val>" powershell.exe -NoProfile -File .claude/skills/meta-edit/scripts/meta-edit.ps1 -ObjectPath "<path>" -Operation <op> -Value "<val>"
``` ```
### JSON mode (сложные/комбинированные) ### JSON mode (сложные/комбинированные)
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\meta-edit\scripts\meta-edit.ps1 -DefinitionFile "<json>" -ObjectPath "<path>" powershell.exe -NoProfile -File .claude/skills/meta-edit/scripts/meta-edit.ps1 -DefinitionFile "<json>" -ObjectPath "<path>"
``` ```
| Параметр | Описание | | Параметр | Описание |
+1 -1
View File
@@ -3,7 +3,7 @@
Для сложных и комбинированных операций используйте JSON-файл вместо inline-режима. Для сложных и комбинированных операций используйте JSON-файл вместо inline-режима.
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\meta-edit\scripts\meta-edit.ps1 -DefinitionFile "<json>" -ObjectPath "<path>" powershell.exe -NoProfile -File .claude/skills/meta-edit/scripts/meta-edit.ps1 -DefinitionFile "<json>" -ObjectPath "<path>"
``` ```
## add — добавить элементы ## add — добавить элементы
+1 -1
View File
@@ -23,7 +23,7 @@ allowed-tools:
| `OutFile` | Записать результат в файл (UTF-8 BOM) | | `OutFile` | Записать результат в файл (UTF-8 BOM) |
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\meta-info\scripts\meta-info.ps1 -ObjectPath "<путь>" powershell.exe -NoProfile -File .claude/skills/meta-info/scripts/meta-info.ps1 -ObjectPath "<путь>"
``` ```
## Три режима ## Три режима
+1 -1
View File
@@ -32,7 +32,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\meta-remove\scripts\meta-remove.ps1 -ConfigDir "<путь>" -Object "Catalog.Товары" powershell.exe -NoProfile -File .claude/skills/meta-remove/scripts/meta-remove.ps1 -ConfigDir "<путь>" -Object "Catalog.Товары"
``` ```
## Что делает ## Что делает
+1 -1
View File
@@ -31,7 +31,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\meta-validate\scripts\meta-validate.ps1 -ObjectPath "<путь>" powershell.exe -NoProfile -File .claude/skills/meta-validate/scripts/meta-validate.ps1 -ObjectPath "<путь>"
``` ```
## Поддерживаемые типы (23) ## Поддерживаемые типы (23)
+1 -1
View File
@@ -21,7 +21,7 @@ allowed-tools:
| `RolesDir` | Каталог `Roles/` в исходниках конфигурации | | `RolesDir` | Каталог `Roles/` в исходниках конфигурации |
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\role-compile\scripts\role-compile.ps1 -JsonPath "<json>" -OutputDir "<RolesDir>" powershell.exe -NoProfile -File .claude/skills/role-compile/scripts/role-compile.ps1 -JsonPath "<json>" -OutputDir "<RolesDir>"
``` ```
`<Role>ИмяРоли</Role>` автоматически добавляется в `<ChildObjects>` файла `Configuration.xml` (ожидается в parent от `RolesDir`). `<Role>ИмяРоли</Role>` автоматически добавляется в `<ChildObjects>` файла `Configuration.xml` (ожидается в parent от `RolesDir`).
+1 -1
View File
@@ -22,7 +22,7 @@ allowed-tools:
## Запуск скрипта ## Запуск скрипта
```powershell ```powershell
powershell.exe -File .claude\skills\role-info\scripts\role-info.ps1 -RightsPath <path> -OutFile <output.txt> powershell.exe -File .claude/skills/role-info/scripts/role-info.ps1 -RightsPath <path> -OutFile <output.txt>
``` ```
### Параметры ### Параметры
+1 -1
View File
@@ -20,7 +20,7 @@ allowed-tools:
## Запуск скрипта ## Запуск скрипта
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\role-validate\scripts\role-validate.ps1 -RightsPath <path> [-MetadataPath <path>] [-OutFile <output.txt>] powershell.exe -NoProfile -File .claude/skills/role-validate/scripts/role-validate.ps1 -RightsPath <path> [-MetadataPath <path>] [-OutFile <output.txt>]
``` ```
### Параметры ### Параметры
+8 -3
View File
@@ -1,7 +1,7 @@
--- ---
name: skd-compile name: skd-compile
description: Компиляция схемы компоновки данных 1С (СКД) из компактного JSON-определения. Используй когда нужно создать СКД с нуля description: Компиляция схемы компоновки данных 1С (СКД) из компактного JSON-определения. Используй когда нужно создать СКД с нуля
argument-hint: <JsonPath> <OutputPath> argument-hint: [-DefinitionFile <json> | -Value <json-string>] -OutputPath <Template.xml>
allowed-tools: allowed-tools:
- Bash - Bash
- Read - Read
@@ -17,11 +17,16 @@ allowed-tools:
| Параметр | Описание | | Параметр | Описание |
|----------|----------| |----------|----------|
| `JsonPath` | Путь к JSON-определению СКД | | `DefinitionFile` | Путь к JSON-файлу с определением СКД (взаимоисключающий с Value) |
| `Value` | JSON-строка с определением СКД (взаимоисключающий с DefinitionFile) |
| `OutputPath` | Путь к выходному Template.xml | | `OutputPath` | Путь к выходному Template.xml |
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\skd-compile\scripts\skd-compile.ps1 -JsonPath "<json>" -OutputPath "<Template.xml>" # Из файла
powershell.exe -NoProfile -File .claude/skills/skd-compile/scripts/skd-compile.ps1 -DefinitionFile "<json>" -OutputPath "<Template.xml>"
# Из строки (без промежуточного файла)
powershell.exe -NoProfile -File .claude/skills/skd-compile/scripts/skd-compile.ps1 -Value '<json-string>' -OutputPath "<Template.xml>"
``` ```
## JSON DSL — краткий справочник ## JSON DSL — краткий справочник
@@ -1,9 +1,8 @@
# skd-compile v1.0 — Compile 1C DCS from JSON # skd-compile v1.0 — Compile 1C DCS from JSON
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param( param(
[Parameter(Mandatory)] [string]$DefinitionFile,
[string]$JsonPath, [string]$Value,
[Parameter(Mandatory)] [Parameter(Mandatory)]
[string]$OutputPath [string]$OutputPath
) )
@@ -13,12 +12,28 @@ $ErrorActionPreference = "Stop"
# --- 1. Load and validate JSON --- # --- 1. Load and validate JSON ---
if (-not (Test-Path $JsonPath)) { if ($DefinitionFile -and $Value) {
Write-Error "File not found: $JsonPath" Write-Error "Cannot use both -DefinitionFile and -Value"
exit 1
}
if (-not $DefinitionFile -and -not $Value) {
Write-Error "Either -DefinitionFile or -Value is required"
exit 1 exit 1
} }
$json = Get-Content -Raw -Encoding UTF8 $JsonPath if ($DefinitionFile) {
if (-not [System.IO.Path]::IsPathRooted($DefinitionFile)) {
$DefinitionFile = Join-Path (Get-Location).Path $DefinitionFile
}
if (-not (Test-Path $DefinitionFile)) {
Write-Error "Definition file not found: $DefinitionFile"
exit 1
}
$json = Get-Content -Raw -Encoding UTF8 $DefinitionFile
} else {
$json = $Value
}
$def = $json | ConvertFrom-Json $def = $json | ConvertFrom-Json
if (-not $def.dataSets -or $def.dataSets.Count -eq 0) { if (-not $def.dataSets -or $def.dataSets.Count -eq 0) {
+2 -2
View File
@@ -1,6 +1,6 @@
--- ---
name: skd-edit name: skd-edit
description: Точечное редактирование схемы компоновки данных 1С (СКД). Используй когда нужно модифицировать существующую СКД — добавить поля, итоги, фильтры, параметры description: Точечное редактирование схемы компоновки данных 1С (СКД). Используй когда нужно модифицировать существующую СКД — добавить поля, итоги, фильтры, параметры, изменить текст запроса
argument-hint: <TemplatePath> -Operation <op> -Value <value> argument-hint: <TemplatePath> -Operation <op> -Value <value>
allowed-tools: allowed-tools:
- Bash - Bash
@@ -25,7 +25,7 @@ allowed-tools:
| `NoSelection` | (опц.) Не добавлять поле в selection варианта | | `NoSelection` | (опц.) Не добавлять поле в selection варианта |
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\skd-edit\scripts\skd-edit.ps1 -TemplatePath "<path>" -Operation <op> -Value "<value>" powershell.exe -NoProfile -File .claude/skills/skd-edit/scripts/skd-edit.ps1 -TemplatePath "<path>" -Operation <op> -Value "<value>"
``` ```
## Пакетный режим (batch) ## Пакетный режим (batch)
+4 -3
View File
@@ -1,7 +1,7 @@
--- ---
name: skd-info name: skd-info
description: Анализ структуры схемы компоновки данных 1С (СКД) — наборы, поля, параметры, варианты. Используй для понимания отчёта — источник данных (запрос), доступные поля, параметры description: Анализ структуры схемы компоновки данных 1С (СКД) — наборы, поля, параметры, варианты. Используй для понимания отчёта — источник данных (запрос), доступные поля, параметры
argument-hint: <TemplatePath> [-Mode overview|query|fields|links|calculated|resources|params|variant|templates|trace] [-Name <dataset|variant|field|group>] argument-hint: <TemplatePath> [-Mode overview|query|fields|links|calculated|resources|params|variant|templates|trace|full] [-Name <dataset|variant|field|group>]
allowed-tools: allowed-tools:
- Bash - Bash
- Read - Read
@@ -24,7 +24,7 @@ allowed-tools:
| `OutFile` | Записать результат в файл (UTF-8 BOM) | | `OutFile` | Записать результат в файл (UTF-8 BOM) |
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\skd-info\scripts\skd-info.ps1 -TemplatePath "<путь>" powershell.exe -NoProfile -File .claude/skills/skd-info/scripts/skd-info.ps1 -TemplatePath "<путь>"
``` ```
С указанием режима: С указанием режима:
@@ -54,8 +54,9 @@ powershell.exe -NoProfile -File .claude\skills\skd-info\scripts\skd-info.ps1 -Te
| `variant` | Список вариантов | Структура группировок + фильтры + вывод | | `variant` | Список вариантов | Структура группировок + фильтры + вывод |
| `templates` | Карта привязок шаблонов (field/group) | Содержимое шаблона: строки, ячейки, выражения | | `templates` | Карта привязок шаблонов (field/group) | Содержимое шаблона: строки, ячейки, выражения |
| `trace` | — | Полная цепочка: набор → вычисление → ресурс | | `trace` | — | Полная цепочка: набор → вычисление → ресурс |
| `full` | Полная сводка: overview + query + fields + resources + params + variant | — |
Паттерн: без `-Name` — карта/индекс, с `-Name` — деталь конкретного элемента. Паттерн: без `-Name` — карта/индекс, с `-Name` — деталь конкретного элемента. Режим `full` объединяет 6 ключевых режимов в один вызов.
## Типичный workflow ## Типичный workflow
+61 -19
View File
@@ -3,7 +3,7 @@
param( param(
[Parameter(Mandatory=$true)] [Parameter(Mandatory=$true)]
[string]$TemplatePath, [string]$TemplatePath,
[ValidateSet("overview", "query", "fields", "links", "calculated", "resources", "params", "variant", "trace", "templates")] [ValidateSet("overview", "query", "fields", "links", "calculated", "resources", "params", "variant", "trace", "templates", "full")]
[string]$Mode = "overview", [string]$Mode = "overview",
[string]$Name, [string]$Name,
[int]$Batch = 0, [int]$Batch = 0,
@@ -289,11 +289,7 @@ for ($i = $pathParts.Count - 1; $i -ge 0; $i--) {
$totalXmlLines = (Get-Content $resolvedPath).Count $totalXmlLines = (Get-Content $resolvedPath).Count
# ============================================================ function Show-Overview {
# MODE: overview
# ============================================================
if ($Mode -eq "overview") {
$lines.Add("=== DCS: $templateName ($totalXmlLines lines) ===") $lines.Add("=== DCS: $templateName ($totalXmlLines lines) ===")
$lines.Add("") $lines.Add("")
@@ -482,7 +478,9 @@ if ($Mode -eq "overview") {
$lines.Add(" [$varIdx] $vName$vPresStr$structStr$filterStr") $lines.Add(" [$varIdx] $vName$vPresStr$structStr$filterStr")
} }
} }
}
function Show-OverviewHints {
# Hints — suggest next commands # Hints — suggest next commands
$lines.Add("") $lines.Add("")
$hints = @() $hints = @()
@@ -519,27 +517,35 @@ if ($Mode -eq "overview") {
if ($totalCount -gt 0) { if ($totalCount -gt 0) {
$hints += "-Mode resources resource aggregation ($totalCount)" $hints += "-Mode resources resource aggregation ($totalCount)"
} }
$params = $root.SelectNodes("s:parameter", $ns)
if ($params.Count -gt 0) { if ($params.Count -gt 0) {
$hints += "-Mode params parameter details" $hints += "-Mode params parameter details"
} }
$variants = $root.SelectNodes("s:settingsVariant", $ns)
if ($variants.Count -eq 1) { if ($variants.Count -eq 1) {
$hints += "-Mode variant variant structure" $hints += "-Mode variant variant structure"
} elseif ($variants.Count -gt 1) { } elseif ($variants.Count -gt 1) {
$hints += "-Mode variant -Name <N> variant structure (1..$($variants.Count))" $hints += "-Mode variant -Name <N> variant structure (1..$($variants.Count))"
} }
$tplDefs = $root.SelectNodes("s:template", $ns)
if ($tplDefs.Count -gt 0) { if ($tplDefs.Count -gt 0) {
$hints += "-Mode templates template bindings and expressions" $hints += "-Mode templates template bindings and expressions"
} }
$hints += "-Mode trace -Name <f> trace field origin (by name or title)" $hints += "-Mode trace -Name <f> trace field origin (by name or title)"
$hints += "-Mode full all sections at once"
$lines.Add("Next:") $lines.Add("Next:")
foreach ($h in $hints) { $lines.Add(" $h") } foreach ($h in $hints) { $lines.Add(" $h") }
} }
# ============================================================ # ============================================================
# MODE: query # MODE: overview
# ============================================================ # ============================================================
elseif ($Mode -eq "query") { if ($Mode -eq "overview") {
Show-Overview
Show-OverviewHints
}
function Show-Query {
# Find dataset # Find dataset
$dataSets = $root.SelectNodes("s:dataSet", $ns) $dataSets = $root.SelectNodes("s:dataSet", $ns)
$targetDs = $null $targetDs = $null
@@ -666,10 +672,13 @@ elseif ($Mode -eq "query") {
} }
# ============================================================ # ============================================================
# MODE: fields # MODE: query
# ============================================================ # ============================================================
elseif ($Mode -eq "fields") { if ($Mode -eq "query") {
Show-Query
}
function Show-Fields {
$dataSets = $root.SelectNodes("s:dataSet", $ns) $dataSets = $root.SelectNodes("s:dataSet", $ns)
function Show-DataSetFields($dsNode) { function Show-DataSetFields($dsNode) {
@@ -881,6 +890,13 @@ elseif ($Mode -eq "fields") {
} }
} }
# ============================================================
# MODE: fields
# ============================================================
if ($Mode -eq "fields") {
Show-Fields
}
# ============================================================ # ============================================================
# MODE: links # MODE: links
# ============================================================ # ============================================================
@@ -980,11 +996,7 @@ elseif ($Mode -eq "calculated") {
} }
} }
# ============================================================ function Show-Resources {
# MODE: resources
# ============================================================
elseif ($Mode -eq "resources") {
$totalFields = $root.SelectNodes("s:totalField", $ns) $totalFields = $root.SelectNodes("s:totalField", $ns)
if ($totalFields.Count -eq 0) { if ($totalFields.Count -eq 0) {
$lines.Add("(no resources)") $lines.Add("(no resources)")
@@ -1031,10 +1043,13 @@ elseif ($Mode -eq "resources") {
} }
# ============================================================ # ============================================================
# MODE: params # MODE: resources
# ============================================================ # ============================================================
elseif ($Mode -eq "params") { if ($Mode -eq "resources") {
Show-Resources
}
function Show-Params {
$params = $root.SelectNodes("s:parameter", $ns) $params = $root.SelectNodes("s:parameter", $ns)
$lines.Add("=== Parameters ($($params.Count)) ===") $lines.Add("=== Parameters ($($params.Count)) ===")
$lines.Add(" Name Type Default Visible Expression") $lines.Add(" Name Type Default Visible Expression")
@@ -1096,10 +1111,13 @@ elseif ($Mode -eq "params") {
} }
# ============================================================ # ============================================================
# MODE: variant # MODE: params
# ============================================================ # ============================================================
elseif ($Mode -eq "variant") { if ($Mode -eq "params") {
Show-Params
}
function Show-Variant {
$variants = $root.SelectNodes("s:settingsVariant", $ns) $variants = $root.SelectNodes("s:settingsVariant", $ns)
if (-not $Name) { if (-not $Name) {
@@ -1274,6 +1292,30 @@ elseif ($Mode -eq "variant") {
} # end else (variant detail) } # end else (variant detail)
} }
# ============================================================
# MODE: variant
# ============================================================
if ($Mode -eq "variant") {
Show-Variant
}
# ============================================================
# MODE: full
# ============================================================
elseif ($Mode -eq "full") {
Show-Overview
$lines.Add(""); $lines.Add("--- query ---"); $lines.Add("")
Show-Query
$lines.Add(""); $lines.Add("--- fields ---"); $lines.Add("")
Show-Fields
$lines.Add(""); $lines.Add("--- resources ---"); $lines.Add("")
Show-Resources
$lines.Add(""); $lines.Add("--- params ---"); $lines.Add("")
Show-Params
$lines.Add(""); $lines.Add("--- variant ---"); $lines.Add("")
Show-Variant
}
# ============================================================ # ============================================================
# MODE: trace # MODE: trace
# ============================================================ # ============================================================
+1 -1
View File
@@ -21,7 +21,7 @@ allowed-tools:
| `OutFile` | Записать результат в файл | | `OutFile` | Записать результат в файл |
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\skd-validate\scripts\skd-validate.ps1 -TemplatePath "<путь>" powershell.exe -NoProfile -File .claude/skills/skd-validate/scripts/skd-validate.ps1 -TemplatePath "<путь>"
``` ```
## Проверки (~30) ## Проверки (~30)
+1 -1
View File
@@ -24,7 +24,7 @@ allowed-tools:
| `NoValidate` | Пропустить авто-валидацию | | `NoValidate` | Пропустить авто-валидацию |
```powershell ```powershell
powershell.exe -NoProfile -File '.claude\skills\subsystem-compile\scripts\subsystem-compile.ps1' -Value '<json>' -OutputDir '<ConfigDir>' powershell.exe -NoProfile -File '.claude/skills/subsystem-compile/scripts/subsystem-compile.ps1' -Value '<json>' -OutputDir '<ConfigDir>'
``` ```
## JSON-определение ## JSON-определение
+1 -1
View File
@@ -24,7 +24,7 @@ allowed-tools:
| `NoValidate` | Пропустить авто-валидацию | | `NoValidate` | Пропустить авто-валидацию |
```powershell ```powershell
powershell.exe -NoProfile -File '.claude\skills\subsystem-edit\scripts\subsystem-edit.ps1' -SubsystemPath '<path>' -Operation add-content -Value 'Catalog.Товары' powershell.exe -NoProfile -File '.claude/skills/subsystem-edit/scripts/subsystem-edit.ps1' -SubsystemPath '<path>' -Operation add-content -Value 'Catalog.Товары'
``` ```
## Операции ## Операции
+5 -4
View File
@@ -1,7 +1,7 @@
--- ---
name: subsystem-info name: subsystem-info
description: Анализ структуры подсистемы 1С из XML-выгрузки — состав, дочерние подсистемы, командный интерфейс, дерево иерархии. Используй для изучения структуры подсистем и навигации по конфигурации description: Анализ структуры подсистемы 1С из XML-выгрузки — состав, дочерние подсистемы, командный интерфейс, дерево иерархии. Используй для изучения структуры подсистем и навигации по конфигурации
argument-hint: <SubsystemPath> [-Mode overview|content|ci|tree] [-Name <элемент>] argument-hint: <SubsystemPath> [-Mode overview|content|ci|tree|full] [-Name <элемент>]
allowed-tools: allowed-tools:
- Bash - Bash
- Read - Read
@@ -17,16 +17,16 @@ allowed-tools:
| Параметр | Описание | | Параметр | Описание |
|----------|----------| |----------|----------|
| `SubsystemPath` | Путь к XML-файлу подсистемы, каталогу подсистемы или каталогу `Subsystems/` (для tree) | | `SubsystemPath` | Путь к XML-файлу подсистемы, каталогу подсистемы или каталогу `Subsystems/` (для tree) |
| `Mode` | Режим: `overview` (default), `content`, `ci`, `tree` | | `Mode` | Режим: `overview` (default), `content`, `ci`, `tree`, `full` |
| `Name` | Drill-down: тип объекта в content, секция в ci, имя подсистемы в tree | | `Name` | Drill-down: тип объекта в content, секция в ci, имя подсистемы в tree |
| `Limit` / `Offset` | Пагинация (по умолчанию 150 строк) | | `Limit` / `Offset` | Пагинация (по умолчанию 150 строк) |
| `OutFile` | Записать результат в файл (UTF-8 BOM) | | `OutFile` | Записать результат в файл (UTF-8 BOM) |
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\subsystem-info\scripts\subsystem-info.ps1 -SubsystemPath "<путь>" powershell.exe -NoProfile -File .claude/skills/subsystem-info/scripts/subsystem-info.ps1 -SubsystemPath "<путь>"
``` ```
## Четыре режима ## Пять режимов
| Режим | Что показывает | | Режим | Что показывает |
|---|---| |---|---|
@@ -34,6 +34,7 @@ powershell.exe -NoProfile -File .claude\skills\subsystem-info\scripts\subsystem-
| `content` | Список Content с группировкой по типу объекта. `-Name Catalog` — только каталоги | | `content` | Список Content с группировкой по типу объекта. `-Name Catalog` — только каталоги |
| `ci` | Разбор CommandInterface.xml: видимость, размещение, порядок команд/подсистем/групп | | `ci` | Разбор CommandInterface.xml: видимость, размещение, порядок команд/подсистем/групп |
| `tree` | Рекурсивное дерево иерархии подсистем с маркерами [CI], [OneCmd], [Скрыт] | | `tree` | Рекурсивное дерево иерархии подсистем с маркерами [CI], [OneCmd], [Скрыт] |
| `full` | Полная сводка: overview + content + ci в одном вызове |
## Примеры ## Примеры
@@ -2,7 +2,7 @@
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param( param(
[Parameter(Mandatory=$true)][string]$SubsystemPath, [Parameter(Mandatory=$true)][string]$SubsystemPath,
[ValidateSet("overview","content","ci","tree")] [ValidateSet("overview","content","ci","tree","full")]
[string]$Mode = "overview", [string]$Mode = "overview",
[string]$Name, [string]$Name,
[int]$Limit = 150, [int]$Limit = 150,
@@ -113,6 +113,174 @@ function Get-SubsystemDir([string]$xmlPath) {
return Join-Path $dir $baseName return Join-Path $dir $baseName
} }
# --- Show functions for full mode ---
function Show-Overview {
Out "Подсистема: $subName"
if ($synonym -and $synonym -ne $subName) { Out "Синоним: $synonym" }
if ($commentText) { Out "Комментарий: $commentText" }
Out "ВключатьВКомандныйИнтерфейс: $inclCI"
Out "ИспользоватьОднуКоманду: $useOneCmd"
if ($explanation) { Out "Пояснение: $explanation" }
if ($picText) { Out "Картинка: $picText" }
if ($contentItems.Count -gt 0) {
$parts = @()
foreach ($type in $groups.Keys) {
$parts += "$type`: $($groups[$type].Count)"
}
Out "Состав: $($contentItems.Count) объектов ($($parts -join ', '))"
} else {
Out "Состав: пусто"
}
if ($childNames.Count -gt 0) {
Out "Дочерние подсистемы ($($childNames.Count)): $($childNames -join ', ')"
}
if ($hasCI) {
Out "Командный интерфейс: есть"
}
}
function Show-Content {
Out "Состав подсистемы $subName ($($contentItems.Count) объектов):"
Out ""
if ($Name) {
if ($groups.Contains($Name)) {
$filtered = $groups[$Name]
Out "$Name ($($filtered.Count)):"
foreach ($n in $filtered) { Out " $n" }
} else {
Out "[INFO] Тип '$Name' не найден в составе."
Out "Доступные типы: $($groups.Keys -join ', ')"
}
} else {
foreach ($type in $groups.Keys) {
Out "$type ($($groups[$type].Count)):"
foreach ($n in $groups[$type]) { Out " $n" }
Out ""
}
}
}
function Show-CI {
$localSubDir = Get-SubsystemDir $SubsystemPath
$localCiPath = Join-Path (Join-Path $localSubDir "Ext") "CommandInterface.xml"
if (-not (Test-Path $localCiPath)) {
Out "Командный интерфейс: $subName"
Out ""
Out "Файл CommandInterface.xml не найден."
Out "Путь: $localCiPath"
} else {
[xml]$ciDoc = Get-Content -Path $localCiPath -Encoding UTF8
$ciNs = New-Object System.Xml.XmlNamespaceManager($ciDoc.NameTable)
$ciNs.AddNamespace("ci", "http://v8.1c.ru/8.3/xcf/extrnprops")
$ciNs.AddNamespace("xr", "http://v8.1c.ru/8.3/xcf/readable")
$ciRoot = $ciDoc.DocumentElement
Out "Командный интерфейс: $subName"
Out ""
# --- CommandsVisibility ---
$visSection = $ciRoot.SelectSingleNode("ci:CommandsVisibility", $ciNs)
if ($visSection) {
$hidden = @(); $shown = @()
foreach ($cmd in $visSection.SelectNodes("ci:Command", $ciNs)) {
$cmdName = $cmd.GetAttribute("name")
$vis = $cmd.SelectSingleNode("ci:Visibility/xr:Common", $ciNs)
if ($vis -and $vis.InnerText -eq "false") { $hidden += $cmdName }
else { $shown += $cmdName }
}
$total = $hidden.Count + $shown.Count
if (-not $Name -or $Name -eq "visibility") {
Out "Видимость ($total):"
if ($hidden.Count -gt 0) {
Out " СКРЫТО ($($hidden.Count)):"
foreach ($h in $hidden) { Out " $h" }
}
if ($shown.Count -gt 0) {
Out " ПОКАЗАНО ($($shown.Count)):"
foreach ($s in $shown) { Out " $s" }
}
Out ""
}
}
# --- CommandsPlacement ---
$placeSection = $ciRoot.SelectSingleNode("ci:CommandsPlacement", $ciNs)
if ($placeSection) {
$placements = @()
foreach ($cmd in $placeSection.SelectNodes("ci:Command", $ciNs)) {
$cmdName = $cmd.GetAttribute("name")
$grp = $cmd.SelectSingleNode("ci:CommandGroup", $ciNs)
$pl = $cmd.SelectSingleNode("ci:Placement", $ciNs)
$grpText = if ($grp) { $grp.InnerText } else { "?" }
$plText = if ($pl) { $pl.InnerText } else { "?" }
$placements += @{ Name=$cmdName; Group=$grpText; Placement=$plText }
}
if ((-not $Name -or $Name -eq "placement") -and $placements.Count -gt 0) {
Out "Размещение ($($placements.Count)):"
$arrow = [char]0x2192
foreach ($p in $placements) {
Out " $($p.Name) $arrow $($p.Group) ($($p.Placement))"
}
Out ""
}
}
# --- CommandsOrder ---
$orderSection = $ciRoot.SelectSingleNode("ci:CommandsOrder", $ciNs)
if ($orderSection) {
$orderGroups = [ordered]@{}
foreach ($cmd in $orderSection.SelectNodes("ci:Command", $ciNs)) {
$cmdName = $cmd.GetAttribute("name")
$grp = $cmd.SelectSingleNode("ci:CommandGroup", $ciNs)
$grpText = if ($grp) { $grp.InnerText } else { "?" }
if (-not $orderGroups.Contains($grpText)) { $orderGroups[$grpText] = @() }
$orderGroups[$grpText] += $cmdName
}
$totalOrder = 0
foreach ($k in $orderGroups.Keys) { $totalOrder += $orderGroups[$k].Count }
if ((-not $Name -or $Name -eq "order") -and $totalOrder -gt 0) {
Out "Порядок команд ($totalOrder):"
foreach ($grpName in $orderGroups.Keys) {
Out " [$grpName]:"
foreach ($c in $orderGroups[$grpName]) { Out " $c" }
}
Out ""
}
}
# --- SubsystemsOrder ---
$subOrderSection = $ciRoot.SelectSingleNode("ci:SubsystemsOrder", $ciNs)
if ($subOrderSection) {
$subOrder = @()
foreach ($s in $subOrderSection.SelectNodes("ci:Subsystem", $ciNs)) {
$subOrder += $s.InnerText
}
if ((-not $Name -or $Name -eq "subsystems") -and $subOrder.Count -gt 0) {
Out "Порядок подсистем ($($subOrder.Count)):"
for ($i = 0; $i -lt $subOrder.Count; $i++) {
Out " $($i+1). $($subOrder[$i])"
}
Out ""
}
}
# --- GroupsOrder ---
$grpOrderSection = $ciRoot.SelectSingleNode("ci:GroupsOrder", $ciNs)
if ($grpOrderSection) {
$grpOrder = @()
foreach ($g in $grpOrderSection.SelectNodes("ci:Group", $ciNs)) {
$grpOrder += $g.InnerText
}
if ((-not $Name -or $Name -eq "groups") -and $grpOrder.Count -gt 0) {
Out "Порядок групп ($($grpOrder.Count)):"
foreach ($g in $grpOrder) { Out " $g" }
}
}
}
}
# ============================================================ # ============================================================
# Mode: tree # Mode: tree
# ============================================================ # ============================================================
@@ -225,124 +393,7 @@ if ($Mode -eq "tree") {
$props = $sub.SelectSingleNode("md:Properties", $ns) $props = $sub.SelectSingleNode("md:Properties", $ns)
$subName = $props.SelectSingleNode("md:Name", $ns).InnerText $subName = $props.SelectSingleNode("md:Name", $ns).InnerText
$subDir = Get-SubsystemDir $SubsystemPath Show-CI
$ciPath = Join-Path (Join-Path $subDir "Ext") "CommandInterface.xml"
if (-not (Test-Path $ciPath)) {
Out "Командный интерфейс: $subName"
Out ""
Out "Файл CommandInterface.xml не найден."
Out "Путь: $ciPath"
} else {
[xml]$ciDoc = Get-Content -Path $ciPath -Encoding UTF8
$ciNs = New-Object System.Xml.XmlNamespaceManager($ciDoc.NameTable)
$ciNs.AddNamespace("ci", "http://v8.1c.ru/8.3/xcf/extrnprops")
$ciNs.AddNamespace("xr", "http://v8.1c.ru/8.3/xcf/readable")
$ciRoot = $ciDoc.DocumentElement
Out "Командный интерфейс: $subName"
Out ""
# --- CommandsVisibility ---
$visSection = $ciRoot.SelectSingleNode("ci:CommandsVisibility", $ciNs)
if ($visSection) {
$hidden = @(); $shown = @()
foreach ($cmd in $visSection.SelectNodes("ci:Command", $ciNs)) {
$cmdName = $cmd.GetAttribute("name")
$vis = $cmd.SelectSingleNode("ci:Visibility/xr:Common", $ciNs)
if ($vis -and $vis.InnerText -eq "false") { $hidden += $cmdName }
else { $shown += $cmdName }
}
$total = $hidden.Count + $shown.Count
if (-not $Name -or $Name -eq "visibility") {
Out "Видимость ($total):"
if ($hidden.Count -gt 0) {
Out " СКРЫТО ($($hidden.Count)):"
foreach ($h in $hidden) { Out " $h" }
}
if ($shown.Count -gt 0) {
Out " ПОКАЗАНО ($($shown.Count)):"
foreach ($s in $shown) { Out " $s" }
}
Out ""
}
}
# --- CommandsPlacement ---
$placeSection = $ciRoot.SelectSingleNode("ci:CommandsPlacement", $ciNs)
if ($placeSection) {
$placements = @()
foreach ($cmd in $placeSection.SelectNodes("ci:Command", $ciNs)) {
$cmdName = $cmd.GetAttribute("name")
$grp = $cmd.SelectSingleNode("ci:CommandGroup", $ciNs)
$pl = $cmd.SelectSingleNode("ci:Placement", $ciNs)
$grpText = if ($grp) { $grp.InnerText } else { "?" }
$plText = if ($pl) { $pl.InnerText } else { "?" }
$placements += @{ Name=$cmdName; Group=$grpText; Placement=$plText }
}
if ((-not $Name -or $Name -eq "placement") -and $placements.Count -gt 0) {
Out "Размещение ($($placements.Count)):"
$arrow = [char]0x2192
foreach ($p in $placements) {
Out " $($p.Name) $arrow $($p.Group) ($($p.Placement))"
}
Out ""
}
}
# --- CommandsOrder ---
$orderSection = $ciRoot.SelectSingleNode("ci:CommandsOrder", $ciNs)
if ($orderSection) {
$orderGroups = [ordered]@{}
foreach ($cmd in $orderSection.SelectNodes("ci:Command", $ciNs)) {
$cmdName = $cmd.GetAttribute("name")
$grp = $cmd.SelectSingleNode("ci:CommandGroup", $ciNs)
$grpText = if ($grp) { $grp.InnerText } else { "?" }
if (-not $orderGroups.Contains($grpText)) { $orderGroups[$grpText] = @() }
$orderGroups[$grpText] += $cmdName
}
$totalOrder = 0
foreach ($k in $orderGroups.Keys) { $totalOrder += $orderGroups[$k].Count }
if ((-not $Name -or $Name -eq "order") -and $totalOrder -gt 0) {
Out "Порядок команд ($totalOrder):"
foreach ($grpName in $orderGroups.Keys) {
Out " [$grpName]:"
foreach ($c in $orderGroups[$grpName]) { Out " $c" }
}
Out ""
}
}
# --- SubsystemsOrder ---
$subOrderSection = $ciRoot.SelectSingleNode("ci:SubsystemsOrder", $ciNs)
if ($subOrderSection) {
$subOrder = @()
foreach ($s in $subOrderSection.SelectNodes("ci:Subsystem", $ciNs)) {
$subOrder += $s.InnerText
}
if ((-not $Name -or $Name -eq "subsystems") -and $subOrder.Count -gt 0) {
Out "Порядок подсистем ($($subOrder.Count)):"
for ($i = 0; $i -lt $subOrder.Count; $i++) {
Out " $($i+1). $($subOrder[$i])"
}
Out ""
}
}
# --- GroupsOrder ---
$grpOrderSection = $ciRoot.SelectSingleNode("ci:GroupsOrder", $ciNs)
if ($grpOrderSection) {
$grpOrder = @()
foreach ($g in $grpOrderSection.SelectNodes("ci:Group", $ciNs)) {
$grpOrder += $g.InnerText
}
if ((-not $Name -or $Name -eq "groups") -and $grpOrder.Count -gt 0) {
Out "Порядок групп ($($grpOrder.Count)):"
foreach ($g in $grpOrder) { Out " $g" }
}
}
}
} else { } else {
# ============================================================ # ============================================================
@@ -398,56 +449,15 @@ if ($Mode -eq "tree") {
$hasCI = Test-Path $ciPath $hasCI = Test-Path $ciPath
if ($Mode -eq "overview") { if ($Mode -eq "overview") {
Out "Подсистема: $subName" Show-Overview
if ($synonym -and $synonym -ne $subName) { Out "Синоним: $synonym" }
if ($commentText) { Out "Комментарий: $commentText" }
Out "ВключатьВКомандныйИнтерфейс: $inclCI"
Out "ИспользоватьОднуКоманду: $useOneCmd"
if ($explanation) { Out "Пояснение: $explanation" }
if ($picText) { Out "Картинка: $picText" }
# Content summary
if ($contentItems.Count -gt 0) {
$parts = @()
foreach ($type in $groups.Keys) {
$parts += "$type`: $($groups[$type].Count)"
}
Out "Состав: $($contentItems.Count) объектов ($($parts -join ', '))"
} else {
Out "Состав: пусто"
}
# Children
if ($childNames.Count -gt 0) {
Out "Дочерние подсистемы ($($childNames.Count)): $($childNames -join ', ')"
}
# CI
if ($hasCI) {
Out "Командный интерфейс: есть"
}
} elseif ($Mode -eq "content") { } elseif ($Mode -eq "content") {
Out "Состав подсистемы $subName ($($contentItems.Count) объектов):" Show-Content
Out "" } elseif ($Mode -eq "full") {
Show-Overview
if ($Name) { Out ""; Out "--- content ---"; Out ""
# Filter by type Show-Content
if ($groups.Contains($Name)) { Out ""; Out "--- ci ---"; Out ""
$filtered = $groups[$Name] Show-CI
Out "$Name ($($filtered.Count)):"
foreach ($n in $filtered) { Out " $n" }
} else {
Out "[INFO] Тип '$Name' не найден в составе."
Out "Доступные типы: $($groups.Keys -join ', ')"
}
} else {
foreach ($type in $groups.Keys) {
Out "$type ($($groups[$type].Count)):"
foreach ($n in $groups[$type]) { Out " $n" }
Out ""
}
}
} }
} }
+1 -1
View File
@@ -21,7 +21,7 @@ allowed-tools:
| `OutFile` | Записать результат в файл | | `OutFile` | Записать результат в файл |
```powershell ```powershell
powershell.exe -NoProfile -File '.claude\skills\subsystem-validate\scripts\subsystem-validate.ps1' -SubsystemPath '<путь>' powershell.exe -NoProfile -File '.claude/skills/subsystem-validate/scripts/subsystem-validate.ps1' -SubsystemPath '<путь>'
``` ```
## Проверки (13) ## Проверки (13)
+1 -1
View File
@@ -33,7 +33,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\template-add\scripts\add-template.ps1 -ObjectName "<ObjectName>" -TemplateName "<TemplateName>" -TemplateType "<TemplateType>" [-Synonym "<Synonym>"] [-SrcDir "<SrcDir>"] [-SetMainSKD] powershell.exe -NoProfile -File .claude/skills/template-add/scripts/add-template.ps1 -ObjectName "<ObjectName>" -TemplateName "<TemplateName>" -TemplateType "<TemplateType>" [-Synonym "<Synonym>"] [-SrcDir "<SrcDir>"] [-SetMainSKD]
``` ```
## Маппинг типов ## Маппинг типов
+1 -1
View File
@@ -31,7 +31,7 @@ allowed-tools:
## Команда ## Команда
```powershell ```powershell
powershell.exe -NoProfile -File .claude\skills\template-remove\scripts\remove-template.ps1 -ObjectName "<ObjectName>" -TemplateName "<TemplateName>" [-SrcDir "<SrcDir>"] powershell.exe -NoProfile -File .claude/skills/template-remove/scripts/remove-template.ps1 -ObjectName "<ObjectName>" -TemplateName "<TemplateName>" [-SrcDir "<SrcDir>"]
``` ```
## Что удаляется ## Что удаляется
+2 -2
View File
@@ -6,8 +6,8 @@
| Навык | Параметры | Описание | | Навык | Параметры | Описание |
|-------|-----------|----------| |-------|-----------|----------|
| `/skd-info` | `<TemplatePath> [-Mode] [-Name]` | Анализ структуры СКД: наборы, поля, параметры, ресурсы, варианты (10 режимов) | | `/skd-info` | `<TemplatePath> [-Mode] [-Name]` | Анализ структуры СКД: наборы, поля, параметры, ресурсы, варианты (11 режимов, включая full) |
| `/skd-compile` | `<JsonPath> <OutputPath>` | Генерация Template.xml из JSON DSL: наборы, поля, итоги, параметры, варианты | | `/skd-compile` | `[-DefinitionFile <json> \| -Value <json-string>] -OutputPath <Template.xml>` | Генерация Template.xml из JSON DSL: наборы, поля, итоги, параметры, варианты |
| `/skd-edit` | `<TemplatePath> -Operation <op> -Value "<value>"` | Точечное редактирование: 25 атомарных операций (add/set/modify/clear/remove) | | `/skd-edit` | `<TemplatePath> -Operation <op> -Value "<value>"` | Точечное редактирование: 25 атомарных операций (add/set/modify/clear/remove) |
| `/skd-validate` | `<TemplatePath> [-MaxErrors 20]` | Валидация структурной корректности: ~30 проверок | | `/skd-validate` | `<TemplatePath> [-MaxErrors 20]` | Валидация структурной корректности: ~30 проверок |
+1 -1
View File
@@ -6,7 +6,7 @@
| Навык | Параметры | Описание | | Навык | Параметры | Описание |
|-------|-----------|----------| |-------|-----------|----------|
| `/subsystem-info` | `<SubsystemPath> [-Mode] [-Name]` | Анализ структуры подсистемы: состав, дочерние, CI, дерево иерархии (4 режима) | | `/subsystem-info` | `<SubsystemPath> [-Mode] [-Name]` | Анализ структуры подсистемы: состав, дочерние, CI, дерево иерархии (5 режимов, включая full) |
| `/subsystem-compile` | `<JsonPath> <OutputDir> [-Parent]` | Генерация подсистемы из JSON DSL: XML + регистрация в Configuration.xml | | `/subsystem-compile` | `<JsonPath> <OutputDir> [-Parent]` | Генерация подсистемы из JSON DSL: XML + регистрация в Configuration.xml |
| `/subsystem-edit` | `<SubsystemPath> -Operation <op> -Value "<value>"` | Точечное редактирование: 5 операций (add/remove content/child, set-property) | | `/subsystem-edit` | `<SubsystemPath> -Operation <op> -Value "<value>"` | Точечное редактирование: 5 операций (add/remove content/child, set-property) |
| `/subsystem-validate` | `<SubsystemPath> [-MaxErrors 30]` | Валидация структурной корректности: 13 проверок | | `/subsystem-validate` | `<SubsystemPath> [-MaxErrors 30]` | Валидация структурной корректности: 13 проверок |