Compare commits
2 Commits
d1aa91f727
...
86e665bcae
| Author | SHA1 | Date | |
|---|---|---|---|
| 86e665bcae | |||
| bc021924e4 |
76
.github/copilot-instructions.md
vendored
76
.github/copilot-instructions.md
vendored
@@ -1,76 +0,0 @@
|
||||
# OpenHIS — AI 编码助手 指南
|
||||
|
||||
目的:帮助自动化/AI 编码代理快速上手本仓库,包含架构要点、关键文件、常用构建/运行命令以及项目约定。请只按照仓库内真实可见的内容提出修改建议或补充说明。
|
||||
|
||||
- **代码组织**: 本项目是一个 Java 后端(多模块 Maven)+ Vue3 前端(Vite)的大型应用。
|
||||
- 后端主模块目录:`openhis-server-new/`(顶层为 `pom`,包含多个子模块)。关键子模块示例:`openhis-application`, `openhis-domain`, `openhis-common`, `core-*` 系列。
|
||||
- 前端目录:`openhis-ui-vue3/`(Vite + Vue 3,使用 Pinia、Element Plus 等)。
|
||||
|
||||
- **大局观(Big Picture)**: 后端以 Spring Boot(Java 17)实现,使用多模块 Maven 管理公共库与业务模块;前端由单独仓库目录通过 Vite 构建并以环境变量(`VITE_APP_BASE_API`)与后端交互。后端扫描 `com.core` 与 `com.openhis` 包(见 `OpenHisApplication.java`),启动类位于:`openhis-server-new/openhis-application/src/main/java/com/openhis/OpenHisApplication.java`。
|
||||
|
||||
- **运行/构建(Windows PowerShell 示例)**:
|
||||
- 构建后端(从仓库根执行):
|
||||
|
||||
```powershell
|
||||
cd openhis-server-new
|
||||
mvn clean package -DskipTests
|
||||
```
|
||||
|
||||
- 仅运行后端模块(开发时常用):
|
||||
|
||||
```powershell
|
||||
cd openhis-server-new/openhis-application
|
||||
mvn spring-boot:run
|
||||
# 或在 IDE 中运行 `com.openhis.OpenHisApplication` 的 main()
|
||||
```
|
||||
|
||||
- 前端启动与构建(需要 Node.js v16.x,仓库 README 建议 v16.15):
|
||||
|
||||
```powershell
|
||||
cd openhis-ui-vue3
|
||||
npm install
|
||||
npm run dev # 本地开发(热重载)
|
||||
npm run build:prod # 生产构建
|
||||
```
|
||||
|
||||
- **环境与配置**:
|
||||
- 后端配置:`openhis-server-new/openhis-application/src/main/resources/application.yml`(数据库、端口、profile 等)。README 还提及 `application-druid.yml`(若存在请优先查看)。
|
||||
- 前端配置:多个 `.env.*` 文件(例如 `.env.development`, `.env.staging`, `.env.production`),关键变量:`VITE_APP_BASE_API`(例如 `/dev-api`),前端通过 `import.meta.env.VITE_APP_BASE_API` 拼接后端 URL(见 `src/utils/request.js`、多个视图与组件)。
|
||||
|
||||
- **重要约定 / 模式**:
|
||||
- 后端采用 Java 17、Spring Boot 2.5.x 家族,父 POM在 `openhis-server-new/pom.xml` 定义。常用依赖版本在该 POM 的 `<properties>` 中集中维护。
|
||||
- 模块间以 Maven 模块依赖与 `com.core` / `com.openhis` 包名分层(见 `pom.xml` 的 `<modules>` 与 `dependencyManagement`)。
|
||||
- 前端通过 Vite 插件配置(`openhis-ui-vue3/vite/plugins`)管理 svg、自动导入等。UI 框架为 Element Plus,状态管理为 Pinia。
|
||||
|
||||
- **集成点 & 外部依赖**:
|
||||
- 数据库:PostgreSQL(README 建议 v16.2),仓库根含一个大型初始化 SQL:`数据库初始话脚本(请使用navicat16版本导入).sql`,用于初始化表与演示数据。
|
||||
- 缓存/会话:Redis(需自行配置)。
|
||||
- 其他:Flowable(工作流),Druid(连接池监控),第三方服务通过特定配置类(例如 `YbServiceConfig` 在 `OpenHisApplication` 中启用)。
|
||||
|
||||
- **调试与常见位置**:
|
||||
- 启动类:`openhis-server-new/openhis-application/src/main/java/com/openhis/OpenHisApplication.java`。
|
||||
- 全局配置:`openhis-server-new/openhis-application/src/main/resources/`(`application.yml`、profile 文件等)。
|
||||
- 前端入口:`openhis-ui-vue3/src/main.js`、路由在 `openhis-ui-vue3/src/router/index.js`。
|
||||
- API 文档与监控路径(通常由后端暴露并被前端访问):
|
||||
- Swagger UI: `<VITE_APP_BASE_API>/swagger-ui/index.html`(前端视图在 `src/views/tool/swagger/index.vue`)。
|
||||
- Druid: `<VITE_APP_BASE_API>/druid/login.html`(见前端相关视图引用)。
|
||||
|
||||
- **为 AI 代理的具体建议(如何安全、有效地修改代码)**:
|
||||
- 修改后端时:优先在子模块(例如 `openhis-application`)本地运行 `mvn spring-boot:run` 验证启动与基础 API;大量改动前先执行 `mvn -T1C -DskipTests clean package` 在 CI 环境上验证构建(本地机器也可用)。
|
||||
- 修改前端时:检查/调整对应 `.env.*` 文件中的 `VITE_APP_BASE_API`,使用 `npm run dev` 本地联调后端接口(可通过代理或将 `VITE_APP_BASE_API` 指向后端地址)。
|
||||
- 修改数据库结构或 seed:请参考仓库根的 SQL 初始化脚本,任何 DDL/数据变更需同步该脚本并通知数据库管理员/运维。
|
||||
|
||||
- **举例(常见任务示例)**:
|
||||
- 本地联调前端 + 后端(PowerShell):
|
||||
|
||||
```powershell
|
||||
# 启动后端
|
||||
cd openhis-server-new/openhis-application
|
||||
mvn spring-boot:run
|
||||
|
||||
# 启动前端(另开终端)
|
||||
cd openhis-ui-vue3
|
||||
npm run dev
|
||||
```
|
||||
|
||||
如需我把这些内容合并为更短或更详细的版本,或把其中某部分(例如后端模块依赖关系图、关键 Java 包说明)展开,请告诉我要增强哪一节。
|
||||
@@ -1 +0,0 @@
|
||||
seeded
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
description: "Get started"
|
||||
---
|
||||
|
||||
get started
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
description: "Safe, practical file workflows"
|
||||
---
|
||||
|
||||
Show me how to interact with files in this workspace. Include safe examples for reading, summarizing, and editing.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
description: "What plugins are and how to install them"
|
||||
---
|
||||
|
||||
Explain what plugins are and how to install them in this workspace.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
description: "How skills work and how to create your own"
|
||||
---
|
||||
|
||||
Explain what skills are, how to use them, and how to create a new skill for this workspace.
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"version": 1,
|
||||
"workspace": {
|
||||
"name": "his",
|
||||
"createdAt": 1770354192916,
|
||||
"preset": "starter"
|
||||
},
|
||||
"authorizedRoots": [
|
||||
"D:\\his"
|
||||
]
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
# No environment variables are required for this skill.
|
||||
@@ -1,51 +0,0 @@
|
||||
---
|
||||
name: agent-creator
|
||||
description: Create new OpenCode agents with a gpt-5.2-codex default.
|
||||
---
|
||||
|
||||
## Quick Usage (Already Configured)
|
||||
|
||||
### Create a project agent
|
||||
```bash
|
||||
opencode agent create
|
||||
```
|
||||
|
||||
### Agent file locations
|
||||
- Project agents: `.opencode/agents/<name>.md`
|
||||
- Global agents: `~/.config/opencode/agents/<name>.md`
|
||||
|
||||
## Default model
|
||||
|
||||
Use `gpt-5.2-codex` as the default model for new agents unless a workflow needs a different model.
|
||||
|
||||
## Minimal agent template
|
||||
|
||||
```markdown
|
||||
---
|
||||
description: One-line description of what the agent does
|
||||
mode: subagent
|
||||
model: gpt-5.2-codex
|
||||
tools:
|
||||
write: false
|
||||
edit: false
|
||||
bash: false
|
||||
---
|
||||
You are a specialized agent. Describe your task, boundaries, and expected output.
|
||||
```
|
||||
|
||||
## Notes from OpenCode docs
|
||||
|
||||
- Agent files are markdown with YAML frontmatter.
|
||||
- The markdown filename becomes the agent name.
|
||||
- Set `mode` to `primary`, `subagent`, or `all`.
|
||||
- If no model is specified, subagents inherit the caller model.
|
||||
- `tools` controls per-agent tool access.
|
||||
|
||||
## Reference
|
||||
|
||||
Follow the official OpenCode agent docs: https://opencode.ai/docs/agents/
|
||||
|
||||
## First-Time Setup (If Not Configured)
|
||||
|
||||
1. Run `opencode agent create` and choose project scope.
|
||||
2. Paste in the default template above and adjust tools as needed.
|
||||
@@ -1,3 +0,0 @@
|
||||
export type AgentCreatorClient = Record<string, never>;
|
||||
|
||||
export const client: AgentCreatorClient = {};
|
||||
@@ -1,10 +0,0 @@
|
||||
import { config } from "./load-env";
|
||||
|
||||
async function main() {
|
||||
void config;
|
||||
console.log("agent-creator: no credentials required.");
|
||||
}
|
||||
|
||||
main().catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -1,3 +0,0 @@
|
||||
export type AgentCreatorConfig = Record<string, never>;
|
||||
|
||||
export const config: AgentCreatorConfig = {};
|
||||
@@ -1 +0,0 @@
|
||||
# No environment variables are required for this skill.
|
||||
@@ -1,8 +0,0 @@
|
||||
# Required credentials (if any)
|
||||
# - List the credential name
|
||||
# - Where to obtain it
|
||||
# - How to store it locally
|
||||
|
||||
# Example:
|
||||
# - GITHUB_TOKEN: https://github.com/settings/tokens
|
||||
# - Store in .env (gitignored)
|
||||
@@ -1,352 +0,0 @@
|
||||
---
|
||||
name: command-creator
|
||||
description: Create OpenCode custom commands for repeatable tasks.
|
||||
---
|
||||
|
||||
## Quick Usage (Already Configured)
|
||||
|
||||
### Create a new command file
|
||||
```bash
|
||||
mkdir -p .opencode/commands
|
||||
```
|
||||
|
||||
Create `.opencode/commands/<name>.md` with frontmatter and a prompt template.
|
||||
|
||||
### Command file example
|
||||
```
|
||||
---
|
||||
description: Run tests with coverage
|
||||
agent: build
|
||||
model: gpt-5.2-codex
|
||||
---
|
||||
|
||||
Run the full test suite with coverage report and show any failures.
|
||||
Focus on the failing tests and suggest fixes.
|
||||
```
|
||||
|
||||
## Prompt config essentials
|
||||
|
||||
- Use `$ARGUMENTS` for all arguments, or `$1`, `$2`, `$3` for positional args.
|
||||
- Use `!\`command\`` to inject shell output into the prompt.
|
||||
- Use `@path/to/file` to include file contents in the prompt.
|
||||
|
||||
## Notes from OpenCode docs
|
||||
|
||||
- Command files live in `.opencode/commands/` (project) or `~/.config/opencode/commands/` (global).
|
||||
- The markdown filename becomes the command name (e.g., `test.md` → `/test`).
|
||||
- JSON config also supports commands in `opencode.json` under `command`.
|
||||
- Custom commands can override built-ins like `/init`, `/undo`, `/redo`, `/share`, `/help`.
|
||||
|
||||
## Reference
|
||||
|
||||
Follow the official OpenCode command docs: https://opencode.ai/docs/commands/
|
||||
Use the docs as the escape hatch when unsure.
|
||||
|
||||
## Docs snapshot
|
||||
|
||||
Skip to content
|
||||
OpenCode
|
||||
|
||||
Search
|
||||
⌘
|
||||
K
|
||||
Intro
|
||||
Config
|
||||
Providers
|
||||
Network
|
||||
Enterprise
|
||||
Troubleshooting
|
||||
Migrating to 1.0
|
||||
TUI
|
||||
CLI
|
||||
Web
|
||||
IDE
|
||||
Zen
|
||||
Share
|
||||
GitHub
|
||||
GitLab
|
||||
Tools
|
||||
Rules
|
||||
Agents
|
||||
Models
|
||||
Themes
|
||||
Keybinds
|
||||
Commands
|
||||
Formatters
|
||||
Permissions
|
||||
LSP Servers
|
||||
MCP servers
|
||||
ACP Support
|
||||
Agent Skills
|
||||
Custom Tools
|
||||
SDK
|
||||
Server
|
||||
Plugins
|
||||
Ecosystem
|
||||
On this page
|
||||
Overview
|
||||
Create command files
|
||||
Configure
|
||||
JSON
|
||||
Markdown
|
||||
Prompt config
|
||||
Arguments
|
||||
Shell output
|
||||
File references
|
||||
Options
|
||||
Template
|
||||
Description
|
||||
Agent
|
||||
Subtask
|
||||
Model
|
||||
Built-in
|
||||
Commands
|
||||
Create custom commands for repetitive tasks.
|
||||
|
||||
Custom commands let you specify a prompt you want to run when that command is executed in the TUI.
|
||||
|
||||
/my-command
|
||||
|
||||
Custom commands are in addition to the built-in commands like /init, /undo, /redo, /share, /help. Learn more.
|
||||
|
||||
Create command files
|
||||
Create markdown files in the commands/ directory to define custom commands.
|
||||
|
||||
Create .opencode/commands/test.md:
|
||||
|
||||
.opencode/commands/test.md
|
||||
---
|
||||
description: Run tests with coverage
|
||||
agent: build
|
||||
model: anthropic/claude-3-sonnet-20241022
|
||||
---
|
||||
|
||||
Run the full test suite with coverage report and show any failures.
|
||||
Focus on the failing tests and suggest fixes.
|
||||
|
||||
The frontmatter defines command properties. The content becomes the template.
|
||||
|
||||
Use the command by typing / followed by the command name.
|
||||
|
||||
"/test"
|
||||
|
||||
Configure
|
||||
You can add custom commands through the OpenCode config or by creating markdown files in the commands/ directory.
|
||||
|
||||
JSON
|
||||
Use the command option in your OpenCode config:
|
||||
|
||||
opencode.jsonc
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"command": {
|
||||
// This becomes the name of the command
|
||||
"test": {
|
||||
// This is the prompt that will be sent to the LLM
|
||||
"template": "Run the full test suite with coverage report and show any failures.\nFocus on the failing tests and suggest fixes.",
|
||||
// This is shown as the description in the TUI
|
||||
"description": "Run tests with coverage",
|
||||
"agent": "build",
|
||||
"model": "anthropic/claude-3-5-sonnet-20241022"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Now you can run this command in the TUI:
|
||||
|
||||
/test
|
||||
|
||||
Markdown
|
||||
You can also define commands using markdown files. Place them in:
|
||||
|
||||
Global: ~/.config/opencode/commands/
|
||||
Per-project: .opencode/commands/
|
||||
~/.config/opencode/commands/test.md
|
||||
---
|
||||
description: Run tests with coverage
|
||||
agent: build
|
||||
model: anthropic/claude-3-5-sonnet-20241022
|
||||
---
|
||||
|
||||
Run the full test suite with coverage report and show any failures.
|
||||
Focus on the failing tests and suggest fixes.
|
||||
|
||||
The markdown file name becomes the command name. For example, test.md lets you run:
|
||||
|
||||
/test
|
||||
|
||||
Prompt config
|
||||
The prompts for the custom commands support several special placeholders and syntax.
|
||||
|
||||
Arguments
|
||||
Pass arguments to commands using the $ARGUMENTS placeholder.
|
||||
|
||||
.opencode/commands/component.md
|
||||
---
|
||||
description: Create a new component
|
||||
---
|
||||
|
||||
Create a new React component named $ARGUMENTS with TypeScript support.
|
||||
Include proper typing and basic structure.
|
||||
|
||||
Run the command with arguments:
|
||||
|
||||
/component Button
|
||||
|
||||
And $ARGUMENTS will be replaced with Button.
|
||||
|
||||
You can also access individual arguments using positional parameters:
|
||||
|
||||
$1 - First argument
|
||||
$2 - Second argument
|
||||
$3 - Third argument
|
||||
And so on…
|
||||
For example:
|
||||
|
||||
.opencode/commands/create-file.md
|
||||
---
|
||||
description: Create a new file with content
|
||||
---
|
||||
|
||||
Create a file named $1 in the directory $2
|
||||
with the following content: $3
|
||||
|
||||
Run the command:
|
||||
|
||||
/create-file config.json src "{ \"key\": \"value\" }"
|
||||
|
||||
This replaces:
|
||||
|
||||
$1 with config.json
|
||||
$2 with src
|
||||
$3 with { "key": "value" }
|
||||
Shell output
|
||||
Use !command to inject bash command output into your prompt.
|
||||
|
||||
For example, to create a custom command that analyzes test coverage:
|
||||
|
||||
.opencode/commands/analyze-coverage.md
|
||||
---
|
||||
description: Analyze test coverage
|
||||
---
|
||||
|
||||
Here are the current test results:
|
||||
!`npm test`
|
||||
|
||||
Based on these results, suggest improvements to increase coverage.
|
||||
|
||||
Or to review recent changes:
|
||||
|
||||
.opencode/commands/review-changes.md
|
||||
---
|
||||
description: Review recent changes
|
||||
---
|
||||
|
||||
Recent git commits:
|
||||
!`git log --oneline -10`
|
||||
|
||||
Review these changes and suggest any improvements.
|
||||
|
||||
Commands run in your project’s root directory and theutput becomes part of the prompt.
|
||||
|
||||
File references
|
||||
Include files in your command using @ followed by the filename.
|
||||
|
||||
.opencode/commands/review-component.md
|
||||
---
|
||||
description: Review component
|
||||
---
|
||||
|
||||
Review the component in @src/components/Button.tsx.
|
||||
Check for performance issues and suggest improvements.
|
||||
|
||||
The file content gets included in the prompt automatically.
|
||||
|
||||
Options
|
||||
Let’s look at the configuration options in detail.
|
||||
|
||||
Template
|
||||
The template option defines the prompt that will be sent to the LLM when the command is executed.
|
||||
|
||||
opencode.json
|
||||
{
|
||||
"command": {
|
||||
"test": {
|
||||
"template": "Run the full test suite with coverage report and show any failures.\nFocus on the failing tests and suggest fixes."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
This is a required config option.
|
||||
|
||||
Description
|
||||
Use the description option to provide a brief description of what the command does.
|
||||
|
||||
opencode.json
|
||||
{
|
||||
"command": {
|
||||
"test": {
|
||||
"description": "Run tests with coverage"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
This is shown as the description in the TUI when you type ithe command.
|
||||
|
||||
Agent
|
||||
Use the agent config to optionally specify which agent should execute this command. If this is a subagent the command will trigger a subagent invocation by default. To disable this behavior, set subtask to false.
|
||||
|
||||
opencode.json
|
||||
{
|
||||
"command": {
|
||||
"review": {
|
||||
"agent": "plan"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
This is an optional config option. If not specified, defaults to your current agent.
|
||||
|
||||
Subtask
|
||||
Use the subtask boolean to force the command to trigger a subagent invocation. This is useful if you want the command to not pollute your primary context and will force the agent to act as a subagent, even if mode is set to primary on the agent configuration.
|
||||
|
||||
opencode.json
|
||||
{
|
||||
"command": {
|
||||
"analyze": {
|
||||
"subtask": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
This is an optional config option.
|
||||
|
||||
Model
|
||||
Use the model config to override the default model for this command.
|
||||
|
||||
opencode.json
|
||||
{
|
||||
"command": {
|
||||
"analyze": {
|
||||
"model": "anthropic/claude-3-5-sonnet-20241022"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
This is an optional config option.
|
||||
|
||||
Built-in
|
||||
opencode includes several built-in commands like /init, /undo, /redo, /share, /help; learn more.
|
||||
|
||||
Note
|
||||
|
||||
Custom commands can override built-in commands.
|
||||
|
||||
If you define a custom command with the same name, it will override the built-in command.
|
||||
|
||||
Edit this page
|
||||
Find a bug? Open an issue
|
||||
Join our Discord community
|
||||
© Anomaly
|
||||
|
||||
Jan 24, 2026
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
name: get-started
|
||||
description: Guide users through the get started setup and Chrome DevTools demo.
|
||||
---
|
||||
|
||||
## When to use
|
||||
- Always load this skill when the user says \"get started\".
|
||||
|
||||
## What to do
|
||||
- Reply with these four lines, exactly and in order:
|
||||
1) hey there welcome this is openwork
|
||||
2) we've pre-configured you with a couple tools
|
||||
3) Get Started
|
||||
4) write \"hey go on google.com\"
|
||||
|
||||
## Then
|
||||
- If the user writes \"go on google.com\" (or \"hey go on google.com\"), use the chrome-devtools MCP to open the site.
|
||||
- After the navigation completes, reply: \"I'm on <site>\" where <site> is the final URL or page title they asked for.
|
||||
@@ -1 +0,0 @@
|
||||
# No environment variables are required for this skill.
|
||||
@@ -1,8 +0,0 @@
|
||||
# Required credentials (if any)
|
||||
# - List the credential name
|
||||
# - Where to obtain it
|
||||
# - How to store it locally
|
||||
|
||||
# Example:
|
||||
# - GITHUB_TOKEN: https://github.com/settings/tokens
|
||||
# - Store in .env (gitignored)
|
||||
@@ -1,41 +0,0 @@
|
||||
---
|
||||
name: plugin-creator
|
||||
description: Create OpenCode plugins and know where to load them.
|
||||
---
|
||||
|
||||
## Quick Usage (Already Configured)
|
||||
|
||||
### Where plugins live
|
||||
- Project plugins: `.opencode/plugins/*.js` or `.opencode/plugins/*.ts`
|
||||
- Global plugins: `~/.config/opencode/plugins/*.js` or `.ts`
|
||||
|
||||
### Load from npm
|
||||
Add npm plugin packages in `opencode.json`:
|
||||
```json
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"plugin": ["opencode-helicone-session", "opencode-wakatime"]
|
||||
}
|
||||
```
|
||||
|
||||
## Minimal plugin template
|
||||
|
||||
```ts
|
||||
export const MyPlugin = async ({ project, client, $, directory, worktree }) => {
|
||||
return {
|
||||
// Hook implementations go here
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Notes from OpenCode docs
|
||||
|
||||
- Plugins are JS/TS modules exporting one or more plugin functions.
|
||||
- Local plugins are loaded directly from the plugin directory.
|
||||
- NPM plugins are installed via Bun at startup and cached in `~/.cache/opencode/node_modules/`.
|
||||
- Load order: global config → project config → global plugins → project plugins.
|
||||
|
||||
## Reference
|
||||
|
||||
Follow the official OpenCode plugin docs: https://opencode.ai/docs/plugins/
|
||||
Use the docs as the escape hatch when unsure.
|
||||
@@ -1 +0,0 @@
|
||||
# No environment variables are required for this skill.
|
||||
@@ -1,8 +0,0 @@
|
||||
# Required credentials (if any)
|
||||
# - List the credential name
|
||||
# - Where to obtain it
|
||||
# - How to store it locally
|
||||
|
||||
# Example:
|
||||
# - GITHUB_TOKEN: https://github.com/settings/tokens
|
||||
# - Store in .env (gitignored)
|
||||
@@ -1,101 +0,0 @@
|
||||
---
|
||||
name: skill-creator
|
||||
description: Create new OpenCode skills with the standard scaffold.
|
||||
---
|
||||
|
||||
Skill creator helps create other skills that are self-buildable.
|
||||
|
||||
The best way to use it is after a user already executed a flow and says: create a skill for this. Alternatively, if the user asks for a skill to be created, suggest they do the task first and ask for skill creation at the end.
|
||||
|
||||
This should trigger this scaffold:
|
||||
- If the user needed to configure things, create a `.env.example` without credentials and include all required variables.
|
||||
- Ask the user if they want to store credentials. If yes, write them to a `.env` file in the skill, and suggest rotating keys later.
|
||||
- Always add a `.gitignore` in the skill that ignores `.env`, and verify `.env` is not tracked.
|
||||
- If the user needed to interact with an API and you created scripts, add reusable scripts under `scripts/`.
|
||||
- New skills should explain how to use the `scripts/` and that `.env.example` defines the minimum config.
|
||||
- Skills should state that they infer what they can do from the available config.
|
||||
|
||||
## Trigger phrases (critical)
|
||||
|
||||
The description field is how Claude decides when to use your skill.
|
||||
Include 2-3 specific phrases that should trigger it.
|
||||
|
||||
Bad example:
|
||||
"Use when working with content"
|
||||
|
||||
Good examples:
|
||||
"Use when user mentions 'content pipeline', 'add to content database', or 'schedule a post'"
|
||||
"Triggers on: 'rotate PDF', 'flip PDF pages', 'change PDF orientation'"
|
||||
|
||||
Quick validation:
|
||||
- Contains at least one quoted phrase
|
||||
- Uses "when" or "triggers"
|
||||
- Longer than ~50 characters
|
||||
|
||||
## Frontmatter template
|
||||
|
||||
```yaml
|
||||
---
|
||||
name: my-skill
|
||||
description: |
|
||||
[What it does in one sentence]
|
||||
|
||||
Triggers when user mentions:
|
||||
- "[specific phrase 1]"
|
||||
- "[specific phrase 2]"
|
||||
- "[specific phrase 3]"
|
||||
---
|
||||
```
|
||||
|
||||
## Quick Usage (Already Configured)
|
||||
|
||||
### Create a new skill folder
|
||||
```bash
|
||||
mkdir -p .opencode/skills/<skill-name>
|
||||
```
|
||||
|
||||
### Minimum scaffold files
|
||||
- `SKILL.md`
|
||||
- `scripts/`
|
||||
- `.env`
|
||||
- `.env.example` (use this to guide the minimum config)
|
||||
- `.gitignore` (ignore `.env`)
|
||||
|
||||
## .env (credentials + config)
|
||||
|
||||
- Use `.env.example` to document required credentials or external setup.
|
||||
- Do not include any real credentials in `.env.example`.
|
||||
|
||||
## Minimal skill template
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: skill-name
|
||||
description: One-line description
|
||||
---
|
||||
|
||||
## Quick Usage (Already Configured)
|
||||
|
||||
### Action 1
|
||||
```bash
|
||||
command here
|
||||
```
|
||||
|
||||
## Common Gotchas
|
||||
|
||||
- Thing that doesn't work as expected
|
||||
|
||||
## First-Time Setup (If Not Configured)
|
||||
|
||||
1. ...
|
||||
```
|
||||
|
||||
## Notes from OpenCode docs
|
||||
|
||||
- Skill folders live in `.opencode/skills/<name>/SKILL.md`.
|
||||
- `name` must be lowercase and match the folder.
|
||||
- Frontmatter requires `name` and `description`.
|
||||
|
||||
## Reference
|
||||
|
||||
Follow the official OpenCode skills docs: https://opencode.ai/docs/skills/
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
name: workspace-guide
|
||||
description: Workspace guide to introduce OpenWork and onboard new users.
|
||||
---
|
||||
|
||||
# Welcome to OpenWork
|
||||
|
||||
Hi, I'm Ben and this is OpenWork. It's an open-source alternative to Claude's cowork. It helps you work on your files with AI and automate the mundane tasks so you don't have to.
|
||||
|
||||
Before we start, use the question tool to ask:
|
||||
"Are you more technical or non-technical? I'll tailor the explanation."
|
||||
|
||||
## If the person is non-technical
|
||||
OpenWork feels like a chat app, but it can safely work with the files you allow. Put files in this workspace and I can summarize them, create new ones, or help organize them.
|
||||
|
||||
Try:
|
||||
- "Summarize the files in this workspace."
|
||||
- "Create a checklist for my week."
|
||||
- "Draft a short summary from this document."
|
||||
|
||||
## Skills and plugins (simple)
|
||||
Skills add new capabilities. Plugins add advanced features like scheduling or browser automation. We can add them later when you're ready.
|
||||
|
||||
## If the person is technical
|
||||
OpenWork is a GUI for OpenCode. Everything that works in OpenCode works here.
|
||||
|
||||
Most reliable setup today:
|
||||
1) Install OpenCode from opencode.ai
|
||||
2) Configure providers there (models and API keys)
|
||||
3) Come back to OpenWork and start a session
|
||||
|
||||
Skills:
|
||||
- Install from the Skills tab, or add them to this workspace.
|
||||
- Docs: https://opencode.ai/docs/skills
|
||||
|
||||
Plugins:
|
||||
- Configure in opencode.json or use the Plugins tab.
|
||||
- Docs: https://opencode.ai/docs/plugins/
|
||||
|
||||
MCP servers:
|
||||
- Add external tools via opencode.json.
|
||||
- Docs: https://opencode.ai/docs/mcp-servers/
|
||||
|
||||
Config reference:
|
||||
- Docs: https://opencode.ai/docs/config/
|
||||
|
||||
End with two friendly next actions to try in OpenWork.
|
||||
@@ -1,26 +0,0 @@
|
||||
# 修复门诊预约界面专家号查询结果显示问题
|
||||
|
||||
## 问题分析
|
||||
1. 前端传递的参数正确:`type=expert`,后端正确转换为`ticketType=专家`
|
||||
2. 实际查询返回了5条记录,但COUNT查询只返回了1条记录
|
||||
3. 这导致前端只显示了1条记录,而不是全部5条
|
||||
4. 原因:MyBatis-Plus自动生成的COUNT查询和实际查询使用了不同的条件,特别是逻辑删除条件
|
||||
|
||||
## 解决方案
|
||||
1. 修改TicketMapper.xml中的自定义COUNT查询,显式添加`delete_flag = '0'`条件
|
||||
2. 在selectTicketPage和selectTicketPage_mpCount查询中都添加逻辑删除条件
|
||||
3. 确保两个查询使用完全相同的WHERE条件
|
||||
|
||||
## 修复步骤
|
||||
1. 修改`selectTicketPage`查询,添加逻辑删除条件`and delete_flag = '0'`
|
||||
2. 修改`selectTicketPage_mpCount`查询,添加逻辑删除条件`and delete_flag = '0'`
|
||||
3. 确保两个查询的WHERE条件完全一致
|
||||
4. 测试修复后的功能,确保专家号能正确显示全部5条记录
|
||||
|
||||
## 代码修改点
|
||||
- 文件:`d:/work/openhis-server-new/openhis-domain/src/main/resources/mapper/clinical/TicketMapper.xml`
|
||||
- 查询:`selectTicketPage` 和 `selectTicketPage_mpCount`
|
||||
- 修改内容:添加逻辑删除条件`and delete_flag = '0'`
|
||||
|
||||
## 预期效果
|
||||
修复后,COUNT查询和实际查询将使用完全相同的条件,包括逻辑删除条件,从而确保COUNT查询返回正确的总记录数,前端能显示所有5条专家号记录。
|
||||
@@ -1,30 +0,0 @@
|
||||
# 修复门诊预约界面专家号查询COUNT结果不正确问题
|
||||
|
||||
## 问题分析
|
||||
1. 前端传递的参数正确:`type=expert`,后端正确转换为`ticketType=专家`
|
||||
2. COUNT查询和实际查询的WHERE条件完全相同:`WHERE delete_flag = '0' AND ticket_type = '专家'`
|
||||
3. 但COUNT查询只返回1条记录,而实际查询返回5条记录
|
||||
4. 原因:MyBatis-Plus的分页插件在处理自定义COUNT查询时,存在bug,导致COUNT查询结果不正确
|
||||
|
||||
## 解决方案
|
||||
修改`TicketAppServiceImpl.java`中的`listTicket`方法,不使用MyBatis-Plus的自动分页功能,而是手动实现分页查询:
|
||||
1. 直接调用`ticketService.countTickets`方法获取总记录数
|
||||
2. 手动构建查询条件
|
||||
3. 确保COUNT查询和实际查询使用完全相同的条件
|
||||
|
||||
## 修复步骤
|
||||
1. 修改`TicketAppServiceImpl.java`中的`listTicket`方法
|
||||
2. 手动实现分页查询,包括:
|
||||
- 构建查询条件
|
||||
- 调用`countTickets`获取总记录数
|
||||
- 调用`selectTicketList`获取分页数据
|
||||
- 手动组装分页结果
|
||||
3. 测试修复后的功能,确保专家号能正确显示全部5条记录
|
||||
|
||||
## 代码修改点
|
||||
- 文件:`d:/work/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointmentmanage/appservice/impl/TicketAppServiceImpl.java`
|
||||
- 方法:`listTicket`
|
||||
- 修改内容:替换MyBatis-Plus的自动分页,改为手动分页实现
|
||||
|
||||
## 预期效果
|
||||
修复后,COUNT查询和实际查询将使用完全相同的条件,COUNT查询将返回正确的总记录数(5条),前端能显示所有5条专家号记录。
|
||||
@@ -1,32 +0,0 @@
|
||||
## 问题分析
|
||||
根据日志和代码分析,发现号源列表显示"没有更多数据了"的问题原因:
|
||||
|
||||
1. **后端查询正常**:成功查询到5条符合条件的专家号源记录
|
||||
2. **数据转换失败**:在`convertToDto`方法中,`fee`字段类型转换错误
|
||||
3. **响应返回空列表**:由于转换异常,最终返回给前端的号源列表为空
|
||||
|
||||
## 问题根源
|
||||
- `Ticket`实体类的`fee`字段为**BigDecimal类型**(数据库存储)
|
||||
- `TicketDto`类的`fee`字段为**String类型**(前端展示)
|
||||
- 在`convertToDto`方法中,直接将BigDecimal类型的`fee`赋值给String类型的`fee`,导致**ClassCastException**
|
||||
|
||||
## 修复方案
|
||||
修改`TicketAppServiceImpl.java`文件中的`convertToDto`方法,将BigDecimal类型的`fee`转换为String类型:
|
||||
|
||||
```java
|
||||
// 原代码
|
||||
dto.setFee(ticket.getFee());
|
||||
|
||||
// 修复后代码
|
||||
dto.setFee(ticket.getFee().toString());
|
||||
```
|
||||
|
||||
## 预期效果
|
||||
1. 修复后,后端能成功将`Ticket`实体转换为`TicketDto`
|
||||
2. 前端能接收到包含5条专家号源的完整列表
|
||||
3. 页面显示正常,不再出现"没有更多数据了"的提示
|
||||
|
||||
## 验证方法
|
||||
1. 重新启动项目,访问号源管理页面
|
||||
2. 选择"专家号"类型,查看是否能正确显示5条号源记录
|
||||
3. 检查日志,确认没有类型转换异常
|
||||
@@ -1,23 +0,0 @@
|
||||
# 修复门诊预约界面专家号查询问题
|
||||
|
||||
## 问题分析
|
||||
从日志中发现关键问题:
|
||||
- 前端传递的ticket_type值是英文:`general` (普通号) 和 `expert` (专家号)
|
||||
- 数据库中存储的ticket_type值是中文:`普通` 和 `专家`
|
||||
- 导致查询条件不匹配,无法查询到数据
|
||||
|
||||
## 解决方案
|
||||
需要在后端添加类型映射转换,将前端传递的英文类型转换为数据库中存储的中文类型。
|
||||
|
||||
## 修复步骤
|
||||
1. 修改 `TicketAppServiceImpl.java` 文件,在处理type参数时添加映射转换逻辑
|
||||
2. 添加从英文类型到中文类型的映射关系
|
||||
3. 测试修复后的功能,确保普通号和专家号都能正确查询
|
||||
|
||||
## 代码修改点
|
||||
- 文件:`d:/work/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointmentmanage/appservice/impl/TicketAppServiceImpl.java`
|
||||
- 方法:`listTicket` 中的type参数处理部分
|
||||
- 修改内容:添加类型映射转换,将 "general" 转换为 "普通","expert" 转换为 "专家"
|
||||
|
||||
## 预期效果
|
||||
修复后,前端选择"普通号"或"专家号"时,系统能正确查询到对应的号源数据,不再出现"没有更多数据了"的提示。
|
||||
@@ -1,23 +0,0 @@
|
||||
**问题分析**:
|
||||
后端返回的响应格式是`{code: 200, msg: "操作成功", data: {total: 5, limit: 20, page: 1, list: [5条记录]}}`,而前端可能期望直接访问`list`属性,导致只能显示1条数据。
|
||||
|
||||
**修复方案**:
|
||||
|
||||
1. 修改`TicketAppServiceImpl.java`的`listTicket`方法,确保返回的分页数据格式正确
|
||||
2. 调整响应结构,使其更符合前端期望
|
||||
3. 保持与现有代码的兼容性
|
||||
|
||||
**修改点**:
|
||||
|
||||
* `TicketAppServiceImpl.java`:优化`listTicket`方法的响应格式
|
||||
|
||||
* 确保分页信息和列表数据都能正确返回给前端
|
||||
|
||||
**预期效果**:
|
||||
|
||||
* 后端返回正确格式的响应数据
|
||||
|
||||
* 前端能够正确显示所有5条专家号数据
|
||||
|
||||
* 保持与现有代码的兼容性
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,57 +0,0 @@
|
||||
-- adm_doctor_schedule definition
|
||||
|
||||
-- Drop table
|
||||
|
||||
-- DROP TABLE adm_doctor_schedule;
|
||||
|
||||
CREATE TABLE adm_doctor_schedule (
|
||||
id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
weekday VARCHAR(50) NULL,
|
||||
time_period VARCHAR(50) NULL,
|
||||
doctor VARCHAR(100) NULL,
|
||||
clinic VARCHAR(100) NULL,
|
||||
start_time TIME NULL,
|
||||
end_time TIME NULL,
|
||||
limit_number INTEGER NULL,
|
||||
call_sign_record VARCHAR(500) NOT NULL DEFAULT '',
|
||||
register_item VARCHAR(200) NULL,
|
||||
register_fee INTEGER NULL,
|
||||
diagnosis_item VARCHAR(200) NULL,
|
||||
diagnosis_fee INTEGER NULL,
|
||||
is_online BOOLEAN NULL,
|
||||
is_stopped BOOLEAN NULL,
|
||||
stop_reason VARCHAR(500) NULL,
|
||||
dept_id INTEGER NULL,
|
||||
create_time TIMESTAMPTZ(6) NULL,
|
||||
update_time TIMESTAMPTZ(6) NULL
|
||||
);
|
||||
|
||||
COMMENT ON TABLE adm_doctor_schedule IS '医生排班表';
|
||||
|
||||
-- Column comments
|
||||
|
||||
COMMENT ON COLUMN adm_doctor_schedule.id IS '主键ID(GENERATED ALWAYS)';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.weekday IS '星期';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.time_period IS '时段(上午/下午)';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.doctor IS '医生姓名';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.clinic IS '诊室';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.start_time IS '开始时间';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.end_time IS '结束时间';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.limit_number IS '限号数量';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.call_sign_record IS '号源记录';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.register_item IS '挂号项目';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.register_fee IS '挂号费';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.diagnosis_item IS '诊查项目';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.diagnosis_fee IS '诊疗费';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.is_online IS '是否线上挂号';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.is_stopped IS '是否停诊';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.stop_reason IS '停诊原因';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.dept_id IS '关联科室ID';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.create_time IS '创建时间';
|
||||
COMMENT ON COLUMN adm_doctor_schedule.update_time IS '更新时间';
|
||||
|
||||
-- 插入迁移记录
|
||||
INSERT INTO __MigrationsHistory (MigrationId, ProductVersion)
|
||||
VALUES ('202512251200 add_table adm_doctor_schedule', '1.0.0');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user