Documents

huawei-cloud-skill-audit

Try it

Audit Huawei Cloud skills for quality, security, and compliance using a two-check pipeline: skillspector (AI security) and gitleaks (credential leak). Generates structured reports with issue details and fix strategies. Triggers include: "审计技能","技能审计","检查技能质量","扫描技能问题","技能安全审计", "audit skill","check skill quality","scan skills for issues","skill audit", "华为云技能审计","技能合规检查","skill gate","质量门禁","技能检查", "audit huawei cloud skill","verify skill compliance","技能质量检查","跑审计","安全扫描".

What it does

Audit Huawei Cloud skills for quality, security, and compliance using a two-check pipeline: skillspector (AI security) and gitleaks (credential leak). Generates structured reports with issue details and fix strategies. Triggers include: "审计技能","技能审计","检查技能质量","扫描技能问题","技能安全审计", "audit skill","check skill quality","scan skills for issues","skill audit", "华为云技能审计","技能合规检查","skill gate","质量门禁","技能检查", "audit huawei cloud skill","verify skill compliance","技能质量检查","跑审计","安全扫描".

The skill document

Huawei Cloud Skill Audit

Two-check security pipeline for auditing Huawei Cloud skills — security gate.


Overview

Scan a single Huawei Cloud skill directory or a folder of skills, run two security gates, and generate a structured report with issue details and fix strategies.

Two checks:

#ToolCheck ContentImplementation
1skillspectorAI skill security scanner: 47 rules / 439 patterns across 17 categories (prompt injection, data exfiltration, privilege escalation, supply chain, behavioral AST, taint tracking, MCP analysis, YARA)Built-in (pure Python, 47 rules + AST analysis)
2gitleaksCredential leak scan: 222 rules detecting hardcoded API keys, passwords, private keys, tokens, and 800+ credential formatsBuilt-in (pure Python, 222 rules + Shannon entropy)

Prerequisites

  1. Python 3.10+ — for the built-in skillspector and gitleaks checks
  2. Node.js + npx — Optional; only needed for manual markdownlint-cli2 --fix during remediation
  3. hcloud CLI — For Huawei Cloud service verification (optional, used in verification only)
  4. Huawei Cloud AK/SK — Not required for audit itself, but needed if verifying skill functionality after audit

skillspector and gitleaks are built-in (pure Python) — no external binary or pip install needed. External binaries are used as fallback if available on PATH.

To skip fallback auto-install of external binaries, use --no-install flag.


Workflow

Input (skill path or folder)
    │
    ├── Discover Skills ──── Find SKILL.md in target or subdirectories
    │
    ├── Run Two Checks ────
    │   1. skillspector → AI security scan (47 rules, 439 patterns)
    │   2. gitleaks → Credential leak detection
    │
    ├── Build Report ────
    │   Section 1: Scanned Skills
    │   Section 2: Issue Summary (by severity)
    │   Section 3: Issue Details (per-issue)
    │   Section 4: Fix Strategies (per rule/category)
    │
    └── Gate Verdict ──── PASS or FAIL

Scan Levels

LevelAnalyzersSpeedUse Case
criticalCRITICAL severity rules only (P5 harmful content)FastStrictest gate, default
highCRITICAL + ERROR severity rulesFastBlock high-risk issues
quickPattern matching only (all static regex rules)FastQuick pre-commit check
standardAll static analyzers (quick + AST + taint tracking)MediumCI/CD gate
deepStandard + MCP analysis (least privilege, tool poisoning, rug pull)SlowerPre-release full audit

Severity filtering applies only to SkillSpector. gitleaks always reports all findings regardless of scan level.


KooCLI Command Format Standard

This skill does not directly invoke hcloud CLI commands. It audits skill directories locally. However, when verifying a skill's functionality after audit, the standard KooCLI format applies:

hcloud   --cli-region= [--key=value ...]

Core Commands

Scan a single skill

python3 scripts/skill_audit.py --target /path/to/my-skill

Scan a folder of skills

python3 scripts/skill_audit.py --target /path/to/skills-folder

Scan with specific level

