AgentX: Command for Claude Code

.claude/commands/rag-publish-requirements.md

rag-publish-requirements is a command for Claude Code from lucky-aeon/AgentX. It costs 0 tokens per session (5,743 once invoked), scanned A, original, Apache-2.0.

A command for planning how a RAG knowledge base is published. RAG is a system that retrieves stored documents to help produce answers; the plan covers version snapshots, administrator review, and database records.

In plain words
What is it for?
Use it to plan versioned releases, copy files and document data into independent snapshots, track review states, and design the related database table.
Why use it?
It helps define how published content stays unchanged and how it is checked before reaching a marketplace.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is lucky-aeon/AgentX's own configuration. It tells Claude Code how to work on AgentX itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything AgentX configures →

Reuse

Borrowing it

Nothing to install: this file belongs to lucky-aeon/AgentX. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/lucky-aeon/AgentX/master/.claude/commands/rag-publish-requirements.md
Clone the repo
git clone --depth 1 https://github.com/lucky-aeon/AgentX

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 rag-publish-requirements

README.md
[![agentmods](https://agentmods.dev/badge/commands/lucky-aeon/agentx/rag-publish-requirements/github.svg)](https://agentmods.dev/commands/lucky-aeon/agentx/rag-publish-requirements)
Your own site
<a href="https://agentmods.dev/commands/lucky-aeon/agentx/rag-publish-requirements"><img src="https://agentmods.dev/badge/commands/lucky-aeon/agentx/rag-publish-requirements/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 rag-publish-requirements

Your own site · 80×15
<a href="https://agentmods.dev/commands/lucky-aeon/agentx/rag-publish-requirements"><img src="https://agentmods.dev/badge/commands/lucky-aeon/agentx/rag-publish-requirements.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 5,743 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.05743
Opus 5 $0.00000 $0.02871
Sonnet 5 $0.00000 $0.01149
Haiku 4.5 $0.00000 $0.00574

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

Security

Grade A, and why

rag-publish-requirements 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.

.claude/commands/rag-publish-requirements.md · 637 lines

How it starts

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

RAG 发布功能需求规划

1. 核心设计原则

1.1 快照机制设计

  • 完整快照rag_versions 表包含完整的文件数据快照,不依赖原始数据
  • 数据独立:版本快照创建后,原始数据的任何变更都不会影响快照
  • 文件复制:发布时需要复制所有文件内容、向量数据、文档单元等

1.2 审核机制设计

  • 必须审核:知识库发布到市场必须经过管理员审核
  • 内容审核:需要审核知识库的内容是否合规
  • 审核状态:审核中、已发布、拒绝、已下架

2. 数据库设计

2.1 RAG 版本表 (rag_versions) - 完整快照

CREATE TABLE rag_versions (
    id VARCHAR(36) PRIMARY KEY,
    
    -- 基本信息(快照时的数据)
    name VARCHAR(255) NOT NULL,                 -- 快照时的名称
    icon VARCHAR(255),                          -- 快照时的图标
    description TEXT,                           -- 快照时的描述
    user_id VARCHAR(36) NOT NULL,               -- 创建者
    
    -- 版本信息
    version VARCHAR(50) NOT NULL,               -- 版本号 (如 "1.0.0")
    change_log TEXT,                            -- 更新日志
    labels JSONB,                               -- 标签
    
    -- 原始数据集信息(仅用于标识,不依赖)
    original_rag_id VARCHAR(36) NOT NULL,       -- 原始RAG数据集ID(仅标识用)
    original_rag_name VARCHAR(255),             -- 原始RAG名称(快照时)
    
    -- 快照统计信息
    file_count INTEGER DEFAULT 0,               -- 文件数量
    total_size BIGINT DEFAULT 0,                -- 总大小
    document_count INTEGER DEFAULT 0,           -- 文档单元数量
    
    -- 发布状态(需要审核)
    publish_status INTEGER DEFAULT 1,           -- 1:审核中, 2:已发布, 3:拒绝, 4:已下架
    reject_reason TEXT,                         -- 审核拒绝原因
    review_time TIMESTAMP,                      -- 审核时间
    published_at TIMESTAMP,                     -- 发布时间
    
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    deleted_at TIMESTAMP
);

2.2 RAG 版本文件表 (rag_version_files) - 文件快照

CREATE TABLE rag_version_files (
    id VARCHAR(36) PRIMARY KEY,
    rag_version_id VARCHAR(36) NOT NULL,        -- 关联RAG版本
    
    -- 文件信息快照
    original_file_id VARCHAR(36) NOT NULL,      -- 原始文件ID(仅标识)
    file_name VARCHAR(255) NOT NULL,            -- 文件名
    file_size BIGINT DEFAULT 0,                 -- 文件大小
    file_type VARCHAR(50),                      -- 文件类型
    file_path VARCHAR(500),                     -- 文件存储路径
    
    -- 处理状态快照
    process_status INTEGER,                     -- 处理状态
    embedding_status INTEGER,                   -- 向量化状态
    
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    deleted_at TIMESTAMP
);

Read the full file on GitHub · 637 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 · 637 lines · 0 tokens per session scan A b01d0f5432fc

Subscribe to this mod's changes

rag-publish-requirements is a command published in the GitHub repository lucky-aeon/AgentX (839 stars, last pushed 2mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 5,743 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.