codestyle
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCodestyle
Codestyle
Code template management: CLI tools for search/get/upload + AI-guided generation.
代码模板管理:提供搜索/获取/上传功能的CLI工具,同时支持AI引导生成功能。
Decision Tree
决策树
User request
│
├─ "search" / "检索" ──→ Search Workflow (CLI, local+remote)
│
├─ "get" / "获取" ──→ Get Workflow (CLI, local+remote)
│
├─ "generate" / "生成" ──→ Generate Workflow (AI dialog, then upload)
│
└─ "upload" / "上传" ──→ Upload Workflow (CLI, remote)User request
│
├─ "search" / "检索" ──→ Search Workflow (CLI, local+remote)
│
├─ "get" / "获取" ──→ Get Workflow (CLI, local+remote)
│
├─ "generate" / "生成" ──→ Generate Workflow (AI dialog, then upload)
│
└─ "upload" / "上传" ──→ Upload Workflow (CLI, remote)Commands
命令说明
| Command | Execution | Description |
|---|---|---|
| CLI (JAR) | Search templates (local Lucene + remote API) |
| CLI (JAR) | Get full template content |
| AI Dialog | Multi-turn conversation, then call upload |
| CLI (JAR) | Upload template to server |
| 命令 | 执行方式 | 描述 |
|---|---|---|
| CLI (JAR) | 搜索模板(本地Lucene + 远程API) |
| CLI (JAR) | 获取完整模板内容 |
| AI Dialog | 多轮对话交互,完成后调用上传接口 |
| CLI (JAR) | 将模板上传到服务器 |
Quick Start
快速开始
Windows
Windows
bash
"<SKILL_DIR>\scripts\codestyle.bat" search "keyword"
"<SKILL_DIR>\scripts\codestyle.bat" get "template-path"
"<SKILL_DIR>\scripts\codestyle.bat" upload --path ./my-templatebash
"<SKILL_DIR>\scripts\codestyle.bat" search "keyword"
"<SKILL_DIR>\scripts\codestyle.bat" get "template-path"
"<SKILL_DIR>\scripts\codestyle.bat" upload --path ./my-templateLinux/macOS
Linux/macOS
bash
bash <SKILL_DIR>/scripts/codestyle search "keyword"
bash <SKILL_DIR>/scripts/codestyle get "template-path"
bash <SKILL_DIR>/scripts/codestyle upload --path ./my-templatebash
bash <SKILL_DIR>/scripts/codestyle search "keyword"
bash <SKILL_DIR>/scripts/codestyle get "template-path"
bash <SKILL_DIR>/scripts/codestyle upload --path ./my-templateGenerate (AI Dialog)
生成(AI 对话)
User: 把这段代码做成模板:[代码]
AI: [多轮对话引导生成模板]
AI: [调用 upload 存储]User: 把这段代码做成模板:[代码]
AI: [多轮对话引导生成模板]
AI: [调用 upload 存储]Workflows
工作流
See references/ for detailed workflow instructions:
- Search Workflow - Find templates (local+remote)
- Get Workflow - Retrieve template content by full path
- Generate Workflow - AI-guided template creation
- Upload Workflow - Submit templates (remote)
详细工作流说明请查看 references/ 目录:
- Search Workflow - 查找模板(本地+远程)
- Get Workflow - 通过完整路径获取模板内容
- Generate Workflow - AI引导的模板创建流程
- Upload Workflow - 提交模板到远程仓库
Generate Workflow Overview
生成工作流概述
Generate workflow is pure AI dialog, no script calls until final upload.
| Input | Example | Pre-processing |
|---|---|---|
| Code snippet | | None |
| Current file | "当前这个文件" | Read file |
| Local path | | Read file |
| GitHub URL | | Clone repo |
| Web URL | | Crawl content |
Process:
识别输入 → 预处理 → 分析结构 → 选择模板 → AI生成 → 去重检测 → 用户确认 → 调用upload生成工作流为纯AI对话形式,直到最终上传步骤前都不会调用脚本。
| 输入 | 示例 | 预处理操作 |
|---|---|---|
| 代码片段 | | 无 |
| 当前文件 | "当前这个文件" | 读取文件 |
| 本地路径 | | 读取文件 |
| GitHub URL | | 克隆仓库 |
| 网页URL | | 爬取内容 |
处理流程:
识别输入 → 预处理 → 分析结构 → 选择模板 → AI生成 → 去重检测 → 用户确认 → 调用uploadFirst-Time Use
首次使用说明
Automatic initialization on first command:
- Detect no marker
.initialized - Download JAR file (if needed)
- Clone template repository
- Create marker
.initialized - Execute original command
首次执行命令时会自动完成初始化:
- 检测到无 标记文件
.initialized - 下载JAR文件(若需要)
- 克隆模板仓库
- 生成 标记文件
.initialized - 执行原命令
Configuration
配置
See references/config.md for configuration options.
配置选项请查看references/config.md。
Template Format
模板格式
Directory Structure
目录结构
Standard template structure with meta.json in version directory:
<artifactId>/
└── <version>/
├── meta.json # Template metadata (required)
├── README.md # Documentation (optional)
└── <subdirectories> # Template files (.ftl)Example:
CRUD/
└── 1.0.0/
├── meta.json
├── README.md
├── backend/
│ ├── sql/Menu.ftl
│ └── src/main/java/...
└── frontend/
└── src/...See references/template-format.md for complete format specification.
See references/template-syntax.md for template syntax.
标准模板结构要求版本目录下必须包含meta.json:
<artifactId>/
└── <version>/
├── meta.json # 模板元数据(必填)
├── README.md # 说明文档(可选)
└── <subdirectories> # 模板文件(.ftl)示例:
CRUD/
└── 1.0.0/
├── meta.json
├── README.md
├── backend/
│ ├── sql/Menu.ftl
│ └── src/main/java/...
└── frontend/
└── src/...完整格式规范请查看references/template-format.md。
模板语法说明请查看references/template-syntax.md。
Requirements
环境要求
- JDK 17+
- Git 2.0+ (for first-time setup and repo cloning)
- Internet connection (for remote API calls)
- JDK 17+
- Git 2.0+(首次设置和仓库克隆时需要)
- 网络连接(用于调用远程API)