mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-18 16:49:41 +03:00
feat(validate): auto-resolve directory paths, fix SKILL.md placeholders
Scripts now accept directory paths (e.g. Forms/ИмяФормы) and auto-resolve to the target XML file. Silent fallbacks handle missing Ext/ level and descriptor-to-file resolution. SKILL.md: concrete placeholders, unified quotes, auto-resolve notes, role-validate MaxErrors in params. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,18 @@ $ErrorActionPreference = "Stop"
|
||||
if (-not [System.IO.Path]::IsPathRooted($CIPath)) {
|
||||
$CIPath = Join-Path (Get-Location).Path $CIPath
|
||||
}
|
||||
# A: Directory → Ext/CommandInterface.xml
|
||||
if (Test-Path $CIPath -PathType Container) {
|
||||
$CIPath = Join-Path (Join-Path $CIPath "Ext") "CommandInterface.xml"
|
||||
}
|
||||
# B1: Missing Ext/ (e.g. Subsystems/X/CommandInterface.xml → Subsystems/X/Ext/CommandInterface.xml)
|
||||
if (-not (Test-Path $CIPath)) {
|
||||
$fn = [System.IO.Path]::GetFileName($CIPath)
|
||||
if ($fn -eq "CommandInterface.xml") {
|
||||
$c = Join-Path (Join-Path (Split-Path $CIPath) "Ext") $fn
|
||||
if (Test-Path $c) { $CIPath = $c }
|
||||
}
|
||||
}
|
||||
if (-not (Test-Path $CIPath)) {
|
||||
Write-Host "[ERROR] File not found: $CIPath"
|
||||
exit 1
|
||||
|
||||
@@ -94,6 +94,17 @@ def main():
|
||||
if not os.path.isabs(ci_path):
|
||||
ci_path = os.path.join(os.getcwd(), ci_path)
|
||||
|
||||
# A: Directory → Ext/CommandInterface.xml
|
||||
if os.path.isdir(ci_path):
|
||||
ci_path = os.path.join(ci_path, 'Ext', 'CommandInterface.xml')
|
||||
# B1: Missing Ext/
|
||||
if not os.path.exists(ci_path):
|
||||
fn = os.path.basename(ci_path)
|
||||
if fn == 'CommandInterface.xml':
|
||||
c = os.path.join(os.path.dirname(ci_path), 'Ext', fn)
|
||||
if os.path.exists(c):
|
||||
ci_path = c
|
||||
|
||||
if not os.path.exists(ci_path):
|
||||
print(f'[ERROR] File not found: {ci_path}')
|
||||
sys.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user