Skip to content

feat(grokbuild): TSP Grok Integration (Phase 0-5) - #10

Merged
Colin4k1024 merged 12 commits into
mainfrom
feature/grokbuild
Jul 30, 2026
Merged

Colin4k1024 merged 12 commits into
mainfrom
feature/grokbuild

Conversation

@Colin4k1024

Copy link
Copy Markdown
Owner

概述

实现 TSP 与 Grok Build 的完整集成,支持通过 Grok 原生插件机制安装和使用 TSP 的所有 skills、commands 和 agents。

变更内容

Phase 0: 基线与兼容契约

  • 修复 6 份文档 freshness 门禁
  • 创建能力矩阵 (.grok/matrix/capability-matrix.md)
  • 定义 provenance 契约 (.grok/contracts/provenance.md)
  • 创建 Grok 插件 manifest (.grok-plugin/plugin.json)

Phase 1: Grok 插件验证

  • 验证 Grok 插件机制 (install/uninstall/update)
  • 创建最小 PoC 插件 (10 skills + 2 agents)

Phase 2: 生成式适配层

  • 实现 scripts/grok/grok-packager.js
  • 生成 Grok 兼容的插件包 (203 skills + 87 commands + 35 agents)
  • 添加 provenance 元数据

Phase 3: Hook 迁移脚本

  • 实现 scripts/grok/grok-event-bridge.js (事件格式转换)
  • 实现 scripts/grok/grok-hook-wrapper.js (hook 执行包装)
  • 处理环境变量映射 (CLAUDE_HOME → GROK_HOME)

Phase 4: 运行时清理

  • 实现 scripts/grok/path-resolver.js (统一路径处理)
  • 实现 scripts/grok/node-preflight.js (Node.js 版本检查)
  • 实现 scripts/grok/validate-plugin.js (插件完整性验证)
  • 清除所有 Claude 目录引用

Phase 5: 发布与硬化

  • 实现 scripts/grok/release.js (发布脚本)
  • 创建兼容性表 (.grok/compatibility-table.md)
  • 支持 Git tag 创建和发布打包

组件统计

类型 数量 状态
Skills 203 ✅ 已适配
Commands (as skills) 87 ✅ 已适配
Agents 35 ✅ 已适配
总计 325 -

集成测试结果

  • ✅ 插件安装成功
  • ✅ Skills 发现和调用正常
  • ✅ Agents 发现和调用正常
  • ✅ Command skills 转换正常
  • ✅ 无 Claude 目录依赖

使用方式

# 生成 Grok 插件
node scripts/grok/grok-packager.js

# 安装到 Grok
grok plugin install .grok-build --trust

# 使用 skill
grok -p "Using the api-design skill, explain RESTful principles"

# 使用 agent
grok --agent ~/.grok/installed-plugins/grok-build-785ba9c7/agents/role-tech-lead.md -p "As tech-lead, plan this feature"

关联 Issue

Closes #9

测试

  • 插件安装/卸载测试
  • Skills 发现测试
  • Agents 发现测试
  • Skill 调用测试
  • Agent 调用测试
  • YAML 格式验证
  • Claude 目录引用检查

🤖 Generated with Claude Code

- Fix doc freshness gate (6 docs updated to 2026-07-29)
- Create capability matrix (.grok/matrix/capability-matrix.md)
- Define provenance contract (.grok/contracts/provenance.md)
- Create Grok plugin manifest (.grok-plugin/plugin.json)
- Add integration README (.grok/README.md)

Refs: #9
- Add scripts/grok/grok-packager.js
- Generates Grok-compatible plugin from TSP sources
- Supports skills (203), commands (87), agents (35)
- Adds provenance metadata to all generated files
- Generates .grok-plugin/plugin.json manifest
- Verified: plugin installs successfully in Grok

Refs: #9
- Add grok-event-bridge.js for event format conversion
- Add grok-hook-wrapper.js for hook execution in Grok
- Handle environment variable mapping (CLAUDE_HOME → GROK_HOME)
- Handle tool name conversion (Bash → bash)
- Support nested hooks structure
- Add README documentation

Refs: #9
- Add path-resolver.js for unified path handling (Claude/Grok)
- Add node-preflight.js for Node.js version check (>=18)
- Add validate-plugin.js for plugin integrity verification
- Update grok-packager.js to replace Claude references with Grok
- Verified: no Claude directory references in generated plugin

Refs: #9
- Add release.js for Grok Compatibility Pack generation
- Add compatibility-table.md with version matrix
- Support Git tag creation and release packaging
- Generate release notes automatically
- Validate build integrity before release

Refs: #9
- Document all scripts (grok-packager, event-bridge, hook-wrapper, etc.)
- Add workflow instructions
- Add component statistics
- Add documentation links

Refs: #9
- Properly quote YAML values containing colons, hashes, or quotes
- Fixes agent loading in Grok (was failing with YAML parse error)
- Verified: tech-lead and code-reviewer agents now load correctly

Refs: #9
- Add hook-compatibility-analysis.md with detailed mapping
- Update grok-packager.js to include hooks support
- Map TSP hooks to Grok events (context, observation, summarize, file-context)

Refs: #9
- Add grok-session-start.js (context event)
- Add grok-session-end.js (summarize event)
- Add grok-post-bash-command-log.js (observation event)
- Add grok-cost-tracker.js (observation event)
- Add grok-pre-bash-block-no-verify.js (file-context event)
- Update grok-packager.js to include hooks scripts
- Create hooks.json with Grok event mapping

Refs: #9
- Change author from string to struct format
- Plugin now validates successfully in Grok
- Hooks are included in plugin components

Refs: #9
Slimdown (204→167 skills, 9.5MB→2.6MB, 27→14 specialist agents):
- P0: Remove goframe-v2 examples/references (6.4MB), delete duplicate
  continuous-learning and deprecated autonomous-loops
- P1: Remove 28 orphaned skills not in any manifest module, assign 6
  keepers (benchmark, browser-qa, git-workflow, hexagonal-architecture,
  pytorch-patterns, architecture-decision-records)
- P2: Merge 8 PUA variants into single parameterized skill
- P3: Parameterize 13 language-specific agents into enhanced generic
  code-reviewer and build-error-resolver with language config tables
- P6: Split monolithic framework-language module into framework-core +
  8 lang-* sub-modules (python, golang, java, kotlin, rust, cpp, perl, laravel)
- P7: Reorganize 178 runbooks → 107 (move demos, conversations, team
  examples, role operations, security gates to subdirectories)
- Clean up legacy hook directories (memory-persistence, strategic-compact)

New capabilities:
- Add loop-engineer role (loop task design, monitoring, convergence)
- Add graph-engineer role (code graph, impact analysis, arch visualization)
- Add commands: /graph-impact, /graph-visualize, /loop-start, /loop-status,
  /goal, /heartbeat
- Add graph-engineering manifest module
@Colin4k1024
Colin4k1024 merged commit e8804f9 into main Jul 30, 2026
1 check failed

This branch was previously deployed

1 inactive deployment
github-pages — e8804f99 Deployed Jul 30, 2026 by Colin4k1024 via deploy #25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] grokbuild

1 participant