zjs105910/workbuddy-market / bundled/novel-writing-suite/skills/story-setup
story-setup
Flagged网文写作工具集基础设施部署与检查。为 Claude Code / OpenCode / Codex / Google Antigravity / ZCode / OpenClaw / Reasonix 提供内置适配;Web AI / 通用 Agent 可走 skills + AGENTS.md 文件模式。触发方式:/story-setup、$story-setup、「准备写书」「帮我搭一下环境」「配置写作项目」「检查写作环境」。
references/templates/hooks/lib/sentinel.sh
View on GitHub#!/bin/bash
# sentinel.sh — 读取 .story-deployed sentinel 字段的工具函数
# .story-deployed 是 YAML key: value 格式(不依赖 yq,用 awk 单进程解析)
# 注意:不加 set -euo pipefail,避免 source 时覆盖调用方的 shell options
sentinel_file() {
if [ -n "${SENTINEL_FILE:-}" ]; then
printf '%s\n' "$SENTINEL_FILE"
elif command -v project_root >/dev/null 2>&1; then
printf '%s/.story-deployed\n' "$(project_root)"
else
printf '%s\n' ".story-deployed"
fi
}
# read_sentinel_field <field_name> [file]
# 输出字段值(已去除前后空格和成对引号);文件或字段缺失时输出空串。
# 调用方安全:始终 return 0,不会因 pipefail / set -e 导致 caller 退出。
read_sentinel_field() {
local field="$1"
local file="${2:-$(sentinel_file)}"
[ -f "$file" ] || return 0
awk -v key="${field}:" '
{ sub(/\r$/, "") }
substr($0, 1, length(key)) == key {
v = substr($0, length(key) + 1)
sub(/^[[:space:]]+/, "", v)
n = length(v)
if (n >= 2 && substr(v, 1, 1) == "\"" && substr(v, n, 1) == "\"") {
v = substr(v, 2, n - 2)
} else if (n >= 2) {
q = sprintf("%c", 39)
if (substr(v, 1, 1) == q && substr(v, n, 1) == q) {
v = substr(v, 2, n - 2)
}
}
sub(/[[:space:]]+$/, "", v)
print v
exit
}
' "$file" 2>/dev/null
return 0
}
# sentinel_exists [file] — exit 0 / 1
sentinel_exists() {
[ -f "${1:-$(sentinel_file)}" ]
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |