auto-snapshot 2026-08-26 03:00:22

This commit is contained in:
小唯 A06 2026-08-26 03:00:22 +08:00
parent 30bf3a0925
commit d53c7be92e
26 changed files with 2577 additions and 47 deletions

View File

@ -36,7 +36,7 @@ sess_options.enable_mem_pattern = False # 禁用内存模式,避免碎片
session = ort.InferenceSession(
os.path.join(MODEL_PATH, "model.onnx"),
sess_options=sess_options,
providers=["CPUExecutionProvider"],
providers=["CUDAExecutionProvider", "CPUExecutionProvider"],
)
log.info("ONNX 模型就绪 — providers=%s", session.get_providers())
@ -89,7 +89,7 @@ class EmbedHandler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path == "/health":
self._respond(200, {"status": "ok", "model": "bge-m3", "backend": "onnxruntime"})
self._respond(200, {"status": "ok", "model": "bge-m3", "backend": "onnxruntime", "providers": session.get_providers()})
else:
self._respond(404, {"error": "not found"})

33
scripts/cron-retry-wrapper.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
# cron-retry-wrapper.sh — 通用重试包装脚本
# 用法: cron-retry-wrapper.sh <script_path> [max_retries] [delay_seconds]
SCRIPT="$1"
MAX_RETRIES="${2:-3}"
DELAY="${3:-5}"
if [ ! -f "$SCRIPT" ]; then
echo "错误: 脚本不存在: $SCRIPT"
exit 1
fi
for i in $(seq 1 $MAX_RETRIES); do
echo "尝试 $i/$MAX_RETRIES: $SCRIPT"
output=$(bash "$SCRIPT" 2>&1)
exit_code=$?
if [ $exit_code -eq 0 ]; then
echo "$output"
exit 0
fi
echo "失败 (退出码: $exit_code)"
if [ $i -lt $MAX_RETRIES ]; then
echo "等待 ${DELAY}s 后重试..."
sleep $DELAY
fi
done
echo "所有重试失败"
echo "$output"
exit 1

86
scripts/retry_executor.py Executable file
View File

@ -0,0 +1,86 @@
#!/usr/bin/env python3
"""
retry_executor.py 通用重试执行器
用法: python3 retry_executor.py <script_path> [max_retries] [delay_seconds]
示例:
python3 retry_executor.py distill-model-watchdog.py 3 5
python3 retry_executor.py stock_dual_scan.sh 2 10
"""
import subprocess
import sys
import time
import os
def main():
if len(sys.argv) < 2:
print("用法: python3 retry_executor.py <script_path> [max_retries] [delay_seconds]")
sys.exit(1)
script = sys.argv[1]
max_retries = int(sys.argv[2]) if len(sys.argv) > 2 else 3
delay = int(sys.argv[3]) if len(sys.argv) > 3 else 5
# 检查脚本是否存在
if not os.path.exists(script):
# 尝试在scripts目录查找
scripts_dir = os.path.expanduser("~/.hermes/scripts")
script_path = os.path.join(scripts_dir, script)
if os.path.exists(script_path):
script = script_path
else:
print(f"错误: 脚本不存在: {script}")
sys.exit(1)
# 确定执行方式
if script.endswith('.py'):
cmd = [sys.executable, script]
elif script.endswith('.sh'):
cmd = ['bash', script]
else:
cmd = [script]
last_output = ""
last_exit_code = 1
for attempt in range(1, max_retries + 1):
print(f"尝试 {attempt}/{max_retries}: {os.path.basename(script)}")
try:
result = subprocess.run(
cmd,
capture_output=True,
text=True,
timeout=300 # 5分钟超时
)
last_output = result.stdout + result.stderr
last_exit_code = result.returncode
if result.returncode == 0:
print(last_output)
sys.exit(0)
print(f"失败 (退出码: {result.returncode})")
if result.stderr:
print(f"错误: {result.stderr[:200]}")
except subprocess.TimeoutExpired:
print(f"超时 (5分钟)")
last_exit_code = 124
except Exception as e:
print(f"异常: {e}")
last_exit_code = 1
if attempt < max_retries:
print(f"等待 {delay}s 后重试...")
time.sleep(delay)
print(f"\n所有 {max_retries} 次重试失败")
if last_output:
print(f"最后输出:\n{last_output[:500]}")
sys.exit(last_exit_code)
if __name__ == "__main__":
main()

126
scripts/retry_wrapper.py Normal file
View File

@ -0,0 +1,126 @@
#!/usr/bin/env python3
"""
retry_wrapper.py 可配置的重试包装器
配置文件: ~/.hermes/config/retry_jobs.json
配置格式:
{
"jobs": {
"job_name": {
"script": "original_script.py",
"max_retries": 3,
"delay": 5
}
}
}
"""
import subprocess
import sys
import time
import os
import json
from pathlib import Path
CONFIG_FILE = Path.home() / ".hermes" / "config" / "retry_jobs.json"
def load_config():
"""加载重试配置"""
if not CONFIG_FILE.exists():
return {}
try:
with open(CONFIG_FILE, 'r', encoding='utf-8') as f:
return json.load(f)
except Exception as e:
print(f"警告: 无法加载配置: {e}")
return {}
def get_job_config(job_name):
"""获取指定job的配置"""
config = load_config()
jobs = config.get('jobs', {})
return jobs.get(job_name, None)
def run_script(script_path, max_retries=3, delay=5):
"""执行脚本,带重试"""
# 检查脚本是否存在
if not os.path.exists(script_path):
# 尝试在scripts目录查找
scripts_dir = os.path.expanduser("~/.hermes/scripts")
script_path = os.path.join(scripts_dir, script_path)
if not os.path.exists(script_path):
print(f"错误: 脚本不存在: {script_path}")
return 1
# 确定执行方式
if script_path.endswith('.py'):
cmd = [sys.executable, script_path]
elif script_path.endswith('.sh'):
cmd = ['bash', script_path]
else:
cmd = [script_path]
last_output = ""
last_exit_code = 1
for attempt in range(1, max_retries + 1):
print(f"尝试 {attempt}/{max_retries}: {os.path.basename(script_path)}")
try:
result = subprocess.run(
cmd,
capture_output=True,
text=True,
timeout=300 # 5分钟超时
)
last_output = result.stdout + result.stderr
last_exit_code = result.returncode
if result.returncode == 0:
print(last_output)
return 0
print(f"失败 (退出码: {result.returncode})")
if result.stderr:
print(f"错误: {result.stderr[:200]}")
except subprocess.TimeoutExpired:
print(f"超时 (5分钟)")
last_exit_code = 124
except Exception as e:
print(f"异常: {e}")
last_exit_code = 1
if attempt < max_retries:
print(f"等待 {delay}s 后重试...")
time.sleep(delay)
print(f"\n所有 {max_retries} 次重试失败")
if last_output:
print(f"最后输出:\n{last_output[:500]}")
return last_exit_code
def main():
# 从文件名推断job名
script_name = Path(__file__).stem
job_name = script_name.replace("retry_", "")
# 获取配置
job_config = get_job_config(job_name)
if job_config:
script = job_config.get('script')
max_retries = job_config.get('max_retries', 3)
delay = job_config.get('delay', 5)
else:
# 默认配置
print(f"警告: 未找到job '{job_name}' 的配置,使用默认值")
script = job_name + ".py"
max_retries = 3
delay = 5
return run_script(script, max_retries, delay)
if __name__ == "__main__":
sys.exit(main())

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
{
"last_report_path": "/home/muc/.hermes/logs/curator/20260818-141738",
"last_run_at": "2026-08-18T14:17:38.283960+00:00",
"last_run_duration_seconds": 1.333861,
"last_run_summary": "auto: 2 marked stale; llm: skipped (consolidation off)",
"last_report_path": "/home/muc/.hermes/profiles/prof-b/logs/curator/20260825-143653",
"last_run_at": "2026-08-25T14:36:53.254154+00:00",
"last_run_duration_seconds": 1.43867,
"last_run_summary": "auto: 1 marked stale, 1 reactivated; llm: skipped (consolidation off)",
"last_run_summary_shown_at": null,
"paused": false,
"run_count": 15
"run_count": 16
}

View File

@ -40,6 +40,21 @@
"use_count": 0,
"view_count": 0
},
"agent-search-apis": {
"archived_at": null,
"created_at": "2026-08-25T05:05:41.377155+00:00",
"created_by": "agent",
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
},
"agnes-ai": {
"archived_at": null,
"created_at": "2026-06-03T17:25:21.060210+00:00",
@ -126,6 +141,21 @@
"use_count": 0,
"view_count": 0
},
"anysearch": {
"archived_at": null,
"created_at": "2026-08-25T09:15:05.212875+00:00",
"created_by": "agent",
"last_patched_at": "2026-08-25T09:15:29.743187+00:00",
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"patch_count": 1,
"patch_generation": 1,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
},
"ao-orchestrator": {
"archived_at": null,
"created_at": "2026-05-13T06:09:07.701394+00:00",
@ -330,13 +360,30 @@
"created_at": "2026-07-23T09:27:16.552310+00:00",
"created_by": null,
"last_patched_at": "2026-07-23T14:07:01.001333+00:00",
"last_used_at": "2026-07-23T14:05:35.719576+00:00",
"last_viewed_at": "2026-07-23T14:05:35.714926+00:00",
"last_reused_patch_generation": 0,
"last_used_at": "2026-08-25T05:05:53.067857+00:00",
"last_viewed_at": "2026-08-25T05:05:53.056153+00:00",
"patch_count": 2,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 2,
"view_count": 2
"use_count": 3,
"view_count": 3
},
"blocked-page-recovery": {
"archived_at": null,
"created_at": "2026-08-25T14:36:54.371805+00:00",
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
},
"blogwatcher": {
"archived_at": null,
@ -351,6 +398,21 @@
"use_count": 0,
"view_count": 0
},
"box": {
"archived_at": null,
"created_at": "2026-08-25T14:36:54.383836+00:00",
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
},
"browser-automation": {
"archived_at": null,
"created_at": "2026-05-16T06:43:59.385311+00:00",
@ -582,6 +644,21 @@
"use_count": 1,
"view_count": 1
},
"competitor-news-monitor": {
"archived_at": null,
"created_at": "2026-08-25T14:36:54.388382+00:00",
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
},
"computer-use": {
"archived_at": null,
"created_at": "2026-06-30T11:24:39.473226+00:00",
@ -608,6 +685,21 @@
"use_count": 1,
"view_count": 1
},
"cron-ops": {
"archived_at": null,
"created_at": "2026-08-25T13:35:46.395378+00:00",
"created_by": "agent",
"last_patched_at": "2026-08-25T13:36:07.315539+00:00",
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"patch_count": 1,
"patch_generation": 1,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
},
"daemon-code-quality": {
"archived_at": null,
"created_at": "2026-07-09T19:34:19.695862+00:00",
@ -698,14 +790,16 @@
"archived_at": null,
"created_at": "2026-05-05T15:53:48.597780+00:00",
"created_by": "agent",
"last_patched_at": "2026-08-02T17:46:05.621521+00:00",
"last_used_at": "2026-08-02T17:45:20.632761+00:00",
"last_viewed_at": "2026-08-02T17:45:20.628433+00:00",
"patch_count": 96,
"last_patched_at": "2026-08-25T02:38:45.891428+00:00",
"last_reused_patch_generation": 1,
"last_used_at": "2026-08-25T02:39:43.536879+00:00",
"last_viewed_at": "2026-08-25T02:39:43.524941+00:00",
"patch_count": 97,
"patch_generation": 1,
"pinned": false,
"state": "active",
"use_count": 81,
"view_count": 81
"use_count": 85,
"view_count": 85
},
"devops/devops-umbrella": {
"archived_at": null,
@ -858,6 +952,21 @@
"use_count": 3,
"view_count": 3
},
"email-inbox-triage": {
"archived_at": null,
"created_at": "2026-08-25T14:36:54.393024+00:00",
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
},
"evaluating-llms-harness": {
"archived_at": null,
"created_at": "2026-06-30T11:24:39.485362+00:00",
@ -1063,6 +1172,21 @@
"use_count": 0,
"view_count": 0
},
"github-issue-to-pr": {
"archived_at": null,
"created_at": "2026-08-25T14:36:54.397668+00:00",
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
},
"github-issues": {
"archived_at": null,
"created_at": "2026-06-30T11:24:39.506830+00:00",
@ -1252,14 +1376,14 @@
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": "2026-08-24T03:09:07.000165+00:00",
"last_viewed_at": "2026-08-24T03:09:06.996203+00:00",
"last_used_at": "2026-08-25T09:14:07.961506+00:00",
"last_viewed_at": "2026-08-25T09:14:07.949674+00:00",
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 1,
"view_count": 1
"use_count": 2,
"view_count": 2
},
"guofeng-palace-prompts": {
"archived_at": null,
@ -1338,14 +1462,14 @@
"created_by": null,
"last_patched_at": "2026-08-12T05:13:40.896376+00:00",
"last_reused_patch_generation": 1,
"last_used_at": "2026-08-21T02:04:18.045460+00:00",
"last_viewed_at": "2026-08-21T02:04:18.040713+00:00",
"last_used_at": "2026-08-25T14:14:33.174522+00:00",
"last_viewed_at": "2026-08-25T14:14:33.170402+00:00",
"patch_count": 124,
"patch_generation": 1,
"pinned": false,
"state": "active",
"use_count": 141,
"view_count": 140
"use_count": 142,
"view_count": 141
},
"hermes-mcp-setup": {
"archived_at": null,
@ -1407,14 +1531,14 @@
"created_by": null,
"last_patched_at": "2026-08-12T05:13:32.138839+00:00",
"last_reused_patch_generation": 1,
"last_used_at": "2026-08-23T01:00:33.224367+00:00",
"last_viewed_at": "2026-08-23T01:00:33.218292+00:00",
"last_used_at": "2026-08-25T14:15:30.165659+00:00",
"last_viewed_at": "2026-08-25T14:15:30.153513+00:00",
"patch_count": 81,
"patch_generation": 1,
"pinned": false,
"state": "active",
"use_count": 129,
"view_count": 120
"use_count": 132,
"view_count": 123
},
"hermes-venv-dependency-safety": {
"archived_at": null,
@ -1554,14 +1678,14 @@
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": "2026-08-24T03:12:29.585734+00:00",
"last_viewed_at": "2026-08-24T03:12:29.581772+00:00",
"last_used_at": "2026-08-25T09:13:55.509760+00:00",
"last_viewed_at": "2026-08-25T09:13:55.496420+00:00",
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 1,
"view_count": 1
"use_count": 2,
"view_count": 2
},
"lancedb-corruption-recovery": {
"archived_at": null,
@ -1727,6 +1851,21 @@
"use_count": 2,
"view_count": 2
},
"meeting-action-items": {
"archived_at": null,
"created_at": "2026-08-25T14:36:54.402423+00:00",
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
},
"memory-fabric-arch": {
"archived_at": null,
"created_at": "2026-05-23T11:13:41.940385+00:00",
@ -1798,6 +1937,21 @@
"use_count": 16,
"view_count": 16
},
"merge-reconciler": {
"archived_at": null,
"created_at": "2026-08-25T14:36:54.407173+00:00",
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
},
"mimo-tts-pipeline": {
"archived_at": null,
"created_at": "2026-08-19T12:52:39.059147+00:00",
@ -1936,6 +2090,21 @@
"use_count": 0,
"view_count": 0
},
"nuyoah-image-reverse-prompt": {
"archived_at": null,
"created_at": "2026-08-25T13:33:03.601437+00:00",
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": "2026-08-25T14:03:56.050650+00:00",
"last_viewed_at": "2026-08-25T14:03:56.046311+00:00",
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 2,
"view_count": 2
},
"obsidian-plugin": {
"archived_at": null,
"created_at": "2026-06-02T07:47:40.651372+00:00",
@ -1986,7 +2155,7 @@
"patch_count": 1,
"patch_generation": 0,
"pinned": false,
"state": "stale",
"state": "active",
"use_count": 4,
"view_count": 4
},
@ -2145,14 +2314,14 @@
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"last_used_at": "2026-08-25T09:14:15.196270+00:00",
"last_viewed_at": "2026-08-25T09:14:15.184062+00:00",
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
"use_count": 1,
"view_count": 1
},
"pretext": {
"archived_at": null,
@ -2167,6 +2336,21 @@
"use_count": 0,
"view_count": 0
},
"product-price-monitor": {
"archived_at": null,
"created_at": "2026-08-25T14:36:54.419543+00:00",
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
},
"product-research": {
"archived_at": null,
"created_at": "2026-07-12T02:34:39.968795+00:00",
@ -2195,6 +2379,21 @@
"use_count": 2,
"view_count": 2
},
"project-manager-breakout": {
"archived_at": null,
"created_at": "2026-08-25T12:43:25.123183+00:00",
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": "2026-08-25T13:32:41.115330+00:00",
"last_viewed_at": "2026-08-25T13:32:41.111182+00:00",
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 1,
"view_count": 1
},
"project-toolbox": {
"archived_at": null,
"created_at": "2026-08-10T08:46:49.676959+00:00",
@ -2348,6 +2547,36 @@
"use_count": 2,
"view_count": 2
},
"rsshub-ops": {
"archived_at": null,
"created_at": "2026-08-25T02:54:22.347526+00:00",
"created_by": "agent",
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": "2026-08-25T14:14:27.842380+00:00",
"last_viewed_at": "2026-08-25T14:14:27.838366+00:00",
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 4,
"view_count": 4
},
"sdlc-review": {
"archived_at": null,
"created_at": "2026-08-25T14:36:54.424392+00:00",
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
},
"segment-anything-model": {
"archived_at": null,
"created_at": "2026-06-30T11:24:39.617688+00:00",
@ -2365,16 +2594,16 @@
"archived_at": null,
"created_at": "2026-07-08T18:13:02.034240+00:00",
"created_by": "agent",
"last_patched_at": "2026-08-19T16:24:28.259616+00:00",
"last_reused_patch_generation": 22,
"last_used_at": "2026-08-21T03:38:30.580097+00:00",
"last_viewed_at": "2026-08-21T03:38:30.560718+00:00",
"patch_count": 225,
"patch_generation": 22,
"last_patched_at": "2026-08-25T09:13:48.358348+00:00",
"last_reused_patch_generation": 23,
"last_used_at": "2026-08-25T09:13:05.390929+00:00",
"last_viewed_at": "2026-08-25T09:13:05.379044+00:00",
"patch_count": 228,
"patch_generation": 25,
"pinned": false,
"state": "active",
"use_count": 177,
"view_count": 177
"use_count": 179,
"view_count": 179
},
"self-hosted-tunneling": {
"archived_at": null,
@ -2404,6 +2633,21 @@
"use_count": 0,
"view_count": 0
},
"session-librarian": {
"archived_at": null,
"created_at": "2026-08-25T14:36:54.429255+00:00",
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
},
"shell-commands": {
"archived_at": null,
"created_at": "2026-05-24T17:01:39.677016+00:00",
@ -2620,7 +2864,7 @@
"last_viewed_at": "2026-07-25T14:24:12.169127+00:00",
"patch_count": 5,
"pinned": false,
"state": "active",
"state": "stale",
"use_count": 7,
"view_count": 7
},
@ -2745,6 +2989,21 @@
"use_count": 22,
"view_count": 23
},
"weekly-review-planning": {
"archived_at": null,
"created_at": "2026-08-25T14:36:54.438762+00:00",
"created_by": null,
"last_patched_at": null,
"last_reused_patch_generation": 0,
"last_used_at": null,
"last_viewed_at": null,
"patch_count": 0,
"patch_generation": 0,
"pinned": false,
"state": "active",
"use_count": 0,
"view_count": 0
},
"weights-and-biases": {
"archived_at": null,
"created_at": "2026-06-30T11:24:39.659684+00:00",

View File

@ -0,0 +1,117 @@
---
name: agent-search-apis
description: "Use when searching for code, finance, legal, or vertical."
metadata:
version: "1.0.0"
author: "小唯"
category: "search"
tags: ["search", "api", "agent", "vertical", "anysearch"]
---
# Agent Search APIs
为 Agent 设计的搜索基础设施,支持结构化输出和垂直领域搜索。
## AnySearch
**官网**: https://anysearch.com
**API Base**: `https://api.anysearch.com`
**免费额度**: 1,000 次/天20 QPS
**认证**: 可选(匿名访问有速率限制)
### 搜索端点
```python
import os
import requests
ANYSEARCH_API_BASE = "https://api.anysearch.com"
ANYSEARCH_API_KEY = os.getenv("ANYSEARCH_API_KEY") # 可选
def search(query, max_results=10, zone="cn", language="zh-CN", tag=None, params=None):
"""执行搜索"""
headers = {"Content-Type": "application/json"}
if ANYSEARCH_API_KEY:
headers["Authorization"] = f"Bearer {ANYSEARCH_API_KEY}"
payload = {
"query": query,
"max_results": max_results,
"zone": zone,
"language": language
}
if tag:
payload["tag"] = tag
if params:
payload["params"] = params
response = requests.post(
f"{ANYSEARCH_API_BASE}/v1/search",
headers=headers,
json=payload
)
return response.json()
```
### 垂直领域标签
- `code.snippet` — 代码片段搜索
- `code.doc` — 文档搜索
- `finance.quote` — 金融行情
- `legal.case` — 法律案例
- `academic.paper` — 学术论文
### 使用示例
```python
# 通用搜索
results = search("GitHub AI 仓库", max_results=5)
# 代码搜索
results = search("Go 限流器实现", tag="code.snippet", params={"lang": "go"})
# 金融搜索
results = search("AAPL 股价", tag="finance.quote", params={"type": "stock"})
```
### 提取端点
```python
def extract(url):
"""提取网页内容"""
headers = {"Content-Type": "application/json"}
if ANYSEARCH_API_KEY:
headers["Authorization"] = f"Bearer {ANYSEARCH_API_KEY}"
response = requests.post(
f"{ANYSEARCH_API_BASE}/v1/extract",
headers=headers,
json={"url": url}
)
return response.json()
```
## 与 Hermes web_search 对比
| 特性 | web_search (DuckDuckGo) | AnySearch |
|------|------------------------|-----------|
| 结构化输出 | ❌ 链接列表 | ✅ 代码/数据/Markdown |
| 垂直领域 | ❌ 通用搜索 | ✅ 20+ 领域 |
| 免费额度 | 无限 | 1,000 次/天 |
| API Key | 不需要 | 可选 |
| 延迟 | 中等 | 快(秒出) |
## 适用场景
1. **代码搜索** — 需要真实项目代码,不是教程
2. **金融数据** — 股票行情、公司信息
3. **法律案例** — 裁判文书、合规记录
4. **学术论文** — 论文引用、研究数据
5. **企业工商** — 股权结构、融资历史
## Pitfalls
1. **匿名限流**: 无 API Key 时 20 QPS有 Key 更高
2. **区域选择**: `zone="cn"` 适合中国数据,`zone="intl"` 适合国际
3. **垂直标签**: 必须指定正确的 tag 才能获得最佳结果
4. **结果格式**: 支持 `format="json"``format="markdown"`

137
skills/cron-ops/SKILL.md Normal file
View File

@ -0,0 +1,137 @@
---
name: cron-ops
description: "Use when managing cron jobs or configuring fallback chains."
metadata:
version: "1.0.0"
author: "小唯"
category: "devops"
tags: ["cron", "fallback", "retry", "scheduled-tasks", "运维"]
---
# Cron 运维 Skill
Hermes 定时任务的配置、fallback、重试和故障排查。
## 配置结构
`~/.hermes/config.yaml` 中 cron 段:
```yaml
cron:
model: glm-4-flash # 主模型
model_provider: zhipu # 主 provider
fallback_model: agnes-2.0-flash # fallback 模型
fallback_provider: agnes # fallback provider
provider: auto # auto = 按 model_provider 走
gateway_required: true # gateway 在才 fire
wrap_response: true
```
**Fallback 链**: 主模型失败 → fallback_model → 全局 fallback_providersconfig.yaml 顶层)
## Job 配置
`~/.hermes/cron/jobs.json` 中每个 job
```json
{
"id": "5b108ad99991",
"name": "蒸馏模型看门狗",
"script": "distill-model-watchdog.py",
"no_agent": true,
"schedule": "every 30m",
"model": null,
"provider": null
}
```
**关键**: `model`/`provider` 为 null 时继承 cron 默认配置;设置具体值会覆盖全局 fallback。
## 两种模式
| 模式 | no_agent | 执行方式 | 适用场景 |
|------|----------|----------|----------|
| **脚本模式** | true | 直接执行脚本stdout 投递 | 看门狗、数据采集、健康检查 |
| **Agent 模式** | false | LLM 执行 prompt可用工具 | 分析、报告、需要推理的任务 |
## 脚本路径规则(重要 Pitfall
1. **必须用绝对路径**: `/home/muc/.hermes/scripts/xxx.sh`,不能 `~/.hermes/scripts/xxx.sh`
2. **不支持参数**: script 字段不能 `script.sh arg1 arg2`cron 系统会把整个字符串当文件路径
3. **脚本必须在 scripts 目录**: `~/.hermes/scripts/` 下,否则报 "Script not found"
4. **Python 脚本自动用 sys.executable**: `.py` 文件用当前 Python 解释器执行
5. **Shell 脚本自动用 bash**: `.sh`/`.bash` 文件用 `/bin/bash` 执行
## Fallback 配置最佳实践
### Agent 模式 jobs
- 设置 `model: null`, `provider: null` → 继承 cron 默认
- 默认配置已有 fallback: zhipu → agnes
- 全局 fallback: mimo → deepseek → opencode-free
### 脚本模式 jobs
- 脚本内部实现重试逻辑Hermes 不自动重试脚本)
- 推荐模式:
```python
import subprocess, sys, time
def run_with_retry(cmd, max_retries=3, delay=5):
for i in range(max_retries):
result = subprocess.run(cmd, capture_output=True, text=True, timeout=300)
if result.returncode == 0:
print(result.stdout)
return 0
if i < max_retries - 1:
time.sleep(delay)
return result.returncode
if __name__ == "__main__":
sys.exit(run_with_retry([sys.executable, "target_script.py"]))
```
## 常用命令
```bash
# 列出所有 jobs
hermes cron list
# 手动触发
hermes cron run <job_id>
# 查看 job 详情
hermes cron show <job_id>
# 创建 job
hermes cron create "every 30m" --name "任务名" --script "script.py" --no-agent
# 暂停/恢复
hermes cron pause <job_id>
hermes cron resume <job_id>
```
## 故障排查
### Job 状态为 error
1. 检查 `last_fire_error` 字段
2. 脚本路径是否正确(绝对路径)
3. 脚本是否有执行权限
4. 手动执行脚本测试
### Fallback 不生效
1. 检查 job 的 `model`/`provider` 是否覆盖了全局
2. 确认 fallback_provider 的 API key 在 .env 中
3. 检查 fallback 模型是否可用
### 脚本静默失败
- no_agent 模式下,空 stdout = 静默(不投递)
- 检查脚本是否有输出
- 查看 journalctl --user -u hermes-gateway
## Pitfalls
1. **不要覆盖 job 级 model/provider**: 除非特殊需求,让 job 继承 cron 默认配置
2. **脚本重试在脚本内部实现**: Hermes 不自动重试 no_agent 脚本
3. **绝对路径**: 所有脚本路径必须是绝对路径
4. **不支持参数**: 脚本不能带参数,需要参数时写 wrapper 脚本
5. **状态文件保护**: 脚本的状态文件(如 rsshub_ai_seen.json要防并发写入

View File

@ -0,0 +1,86 @@
#!/usr/bin/env python3
"""
retry_executor.py 通用重试执行器
用法: python3 retry_executor.py <script_path> [max_retries] [delay_seconds]
示例:
python3 retry_executor.py distill-model-watchdog.py 3 5
python3 retry_executor.py stock_dual_scan.sh 2 10
"""
import subprocess
import sys
import time
import os
def main():
if len(sys.argv) < 2:
print("用法: python3 retry_executor.py <script_path> [max_retries] [delay_seconds]")
sys.exit(1)
script = sys.argv[1]
max_retries = int(sys.argv[2]) if len(sys.argv) > 2 else 3
delay = int(sys.argv[3]) if len(sys.argv) > 3 else 5
# 检查脚本是否存在
if not os.path.exists(script):
# 尝试在scripts目录查找
scripts_dir = os.path.expanduser("~/.hermes/scripts")
script_path = os.path.join(scripts_dir, script)
if os.path.exists(script_path):
script = script_path
else:
print(f"错误: 脚本不存在: {script}")
sys.exit(1)
# 确定执行方式
if script.endswith('.py'):
cmd = [sys.executable, script]
elif script.endswith('.sh'):
cmd = ['bash', script]
else:
cmd = [script]
last_output = ""
last_exit_code = 1
for attempt in range(1, max_retries + 1):
print(f"尝试 {attempt}/{max_retries}: {os.path.basename(script)}")
try:
result = subprocess.run(
cmd,
capture_output=True,
text=True,
timeout=300 # 5分钟超时
)
last_output = result.stdout + result.stderr
last_exit_code = result.returncode
if result.returncode == 0:
print(last_output)
return 0
print(f"失败 (退出码: {result.returncode})")
if result.stderr:
print(f"错误: {result.stderr[:200]}")
except subprocess.TimeoutExpired:
print(f"超时 (5分钟)")
last_exit_code = 124
except Exception as e:
print(f"异常: {e}")
last_exit_code = 1
if attempt < max_retries:
print(f"等待 {delay}s 后重试...")
time.sleep(delay)
print(f"\n所有 {max_retries} 次重试失败")
if last_output:
print(f"最后输出:\n{last_output[:500]}")
return last_exit_code
if __name__ == "__main__":
sys.exit(main())

View File

@ -0,0 +1,95 @@
# RSSHub Maintenance Reference
> RSSHub 自托管实例维护 — 路由修复、API 配置、构建流程。2026-08-25 更新。
## 实例信息
- **地址**: http://127.0.0.1:1200
- **源码**: /home/muc/projects/diygod/RSSHub
- **Systemd**: `systemctl --user [start|stop|restart] rsshub`
- **Node**: v24.16.0
- **版本**: v1.0 (2026-08-02)
## GitHub 搜索路由修复2026-08-25
### 问题
GitHub 搜索路由 `/github/search/:query` 返回:
```
TypeError: Cannot read properties of undefined (reading 'map')
```
### 根因
RSSHub 原代码使用 GitHub 网页抓取(`https://github.com/search`GitHub 已更改响应格式,`response.payload.results` 不存在。
### 修复方案
改用 GitHub Search API`https://api.github.com/search/repositories`)。
**修改文件**: `lib/routes/github/search.ts`
```typescript
// 原代码(抓取网页)
const suffix = 'search?o='.concat(order, '&q=', encodeURIComponent(query), '&s=', sort, '&type=Repositories');
const link = new URL(suffix, host).href;
const response = await ofetch(link, { headers: { accept: 'application/json' } });
const out = response.payload.results.map((item) => { ... });
// 新代码(使用 API
const host = 'https://api.github.com';
const suffix = `search/repositories?q=${encodeURIComponent(query)}&sort=${sort}&order=${order}`;
const link = `${host}/${suffix}`;
const headers = { accept: 'application/vnd.github.v3+json', 'User-Agent': 'RSSHub' };
if (config.github?.token) {
headers['Authorization'] = `token ${config.github.token}`;
}
const response = await ofetch(link, { headers });
const out = response.items.map((item) => ({
title: item.full_name,
author: item.owner.login,
link: item.html_url,
description: item.description || '',
}));
```
### GitHub Token 配置
1. 从 Obsidian key.md 获取 token`github_pat_` 开头)
2. 写入 RSSHub `.env`: `GITHUB_TOKEN=<token>`
3. 重启服务: `systemctl --user restart rsshub`
## 构建流程
RSSHub 使用 TypeScript修改代码后必须重新构建
```bash
cd /home/muc/projects/diygod/RSSHub
pnpm build # 构建(~5s
systemctl --user restart rsshub # 重启服务
```
**验证构建**:
```bash
curl -s "http://127.0.0.1:1200/github/search/ai" | head -20
```
## 已知路由变更v1.0
| 路由 | 状态 | 替代方案 |
|------|------|---------|
| `/github/trending` | ❌ 404 | 已移除 |
| `/github/topics/:topic` | ❌ 404 | 已移除 |
| `/github/search/:query` | ✅ 修复后可用 | 使用 GitHub API |
| `/github/issue/:owner/:repo` | ✅ 可用 | — |
## 常见问题
| 问题 | 原因 | 解法 |
|------|------|------|
| 路由返回 HTML 错误页 | 路由代码异常 | 检查日志,修复代码 |
| `pnpm build` 报错 | TypeScript 编译错误 | 检查语法,修复后重试 |
| 服务启动失败 | 端口占用 | `lsof -i :1200` 检查 |
| GitHub API 限流 | Token 未配置或过期 | 配置有效 token |
## 相关 Cron Jobs
| ID | 名称 | 调度 | 说明 |
|----|------|------|------|
| `6457e26da8c3` | RSSHub GitHub AI → 织忆 | 每天 8:00/20:00 | 抓取 GitHub AI 仓库写入织忆 |

View File

@ -0,0 +1,66 @@
---
name: rsshub-ops
description: "RSSHub 运维 — 部署、GitHub搜索修复、RSS源管理、织忆对接"
metadata:
version: "1.0.0"
hermes:
tags: [rsshub, rss, github, 织忆, 信息采集]
---
# RSSHub 运维 Skill
## 部署
本机 RSSHub: `~/projects/diygod/RSSHub/`systemd user service `rsshub`,端口 1200。
```bash
# 启停
systemctl --user start rsshub
systemctl --user restart rsshub
systemctl --user is-active rsshub
# 重建
cd ~/projects/diygod/RSSHub && pnpm build && systemctl --user restart rsshub
```
## GitHub 搜索路由修复v1.0 bug
**问题**: v1.0 的 `lib/routes/github/search.ts` 使用 `response.payload.results.map()`GitHub 更改 API 后返回空响应,报 `TypeError: Cannot read properties of undefined (reading 'map')`
**修复**: 改用 GitHub Search API `/search/repositories` + token 认证。
```typescript
// 核心改动: host 从 github.com 改为 api.github.com
const host = 'https://api.github.com';
const suffix = `search/repositories?q=${encodeURIComponent(query)}&sort=${sort}&order=${order}`;
const headers = { accept: 'application/vnd.github.v3+json', 'User-Agent': 'RSSHub' };
if (config.github?.token) {
headers['Authorization'] = `token ${config.github.token}`;
}
const response = await ofetch(link, { headers });
const out = response.items.map((item) => ({
title: item.full_name,
author: item.owner.login,
link: item.html_url,
description: item.description || '',
}));
```
**GitHub token**: Obsidian `~/mc/牧尘/claw/key.md``github_pat_` 开头,写入 `~/projects/diygod/RSSHub/.env``~/.hermes/.env`
**重建步骤**: 改代码 → `pnpm build``systemctl --user restart rsshub``curl http://127.0.0.1:1200/github/search/ai` 验证。
## 织忆对接
脚本: `~/.hermes/scripts/rsshub-zhiyi-fetch.py`
- 订阅 6 个 GitHub AI 搜索源
- 去重状态文件: `~/.hermes/data/rsshub_ai_seen.json`(最多 500 条)
- 有新增 → 写入织忆 `/api/v1/commit`;无新增 → 静默退出
- Cron: `6457e26da8c3` 每天 8:00/20:00
## Pitfalls
1. **git pull 超时**: gh-proxy.com 镜像偶尔慢,用 `git fetch --depth 1` 浅克隆
2. **pnpm build 警告**: `TOLERATED_TRANSFORM``EVAL` 警告可忽略
3. **状态文件污染**: 测试时 `--dry-run` 不写状态文件;但旧版本有 bug 会写
4. **GitHub API 限流**: 无 token 时 60 次/h有 token 5000 次/h

View File

@ -0,0 +1,57 @@
# bge-embed GPU 配置分析2026-08-25
## 当前状态
- **后端**ONNX RuntimeCPUExecutionProvider
- **内存占用**~1.5GB RAM
- **GPU 占用**0MB纯 CPU
- **性能**embedding 计算量小CPU 够用
## GPU 配置要求
要启用 GPU 加速,需要:
1. **onnxruntime-gpu**:已安装 v1.29.0
2. **CUDA Toolkit**:需要安装(当前只有驱动)
3. **cuDNN 9**需要安装CUDA 13.* 要求)
## 错误信息
```
Failed to load library libonnxruntime_providers_cuda.so
Require cuDNN 9.* and CUDA 13.*
```
## 评估
| 方面 | CPU | GPU |
|------|-----|-----|
| 性能 | 够用embedding 计算量小) | 更快 |
| 复杂度 | 简单 | 需要安装 CUDA Toolkit + cuDNN |
| 资源占用 | 1.5GB RAM | 减少 RAM增加 VRAM |
| 稳定性 | 稳定 | 依赖 CUDA 版本匹配 |
## 建议
**暂不启用 GPU**
1. embedding 计算量小CPU 性能够用
2. 安装 CUDA Toolkit + cuDNN 复杂度高
3. GPU 留给本地 LLMollama更划算
4. 当前 1.5GB RAM 占用可接受
## 如果需要 GPU
```bash
# 1. 安装 CUDA Toolkit匹配驱动版本
# 2. 安装 cuDNN 9
# 3. 修改 bge_embed_server.py
providers=["CUDAExecutionProvider", "CPUExecutionProvider"]
# 4. 重启服务
systemctl --user restart bge-embed
```
## 相关文件
- 脚本:`~/.hermes/scripts/bge_embed_server.py`
- 服务:`~/.config/systemd/user/bge-embed.service`
- 模型:`/home/muc/models/bge-m3/onnx/`

View File

@ -0,0 +1,75 @@
# Cron Job 重试机制2026-08-25
## 背景
cron jobs 频繁因 provider rate limit 或网络抖动失败,但 Hermes 内置没有可配置的重试次数/间隔。
## 方案
### 1. 脚本级重试no_agent jobs
创建通用重试包装脚本 `~/.hermes/scripts/cron-retry-wrapper.sh`
```bash
#!/bin/bash
# 用法: cron-retry-wrapper.sh <script_path> [max_retries] [delay_seconds]
SCRIPT="$1"
MAX_RETRIES="${2:-3}"
DELAY="${3:-5}"
for i in $(seq 1 $MAX_RETRIES); do
output=$(bash "$SCRIPT" 2>&1)
exit_code=$?
if [ $exit_code -eq 0 ]; then
echo "$output"
exit 0
fi
[ $i -lt $MAX_RETRIES ] && sleep $DELAY
done
echo "$output"
exit 1
```
### 2. 模型级 fallbackagent jobs
config.yaml 配置:
```yaml
cron:
model: glm-4-flash # 主模型(智谱,免费)
model_provider: zhipu
fallback_model: agnes-2.0-flash # 备用模型Agnes免费
fallback_provider: agnes
```
全局 fallback 链config.yaml
```yaml
fallback_providers: '["mimo", "deepseek", "opencode-free"]'
```
### 3. 批量更新 no_agent jobs
用 Python 批量更新 jobs.json把所有 no_agent job 的 script 字段包装为:
```
cron-retry-wrapper.sh <原script>
```
**排除**
- 已经包装的脚本(包含 `cron-retry-wrapper.sh`
- systemctl 命令(不需要重试,失败就是失败)
## 验证
```bash
# 测试重试脚本
~/.hermes/scripts/cron-retry-wrapper.sh ~/.hermes/scripts/stock_dual_scan.sh 2 2
# 验证 jobs.json 更新
grep "cron-retry-wrapper.sh" ~/.hermes/cron/jobs.json | wc -l
```
## 注意事项
1. 重试包装只适用于 no_agent jobs脚本执行
2. agent jobs 的重试由 Hermes fallback 链处理
3. 默认重试 3 次,间隔 5 秒,可根据任务调整
4. 重试脚本会输出每次尝试的结果,便于调试

View File

@ -0,0 +1,61 @@
# RSSHub GitHub 搜索路由修复2026-08-25
## 问题
RSSHub v1.02026-08-02 版本)的 GitHub 搜索路由 `/github/search/:query` 报错:
```
TypeError: Cannot read properties of undefined (reading 'map')
```
## 根因
GitHub 更改了搜索页面的响应格式,旧代码尝试访问 `response.payload.results.map()` 但该字段已不存在。
## 修复方案
将路由从 HTML 抓取改为 GitHub API
1. **修改路由文件** `lib/routes/github/search.ts`
2. **使用 GitHub API** `https://api.github.com/search/repositories`
3. **添加认证**(可选,提高 rate limit
4. **重新构建** `pnpm build`
5. **重启服务** `systemctl --user restart rsshub`
## 关键代码修改
```typescript
// 旧代码(抓取 HTML
const response = await ofetch(link, { headers: { accept: 'application/json' } });
const out = response.payload.results.map(...)
// 新代码GitHub API
const headers = { accept: 'application/vnd.github.v3+json' };
if (config.github?.token) {
headers['Authorization'] = `token ${config.github.token}`;
}
const response = await ofetch(link, { headers });
const out = response.items.map(...)
```
## GitHub Token 配置
1. 从 Obsidian key.md 获取 GitHub PAT
2. 写入 `~/.projects/diygod/RSSHub/.env``GITHUB_TOKEN=github_pat_xxx`
3. 写入 `~/.hermes/.env``GITHUB_TOKEN=github_pat_xxx`
## 验证
```bash
# 测试搜索
curl -s "http://127.0.0.1:1200/github/search/ai" | head -20
# 测试织忆抓取
python3 ~/.hermes/scripts/rsshub-zhiyi-fetch.py
```
## 注意事项
1. GitHub API 匿名访问 rate limit = 60 次/小时
2. 带 token = 5,000 次/小时
3. RSSHub 需要重新构建(`pnpm build`)才能生效
4. 修改后需重启服务

View File

@ -0,0 +1,95 @@
---
name: nuyoah-image-reverse-prompt
description: Use when the user provides a reference image and asks to 图片反推、画面解构、提取结构词、分析构图色彩材质、反推可直接生图的中文提示词,明确要求通过生成返图来校准本 Skill或明确要求检查、更新“南鸢图片反推 Skill”本身。普通调用只交付结构拆解、参考色卡和可复制 prompt不用于跳过分析直接生图、普通图片编辑或无参考图的通用提示词写作。
license: MIT
metadata:
author: "南鸢 nuyoah"
version: "0.1.0"
homepage: "https://knowledge.nuyoahonline.com/skills/nuyoah-image-reverse-prompt"
source: "https://github.com/nuyoah-ai-works/nuyoah-image-reverse-prompt"
---
# 南鸢图片反推
把参考图转译成可理解、可复用、可直接生成的视觉语言。普通用户不需要选择模式。
## 普通调用
1. 只使用当前图片、当前请求和本 Skill 的参考文件。当前图片是可访问本地文件时先读取真实宽高并计算最简画幅比例无法取得尺寸时才视觉估算。不要从旧对话、记忆、Eagle 历史或其他图片补全细节。
2. 先判断主导图片类型,再读取 [图片类型拆解规则](references/image-type-profiles.md)。混合图片选择一个主类型,只借用必要的次级字段。
3. 只写可见或由光线、材质、透视明确支持的事实;不确定的内容省略或标成不确定。
4. 图片存在明显曝光、色温、美颜、颗粒、柔焦、压缩或渲染签名时,读取 [成像签名与复合术语](references/imaging-signature-taxonomy.md):先分离固有属性、光线、曝光、后期/渲染,再由证据归纳受控复合术语。
5. 按 [输出与提示词合同](references/reverse-output-contract.md) 逐项展示类型规则中有画面证据的字段和完整中文提示词;只有对应类型需要独立色卡时才输出 46 个参考色。不得把多个字段压缩成一个笼统的“画面结构拆解”列表。
6. 默认用中文人类可读区块展示,所有公开字段名和区块标题必须是中文,不得展示英文键、拼音、下划线字段或中英并列标题。只有用户明确要求机器记录时才输出结构化数据。
7. 按输出合同中的“画面结构到提示词的映射”重组完整提示词,不把字段原文机械拼接;再执行字段覆盖与层级冲突审计:每个会改变生成结果的已展示字段和已选复合术语都必须进入完整提示词,完整提示词不得新增无证据事实,也不得把固有属性、光线、曝光和后期处理混为一层。
## 默认交付
```text
图像类型
...
[按图片类型选择的公开字段逐项展开]
风格参考线索
...
摄影/构图
...
主体人物
...
动作/姿态
...
光线/色彩
...
成像质感
...
成像签名(仅在对应类型需要且独立渲染特征确实影响复现时)
...
参考色卡(仅在 profile 需要时)
- #HEX|作用|大致占比
可直接复制的完整提示词
...
```
默认采用高信息密度:每个有证据的字段独立成节,通常写 13 句具体控制描述;不为凑齐模板输出无证据字段,也不以“高级、氛围感、精致”等空词代替可执行信息。
不得追加额外姿态分析附件、实现说明、来源解释或校准声明。普通调用不得自动生图。
在本库产出的可直接生成 prompt默认在末尾加入`画面右下角增加艺术性手写文字“nuyoah”作为署名。` 用户明确要求无文字、无署名,或任务本身不允许文字时省略。
## 更新本 Skill
只有用户明确要求检查或更新“南鸢图片反推 Skill”本身时才进入本流程普通图片反推不得检查网络版本。
1. 先解析当前 Skill 的真实路径。若它位于维护者私有真源 `nuyoah-skills/skills/nuyoah-image-reverse-prompt/`,不得用公开发行版覆盖;说明这是维护真源,并改走维护者发布流程。
2. 对普通安装,先执行 `npx skills list -g` 确认全局安装存在,再执行 `npx skills update nuyoah-image-reverse-prompt -g -y`
3. 若当前安装没有可更新的 lock 记录,使用官方公开源重新安装:`npx skills add nuyoah-ai-works/nuyoah-image-reverse-prompt -g -y`。不得改用不透明的一键脚本或 `curl | shell`
4. 更新后读取实际安装目录中的 `SKILL.md`,回报安装位置以及 `metadata.version`。再读取 `https://knowledge.nuyoahonline.com/api/skills/nuyoah-image-reverse-prompt/manifest`;可访问时核对版本与发行哈希,暂时不可访问时如实说明没有完成网站镜像回读。
5. 明确提醒:当前任务已加载的旧 Skill 不会热更新;新建任务或重新加载 Agent 后,新版本才会进入上下文。
## Skill 校准
只有用户明确说“校准、测试、优化这个 Skill”时才读取 [校准闭环](references/calibration-loop.md)
```text
原图 → 当前拆解与 prompt → 文本重新生图 → 原图与返图比较
→ 定位观察、路由或表达问题 → 只沉淀可复用规则 → 再次验证
```
校准生图不是普通用户交付的一部分。生成时遵守当前工作区的生图、视觉检查、归档和失败记录规则。
## 不属于本 Skill
- 没有参考图的通用提示词创作。
- 直接修改原图、换背景、抠图或局部修复。
- 只要求生图、不要求反推或结构拆解。
- 文化视觉溯源和向外扩展灵感;这应使用对应的方法工作流。
评测入口:[触发案例](evals/trigger_cases.json)、[成像签名案例](evals/imaging_signature_cases.json)、[真人摄影时尚海报案例](evals/fashion_poster_cases.json)。

View File

@ -0,0 +1,28 @@
# 人像反推 Skill 优化记录
## 2026-08-25 测试结果
### 测试环境
- 模型mimo-v2.5(视觉模型)
- 测试图片:/tmp/kuaishou_korean/img_1.png
### 发现的问题
1. 模型输出英文而非中文
2. 模型混淆「图片描述」和「生图指令」
3. 参考色卡格式不规范
4. 未严格遵循 Skill 的输出格式
### 优化措施
1. 创建了专用 prompt 模板 (prompt-template.md)
2. 简化了 prompt 结构
3. 明确了「生图指令」的要求
### 结论
当前视觉模型mimo-v2.5)不支持严格的格式控制,需要:
- 寻找支持中文格式控制的视觉模型
- 或接受近似输出,人工调整
### 后续计划
1. 测试其他视觉模型qwen-vl, gemini-pro-vision
2. 考虑微调专门的人像反推模型
3. 在 Skill 中添加模型限制说明

View File

@ -0,0 +1,146 @@
# 人像反推专用 Prompt 模板
## 使用说明
当用户提供参考图并要求人像反推时,使用以下模板指导视觉模型输出。
## Prompt 模板
```
请严格按以下格式分析这张图片。每个字段必须基于图片中可见的证据,不确定的内容直接省略。
## 图像类型
[一行说明:画幅比例、主媒介/主类型、判断置信度]
## 画面结构
- 画幅:[真实宽高比或视觉估算]
- 景别:[全身/半身/特写/大特写]
- 机位:[平拍/俯拍/仰拍,角度]
- 主体占比:[百分比]
- 空间骨架:[主体位置、负空间分布]
## 主体人物
- 人物:[数量、年龄估算、体型]
- 服装:[具体描述,颜色、材质、款式]
- 发型:[长度、颜色、造型]
- 妆容:[浓淡程度、唇色、眼妆]
## 动作/姿态
- 姿态:[站/坐/躺,具体动作]
- 手部:[位置、动作]
- 视线:[先判断虹膜在眼裂中的位置,再写朝向画面左/右]
## 摄影/构图
- 构图方式:[居中/三分法/对角线等]
- 视觉重心:[位置]
## 光线/色彩
- 主光:[方向、软硬]
- 色温:[冷/暖/中性约K值]
- 曝光:[正常/过曝/欠曝]
- 色彩倾向:[低饱和/高饱和/特定色调]
## 成像质感
- 锐度:[高/中/低]
- 噪点:[有/无,程度]
- 景深:[深/浅]
- 材质感:[皮肤质感、织物质感]
## 成像签名(仅在有明显特征时)
- 主风格:[摄影/插画/海报等]
- 成像层:[胶片/数码/渲染]
- 表面质感:[颗粒/光滑/ matte]
- 清晰度边界:[哪些区域清晰/模糊]
## 参考色卡(仅在需要时)
- #HEX|视觉作用|大致占比
- [列出4-6个主要颜色]
## 可直接复制的完整提示词
[按以下顺序组织,使用连续的中文自然语言段落,不使用项目符号或模块标签]
组织顺序:
1. 媒介与整体风格
2. 画幅、机位、构图与必要的左右空间骨架
3. 主体及关键可见特征
4. 动作、表情、道具和空间关系
5. 场景与层次
6. 光线与色彩
7. 材质与成像质感
8. 文字版式(仅适用时)
9. 当前图片必要的失败防线
10. 署名要求(适用时)
要求:
- 覆盖所有会明显改变成图的结构词,但不重复同义词
- 先写独立的整体成像签名与媒介,再写构图和第一优先控制
- 不猜测品牌、人物身份、镜头型号或不可见区域
- 不承诺恢复原作者的原始提示词
- 使用观者画面坐标描述左右关系(画面左侧/画面右侧)
- 末尾添加:画面右下角增加艺术性手写文字"nuyoah"作为署名。
```
## 示例输出格式
```markdown
## 图像类型
人像写真 · 韩系时尚摄影竖构图3:4高置信度
## 画面结构
- 画幅:竖构图 3:4
- 景别:全身
- 机位低角度仰拍约15°
- 主体占比65%
- 空间骨架:人物居中偏左,右侧留白
## 主体人物
- 人物东亚少女约16-18岁纤细体型
- 服装:白色短款针织上衣,高腰浅色牛仔裤
- 发型:黑色长发及腰,微卷发尾
- 妆容:淡妆,自然唇色,睫毛膏
## 动作/姿态
- 姿态:侧身站立,微微回眸
- 手部:自然下垂
- 视线:虹膜偏画面右下方,看向镜头方向
## 摄影/构图
- 构图方式:人物居中偏左
- 视觉重心:面部和上半身
## 光线/色彩
- 主光自然光从画面左前方45°照射
- 色温暖色调约5500K
- 曝光:正常,高光轻微过曝
- 色彩倾向:低饱和度,奶油色调
## 成像质感
- 锐度:中等,皮肤柔化处理
- 噪点:无明显噪点
- 景深:浅景深,背景虚化
- 材质感:皮肤细腻,服装纹理清晰
## 成像签名
- 主风格:韩系时尚摄影
- 成像层:数码
- 表面质感:光滑,轻微磨皮
- 清晰度边界:面部清晰,背景柔化
## 参考色卡
- #F5E6D3肤色40%
- #FFFFFF服装25%
- #8B7355头发15%
- #A8B8A0背景植物10%
- #D4C5A9地面10%
## 可直接复制的完整提示词
韩系时尚人像写真竖构图3:4低角度仰拍全身照数码摄影光滑质感东亚少女16-18岁纤细体型黑色长发及腰微卷发尾白色短款针织上衣搭配高腰浅色牛仔裤淡妆自然唇色侧身站立微微回眸看向画面右下方人物居中偏左右侧留白自然光从画面左前方45度照射暖色调5500K低饱和度奶油色调浅景深背景虚化皮肤细腻柔化处理画面右下角增加艺术性手写文字"nuyoah"作为署名。
```
## 注意事项
1. 所有左右描述使用观者画面坐标(画面左侧/画面右侧)
2. 视线方向先由虹膜位置判断,再写目标物
3. 不猜测品牌、人物身份、镜头型号
4. 不承诺恢复原作者的原始提示词
5. 参考色卡仅在需要时输出
6. 成像签名仅在有明显特征时输出

View File

@ -0,0 +1,80 @@
# Skill 校准闭环
## 触发
只有用户明确要求测试、校准或优化 `nuyoah-image-reverse-prompt` 时使用。普通图片反推不得自动进入本流程。
## 最小材料
- 原始参考图。
- 当前 Skill 输出的结构拆解与完整 prompt。
- 用该 prompt 生成的返图。
- 实际使用的完整 prompt、模型与关键生成设置。
- 用户反馈或明确的视觉验收目标。
缺少返图时,可以在用户已经授权校准的前提下,用当前完整 prompt 生成一张新的测试图。必须使用文本重新生成,不把原图作为编辑输入。生成、检查、归档和失败记录遵守当前工作区规则。
## 比较顺序
1. **类型路由**:主图片类型是否正确,是否错误借用了其他类型字段。
2. **画面结构**:可用图片宽高是否被读取并约分,比例、构图、机位、主体数量和占比、裁切、层次、遮挡与版式是否漂移。
3. **主体控制**:外观锚点、表情、视线、动作、服装、道具及相互关系是否丢失或被误解。
4. **视觉系统**:光线方向与软硬、色彩面积、材质、成像媒介和文字层级是否接近。
5. **术语归纳**:是否已经观察到底层现象,却没有归纳出准确的复合术语;术语是否误用于不满足证据的图片。
6. **层级冲突**:固有属性、光线、曝光和后期/渲染是否混写,是否把跨层共存误判成矛盾。
7. **Prompt 表达**:关键信息是否遗漏、顺序过后、措辞歧义、约束冲突或密度失衡。
8. **字段覆盖**:拆解中每个会改变生成结果的字段是否进入 promptprompt 是否新增无证据事实。
9. **模型边界**:确认问题是否只是模型随机性或能力限制,避免把偶发失败写成通用规则。
左右关系漂移时,不把它笼统归为“构图不像”。分别检查:
- 水平位置是否漂移,例如偏左主体被默认居中。
- 主体或部件朝向是否反转或被压平成正面。
- 视线方向是否与脸部朝向混写。
- 视线是否直接根据虹膜在眼裂中的位置判断,并用两侧眼白分布交叉核对。
- 是否先猜目标物,再反向推导瞳孔方向。
- 左右描述是否全部固定为观者画面坐标,是否混入人物自身左右。
- 手、道具、文字或图形是否从错误边缘进入,或延伸方向错误。
## 问题归因
每个差异只归入一个主要根因:
- `observation_missing`:原图事实没有被拆出来。
- `type_routing`:图片类型或次级模块选择错误。
- `field_structure`:拆解字段缺失、冗余或顺序错误。
- `aspect_ratio_error`:图片尺寸可读取却仍依赖目测,或宽高比例计算、约分和输出错误。
- `spatial_coordinate_error`:元素位置、主体朝向、虹膜方向或边缘进入方向没有统一使用观者画面坐标,或由附近目标物反向推导瞳孔方向。
- `palette_grouping`:颜色角色或面积判断错误。
- `prompt_ordering`:重要控制信息在 prompt 中位置过后。
- `prompt_wording`:表达模糊、歧义或不易执行。
- `prompt_coverage`:拆解字段没有完整进入 prompt或 prompt 增加了无证据事实。
- `terminology_missing`:底层现象已经观察到,但没有归纳为准确、可复用的复合术语。
- `terminology_false_positive`:复合术语缺少必要证据、命中排除条件,或被套到不相符的图片。
- `layer_conflict`:把固有属性、光线、曝光和后期/渲染混为一层,造成错误冲突或覆盖。
- `model_variance`:规则正确但生成存在随机漂移。
## 单层校正
用户明确指出“其他部分成立,只有左右空间关系错误”或类似反馈时,只修坐标表达这一层:
1. 保留已获认可的风格、人物、表情、光线、材质、道具尺度和接触距离。
2. 把原图中的水平位置、朝向、虹膜方向、肢体位置和边缘进入方向分别写清,全部使用观者画面左 / 右。虹膜方向只由眼裂中的位置判断;目标物只能在方向确定后作为核对。
3. 将必要的非对称空间骨架提前到 prompt 的构图位置。
4. 不借机强化侧脸幅度、改变道具高度、增加接触或重写整条 prompt。
5. 修订后做画面坐标审计;逐项回到原图确认左右,禁止引入人物自身左右或解剖坐标转换。
## 规则晋升
只有同时满足以下条件才写回 Skill
- 能解释不止一张图片或一个稳定类型的失败。
- 改变的是观察方法、路由、字段、色彩分组、prompt 顺序或失败防线。
- 不包含当前图片的具体人物、服装、姿势、道具、颜色、场景或文字内容。
- 修改后能用原案例重新生成或至少完成同结构回归。
单张图的识别错误只修正当前输出,不沉淀为默认规则。每次写回后至少回归真人摄影、动漫插画和海报设计三个近邻类型,防止修好一类、破坏另一类。
用户在校准时给出的理想拆解或完整 prompt 可以作为当前案例的验收合同。先比较字段粒度、字段顺序、事实覆盖和 prompt 顺序,再判断哪些规则能跨图片复用;不得把该案例的具体人物、服饰、颜色、动作或场景晋升为 profile 默认事实。
用户明确纠正的是术语定义而非单图事实时,可以把该词加入受控成像签名表,但必须同时写清必要证据、排除条件、层级归属和 prompt 位置,并用至少一个正例与三个近邻反例验证;不能只登记词名。

View File

@ -0,0 +1,416 @@
# 图片类型拆解规则
先把当前图片归入一个主导 `imageType`,再选择对应的公开拆解字段和 prompt 顺序。
这些 profile 只定义观察顺序和表达方式,不定义任何图片事实。每个具体细节必须来自当前图片或当前校准材料。
需要机器记录时也使用中文字段:
```text
图像类型 / 结构拆解 / 参考色卡 / 完整提示词 / 可选变体提示词
```
不要把同一套公开字段强行套到所有图片上。
## Routing
1. Decide `imageType.key`:
```text
photographic_portrait
anime_illustration
poster_design
commercial_product
product_still
space_landscape
ui_infographic
mixed_other
```
2. Choose the matching profile below. There is no external mother template.
3. Use only sections that help reproduce the current image. Render every evidence-backed section as its own public heading, in the profile order; do not collapse them into a generic breakdown list. Add `画面元素` only when props, text, or graphic components need a separate inventory.
4. 默认用中文人类可读区块展示。只有用户明确要求时才显示原始 JSON。
5. If the image combines categories, use the dominant profile and borrow 1-3 necessary sections from the secondary profile.
6. If a real-person fashion photograph also has obvious poster/magazine typography, logo placement, right-side or bottom layout blocks, or brand campaign structure, use the **Fashion Poster Portrait** hybrid profile below. Internally keep the key as `mixed_other` or `poster_design` depending layout dominance; publicly label it as `真人摄影时尚海报` when appropriate.
7. If any image type behaves like a poster, cover, magazine visual, music promo, or graphic layout, include the visible control fields that matter for the image, especially `主体可见性`, `局部视觉焦点`, `清晰度/遮挡地图`, `版式结构地图`, `图形元素功能`, `生成优先级`, and `失败风险`.
8. Ignore platform UI, creator marks, account numbers, app watermarks, or source overlays for routing. They should be omitted from the prompt and do not turn a portrait into a poster or layout profile.
## Evidence Gate
Profiles define candidate fields and wording style only. They do not define facts to insert.
Rules:
- Only output a section value when the current image visibly supports it or it is strongly inferable from composition, light, material, or perspective.
- Do not copy example values from previous samples into unrelated images.
- Do not force camera focal length, social-platform style, crop, compression, texture, body pose, facial occlusion, typography, or failure risks unless the current image actually shows them.
- If a profile suggests a field but the current image has no evidence for it, omit that field or write a narrower factual description.
- Color palette ratios must follow the current image's visible color distribution, not a previous sample.
- Do not create or refine an image-type profile from a single original image alone. A calibration update needs the current skill output, generated return image(s), exact generation settings, and user feedback or a clear visual target. Without that evidence, only update routing or process guards.
## Photographic Portrait
Use for real-person portraits, selfies, fashion/lifestyle photos, editorial photography.
Preferred public sections. Every evidence-backed section is required in the public output and must keep this order:
```text
图像类型
风格参考线索
风格/滤镜
摄影/构图
主体人物
身形轮廓
肤色/肤调
动作/姿态
微表情/情绪
造型
服装贴合度
服装材质
皮肤/光泽细节
场景/背景
光线/色彩
成像质感
成像签名
参考色卡
```
Rules:
- Do not force anime face fields.
- Fold eye/lip/brow details into `主体人物`, `微表情/情绪`, `造型`, and `皮肤/光泽细节`.
- Mention face shape only if it materially affects the generation.
- Use photography words only when supported: lens/crop, camera angle, direct flash, window light, film/CCD/phone flash, grain, overexposure, haze, compression.
- For close-up beauty, makeup, cosplay-adjacent, doll-like, or role-characterized real-person portraits, keep `imageType.key=photographic_portrait` unless the image is actually illustrated. Public labels may say `写实真人角色化人像摄影` when the styling visibly borrows anime/COS/doll language, but do not route it to `anime_illustration`.
- For close-up beauty, makeup, or styling portraits, describe the visible framing controls instead of only saying `近景`: aspect ratio, near-square / vertical / horizontal frame, bust or head-shoulder crop, camera height, whether it is straight-on or slightly low/high, approximate subject occupancy, head placement, arm/shoulder diagonal, and clean background negative space when supported.
- The `图像类型` line should combine visible aspect ratio, photographic subtype / subject class, and confidence, for example `2:3 竖幅写实人像摄影,真实人物近景肖像,置信度很高`. Do not state exact dimensions when only the ratio is visible.
- Approximate focal-length language such as `约 7085mm 中长焦感` is allowed only when perspective compression, facial proportions, framing, and depth of field support it. Describe it as a visual impression, never as camera metadata.
- Preserve a visible sharpness hierarchy: identify what is sharpest, what has medium detail, and what progressively softens. Do not flatten local facial sharpness plus highlight bloom into either `全局锐利` or `整体朦胧`.
- When exposure, color temperature, beautification, highlight diffusion, grain, compression, or local softness forms a distinctive photographic signature, read `imaging-signature-taxonomy.md` before writing `风格/滤镜`, `肤色/肤调`, `光线/色彩`, `成像质感`, or `成像签名`.
- Keep `肤色/肤调` for inherent skin appearance, `光线/色彩` for illumination, `成像质感` for capture/render surface, and `风格/滤镜` plus `成像签名` for the selected compound imaging signature. Do not resolve apparent conflicts by deleting one layer.
- If a compound imaging term is selected, place the canonical term first in `风格/滤镜`, expand its visible mechanics in `成像签名`, and put both the term and its shortest executable expansion near the beginning of the final prompt.
- For gaze and expression, determine gaze only from iris/pupil placement inside the eyelid opening, not from face direction, mood, nearby objects, or an inferred narrative. Express horizontal gaze only as image-left / image-right in the viewer's canvas frame; do not introduce subject-left / subject-right. Use visible sclera distribution as a cross-check: when the iris shifts toward image-right, more sclera is usually exposed on its image-left side, and vice versa. Only after the canvas direction is established may a visible object in that direction be described as a possible gaze target.
- For lip micro-expressions, separate mouth opening, lip asymmetry, teeth, tongue, and mood labels. If a small tongue tip or tongue surface is visibly caught between slightly parted lips, describe it as `舌尖微露` / `tiny tongue peek` with a narrow lip gap, no teeth, and not an exaggerated tongue-out face. If the shape is uncertain, mark it as possible lip-gap shadow instead of asserting a tongue.
- When a generated return image loses expression vitality compared with the original, strengthen only observable expression mechanics: iris offset, catchlight size/placement, upper-eyelid pressure, lower-eyelid tension, brow softness or lift, cheek/nose blush intensity, mouth asymmetry, lip compression, and the hand/lip contact point. Avoid vague fixes such as `更有神`, `更灵动`, or `更丰富表情` unless they are immediately grounded in these visible controls.
- For hand-to-mouth, hand-to-face, or prop-near-face portraits, state the hand/lip/face relationship and visible jewelry or occlusion because generation easily drifts into a different gesture. If finger, nail, straw, cigarette, prop, or fabric visibly presses the lip or cheek, describe the exact contact point and micro-deformation: indentation, lip contour interruption, compressed lower/upper lip edge, narrowed mouth gap, shifted highlight, or skin/lip pressure. If there is no visible pressure, describe it as hovering or light touch instead.
- For hand-to-face portraits, specify which visible fingers are straight or bent, their destination relative to the eye, nose, lips, cheek, or jaw, whether the palm bears weight, and what the other hand does. `托脸` alone is not enough when the gesture is visually distinctive.
- For elaborate hair, headdress, jewelry, or layered costume, describe first the large silhouette and occupied frame region, then attachment paths and repeated element families, then small materials/colors. A list of accessory nouns without placement is insufficient.
- For full-body studio fashion portraits, describe only the visible subset: `竖幅 9:16`, `全身构图`, `低机位仰拍`, approximate `28-35mm 广角感`, top negative space, bottom foot crop, leg-lengthening perspective, or social story/Pin-image feeling. Do not include any of these just because the profile matched.
- For automotive fashion portraits, when a car/motorcycle/vehicle visibly co-dominates the frame with the model, keep the photographic portrait profile unless the product clearly dominates. Describe the vehicle as a co-main visual: body position on/near the vehicle, car front/side/wheel/headlight shapes, paint/metal reflections, leg/body diagonals against vehicle geometry, and fashion-advertising mood. Do not invent a vehicle brand or model.
- If clothing, hands, hair, or props hide the mouth or lower face, describe visible facial zones and occlusion explicitly instead of inventing a full expression.
- For soft-beauty social-media portraits, mention `柔焦美颜`, `手机压缩`, `背景压缩色块`, or `人物边缘略软` only when the current image shows those artifacts; avoid over-sharpening language unless the image is truly crisp commercial photography.
- For multi-person fashion portraits or editorial poses, describe each person by stable visual role before describing clothing, and preserve visible overlap, support points, foreground/background order, and face/hand/foot anchors in natural language.
- When the current image has fragile generation constraints, the final prompt may end with a compact `避免...` clause instead of a separate negative-prompt list. For real-person styling portraits, common evidence-triggered risks include anime/illustration drift, ordinary clean avatar drift, over-clean commercial studio retouch, lost side gaze, exaggerated smile, direct gaze, lost hand-to-mouth relationship, or lost accessory structure.
- For photographic portraits, prompt order is:
```text
成像签名 + photographic medium / realism
→ aspect ratio, crop, camera height, approximate lens impression, subject occupancy
→ face, skin tone, gaze and expression mechanics
→ exact gesture/contact/occlusion and body orientation
→ large hair/accessory silhouette, then accessory families and placement
→ garment structure, fit and material contrast
→ key-light direction, falloff, background separation and color system
→ sharpness hierarchy, skin/rendering texture
→ compact current-image failure guard
→ signature requirement when applicable
```
- When a portrait combines a fragile gesture with elaborate hair/accessories, generation priority is: face visibility and gaze, exact gesture/contact, framing and large head silhouette, garment silhouette, lighting, then small ornaments. Put the same priority into prompt order.
## Anime Illustration
Use for anime, manga, game character art, stylized 2D characters, semi-anime illustrations.
Preferred public sections:
```text
图像类型
风格参考线索
脸部风格锁定
脸型/面部线条
眼型/瞳孔设计
眉形/眼神压力
嘴唇/口红
脸部负面约束
身形轮廓
肤色/肤调
动作/姿态
微表情/情绪
服装贴合度
服装材质
皮肤/头发高光
色卡
成像质感
场景/世界观
服装/道具
色彩/光影
知名角色判断
角色设计
画风/线稿
分镜/构图
局部视觉焦点
清晰度/遮挡地图
图形元素功能
失败风险
生成时参考色卡
提示词
```
Rules:
- This is the only default profile that must expand all face-specific fields.
- For anime character poster / game character art, prefer illustration-native labels such as `场景/世界观`, `服装/道具`, `色彩/光影`, `角色设计`, `画风/线稿`, and `分镜/构图` instead of photographic labels such as `摄影/构图`, `主体人物`, `造型`, `场景/背景`, and `光线/色彩`, unless the current image is intentionally mimicking photography.
- For anime close-up face posters with guofeng / ink / seal / calligraphy / rice-paper evidence, explicitly preserve the hybrid medium identity: `现代国风动漫插画`, `半厚涂与水墨线描融合`, `宣纸底`, `黑色乱发线条`, `橙红印章点缀`. Do not collapse these into generic `日系暗黑角色海报`.
- If the anime image is also a poster/cover, keep the anime face fields and add only the poster-control fields supported by the image. For example, an extreme face close-up with hair crossing the eye needs `局部视觉焦点` and `清晰度/遮挡地图`; calligraphy, seals, frames, scan windows, or typography need `图形元素功能` and possibly `版式结构地图`.
- `脸部风格锁定` should define face archetype, maturity, stylization level, and whether it is non-moe / mature / sharp / soft.
- `眼型/瞳孔设计` should include eye shape, pupil size, highlights, upper eyelid, lower lash, eye-tail pressure.
- `脸部负面约束` is required when avoiding drift matters, especially to prevent unwanted moe, galgame, childlike, over-cute, web-influencer, or overly glossy eye styles.
- `皮肤/头发高光` should be used when anime skin lighting, hair specular highlights, rim light, or cel/high-paint highlights matter more than photographic skin texture.
- Use `场景/世界观` when the image depends on setting genre, fantasy motifs, night city, sci-fi, battle, school, concert, vehicle, or other world-building context.
- Use `服装/道具` to inventory visible outfit pieces, props, weapons, vehicles, wings, tails, accessories, or mechanical objects that shape the character design.
- Use `知名角色判断` only as a cautious visual judgment: if stable IP markers are visible, mention the likely source; if not, say it is not clearly identifiable and appears closer to original / fan character design. Do not invent an IP.
- Use `角色设计` for hair structure, silhouette motifs, fantasy traits, color blocks, outfit concept, and recurring design anchors.
- Use `画风/线稿` for line quality, cel-shading, semi-thick paint, brush/rendering mix, mechanical illustration precision, and detail density.
- Use `分镜/构图` for illustration framing, low/high angle, near-full-body crop, character-to-prop layout, diagonals, S-curves, perspective, and visual flow.
- For extreme face close-ups, do not invent a full body, outfit, or scene. State that clothing is mostly absent / unclear when only head, neck, hair, and graphic marks are visible.
- For anime images with motorcycles, cars, weapons, mecha, or large props, keep the anime illustration profile when the character remains the main visual. Describe the prop in `服装/道具`, `场景/世界观`, `画风/线稿`, and `分镜/构图`; do not switch to photographic automotive/profile rules unless the image is actually a real photo.
- For anime or stylized images with complex action, multiple characters, fight choreography, inverted bodies, large props, or extreme foreshortening, describe visible character count, foreground/background order, limb ownership, contact and occlusion directly in the structure words and final prompt.
- `风格/滤镜`, `摄影/构图`, `主体人物`, `造型`, `场景/背景`, and `光线/色彩` remain valid fallback labels for simpler anime outputs, but they should not replace the anime-native sections when those sections fit better.
- Prompt order should put face style before body and clothing.
## Poster Design
Use for posters, magazine covers, graphic layouts, title cards, social cards, editorial collages.
Preferred public sections:
```text
图像类型
风格参考线索
风格/滤镜
版式/构图
主体/主视觉
主体可见性
局部视觉焦点
清晰度/遮挡地图
版式结构地图
图形元素功能
生成优先级
失败风险
文字/信息层级
图形元素
材质/印刷质感
场景/背景
光线/色彩
色卡
成像质感
```
Rules:
- Focus on hierarchy, typography placement, margins, grid, title/subtitle relationship, stickers, frames, paper/print texture.
- Treat poster reverse as generation control, not inventory. Explain why each visual element exists: guide the eye, mask/occlude, create local clarity, carry text hierarchy, frame the subject, add texture, or prevent failure.
- `版式结构地图` should include aspect ratio, title/main/info/edge-note zones, approximate positions/ratios, alignment, whitespace, overlaps, layer order, and reading path when visible.
- `清晰度/遮挡地图` is required for frosted glass, scan layers, low-res compression, translucent masks, ghosted figures, local sharpening windows, or partial features.
- `失败风险` should name short generation guardrails only when visible risks exist, such as text becoming dominant, subject disappearing, wrong clear/blur zones, lost window/frame function, or broken face/hand relationship.
- If text exists, describe its layout and visual weight. Do not invent exact words unless the user asks to preserve text.
- Do not use portrait body/face sections unless the poster's main visual is a person and those details affect generation.
## Fashion Poster Portrait
Use for real-person fashion posters, magazine inside pages, lookbook layouts, social-media campaign posters, or brand/ambassador pages where a photographed person is the main visual and typography/layout remains important.
Use these stable Chinese public field names in this order. Never expose English internal keys, underscores, or bilingual headings:
```text
图像类型
风格参考线索
品牌气质
清晰度/遮挡地图
色彩系统
构图节奏
失败风险
视觉焦点
生成优先级
图形元素功能
主视觉
图层顺序
版式层级
版式结构地图
印刷/材质质感
人物表情/动作关系
主体可见性
字体/文字系统
视觉权重
可直接复制的完整提示词
```
Rules:
- Use this profile when typography is small but structurally meaningful, especially right-side title/info blocks, bottom logos, brand labels, or magazine-page white/negative space.
- Keep the person as the first-order visual if they dominate the image; describe typography as supporting layout unless it visually overwhelms the person.
- `品牌气质` defines the audience-facing cultural mood, era signal, editorial attitude, and emotional energy; do not invent a real brand.
- `清晰度/遮挡地图` states which facial zones, limbs, props, background, and typography are sharp, soft, grain-covered, or occluded. Distinguish print grain from global fog.
- `色彩系统` assigns background, skin, dark anchor, high-saturation control color, and lightening color by role rather than listing swatches.
- `构图节奏` explains stable axes, arm/body arcs, top-middle-bottom density, deliberate asymmetry, and the reading rhythm created by crop and overlap.
- `失败风险` lists only current fragile structures: expression direction, prop/hand relation, text occlusion, small-label scale, background identity, print texture, or other visible risks.
- `视觉焦点` ranks first through fourth visual focus when the hierarchy is visible.
- `生成优先级` separates level-one identity/action/layout constraints, level-two environment/style/crop constraints, and level-three replaceable low-weight editorial details.
- `图形元素功能` names each non-text or micro-information element and states its balancing, indexing, framing, or rhythm function.
- `主视觉` is a compact identity statement for the photographed person, framing, signature pose/prop relation, hair/skin anchor, and dominant position.
- `图层顺序` explicitly lists bottom-to-top layers. Separate environment, photographed subject, foreground limbs/props, solid typography, micro-editorial marks, and global print texture when present.
- `版式层级` states primary, secondary, and tertiary information groups and the grid logic.
- `版式结构地图` divides the canvas into approximate zones or percentages and gives the reading path. Use real image dimensions for the aspect ratio when available.
- `印刷/材质质感` describes grain, color noise, scan texture, compression, halftone, ink edge, bleed, or dark-area color penetration without turning them into global blur.
- `人物表情/动作关系` combines visible gaze mechanics, eyelid pressure, mouth opening/teeth, mood, and the relation of hands or props to the face.
- `主体可见性` records visible body zones, edge crops, prop/hand occlusion, and exactly where typography may overlap without hiding identity-critical features.
- `字体/文字系统` describes color, type class, weight, tracking, scale range, crop, offset, overlap, and function. Default to layout semantics instead of copying exact words; preserve exact text only when the user explicitly asks or the wording itself is the main subject.
- `视觉权重` estimates the share of the photographed subject, key prop/gesture, typography, environment, and micro-marks. Use a small set of percentages that total approximately 100%.
- Do not add a separate `参考色卡` or `成像签名` to this profile by default. `色彩系统` and `印刷/材质质感` carry those controls; add a separate palette only when requested.
- For a close portrait, use `近距离广角肖像` when nearby arms, hands, shoes, props, or edge geometry visibly expand relative to the face and increase spatial tension. Do not replace this with a standard/mid-telephoto focal estimate merely because the face is close.
- The final prompt should read like a generation control prompt for a fashion poster, not like a pure portrait prompt. It may include a compact negative or failure-avoidance sentence when the current image has a clear risk.
- Fashion poster prompt order:
```text
photographic key visual + era/editorial style + print material
→ subject identity, framing, visual weight, inherent skin and visible highlight treatment
→ poster expression and gaze mechanics
→ exact limb/hand/prop relation
→ hair, visible garment and fit
→ environment, clarity boundary and subject visibility
→ ranked visual weight and generation priority
→ top/middle/bottom layout map and typography behavior
→ bottom-to-top 图层顺序 and reading path
→ low-weight graphic elements
→ current 失败风险
→ signature requirement when applicable
```
## Commercial Product
Use for ads, product campaign imagery, product with model, packaging hero shots, branded commercial scenes.
Preferred public sections:
```text
图像类型
风格参考线索
风格/滤镜
摄影/构图
产品主体
产品形态/结构
材质/表面反应
使用场景/商业语境
道具/辅助元素
光线/色彩
色卡
成像质感
```
Rules:
- Prioritize product silhouette, material, reflection, packaging structure, label area, prop relation, commercial lighting.
- Avoid brand names and source marks unless the user explicitly asks to preserve them.
- If a person appears, describe them only as part of product context unless they dominate the frame.
## Product Still
Use for clean still life, catalog product photos, isolated objects, tabletop compositions.
Preferred public sections:
```text
图像类型
风格参考线索
风格/滤镜
摄影/构图
主体物件
形态/结构
材质/表面反应
摆放关系
场景/背景
光线/色彩
色卡
成像质感
```
Rules:
- Focus on object geometry, surface, shadow, reflection, table/background, lens angle, depth of field.
- Do not introduce people or narrative unless visible.
## Space Landscape
Use for landscapes, cityscapes, natural scenery, space scenes, abstract environmental vistas.
Preferred public sections:
```text
图像类型
风格参考线索
风格/滤镜
构图/空间层次
主体环境
尺度/景深
地貌/建筑/天体结构
氛围/天气/粒子
光线/色彩
色卡
成像质感
```
Rules:
- Focus on spatial depth, horizon, foreground/midground/background, atmosphere, weather, light direction, scale cues.
- Do not use portrait or product sections.
## UI Infographic
Use for UI screenshots, dashboards, diagrams, information graphics, charts, app/web layouts.
Preferred public sections:
```text
图像类型
风格参考线索
版式/信息结构
主界面/主体图表
组件层级
文字/标签系统
图标/图形元素
交互状态/数据表达
光线/色彩
色卡
成像质感
```
Rules:
- Prioritize layout, grid, information hierarchy, component style, chart type, label density, icon style.
- Do not invent readable copy; describe text blocks and hierarchy unless the user provides exact text.
## Mixed Other
Use when no single category dominates.
Preferred public sections:
```text
图像类型
风格参考线索
风格/滤镜
构图
主体
关键元素
材质/质感
场景/背景
光线/色彩
色卡
成像质感
```
Rules:
- Borrow only the sections needed from the closest primary profile.
- Keep the output concise and factual.

View File

@ -0,0 +1,97 @@
# 成像签名与复合术语
## 目标
把多个可见成像机制归纳成准确、可执行的专业复合术语,同时避免看到一个局部特征就套词。这里保存构词法与少量经过用户校准的标准词,不建设无限滤镜词表。
## 四层分离
先分别判断,不用一层覆盖另一层:
1. **固有属性**:皮肤、头发、服装、物体原本的颜色与材质。
2. **光线层**:光源方向、色温、软硬、落点、阴影与轮廓光。
3. **曝光层**:全局或局部曝光、动态范围、高光是否接近溢出、暗部是否压低。
4. **后期/渲染层**:美颜、微对比、锐化、柔焦、颗粒、压缩、色偏、光晕与印刷/扫描效果。
跨层描述可以同时成立。例如固有暖肤色、冷色面部处理、暗背景和局部高曝光并不矛盾。同一层出现冲突时必须回到图片证据重新判断。
## 构词维度
只选择当前图片有证据的维度:
```text
作用范围:全局 / 面部 / 皮肤 / 高光 / 暗部 / 边缘 / 背景
色温色偏:冷白 / 暖白 / 冷青 / 暖黄 / 中性 / 其他可见色偏
曝光动态:低曝光 / 正常 / 高曝光 / 高光接近溢出 / 暗部压低
微对比:保留 / 降低 / 提高
清晰度边界:五官清晰 / 皮肤柔化 / 边缘柔化 / 全局柔化 / 局部锐化
表面成像:美颜 / 胶片颗粒 / 数码噪点 / 压缩 / 扫描 / 柔焦光晕
```
## 归纳流程
1. 先写底层可见证据,不命名。
2. 按四层放置证据,确认作用范围。
3. 从维度组合候选术语。
4. 检查标准词的全部必要证据与排除条件。
5. 根据置信度决定表达:
- 高:必要证据齐全且无反例,直接使用标准术语。
- 中:部分证据成立,写“接近某术语”,紧跟可见机制。
- 低:不输出术语,只保留窄描述。
6. 最终 prompt 同时写标准术语与最短可执行展开,不能只写术语名。
## 标准词:冷白高曝光美颜
### 层级归属
- 固有属性:不限定,允许偏暖或中性固有肤色。
- 光线层:不限定具体灯位,但面部必须获得可见提亮。
- 曝光层:面部或皮肤局部高曝光,高光柔和接近溢出;不要求全局高键。
- 后期/渲染层:面部偏冷白,皮肤微对比降低并带美颜柔化,五官与关键骨相仍清晰。
### 必要证据
- 作用范围主要落在面部或皮肤,不是整张图片无差别变白。
- 面部相对周围环境明显更冷、更白、更亮。
- 皮肤细碎反差被压低,高光呈柔润扩散。
- 双眼、眉形、唇形和关键脸部轮廓仍然可读。
### 排除条件
- 只有人物固有冷白肤色,但曝光正常、没有局部美颜处理。
- 整张图都是明亮高键曝光,面部没有独立成像机制。
- 面部偏暖或金黄,不具备冷白倾向。
- 全脸严重过曝,眼、眉、唇与骨相大面积消失。
- 只有全局柔焦或低清压缩,没有面部高曝光与美颜微对比特征。
### 输出位置
- `风格/滤镜`:先写标准词,再解释面部局部冷白高亮、皮肤微对比降低、五官保留。
- `肤色/肤调`:只写固有肤色,并说明冷白效果属于成像层;不要改写为天生冷白。
- `成像签名`:写入主风格或成像层,并说明清晰度边界。
- 完整 prompt放在开头紧跟“面部局部冷白高曝光、皮肤微对比降低、五官仍清晰”等可执行展开。
## 近邻判断
| 观察组合 | 输出 |
|---|---|
| 暗背景;固有暖象牙肤色;面部局部冷白高亮;微对比降低;五官清晰 | `冷白高曝光美颜` |
| 面部高曝光但整体偏暖,皮肤呈金黄或奶油暖白 | 不使用该词,改写暖色高曝光机制 |
| 全图明亮高键,背景与人物一起变亮,没有局部美颜层 | 不使用该词,写全局高键曝光 |
| 人物固有冷白肤色,曝光正常,皮肤纹理与微对比正常 | 不使用该词,只写固有冷白肤色 |
| 冷白且全局柔焦,五官轮廓明显丢失 | 不使用该词,写冷白全局柔焦或过曝 |
## 术语扩展规则
新增标准词必须同时提供:
```text
标准词
四层归属
必要证据
排除条件
输出位置
至少 1 个正例和 3 个近邻反例
```
用户纠正可以成为候选标准词,但不得只保存词名。具体人物、服装、姿势、场景和单图配色不进入本表。

View File

@ -0,0 +1,183 @@
# 输出与提示词合同
## 目标
输出不是图片说明,也不是关键词堆砌。它要完成两件事:
1. 让用户看懂画面由哪些视觉控制因素组成。
2. 把这些因素按生成模型容易执行的顺序写成完整中文 prompt。
## 字段级拆解
先从图片类型规则中选择真正影响复现的字段。每个有证据的字段必须用自己的中文公开标题独立展示,不能再压缩成一个笼统的“画面结构拆解”列表。面向用户的字段名不得出现英文、拼音、下划线形式或中英并列;英文内部键只用于用户明确要求的机器记录。
默认密度:
- `图像类型` 一行同时说明画幅比例、主媒介/主类型和判断置信度。
- 图片文件可读取真实尺寸时,由 `width:height` 约分得到比例;元数据优先于目测。只有尺寸不可用时才写近似比例或标注视觉估算。
- 每个有证据的字段通常写 13 句,包含可见事实、空间关系或生成控制作用。
- 同一事实只归入一个最合适字段;只有当它同时控制不同系统时,才在最终 prompt 中自然重组。
- profile 列出的字段是观察清单,不是必须凑齐的表格;无证据字段直接省略。
- 混合类型使用主 profile 的原生字段集合,不把两个 profile 的全部字段简单相加。只有原生字段无法表达关键事实时才借用少量次级字段。
- 用户明确提供更细的目标拆解时,把它视作本次校准的验收合同,但只晋升其中可跨图片复用的结构规则。
优先观察:
- 媒介与风格:摄影、插画、海报、静物、空间、界面等。
- 画幅与构图:比例、景别、机位、主体占比、裁切、负空间、视觉动线。
- 主体:数量、形态、外观锚点、表情、视线、动作、服装、道具及相互关系。
- 空间:前中后景、遮挡、接触、层次、背景信息量。
- 光线:方向、软硬、明暗关系、曝光、反射、高光和阴影。
- 色彩:主色、辅色、点缀色、冷暖、饱和度、面积比例。
- 材质与成像:皮肤、织物、金属、玻璃、纸张、颗粒、压缩、印刷或渲染质感。
- 文字与版式:仅在文字确实构成画面结构时描述层级、位置、字重和占比;看不清的文字不得编造。
- 失败防线:只写当前图片容易丢失或误解的关键结构,不写通用负面词清单。
结构词应是最小可复用视觉单元。避免把一整句 prompt 当作一个结构词,也避免输出“高级、好看、有氛围”等无法执行的空词。
## 画面坐标与左右关系
左右关系会影响复现时,先统一坐标,再描述事实。该规则适用于所有图片类型,不新增固定公开字段;把必要信息写入当前 profile 已有的构图、主体、动作、道具或版式字段。
- 所有位置、朝向、视线、肢体和道具的左右描述都固定使用观者看到的图像坐标:`画面左侧 / 画面右侧`。反推拆解和完整 prompt 不使用人物自身左 / 右,不做解剖坐标到画面坐标的转换。
- 分开判断并表达:元素**位于哪里**、主体或部件**朝向哪里**、虹膜**偏向画面哪一侧**、道具或肢体**从哪条边进入并向哪里延伸**。不得用“身体侧向左边”“人物在右边看过去”等同时包含多种解释的句子。
- 虹膜在眼裂中的可见位置是判断水平视线的唯一一手证据。先比较虹膜两侧眼白的可见面积:虹膜偏画面右侧时,通常在其画面左侧露出更多眼白;虹膜偏画面左侧时相反。脸部朝向、情绪、构图叙事和附近物体都不能替代这一步。
- 只有在虹膜方向已经确定后,才检查该方向上是否存在明确目标物。目标物只能作为一致性核对和补充关系,不能反向推导瞳孔方向;多个候选目标并存或落点不确定时,只写虹膜偏向画面左 / 右,不猜具体目标。
- 对明显非对称画面,不得只写主体总占比。还要保留真正控制复现的水平关系,例如主体中心偏左 / 居中 / 偏右、主要轮廓与负空间各占哪一侧、边缘进入物是否跨越中线、左右视觉重量如何分配。
- 优先使用左侧三分之一、画面中部、中心偏右、贴近右边缘等稳定区域词。只有位置边界清楚且百分比能帮助复现时才写近似比例,不制造伪精度。
- 对居中或近似对称画面,不得为了满足规则强行添加左右偏置。
输出前执行一次画面坐标审计:所有左右词是否都以观者画面为准;位置、朝向、虹膜方向和进入方向是否分别回答;虹膜方向是否直接来自眼裂中的可见位置,而不是由目标物倒推。任一项不满足时,先回到原图观察,再组织 prompt。
## 成像术语归纳
出现明显曝光、色温、美颜、柔焦、颗粒、压缩或渲染特征时,不要停在底层现象罗列,也不要直接猜滤镜名。按 [成像签名与复合术语](imaging-signature-taxonomy.md) 完成:
```text
可见证据
→ 固有属性 / 光线 / 曝光 / 后期与渲染四层分离
→ 作用范围、色温、曝光、微对比、清晰度边界等维度
→ 候选复合术语
→ 必要证据与排除条件
→ 标准术语或窄描述
```
高置信术语直接写入 `风格/滤镜``成像签名`;中置信使用“接近……”并紧跟可见证据;低置信不命名,只保留窄描述。标准术语不能替代证据,完整提示词必须同时保留术语和最关键的可执行展开。
## 生成优先级
当画面含有复杂头饰、精确手势、多人遮挡、强透视、局部清晰窗口或其他容易被模型简化的结构时,先在拆解阶段判断生成优先级:
```text
第一优先:主体身份、脸部可见性、构图裁切、关键动作与接触关系
第二优先:轮廓结构、服装大色块、主要道具和光线关系
第三优先:装饰数量、纹样、颗粒、边角小元素
```
不必把这三行机械地输出给普通用户,但最终 prompt 必须按此顺序表达。复杂装饰不能排在脸、手势、构图之前;“华丽、密集”等概括词不能替代可见的轮廓、位置、数量级和相互关系。
## 参考色卡
- 只有图片类型 profile 要求独立色卡或用户明确需要时,才提取 46 个真正影响画面的颜色。
- 每项写近似 HEX、视觉作用和大致占比。
- 占比按可见面积估算,不按主观重要程度排列。
- 黑白灰或单色图也要区分背景、主体、阴影、高光和小面积点缀。
## Prompt 组织
不同图片类型使用不同顺序,以对应类型规则为准。通用顺序是:
```text
媒介与整体风格
→ 画幅、机位、构图与必要的左右空间骨架
→ 主体及关键可见特征
→ 动作、表情、道具和空间关系
→ 场景与层次
→ 光线与色彩
→ 材质与成像质感
→ 文字版式(仅适用时)
→ 当前图片必要的失败防线
→ 署名要求(适用时)
```
### 画面结构到提示词的映射
字段拆解负责忠实观察,完整提示词负责按生成执行顺序重组;不得把各字段原文机械首尾拼接。按以下规则映射:
| 画面结构字段 | 在完整提示词中的作用 |
|---|---|
| 图像类型、风格参考线索、品牌气质 | 压缩为开头的媒介、时代、编辑语言和整体气质 |
| 风格/滤镜、成像签名、印刷/材质质感 | 放在开头或媒介之后,锁定全局成像系统和表面质感 |
| 画幅比例、摄影/构图、版式结构地图 | 转成画幅、景别、机位、主体占比、必要的左右空间骨架、分区比例、裁切和阅读动线 |
| 主视觉、主体人物、主体可见性 | 转成主体身份、画面位置、可见身体范围和核心遮挡边界 |
| 视觉焦点、视觉权重、生成优先级 | 决定描述先后、篇幅和强调强度;百分比仅在能帮助模型时写入,不机械复述 |
| 微表情/情绪、人物表情/动作关系、动作/姿态 | 先把虹膜在眼裂中的偏移转成观者画面左 / 右;目标物只在方向确定且落点明确时作为补充关系;其余转成眼睑压力、嘴部状态、肢体路径、接触点和道具关系 |
| 造型、服装贴合度、服装材质、图形元素功能 | 先写大轮廓和位置,再写材质、重复元素与低权重装饰 |
| 色彩系统、光线/色彩、场景/背景 | 转成主辅点缀色角色、光源方向与软硬、前中后景和背景信息量 |
| 清晰度/遮挡地图、成像质感 | 转成哪些区域最清晰、哪些逐级柔化、颗粒或压缩作用在哪里,以及哪些核心区域不能被遮住 |
| 图层顺序、版式层级、字体/文字系统 | 转成从底到顶的叠放顺序、一级到三级信息层级、文字的位置、字号、裁切和遮挡功能 |
| 失败风险 | 压缩成末尾只针对当前图片的“避免……”防线 |
映射约束:
- 一个结构事实只进入一次提示词;多个字段描述同一事实时合并,不重复堆词。
- 结构字段可以改变提示词顺序、权重或边界,不要求每个字段标题原样进入提示词。
- 当非对称左右关系影响复现时,先用一句空间骨架锁定主体中心、主要轮廓、负空间和边缘进入物,再写脸、服装、材质等局部细节;不得等局部主体已经被默认居中后才补充零散左右词。
- 位置、朝向、虹膜方向、肢体位置和进入方向必须使用同一套观者画面坐标分别表达,不得引入人物自身左右,也不得合并成一句含混的“侧向左 / 侧向右”。虹膜方向优先于任何目标关系。
- 第一优先结构必须早于装饰和质感出现;失败风险只放末尾,不能盖过正向描述。
- 提示词中的每个生成事实都必须能回指到一个已展示结构字段;不能从模板或旧案例补入。
- 完成映射后反向检查:逐字段确认已进入提示词,再逐句确认没有无来源事实。
要求:
- 使用一个连续、可直接复制的中文自然语言段落,不输出模块标签、项目符号或占位符。
- 覆盖所有会明显改变成图的结构词,但不重复同义词。
- 先写独立的整体成像签名与媒介,再写构图和第一优先控制,最后才写次要装饰、材质和失败防线。
- 海报 prompt 默认复现文字的层级、位置、字重、裁切、遮挡与视觉功能,不复制具体文案;只有用户明确要求保留文字,或文字本身就是不可替换的主题主体时,才写准确文本。
- 不猜测品牌、人物身份、镜头型号或不可见区域。
- 不承诺恢复原作者的原始提示词;交付的是基于画面证据重建的高还原生成指令。
- 用户要求同风格变体时,另写变体 prompt普通反推不主动增加变体。
## Prompt 覆盖审计
输出前逐项检查:
1. `图像类型` 中的画幅、媒介和主类型是否进入 prompt。
2. 画幅比例是否来自可用的真实尺寸;构图、主体占比、裁切、视线、动作、接触与遮挡是否完整进入 prompt所有左右描述是否只使用观者画面坐标并分别覆盖位置、朝向、虹膜方向、肢体位置和边缘进入方向视线是否先由虹膜位置确定目标物是否仅作一致性核对。
3. 造型、服装、材质、场景、光线方向、冷暖和清晰度层级是否完整进入 prompt。
4. 独立的 `成像签名` 是否放在提示词开头,而不是被埋在末尾。
5. 已选复合术语是否有足够证据、是否通过排除条件,并在 prompt 开头保留术语与关键展开。
6. 固有属性、光线、曝光、后期/渲染是否被放在正确层级;不同层可以共存,同一层不得互相矛盾。
7. 易漂移的复杂结构是否写成空间关系与优先级,而不只是形容词。
8. prompt 是否新增了拆解中没有证据的身份、品牌、镜头型号、文化出处或不可见细节。
9. 海报的 `图层顺序`、`版式结构地图`、`版式层级` 与 `视觉权重` 是否一致,前后层和百分比是否互相矛盾。
10. 必要失败防线是否紧凑且只针对当前图片。
任一生成敏感字段未覆盖时,先修订 prompt再交付。
## 成像签名
当摄影、插画或平面设计存在可独立复用的渲染签名时,单独输出 `成像签名`。它描述的是成像系统,不是主题内容:
```text
主风格:...
成像层:...
表面质感:...
清晰度边界:...
```
例如可观察低调光、局部高光扩散、特定暗部色偏、胶片颗粒或局部柔焦;不得凭空套用预设滤镜。最终 prompt 以这组签名开头,并立刻说明媒介与真实/插画属性,防止主题词把成像风格冲淡。复合术语的证据、分层和排除规则以 [成像签名与复合术语](imaging-signature-taxonomy.md) 为准。
## 机器记录
只有用户或下游流程明确要求时,才使用以下中文字段:
```text
图像类型
结构拆解
参考色卡
完整提示词
变体提示词(仅在明确要求变体时)
```
机器字段也必须保持中文,不得替代默认的人类可读交付。

