stardust-auth

stardust-auth is a command for Claude Code from wordflowlab/novel-writer. It costs 0 tokens per session (1,535 once invoked), scanned B, original, MIT.

An authentication command for the Stardust Dreams template marketplace. It checks whether you are signed in and supports password, QR-code, or API-key login.

In plain words
What is it for?
Use it to sign in, check your authentication status, and obtain access to paid templates.
Why use it?
It removes the need to handle the marketplace login process manually before using paid templates. It also checks existing tokens and stores login details in encrypted form.

Command for Claude Code

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

Good fit Use it to sign in, check your authentication status, and obtain access to paid templates.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/wordflowlab/novel-writer/stardust-auth
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-auth

README.md
[![agentmods](https://agentmods.dev/badge/commands/wordflowlab/novel-writer/stardust-auth/github.svg)](https://agentmods.dev/commands/wordflowlab/novel-writer/stardust-auth)
Your own site
<a href="https://agentmods.dev/commands/wordflowlab/novel-writer/stardust-auth"><img src="https://agentmods.dev/badge/commands/wordflowlab/novel-writer/stardust-auth/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-auth

Your own site · 80×15
<a href="https://agentmods.dev/commands/wordflowlab/novel-writer/stardust-auth"><img src="https://agentmods.dev/badge/commands/wordflowlab/novel-writer/stardust-auth.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 1,535 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.01535
Opus 5 $0.00000 $0.00767
Sonnet 5 $0.00000 $0.00307
Haiku 4.5 $0.00000 $0.00153

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

Security

Grade B, and why

stardust-auth scanned grade B with 1 finding 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.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

const response = await fetch('https://api.stardust-dreams.com/auth/login', { method: 'POST',
plugins/stardust-dreams/commands/stardust-auth.md · 205 lines

How it starts

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

星尘织梦认证登录 - /stardust-auth

系统角色

你是星尘织梦工具市场的认证助手,负责帮助用户安全登录并获取访问权限。

任务

引导用户完成星尘织梦账号的认证流程,安全存储访问令牌,确保用户能够使用付费模板功能。

工作流程

1. 检查认证状态

// 首先检查是否已有有效 token
const existingToken = await checkExistingAuth();
if (existingToken && !isExpired(existingToken)) {
  return "✅ 您已登录,可以直接使用模板功能";
}

2. 引导登录

询问用户选择登录方式:

  • 账号密码登录 - 输入邮箱和密码
  • 扫码登录 - 生成二维码,手机扫码确认
  • API Key - 使用长期 API Key(企业用户)

3. 执行认证

账号密码方式
async function loginWithPassword() {
  // 1. 安全输入密码(不显示明文)
  const email = await prompt("请输入邮箱:");
  const password = await promptPassword("请输入密码:");

  // 2. 调用认证 API
  const response = await fetch('https://api.stardust-dreams.com/auth/login', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ email, password })
  });

  // 3. 获取 token
  const { token, refreshToken, expiresIn, userInfo } = response.data;

  // 4. 安全存储(加密保存)
  await secureStorage.save('auth', {
    token: encrypt(token),
    refreshToken: encrypt(refreshToken),
    expiresAt: Date.now() + expiresIn * 1000,
    user: userInfo
  });

  return userInfo;
}
扫码登录方式
async function loginWithQR() {
  // 1. 获取登录二维码
  const { qrCode, sessionKey } = await getLoginQR();

  // 2. 显示二维码
  console.log("请使用星尘织梦 App 扫描二维码:");
  displayQRCode(qrCode);

  // 3. 轮询等待确认
  const token = await pollForConfirmation(sessionKey);

  return token;
}

4. 验证权限

登录成功后,检查用户订阅状态:

async function checkSubscription(token) {
  const subscription = await api.getSubscription(token);

  console.log(`
    ✨ 登录成功!
    👤 用户:${subscription.username}
    📅 订阅类型:${subscription.plan}
    🎯 可用模板:${subscription.availableTemplates.length} 个
    ⏰ 到期时间:${subscription.expiresAt || '永久'}
  `);

  if (subscription.plan === 'free') {
    console.log(`
      💡 提示:您当前是免费用户,部分高级模板需要升级订阅
      🚀 升级地址:https://stardust-dreams.com/pricing
    `);
  }
}

5. Token 管理

自动续期
// 后台自动续期,用户无感知
setInterval(async () => {
  const auth = await secureStorage.get('auth');
  if (auth && isNearExpiry(auth.expiresAt)) {
    const newToken = await refreshAuthToken(auth.refreshToken);
    await secureStorage.update('auth', newToken);
  }
}, 60000); // 每分钟检查

Read the full file on GitHub · 205 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 · 205 lines · 0 tokens per session scan B 3c1faa3ca161

Subscribe to this mod's changes

stardust-auth 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 1,535 tokens. A static security scan graded it B with 1 finding (sends data to an external url). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.