AI agent skills for Ascend C

CANNBot repository provides skills for AI agents with specialized knowledge about Ascend C API, NPU architecture, Tiling design, and Matmul/GEMM optimization. These skills give the AI coding assistant context-aware help with operator development, API usage, and explaining Ascend C specifics. The following instructions are recommended to use with OpenCode client.

Directory Structure

The cannbot-skills repository should be cloned as a sibling directory to pyasc (not inside the project). Skills are symlinked into .opencode/skills/, the ops-code-reviewer agents into .opencode/agents/, and asc-devkit is symlinked in the project root. All paths use the $CANNBOT_SKILLS environment variable.

Installation

# Clone cannbot-skills as sibling to pyasc
export CANNBOT_SKILLS=$PWD/../cannbot-skills
git clone https://gitcode.com/cann/cannbot-skills.git $CANNBOT_SKILLS

# Clone asc-devkit (API docs + examples)
git clone https://gitcode.com/cann/asc-devkit.git $CANNBOT_SKILLS/plugins-official/ops-direct-invoke/asc-devkit

# Create symlinks
skills=(
    ascendc-api-best-practices
    ascendc-blaze-best-practice
    ascendc-code-review
    ascendc-crash-debug
    ascendc-docs-search
    ascendc-performance-best-practices
    ascendc-perf-optimize
    ascendc-precision-debug
    ascendc-runtime-debug
    ascendc-tiling-design
    npu-arch
    ascendc-regbase-best-practice
    ascendc-sync-audit
    ops-profiling
    ops-simulator
    aiss-tiling-solver
    ops-precision-standard
)
for skill in "${skills[@]}"; do
    ln -sfn $CANNBOT_SKILLS/ops/$skill .opencode/skills/$skill
done
ln -sfn $CANNBOT_SKILLS/plugins-official/ops-direct-invoke/asc-devkit ./asc-devkit

# ops-code-reviewer plugin: agent symlinks only (do not overwrite AGENTS.md)
mkdir -p .opencode/agents
for agent in ascendc-code-summarizer ascendc-ops-reviewer; do
    ln -sfn $CANNBOT_SKILLS/plugins-official/ops-code-reviewer/agents/$agent.md .opencode/agents/$agent.md
done

# Verify skills installation
for s in .opencode/skills/*/; do
  [ -f "$s/SKILL.md" ] && echo "OK: $s" || echo "MISSING: $s"
done

Restart OpenCode to load the skills.

Updating

cd $CANNBOT_SKILLS && git pull
cd plugins-official/ops-direct-invoke/asc-devkit && git pull

Restart OpenCode to apply updates.

Alternative: Automated Installation

Use init.sh from a plugin directory to install all skills from that plugin:

cd $CANNBOT_SKILLS/plugins-official/<plugin-name>
bash init.sh project opencode /path/to/pyasc

See the cannbot-skills README for available plugins.