This repository is used to manage daily utility scripts. When I ask an AI assistant to create, modify, or delete scripts in this project, follow this document strictly.
For script creation tasks, only the following paths may be created or modified by default:
bat/*.bat
ps1/*.ps1
config/scripts.json
README.md
Do not modify any other project files unless I explicitly ask for it.
Windows Batch scripts must be created under:
bat/
The script path in config/scripts.json should use a project-relative path:
bat/script_name.bat
PowerShell scripts must be created under:
ps1/
The script path in config/scripts.json should use a project-relative path:
ps1/script_name.ps1
Every PowerShell script must also have a same-name BAT launcher under bat/.
For PS1-backed scripts, register the BAT launcher in config/scripts.json by default so it can be launched by double-click.
Example:
ps1/browser_auto.ps1
bat/browser_auto.bat
- Use English letters, numbers, underscores, or hyphens.
- Do not use spaces.
- Do not use Chinese characters in new script file names.
- The file name should clearly describe the script purpose.
- Keep script names concise. Prefer one to three short English words.
.batfiles must be placed in thebatfolder..ps1files must be placed in theps1folder.- If a
.ps1file is created, a.batfile with the same base name must also be created.
Recommended format:
action_target.bat
action_target.ps1
Examples:
bat/backup_project.bat
ps1/clean_temp_files.ps1
After creating a new script, update the following file:
config/scripts.json
The new script must be added to the scripts array. Its group must be selected according to the existing groups array.
Before a person or AI assistant directly modifies config/scripts.json, run this command immediately before the edit:
npm run backup-configThe backup is written under backup/ with a Windows-compatible local timestamp:
backup/scripts-2026-06-25_21-54-00-123.json
Website operations that create, edit, delete, or reorder scripts and groups automatically create the same backup before writing. If the backup fails, the configuration write is cancelled.
Every website startup removes only automatic backups whose filename timestamp is more than seven days old. Manual files such as backup/scripts.json, malformed names, directories, and unrelated backup content are never removed automatically.
Before adding a script, read the groups array in config/scripts.json and choose the correct groupId based on the script purpose.
Current common groups include:
| Purpose | groupId | Display Name |
|---|---|---|
| Common scripts | 常用 |
常用 |
| Local services | group-mq8b1r2n-6set70 |
本地服务 |
| Developer tools | 开发工具 |
开发工具 |
| Reverse engineering / Android reverse engineering | 安卓逆向 |
逆向 |
| File processing | 文件处理 |
文件处理 |
| Ports and services | 端口与服务 |
端口与服务 |
| Disk cleanup | 磁盘清理 |
磁盘清理 |
| System maintenance | 系统维护 |
系统维护 |
| Network checks | 网络检查 |
网络检查 |
| Proxy tools | group-mq8bcb2k-ih45b6 |
代理 |
| Automation | group-mq9a888i |
自动化 |
| Data-related tools | group-mq9j08xp |
一些数据 |
| Skill tools | skill |
skill |
If the correct group is unclear, ask me first. Do not create a new group without confirmation.
Each new script must add one object to the scripts array.
BAT example:
{
"id": "bat-example_script-bat",
"name": "example_script",
"groupId": "常用",
"path": "bat/example_script.bat",
"description": "Briefly describe what this script does",
"priority": "normal",
"shell": "",
"ports": [],
"order": 100
}PowerShell example:
{
"id": "ps1-example_script-ps1",
"name": "example_script",
"groupId": "group-mq9a888i",
"path": "ps1/example_script.ps1",
"description": "Briefly describe what this script does",
"priority": "normal",
"shell": "",
"ports": [],
"order": 101
}id must be unique.
Recommended format:
bat-file_name_without_extension-bat
ps1-file_name_without_extension-ps1
Keep underscores in file names. Spaces are not allowed.
Examples:
bat-clean_temp-bat
ps1-clean_temp-ps1
name should be the script file name without the extension.
Example:
clean_temp
groupId must use an existing id from the groups array.
Do not confuse the display name with the groupId. Some groups have different display names and IDs.
Example:
Display name: 自动化
groupId: group-mq9a888i
Use a project-relative path:
bat/xxx.bat
ps1/xxx.ps1
Do not use an absolute path for newly created scripts unless I explicitly request it.
description is required.
Rules:
- Use one short sentence to describe the script purpose.
- Use a brief Chinese description for user-facing script entries.
- Do not leave it empty.
- Keep it concise.
Example:
Clean temporary files from the selected directory
Use the default value:
normal
Use an empty string by default:
""Use an empty array by default:
[]If the script starts or occupies specific ports, and I have explicitly provided those ports, fill them in.
Example:
[3000, 8080]order must be the current maximum order value in the scripts array plus 1.
If the current maximum value is 58, the new script should use:
"order": 59A BAT script should preferably include this basic structure:
@echo off
chcp 65001 >nul
setlocal
REM Write script logic here
endlocal
pauseRequirements:
- Use UTF-8 friendly console output.
- Show clear prompts before important operations.
- Dangerous operations must ask for confirmation.
- Wrap paths in quotes whenever possible.
- If the project root is needed, derive it from
%~dp0when appropriate.
A PS1 script should preferably include this basic structure:
$ErrorActionPreference = "Stop"
# Write script logic hereRequirements:
- Use
Join-Pathfor paths. - Use
$PSScriptRootwhen the script directory is needed. - Print clear logs for important operations.
- Dangerous operations must ask for confirmation.
- Do not change critical system settings by default unless I explicitly ask for it.
When creating a new script, the AI assistant must follow this order:
- Confirm the script type: BAT or PS1.
- Create the script in the correct folder:
- BAT:
bat/ - PS1:
ps1/
- BAT:
- Read
config/scripts.json. - Select the correct
groupIdfrom the existinggroupsarray. - Calculate the new
ordervalue. - If the script type is PS1, create a same-name BAT launcher in
bat/. - Run
npm run backup-configimmediately before directly editingconfig/scripts.json. - Append the new script entry to the
scriptsarray. For PS1-backed scripts, register the BAT launcher path by default. - Use a brief Chinese description in the
descriptionfield. - Ensure the JSON format remains valid.
- Do not modify unrelated files.
- Tell me which files were added and which group was used.
If I ask to modify an existing script:
- Only modify the target script file.
- Run
npm run backup-configimmediately before directly modifyingconfig/scripts.json. - Modify
config/scripts.jsononly if the script description, path, group, ports, or other metadata needs to change. - Do not reformat or reorder the entire JSON file unnecessarily.
- Do not delete other script entries.
If I ask to delete a script:
- Delete the corresponding
.bator.ps1file. - Run
npm run backup-configimmediately before directly editingconfig/scripts.json. - Remove the matching entry from the
scriptsarray inconfig/scripts.json. - Do not delete any other scripts.
- Do not delete groups unless I explicitly request it.
- Do not place BAT scripts in the
ps1folder. - Do not place PS1 scripts in the
batfolder. - Do not create new groups without confirmation.
- Do not use absolute paths in the
pathfield for newly created local scripts. - Do not leave
descriptionempty. - Do not modify unrelated project files.
- Do not delete existing configuration entries unless requested.
- Do not break the JSON format of
scripts.json.
After creating a new script, reply using this format:
Completed:
- Added script: bat/xxx.bat or ps1/xxx.ps1
- Updated config: config/scripts.json
- Group: display name / groupId
- Description: one-sentence script description
- No other files were modified