Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3ab9d29
hot fix
Asheze1127 Apr 7, 2026
a663583
feat: add subagent orchestration kit
Asheze1127 Apr 7, 2026
cc498b1
fix: clarify plugin context resolution
Asheze1127 Apr 7, 2026
3c3b255
feat: start console opportunity cycle
Asheze1127 Apr 7, 2026
f28d0bc
fix: improve plugin portability
Asheze1127 Apr 7, 2026
28a3519
feat: add hackathon scoped mentor board
Asheze1127 Apr 7, 2026
6c57291
merge: subagent orchestration kit into dev-codex
Asheze1127 Apr 7, 2026
e7c4e75
merge: opportunity cycle into dev-codex
Asheze1127 Apr 7, 2026
910e822
feat: add mentor question detail workflow
Asheze1127 Apr 7, 2026
9856217
feat: add console role scope session shell
Asheze1127 Apr 7, 2026
2ce3eca
feat: enforce console viewer scope in api
Asheze1127 Apr 7, 2026
bb5f62e
fix: fail closed on unresolved slack scope
Asheze1127 Apr 7, 2026
31dbfc7
feat: add stateful question followups
Asheze1127 Apr 7, 2026
9aecaf6
feat: unify console tracks and add dark mode
Asheze1127 Apr 8, 2026
b264172
feat: add console auth onboarding and scout flow
Asheze1127 Apr 8, 2026
41d2b5b
feat: add console auth and scout onboarding
Asheze1127 Apr 8, 2026
2ac88c0
feat: add organizer setup for teams and hackathons
Asheze1127 Apr 8, 2026
d9f4e7b
feat: add organizer team mapping controls
Asheze1127 Apr 8, 2026
d68a5f4
fix: polish organizer and tenant operations UI
Asheze1127 Apr 8, 2026
d5e3c9f
feat: add judge digests and portfolio exports
Asheze1127 Apr 8, 2026
a931121
fix: sanitize hacker portfolio export redirects
Asheze1127 Apr 8, 2026
600ef27
feat: add judge digests and portfolio export
Asheze1127 Apr 8, 2026
7d152e0
feat: add platform role binding controls
Asheze1127 Apr 8, 2026
b6fa2e8
feat: add slack oauth installation tracking
Asheze1127 Apr 8, 2026
0258130
feat: connect sponsor visibility and portfolio digests
Asheze1127 Apr 8, 2026
49d6afd
feat: expand judge digest github context
Asheze1127 Apr 8, 2026
edbeaa3
feat: resolve slack bot tokens per workspace
Asheze1127 Apr 8, 2026
128b86c
chore: align env defaults and make test
Asheze1127 Apr 8, 2026
908cb82
feat: add participant github oauth for digests
Asheze1127 Apr 8, 2026
10a2992
fix: keep signup working before github migration
Asheze1127 Apr 9, 2026
413db81
fix: require user confirmation for ai question answers
Asheze1127 Apr 10, 2026
05c99d1
fix: improve mentor escalation ux
Asheze1127 Apr 10, 2026
e67836d
fix: always show ai answer confirmation buttons
Asheze1127 Apr 10, 2026
295e462
fix: salvage malformed triage json
Asheze1127 Apr 10, 2026
b0405ce
chore: prevent duplicate dev worker processes
Asheze1127 Apr 10, 2026
41e53d1
refactor: wrap bonsai text answers into triage results
Asheze1127 Apr 10, 2026
2f3772b
feat: add kit ai provider for triage
Asheze1127 Apr 10, 2026
5ef4177
fix: make question action buttons idempotent
Asheze1127 Apr 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "local-plugins",
"interface": {
"displayName": "Local Plugins"
},
"plugins": [
{
"name": "subagent-orchestration-kit",
"source": {
"source": "local",
"path": "./plugins/subagent-orchestration-kit"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Productivity"
}
]
}
33 changes: 26 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,42 @@
# .env は絶対にコミットしないこと

# === Slack ===
SLACK_BOT_TOKEN=
SLACK_SIGNING_SECRET=
SLACK_APP_ID=
SLACK_BOT_TOKEN= # xoxb-... (OAuth & Permissions)
SLACK_APP_TOKEN= # xapp-... (Basic Information → App-Level Tokens → connections:write)
SLACK_APP_ID= # A0XXXXXXX (setup.sh で使用)
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=
SLACK_REDIRECT_URI=
SLACK_INSTALLATION_ENCRYPTION_SECRET=
SLACK_SIGNING_SECRET= # 不要になりましたが念のため残す
SLACK_MENTOR_CHANNEL_ID=
SLACK_PROGRESS_CHANNEL_ID=

