Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计提醒

acf-local-jsonACF 本地 JSON

Agent Skill

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

总安装

1,270

周安装

54

GitHub Stars

1

下载量

445
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/josecortezz25/local-json-acf-skill --skill acf-local-json

简介

用于将图像、设计稿或 HTML 结构转换为 WordPress ACF 本地 JSON 配置。

  • 适合前端开发者快速生成字段组、重复器和灵活内容区块的定义文件。
  • 支持自动识别文本、图片、开关等字段类型,并生成标准 JSON 结构。
  • 需在 WordPress 项目中配合 ACF 插件使用,不支持直接部署到线上站点。
  • acf-local-json 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

ACF Local JSON Builder

Generate complete ACF (Advanced Custom Fields) Local JSON configurations from images, designs, or HTML structures for WordPress development.

Core Workflow

  1. Analyze Input: Examine the provided image, design, or HTML structure
  2. Identify Components: Detect repeating patterns, content sections, and field relationships
  3. Map Field Types: Determine appropriate ACF field types for each component
  4. Generate JSON: Create the complete Local JSON configuration
  5. Validate Structure: Ensure proper nesting, keys, and field relationships

Field Type Detection Guidelines

From Visual Analysis

  • Text inputs/headingstext, textarea, or wysiwyg
  • Imagesimage (consider gallery for multiple)
  • Repeating cards/sectionsrepeater or flexible_content
  • Toggle statestrue_false or button_group
  • Dropdowns/select boxesselect or radio
  • Date displaysdate_picker or date_time_picker
  • Links/buttonslink or url
  • Color variationscolor_picker
  • File downloadsfile
  • Numbered listsnumber or range
  • Tab interfacestab field type
  • Accordionsflexible_content with layouts

From HTML Structure

<!-- Text Field -->
<h1>, <h2>, <p> → text/textarea/wysiwyg

<!-- Image Field -->
<img> → image field
<picture>, <source> → image with return format 'array'

<!-- Repeater Pattern -->
<div class="card"> (múltiples) → repeater
<ul><li> (dinámicos) → repeater

<!-- Flexible Content Pattern -->
Secciones variadas (hero, features, cta) → flexible_content

<!-- Link Field -->
<a href=""> → link field

<!-- True/False -->
<input type="checkbox"> → true_false

JSON Structure Template

Every ACF Local JSON file follows this structure:

{
  "key": "group_unique_identifier",
  "title": "Field Group Name",
  "fields": [...],
  "location": [...],
  "menu_order": 0,
  "position": "normal",
  "style": "default",
  "label_placement": "top",
  "instruction_placement": "label",
  "hide_on_screen": "",
  "active": true,
  "description": ""
}

Field Structure Patterns

Basic Field

{
  "key": "field_unique_key",
  "label": "Field Label",
  "name": "field_name",
  "type": "text",
  "instructions": "",
  "required": 0,
  "conditional_logic": 0,
  "wrapper": {
    "width": "",
    "class": "",
    "id": ""
  },
  "default_value": "",
  "placeholder": "",
  "prepend": "",
  "append": "",
  "maxlength": ""
}

Repeater Field

{
  "key": "field_repeater_key",
  "label": "Items",
  "name": "items",
  "type": "repeater",
  "instructions": "",
  "required": 0,
  "layout": "block",
  "button_label": "Add Item",
  "min": 0,
  "max": 0,
  "sub_fields": [
    {
      "key": "field_subfield_key",
      "label": "Title",
      "name": "title",
      "type": "text",
      "parent": "field_repeater_key"
    }
  ]
}

Flexible Content

{
  "key": "field_flexible_key",
  "label": "Page Builder",
  "name": "page_builder",
  "type": "flexible_content",
  "instructions": "",
  "button_label": "Add Section",
  "min": "",
  "max": "",
  "layouts": {
    "layout_hero": {
      "key": "layout_hero_key",
      "name": "hero",
      "label": "Hero Section",
      "display": "block",
      "sub_fields": [...]
    },
    "layout_features": {
      "key": "layout_features_key",
      "name": "features",
      "label": "Features Section",
      "display": "block",
      "sub_fields": [...]
    }
  }
}

Image Field

{
  "key": "field_image_key",
  "label": "Image",
  "name": "image",
  "type": "image",
  "return_format": "array",
  "preview_size": "medium",
  "library": "all",
  "min_width": "",
  "min_height": "",
  "min_size": "",
  "max_width": "",
  "max_height": "",
  "max_size": "",
  "mime_types": ""
}

Key Generation Rules

  1. Group Keys: group_ + descriptive_snake_case + random_hash

- Example: group_homepage_hero_5f8a2b

  1. Field Keys: field_ + descriptive_snake_case + random_hash

- Example: field_hero_title_9c3d1e

  1. Layout Keys: layout_ + layout_name + random_hash

- Example: layout_hero_section_4b7e9a

  1. Uniqueness: Every key must be globally unique across all ACF installations

Location Rules

Common location patterns:

"location": [
  [
    {
      "param": "post_type",
      "operator": "==",
      "value": "page"
    }
  ]
]
"location": [
  [
    {
      "param": "page_template",
      "operator": "==",
      "value": "template-homepage.php"
    }
  ]
]
"location": [
  [
    {
      "param": "post_type",
      "operator": "==",
      "value": "post"
    },
    {
      "param": "post_category",
      "operator": "==",
      "value": "category:news"
    }
  ]
]

Best Practices

  1. Semantic Naming: Use clear, descriptive names that reflect content purpose
  2. Proper Nesting: Maintain correct parent-child relationships in repeaters/flex
  3. Return Formats: Choose appropriate return formats (ID, array, url for images)
  4. Instructions: Add helpful instructions for content editors
  5. Defaults: Set sensible default values where appropriate
  6. Validation: Include min/max constraints where relevant
  7. Layout Types: Use block, table, or row layouts appropriately
  8. Clone Fields: Reference the clone fields documentation for reusable field sets

Output Format

Generate the complete JSON file ready to save as:

acf-json/group_[name].json

The file should be valid JSON and immediately usable in WordPress ACF Pro's Local JSON feature.

Advanced Features

For complex patterns like:

  • Clone fields: See references/clone-fields.md
  • Bidirectional relationships: See references/relationships.md
  • Custom field types: See references/custom-types.md
  • Conditional logic: See references/conditional-logic.md

Example Workflow

User provides: Screenshot of a hero section with title, subtitle, CTA button, and background image

Analysis:

  1. Hero section = Field Group
  2. Title = text field
  3. Subtitle = textarea field
  4. CTA = link field (text + URL)
  5. Background = image field

Output: Complete JSON with all fields properly structured and nested

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

38.81%
按下载量换算173

Claude

29.42%
按下载量换算131

Cursor

19.52%
按下载量换算87

Gemini CLI

9.9%
按下载量换算44

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills