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.
Recommended Skills
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/, 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
ln -sfn $CANNBOT_SKILLS/ops/ascendc-api-best-practices .opencode/skills/ascendc-api-best-practices
ln -sfn $CANNBOT_SKILLS/ops/ascendc-blaze-best-practice .opencode/skills/ascendc-blaze-best-practice
ln -sfn $CANNBOT_SKILLS/ops/ascendc-code-review .opencode/skills/ascendc-code-review
ln -sfn $CANNBOT_SKILLS/ops/ascendc-crash-debug .opencode/skills/ascendc-crash-debug
ln -sfn $CANNBOT_SKILLS/ops/ascendc-docs-search .opencode/skills/ascendc-docs-search
ln -sfn $CANNBOT_SKILLS/ops/ascendc-performance-best-practices .opencode/skills/ascendc-performance-best-practices
ln -sfn $CANNBOT_SKILLS/ops/ascendc-perf-optimize .opencode/skills/ascendc-perf-optimize
ln -sfn $CANNBOT_SKILLS/ops/ascendc-precision-debug .opencode/skills/ascendc-precision-debug
ln -sfn $CANNBOT_SKILLS/ops/ascendc-runtime-debug .opencode/skills/ascendc-runtime-debug
ln -sfn $CANNBOT_SKILLS/ops/ascendc-tiling-design .opencode/skills/ascendc-tiling-design
ln -sfn $CANNBOT_SKILLS/ops/npu-arch .opencode/skills/npu-arch
ln -sfn $CANNBOT_SKILLS/plugins-official/ops-direct-invoke/asc-devkit ./asc-devkit
# 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.
Hiding Symlinks from Git
The symlinks created above (asc-devkit and skills under .opencode/skills/) are external
dependencies and should not be tracked by git. It is recommended to add them to the local .git/info/exclude file:
echo "
# CANNBot skills symlinks
asc-devkit
.opencode/skills/ascendc-*
.opencode/skills/npu-arch" >> .git/info/exclude
This file is local-only and will not be committed.
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.