Skip to content
FunCoding

add_line_by_type

根据文件类型向指定文件中添加代码行。当用户提到批量添加代码、按类型插入行、自动加 import 时使用。

Star
1,359
License
Apache-2.0
Last commit
Aug 20, 2026

skills/file/add_line_by_type/SKILL.md

View on GitHub

add_line_by_type Skill

根据类型添加行

功能描述

根据文件类型,向指定文件中添加对应的代码行。

⚠️ TODO: 该功能为历史功能,行为待测试。

所属分类

office/skills/file/add_line_by_type/

调用方式

from skills.file import add_line_by_type

add_line_by_type(
    add_line_dict={'import': 'import os'},
    file_path='./test.py',
    file_type='.py',
    output_path='add_line'
)

参数说明

参数类型必填默认值说明
add_line_dictdict是-添加行的字典
file_pathstr是-文件路径
file_typestr否'.py'文件类型
output_pathstr否'add_line'输出路径

返回值

None

原始函数

office.api.file.add_line_by_type

Similar Skills

receiving-code-review

OBobra/superpowers298k2,631 new stars in the last 7 days

requesting-code-review

OBobra/superpowers298k2,631 new stars in the last 7 days

systematic-debugging

OBobra/superpowers298k2,631 new stars in the last 7 days

code-review

MAmattpocock/skills288k10,178 new stars in the last 7 days

codebase-design

MAmattpocock/skills288k10,178 new stars in the last 7 days

scaffold-exercises

MAmattpocock/skills288k10,178 new stars in the last 7 days