# === Database ===
DATABASE_URL=postgres://postgres:postgres@localhost:5432/kcl_support_hub
DATABASE_URL=postgres://postgres:postgres@localhost:5432/kcl_support_hub?sslmode=disable

# === AI (Bonsai / Ollama) ===
# ollama serve && ollama pull qwen2.5:7b を実行してから設定
BONSAI_BASE_URL=http://localhost:11434/v1
BONSAI_API_KEY=ollama
BONSAI_MODEL=qwen2.5:7b

# === AI (KIT AI endpoint) ===
# 社内 AI サーバーを使う場合はこちらを設定
KIT_AI_URL=https://aisvr221.aikb.kyutech.ac.jp/api/generate
KIT_AI_PW=
KIT_AI_MODEL=gpt-oss:120b
KIT_AI_VERIFY_TLS=false

# === AI Fallback (optional) ===
# どちらか一方を設定すると Bonsai 落ちたときの fallback が有効になる
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
GITHUB_TOKEN= # judge digest の運営 fallback / public repo rate limit 緩和用(participant 連携が優先)
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_REDIRECT_URI=http://localhost:3001/github/oauth/callback
GITHUB_CONNECTION_ENCRYPTION_SECRET=

# === AI 設定 ===
AI_CONFIDENCE_THRESHOLD=0.5
Expand All @@ -34,7 +51,7 @@ ONYX_API_URL=
ONYX_API_KEY=

# === AWS ===
AWS_REGION=ap-northeast-1
AWS_REGION=us-east-1
# ローカル開発 (LocalStack) 用
AWS_ENDPOINT_URL=http://localhost:4566
AWS_ACCESS_KEY_ID=test
Expand All @@ -47,8 +64,10 @@ SQS_PROGRESS_URL=http://localhost:4566/000000000000/progress
# === API Server ===
PORT=8080
ENV=development
HACKHUB_INTERNAL_AUTH_SECRET=dev-internal-auth-secret-change-in-production

# === Web Dashboard ===
# === Control Plane ===
NEXT_PUBLIC_API_URL=http://localhost:8080
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_URL=http://localhost:3001
NEXTAUTH_SECRET=dev-secret-change-in-production
CONSOLE_SESSION_SECRET=dev-console-session-secret-change-in-production
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Thumbs.db
.vscode/
*.swp

# Local runtime state
.tmp/

# VitePress
docs-host/.vitepress/cache
docs-host/.vitepress/dist
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# CLAUDE.md — KCL Support Hub
# CLAUDE.md — HackHub

Claude Code がこのリポジトリで作業するときに読む指示書です。

---

## 最初にやること

1. `docs/specification.md` を読んでプロダクト全体を把握する
1. `docs/specification.md` を読んで、support hub と showcase / talent の両トラックを把握する
2. 作業対象に関連する `docs/detail/` のファイルを読む
3. `AGENTS.md` のルール(3段階境界・DoD)を確認する

Expand Down
54 changes: 30 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ export

.PHONY: help \
up down logs \
init-sqs \
migrate migrate-down migrate-status \
dev-api dev-worker dev-web \
docs docs-build \
dev-api dev-worker dev-web dev-console dev-control-plane \
docs \
build \
slack-setup slack-manifest \
slack-manifest \
lint test \
setup

Expand All @@ -16,12 +17,13 @@ export
# -----------------------------------------------
help:
@echo ""
@echo "KCL Support Hub — Makefile"
@echo "HackHub — Makefile"
@echo ""
@echo " インフラ"
@echo " make up Docker インフラ起動 (postgres + localstack)"
@echo " make down Docker インフラ停止"
@echo " make logs Docker ログ表示"
@echo " make init-sqs LocalStack SQS キュー作成 (up後に必要)"
@echo ""
@echo " DB"
@echo " make migrate マイグレーション実行"
Expand All @@ -32,21 +34,22 @@ help:
@echo " make dev-api Go API サーバー起動 (port 8080)"
@echo " make dev-worker TypeScript Worker 起動"
@echo " make dev-web Next.js ダッシュボード起動 (port 3000)"
@echo " make dev-control-plane Next.js control-plane 起動 (port 3001)"
@echo " make dev-console 互換 alias (legacy name)"
@echo " 起動後: http://localhost:3001/signup からアカウント作成"
@echo " make docs ドキュメントサーバー起動 (port 4000)"
@echo " make docs-build ドキュメントを静的ファイルにビルド"
@echo ""
@echo " Slack"
@echo " make slack-setup URL=https://xxxx.ngrok-free.app"
@echo " Slash Commands + Interactivity URL を一括更新"
@echo " make slack-manifest manifest.json の内容を表示"
@echo " ※ Socket Mode 使用中のため ngrok / URL 設定不要"
@echo ""
@echo " ビルド / テスト"
@echo " make build 全サービスをビルド"
@echo " make lint 全サービスのリント"
@echo " make test 全サービスのテスト"
@echo " make test 利用可能なテスト / 型検査"
@echo ""
@echo " 初回セットアップ一括"
@echo " make setup up + migrate をまとめて実行"
@echo " make setup up + init-sqs + migrate をまとめて実行"
@echo ""

