| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
Tags
- 명심보감
- 공부집중
- 코틀린
- gemini-cli
- 오픈소스
- kotlin
- Android
- 오늘의역사
- 명언
- ASMR
- 명상명언
- FSM
- 명언모음
- 장자명언
- 이모지메모
- androidx
- Gemini
- Flutter
- Firebase
- Coroutine
- DART
- 소울칼리버6
- Freesound
- 생성AI
- 좋은글필사하기
- ChatGPT
- 파이썬
- jetpack compose
- Linux
- javascript
Archives
- Today
- Total
Vintage appMaker의 Tech Blog
[codex] skill을 자동등록 해주는 skill-creator 본문
codex skill-creator
codex에서 프롬프트로 skills를 등록할 수 있는 skill
codex app 또는 cli에서 프롬프트로 기능을 구현한 후, 그것을 skills로 등록해줘 라는 프롬프트만 던지면 skill로 자동등록 해준다. 사용자가 직접 폴더에 가서 .md와 기타 파일들을 만들거나 codex app에서 스킬등록 메뉴를 사용할 필요없이 바로 생성해주는 기능이다.
1. 프롬프트
skills에 등록하기 전에 프롬프트는 다음과 같다.
내 PC의 그래픽카드 종류가 무엇이 있는 지 알려줘.
그리고 램, CPU, DISK 등의 정보를 가져온 후,
지금사양이 사무용인지 게임용인지 리포트로 정리해줘.
게임용의 경우, 어떤 게임까지 가능한지 리스트업 한다.
report.html로 저장하고
code_snipet의 app.html을 기본테마로 해서 만들어줘.
위의 프롬프트에서 code_snipet의 app.html을 기본테마와 같은 프롬프트는 무시해도 된다. 개인적으로 사용하는 MCP를 활용하여 HTML 템플릿을 사용한 것이다(리포트 문서를 규격화 하기 위함). HTML 템플릿을 그대로 적용하고 싶다면 아래 링크를 참조하면 된다.
[gemini - cli] mcp를 만들어 코드 스니펫 활용하기
MCP를 사용한 코드스니펫 활용Python FastMCP를 활용하여 규격화된 HTML 코드 스니펫 활용하기1. 목적지침과 코드 인터프리터를 활용하여 코드 스니펫을 활용하는 것도 매우 효율적이다. 그러나 프로
vintageappmaker.tistory.com
2. 결과


3. skill 등록 및 확인
codex에서 프롬프트로 작업한 것을 SKILLS에 등록하는 것은 프롬프트로 가능하다. 다음과 같은 프롬프트를 실행하면 된다.
지금 내용을 SKILLS에 등록해줘.
MY_PC_GRADE라는 이름으로 등록해줘
위의 프롬프트가 실행된 후 SKILL가 등록된다. 그러면 다음과 같은 프롬프트로 확인을 해본다.
지금 등록된 SKILL의 파일 목록을 Tree 형태로 보여줘.
그리고 파일의 기능을 ()안에 간단히 설명해줘.
결과는 다음과 같다.
my-pc-grade/
├─ SKILL.md (스킬의 트리거 조건, 사용 시점, 작업 절차를 정의하는 핵심 문서)
├─ agents/
│ └─ openai.yaml (스킬 표시 이름, 짧은 설명, 기본 프롬프트를 담는 UI 메타데이터)
└─ scripts/
└─ collect_pc_specs.py (GPU, CPU, RAM, 디스크, 사용률을 로컬에서 수집해 JSON으로 출력하는 스크립트)
실제 경로는 my-pc-grade 입니다.
4. SKILL 정보
- SKILL.md
---
name: my-pc-grade
description: Inspect the local PC's GPU, CPU, RAM, disk capacity, and current utilization; classify the machine as office-use or gaming-use; estimate which games are realistically playable; and generate a report.html based on the code_snipet app.html base theme. Use when the user asks to grade their PC, summarize hardware specs, judge office-vs-gaming suitability, or create an HTML hardware report.
metadata:
display_name: MY_PC_GRADE
short-description: Grade the local PC and generate an HTML hardware report
---
# MY_PC_GRADE
## When to use
- Use this skill when the user asks what graphics card or hardware the current PC has.
- Use it when the user wants a judgment such as office-use, gaming-use, low-end gaming, or playable game estimates.
- Use it when the user wants the result saved as `report.html`.
## Workflow
1. Collect GPU devices with `pnputil /enum-devices /class Display`.
2. Collect CPU model from `HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0`.
3. Run `scripts/collect_pc_specs.py` to gather:
- current CPU usage
- logical processor count
- total and available memory
- per-drive total, used, free, and used percentage
4. Use `mcp__code_snipet_html__get_snippet_code` with `app.html` and reuse that base theme for the final HTML.
5. Classify the PC:
- `office-use` if the machine is sufficient for browsing, office apps, meetings, and general multitasking.
- `gaming-use` if a discrete GPU is present and the combination is suitable for actual gameplay beyond casual office work.
- If both are true, say so clearly and distinguish the gaming tier such as entry-level or midrange.
6. Estimate playable games conservatively from the CPU/GPU/RAM combination. Separate into:
- comfortable
- playable with settings adjustment
- heavy games with major compromises
7. Call out operational risks separately. Disk free space is especially important when `C:` is nearly full.
8. Save the final output as `report.html` in the working directory unless the user requests another path.
## Notes
- Prefer local system inspection over internet lookups.
- `spacedesk Graphics Adapter` and similar virtual adapters should not be treated as the main gaming GPU.
- If WMI or CIM commands are blocked, continue with `pnputil`, registry queries, and the bundled Python script instead of stopping.
- If a helper script from another skill fails due to missing dependencies, do not install anything by default. Continue with the bundled local fallback.
## Output guidance
- Keep the report in Korean unless the user requests another language.
- Include:
- GPU list
- CPU
- RAM
- disks and free space
- current usage snapshot
- office/gaming verdict
- playable game list
- caveats and upgrade bottlenecks
- Use the `app.html` theme structure, but adapt the content for a hardware report rather than a generic form page.
- openai.yaml
version: 1
display_name: MY_PC_GRADE
short_description: Grade the local PC and generate an HTML hardware report
default_prompt: Inspect this PC, classify it for office or gaming use, estimate playable games, and save the result as report.html.
- collect_pc_specs.py
import ctypes
import json
import os
import shutil
import subprocess
import time
from ctypes import wintypes
class FILETIME(ctypes.Structure):
_fields_ = [("dwLowDateTime", wintypes.DWORD), ("dwHighDateTime", wintypes.DWORD)]
class MEMORYSTATUSEX(ctypes.Structure):
_fields_ = [
("dwLength", wintypes.DWORD),
("dwMemoryLoad", wintypes.DWORD),
("ullTotalPhys", ctypes.c_ulonglong),
("ullAvailPhys", ctypes.c_ulonglong),
("ullTotalPageFile", ctypes.c_ulonglong),
("ullAvailPageFile", ctypes.c_ulonglong),
("ullTotalVirtual", ctypes.c_ulonglong),
("ullAvailVirtual", ctypes.c_ulonglong),
("sullAvailExtendedVirtual", ctypes.c_ulonglong),
]
def filetime_to_int(filetime):
return (filetime.dwHighDateTime << 32) | filetime.dwLowDateTime
def get_cpu_usage(interval=1.0):
idle_1 = FILETIME()
kernel_1 = FILETIME()
user_1 = FILETIME()
idle_2 = FILETIME()
kernel_2 = FILETIME()
user_2 = FILETIME()
ctypes.windll.kernel32.GetSystemTimes(
ctypes.byref(idle_1), ctypes.byref(kernel_1), ctypes.byref(user_1)
)
time.sleep(interval)
ctypes.windll.kernel32.GetSystemTimes(
ctypes.byref(idle_2), ctypes.byref(kernel_2), ctypes.byref(user_2)
)
idle_delta = filetime_to_int(idle_2) - filetime_to_int(idle_1)
kernel_delta = filetime_to_int(kernel_2) - filetime_to_int(kernel_1)
user_delta = filetime_to_int(user_2) - filetime_to_int(user_1)
total_delta = kernel_delta + user_delta
if total_delta <= 0:
return 0.0
return round((total_delta - idle_delta) * 100.0 / total_delta, 2)
def run_command(command):
completed = subprocess.run(command, capture_output=True, text=True, shell=True)
return completed.stdout.strip()
def get_cpu_name():
output = run_command(
'reg query "HKLM\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0" /v ProcessorNameString'
)
lines = [line.strip() for line in output.splitlines() if "ProcessorNameString" in line]
if not lines:
return ""
parts = lines[0].split("REG_SZ", 1)
return parts[1].strip() if len(parts) == 2 else lines[0]
def get_gpu_devices():
output = run_command("pnputil /enum-devices /class Display")
devices = []
current = {}
for raw_line in output.splitlines():
line = raw_line.strip()
if not line:
if current:
devices.append(current)
current = {}
continue
if ":" not in line:
continue
key, value = [part.strip() for part in line.split(":", 1)]
current[key] = value
if current:
devices.append(current)
return [
{
"description": device.get("Device Description", ""),
"manufacturer": device.get("Manufacturer Name", ""),
"status": device.get("Status", ""),
}
for device in devices
if device.get("Device Description")
]
def get_memory():
memory = MEMORYSTATUSEX()
memory.dwLength = ctypes.sizeof(MEMORYSTATUSEX)
ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(memory))
return {
"total_gb": round(memory.ullTotalPhys / (1024 ** 3), 2),
"available_gb": round(memory.ullAvailPhys / (1024 ** 3), 2),
"used_pct": int(memory.dwMemoryLoad),
}
def get_disks():
disks = []
for letter in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
drive = f"{letter}:\\"
if not os.path.exists(drive):
continue
usage = shutil.disk_usage(drive)
disks.append(
{
"drive": letter,
"total_gb": round(usage.total / (1024 ** 3), 2),
"used_gb": round((usage.total - usage.free) / (1024 ** 3), 2),
"free_gb": round(usage.free / (1024 ** 3), 2),
"used_pct": round(((usage.total - usage.free) * 100.0) / usage.total, 1),
}
)
return disks
def main():
print(
json.dumps(
{
"cpu_name": get_cpu_name(),
"cpu_usage_pct": get_cpu_usage(),
"logical_processors": os.cpu_count(),
"memory": get_memory(),
"disks": get_disks(),
"gpus": get_gpu_devices(),
},
ensure_ascii=False,
indent=2,
)
)
if __name__ == "__main__":
main()
'Source code or Tip > 생성AI' 카테고리의 다른 글
| [gemini] gems를 활용한 4컷 만화 만들기 (0) | 2026.03.13 |
|---|---|
| [gemini cli] skill과 mcp를 활용한 주식 리포트 (0) | 2026.03.02 |
| [gemini cli] mcp 활용 - 크롬 히스토리 분석 "지침 만들기" (0) | 2026.02.28 |
| [gemini cli] mcp를 활용한 크롬 히스토리 분석 (0) | 2026.02.26 |
| [gemini Notebooklm] Canvas로 리포트 만들기(텍스트, 웹앱) (0) | 2026.02.16 |
Comments
