Skip to content

chore(cubebot): GitHub automation bot for issue triage#1361

Open
alvarosabu wants to merge 34 commits intomainfrom
chore/tres-212-github-cubebot-automation
Open

chore(cubebot): GitHub automation bot for issue triage#1361
alvarosabu wants to merge 34 commits intomainfrom
chore/tres-212-github-cubebot-automation

Conversation

@alvarosabu
Copy link
Copy Markdown
Member

Summary

Implements CubeBot — a Cloudflare Workers GitHub App that acts as a first responder on TresJS issues.

  • Scaffold Cloudflare Worker app with Hono, D1, Workers AI, and Octokit
  • Add webhook signature verification
  • Add GitHub API client and helpers
  • Add issue type and package detection logic
  • Add RAG retrieval with Workers AI embeddings (bge-base-en-v1.5)
  • Add Claude integration for issue analysis
  • Add comment formatters (maintainer summary, author greeting, feature redirect)
  • Add issue opened handler: triage bugs, redirect feature requests to discussions
  • Add comment handler for @tresjs-cubebot mentions
  • Add docs embedding script and admin seed endpoint
  • Integrate @octokit/auth-app for GitHub App authentication
  • Add org membership check to skip feature redirect and reproduction requests for Tres org members
  • Add GitHub Actions workflow to auto-deploy on changes to apps/cubebot/**

Test plan

  • Webhook receives issues.opened and correctly triages bug reports
  • Feature requests from non-org members are redirected to discussions
  • Feature requests from org members are NOT redirected
  • Org members do not receive reproduction request in comment or label
  • @tresjs-cubebot mentions in comments trigger a RAG-powered reply
  • GitHub Actions deploys to Cloudflare Workers on push to main with cubebot changes

Closes TRES-212

🤖 Generated with Claude Code

alvarosabu and others added 21 commits January 27, 2026 07:50
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…and enhance issue handling with organization membership checks
…ntext

- Added `analyzeFeasibility` function to assess technical feasibility of proposals.
- Introduced `FEASIBILITY_SYSTEM_PROMPT` and `buildFeasibilityPrompt` for generating prompts.
- Updated comment handler to fetch relevant code and provide analysis in response to user comments.
- Enhanced keyword extraction for targeted code searches.
…abels

- Changed package format in prompts to use pipe-separated values for clarity.
- Updated issue triage logic to improve label handling, including clearer label names and conditions for adding package labels.
- Renamed `convertToDiscussion` function to `closeIssueAsFeatureRequest` to better reflect its purpose.
- Updated the function to close feature request issues with a "not planned" reason and return a new discussion URL.
- Modified the issue handler to utilize the new function and streamline the redirection process for feature requests.
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 27, 2026

Deploy Preview for tresjs-docs failed. Why did it fail? →

Name Link
🔨 Latest commit 829ac39
🔍 Latest deploy log https://app.netlify.com/projects/tresjs-docs/deploys/69da20b09602570008d7894e

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 27, 2026

Deploy Preview for cientos-tresjs failed. Why did it fail? →

Name Link
🔨 Latest commit 829ac39
🔍 Latest deploy log https://app.netlify.com/projects/cientos-tresjs/deploys/69da20b0eec1870008dd5225

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 27, 2026

Deploy Preview for tresjs-lab failed. Why did it fail? →

Name Link
🔨 Latest commit 829ac39
🔍 Latest deploy log https://app.netlify.com/projects/tresjs-lab/deploys/69da20b04bc35d00083f214c

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 27, 2026

Open in StackBlitz

@tresjs/cientos

npm i https://pkg.pr.new/@tresjs/cientos@1361

@tresjs/core

npm i https://pkg.pr.new/@tresjs/core@1361

@tresjs/eslint-config

npm i https://pkg.pr.new/@tresjs/eslint-config@1361

@tresjs/leches

npm i https://pkg.pr.new/@tresjs/leches@1361

@tresjs/nuxt

npm i https://pkg.pr.new/@tresjs/nuxt@1361

@tresjs/post-processing

npm i https://pkg.pr.new/@tresjs/post-processing@1361

commit: 829ac39

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds “CubeBot”, a Cloudflare Workers GitHub App intended to auto-triage TresJS issues and respond to @tresjs-cubebot mentions with RAG-augmented Claude analysis.

Changes:

  • Scaffolds a new apps/cubebot Worker app (Hono + D1 + Workers AI embeddings + Octokit + Anthropic Claude).
  • Implements webhook handling for issues.opened triage and issue_comment.created mention replies.
  • Adds deployment automation via a GitHub Actions workflow for changes under apps/cubebot/**.

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pnpm-lock.yaml Adds CubeBot dependencies (Hono, Octokit, Anthropic SDK, Wrangler, etc.).
apps/cubebot/wrangler.toml Cloudflare Worker configuration (entrypoint, D1 binding, AI binding, observability).
apps/cubebot/tsconfig.json TypeScript configuration for the Worker app.
apps/cubebot/src/types.ts Defines webhook payload and triage result types.
apps/cubebot/src/triage/detect.ts Issue type/package detection + heuristics for reproduction/system info/expected behavior.
apps/cubebot/src/triage/comments.ts Formats maintainer/author comments and feature-redirect message.
apps/cubebot/src/index.ts Hono routes: health, /admin/seed-docs, and /webhook.
apps/cubebot/src/github/verify.ts Verifies GitHub webhook signature.
apps/cubebot/src/github/handlers/issues.ts Handles issues.opened triage flow (labels/comments/feature redirect).
apps/cubebot/src/github/handlers/comments.ts Handles bot mentions in comments and posts a RAG-powered reply.
apps/cubebot/src/github/code.ts Fetches and searches TresJS repo code for feasibility context.
apps/cubebot/src/github/auth.ts GitHub App installation auth via @octokit/auth-app with simple token caching.
apps/cubebot/src/github/api.ts GitHub API helpers (org membership check, comment, labels, close).
apps/cubebot/src/ai/rag.ts Embedding generation + in-memory similarity search over D1 rows.
apps/cubebot/src/ai/prompts.ts Claude system prompts + JSON-output prompt builders.
apps/cubebot/src/ai/claude.ts Anthropic client calls for issue analysis and feasibility analysis.
apps/cubebot/src/admin/seed-docs.ts Admin endpoint to fetch docs, embed via Workers AI, and store chunks in D1.
apps/cubebot/scripts/embed-docs.ts Local script to fetch/split docs and write chunks to JSON.
apps/cubebot/schema.sql D1 schema for doc_chunks storage.
apps/cubebot/package.json CubeBot package metadata + dev/deploy scripts.
apps/cubebot/eslint.config.js ESLint config using @tresjs/eslint-config.
apps/cubebot/README.md Setup/deploy/secret instructions for CubeBot.
apps/cubebot/CLAUDE.md Local documentation for the CubeBot subproject.
apps/cubebot/.gitignore Ignores data output and Wrangler local state.
.github/workflows/deploy-cubebot.yml Auto-deploys CubeBot to Cloudflare Workers on pushes to main.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/cubebot/src/github/handlers/issues.ts
Comment thread apps/cubebot/src/github/handlers/issues.ts Outdated
Comment thread apps/cubebot/src/github/verify.ts Outdated
Comment thread apps/cubebot/src/admin/seed-docs.ts Outdated
Comment thread apps/cubebot/src/ai/rag.ts Outdated
Comment thread apps/cubebot/README.md Outdated
@alvarosabu
Copy link
Copy Markdown
Member Author

@claude mind reviewing this one?

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.

2 participants