# -----------------------------------------------
Expand All @@ -55,6 +58,9 @@ help:
up:
docker compose -f infra/docker/compose.yml up -d

init-sqs:
docker exec docker-localstack-1 bash /etc/localstack/init/ready.d/init-localstack.sh

down:
docker compose -f infra/docker/compose.yml down

Expand All @@ -80,29 +86,26 @@ dev-api:
$(MAKE) -C apps/api dev

dev-worker:
cd apps/worker && pnpm dev
./scripts/dev-worker.sh

dev-web:
cd apps/web && pnpm dev
cd apps/web && PORT=3000 pnpm dev

dev-console:
cd apps/console && PORT=3001 pnpm dev

dev-control-plane:
cd apps/console && PORT=3001 pnpm dev

# -----------------------------------------------
# ドキュメント
# -----------------------------------------------
docs:
cd docs-host && pnpm dev

docs-build:
cd docs-host && pnpm build
node docs-host/server.js

# -----------------------------------------------
# Slack
# -----------------------------------------------
slack-setup:
ifndef URL
$(error URLを指定してください: make slack-setup URL=https://xxxx.ngrok-free.app)
endif
./infra/slack/setup.sh "$(URL)"

slack-manifest:
@cat infra/slack/manifest.json

Expand All @@ -113,6 +116,7 @@ build:
$(MAKE) -C apps/api build
cd apps/worker && pnpm build
cd apps/web && pnpm build
cd apps/console && pnpm build

# -----------------------------------------------
# リント / テスト
Expand All @@ -121,22 +125,24 @@ lint:
$(MAKE) -C apps/api lint
cd apps/worker && pnpm lint
cd apps/web && pnpm lint
cd apps/console && pnpm lint

test:
$(MAKE) -C apps/api test
cd apps/worker && pnpm test
cd apps/worker && pnpm typecheck
cd apps/console && pnpm typecheck

# -----------------------------------------------
# 初回セットアップ一括
# -----------------------------------------------
setup: up
@echo "インフラ起動を待機中..."
@sleep 5
$(MAKE) init-sqs
$(MAKE) migrate
@echo ""
@echo "セットアップ完了。次のステップ:"
@echo " 1. make dev-api (別ターミナル)"
@echo " 2. make dev-worker (別ターミナル)"
@echo " 3. make dev-web (別ターミナル)"
@echo " 4. ngrok http 8080"
@echo " 5. make slack-setup URL=<ngrok URL>"
@echo " 4. make dev-control-plane (別ターミナル)"
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# KCL Support Hub
# HackHub

KCL(初心者向けハッカソン)の質問受付・進捗可視化・AI 一次対応システム
HackHub は、`progress-checker` の support hub と `hack-evaluater` の showcase / talent product を同時に提供する multi-hackathon platform です

Slack を主入口として、Bonsai-8B(ローカル LLM)が質問をトリアージし、メンターへのエスカレーションを支援します。
Slack を主入口にした質問受付・進捗可視化・AI 一次対応に加えて、GitHub repository の発表要約、ハッカソン実績からの portfolio 出力、Sponsor 向け scout workflow を同じ権限モデルの上に載せます。
現在の `dev-codex` 系統では、`apps/console` をその統合 control-plane として拡張しています。
最新 slice では、console のローカル認証、アカウント作成、ロール切替、Slack 導入案内、Sponsor / Hacker の scout onboarding、Organizer 向け team / Slack channel mapping UI、Judge 向け GitHub digest、Hacker 向け portfolio 下書きと Markdown export、dark mode、署名付き internal headers による API scope 接続まで入っています。

## ドキュメント

- [仕様概要](./docs/specification.md)
- [アーキテクチャ](./docs/detail/02_architecture.md)
- [AI フロー](./docs/detail/03_ai-flow.md)
- [実装フェーズ](./docs/detail/05_implementation-phases.md)
- [統合差分と opportunity cycle](./docs/detail/10_combined-product-gap-analysis.md)
- [AI コーディング環境セットアップ](./docs/ai-setup.md)

## セットアップ
Expand All @@ -22,3 +25,25 @@ docker compose -f infra/docker/compose.yml up -d
```

詳細は [`docs/detail/07_env-vars.md`](./docs/detail/07_env-vars.md) を参照。

## 開発用アプリ

- `apps/web` : 既存の read-only dashboard
- `apps/console` : support hub + showcase / talent の両導線を載せる統合 control-plane
- `dev-codex` では `/login` から role / hackathon scope session を作って protected route を切り替える
- `/tenant` でハッカソン登録、`/organizer` で team / Slack channel mapping を行える
- `/judge` で GitHub repository から発表用 digest を生成して履歴保存できる
- `/hacker` で participant GitHub 連携、portfolio 下書き保存、Markdown export ができる
- `/sponsor` で可視範囲内の参加者へ scout を送れる
- `make dev-control-plane` が推奨起動コマンド。`make dev-console` は互換 alias

## ローカル確認の最短手順

1. `make up`
2. `make init-sqs`
3. `make migrate`
4. `make dev-api`
5. `make dev-worker`
6. `make dev-control-plane`

その後、`http://localhost:3001/signup` でアカウントを作成し、`/login` からログインします。Slack App の導入確認は `http://localhost:3001/slack/install` から、participant の GitHub 連携は `http://localhost:3001/hacker` から行えます。
21 changes: 13 additions & 8 deletions apps/api/cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func main() {
log.Fatalf("sqs init: %v", err)
}

// Start Slack Socket Mode in a background goroutine.
// Connects to Slack via WebSocket — no public URL required.
go slackhandler.RunSocketMode(cfg, sqlDB, sqsClient)

if !cfg.IsDev() {
gin.SetMode(gin.ReleaseMode)
}
Expand All @@ -46,17 +50,18 @@ func main() {
c.JSON(http.StatusOK, gin.H{"status": "ok"})
})

