Skip to content

Feat/add kata endpoints - #15

Merged
kevinccbsg merged 18 commits into
stagingfrom
feat/add-kata-endpoints
Dec 2, 2025
Merged

kevinccbsg merged 18 commits into
stagingfrom
feat/add-kata-endpoints

Conversation

@kevinccbsg

Copy link
Copy Markdown
Collaborator

Pull Request

What’s this about?

This pull request introduces a new OpenAI-powered "kata prompting" workflow that enables dynamic tool selection and message composition for Slack channels. It adds core agent logic, database queries for leaderboards and transactions, OpenAI API integration, a new API endpoint, and supporting tests and mocks. The changes are grouped below by theme.

Kata Prompting Agent & Workflow

  • Added processKataPrompting agent in agent.ts that orchestrates two OpenAI calls: first to select which tools to use (leaderboard, transactions), then to compose a human-readable message using results from those tools.
  • Created kataPrompting process function and Slack integration to send the composed message to a channel. [1] [2]

Database Tooling for Prompting

  • Added database queries in index.ts for fetching last week’s transactions, last week’s leaderboard, and today’s leaderboard, each with user details and ranking.

OpenAI API Integration

  • Added OpenAI client wrapper and type exports to centralize chat completion logic and ensure proper parameter passing.
  • Added openai package dependency.

API Endpoint for Kata Prompting

  • Introduced /api/kata-prompting endpoint with API key authorization, asynchronous processing via waitUntil, and request handling for channel, tools, and prompt.
  • Updated .env.example to include required API keys.

Testing & Mocks

  • Added comprehensive e2e and unit tests for the kata prompting workflow, including OpenAI and Slack mocks, and validation of tool selection and message composition. [1] [2] [3]
  • Fixed imports in legacy tests to point to the correct database module. [1] [2]

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactor
  • Docs
  • Test
  • Build/CI

Checklist

  • Code follows project conventions
  • Self-reviewed the changes
  • Added/updated documentation if needed
  • No new warnings
  • Tests added or updated
  • All tests pass locally

Testing Notes

Screenshot 2025-12-01 at 19 37 18 Screenshot 2025-12-01 at 19 37 35

@vercel

vercel Bot commented Dec 1, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
apogee-bot Ignored Ignored Preview Dec 2, 2025 6:53pm

@kevinccbsg
kevinccbsg changed the base branch from main to staging December 1, 2025 18:38
Comment thread app/_lib/_agent/agent.ts Outdated
Comment thread app/_lib/_db/index.ts
Comment thread app/_lib/_process/kataPrompting.ts Outdated
Comment thread app/api/kata-prompting/route.ts Outdated
@kevinccbsg
kevinccbsg merged commit f4ca21e into staging Dec 2, 2025
3 checks passed
@kevinccbsg
kevinccbsg deleted the feat/add-kata-endpoints branch December 2, 2025 20:02
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