From 4c5e10a95893e01dbaeb37927ee119df34972ec4 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sat, 21 Feb 2026 18:46:33 +0300 Subject: [PATCH 1/3] fix(db-run): warn on ERF files passed to /Execute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /Execute is EPF-only; passing .erf causes empty form or type confusion. db-run now detects .erf extension and launches the database without /Execute, advising the user to open the report via File→Open. Co-Authored-By: Claude Opus 4.6 --- .claude/skills/db-run/scripts/db-run.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.claude/skills/db-run/scripts/db-run.ps1 b/.claude/skills/db-run/scripts/db-run.ps1 index 2249bc1a..946291e0 100644 --- a/.claude/skills/db-run/scripts/db-run.ps1 +++ b/.claude/skills/db-run/scripts/db-run.ps1 @@ -118,6 +118,15 @@ if ($UserName) { $argString += " /N`"$UserName`"" } if ($Password) { $argString += " /P`"$Password`"" } # --- Optional params --- +if ($Execute) { + $ext = [System.IO.Path]::GetExtension($Execute).ToLower() + if ($ext -eq ".erf") { + Write-Host "[WARN] /Execute не поддерживает ERF-файлы (внешние отчёты)." -ForegroundColor Yellow + Write-Host " Откройте отчёт через «Файл -> Открыть»: $Execute" -ForegroundColor Yellow + Write-Host " Запускаю базу без /Execute." -ForegroundColor Yellow + $Execute = "" + } +} if ($Execute) { $argString += " /Execute `"$Execute`"" } From 78e252af1ea1339d8ca55b31e5528dc0bdbc9f7b Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sat, 21 Feb 2026 19:04:55 +0300 Subject: [PATCH 2/3] fix(skills): add sibling XML auto-resolve for directory paths When a directory is passed (e.g. src/Name or Catalogs/Name), the auto-resolve now also checks for a sibling file ../Name.xml, which is the standard layout for both 1C config dumps and EPF/ERF sources. Affected: meta-info, meta-edit, meta-validate, epf-validate, subsystem-edit, subsystem-info, subsystem-validate (7 scripts). Co-Authored-By: Claude Opus 4.6 --- .claude/skills/epf-validate/scripts/epf-validate.ps1 | 3 +++ .claude/skills/meta-edit/scripts/meta-edit.ps1 | 5 ++++- .claude/skills/meta-info/scripts/meta-info.ps1 | 5 ++++- .claude/skills/meta-validate/scripts/meta-validate.ps1 | 3 +++ .claude/skills/subsystem-edit/scripts/subsystem-edit.ps1 | 4 +++- .claude/skills/subsystem-info/scripts/subsystem-info.ps1 | 3 +++ .../skills/subsystem-validate/scripts/subsystem-validate.ps1 | 2 ++ 7 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.claude/skills/epf-validate/scripts/epf-validate.ps1 b/.claude/skills/epf-validate/scripts/epf-validate.ps1 index 95c5c2d6..5e6a6404 100644 --- a/.claude/skills/epf-validate/scripts/epf-validate.ps1 +++ b/.claude/skills/epf-validate/scripts/epf-validate.ps1 @@ -22,8 +22,11 @@ if (-not [System.IO.Path]::IsPathRooted($ObjectPath)) { if (Test-Path $ObjectPath -PathType Container) { $dirName = Split-Path $ObjectPath -Leaf $candidate = Join-Path $ObjectPath "$dirName.xml" + $sibling = Join-Path (Split-Path $ObjectPath) "$dirName.xml" if (Test-Path $candidate) { $ObjectPath = $candidate + } elseif (Test-Path $sibling) { + $ObjectPath = $sibling } else { $xmlFiles = @(Get-ChildItem $ObjectPath -Filter "*.xml" -File | Select-Object -First 1) if ($xmlFiles.Count -gt 0) { diff --git a/.claude/skills/meta-edit/scripts/meta-edit.ps1 b/.claude/skills/meta-edit/scripts/meta-edit.ps1 index a41de7c2..d4cf2140 100644 --- a/.claude/skills/meta-edit/scripts/meta-edit.ps1 +++ b/.claude/skills/meta-edit/scripts/meta-edit.ps1 @@ -58,10 +58,13 @@ if ($DefinitionFile) { if (Test-Path $ObjectPath -PathType Container) { $dirName = Split-Path $ObjectPath -Leaf $candidate = Join-Path $ObjectPath "$dirName.xml" + $sibling = Join-Path (Split-Path $ObjectPath) "$dirName.xml" if (Test-Path $candidate) { $ObjectPath = $candidate + } elseif (Test-Path $sibling) { + $ObjectPath = $sibling } else { - Write-Error "Directory given but no $dirName.xml found inside" + Write-Error "Directory given but no $dirName.xml found inside or as sibling" exit 1 } } diff --git a/.claude/skills/meta-info/scripts/meta-info.ps1 b/.claude/skills/meta-info/scripts/meta-info.ps1 index 8f52e4b4..907c37fc 100644 --- a/.claude/skills/meta-info/scripts/meta-info.ps1 +++ b/.claude/skills/meta-info/scripts/meta-info.ps1 @@ -22,12 +22,15 @@ if (-not [System.IO.Path]::IsPathRooted($ObjectPath)) { $ObjectPath = Join-Path (Get-Location).Path $ObjectPath } -# Directory -> find XML inside +# Directory -> find XML inside or as sibling if (Test-Path $ObjectPath -PathType Container) { $dirName = Split-Path $ObjectPath -Leaf $candidate = Join-Path $ObjectPath "$dirName.xml" + $sibling = Join-Path (Split-Path $ObjectPath) "$dirName.xml" if (Test-Path $candidate) { $ObjectPath = $candidate + } elseif (Test-Path $sibling) { + $ObjectPath = $sibling } else { $xmlFiles = @(Get-ChildItem $ObjectPath -Filter "*.xml" -File | Select-Object -First 1) if ($xmlFiles.Count -gt 0) { diff --git a/.claude/skills/meta-validate/scripts/meta-validate.ps1 b/.claude/skills/meta-validate/scripts/meta-validate.ps1 index 00e5f201..0a772037 100644 --- a/.claude/skills/meta-validate/scripts/meta-validate.ps1 +++ b/.claude/skills/meta-validate/scripts/meta-validate.ps1 @@ -21,8 +21,11 @@ if (-not [System.IO.Path]::IsPathRooted($ObjectPath)) { if (Test-Path $ObjectPath -PathType Container) { $dirName = Split-Path $ObjectPath -Leaf $candidate = Join-Path $ObjectPath "$dirName.xml" + $sibling = Join-Path (Split-Path $ObjectPath) "$dirName.xml" if (Test-Path $candidate) { $ObjectPath = $candidate + } elseif (Test-Path $sibling) { + $ObjectPath = $sibling } else { $xmlFiles = @(Get-ChildItem $ObjectPath -Filter "*.xml" -File | Select-Object -First 1) if ($xmlFiles.Count -gt 0) { diff --git a/.claude/skills/subsystem-edit/scripts/subsystem-edit.ps1 b/.claude/skills/subsystem-edit/scripts/subsystem-edit.ps1 index 4769f47d..635ef244 100644 --- a/.claude/skills/subsystem-edit/scripts/subsystem-edit.ps1 +++ b/.claude/skills/subsystem-edit/scripts/subsystem-edit.ps1 @@ -23,8 +23,10 @@ if (-not [System.IO.Path]::IsPathRooted($SubsystemPath)) { if (Test-Path $SubsystemPath -PathType Container) { $dirName = Split-Path $SubsystemPath -Leaf $candidate = Join-Path $SubsystemPath "$dirName.xml" + $sibling = Join-Path (Split-Path $SubsystemPath) "$dirName.xml" if (Test-Path $candidate) { $SubsystemPath = $candidate } - else { Write-Error "No $dirName.xml found in directory"; exit 1 } + elseif (Test-Path $sibling) { $SubsystemPath = $sibling } + else { Write-Error "No $dirName.xml found in directory or as sibling"; exit 1 } } if (-not (Test-Path $SubsystemPath)) { Write-Error "File not found: $SubsystemPath"; exit 1 } $resolvedPath = (Resolve-Path $SubsystemPath).Path diff --git a/.claude/skills/subsystem-info/scripts/subsystem-info.ps1 b/.claude/skills/subsystem-info/scripts/subsystem-info.ps1 index 82696f52..99192d1e 100644 --- a/.claude/skills/subsystem-info/scripts/subsystem-info.ps1 +++ b/.claude/skills/subsystem-info/scripts/subsystem-info.ps1 @@ -402,8 +402,11 @@ if ($Mode -eq "tree") { if (Test-Path $SubsystemPath -PathType Container) { $dirName = Split-Path $SubsystemPath -Leaf $candidate = Join-Path $SubsystemPath "$dirName.xml" + $sibling = Join-Path (Split-Path $SubsystemPath) "$dirName.xml" if (Test-Path $candidate) { $SubsystemPath = $candidate + } elseif (Test-Path $sibling) { + $SubsystemPath = $sibling } else { Write-Host "[ERROR] No $dirName.xml found in directory. Use -Mode tree for directory listing." exit 1 diff --git a/.claude/skills/subsystem-validate/scripts/subsystem-validate.ps1 b/.claude/skills/subsystem-validate/scripts/subsystem-validate.ps1 index 75033983..2f2bb0cd 100644 --- a/.claude/skills/subsystem-validate/scripts/subsystem-validate.ps1 +++ b/.claude/skills/subsystem-validate/scripts/subsystem-validate.ps1 @@ -16,7 +16,9 @@ if (-not [System.IO.Path]::IsPathRooted($SubsystemPath)) { if (Test-Path $SubsystemPath -PathType Container) { $dirName = Split-Path $SubsystemPath -Leaf $candidate = Join-Path $SubsystemPath "$dirName.xml" + $sibling = Join-Path (Split-Path $SubsystemPath) "$dirName.xml" if (Test-Path $candidate) { $SubsystemPath = $candidate } + elseif (Test-Path $sibling) { $SubsystemPath = $sibling } else { Write-Host "[ERROR] No $dirName.xml found in directory: $SubsystemPath" exit 1 From bc9087957f80c353fd883e51c505ba83e9813a8c Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sat, 21 Feb 2026 19:46:38 +0300 Subject: [PATCH 3/3] fix(skills): add file-not-found fallback for Dir/Name/Name.xml paths When a non-existent path like Dir/Name/Name.xml is passed (common when models construct paths from directory structure), auto-resolve tries Dir/Name.xml as sibling. Applied to all 7 scripts with path resolution. Also update meta-info SKILL.md to encourage skill usage over direct XML reads. Co-Authored-By: Claude Opus 4.6 --- .../epf-validate/scripts/epf-validate.ps1 | 10 ++++++++++ .claude/skills/meta-edit/scripts/meta-edit.ps1 | 10 ++++++++++ .claude/skills/meta-info/SKILL.md | 2 +- .claude/skills/meta-info/scripts/meta-info.ps1 | 10 ++++++++++ .../meta-validate/scripts/meta-validate.ps1 | 10 ++++++++++ .../subsystem-edit/scripts/subsystem-edit.ps1 | 9 +++++++++ .../subsystem-info/scripts/subsystem-info.ps1 | 18 ++++++++++++++++++ .../scripts/subsystem-validate.ps1 | 9 +++++++++ 8 files changed, 77 insertions(+), 1 deletion(-) diff --git a/.claude/skills/epf-validate/scripts/epf-validate.ps1 b/.claude/skills/epf-validate/scripts/epf-validate.ps1 index 5e6a6404..58c090c0 100644 --- a/.claude/skills/epf-validate/scripts/epf-validate.ps1 +++ b/.claude/skills/epf-validate/scripts/epf-validate.ps1 @@ -38,6 +38,16 @@ if (Test-Path $ObjectPath -PathType Container) { } } +# File not found — check Dir/Name/Name.xml → Dir/Name.xml +if (-not (Test-Path $ObjectPath)) { + $fileName = [System.IO.Path]::GetFileNameWithoutExtension($ObjectPath) + $parentDir = Split-Path $ObjectPath + $parentDirName = Split-Path $parentDir -Leaf + if ($fileName -eq $parentDirName) { + $candidate = Join-Path (Split-Path $parentDir) "$fileName.xml" + if (Test-Path $candidate) { $ObjectPath = $candidate } + } +} if (-not (Test-Path $ObjectPath)) { Write-Host "[ERROR] File not found: $ObjectPath" exit 1 diff --git a/.claude/skills/meta-edit/scripts/meta-edit.ps1 b/.claude/skills/meta-edit/scripts/meta-edit.ps1 index d4cf2140..74046d46 100644 --- a/.claude/skills/meta-edit/scripts/meta-edit.ps1 +++ b/.claude/skills/meta-edit/scripts/meta-edit.ps1 @@ -68,6 +68,16 @@ if (Test-Path $ObjectPath -PathType Container) { exit 1 } } +# File not found — check Dir/Name/Name.xml → Dir/Name.xml +if (-not (Test-Path $ObjectPath)) { + $fileName = [System.IO.Path]::GetFileNameWithoutExtension($ObjectPath) + $parentDir = Split-Path $ObjectPath + $parentDirName = Split-Path $parentDir -Leaf + if ($fileName -eq $parentDirName) { + $candidate = Join-Path (Split-Path $parentDir) "$fileName.xml" + if (Test-Path $candidate) { $ObjectPath = $candidate } + } +} if (-not (Test-Path $ObjectPath)) { Write-Error "Object file not found: $ObjectPath" exit 1 diff --git a/.claude/skills/meta-info/SKILL.md b/.claude/skills/meta-info/SKILL.md index 81e6c029..6ac2aa1b 100644 --- a/.claude/skills/meta-info/SKILL.md +++ b/.claude/skills/meta-info/SKILL.md @@ -1,6 +1,6 @@ --- name: meta-info -description: Анализ структуры объекта метаданных 1С из XML-выгрузки — реквизиты, табличные части, формы, движения, типы. Используй для изучения структуры объектов и как подготовительный шаг при написании запросов и кода, работающего с объектами +description: Анализ структуры объекта метаданных 1С из XML-выгрузки — реквизиты, табличные части, формы, движения, типы. Используй для изучения структуры объектов (вместо чтения XML-файлов напрямую) и как подготовительный шаг при написании запросов и кода, работающего с объектами argument-hint: [-Mode overview|brief|full] [-Name <элемент>] allowed-tools: - Bash diff --git a/.claude/skills/meta-info/scripts/meta-info.ps1 b/.claude/skills/meta-info/scripts/meta-info.ps1 index 907c37fc..b0d91f8b 100644 --- a/.claude/skills/meta-info/scripts/meta-info.ps1 +++ b/.claude/skills/meta-info/scripts/meta-info.ps1 @@ -42,6 +42,16 @@ if (Test-Path $ObjectPath -PathType Container) { } } +# File not found — check Dir/Name/Name.xml → Dir/Name.xml (common LLM mistake) +if (-not (Test-Path $ObjectPath)) { + $fileName = [System.IO.Path]::GetFileNameWithoutExtension($ObjectPath) + $parentDir = Split-Path $ObjectPath + $parentDirName = Split-Path $parentDir -Leaf + if ($fileName -eq $parentDirName) { + $candidate = Join-Path (Split-Path $parentDir) "$fileName.xml" + if (Test-Path $candidate) { $ObjectPath = $candidate } + } +} if (-not (Test-Path $ObjectPath)) { Write-Host "[ERROR] File not found: $ObjectPath" exit 1 diff --git a/.claude/skills/meta-validate/scripts/meta-validate.ps1 b/.claude/skills/meta-validate/scripts/meta-validate.ps1 index 0a772037..aba022bf 100644 --- a/.claude/skills/meta-validate/scripts/meta-validate.ps1 +++ b/.claude/skills/meta-validate/scripts/meta-validate.ps1 @@ -37,6 +37,16 @@ if (Test-Path $ObjectPath -PathType Container) { } } +# File not found — check Dir/Name/Name.xml → Dir/Name.xml +if (-not (Test-Path $ObjectPath)) { + $fileName = [System.IO.Path]::GetFileNameWithoutExtension($ObjectPath) + $parentDir = Split-Path $ObjectPath + $parentDirName = Split-Path $parentDir -Leaf + if ($fileName -eq $parentDirName) { + $candidate = Join-Path (Split-Path $parentDir) "$fileName.xml" + if (Test-Path $candidate) { $ObjectPath = $candidate } + } +} if (-not (Test-Path $ObjectPath)) { Write-Host "[ERROR] File not found: $ObjectPath" exit 1 diff --git a/.claude/skills/subsystem-edit/scripts/subsystem-edit.ps1 b/.claude/skills/subsystem-edit/scripts/subsystem-edit.ps1 index 635ef244..ff108342 100644 --- a/.claude/skills/subsystem-edit/scripts/subsystem-edit.ps1 +++ b/.claude/skills/subsystem-edit/scripts/subsystem-edit.ps1 @@ -28,6 +28,15 @@ if (Test-Path $SubsystemPath -PathType Container) { elseif (Test-Path $sibling) { $SubsystemPath = $sibling } else { Write-Error "No $dirName.xml found in directory or as sibling"; exit 1 } } +# File not found — check Dir/Name/Name.xml → Dir/Name.xml +if (-not (Test-Path $SubsystemPath)) { + $fn = [System.IO.Path]::GetFileNameWithoutExtension($SubsystemPath) + $pd = Split-Path $SubsystemPath + if ($fn -eq (Split-Path $pd -Leaf)) { + $c = Join-Path (Split-Path $pd) "$fn.xml" + if (Test-Path $c) { $SubsystemPath = $c } + } +} if (-not (Test-Path $SubsystemPath)) { Write-Error "File not found: $SubsystemPath"; exit 1 } $resolvedPath = (Resolve-Path $SubsystemPath).Path diff --git a/.claude/skills/subsystem-info/scripts/subsystem-info.ps1 b/.claude/skills/subsystem-info/scripts/subsystem-info.ps1 index 99192d1e..14ff4a04 100644 --- a/.claude/skills/subsystem-info/scripts/subsystem-info.ps1 +++ b/.claude/skills/subsystem-info/scripts/subsystem-info.ps1 @@ -383,6 +383,15 @@ if ($Mode -eq "tree") { Write-Host "[ERROR] ci mode requires a subsystem .xml file, not a directory" exit 1 } + # File not found — check Dir/Name/Name.xml → Dir/Name.xml + if (-not (Test-Path $SubsystemPath)) { + $fn = [System.IO.Path]::GetFileNameWithoutExtension($SubsystemPath) + $pd = Split-Path $SubsystemPath + if ($fn -eq (Split-Path $pd -Leaf)) { + $c = Join-Path (Split-Path $pd) "$fn.xml" + if (Test-Path $c) { $SubsystemPath = $c } + } + } if (-not (Test-Path $SubsystemPath)) { Write-Host "[ERROR] File not found: $SubsystemPath" exit 1 @@ -413,6 +422,15 @@ if ($Mode -eq "tree") { } } + # File not found — check Dir/Name/Name.xml → Dir/Name.xml + if (-not (Test-Path $SubsystemPath)) { + $fn = [System.IO.Path]::GetFileNameWithoutExtension($SubsystemPath) + $pd = Split-Path $SubsystemPath + if ($fn -eq (Split-Path $pd -Leaf)) { + $c = Join-Path (Split-Path $pd) "$fn.xml" + if (Test-Path $c) { $SubsystemPath = $c } + } + } if (-not (Test-Path $SubsystemPath)) { Write-Host "[ERROR] File not found: $SubsystemPath" exit 1 diff --git a/.claude/skills/subsystem-validate/scripts/subsystem-validate.ps1 b/.claude/skills/subsystem-validate/scripts/subsystem-validate.ps1 index 2f2bb0cd..ddd37f5b 100644 --- a/.claude/skills/subsystem-validate/scripts/subsystem-validate.ps1 +++ b/.claude/skills/subsystem-validate/scripts/subsystem-validate.ps1 @@ -24,6 +24,15 @@ if (Test-Path $SubsystemPath -PathType Container) { exit 1 } } +# File not found — check Dir/Name/Name.xml → Dir/Name.xml +if (-not (Test-Path $SubsystemPath)) { + $fn = [System.IO.Path]::GetFileNameWithoutExtension($SubsystemPath) + $pd = Split-Path $SubsystemPath + if ($fn -eq (Split-Path $pd -Leaf)) { + $c = Join-Path (Split-Path $pd) "$fn.xml" + if (Test-Path $c) { $SubsystemPath = $c } + } +} if (-not (Test-Path $SubsystemPath)) { Write-Host "[ERROR] File not found: $SubsystemPath" exit 1