// Slack webhook routes
r.POST("/slack/commands", slackhandler.HandleSlashCommand(cfg, sqlDB))
r.POST("/slack/interactions", slackhandler.HandleInteraction(cfg, sqlDB, sqsClient))

// REST API routes for the dashboard
api := r.Group("/api")
{
api.GET("/questions", apihandler.HandleListQuestions(sqlDB))
api.GET("/questions/:id", apihandler.HandleGetQuestion(sqlDB))
api.GET("/progress", apihandler.HandleListProgress(sqlDB))
api.GET("/teams", apihandler.HandleListTeams(sqlDB))
api.GET("/hackathons", apihandler.HandleListHackathons(sqlDB, cfg.InternalAuthSecret))
api.POST("/hackathons", apihandler.HandleCreateHackathon(sqlDB, cfg.InternalAuthSecret))
api.GET("/questions", apihandler.HandleListQuestions(sqlDB, cfg.InternalAuthSecret))
api.GET("/questions/:id", apihandler.HandleGetQuestion(sqlDB, cfg.InternalAuthSecret))
api.PATCH("/questions/:id/status", apihandler.HandleUpdateQuestionStatus(sqlDB, cfg.InternalAuthSecret))
api.GET("/progress", apihandler.HandleListProgress(sqlDB, cfg.InternalAuthSecret))
api.GET("/teams", apihandler.HandleListTeams(sqlDB, cfg.InternalAuthSecret))
api.POST("/teams", apihandler.HandleCreateTeam(sqlDB, cfg.InternalAuthSecret))
api.PATCH("/teams/:id", apihandler.HandleUpdateTeam(sqlDB, cfg.InternalAuthSecret))
}

log.Printf("starting server on :%s (env=%s)", cfg.Port, cfg.Env)
Expand Down
39 changes: 39 additions & 0 deletions apps/api/db/migrations/007_create_hackathons.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
-- +goose Up
CREATE TABLE hackathons (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
slug TEXT NOT NULL UNIQUE,
name TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

ALTER TABLE teams
ADD COLUMN hackathon_id UUID REFERENCES hackathons (id),
ADD COLUMN slack_workspace_id TEXT;

INSERT INTO hackathons (id, slug, name)
VALUES (
'00000000-0000-0000-0000-000000000001',
'default-hackathon',
'Default Hackathon'
);

UPDATE teams
SET hackathon_id = '00000000-0000-0000-0000-000000000001'
WHERE hackathon_id IS NULL;

ALTER TABLE teams
ALTER COLUMN hackathon_id SET NOT NULL;

CREATE INDEX idx_teams_hackathon_id ON teams (hackathon_id);
CREATE INDEX idx_teams_slack_scope ON teams (slack_workspace_id, slack_channel_id);

-- +goose Down
DROP INDEX idx_teams_slack_scope;
DROP INDEX idx_teams_hackathon_id;

ALTER TABLE teams
DROP COLUMN slack_workspace_id,
DROP COLUMN hackathon_id;

DROP TABLE hackathons;
Loading
Loading