mirror of
https://github.com/hansjone/netxops.git
synced 2026-10-19 23:03:33 +08:00
feat(skills): pull group skills from netx /mcp resources, drop bundled copy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
277a61894d
commit
fa82f530e9
31 changed files with 2074 additions and 2027 deletions
|
|
@ -1,53 +0,0 @@
|
|||
# Sync canonical netx/skills → dsh-netxops presets (npm embed only).
|
||||
# MCP packages do NOT carry a skills/ mirror — point Cursor/hosts at netx/skills/.
|
||||
param(
|
||||
[string]$NetxRoot = ""
|
||||
)
|
||||
$ErrorActionPreference = "Stop"
|
||||
$opsRoot = Resolve-Path (Join-Path $PSScriptRoot "..")
|
||||
if (-not $NetxRoot) {
|
||||
$sibling = Join-Path $opsRoot "..\netx"
|
||||
if (Test-Path (Join-Path $sibling "skills")) {
|
||||
$NetxRoot = (Resolve-Path $sibling).Path
|
||||
} else {
|
||||
throw "Pass -NetxRoot or place netx checkout next to netxops (../netx/skills)"
|
||||
}
|
||||
}
|
||||
$src = Join-Path $NetxRoot "skills"
|
||||
$dst = Join-Path $opsRoot "presets\netxops\skills"
|
||||
if (-not (Test-Path $src)) { throw "missing $src" }
|
||||
|
||||
foreach ($group in @("ops", "topology", "biz-monitor")) {
|
||||
$from = Join-Path $src $group
|
||||
$to = Join-Path $dst $group
|
||||
if (-not (Test-Path $from)) { throw "missing group $from" }
|
||||
if (Test-Path $to) { Remove-Item $to -Recurse -Force }
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path $to) | Out-Null
|
||||
Copy-Item $from $to -Recurse -Force
|
||||
}
|
||||
|
||||
# Drop legacy groups if present
|
||||
foreach ($legacy in @("nms", "common", "topology-layout")) {
|
||||
$legacyPath = Join-Path $dst $legacy
|
||||
if (Test-Path $legacyPath) { Remove-Item $legacyPath -Recurse -Force }
|
||||
}
|
||||
|
||||
@"
|
||||
# Mirrored from netx/skills — do not long-edit here
|
||||
|
||||
Canonical: ``$NetxRoot\skills``
|
||||
|
||||
```powershell
|
||||
powershell -File .\scripts\sync-skills-from-netx.ps1
|
||||
```
|
||||
|
||||
Runtime prefers ``NETX_SKILLS_ROOT`` or sibling ``../netx/skills``.
|
||||
Groups: **ops** (``netx-ops``) + **topology** (``netx-topology``). One group ↔ one skill.
|
||||
|
||||
**Keep netx-ops pure netx** (alarms / inventory / CLI). Knowledge-base triage belongs in
|
||||
operator-subset ``_skills/kb-*`` packs registered by the plugin — do **not** write KB linkage
|
||||
back into ``netx-ops``.
|
||||
"@ | Set-Content -Encoding utf8 (Join-Path $dst "README.md")
|
||||
|
||||
Write-Host "Synced $src -> $dst"
|
||||
Get-ChildItem -Recurse $dst -Filter SKILL.md | ForEach-Object { $_.FullName.Substring($opsRoot.Path.Length) }
|
||||
|
|
@ -70,23 +70,15 @@ export function verifyRelease(directory = root) {
|
|||
})
|
||||
assert.equal(typeof clientExports.apply, 'function')
|
||||
assert.deepEqual(Array.from(clientExports.inject), ['slots', 'locale'])
|
||||
for (const group of ['ops/netx-ops', 'topology/netx-topology', 'biz-monitor/netx-biz-monitor']) {
|
||||
const skill = read(`presets/netxops/skills/${group}/SKILL.md`).replace(/\r\n/g, '\n')
|
||||
const frontmatter = /^---\n([\s\S]*?)\n---/.exec(skill)
|
||||
assert.ok(frontmatter, `Missing skill frontmatter: ${group}`)
|
||||
const parsed = load(frontmatter[1])
|
||||
assert.equal(typeof parsed.name, 'string')
|
||||
assert.equal(typeof parsed.description, 'string')
|
||||
assert.ok(skill.slice(frontmatter[0].length).trim())
|
||||
}
|
||||
for (const path of ['presets/netxops/PERSONA.md', 'presets/netxops/preset.yml']) assert.ok(read(path).trim())
|
||||
assert.equal(existsSync(resolve(directory, 'presets/netxops/skills')), false, 'Group skills must not be bundled')
|
||||
return { version: pkg.version, outputs }
|
||||
}
|
||||
|
||||
if (process.argv[1] && fileURLToPath(import.meta.url) === resolve(process.argv[1])) {
|
||||
try {
|
||||
const result = verifyRelease()
|
||||
console.log(`Release ${result.version}: ${result.outputs.length} JS artifacts, bundle and skills verified.`)
|
||||
console.log(`Release ${result.version}: ${result.outputs.length} JS artifacts and bundle verified.`)
|
||||
} catch (error) {
|
||||
console.error(error.message)
|
||||
process.exitCode = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue