Token导航 LogoToken导航

Agent Skill · 开发

container-presentational(容器展示)

container-presentational 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

container-presentational 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 11,147。

总安装 1,909周安装 78GitHub Stars 174下载 612核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/patternsdev/skills --skill container-presentational

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

Container/Presentational Pattern 源自 Dan Abramov 的 React 组件分离思想。将组件分为关注 UI 渲染的 Presentational 与处理逻辑的 Container 两类。提升代码可维护性与复用性,是现代前端架构重要设计模式之一。

适用于 React/Vue 等项目重构与新人培训参考材料。container-presentational 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/container-presentational

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/patternsdev/skills --skill container-presentat…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

container-presentational 怎么安装?

在终端执行 npx skills add https://github.com/patternsdev/skills --skill container-presentational。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

container-presentational 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

container-presentational 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

container-presentational 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

container-presentational 用的人多吗?

公开数据是累计安装 1,909 次,近一周安装 78 次,下载 612 次,GitHub 174 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

container-presentational 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
container-presentational

容器展示 · 本页

1,909174需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Container/Presentational Pattern

Table of Contents

In 2015, Dan Abramov wrote an article titled "Presentational and Container Components" that changed the way many developers thought about component architecture in React. He introduced a pattern that separated components into two categories:

  1. Presentational Components (or Dumb Components): These are concerned with how things look. They don't specify how the data is loaded or mutated but rather receive data and callbacks exclusively via props.
  2. Container Components (or Smart Components): These are concerned with how things work. They provide the data and behavior to presentational or other container components.

When to Use

  • Use this when you want a clear separation between data-fetching logic and UI rendering
  • This is helpful for making presentational components reusable and easy to test

Instructions

  • Container components handle data fetching and state; presentational components handle rendering via props
  • Prefer composables over container components in Vue 3 for the same separation of concerns
  • Keep presentational components stateless — they receive data only through props
  • Use the useDogImages() composable pattern as a modern alternative to container wrappers

Details

While this pattern was mainly associated with React, its fundamental principle was adopted and adapted in various forms across other libraries and frameworks.

Dan's distinction offered a clearer and more scalable way to structure JavaScript applications. By clearly defining the responsibilities of different types of components, developers could ensure better reusability of the UI components (presentational) and logic (containers).

However, with the emergence of hooks in React and the Composition API in Vue 3, the clear boundary between presentational and container components began to blur. Hooks and the Composition API began allowing developers to encapsulate and reuse state and logic without necessarily being confined to a class-based container component or the Options API. With that being said, the pattern can still be helpful at certain times.

Let's say we want to create an application that fetches 6 dog images, and renders these images on the screen.

To follow the container/presentational pattern, we want to enforce the separation of concerns by separating this process into two parts:

  1. Presentational Components: Components that care about *how* data is shown to the user. In this example, that's the rendering of the list of dog images.
  2. Container Components: Components that care about *what* data is shown to the user. In this example, that's fetching the dog images.

Fetching the dog images deals with application logic, whereas displaying the images only deals with the view.

Presentational Component

A presentational component receives its data through props. Its primary function is to simply display the data it receives the way we want them to, including styles, *without modifying* that data.

When rendering the dog images, we simply want to map over each dog image that was fetched from the API, and render those images. We can create a DogImages component that receives the data through props, and renders the data it received.

<template>
  <div>
    <div v-for="(dog, index) in dogs" :key="index">
      <img :src="dog" alt="Dog" />
    </div>
  </div>
</template>

<script setup>
  defineProps(["dogs"]);
</script>

The DogImages component is a presentational component. Presentational components are *usually* stateless: they do not contain their own Vue state, unless they need a state for UI purposes. Presentational components receive their data from container components.

Container Component

The primary function of container components is to pass data to presentational components, which they *contain*. Container components themselves usually don't render any other components besides the presentational components that care about their data. Since they don't render anything themselves, they usually do not contain any styling either.

We need to create a container component that fetches this data, and passes this data to the presentational component DogImages in order to display it on the screen.

<template>
  <DogImages :dogs="dogs" />
</template>

<script setup>
  import { ref, onMounted } from "vue";
  import DogImages from "./DogImages.vue";

  const dogs = ref([]);

  onMounted(async () => {
    const response = await fetch(
      "https://dog.ceo/api/breed/labrador/images/random/6"
    );
    const { message } = await response.json();
    dogs.value = message;
  });
</script>

Combining these two components together makes it possible to separate handling application logic with the view.

Composables

In many cases, the Container/Presentational pattern can be replaced with composables. The introduction of the Composition API made it easy for developers to add statefulness without needing a container component to provide that state.

Instead of having the data fetching logic in a container component, we can create a custom composable that fetches the images, and returns the array of dogs.

import { ref, onMounted } from "vue";

export function useDogImages() {
  const dogs = ref([]);

  onMounted(async () => {
    const response = await fetch(
      "https://dog.ceo/api/breed/labrador/images/random/6"
    );
    const { message } = await response.json();
    dogs.value = message;
  });

  return { dogs };
}

By using this composable, we no longer need the wrapping container component to fetch the data. Instead, we can use this composable directly in our presentational DogImages component!

<template>
  <div>
    <div v-for="(dog, index) in dogs" :key="index">
      <img :src="dog" alt="Dog" />
    </div>
  </div>
</template>

<script setup>
  import { useDogImages } from "../composables/useDogImages";

  const { dogs } = useDogImages();
</script>

By using the useDogImages composable, we still separated the application logic from the view. We're simply using the returned data from the composable, without modifying that data within the component.

Composables make it easy to separate logic and view in a component, just like the Container/Presentational pattern. It saves us the extra layer that was necessary in order to wrap the presentational component within the container component.

Source

References

平台分布

Codex

36.61%
按下载量换算224

Claude

28.82%
按下载量换算176

Cursor

17.76%
按下载量换算109

Gemini CLI

9.58%
按下载量换算59

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills