Token导航 LogoToken导航TokenDH.com
开发规范敏感数据github未标认证来源可访问许可证需确认审计提醒

pillar-best-practices支柱最佳实践

Agent Skill

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

总安装

312

周安装

13

GitHub Stars

公开资料未说明

下载量

104
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/pillarhq/pillar-skills --skill pillar-best-practices

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适用于围绕仓库状态、代码变更或协作事项进行整理。
  • 可结合来源仓库和原始 README 继续核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • pillar-best-practices 属于开发规范类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Pillar SDK & CLI Best Practices

Best practices for integrating the Pillar SDK and CLI into web applications. Covers project setup with the CLI, tool syncing, knowledge source management, and SDK integration patterns.

When to Apply

Reference these guidelines when:

  • Setting up Pillar in a new project (pillar init)
  • Syncing tools to the Pillar backend (pillar sync)
  • Managing knowledge sources (pillar knowledge)
  • Diagnosing integration issues (pillar doctor)
  • Adding Pillar SDK to a React or Next.js project
  • Setting up PillarProvider in your app
  • Defining tools for the AI assistant to discover and call
  • Creating tool handlers to execute user requests
  • Designing multi-tool workflows for agentic operations

Essential Rules

CLI

PriorityRuleDescription
CRITICALcli-setupUse pillar init to scaffold a project — handles framework detection, SDK install, credentials, and first sync
HIGHcli-syncUse pillar sync --scan to push tool definitions; use --watch in development and CI for deploys
HIGHcli-knowledgeUse pillar knowledge to manage docs and help content the copilot uses to answer questions

SDK

PriorityRuleDescription
CRITICALsetup-providerAlways wrap your app with PillarProvider
CRITICALsetup-nextjsNext.js App Router requires a 'use client' wrapper
CRITICALschema-compatibilityinputSchema must follow cross-model formatting rules (arrays need items, no type unions)
HIGHtool-descriptionsWrite specific, AI-matchable descriptions and keep tools focused
HIGHtool-return-valuesReturn flat data from execute -- never {success: true} without the actual data
HIGHtool-handlersUse centralized handlers with proper cleanup
HIGHguidance-fieldUse the guidance field for agent-facing disambiguation and prerequisites
HIGHconfirmation-uiUse needsConfirmation or renderConfirmation for destructive actions (delete, purchase)
HIGHinline-ui-toolsUse type: 'inline_ui' with render for interactive UI in chat; use sendResult to return data to the agent
HIGHworkflow-patternsDesign multi-tool workflows using the distributed guidance pattern
HIGHtool-overlap-auditAudit existing tools for overlap before creating new ones
HIGHcodebase-verificationVerify API shapes against the actual codebase -- never guess
HIGHform-queue-patternFor form-opening tools, defer completion until user submits; queue multiple forms for sequential execution

Quick Reference — CLI

1. Project Setup (CRITICAL)

Install and initialize Pillar in one command:

npx pillar-cli init

This detects your framework, installs the SDK, generates a provider wrapper and starter tools, creates credentials, syncs tools, and sets up knowledge sources. See rules/cli-setup.md.

If you already have an agent slug:

npx pillar-cli init --agent-slug your-slug

2. Tool Syncing (HIGH)

Push tool definitions to the backend:

pillar sync --scan ./src          # one-time sync
pillar sync --scan ./src --watch  # re-sync on file changes
pillar sync status --scan ./src   # compare local vs remote

In CI/CD:

npx pillar-cli sync --scan ./src

Set PILLAR_SLUG and PILLAR_SECRET as environment variables. See rules/cli-sync.md.

3. Knowledge Sources (HIGH)

Add docs and help content the copilot uses to answer questions:

pillar knowledge add https://docs.myapp.com
pillar knowledge list
pillar knowledge status
pillar knowledge sync <source-id>
pillar knowledge remove <source-id>

See rules/cli-knowledge.md.

4. Diagnostics

Verify the integration is healthy:

pillar doctor

Checks agent slug, sync secret, SDK version, tool sync status, knowledge sources, and embed config reachability.

5. Testing

Test the copilot without starting your app:

pillar chat "how do I export data?"   # single question
pillar chat                            # interactive session

6. Authentication

pillar auth login     # opens browser to authenticate
pillar auth status    # check current session
pillar auth logout    # clear credentials

Credentials are stored in ~/.pillar/config.json.

Quick Reference — SDK

7. Provider Setup (CRITICAL)

Always wrap your app with PillarProvider:

import { PillarProvider } from '@pillar-ai/react';

<PillarProvider agentSlug="your-agent-slug">
  {children}
</PillarProvider>

8. Next.js App Router (CRITICAL)

Create a client wrapper component:

// providers/PillarSDKProvider.tsx
'use client';

import { PillarProvider } from '@pillar-ai/react';

export function PillarSDKProvider({ children }: { children: React.ReactNode }) {
  return (
    <PillarProvider agentSlug={process.env.NEXT_PUBLIC_PILLAR_AGENT_SLUG!}>
      {children}
    </PillarProvider>
  );
}

9. Tool Descriptions (HIGH)

Write specific descriptions the AI can match:

// Good - specific and includes context
description: 'Navigate to billing settings. Suggest when user asks about payments, invoices, or subscription.'

// Bad - too generic
description: 'Go to billing'

10. Tool Registration (HIGH)

In React components, use the usePillarTool hook — it auto-registers on mount and cleans up on unmount:

import { usePillarTool } from '@pillar-ai/react';

usePillarTool({
  name: 'create_dashboard',
  description: 'Create a new empty dashboard.',
  guidance: 'First step in dashboard workflow. Returns dashboard_uid needed by create_*_panel tools.',
  type: 'trigger_tool',
  autoRun: true,
  inputSchema: { type: 'object', properties: { title: { type: 'string' } }, required: ['title'] },
  execute: async (data) => {
    const result = await api.createDashboard(data.title);
    return { uid: result.uid };
  },
});

Outside React (or for imperative registration), use pillar.defineTool() with the same schema shape. It returns an unsubscribe function for cleanup.

Sync tools after defining them: pillar sync --scan./src

11. Guidance Field (HIGH)

Use guidance for agent-facing instructions that help the LLM choose and chain tools:

get_available_datasources: {
  description: 'Get datasources available for creating visualizations.',
  guidance: 'Call BEFORE creating dashboards or panels. If zero results, ask user to create one.',
}

12. Audit for Overlap (HIGH)

Before creating a new tool, search existing tools for semantic overlap:

// Found existing: save_dashboard handles "create a dashboard"
// Don't create a second create_dashboard -- extend or disambiguate instead

13. Decompose Large Tools (HIGH)

Prefer smaller tools with tight schemas over one large tool with many modes:

// Instead of one "manage_user" with an operation enum,
// split into focused tools:
invite_user: { description: 'Invite a new user by email', type: 'trigger_tool' }
remove_user: { description: 'Remove a user from the org', type: 'trigger_tool' }
change_user_role: { description: 'Change a user role', type: 'trigger_tool' }

14. Inline UI Tools (HIGH)

Use type: 'inline_ui' with a render component for interactive UI in the chat. The AI provides data directly to the component — no execute needed. Use sendResult to return data to the agent:

usePillarTool({
  name: 'show_results',
  description: 'Display search results',
  type: 'inline_ui',
  inputSchema: { type: 'object', properties: { query: { type: 'string' } } },
  render: ({ data, sendResult }) => (
    <ResultsCard data={data} onSelect={(item) => sendResult({ selected: item.id })} />
  ),
});

15. Confirmation UI (HIGH)

Use needsConfirmation: true for destructive actions. The agent calls the tool, but a Confirm/Cancel card is shown before execute runs. For custom UI, use renderConfirmation:

usePillarTool({
  name: 'delete_project',
  description: 'Delete a project permanently',
  needsConfirmation: true,
  execute: async ({ projectId }) => {
    await api.deleteProject(projectId);
    return { deleted: true };
  },
});

How to Use

Read individual rule files for detailed explanations and code examples:

rules/cli-setup.md
rules/cli-sync.md
rules/cli-knowledge.md
rules/setup-provider.md
rules/setup-nextjs.md
rules/tool-descriptions.md
rules/tool-handlers.md
rules/schema-compatibility.md
rules/guidance-field.md
rules/workflow-patterns.md
rules/tool-overlap-audit.md
rules/codebase-verification.md
rules/form-queue-pattern.md

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

31.99%
按下载量换算33

Claude

31.98%
按下载量换算33

Cursor

18.83%
按下载量换算20

Gemini CLI

8.87%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

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

安装前确认

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

来源信息

继续浏览同类 Skills