Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计提醒

webapp-loader-actionWeb 应用 加载器操作

Agent Skill

webapp-loader-action 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

238

周安装

10

GitHub Stars

公开资料未说明

下载量

83
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:webapp-loader-action(Web 应用 加载器操作)
来源仓库:https://github.com/efesto-cloud/skills
仓库路径:skills/webapp-loader-action
安装命令:
npx skills add https://github.com/efesto-cloud/skills --skill webapp-loader-action
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/efesto-cloud/skills --skill webapp-loader-action

简介

用于查找、检索和筛选相关信息,支持按任务场景或关键词定位目标内容。

  • 适合在多种宿主环境中快速提取候选结果并进行分类。
  • 通过 npx skills add 从 GitHub 仓库安装,部署流程标准化。
  • 建议核实仓库维护状态,避免触发意外的联网或文件操作。
  • webapp-loader-action 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Webapp Loader / Action Skill

Loaders fetch data for a route (called on GET). Actions handle mutations (called on POST/PUT/DELETE, usually from a <Form> submission). Both live in the same route file and call use cases from the core package through a DI container.

Read references/templates.md for copy-paste starting points.

Before You Start

If the user hasn't told you which use case to call, ask. Then find the interface file:

{core-package}/src/useCase/{domain}/I{Name}.ts

Read it carefully — the input type tells you exactly what the use case expects, and the return type tells you what you get back.

Key questions to clarify before writing code:

  • Loader or action (or both)? Loaders = read data; actions = mutate.
  • Is the route behind auth? If yes, extract a session token from the request.
  • Where does input come from?

- Loader: URL params (args.params) and/or query string (new URL(args.request.url).searchParams) - Action: URL params and/or request body — usually FormData (await args.request.formData())

  • Does the action handle multiple intents? A single action can dispatch on an intent field using a Zod discriminated union.
  • What does the caller (component) need back? Shape the return value to be convenient for the component.

Step 1 — Find the Use Case Interface

Grep or browse for I{Name}.ts in the core's useCase/ directory. Read:

  • The input type (and any auth wrapper like WithOperatorAuth<…>)
  • The return type (usually Result<DTO, Error>)
  • Any optional fields (like populate)

This tells you exactly which fields to validate and pass.

Step 2 — Validate Inputs with Zod

Always validate before touching the use case. Use the simplest validator that captures the shape:

Loader — query string:

const query_validator = z.object({
  search: z.string().optional(),
  page_n: z.coerce.number().int().min(1).optional().default(1),
  page_size: z.coerce.number().int().min(10).max(100).optional().default(25),
  id: z.string().optional(),
});

Loader — URL params:

const params_validator = z.object({
  _id: z.string().min(1),
});

Action — single intent:

const body_validator = z.object({
  name: z.string().min(1),
  description: z.string().optional(),
});

Action — multiple intents (discriminated union):

const body_validator = z.discriminatedUnion('intent', [
  z.object({ intent: z.literal('CREATE'), name: z.string().min(1) }),
  z.object({ intent: z.literal('DELETE'), id: z.string() }),
]);

Parse from Object.fromEntries(…) for both query strings and FormData. Use .parse() in loaders (throw on error) or .safeParse() in actions (return an error response on failure).

Step 3 — Authenticate

If the route is behind auth, call the appropriate helper at the top of the loader/action before doing anything else. This will redirect or throw if the user isn't logged in.

// Example: operator session cookie
const session_id = await requireOperatorSessId(args.request);

The session token becomes part of the use case input (the auth wrapper field).

If the route is public, skip this step entirely.

Step 4 — Get the Use Case and Execute

const result = await container
  .get<IMyUseCase>(Symbols.UseCase.myDomain.MyUseCaseName)
  .execute({
    session_id,        // from auth step
    ...validated,      // spread validated inputs
  });

Imports needed:

import { container, IMyUseCase, Symbols } from '@workspace/core';

Replace @workspace with the actual workspace name for the project (e.g. @dav, @acme).

Step 5 — Handle the Result

In a loader — unwrap and throw on failure (React Router will catch it):

const data = result.unwrapOrThrow();
return { items: data };

Or handle specific errors gracefully:

if (result.isFailure()) throw new Response('Not found', { status: 404 });
return { item: result.data };

In an action — return a toast/response the component can consume:

// Using a Toast helper (if available in the project)
return Toast.fromResult(result, 'Created successfully');

// Or manually:
if (result.isFailure()) return { ok: false, error: result.error.message };
return { ok: true, data: result.data };

If validation fails in an action, return early:

const body = body_validator.safeParse(Object.fromEntries(await args.request.formData()));
if (!body.success) return { ok: false, error: 'Invalid input', details: body.error.flatten() };

Step 6 — Transform the Return Value (if needed)

Shape the returned data to make life easy for the component. Common transforms:

  • Build pagination links from page number and total
  • Resolve a path/breadcrumb from a tree structure
  • Merge multiple use case results into a flat object
  • Compute derived boolean flags (hasNext, isEmpty, etc.)

Only add what the component actually needs. Keep it minimal.

Checklist

  • Use case interface read — input and return type understood
  • Zod validator covers all inputs (params, query, or body)
  • Auth called before any use case (if route is protected)
  • Use case fetched from container.get<I…>(Symbols.…) — not instantiated directly
  • Result handled: unwrapped in loaders, gracefully returned in actions
  • Return value is flat and convenient for the component — no raw domain objects

Special Cases

Multiple use cases in one loader — run them in parallel when they're independent:

const [aRes, bRes] = await Promise.all([
  container.get<IA>(Symbols.UseCase.foo.A).execute({ session_id }),
  container.get<IB>(Symbols.UseCase.bar.B).execute({ session_id }),
]);
const a = aRes.unwrapOrThrow();
const b = bRes.unwrapOrThrow();

Optional data — a use case may return Maybe<T> instead of Result. Use .isSome() / .isNone():

const maybe = await container.get<IGetFoo>(Symbols.UseCase.foo.GetFoo).execute({ session_id, id });
const foo = maybe.isSome() ? maybe.data : null;
return { foo };

Action with redirect — after a mutation, redirect to the detail page:

const result = await container.get<ICreateFoo>(…).execute(…);
if (result.isFailure()) return { ok: false, error: result.error.message };
throw redirect(`/admin/foo/${result.data._id}`);

Public loader (no auth) — simply skip the auth step and pass only the validated input:

export async function loader(args: LoaderFunctionArgs) {
  const query = query_validator.parse(Object.fromEntries(new URL(args.request.url).searchParams));
  const result = await container.get<ISearchFoo>(Symbols.UseCase.foo.SearchFoo).execute(query);
  return { items: result.unwrapOrThrow() };
}

Related Skills

  • /usecase — Create or update the use case being called
  • /entity — Create or update domain entities

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.18%
按下载量换算29

Claude

33%
按下载量换算27

Cursor

18.7%
按下载量换算16

Gemini CLI

9.53%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills