mirror of
https://github.com/hansjone/netxops.git
synced 2026-10-12 16:23:18 +08:00
Ship capability groups (nms/common/topology) with shared netx skills.
One group maps to one skill and tools-*; rename NMS tools to *Nms*; sync playbooks from netx/skills. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
83c3796fbb
commit
3c9a383071
47 changed files with 11790 additions and 680 deletions
32
test/group-skills.test.mjs
Normal file
32
test/group-skills.test.mjs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/**
|
||||
* Group skill loader: one capability group ↔ one skill dir.
|
||||
*/
|
||||
|
||||
import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
import { readdirSync, readFileSync, existsSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
|
||||
import { opsSkillsRoot } from '../src/netx/group-skills.ts'
|
||||
import { SKILL_DIR_BY_GROUP } from '../src/netx/capability-groups.ts'
|
||||
|
||||
test('opsSkillsRoot points at nms / common / topology playbook dirs', () => {
|
||||
const root = opsSkillsRoot()
|
||||
assert.ok(existsSync(root), root)
|
||||
for (const dir of Object.values(SKILL_DIR_BY_GROUP)) {
|
||||
assert.ok(existsSync(join(root, dir)), join(root, dir))
|
||||
}
|
||||
})
|
||||
|
||||
test('each group dir has a playbook with name + description', () => {
|
||||
const root = opsSkillsRoot()
|
||||
for (const group of Object.keys(SKILL_DIR_BY_GROUP)) {
|
||||
const groupDir = join(root, SKILL_DIR_BY_GROUP[group])
|
||||
const bundles = readdirSync(groupDir).filter((name) => existsSync(join(groupDir, name, 'SKILL.md')))
|
||||
assert.ok(bundles.length >= 1, group)
|
||||
const raw = readFileSync(join(groupDir, bundles[0], 'SKILL.md'), 'utf8')
|
||||
assert.match(raw, /^---\r?\n/)
|
||||
assert.match(raw, /\nname:\s+\S+/)
|
||||
assert.match(raw, /\ndescription:\s/)
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue