Skip to main content

preview

Path to markdown file, plan directory, or plans collection

소스 정보

저장소
LongLeo287/SEOSONA-OS
최근 소스 활동
2026년 8월 4일 05:01
감지된 SKILL.md 언어
영어
스타
2
포크
1

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
preview
description
Path to markdown file, plan directory, or plans collection
metadata
{"author":"claudekit","version":"1.0.0"}
Universal viewer using `markdown-novel-viewer` skill - pass ANY path and see it rendered nicely. ## Usage - `/preview <file.md>` - View markdown file in novel-reader UI - `/preview <directory/>` - Browse directory contents - `/preview --stop` - Stop running server ## Examples ```bash /preview plans/my-plan/plan.md # View markdown file /preview plans/ # Browse plans directory /preview docs/ # Browse docs directory /preview any/path/to/file.md # View any markdown file /preview any/path/ # Browse any directory ``` ## Execution **IMPORTANT:** Run server as Claude Code background task using `run_in_background: true` with the Bash tool. This makes the server visible in `/tasks` and manageable via `KillShell`. Check if this script is located in the current workspace or in `$HOME/.opencode/skills/markdown-novel-viewer` directory: - If in current workspace: `$SKILL_DIR_PATH` = `./.opencode/skills/markdown-novel-viewer/` - If in home directory: `$SKILL_DIR_PATH` = `$HOME/.opencode/skills/markdown-novel-viewer/` ### Stop Server If `--stop` flag is provided: ```bash node $SKILL_DIR_PATH/scripts/server.cjs --stop ``` ### Start Server Otherwise, run the `markdown-novel-viewer` server as CC background task with `--foreground` flag (keeps process alive for CC task management): ```bash # Determine if path is file or directory INPUT_PATH="{{path}}" if [[ -d "$INPUT_PATH" ]]; then # Directory mode - browse node $SKILL_DIR_PATH/scripts/server.cjs \ --dir "$INPUT_PATH" \ --host 127.0.0.1 \ --open \ --foreground else # File mode - view markdown node $SKILL_DIR_PATH/scripts/server.cjs \ --file "$INPUT_PATH" \ --host 127.0.0.1 \ --open \ --foreground fi ``` **Critical:** When calling the Bash tool: - Set `run_in_background: true` to run as CC background task - Set `timeout: 300000` (5 minutes) to prevent premature termination - Parse JSON output and report URL to user Example Bash tool call: ```json { "command": "node .opencode/skills/markdown-novel-viewer/scripts/server.cjs --dir \"path\" --host 127.0.0.1 --open --foreground", "run_in_background": true, "timeout": 300000, "description": "Start preview server in background" } ``` After starting, parse the JSON output (e.g., `{"success":true,"url":"htt~/.seosona/path/:3456/view?file=...","networkUrl":"htt~/.seosona/path/:3456/view?file=..."}`) and report: - Local URL for browser access - Network URL only when explicitly authorized for remote device access - Inform user that server is now running as CC background task (visible in `/tasks`) **CRITICAL:** MUST display the FULL URL including path and query string (e.g., `htt~/.seosona/path/:3456/view?file=/path/to/file.md`). NEVER truncate to just `host:port` (e.g., `htt~/.seosona/path/:3456`). The full URL is required for direct file access.
GitHub에서 보기