mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-17 23:35:22 +03:00
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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
78e252af1e
commit
bc9087957f
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: meta-info
|
||||
description: Анализ структуры объекта метаданных 1С из XML-выгрузки — реквизиты, табличные части, формы, движения, типы. Используй для изучения структуры объектов и как подготовительный шаг при написании запросов и кода, работающего с объектами
|
||||
description: Анализ структуры объекта метаданных 1С из XML-выгрузки — реквизиты, табличные части, формы, движения, типы. Используй для изучения структуры объектов (вместо чтения XML-файлов напрямую) и как подготовительный шаг при написании запросов и кода, работающего с объектами
|
||||
argument-hint: <ObjectPath> [-Mode overview|brief|full] [-Name <элемент>]
|
||||
allowed-tools:
|
||||
- Bash
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user