返回 Skill 列表
extension
分类: 开发与工程无需 API Key

code-walk-thru

当用户希望你通过编辑器逐个解释代码或文本文件的工作原理,或者向用户展示你所做的更改等内容时,请使用此方法。通常你会反复使用这种方法,逐一向用户展示你的更改或代码文件,有时会指定具体的行号。这样,当你指向各个文件(可能在这些文件中指定特定的行号)时,用户可以轻松地在他们喜欢的编辑器中跟随。

person作者: jakexiaohubgithub

code-walk-thru

Instructions

Depending on which EDITOR the user says they are using, you will use a different "show-file" cli command that shows (in the EDITOR) a specific file, optionally at specific line-number, as in examples below. If no editor specified, you must ask the user which editor they are using.

IMPORTANT: you must walk thru the files ONE BY ONE, and you MUST wait for the user to say something before moving on to the next file, or to same file different line.

  • VSCode:
code --goto <file_path>:<line_number>
  • PyCharm:
pycharm --line <line_number> <file_path>
  • IntelliJ:
intellij --line <line_number> <file_path>
  • Zed:
zed path/to/file.md:43
  • Vim/Neovim:
vim +42 blah.py
nvim +42 blah.py

If any of these fail tell the user to install the corresponding CLI tool for their editor.