@pilllesss/yorn 1.0.181 → 1.0.182

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -64,6 +64,25 @@ User configuration lives in `~/.yorn/agent/`:
64
64
 
65
65
  Project-local overrides live in `.yorn/settings.json` inside a trusted project.
66
66
 
67
+ ## Embedded Skills & Subagent Script
68
+
69
+ Yorn ships with built-in embedded skills in `dist/skills/` (`graphify`, `agent-browser`, `subagent`, `screenshot`, `frontend-design`, `security-best-practices`, `add-provider`).
70
+
71
+ ### Spawning Subagents via `run_agent.sh`
72
+
73
+ The `subagent` skill bundles a cross-platform helper script (`run_agent.sh`) compatible with Linux, macOS, Android (Termux), iOS (iSH/a-Shell), and Windows (Git Bash/WSL/MSYS2):
74
+
75
+ ```sh
76
+ # Basic subagent run
77
+ sh "<skills_dir>/subagent/run_agent.sh" "Inspect codebase architecture and report"
78
+
79
+ # Custom provider, model, and tool restrictions
80
+ sh "<skills_dir>/subagent/run_agent.sh" -P openrouter -m anthropic/claude-3.5-sonnet -t read,grep,find,ls "Search for auth logic"
81
+
82
+ # Pure computation (no tools allowed)
83
+ sh "<skills_dir>/subagent/run_agent.sh" -nt "Explain the time complexity of this algorithm"
84
+ ```
85
+
67
86
  ## Environment variables
68
87
 
69
88
  - `YORN_CODING_AGENT_DIR` — override the agent config directory (default: `~/.yorn/agent`)
@@ -1 +1 @@
1
- {"schemaVersion":3,"generatedAt":"2026-08-29T10:23:30.769Z","structureHash":"3057daf694c095271f781bcfe5761e8b23c87ee15db6a23b539b956f99c163cd","files":{"amazon-bedrock.json":"681b69fb339cc8dce9f90d4ecfff4f9d5ee766d5aade5c9159f6de6df727eaab","ant-ling.json":"4979fe79d99ed97382d7ce40170c6132e932e77906de1eb54464c042e7d63633","anthropic.json":"e22c277e3a1ffddc3d2701b72787c9e0bd67b835de6b4cb806677b6b6a89a2f7","azure-openai-responses.json":"37d12c5cbfc29bfd9a802a0516f5d3209320bd4aa8ef9cd7c219af208244afa3","baseten.json":"e4d1ec84e8180a53e21c1511b8d78e497784515c33ba8397382ac3450c8b126e","cerebras.json":"38272a7525d6680c71bb4bb3c4085e871768b400832e2013b0e7fd92f8fd4f05","cloudflare-ai-gateway.json":"08cb27aade0885253e159ceacea6814ff324522b9cbe100a0c760a71723b41c7","cloudflare-workers-ai.json":"0ed67191adec10707a8ce1ed2c99a949dd06ec537de15d6b57e830575d248b86","deepseek.json":"e3106724723fd82d48a3ff685da9908a3a7b7b4fd84cc3cfe97a6a23067b6029","fireworks.json":"bce5d63ea8747157fcc7c540c2255c95c5f945a16d6c379bcc2d02a44790756f","github-copilot.json":"ecf7276f0b7744565ccbf8f5d64a12b3cd7e22f4acac398f3259f489d1c97745","google-vertex.json":"fb7586fc955da7b7d7d11d641954f496fbbb42cf3e4cbba66d7116ea3b37d5ed","google.json":"b5572904165d37ab594eafc3ab7f29774e35747b5dd211144ec01532db9217c1","groq.json":"f1eb899453e70b5e4479fe6eb78869ee99121fa6d4a019a5a05ab42d2ada8992","huggingface.json":"7616a851e53d254e375b760abe2b6148e8961a102bd5c7af31829a0f2dc8e5c5","kimi-coding.json":"ba42a26a69e5cb2122c0b384ba572efae93f42239ad86f26c2b7320a14aa75a1","minimax-cn.json":"65d37e55a6d9585855f94b3fb7739308d107fe248ebd9e1001d1c5d4606ad2c4","minimax.json":"c7dc5765995ae77242916430929c7cc9a782589f7e483e13f7e01663190d028e","mistral.json":"e3a109306644bf2f2fa38fece50b2d3ce1dbe3b87b1f1b9e2d70cce7eb5c0ea1","moonshotai-cn.json":"1e6146ff3477883636448c0f44222f0a52b3c4562ef8f4eecf7e941cdd59d12e","moonshotai.json":"d8d5209873058ddccd37c1f026833e2ea3f9476c3dc9628b4a940d407acc0b2e","nvidia.json":"62fa810bece1c90454b481db5a3ff78bc66dc28dab9c65a655397eb1dfe2de73","openai-codex.json":"2712c2924a4a75213dddc743c0e5f08d50a781fe807f16d5afb5fb65b41c64c7","openai.json":"2f32f5796138f03153a0314edf4c8ee27531d62f3477de0da46e51095f5e4782","opencode-go.json":"5fc1e0352e9e2d83c2bcc8cd8c8fafa5e20bf0566606612f91befb42e7f6531d","opencode.json":"b44bf827b591b9c6a500ee0ba348e96f6bd72e7b6ba0a2429ed084ee66130a3a","openrouter.json":"5827a34a3ab679f8db4fa1c0dc0b058d3b3a81a9bc2d9940f005fa3fe90b122a","qwen-token-plan-cn.json":"e62dde34edb603376a1dc60b2a74a9c2605b9e81d81df55cc259796c45aa4793","qwen-token-plan-individual.json":"0e1578a5c0e11d65644bb42d1d6efee5af97a55a4881d0421ab68bd970d4d4ef","qwen-token-plan.json":"fe914313157ff41ab2f71977f0fdcfedb3a8a205d1092e3180f6799e5d7942fd","together.json":"c2b03c476d6b4d4059ed18a80f34d274c754dc84fe2591ae79fe2986512f2a51","vercel-ai-gateway.json":"2487069ae500c07e9417c59eea8f7b651a0fb5b21b0c9d073d0f71d72b34b567","xai.json":"282838b0546d63106c81f1703cdf5ed31ebfe0c5f13a4bec0d590472cbbe03f2","xiaomi-token-plan-ams.json":"7ce8ed244672c45737d286ff3ca9c3a2686a5d4b2f0c5f71ab9348c14b14daf3","xiaomi-token-plan-cn.json":"684892b5fe6fa371d6040d2011c0fa33facd650d2eaf19f5dbee8efb33016200","xiaomi-token-plan-sgp.json":"b19e79b82ac4fdcb080e6d220106797504c885ed70b27fc2b3c1aa4810f32963","xiaomi.json":"810368d3828c8bb9498012a0d48639030c0c216b8c13e79da02daa515aa23448","zai-coding-cn.json":"abf4cbc22507b9d545842072b5e34bce230025fc20f7b1cc67db3782c1dc4b56","zai.json":"089af736a622b0a25e417493819f4e174884afba43235c5a1f17814057875627"}}
1
+ {"schemaVersion":3,"generatedAt":"2026-08-29T10:27:53.139Z","structureHash":"3057daf694c095271f781bcfe5761e8b23c87ee15db6a23b539b956f99c163cd","files":{"amazon-bedrock.json":"681b69fb339cc8dce9f90d4ecfff4f9d5ee766d5aade5c9159f6de6df727eaab","ant-ling.json":"4979fe79d99ed97382d7ce40170c6132e932e77906de1eb54464c042e7d63633","anthropic.json":"e22c277e3a1ffddc3d2701b72787c9e0bd67b835de6b4cb806677b6b6a89a2f7","azure-openai-responses.json":"37d12c5cbfc29bfd9a802a0516f5d3209320bd4aa8ef9cd7c219af208244afa3","baseten.json":"e4d1ec84e8180a53e21c1511b8d78e497784515c33ba8397382ac3450c8b126e","cerebras.json":"38272a7525d6680c71bb4bb3c4085e871768b400832e2013b0e7fd92f8fd4f05","cloudflare-ai-gateway.json":"08cb27aade0885253e159ceacea6814ff324522b9cbe100a0c760a71723b41c7","cloudflare-workers-ai.json":"0ed67191adec10707a8ce1ed2c99a949dd06ec537de15d6b57e830575d248b86","deepseek.json":"e3106724723fd82d48a3ff685da9908a3a7b7b4fd84cc3cfe97a6a23067b6029","fireworks.json":"bce5d63ea8747157fcc7c540c2255c95c5f945a16d6c379bcc2d02a44790756f","github-copilot.json":"ecf7276f0b7744565ccbf8f5d64a12b3cd7e22f4acac398f3259f489d1c97745","google-vertex.json":"fb7586fc955da7b7d7d11d641954f496fbbb42cf3e4cbba66d7116ea3b37d5ed","google.json":"b5572904165d37ab594eafc3ab7f29774e35747b5dd211144ec01532db9217c1","groq.json":"f1eb899453e70b5e4479fe6eb78869ee99121fa6d4a019a5a05ab42d2ada8992","huggingface.json":"7616a851e53d254e375b760abe2b6148e8961a102bd5c7af31829a0f2dc8e5c5","kimi-coding.json":"ba42a26a69e5cb2122c0b384ba572efae93f42239ad86f26c2b7320a14aa75a1","minimax-cn.json":"65d37e55a6d9585855f94b3fb7739308d107fe248ebd9e1001d1c5d4606ad2c4","minimax.json":"c7dc5765995ae77242916430929c7cc9a782589f7e483e13f7e01663190d028e","mistral.json":"e3a109306644bf2f2fa38fece50b2d3ce1dbe3b87b1f1b9e2d70cce7eb5c0ea1","moonshotai-cn.json":"1e6146ff3477883636448c0f44222f0a52b3c4562ef8f4eecf7e941cdd59d12e","moonshotai.json":"d8d5209873058ddccd37c1f026833e2ea3f9476c3dc9628b4a940d407acc0b2e","nvidia.json":"62fa810bece1c90454b481db5a3ff78bc66dc28dab9c65a655397eb1dfe2de73","openai-codex.json":"2712c2924a4a75213dddc743c0e5f08d50a781fe807f16d5afb5fb65b41c64c7","openai.json":"2f32f5796138f03153a0314edf4c8ee27531d62f3477de0da46e51095f5e4782","opencode-go.json":"5fc1e0352e9e2d83c2bcc8cd8c8fafa5e20bf0566606612f91befb42e7f6531d","opencode.json":"b44bf827b591b9c6a500ee0ba348e96f6bd72e7b6ba0a2429ed084ee66130a3a","openrouter.json":"5827a34a3ab679f8db4fa1c0dc0b058d3b3a81a9bc2d9940f005fa3fe90b122a","qwen-token-plan-cn.json":"e62dde34edb603376a1dc60b2a74a9c2605b9e81d81df55cc259796c45aa4793","qwen-token-plan-individual.json":"0e1578a5c0e11d65644bb42d1d6efee5af97a55a4881d0421ab68bd970d4d4ef","qwen-token-plan.json":"fe914313157ff41ab2f71977f0fdcfedb3a8a205d1092e3180f6799e5d7942fd","together.json":"c2b03c476d6b4d4059ed18a80f34d274c754dc84fe2591ae79fe2986512f2a51","vercel-ai-gateway.json":"2487069ae500c07e9417c59eea8f7b651a0fb5b21b0c9d073d0f71d72b34b567","xai.json":"282838b0546d63106c81f1703cdf5ed31ebfe0c5f13a4bec0d590472cbbe03f2","xiaomi-token-plan-ams.json":"7ce8ed244672c45737d286ff3ca9c3a2686a5d4b2f0c5f71ab9348c14b14daf3","xiaomi-token-plan-cn.json":"684892b5fe6fa371d6040d2011c0fa33facd650d2eaf19f5dbee8efb33016200","xiaomi-token-plan-sgp.json":"b19e79b82ac4fdcb080e6d220106797504c885ed70b27fc2b3c1aa4810f32963","xiaomi.json":"810368d3828c8bb9498012a0d48639030c0c216b8c13e79da02daa515aa23448","zai-coding-cn.json":"abf4cbc22507b9d545842072b5e34bce230025fc20f7b1cc67db3782c1dc4b56","zai.json":"089af736a622b0a25e417493819f4e174884afba43235c5a1f17814057875627"}}
@@ -3,13 +3,54 @@ name: "subagent"
3
3
  description: "Delegate tasks, perform parallel research, or run focused subtasks using a stateless child Yorn agent via bash. Use when a task requires deep isolated research, executing tasks in parallel, running read-only code analysis without polluting current conversation context, or executing subtasks in a fresh unsaved session."
4
4
  ---
5
5
 
6
- # Subagent Task Delegation via Yorn CLI
6
+ # Subagent Task Delegation via Yorn CLI & Cross-Platform Shell Script
7
7
 
8
- This skill teaches how to spawn and manage child subagents using `yorn` CLI commands executed directly through the `bash` tool. Each subagent runs as an independent, stateless child session without persisting session history (`--no-session`), returning results directly to your bash output.
8
+ This skill teaches how to spawn and manage child subagents using `yorn` CLI commands or the bundled cross-platform shell script `run_agent.sh` executed directly through the `bash` tool. Each subagent runs as an independent, stateless child session without persisting session history (`--no-session`), returning results directly to your bash output.
9
+
10
+ The bundled script `run_agent.sh` automatically resolves the correct executable path and environment across **all operating systems** (Linux, macOS, Android Termux, iOS iSH/a-Shell, and Windows Git Bash/WSL/MSYS2).
11
+
12
+ ---
13
+
14
+ ## 🚀 Recommended: Using `run_agent.sh` (Cross-Platform Script)
15
+
16
+ Located in the skill directory: `<skill_dir>/run_agent.sh`
17
+
18
+ ### 1. Basic Invocation
19
+ ```bash
20
+ sh "<skill_dir>/run_agent.sh" "Your prompt here"
21
+ ```
22
+
23
+ ### 2. Specifying Model, Provider & Tools
24
+ ```bash
25
+ sh "<skill_dir>/run_agent.sh" -P openrouter -m anthropic/claude-3.5-sonnet -t read,grep,find,ls "Search for auth logic"
26
+ ```
27
+
28
+ ### 3. Pure Computation (No Tools)
29
+ ```bash
30
+ sh "<skill_dir>/run_agent.sh" -nt "Explain the time complexity of this algorithm"
31
+ ```
32
+
33
+ ### 4. Custom System Prompt & Thinking Level
34
+ ```bash
35
+ sh "<skill_dir>/run_agent.sh" -s "You are an expert security auditor." -k high "Audit endpoints in src/api/"
36
+ ```
37
+
38
+ ### 5. Script Flags Reference
39
+ | Flag | Description | Default |
40
+ |---|---|---|
41
+ | `-p, --prompt <text>` | Subagent prompt text | Positional arg or stdin |
42
+ | `-m, --model <name>` | Target model | `$YORN_MODEL` |
43
+ | `-P, --provider <name>` | Target provider | `$YORN_PROVIDER` |
44
+ | `-t, --tools <list>` | Allowlist of tools (`read,grep,find,ls`) | All default tools |
45
+ | `-nt, --no-tools` | Disable all tools (pure reasoning) | Off |
46
+ | `-s, --system-prompt <text>` | Custom system prompt | Default prompt |
47
+ | `-k, --thinking <level>` | Thinking level (`off`, `low`, `medium`, `high`, `max`) | Model default |
48
+ | `--json` | Stream structured JSON event payloads | Off |
49
+ | `-f, --file <path>` | Read prompt from file | None |
9
50
 
10
51
  ---
11
52
 
12
- ## 🚀 Core Command Patterns
53
+ ## Direct CLI Command Patterns
13
54
 
14
55
  ### 1. Direct Execution (Standard Delegation)
15
56
  Run a self-contained subtask. The result prints directly to stdout in the bash tool result:
@@ -72,7 +113,7 @@ yorn -p --no-session "Check tsconfig.json and suggest compiler options for stric
72
113
 
73
114
  ---
74
115
 
75
- ## 📋 Best Practices
116
+ ## 💡 Best Practices
76
117
 
77
118
  1. **Always use `--no-session` and `-p` (or `--mode json -p`):**
78
119
  - `--no-session`: Prevents saving dummy sessions into `~/.yorn/agent/sessions/`.
@@ -0,0 +1,155 @@
1
+ #!/bin/sh
2
+ set -e
3
+
4
+ # Cross-platform Yorn Subagent Launcher
5
+ # Compatible with Linux, macOS, Android (Termux), iOS (iSH/a-Shell), and Windows (Git Bash/WSL/MSYS2)
6
+
7
+ PROMPT=""
8
+ MODEL="${YORN_MODEL:-}"
9
+ PROVIDER="${YORN_PROVIDER:-}"
10
+ TOOLS=""
11
+ NO_TOOLS=0
12
+ SYSTEM_PROMPT=""
13
+ THINKING=""
14
+ MODE="text"
15
+ PROMPT_FILE=""
16
+
17
+ while [ $# -gt 0 ]; do
18
+ case "$1" in
19
+ -p|--prompt)
20
+ PROMPT="$2"
21
+ shift 2
22
+ ;;
23
+ -m|--model)
24
+ MODEL="$2"
25
+ shift 2
26
+ ;;
27
+ -P|--provider)
28
+ PROVIDER="$2"
29
+ shift 2
30
+ ;;
31
+ -t|--tools)
32
+ TOOLS="$2"
33
+ shift 2
34
+ ;;
35
+ -nt|--no-tools)
36
+ NO_TOOLS=1
37
+ shift
38
+ ;;
39
+ -s|--system-prompt)
40
+ SYSTEM_PROMPT="$2"
41
+ shift 2
42
+ ;;
43
+ -k|--thinking)
44
+ THINKING="$2"
45
+ shift 2
46
+ ;;
47
+ --json)
48
+ MODE="json"
49
+ shift
50
+ ;;
51
+ --mode)
52
+ MODE="$2"
53
+ shift 2
54
+ ;;
55
+ -f|--file)
56
+ PROMPT_FILE="$2"
57
+ shift 2
58
+ ;;
59
+ -h|--help)
60
+ echo "Usage: run_agent.sh [options] [prompt]"
61
+ echo ""
62
+ echo "Options:"
63
+ echo " -p, --prompt <text> Subagent task prompt"
64
+ echo " -m, --model <model> Model name (default: \$YORN_MODEL)"
65
+ echo " -P, --provider <provider> Provider name (default: \$YORN_PROVIDER)"
66
+ echo " -t, --tools <list> Comma-separated tool allowlist (e.g. read,grep,find,ls)"
67
+ echo " -nt, --no-tools Disable all tools"
68
+ echo " -s, --system-prompt <text> Custom system prompt"
69
+ echo " -k, --thinking <level> Thinking level (off, low, medium, high, max)"
70
+ echo " --json Output raw JSON event stream"
71
+ echo " -f, --file <path> Read prompt from a file"
72
+ echo " -h, --help Show this help"
73
+ exit 0
74
+ ;;
75
+ *)
76
+ if [ -z "$PROMPT" ]; then
77
+ PROMPT="$1"
78
+ else
79
+ PROMPT="$PROMPT $1"
80
+ fi
81
+ shift
82
+ ;;
83
+ esac
84
+ done
85
+
86
+ # Read prompt from file if specified
87
+ if [ -n "$PROMPT_FILE" ] && [ -f "$PROMPT_FILE" ]; then
88
+ PROMPT="$(cat "$PROMPT_FILE")"
89
+ fi
90
+
91
+ # Read prompt from stdin if not passed via args
92
+ if [ -z "$PROMPT" ] && [ ! -t 0 ]; then
93
+ PROMPT="$(cat)"
94
+ fi
95
+
96
+ if [ -z "$PROMPT" ]; then
97
+ echo "Error: No prompt provided. Specify --prompt \"...\" or pass via positional args/stdin." >&2
98
+ exit 1
99
+ fi
100
+
101
+ # Resolve yorn binary / script cross-platform
102
+ YORN_CMD=""
103
+ SCRIPT_DIR="$(cd "$(dirname "$0")" 2>/dev/null && pwd || echo "")"
104
+
105
+ if command -v yorn >/dev/null 2>&1; then
106
+ YORN_CMD="yorn"
107
+ elif [ -n "$SCRIPT_DIR" ] && [ -f "$SCRIPT_DIR/../../yorn.cjs" ]; then
108
+ YORN_CMD="node \"$SCRIPT_DIR/../../yorn.cjs\""
109
+ elif [ -f "./dist/yorn.cjs" ]; then
110
+ YORN_CMD="node ./dist/yorn.cjs"
111
+ elif [ -f "../dist/yorn.cjs" ]; then
112
+ YORN_CMD="node ../dist/yorn.cjs"
113
+ elif [ -n "$APPDATA" ] && [ -f "$APPDATA/npm/node_modules/@pilllesss/yorn/dist/yorn.cjs" ]; then
114
+ YORN_CMD="node \"$APPDATA/npm/node_modules/@pilllesss/yorn/dist/yorn.cjs\""
115
+ elif [ -n "$PREFIX" ] && [ -f "$PREFIX/lib/node_modules/@pilllesss/yorn/dist/yorn.cjs" ]; then
116
+ YORN_CMD="node \"$PREFIX/lib/node_modules/@pilllesss/yorn/dist/yorn.cjs\""
117
+ elif [ -f "/data/data/com.termux/files/usr/lib/node_modules/@pilllesss/yorn/dist/yorn.cjs" ]; then
118
+ YORN_CMD="node /data/data/com.termux/files/usr/lib/node_modules/@pilllesss/yorn/dist/yorn.cjs"
119
+ else
120
+ YORN_CMD="npx --no-install @pilllesss/yorn"
121
+ fi
122
+
123
+ # Build arguments
124
+ ARGS="-p --no-session"
125
+
126
+ if [ "$MODE" = "json" ]; then
127
+ ARGS="$ARGS --mode json"
128
+ fi
129
+
130
+ if [ -n "$PROVIDER" ]; then
131
+ ARGS="$ARGS --provider $PROVIDER"
132
+ fi
133
+
134
+ if [ -n "$MODEL" ]; then
135
+ ARGS="$ARGS --model $MODEL"
136
+ fi
137
+
138
+ if [ "$NO_TOOLS" -eq 1 ]; then
139
+ ARGS="$ARGS --no-tools"
140
+ elif [ -n "$TOOLS" ]; then
141
+ ARGS="$ARGS --tools $TOOLS"
142
+ fi
143
+
144
+ if [ -n "$THINKING" ]; then
145
+ ARGS="$ARGS --thinking $THINKING"
146
+ fi
147
+
148
+ if [ -n "$SYSTEM_PROMPT" ]; then
149
+ # Escape any quotes in system prompt
150
+ ESCAPED_SYS_PROMPT="$(echo "$SYSTEM_PROMPT" | sed 's/"/\\"/g')"
151
+ ARGS="$ARGS --system-prompt \"$ESCAPED_SYS_PROMPT\""
152
+ fi
153
+
154
+ # Execute child agent
155
+ eval "$YORN_CMD $ARGS \"\$PROMPT\""