定制 wuhhh/field-agent 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wuhhh/field-agent

Composer 安装命令:

composer require wuhhh/field-agent

包简介

An intelligent Craft CMS plugin for AI-powered field generation, modification, and context-aware operations

README 文档

README

⚠️ ALPHA SOFTWARE - USE WITH CAUTION ⚠️

This plugin uses AI to generate Craft CMS fields, entry types, and sections from natural language prompts. The plugin supports all native Craft CMS field types (as of Craft 5.8 and including the new Content Block) as well as CKEditor fields.

WARNING: This is an experimental plugin and you should not use it on production sites. Always backup your database before testing it.

Note: Rollback functionality currently only supports CREATE operations - field/entry type/section modifications and deletions cannot be rolled back.

Alpha Installation

This plugin is not yet available in the Craft Plugin Store. To install for testing:

composer require wuhhh/field-agent:v1.0.5-alpha
./craft plugin/install field-agent && ./craft plugin/enable field-agent

Configuration Setup

  1. Create config file - Copy the plugin's config file to your project:
cp vendor/wuhhh/field-agent/config/field-agent.php config/field-agent.php
  1. Add API key to .env (you only need one):
# For Anthropic Claude (default)
ANTHROPIC_API_KEY=sk-ant-your-key-here

# OR for OpenAI (optional)
OPENAI_API_KEY=sk-your-key-here
  1. Set default provider in config/field-agent.php if desired:
'defaultProvider' => 'anthropic', // or 'openai'

Test your setup:

./craft field-agent/generator/test-llm

Basic Usage

The plugin analyzes your existing Craft setup and creates or modifies fields/entry types/sections based on natural language prompts.

Main command:

./craft field-agent/generator/prompt "your description here"

Examples:

# Create new structures
./craft field-agent/generator/prompt "Create a portfolio section with project fields"

# Modify existing structures  
./craft field-agent/generator/prompt "Add author and featured image to blog posts"

The system will automatically:

  • Analyse existing project structure
  • Avoid naming conflicts with reserved Craft handles
  • Reuse existing fields when appropriate
  • Create fields, then entry types, then sections in proper order

Commands

Generation

# Main prompt command (uses your configured default provider)
./craft field-agent/generator/prompt "description" [--debug]

# Override provider for single command
./craft field-agent/generator/prompt "description" openai

# Debug mode (shows full AI request/response)  
./craft field-agent/generator/prompt "description" --debug

Operation Management

# List all generation operations
./craft field-agent/generator/operations

# Rollback specific operation by ID
./craft field-agent/generator/rollback <operation-id>

# ⚠️ DESTRUCTIVE: Rollback ALL operations
./craft field-agent/generator/rollback-all

# Clean up old data
./craft field-agent/generator/prune-all --confirm=1

Troubleshooting

API Issues

# Test your API connection
./craft field-agent/generator/test-llm --debug

# Check environment variables are loaded
./craft field-agent/generator/test-llm

Common Problems

  • 401 errors: Verify your API key is correct and has credits
  • Field conflicts: System handles automatically, check operation history
  • Operation failures: Use --debug mode to see detailed error information

Debug Mode

Add --debug to see full AI request/response and operation details:

./craft field-agent/generator/prompt "create blog fields" --debug

What It Does

This plugin generates Craft CMS fields, entry types, and sections using AI from natural language descriptions. It analyzes your existing Craft setup to avoid conflicts and reuse appropriate fields.

Key capabilities:

  • Understands all native Craft fields plus CKEditor
  • Modifies existing entry types without breaking content
  • Avoids reserved Craft handles and suggests alternatives
  • Creates related structures (category groups, tag groups) automatically
  • Provides complete rollback of all operations

Alpha Testing Notes

This is experimental software. It works well but may have edge cases. Please:

License

Proprietary - Commercial plugin for Craft CMS

wuhhh/field-agent 适用场景与选型建议

wuhhh/field-agent 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「cms」 「Craft」 「ai」 「craftcms」 「craft-plugin」 「llm」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 wuhhh/field-agent 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 wuhhh/field-agent 我们能提供哪些服务?
定制开发 / 二次开发

基于 wuhhh/field-agent 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2025-08-08