python3 scripts/skill_audit.py --target /path/to/skills --scan-level quick

Selective check execution

python3 scripts/skill_audit.py --target /path/to/skills --checks skillspector
python3 scripts/skill_audit.py --target /path/to/skills --skip-checks gitleaks

Run with custom tool paths

python3 scripts/skill_audit.py \
  --target /path/to/skill-or-folder \
  --scan-level standard \
  --skillspector /path/to/skillspector \
  --gitleaks /path/to/gitleaks \
  --node-bin /opt/nvm/versions/node/v18.20.8/bin

Available --scan-level values: critical (default), high, quick, standard, deep. Available --checks: skillspector, gitleaks. Use --skip-checks to exclude specific checks.


Parameter Confirmation

ParameterRequiredDescriptionExample
--targetYesSingle skill dir or parent folder of skills/home/user/.hermes/skills/huawei-cloud-ecs-manage
--output-dirNoReport output directory (default: parent of target)--output-dir ./reports
--scan-levelNoScan depth: critical/high/quick/standard/deep (default: critical)--scan-level deep
--checksNoComma-separated checks to run (default: all);可用值仅 skillspector,gitleaks。与 --skip-checks 互斥,不可同时使用--checks skillspector
--skillspectorNoSkillSpector binary path override--skillspector /usr/local/bin/skillspector
--gitleaksNogitleaks binary path override--gitleaks /usr/local/bin/gitleaks
--skip-checksNoComma-separated checks to skip;与 --checks 互斥,不可同时使用--skip-checks gitleaks
--no-installNoSkip auto-install of tools--no-install

Report Structure

Report is saved as skill-gate-report-.txt in the parent directory of the scanned path.

InputReport saved to
/repo/skills/huawei-cloud-ecs-manage/repo/skills/skill-gate-report-.txt
/repo/skills/repo/skill-gate-report-.txt

Four sections:

  1. Scanned Skills — list of all skills found
  2. Issue Summary — count by severity (CRITICAL/ERROR/WARNING) with rule breakdown (INFO excluded)
  3. Issue Details — per-issue: skill name, rule, line number, snippet, message
  4. Fix Strategies — actionable remediation for each unique rule/category

Fix Strategies Reference

skillspector

RuleFix
P1-P5 (Prompt Injection)Do not embed user-controllable input in system prompts; use template variables with explicit escaping
E1-E4 (Data Exfiltration)Remove external URLs; use env vars for API endpoints; restrict network access in tool definitions
PE1-PE3 (Privilege Escalation)Avoid sudo/root commands; use capability-based permissions; do not disable security controls
AST1-AST3 (Behavioral AST)Replace exec()/eval() with safer alternatives; use importlib with allowlists
YR1-YR4 (YARA)Remove reverse shell/webshell patterns; move server functionality to separate controlled service
SC1-SC6 (Supply Chain)Pin dependency versions with hashes; update vulnerable dependencies
LP1-LP4 (MCP Least Privilege)Reduce MCP tool permissions to minimum required
TP1-TP4 (MCP Tool Poisoning)Validate MCP tool metadata against manifest

gitleaks

RuleFix
generic-api-keyReplace hardcoded API key/secret with os.environ.get("VAR") or ${VAR}; add to .gitleaksignore if false positive
private-keyRemove hardcoded private key; load from file or secret manager at runtime; add key file to .gitignore
(other rules)Replace hardcoded credential with environment variable or secret manager reference; see https://gitleaks.io/docs/secrets

Remediation Workflow (audit -> fix -> verify)

After running the audit and getting a FAIL, follow this sequence:

  1. Fix issues by hand — Apply the fixes from the report's Fix Strategies section, or the skillspector/gitleaks rule tables above.
  2. Re-run the full audit to verify PASS.

Markdown style and SKILL.md spec issues are not audited by this skill; use external tools like markdownlint-cli2 --fix only if you need to fix markdown style separately.


CI/CD Integration

jobs:
  skill-gate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.12'
      - name: Run audit
        run: python3 scripts/skill_audit.py --target . --output-dir .
      - name: Upload report
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: skill-gate-report
          path: skill-gate-report-*.txt

Configuration Files

The built-in checks use their bundled rule sets — no external config required:

  • scripts/checks/skillspector_rules.json — skillspector rules (47 rules / 439 patterns)
  • scripts/checks/gitleaks_rules.json — gitleaks rules (222 rules)

.markdownlint.json and skillcheck.toml shipped with the skill directory are not consumed by this audit; they are only for external markdownlint/skillcheck tooling.


Security Scanning

Why skillspector static-only mode has limitations

skillspector runs with --no-llm mode (static analysis only). Gaps:

AnalyzerWhat it detectsWhat it MISSES in --no-llm mode
Pattern matching (P1-P5, E1-E4, PE1-PE3)Prompt injection, data exfiltration, privilege escalation patternsLLM-generated obfuscated variants
AST analysis (AST1-AST3)exec()/eval() calls, dynamic importsRuntime-evaluated strings
YARA rules (YR1-YR4)Reverse shell, webshell patternsEncoded/obfuscated payloads
Supply chain (SC1-SC6)Vulnerable/pinned dependency issuesTransitive dependency exploits

Complementary tools

ToolDetectsInstall
skillspector (built-in, --no-llm)Prompt injection, reverse shell, command injection, data exfiltration, privilege escalation, supply chainAuto-installed
gitleaks (built-in)800+ credential types: API keys, passwords, private keys, tokensAuto-installed
gitcode-security-scannerGeneric keyword credentials, Chinese keywords, SQL injection, debug leakageFrom DTSE-SKILL repo

Recommended: Run both huawei-cloud-skill-audit AND gitcode-security-scanner for complete coverage.


Output Format

Report is a plain text file with four sections (Scanned Skills, Issue Summary, Issue Details, Fix Strategies) followed by a Gate Verdict (PASS/FAIL).


Verification Method

Run audit

python3 scripts/skill_audit.py --target /path/to/skill

Verify fix

# Fix issues from the report's Fix Strategies section, then re-run audit
python3 scripts/skill_audit.py --target /path/to/skill

Check gate verdict

# Gate Verdict: PASS = all checks passed
# Gate Verdict: FAIL = one or more checks have issues

Reference Documents

  • references/iam-policies.md — IAM permissions required for skill audit
  • references/verification-method.md — Detailed verification procedures
  • references/acceptance-criteria.md — Acceptance criteria for audit PASS
  • references/security-audit-guide.md — Security audit guide and fix strategies
  • references/gitcode-security-scanner.md — Complementary scanner usage guide

Best Practices

  • Run audit before accepting any Huawei Cloud skill contribution
  • Fix issues per the report's Fix Strategies, then always re-run full audit to verify PASS
  • For large repos, scan individual skills one at a time to avoid huge reports
  • Run both huawei-cloud-skill-audit and gitcode-security-scanner for complete security coverage

Notes

  • 本 skill 仅生成审计报告和修复策略,不自动修改任何技能文件;修复由用户按报告 Fix Strategies 或 Remediation Workflow 手动执行,修复后需重新运行审计验证
  • Two-check pipeline runs sequentially; each check is independent
  • API endpoints are strictly prohibited from being inferred
  • Credentials (AK/SK) are read from environment variables; hardcoding is prohibited
  • If AK/SK is missing for post-audit verification, prompt the user; do not skip
  • Resources created during testing must be tracked; output manual cleanup instructions if any remain
  • INFO-level issues are excluded from the report; only CRITICAL/ERROR/WARNING appear
  • gitleaks --no-git mode scans current file contents only, not git history
  • gitleaks does not detect Chinese keyword credentials; use gitcode-security-scanner for those

Edge Cases

ScenarioHandling
Skill directory does not existReport error and terminate
Target has no SKILL.md and no subdirs with SKILL.mdReport error: no skills found
Built-in rules file missingAuto-download fallback binary (skillspector/gitleaks)
Python version < 3.12External skillspector binary not available; builtin still works
Large repo produces huge reportScan individual skills; use head/tail to read summary
gitleaks false positiveAdd to .gitleaksignore file
skillspector exit code 1Risk score > 50; treated as finding source, not hard failure

Design Principles

  • Two-Check Pipeline — Each check is independent and contributes to the overall gate verdict
  • Auto-Install — Missing tools are installed automatically on first run
  • Chain Verification — All enabled checks must pass for gate verdict PASS
  • Agent-proof — Write operations require user confirmation; automatic gate bypassing is not allowed
  • Data-Driven — Report is structured text with clear severity levels and fix strategies
  • Batch Repeatable — Same skill can be audited repeatedly; --fresh resets
  • Credential Security — No hardcoded AK/SK; read from environment variables
  • Least Privilege — IAM policies follow minimum required permissions

Related skills

End-to-end functional testing framework for Huawei Cloud skills — three-tier pipeline covering single-skill unit testing, multi-skill orchestration, and end-to-end full flow testing. Each phase produces structured JSON output with chain verification. Supports skill installation validation, functional analysis, CLI→SDK→API feasibility research, test case generation, real-environment execution with resource lifecycle, resource cleanup, multi-skill scenario orchestration, trigger-conflict detection, and consolidated reporting. Triggers include: 测试技能, 执行技能测试, 跑测试流程, 技能回归测试, skill test, run skill tests, test huawei cloud skill, verify skill, 测试华为云skill, 全流程测试, 编排测试, 技能完整性检查, skill-tester, 跑测试, 回归测试, 组合测试, 多skill编排, verification, e2e.

by huaweicloud-skills-team

Audit a target SKILL.md against the Agent Skills specification and generate a Chinese HTML report. Use when the user asks to check, audit, review, or optimiz...

21 installs

Skill Security — 安全审计扫描器,帮助你快速发现 Skill 中的安全风险。轻量 SAST 污点追踪(Python AST + JS 词法近似,source→sink 证据链降误报)、规则引擎(YAML 规则包热插拔扩展)、社区规则(schema 校验 + 来源记录 + 签名验证)、提示注入 ML 语义检测(ONNX + 正则降级)、系统级行为捕获(eBPF Linux / ETW Windows)、动态沙箱执行扫描、供应链风险分析、CVE 离线缓存、恶意 Skill 指纹库、健康度与合规检查(质量+结构+权限合并)、全局排除配置、CI/CD 集成、JSON/HTML/SARIF 报告生成。

1 installs

Audit another Codex skill for structural compliance, trigger quality, instruction clarity, reuse of scripts or references, and overall maintainability. Use w...

16 installs

1. Six-phase pipeline for creating Huawei Cloud skills — Socratic requirements gathering, CLI→SDK→API research, MD generation, test preparation, detailed testing, and final cleanup & compliance check 2. Phase-chained dependency: each phase builds on the previous phase's output, no phase may be skipped 3. Supports CLI, SDK, and REST API execution modes with automatic fallback detection 4. Generates complete skill directory structure with SKILL.md, references/, scripts/, templates/ 5. Validates against the Huawei Cloud Skill Specification (华为云Skill检查规范) Triggers include: "创建华为云Skill","新建华为云Skill","华为云skill创建器","创建 Skill","新建 Skill","skill 创建器","create skill","build skill","new skill","skill creator","scaffold a Huawei Cloud skill","wrap CLI or OpenAPI into a skill","package cloud operations into a skill","帮我创建华为云Skill","帮我新建一个Skill","封装华为云CLI为Skill","华为云Skill脚手架","帮我创建一个skill","我需要一个skill","建一个skill","生成skill","帮我建一个华为云skill".

by huaweicloud-skills-team

Invoke this skill to capture poor experiences and distill them into high-value requirements (Voice of Developer). Use when user encounters any Huawei Cloud related issues, like user expresses dissatisfaction, encounters errors, or wants to report issues/suggestions.Triggers include: "体验差","反馈问题","反馈建议","这个有bug","拒绝了请求","报告问题","反馈体验","report a problem","report a suggestion","bug report","poor experience","voice of developer"

by huaweicloud-skills-team