Add OpenStock agent CLI skill
CI / test (push) Successful in 37s

This commit is contained in:
2026-06-09 17:22:59 +09:00
parent 9e4d6aecc7
commit 347c9546ed
34 changed files with 1005 additions and 0 deletions
@@ -0,0 +1,20 @@
# `openstock order buy`
Purpose: place a live KIS domestic stock buy order.
Usage:
```bash
openstock order buy 005930 --qty 1 --price 70000
openstock order buy 005930 --qty 1 --market
```
Inputs: `symbol`, `--qty`, one of `--price` or `--market`.
External IO: KIS live order endpoint.
Side effect: live financial buy order.
Output fields: `broker`, `side`, `symbol`, `qty`, `order_type`, `price`, `order`.
Agent rule: only run after explicit current-user approval for a real order.
@@ -0,0 +1,52 @@
# `openstock order`
## Purpose
Place and query live KIS domestic stock orders.
## Subcommands
| Command | Purpose |
| --- | --- |
| `openstock order buy <symbol> --qty QTY (--price PRICE|--market)` | Place a live buy order. |
| `openstock order sell <symbol> --qty QTY (--price PRICE|--market)` | Place a live sell order. |
| `openstock order status [order_no] [--from YYYYMMDD] [--to YYYYMMDD]` | Query order/execution status. |
## Safety
`buy` and `sell` are live financial orders. Do not run them unless the user explicitly asks for a real order in the current task.
Before placing an order:
1. Run `openstock account status`.
2. Confirm the symbol with `search` or `market`.
3. Confirm side, quantity, order type, and price.
4. Prefer `order status` for verification after order placement.
## IO
| Direction | Data |
| --- | --- |
| Env read | `KIS_ACCESS_TOKEN`, `KIS_APPKEY`, `KIS_APPSECRET`, `KIS_ACCOUNT` |
| External IO | KIS order and order inquiry endpoints. |
| Side effect | `buy` and `sell` place live orders. `status` is read-only. |
## Output Fields
| Field | Meaning |
| --- | --- |
| `broker` | Broker used for order. |
| `side` | `buy` or `sell`. |
| `symbol` | Ordered symbol. |
| `qty` | Order quantity. |
| `order_type` | `limit` or `market`. |
| `price` | Limit price or market-order price representation. |
| `order` | Broker order result. |
| `account` | Account queried for status. |
| `order_no` | Requested order number filter. |
| `orders` | Order/execution list. |
| `summary` | Broker summary values. |
## Agent Notes
For analysis-only tasks, never use `buy` or `sell`. Use `order status` only when order history is relevant.
@@ -0,0 +1,20 @@
# `openstock order sell`
Purpose: place a live KIS domestic stock sell order.
Usage:
```bash
openstock order sell 005930 --qty 1 --price 70000
openstock order sell 005930 --qty 1 --market
```
Inputs: `symbol`, `--qty`, one of `--price` or `--market`.
External IO: KIS live order endpoint.
Side effect: live financial sell order.
Output fields: `broker`, `side`, `symbol`, `qty`, `order_type`, `price`, `order`.
Agent rule: only run after explicit current-user approval for a real order.
@@ -0,0 +1,18 @@
# `openstock order status`
Purpose: query KIS order and execution status.
Usage:
```bash
openstock order status
openstock order status 1234567890 --from 20260601 --to 20260609
```
Inputs: optional `order_no`, `--from`, `--to`.
External IO: KIS order inquiry endpoint.
Output fields: `broker`, `account`, `order_no`, `orders`, `summary`.
Agent rule: read-only; use after order placement or when auditing order history.