feat(cli): eip4 init 一键接入 Claude Code/Codex/OpenCode (G1)

- 新增 eip4 init:把 agent skills 装到目标项目
  - Claude Code → .claude/skills/<name>/SKILL.md(代码生成 frontmatter)
  - Codex/OpenCode → 根 AGENTS.md(EIP4-SKILLS 标记块,内嵌 skill 全文,块外保留,幂等)
  - base URL 按 --base-url/--env/current env 渲染
- docs/skills/*.md 的 base URL 改为 {{EIP4_BASE_URL}} 占位符
- 新增 eip4-skills/manifest.json + pom 用 maven-resources-plugin 把 docs/skills 打进 jar(init 默认从 classpath 读,无需仓库在场)
- 文档:AI_AGENT_Nocobase_INTEGRATION_GAP_AND_PLAN(NocoBase 对照 + G1-G3 计划)、skills/README、平台 README
- TDD 5 个新测试,platform-cli 共 20 单测全绿;真实 jar 端到端验证通过

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-22 14:14:26 +08:00
parent 2fc093f25e
commit 5b06aeceff
10 changed files with 478 additions and 14 deletions

View File

@@ -37,7 +37,7 @@ ENABLED:启用:boolean::false
```bash
java -jar platform-cli/target/platform-cli-0.1.0-SNAPSHOT.jar ai auto-develop \
--base-url http://localhost:8084 \
--base-url {{EIP4_BASE_URL}} \
--objective "新增客户等级维护功能" \
--feature-name "客户等级维护" \
--table-name EIP4AI_CUSTOMER_LEVEL \
@@ -56,7 +56,7 @@ java -jar platform-cli/target/platform-cli-0.1.0-SNAPSHOT.jar ai auto-develop \
```bash
java -jar platform-cli/target/platform-cli-0.1.0-SNAPSHOT.jar ai auto-develop \
--base-url http://localhost:8084 \
--base-url {{EIP4_BASE_URL}} \
--objective "新增组织分类树形维护功能" \
--feature-name "组织分类维护" \
--table-name EIP4AI_ORG_CATEGORY \
@@ -83,9 +83,9 @@ java -jar platform-cli/target/platform-cli-0.1.0-SNAPSHOT.jar ai auto-develop \
## 页面 schema 校验
```bash
curl http://localhost:8084/api/page/schema/components
curl {{EIP4_BASE_URL}}/api/page/schema/components
curl -X POST http://localhost:8084/api/page/schema/validate \
curl -X POST {{EIP4_BASE_URL}}/api/page/schema/validate \
-H "Content-Type: application/json" \
--data-binary @target/ai-runs/page-schema.json
```
@@ -95,10 +95,10 @@ curl -X POST http://localhost:8084/api/page/schema/validate \
## AI 工具权限检查
```bash
curl http://localhost:8084/api/ai/tools
curl http://localhost:8084/api/ai/employees
curl {{EIP4_BASE_URL}}/api/ai/tools
curl {{EIP4_BASE_URL}}/api/ai/employees
curl -X POST http://localhost:8084/api/ai/tools/access-check \
curl -X POST {{EIP4_BASE_URL}}/api/ai/tools/access-check \
-H "Content-Type: application/json" \
-d '{"employeeId":"agent-developer","toolName":"local.apply","grantedScopes":["ai:local:apply"],"targetEnv":"local","productionWrite":false}'
```