报纸
- 作者仓库星标 393
- 许可证 Apache-2.0
- 作者仓库 gradient-bang
- 领域
- 人工智能
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @pipecat-ai · Apache-2.0
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 需要 · OpenAI
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 读取环境变量
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
第 1 步——从用户那里收集副本
所需输入: 标题(最大类型 — 例如 `CALL TO ARMS`) 副标题(一行 — 例如 `Pilots Wanted to Test the Combat Rework`) 正文(1-3 个短句设定风险) 号召性用语(例如 `Join the test → #gradient-bang`)
第 2 步 — 编写 Markdown 副本
使用这个精确的结构写入`artifacts/banners/<slug>.md`(每行独占一行,块之间有空行)。文件中的每个可见单词都会逐字呈现 - 没有额外的隐藏格式。将总可见字数控制在 50 以下——横幅很快就会变得拥挤。如果身体太长,请修剪它。
第 3 步 — 渲染
来源`.env.bot`,因为这是`OPENAI_API_KEY`在此存储库中的位置(脚本还会从`.env`自动加载它(如果存在))。默认为`2048x1024`(干净的 2:1 横幅)。对于更宽的 Discord 横幅形状,请附加 `--size 2880x1024`。两个亮度都必须是 16 的倍数;最大边数 3840;最大比例 3:1。默认为报头参考。对于更繁忙的全页风格美感,请附加`--reference src/gradientbang/newspaper/assets/references/full-page-style-fri-sat-pt.png`。
第 4 步 — 显示结果
读取生成的 PNG,以便图像在聊天中可见,然后使用工件路径进行总结。用户审阅并接受、编辑降价并重新渲染,或者要求重新拍摄(图像编辑不是确定性的 - 相同的输入可以产生不同的布局)。
# Newspaper Asset Generator
Single entry point for all *Gradient News & Observer* image assets. Routes to the underlying script based on the asset type.
## Usage
`/newspaper <asset-type> [args]`
Asset types:
- `banner` — single wide masthead-style banner (e.g. CALL TO ARMS recruiting header). Handled below.
- `front-page` — full ten-section newspaper front page from real game events. Hands off to **[`/news-front-page`](../news-front-page/SKILL.md)** — invoke that skill directly instead.
- `prompt-experiment` — sweep prompt variants for front-page rendering. Calls `news-front-page-prompt-experiment` (see [src/gradientbang/newspaper/scripts/prompt_experiment.py](../../../src/gradientbang/newspaper/scripts/prompt_experiment.py) for flags).
If the user passes an unrecognized asset type, list the three options above and stop — do not guess.
## All output goes under `artifacts/`
`artifacts/` is gitignored. Both copy markdown and rendered PNGs live there. Subdirectories per asset type:
- `artifacts/banners/`
- `artifacts/gradient-news-observer-regions/` (front-page composited)
- `artifacts/gradient-news-observer-images/` (front-page one-shot)
## Banner workflow
A banner is a single wide image with one dramatic headline + short body + call-to-action. Used for recruiting drives, special-edition broadsides, channel headers, etc.
### Step 1 — gather copy from the user
Required inputs:
- **Headline** (largest type — e.g. `CALL TO ARMS`)
- **Subhead** (one line — e.g. `Pilots Wanted to Test the Combat Rework`)
- **Body** (1–3 short sentences setting the stakes)
- **Call to action** (e.g. `Join the test → #gradient-bang`)
Optional:
- **Kicker** (small caps line above the headline; defaults to `THE GRADIENT NEWS & OBSERVER · SPECIAL EDITION`)
- **Slug** (short filename stem, kebab-case; defaults to a slugified headline)
If the user's prompt only gives you a topic ("call to arms for combat rework"), draft kicker/headline/subhead/body/CTA yourself in the newspaper's voice and confirm with the user before rendering — image-edit calls take ~2 minutes and cost real money.
### Step 2 — write the copy markdown
Write to `artifacts/banners/<slug>.md` using this exact structure (each line on its own line, blank lines between blocks). Every visible word in the file is rendered verbatim — no extra hidden formatting.
```
<KICKER>
<HEADLINE>
<Subhead>
<Body sentences.>
<Call to action>
```
Keep total visible word count under ~50 — banners get cramped fast. If body runs long, trim it.
### Step 3 — render
```bash
set -a && source .env.bot && set +a
uv run news-banner --copy-file artifacts/banners/<slug>.md
```
- Sources `.env.bot` because that's where `OPENAI_API_KEY` lives in this repo (the script also auto-loads it from `.env` if present).
- Defaults to `2048x1024` (clean 2:1 banner). For wider Discord-banner shapes, append `--size 2880x1024`. Both dims must be multiples of 16; max edge 3840; max ratio 3:1.
- Defaults to the masthead reference. For a busier full-page-style aesthetic, append `--reference src/gradientbang/newspaper/assets/references/full-page-style-fri-sat-pt.png`.
- Render takes ~120–150s. Stream stdout — the script prints the final PNG path on success.
- Pass `--force` to overwrite an existing PNG with the same name.
### Step 4 — show the result
Read the generated PNG so the image is visible in chat, then summarize with the artifact path. The user reviews and either accepts, edits the markdown and re-renders, or asks for a fresh take (image-edit isn't deterministic — same input can produce a different layout).
## Front-page workflow
Don't replicate the front-page logic here. Tell the user:
> Front pages are a different animal — they pull real game events into a structured digest, then render a 2160×3840 ten-story page. Use `/news-front-page [duration]` (e.g. `/news-front-page 24h`).
If they explicitly want to re-render an existing markdown front page without regenerating the digest, they can call `news-front-page-image --front-page-md <path>` directly.
## Prompt-experiment workflow
This is a power-user tool for sweeping prompt variants. Run with `--help` first to surface the flags, then construct the right command for the user's question:
```bash
uv run news-front-page-prompt-experiment --help
```
## Rules
- **Always confirm copy before spending an image-edit call.** Each one costs and takes ~2 min. Cheap to iterate on markdown, expensive to iterate on images.
- **Only edit `artifacts/`** for copy and outputs. Don't write under `src/` for one-off banners.
- **Don't invent new script entry points.** If the user wants something the existing scripts don't support (e.g. a different aspect or new layout), discuss the trade-off before adding code.
- **Don't commit anything.** The user reviews artifacts and decides what to share.
章节与文件索引
按说明文件中的顺序排列。
用途
所有输出都在artifacts/下
横幅工作流程
第 1 步——从用户那里收集副本
第 2 步 — 编写 Markdown 副本
文件/命令 -> /newspaper <asset-type> [args] · banner · front-page · /news-front-page · prompt-experiment · news-front-page-prompt-experiment · artifacts/ · artifacts/banners/
内容校验值 -> a8a720f629c0
当前原文的自动摘译,尚未人工审校。
用途
/newspaper <asset-type> [args]资产类型:banner— 单宽报头样式横幅(例如“战斗号召”招募标题)。下面处理。front-page— 来自真实游戏事件的完整十版报纸头版。交给/news-front-page——直接调用该技能。prompt-experiment— 用于首页渲染的扫描提示变体。调用news-front-page-prompt-experiment(有关标志,请参阅 src/gradientbang/newspaper/scripts/prompt_experiment.py)。所有输出都在artifacts/下
artifacts/被忽略。复制 markdown 和渲染的 PNG 都在那里。每个资产类型的子目录:artifacts/banners/artifacts/gradient-news-observer-regions/(首页合成)artifacts/gradient-news-observer-images/(首页一次性)横幅工作流程
横幅是一张宽幅图像,带有一个引人注目的标题+简短的正文+号召性用语。用于招募活动、特别版侧边栏、频道标题等。