stardust-use

stardust-use is a command for Claude Code from wordflowlab/novel-writer. It costs 0 tokens per session (2,397 once invoked), scanned A, original, MIT.

A command for retrieving an encrypted prompt template from a service, decrypting it in memory, filling in parameters, and generating content. It requires an authenticated session.

In plain words
What is it for?
Use it to run a server-provided prompt template for a valid session without permanently storing the decrypted template.
Why use it?
It keeps the decrypted prompt out of files and logs and checks that the session and login are valid before use.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Good fit Use it to run a server-provided prompt template for a valid session without permanently storing the decrypted template.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/wordflowlab/novel-writer/stardust-use
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/wordflowlab/novel-writer

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for stardust-use

README.md
[![agentmods](https://agentmods.dev/badge/commands/wordflowlab/novel-writer/stardust-use/github.svg)](https://agentmods.dev/commands/wordflowlab/novel-writer/stardust-use)
Your own site
<a href="https://agentmods.dev/commands/wordflowlab/novel-writer/stardust-use"><img src="https://agentmods.dev/badge/commands/wordflowlab/novel-writer/stardust-use/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for stardust-use

Your own site · 80×15
<a href="https://agentmods.dev/commands/wordflowlab/novel-writer/stardust-use"><img src="https://agentmods.dev/badge/commands/wordflowlab/novel-writer/stardust-use.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,397 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.02397
Opus 5 $0.00000 $0.01198
Sonnet 5 $0.00000 $0.00479
Haiku 4.5 $0.00000 $0.00240

Measured 10d ago against content hash 13a160efc65e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

stardust-use scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/stardust-dreams/commands/stardust-use.md · 327 lines

How it starts

The opening of the file, as written. The whole thing — 327 lines — stays where its author put it; the contents beside it link to each section on GitHub.

使用星尘织梦模板 - /stardust-use

系统角色

你是星尘织梦工具市场的执行助手,负责从服务端获取加密的 Prompt 模板,在内存中解密并填充参数,生成高质量的创作内容。

重要安全原则

⚠️ 核心安全要求

  1. 永不保存 - 解密后的 Prompt 绝不能写入文件或日志
  2. 即用即删 - 使用完立即从内存清理
  3. 权限验证 - 必须有有效的认证 token
  4. 会话校验 - SessionID 必须有效且属于当前用户

工作流程

步骤 1:参数验证

async function validateParams(sessionId, options) {
  // 检查必需参数
  if (!sessionId) {
    throw new Error('请提供 SessionID (--session 参数)');
  }

  // 验证 SessionID 格式
  if (!/^[a-zA-Z0-9]{8,12}$/.test(sessionId)) {
    throw new Error('SessionID 格式无效');
  }

  // 检查认证状态
  const auth = await getAuthToken();
  if (!auth || isExpired(auth)) {
    throw new Error('请先使用 /stardust-auth 登录');
  }

  return { sessionId, token: auth.token };
}

步骤 2:获取会话信息

async function fetchSessionInfo(sessionId) {
  // 从公开 API 获取会话基本信息
  const response = await fetch(`${API_BASE}/api/session/${sessionId}`);

  if (!response.ok) {
    if (response.status === 404) {
      throw new Error('会话不存在或已过期,请重新在 Web 端生成');
    }
    throw new Error('获取会话信息失败');
  }

  const session = await response.json();

  // 显示会话信息
  console.log(`
📋 会话信息:
- 模板:${session.templateName}
- 类型:${session.templateType}
- 创建时间:${session.createdAt}
- 过期时间:${session.expiresAt}
  `);

  return session;
}

步骤 3:获取加密的 Prompt

async function fetchEncryptedPrompt(token, templateId, sessionId) {
  console.log('🔐 正在获取加密模板...');

  const response = await fetch(`${API_BASE}/api/protected/prompt/get`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      templateId,
      sessionId
    })
  });

  if (!response.ok) {
    if (response.status === 401) {
      throw new Error('认证失败,请重新登录');
    }
    if (response.status === 403) {
      throw new Error('无权访问此模板,请检查订阅状态');
    }
    if (response.status === 429) {
      throw new Error('请求过于频繁,请稍后重试');
    }
    throw new Error(`获取模板失败: ${response.statusText}`);
  }

  const data = await response.json();

  return {
    encryptedPrompt: data.encryptedPrompt,  // 加密的 Prompt
    sessionKey: data.sessionKey,            // 解密密钥
    parameters: data.parameters,            // 用户参数
    metadata: data.metadata                 // 元数据
  };
}

Read the full file on GitHub · 327 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 327 lines · 0 tokens per session scan A 13a160efc65e

Subscribe to this mod's changes

stardust-use is a command published in the GitHub repository wordflowlab/novel-writer (943 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,397 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.