← Files RAG & GenAI CopilotARCHIVED FILE
scripts/validate_package.py
2.46 KB · Nov 11, 2026 · 12:49 UTC
#!/usr/bin/env python3
"""Static checks for a complete skills-only plugin. Not installed-runtime tests."""
import json, re, sys, pathlib
ROOT=pathlib.Path(__file__).resolve().parents[1]
errors=[];checks=0
def assert_(cond,message):
global checks
checks+=1
if not cond:errors.append(message)
p=json.loads((ROOT/'plugin.json').read_text());i=p['extensions']['com.openai']['interface']
assert_(p['name']=='production-rag-genai-copilot','unexpected package ID')
assert_(p['version']=='0.2.0','wrong version')
assert_(len(i['displayName'])<=30,'display name >30')
assert_(len(i['shortDescription'])<=30,'subtitle >30')
assert_(len(i['longDescription'])<=4000,'longDescription >4000')
assert_(len(i['defaultPrompt'])<=3,'more than three prompts')
for prompt in i['defaultPrompt']:assert_(len(prompt)<=128,'starter prompt >128')
assert_(len(i['capabilities'])<=20,'too many capabilities')
for cap in i['capabilities']:assert_(len(cap)<=120,'capability too long')
for u in ('websiteURL','supportURL','privacyPolicyURL','termsOfServiceURL'):assert_(i[u].startswith('https://tekrislabs.com/'),f'bad {u}')
for asset in ('logo','composerIcon'):assert_((ROOT/i[asset]).exists(),f'missing {asset}')
assert_('mcp.json' not in [x.name for x in ROOT.iterdir()],'Unexpected MCP config for skills-only plugin')
all_skills=list((ROOT/'skills').glob('*/SKILL.md'))
assert_(len(all_skills)==15,f'expected 15 skills, got {len(all_skills)}')
for f in all_skills:
s=f.read_text();assert_(s.startswith('---\n'),'missing frontmatter '+str(f))
assert_(re.search(r'^name: '+re.escape(f.parent.name)+r'$',s,re.M)!=None,'skill name mismatch '+str(f))
assert_(re.search(r'^description: \S',s,re.M)!=None,'missing description '+str(f))
for ref in re.findall(r'\b\.\./\.\./([A-Za-z0-9_./-]+)',s):
assert_((ROOT/ref).exists(),'missing skill reference: '+str(f)+': '+ref)
assert_((ROOT/'skills/production-rag-genai-copilot/agents/openai.yaml').exists(),'missing legacy-compatible skill interface')
assert_((ROOT/'benchmarks/scenarios.json').exists(),'missing benchmark cases')
cases=json.loads((ROOT/'benchmarks/scenarios.json').read_text())['cases']
assert_(len(cases)>=20,'missing test coverage')
assert_(len({c['id'] for c in cases})==len(cases),'duplicate test id')
assert_(json.loads((ROOT/'.codex-plugin/plugin.json').read_text())['interface']['displayName']==i['displayName'],'legacy manifest mismatch')
print(f'Static checks: {checks}, errors: {len(errors)}')
for x in errors:print('ERROR:',x)
sys.exit(1 if errors else 0)
SHA-256: 14198ce9e392ce31f50b04b77b2147c4f7e4174c342adaf79419b43beefddb85