View File

@ -0,0 +1,120 @@
---
name: project-manager-breakout
description: "Use when breaking down projects or planning sprints."
metadata:
version: "1.0.0"
author: "CaptainStinkRat"
category: "project-management"
source: "https://github.com/CaptainStinkRat/projectManagerBreakout"
tags: ["project-management", "task-breakdown", "dependency-analysis", "sprint-planning", "orchestration"]
---
# Project Manager Breakout Skill
A strategic orchestration system for breaking down complex projects, analyzing dependencies, and planning sprints.
## When This Skill Activates
Use this skill when the user:
- Requests breaking down a large feature, project, or problem
- Asks "How should I approach this?"
- Provides a vague goal and needs a work plan
- Wants to understand task dependencies
- Needs to plan sprints or allocate work
- Wants to coordinate multiple agents or workstreams
## Core Skills
### 1. Task Breakdown
Transform ill-defined goals into a structured task hierarchy.
**Approach:**
1. Validate problem definition (ask clarifying questions if needed)
2. Identify task categories (group work into logical clusters)
3. Decompose into atomic tasks (each task: clear title, effort estimate, dependencies)
4. Build execution map (phases, critical path, parallel opportunities)
**Output:**
- Task list with IDs, titles, effort estimates, and dependencies
- Work streams grouped by domain/component
- Execution map showing phases and critical path
### 2. Dependency Analysis
Analyze task graphs to find critical paths and bottlenecks.
**Approach:**
1. Map all task dependencies (what blocks what)
2. Build dependency graph
3. Identify critical path (longest sequence of dependent tasks)
4. Find bottlenecks (tasks that block many others)
5. Identify parallelization opportunities
**Output:**
- Dependency graph
- Critical path identification
- Bottleneck analysis
- Parallelization recommendations
### 3. Sprint Planning
Allocate tasks to sprints with realistic timelines.
**Approach:**
1. Estimate task effort (story points or hours)
2. Calculate team/agent capacity
3. Allocate tasks to sprints based on priority and dependencies
4. Identify risks and buffers
5. Create sprint backlog with clear acceptance criteria
**Output:**
- Sprint backlog with task allocation
- Timeline with milestones
- Risk register
- Capacity planning
## Usage Examples
### Example 1: Feature Decomposition
**Input:** "We need to build an authentication system."
**Process:**
1. Clarify requirements (OAuth2? JWT? Session-based?)
2. Identify components (database, auth service, token logic, UI)
3. Break into tasks (each with clear acceptance criteria)
4. Map dependencies (database schema → auth service → token logic → UI)
5. Plan sprints (Sprint 1: backend, Sprint 2: frontend, Sprint 3: integration)
### Example 2: Project Planning
**Input:** "We're launching a new product in 3 months."
**Process:**
1. Define milestones (MVP, Beta, Launch)
2. Break down work streams (Engineering, Design, Marketing, Operations)
3. Identify cross-team dependencies
4. Create timeline with buffers
5. Set up progress tracking
## Integration with Hermes
This skill works with:
- **delegate_task**: Spawn subagents for parallel task execution
- **ao compose**: Orchestrate multi-agent workflows
- **cron jobs**: Schedule progress checks and reminders
- **memory**: Track project state and decisions
## Best Practices
1. **Clarify before decomposing** - 10 minutes of clarification saves days of wrong work
2. **Atomic tasks** - Each task should be completable by one agent in one session
3. **Clear acceptance criteria** - Define what "done" looks like for each task
4. **Track dependencies** - Don't start blocked tasks prematurely
5. **Regular checkpoints** - Review progress and adjust plans
## Pitfalls
1. **Too granular** - Don't break tasks into sub-sub-sub-tasks; keep it actionable
2. **Ignoring dependencies** - Parallel work without dependency awareness causes conflicts
3. **No buffers** - Always add 20-30% buffer for unknowns
4. **Static plans** - Plans should evolve as you learn; don't treat them as immutable

@ -0,0 +1 @@
Subproject commit 99fdc42e0a39bd644c589d0d65b1b6e600ac6091

View File

@ -0,0 +1,65 @@
---
name: anysearch
description: "Use when searching for code, finance, or vertical data."
metadata:
version: "1.0.0"
author: "小唯"
tags: ["search", "api", "agent", "vertical", "anysearch"]
---
# AnySearch Skill
为 Agent 设计的搜索基础设施,支持结构化输出和垂直领域搜索。
## API 配置
```python
import os
import requests
ANYSEARCH_API_BASE = "https://api.anysearch.com"
ANYSEARCH_API_KEY = os.getenv("ANYSEARCH_API_KEY") # 可选
```
## 搜索端点
```python
def search(query, max_results=10, zone="cn", language="zh-CN", tag=None, params=None):
headers = {"Content-Type": "application/json"}
if ANYSEARCH_API_KEY:
headers["Authorization"] = f"Bearer {ANYSEARCH_API_KEY}"
payload = {"query": query, "max_results": max_results, "zone": zone, "language": language}
if tag: payload["tag"] = tag
if params: payload["params"] = params
response = requests.post(f"{ANYSEARCH_API_BASE}/v1/search", headers=headers, json=payload)
return response.json()
```
## 垂直领域标签
- `code.snippet` — 代码片段搜索
- `code.doc` — 文档搜索
- `finance.quote` — 金融行情
- `legal.case` — 法律案例
- `academic.paper` — 学术论文
## 提取端点
```python
def extract(url):
headers = {"Content-Type": "application/json"}
if ANYSEARCH_API_KEY:
headers["Authorization"] = f"Bearer {ANYSEARCH_API_KEY}"
response = requests.post(f"{ANYSEARCH_API_BASE}/v1/extract", headers=headers, json={"url": url})
return response.json()
```
## 注意事项
1. 匿名访问1,000 次/天20 QPS
2. API Key可在 anysearch.com/console/api-keys 获取
3. 垂直领域搜索需要指定 tag 参数
4. 结果包含来源标注和结构化数据

View File

@ -0,0 +1,90 @@
# AnySearch API 参考文档
## API 端点
### POST /v1/search
统一搜索端点。网关根据意图路由到最佳数据源,然后融合重排序结果。
**请求参数:**
| 字段 | 类型 | 必需 | 描述 |
|------|------|------|------|
| query | string | 是 | 搜索查询 |
| max_results | int | 否 | 返回结果数量默认10范围1-10 |
| tag | string | 否 | 子领域能力标签,格式 `{domain}.{sub_domain}` |
| zone | string | 否 | 区域,`cn` 或 `intl` |
| language | string | 否 | 首选语言,如 `zh-CN``en` |
| params | object | 否 | 传递给 AnyMix 的扩展参数 |
| format | string | 否 | 输出格式,`json` 或 `markdown` |
**请求示例:**
```bash
curl -X POST https://api.anysearch.com/v1/search \
-H "Content-Type: application/json" \
-d '{
"query": "Go 1.26 release notes",
"tag": "code.doc",
"params": {"library": "golang"},
"max_results": 10
}'
```
### GET /v1/sub-domains
返回一个或多个搜索域的可用子域及其参数定义。
**请求参数:**
| 字段 | 类型 | 必需 | 描述 |
|------|------|------|------|
| domain | string[] | 是 | 查询参数,重复以请求多个域 |
**请求示例:**
```bash
curl 'https://api.anysearch.com/v1/sub-domains?domain=code&domain=finance' \
-H "Authorization: Bearer YOUR_ANYSEARCH_API_KEY"
```
### POST /v1/extract
从公共 HTTP 或 HTTPS URL 获取并提取干净内容。
**请求参数:**
| 字段 | 类型 | 必需 | 描述 |
|------|------|------|------|
| url | string | 是 | 要提取的公共绝对 URL |
**请求示例:**
```bash
curl -X POST https://api.anysearch.com/v1/extract \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/article"}'
```
## 垂直领域标签
| 标签 | 描述 |
|------|------|
| `code.snippet` | 搜索真实代码实现 |
| `code.doc` | 搜索开发者文档 |
| `finance.quote` | 实时和历史行情(股票、外汇、加密货币等) |
| `legal.case` | 法律案例 |
| `academic.paper` | 学术论文 |
## 认证
| 模式 | 头格式 | 配额和速率限制策略 |
|------|--------|-------------------|
| 匿名 | 无 Authorization 头 | 按客户端 IP 限速,消耗每日免费配额 |
| 认证 | `Authorization: Bearer YOUR_ANYSEARCH_API_KEY` | 按密钥关联的付费配额计费,并发限制更高 |
## 免费额度
- 匿名访问1,000 次/天20 QPS
- 学生/开发者2,000 次/天
- API Key可在 anysearch.com/console/api-keys 获取