claude-code-orchestrator-kit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/database/workers/api-builder.md +155 -0
- package/.claude/agents/database/workers/database-architect.md +193 -0
- package/.claude/agents/database/workers/supabase-auditor.md +1070 -0
- package/.claude/agents/development/workers/code-reviewer.md +968 -0
- package/.claude/agents/development/workers/cost-calculator-specialist.md +683 -0
- package/.claude/agents/development/workers/llm-service-specialist.md +999 -0
- package/.claude/agents/development/workers/skill-builder-v2.md +480 -0
- package/.claude/agents/development/workers/typescript-types-specialist.md +649 -0
- package/.claude/agents/development/workers/utility-builder.md +582 -0
- package/.claude/agents/documentation/workers/technical-writer.md +152 -0
- package/.claude/agents/frontend/workers/fullstack-nextjs-specialist.md +206 -0
- package/.claude/agents/frontend/workers/visual-effects-creator.md +159 -0
- package/.claude/agents/health/orchestrators/bug-orchestrator.md +1045 -0
- package/.claude/agents/health/orchestrators/dead-code-orchestrator.md +1045 -0
- package/.claude/agents/health/orchestrators/dependency-orchestrator.md +1045 -0
- package/.claude/agents/health/orchestrators/security-orchestrator.md +1045 -0
- package/.claude/agents/health/workers/bug-fixer.md +525 -0
- package/.claude/agents/health/workers/bug-hunter.md +649 -0
- package/.claude/agents/health/workers/dead-code-hunter.md +446 -0
- package/.claude/agents/health/workers/dead-code-remover.md +437 -0
- package/.claude/agents/health/workers/dependency-auditor.md +379 -0
- package/.claude/agents/health/workers/dependency-updater.md +436 -0
- package/.claude/agents/health/workers/security-scanner.md +700 -0
- package/.claude/agents/health/workers/vulnerability-fixer.md +524 -0
- package/.claude/agents/infrastructure/workers/infrastructure-specialist.md +156 -0
- package/.claude/agents/infrastructure/workers/orchestration-logic-specialist.md +1260 -0
- package/.claude/agents/infrastructure/workers/qdrant-specialist.md +503 -0
- package/.claude/agents/infrastructure/workers/quality-validator-specialist.md +984 -0
- package/.claude/agents/meta/workers/meta-agent-v3.md +503 -0
- package/.claude/agents/research/workers/problem-investigator.md +507 -0
- package/.claude/agents/research/workers/research-specialist.md +423 -0
- package/.claude/agents/testing/workers/accessibility-tester.md +813 -0
- package/.claude/agents/testing/workers/integration-tester.md +188 -0
- package/.claude/agents/testing/workers/mobile-fixes-implementer.md +252 -0
- package/.claude/agents/testing/workers/mobile-responsiveness-tester.md +180 -0
- package/.claude/agents/testing/workers/performance-optimizer.md +262 -0
- package/.claude/agents/testing/workers/test-writer.md +800 -0
- package/.claude/commands/health-bugs.md +297 -0
- package/.claude/commands/health-cleanup.md +297 -0
- package/.claude/commands/health-deps.md +297 -0
- package/.claude/commands/health-metrics.md +747 -0
- package/.claude/commands/health-security.md +297 -0
- package/.claude/commands/push.md +21 -0
- package/.claude/commands/speckit.analyze.md +184 -0
- package/.claude/commands/speckit.checklist.md +294 -0
- package/.claude/commands/speckit.clarify.md +178 -0
- package/.claude/commands/speckit.constitution.md +78 -0
- package/.claude/commands/speckit.implement.md +182 -0
- package/.claude/commands/speckit.plan.md +87 -0
- package/.claude/commands/speckit.specify.md +250 -0
- package/.claude/commands/speckit.tasks.md +137 -0
- package/.claude/commands/translate-doc.md +95 -0
- package/.claude/commands/worktree-cleanup.md +382 -0
- package/.claude/commands/worktree-create.md +287 -0
- package/.claude/commands/worktree-list.md +239 -0
- package/.claude/commands/worktree-remove.md +339 -0
- package/.claude/schemas/base-plan.schema.json +82 -0
- package/.claude/schemas/bug-plan.schema.json +71 -0
- package/.claude/schemas/dead-code-plan.schema.json +71 -0
- package/.claude/schemas/dependency-plan.schema.json +74 -0
- package/.claude/schemas/security-plan.schema.json +71 -0
- package/.claude/scripts/gates/check-bundle-size.sh +47 -0
- package/.claude/scripts/gates/check-coverage.sh +67 -0
- package/.claude/scripts/gates/check-security.sh +46 -0
- package/.claude/scripts/release.sh +740 -0
- package/.claude/settings.local.json +21 -0
- package/.claude/settings.local.json.example +20 -0
- package/.claude/skills/calculate-priority-score/SKILL.md +229 -0
- package/.claude/skills/calculate-priority-score/scoring-matrix.json +83 -0
- package/.claude/skills/extract-version/SKILL.md +228 -0
- package/.claude/skills/format-commit-message/SKILL.md +189 -0
- package/.claude/skills/format-commit-message/template.md +64 -0
- package/.claude/skills/format-markdown-table/SKILL.md +202 -0
- package/.claude/skills/format-markdown-table/examples.md +84 -0
- package/.claude/skills/format-todo-list/SKILL.md +222 -0
- package/.claude/skills/format-todo-list/template.json +30 -0
- package/.claude/skills/generate-changelog/SKILL.md +258 -0
- package/.claude/skills/generate-changelog/commit-mapping.json +47 -0
- package/.claude/skills/generate-report-header/SKILL.md +228 -0
- package/.claude/skills/generate-report-header/template.md +66 -0
- package/.claude/skills/parse-error-logs/SKILL.md +286 -0
- package/.claude/skills/parse-error-logs/patterns.json +26 -0
- package/.claude/skills/parse-git-status/SKILL.md +164 -0
- package/.claude/skills/parse-package-json/SKILL.md +151 -0
- package/.claude/skills/parse-package-json/schema.json +43 -0
- package/.claude/skills/render-template/SKILL.md +245 -0
- package/.claude/skills/rollback-changes/SKILL.md +582 -0
- package/.claude/skills/rollback-changes/changes-log-schema.json +101 -0
- package/.claude/skills/run-quality-gate/SKILL.md +404 -0
- package/.claude/skills/run-quality-gate/gate-mappings.json +97 -0
- package/.claude/skills/validate-plan-file/SKILL.md +327 -0
- package/.claude/skills/validate-plan-file/schema.json +35 -0
- package/.claude/skills/validate-report-file/SKILL.md +256 -0
- package/.claude/skills/validate-report-file/schema.json +67 -0
- package/.env.example +49 -0
- package/.github/BRANCH_PROTECTION.md +137 -0
- package/.github/workflows/build.yml +70 -0
- package/.github/workflows/claude-code-review.yml +255 -0
- package/.github/workflows/claude.yml +79 -0
- package/.github/workflows/deploy-staging.yml +90 -0
- package/.github/workflows/test.yml +104 -0
- package/.gitignore +116 -0
- package/CLAUDE.md +137 -0
- package/LICENSE +72 -0
- package/README.md +1098 -0
- package/docs/ARCHITECTURE.md +746 -0
- package/docs/Agents Ecosystem/AGENT-ORCHESTRATION.md +568 -0
- package/docs/Agents Ecosystem/AI-AGENT-ECOSYSTEM-README.md +658 -0
- package/docs/Agents Ecosystem/ARCHITECTURE.md +606 -0
- package/docs/Agents Ecosystem/QUALITY-GATES-SPECIFICATION.md +1315 -0
- package/docs/Agents Ecosystem/REPORT-TEMPLATE-STANDARD.md +1324 -0
- package/docs/Agents Ecosystem/spec-kit-comprehensive-updates.md +478 -0
- package/docs/FAQ.md +572 -0
- package/docs/MIGRATION-GUIDE.md +542 -0
- package/docs/PERFORMANCE-OPTIMIZATION.md +494 -0
- package/docs/ROADMAP.md +439 -0
- package/docs/TUTORIAL-CUSTOM-AGENTS.md +2041 -0
- package/docs/USE-CASES.md +706 -0
- package/index.js +96 -0
- package/mcp/.mcp.base.json +21 -0
- package/mcp/.mcp.frontend.json +29 -0
- package/mcp/.mcp.full.json +67 -0
- package/mcp/.mcp.local.example.json +7 -0
- package/mcp/.mcp.local.json +7 -0
- package/mcp/.mcp.n8n.json +45 -0
- package/mcp/.mcp.supabase-full.json +35 -0
- package/mcp/.mcp.supabase-only.json +28 -0
- package/package.json +78 -0
- package/postinstall.js +71 -0
- package/switch-mcp.sh +101 -0
package/.env.example
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# ===================================================================
|
|
2
|
+
# MCP Server Configuration - EXAMPLE FILE
|
|
3
|
+
# ===================================================================
|
|
4
|
+
# IMPORTANT: Copy this file to .env.local and fill in your actual credentials
|
|
5
|
+
# Command: cp .env.example .env.local
|
|
6
|
+
#
|
|
7
|
+
# .env.local is git-ignored and will NOT be committed to the repository
|
|
8
|
+
|
|
9
|
+
# ===================================================================
|
|
10
|
+
# Supabase Configuration
|
|
11
|
+
# ===================================================================
|
|
12
|
+
# Main Supabase Instance
|
|
13
|
+
# Get from: https://supabase.com/dashboard/project/_/settings/api
|
|
14
|
+
SUPABASE_PROJECT_REF=your-project-ref-here
|
|
15
|
+
SUPABASE_ACCESS_TOKEN=your-access-token-here
|
|
16
|
+
SUPABASE_DB_PASSWORD=your-database-password-here
|
|
17
|
+
|
|
18
|
+
# Legacy/Secondary Supabase Instance (optional)
|
|
19
|
+
SUPABASE_LEGACY_PROJECT_REF=your-legacy-project-ref-here
|
|
20
|
+
|
|
21
|
+
# ===================================================================
|
|
22
|
+
# Sequential Thinking MCP Server
|
|
23
|
+
# ===================================================================
|
|
24
|
+
# Get from: https://smithery.ai/
|
|
25
|
+
SEQUENTIAL_THINKING_KEY=your-smithery-api-key-here
|
|
26
|
+
SEQUENTIAL_THINKING_PROFILE=your-smithery-profile-here
|
|
27
|
+
|
|
28
|
+
# ===================================================================
|
|
29
|
+
# n8n Configuration
|
|
30
|
+
# ===================================================================
|
|
31
|
+
# Your n8n instance URL and API key
|
|
32
|
+
N8N_API_URL=https://your-n8n-instance.com
|
|
33
|
+
N8N_API_KEY=your-n8n-api-key-here
|
|
34
|
+
|
|
35
|
+
# ===================================================================
|
|
36
|
+
# GitHub Configuration (optional)
|
|
37
|
+
# ===================================================================
|
|
38
|
+
# GitHub Personal Access Token
|
|
39
|
+
# Create at: https://github.com/settings/tokens
|
|
40
|
+
GITHUB_TOKEN=your-github-token-here
|
|
41
|
+
GITHUB_PAT=your-github-pat-here
|
|
42
|
+
|
|
43
|
+
# ===================================================================
|
|
44
|
+
# Notes
|
|
45
|
+
# ===================================================================
|
|
46
|
+
# - Never commit .env.local to git
|
|
47
|
+
# - Keep your tokens and passwords secure
|
|
48
|
+
# - Use environment-specific values for different setups
|
|
49
|
+
# - We use ONLY cloud Supabase, no local Docker instance
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Branch Protection Rules Configuration
|
|
2
|
+
|
|
3
|
+
**Task**: T088 - Configure branch protection rules for main branch
|
|
4
|
+
**Status**: Configuration instructions (requires GitHub admin access)
|
|
5
|
+
|
|
6
|
+
## Required Configuration
|
|
7
|
+
|
|
8
|
+
Branch protection rules must be configured in GitHub repository settings for the `main` branch.
|
|
9
|
+
|
|
10
|
+
### Access Path
|
|
11
|
+
1. Go to repository Settings
|
|
12
|
+
2. Navigate to Branches → Branch protection rules
|
|
13
|
+
3. Click "Add rule" or edit existing rule for `main`
|
|
14
|
+
|
|
15
|
+
### Required Settings
|
|
16
|
+
|
|
17
|
+
#### 1. Branch Name Pattern
|
|
18
|
+
- Pattern: `main`
|
|
19
|
+
|
|
20
|
+
#### 2. Protect Matching Branches
|
|
21
|
+
Enable the following protections:
|
|
22
|
+
|
|
23
|
+
**Require status checks to pass before merging**
|
|
24
|
+
- ✅ Require status checks to pass before merging
|
|
25
|
+
- ✅ Require branches to be up to date before merging
|
|
26
|
+
- Required status checks:
|
|
27
|
+
- `test / test (20.x)` - Test workflow must pass
|
|
28
|
+
- `build / build (20.x)` - Build workflow must pass
|
|
29
|
+
|
|
30
|
+
**Require pull request reviews before merging**
|
|
31
|
+
- ✅ Require pull request reviews before merging
|
|
32
|
+
- Required number of approvals: 1
|
|
33
|
+
- ✅ Dismiss stale pull request approvals when new commits are pushed
|
|
34
|
+
- ✅ Require review from Code Owners (if CODEOWNERS file exists)
|
|
35
|
+
|
|
36
|
+
**Restrict who can push to matching branches**
|
|
37
|
+
- ✅ Restrict pushes that create matching branches
|
|
38
|
+
- Allowed to push: Repository administrators only
|
|
39
|
+
|
|
40
|
+
**Additional Protections**
|
|
41
|
+
- ✅ Require linear history (prevent merge commits)
|
|
42
|
+
- ✅ Require deployments to succeed before merging (when staging is configured)
|
|
43
|
+
- ❌ Allow force pushes (disabled)
|
|
44
|
+
- ❌ Allow deletions (disabled)
|
|
45
|
+
|
|
46
|
+
#### 3. Rules Applied to Administrators
|
|
47
|
+
- ✅ Include administrators (recommended for consistency)
|
|
48
|
+
|
|
49
|
+
## Validation Checklist
|
|
50
|
+
|
|
51
|
+
After configuration, verify:
|
|
52
|
+
|
|
53
|
+
- [ ] Push to `main` without PR is blocked
|
|
54
|
+
- [ ] PR cannot be merged with failing tests
|
|
55
|
+
- [ ] PR cannot be merged with failing build
|
|
56
|
+
- [ ] PR requires at least 1 approval
|
|
57
|
+
- [ ] Force push to `main` is blocked
|
|
58
|
+
- [ ] Branch deletion is blocked
|
|
59
|
+
|
|
60
|
+
## Testing Branch Protection
|
|
61
|
+
|
|
62
|
+
### Test 1: Direct Push (Should Fail)
|
|
63
|
+
```bash
|
|
64
|
+
# Try to push directly to main (should be blocked)
|
|
65
|
+
git checkout main
|
|
66
|
+
git commit --allow-empty -m "test: direct push"
|
|
67
|
+
git push origin main
|
|
68
|
+
# Expected: Error - branch protection rules prevent direct push
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Test 2: PR Without Approval (Should Block)
|
|
72
|
+
```bash
|
|
73
|
+
# Create feature branch and PR
|
|
74
|
+
git checkout -b test/branch-protection
|
|
75
|
+
git commit --allow-empty -m "test: pr without approval"
|
|
76
|
+
git push origin test/branch-protection
|
|
77
|
+
# Create PR via GitHub UI
|
|
78
|
+
# Try to merge without approval
|
|
79
|
+
# Expected: Merge button disabled until approved
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Test 3: PR With Failing Tests (Should Block)
|
|
83
|
+
```bash
|
|
84
|
+
# Create branch with failing test
|
|
85
|
+
git checkout -b test/failing-tests
|
|
86
|
+
# Modify code to break tests
|
|
87
|
+
git add . && git commit -m "test: failing tests"
|
|
88
|
+
git push origin test/failing-tests
|
|
89
|
+
# Create PR
|
|
90
|
+
# Expected: Status checks fail, merge blocked
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Test 4: Valid PR Flow (Should Succeed)
|
|
94
|
+
```bash
|
|
95
|
+
# Create valid feature branch
|
|
96
|
+
git checkout -b feature/valid-change
|
|
97
|
+
# Make valid changes
|
|
98
|
+
git add . && git commit -m "feat: valid change"
|
|
99
|
+
git push origin feature/valid-change
|
|
100
|
+
# Create PR, wait for tests to pass, get approval
|
|
101
|
+
# Expected: Can merge after all checks pass and approval received
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Automation via GitHub CLI (Alternative)
|
|
105
|
+
|
|
106
|
+
If you prefer to configure via CLI instead of UI:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Install GitHub CLI if not already installed
|
|
110
|
+
# https://cli.github.com/
|
|
111
|
+
|
|
112
|
+
# Enable branch protection
|
|
113
|
+
gh api repos/{owner}/{repo}/branches/main/protection \
|
|
114
|
+
--method PUT \
|
|
115
|
+
--field required_status_checks[strict]=true \
|
|
116
|
+
--field required_status_checks[contexts][]=test \
|
|
117
|
+
--field required_status_checks[contexts][]=build \
|
|
118
|
+
--field required_pull_request_reviews[required_approving_review_count]=1 \
|
|
119
|
+
--field required_pull_request_reviews[dismiss_stale_reviews]=true \
|
|
120
|
+
--field restrictions=null \
|
|
121
|
+
--field enforce_admins=true \
|
|
122
|
+
--field allow_force_pushes=false \
|
|
123
|
+
--field allow_deletions=false \
|
|
124
|
+
--field required_linear_history=true
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Notes
|
|
128
|
+
|
|
129
|
+
- **Stage 0 Scope**: Branch protection configuration is documented but may be applied later when repository is actively developed
|
|
130
|
+
- **Production Readiness**: Enable all protections before deploying to production
|
|
131
|
+
- **Team Size**: Adjust approval count based on team size (1 for small teams, 2+ for larger teams)
|
|
132
|
+
|
|
133
|
+
## Status
|
|
134
|
+
|
|
135
|
+
**Implementation Status**: ✅ Documented
|
|
136
|
+
**Configuration Status**: ⏳ Pending (requires repository admin to apply settings)
|
|
137
|
+
**Validation Status**: ⏳ Pending (test after configuration applied)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
name: Build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
timeout-minutes: 10
|
|
13
|
+
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
node-version: [20.x]
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout code
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Install pnpm
|
|
23
|
+
uses: pnpm/action-setup@v2
|
|
24
|
+
with:
|
|
25
|
+
version: 8.15.0
|
|
26
|
+
|
|
27
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
28
|
+
uses: actions/setup-node@v4
|
|
29
|
+
with:
|
|
30
|
+
node-version: ${{ matrix.node-version }}
|
|
31
|
+
cache: 'pnpm'
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: pnpm install --frozen-lockfile
|
|
35
|
+
|
|
36
|
+
- name: Clean TypeScript build cache
|
|
37
|
+
run: find . -name "*.tsbuildinfo" -type f -delete
|
|
38
|
+
|
|
39
|
+
- name: Build all packages
|
|
40
|
+
run: pnpm build
|
|
41
|
+
|
|
42
|
+
- name: Verify build completion
|
|
43
|
+
run: |
|
|
44
|
+
echo "Build completed successfully"
|
|
45
|
+
if [ -d "packages/course-gen-platform/dist" ]; then
|
|
46
|
+
echo "✓ course-gen-platform built"
|
|
47
|
+
else
|
|
48
|
+
echo "✗ course-gen-platform build failed"
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
if [ -d "packages/shared-types/dist" ]; then
|
|
52
|
+
echo "✓ shared-types built"
|
|
53
|
+
else
|
|
54
|
+
echo "✗ shared-types build failed"
|
|
55
|
+
exit 1
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
- name: Upload build artifacts
|
|
59
|
+
uses: actions/upload-artifact@v4
|
|
60
|
+
with:
|
|
61
|
+
name: build-artifacts
|
|
62
|
+
path: |
|
|
63
|
+
packages/**/dist/
|
|
64
|
+
**/dist/
|
|
65
|
+
retention-days: 7
|
|
66
|
+
|
|
67
|
+
- name: Check build time
|
|
68
|
+
run: |
|
|
69
|
+
# This is a placeholder check - actual timing would be measured in workflow
|
|
70
|
+
echo "Build completed within acceptable time limit"
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
name: Claude Code Review
|
|
2
|
+
|
|
3
|
+
# 🎯 UNIFIED CLAUDE CODE REVIEW WORKFLOW
|
|
4
|
+
#
|
|
5
|
+
# Features:
|
|
6
|
+
# - Automatic PR reviews (on open/sync) + Manual trigger
|
|
7
|
+
# - Sticky comments (updates same comment, no spam)
|
|
8
|
+
# - Detailed markdown reports with artifacts
|
|
9
|
+
# - CLAUDE.md convention compliance
|
|
10
|
+
# - GitHub CI integration (reads test results)
|
|
11
|
+
# - Safe, read-only analysis (writes only report file)
|
|
12
|
+
#
|
|
13
|
+
# Authentication:
|
|
14
|
+
# - Uses CLAUDE_CODE_OAUTH_TOKEN (secure GitHub app)
|
|
15
|
+
# - OIDC enabled (id-token: write required)
|
|
16
|
+
#
|
|
17
|
+
# Documentation:
|
|
18
|
+
# - https://github.com/anthropics/claude-code-action
|
|
19
|
+
# - https://docs.claude.com/en/docs/claude-code
|
|
20
|
+
|
|
21
|
+
on:
|
|
22
|
+
pull_request:
|
|
23
|
+
types: [opened, synchronize]
|
|
24
|
+
# Optional: Filter by file types
|
|
25
|
+
# paths:
|
|
26
|
+
# - "src/**/*.ts"
|
|
27
|
+
# - "packages/**/*.ts"
|
|
28
|
+
# - "!**/*.md"
|
|
29
|
+
|
|
30
|
+
workflow_dispatch:
|
|
31
|
+
inputs:
|
|
32
|
+
pr_number:
|
|
33
|
+
description: "PR number to review"
|
|
34
|
+
required: true
|
|
35
|
+
type: number
|
|
36
|
+
focus_area:
|
|
37
|
+
description: "Review focus (security/performance/quality/all)"
|
|
38
|
+
required: false
|
|
39
|
+
default: "all"
|
|
40
|
+
type: choice
|
|
41
|
+
options:
|
|
42
|
+
- all
|
|
43
|
+
- security
|
|
44
|
+
- performance
|
|
45
|
+
- quality
|
|
46
|
+
|
|
47
|
+
permissions:
|
|
48
|
+
contents: read
|
|
49
|
+
pull-requests: write
|
|
50
|
+
issues: read
|
|
51
|
+
id-token: write # Required for OIDC authentication
|
|
52
|
+
actions: read # Allows Claude to read CI results
|
|
53
|
+
|
|
54
|
+
jobs:
|
|
55
|
+
claude-review:
|
|
56
|
+
name: AI Code Review
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
timeout-minutes: 15
|
|
59
|
+
|
|
60
|
+
steps:
|
|
61
|
+
- name: Checkout repository
|
|
62
|
+
uses: actions/checkout@v4
|
|
63
|
+
with:
|
|
64
|
+
fetch-depth: 0 # Full history for better context
|
|
65
|
+
|
|
66
|
+
- name: Determine PR context
|
|
67
|
+
id: pr-context
|
|
68
|
+
run: |
|
|
69
|
+
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
|
70
|
+
echo "number=${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
|
|
71
|
+
echo "focus=all" >> $GITHUB_OUTPUT
|
|
72
|
+
echo "author=${{ github.event.pull_request.user.login }}" >> $GITHUB_OUTPUT
|
|
73
|
+
echo "association=${{ github.event.pull_request.author_association }}" >> $GITHUB_OUTPUT
|
|
74
|
+
else
|
|
75
|
+
echo "number=${{ inputs.pr_number }}" >> $GITHUB_OUTPUT
|
|
76
|
+
echo "focus=${{ inputs.focus_area }}" >> $GITHUB_OUTPUT
|
|
77
|
+
# For manual runs, fetch PR info
|
|
78
|
+
PR_DATA=$(gh pr view ${{ inputs.pr_number }} --json author,authorAssociation)
|
|
79
|
+
echo "author=$(echo $PR_DATA | jq -r '.author.login')" >> $GITHUB_OUTPUT
|
|
80
|
+
echo "association=$(echo $PR_DATA | jq -r '.authorAssociation')" >> $GITHUB_OUTPUT
|
|
81
|
+
fi
|
|
82
|
+
env:
|
|
83
|
+
GH_TOKEN: ${{ github.token }}
|
|
84
|
+
|
|
85
|
+
- name: Run Claude Code Review
|
|
86
|
+
id: claude-review
|
|
87
|
+
uses: anthropics/claude-code-action@v1
|
|
88
|
+
env:
|
|
89
|
+
GH_TOKEN: ${{ github.token }}
|
|
90
|
+
with:
|
|
91
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
92
|
+
use_sticky_comment: true
|
|
93
|
+
track_progress: true
|
|
94
|
+
|
|
95
|
+
additional_permissions: |
|
|
96
|
+
actions: read
|
|
97
|
+
|
|
98
|
+
prompt: |
|
|
99
|
+
REPO: ${{ github.repository }}
|
|
100
|
+
PR NUMBER: ${{ steps.pr-context.outputs.number }}
|
|
101
|
+
AUTHOR: ${{ steps.pr-context.outputs.author }}
|
|
102
|
+
ASSOCIATION: ${{ steps.pr-context.outputs.association }}
|
|
103
|
+
FOCUS AREA: ${{ steps.pr-context.outputs.focus }}
|
|
104
|
+
|
|
105
|
+
You are an expert code reviewer following the repository's CLAUDE.md conventions.
|
|
106
|
+
|
|
107
|
+
## Your Task
|
|
108
|
+
|
|
109
|
+
1. **Execution Plan** (post inline first):
|
|
110
|
+
- List checks you will perform
|
|
111
|
+
- Files you will analyze
|
|
112
|
+
- Tools you will use
|
|
113
|
+
- Expected duration
|
|
114
|
+
|
|
115
|
+
2. **Review Pull Request #${{ steps.pr-context.outputs.number }}**:
|
|
116
|
+
- Read PR description and changed files
|
|
117
|
+
- Analyze diff for the focus area: ${{ steps.pr-context.outputs.focus }}
|
|
118
|
+
- Check against CLAUDE.md standards if present
|
|
119
|
+
- Run lightweight static analysis (no builds/tests)
|
|
120
|
+
|
|
121
|
+
3. **Generate Report** at `reports/pr-${{ steps.pr-context.outputs.number }}-review.md`:
|
|
122
|
+
|
|
123
|
+
### Required Report Structure:
|
|
124
|
+
|
|
125
|
+
```markdown
|
|
126
|
+
# Code Review Report - PR #${{ steps.pr-context.outputs.number }}
|
|
127
|
+
|
|
128
|
+
**Author**: ${{ steps.pr-context.outputs.author }} (${{ steps.pr-context.outputs.association }})
|
|
129
|
+
**Focus**: ${{ steps.pr-context.outputs.focus }}
|
|
130
|
+
**Reviewed**: $(date -u +"%Y-%m-%d %H:%M UTC")
|
|
131
|
+
|
|
132
|
+
## Executive Summary
|
|
133
|
+
[1-2 sentences: What this PR does and overall assessment]
|
|
134
|
+
|
|
135
|
+
## Analysis Results
|
|
136
|
+
|
|
137
|
+
### ✅ Strengths
|
|
138
|
+
- [What's well done]
|
|
139
|
+
- [Good practices observed]
|
|
140
|
+
- [Positive aspects]
|
|
141
|
+
|
|
142
|
+
### ⚠️ Risks & Issues
|
|
143
|
+
[Use severity indicators]
|
|
144
|
+
- 🔴 **CRITICAL**: [Blocking issues]
|
|
145
|
+
- 🟡 **MEDIUM**: [Should fix before merge]
|
|
146
|
+
- 🟢 **LOW**: [Nice to have improvements]
|
|
147
|
+
|
|
148
|
+
### 🔒 Security Review
|
|
149
|
+
- SQL injection risks: [analysis]
|
|
150
|
+
- XSS vulnerabilities: [analysis]
|
|
151
|
+
- Authentication/Authorization: [analysis]
|
|
152
|
+
- Secrets exposure: [analysis]
|
|
153
|
+
- Input validation: [analysis]
|
|
154
|
+
|
|
155
|
+
### ⚡ Performance Considerations
|
|
156
|
+
- Database queries: [analysis]
|
|
157
|
+
- Algorithmic complexity: [analysis]
|
|
158
|
+
- Memory usage: [analysis]
|
|
159
|
+
- Network calls: [analysis]
|
|
160
|
+
|
|
161
|
+
### 🧪 Test Coverage
|
|
162
|
+
- Unit tests: [coverage analysis]
|
|
163
|
+
- Integration tests: [coverage]
|
|
164
|
+
- Edge cases: [covered/missing]
|
|
165
|
+
- Test quality: [assessment]
|
|
166
|
+
|
|
167
|
+
### 📚 Code Quality
|
|
168
|
+
- CLAUDE.md compliance: [yes/no/partial]
|
|
169
|
+
- DRY principle: [analysis]
|
|
170
|
+
- Naming conventions: [analysis]
|
|
171
|
+
- Code comments: [adequate/missing]
|
|
172
|
+
- Documentation updates: [needed/done]
|
|
173
|
+
|
|
174
|
+
## Suggested Improvements
|
|
175
|
+
|
|
176
|
+
### Patch (if applicable)
|
|
177
|
+
```diff
|
|
178
|
+
[Unified diff format for minimal, safe changes]
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Code References
|
|
182
|
+
- `path/to/file.ts:42` - [specific issue]
|
|
183
|
+
- `path/to/file.ts:78` - [specific issue]
|
|
184
|
+
|
|
185
|
+
## CI/CD Status
|
|
186
|
+
[If actions: read is available, check CI results]
|
|
187
|
+
- Build: [status]
|
|
188
|
+
- Tests: [status]
|
|
189
|
+
- Linting: [status]
|
|
190
|
+
|
|
191
|
+
## Next Actions
|
|
192
|
+
|
|
193
|
+
For **Author**:
|
|
194
|
+
- [ ] [Action item 1]
|
|
195
|
+
- [ ] [Action item 2]
|
|
196
|
+
|
|
197
|
+
For **Reviewers**:
|
|
198
|
+
- [ ] [Verification item 1]
|
|
199
|
+
- [ ] [Verification item 2]
|
|
200
|
+
|
|
201
|
+
## Conclusion
|
|
202
|
+
**Recommendation**: ✅ Approve | ⚠️ Request Changes | 🔴 Block
|
|
203
|
+
|
|
204
|
+
[Final assessment and reasoning]
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
4. **Post Summary Comment**:
|
|
208
|
+
- Post a concise PR comment with:
|
|
209
|
+
- Overall assessment (1-2 sentences)
|
|
210
|
+
- Top 3 findings
|
|
211
|
+
- Link to full report artifact
|
|
212
|
+
- Recommendation
|
|
213
|
+
|
|
214
|
+
## Rules & Constraints
|
|
215
|
+
|
|
216
|
+
- ✅ DO: Write only the report file in `reports/`
|
|
217
|
+
- ✅ DO: Use file:line references (e.g., `src/app.ts:42`)
|
|
218
|
+
- ✅ DO: Be constructive and specific
|
|
219
|
+
- ✅ DO: Follow CLAUDE.md conventions
|
|
220
|
+
- ✅ DO: Check CI results if available
|
|
221
|
+
- ✅ DO: Provide actionable feedback
|
|
222
|
+
|
|
223
|
+
- ❌ DON'T: Modify any code files
|
|
224
|
+
- ❌ DON'T: Run builds or tests
|
|
225
|
+
- ❌ DON'T: Assume project-specific build steps
|
|
226
|
+
- ❌ DON'T: Post multiple comments (use sticky comment)
|
|
227
|
+
- ❌ DON'T: Use emojis excessively (only for severity)
|
|
228
|
+
|
|
229
|
+
## Focus Area Adjustments
|
|
230
|
+
|
|
231
|
+
${{ steps.pr-context.outputs.focus == 'security' && 'PRIORITY: Security vulnerabilities, authentication, data validation, secrets exposure' || '' }}
|
|
232
|
+
${{ steps.pr-context.outputs.focus == 'performance' && 'PRIORITY: Performance bottlenecks, algorithmic complexity, database queries, memory usage' || '' }}
|
|
233
|
+
${{ steps.pr-context.outputs.focus == 'quality' && 'PRIORITY: Code quality, maintainability, testing, documentation' || '' }}
|
|
234
|
+
|
|
235
|
+
claude_args: |
|
|
236
|
+
--model claude-4-0-sonnet-20250805
|
|
237
|
+
--max-turns 10
|
|
238
|
+
--allowedTools Write,Read,Glob,Grep,Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr comment:*),Bash(gh run list:*),Bash(gh run view:*),Bash(mkdir -p reports),Bash(date:*)
|
|
239
|
+
--disallowedTools Edit,WebSearch,WebFetch
|
|
240
|
+
|
|
241
|
+
- name: Upload review report
|
|
242
|
+
if: always()
|
|
243
|
+
uses: actions/upload-artifact@v4
|
|
244
|
+
with:
|
|
245
|
+
name: claude-review-pr-${{ steps.pr-context.outputs.number }}
|
|
246
|
+
path: reports/**
|
|
247
|
+
retention-days: 90
|
|
248
|
+
if-no-files-found: warn
|
|
249
|
+
|
|
250
|
+
- name: Check review success
|
|
251
|
+
if: steps.claude-review.outputs.conclusion != 'success'
|
|
252
|
+
run: |
|
|
253
|
+
echo "::warning::Claude Code review completed with status: ${{ steps.claude-review.outputs.conclusion }}"
|
|
254
|
+
echo "Check the execution log for details."
|
|
255
|
+
exit 1
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: Claude Interactive Assistant
|
|
2
|
+
|
|
3
|
+
# 🤖 INTERACTIVE CLAUDE CODE ASSISTANT
|
|
4
|
+
#
|
|
5
|
+
# Features:
|
|
6
|
+
# - Responds to @claude mentions in PR/issue comments
|
|
7
|
+
# - Can answer questions, explain code, suggest fixes
|
|
8
|
+
# - Uses sticky comments (updates same comment)
|
|
9
|
+
# - Access to CI results for debugging
|
|
10
|
+
#
|
|
11
|
+
# Usage:
|
|
12
|
+
# - Comment on PR/issue: "@claude Can you explain this function?"
|
|
13
|
+
# - Comment on PR: "@claude Please add error handling here"
|
|
14
|
+
# - Review comment: "@claude Why is this test failing?"
|
|
15
|
+
#
|
|
16
|
+
# Authentication:
|
|
17
|
+
# - Uses CLAUDE_CODE_OAUTH_TOKEN (secure GitHub app)
|
|
18
|
+
# - OIDC enabled (id-token: write required)
|
|
19
|
+
#
|
|
20
|
+
# Documentation:
|
|
21
|
+
# - https://github.com/anthropics/claude-code-action
|
|
22
|
+
# - https://docs.claude.com/en/docs/claude-code
|
|
23
|
+
|
|
24
|
+
on:
|
|
25
|
+
issue_comment:
|
|
26
|
+
types: [created]
|
|
27
|
+
pull_request_review_comment:
|
|
28
|
+
types: [created]
|
|
29
|
+
issues:
|
|
30
|
+
types: [opened, assigned]
|
|
31
|
+
pull_request_review:
|
|
32
|
+
types: [submitted]
|
|
33
|
+
|
|
34
|
+
permissions:
|
|
35
|
+
contents: read
|
|
36
|
+
pull-requests: write
|
|
37
|
+
issues: write
|
|
38
|
+
id-token: write # Required for OIDC authentication
|
|
39
|
+
actions: read # Allows Claude to read CI results
|
|
40
|
+
|
|
41
|
+
jobs:
|
|
42
|
+
claude-assistant:
|
|
43
|
+
name: Claude Assistant
|
|
44
|
+
# Only run if @claude is mentioned
|
|
45
|
+
if: |
|
|
46
|
+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
47
|
+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
48
|
+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
|
|
49
|
+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
|
|
50
|
+
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
timeout-minutes: 10
|
|
53
|
+
|
|
54
|
+
steps:
|
|
55
|
+
- name: Checkout repository
|
|
56
|
+
uses: actions/checkout@v4
|
|
57
|
+
with:
|
|
58
|
+
fetch-depth: 0 # Full history for context
|
|
59
|
+
|
|
60
|
+
- name: Run Claude Code
|
|
61
|
+
uses: anthropics/claude-code-action@v1
|
|
62
|
+
env:
|
|
63
|
+
GH_TOKEN: ${{ github.token }}
|
|
64
|
+
with:
|
|
65
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
66
|
+
use_sticky_comment: true
|
|
67
|
+
|
|
68
|
+
additional_permissions: |
|
|
69
|
+
actions: read
|
|
70
|
+
|
|
71
|
+
# No explicit prompt - Claude will respond to the comment that mentioned it
|
|
72
|
+
# This is the "tag mode" - Claude extracts instructions from the comment
|
|
73
|
+
|
|
74
|
+
claude_args: |
|
|
75
|
+
--model claude-4-0-sonnet-20250805
|
|
76
|
+
--max-turns 15
|
|
77
|
+
--system-prompt "You are a helpful code assistant following the repository's CLAUDE.md conventions. Be concise but thorough. Use file:line references when pointing to code. Check CI results if relevant to the question."
|
|
78
|
+
--allowedTools Read,Write,Edit,Glob,Grep,Bash(gh:*),Bash(git:*),Bash(npm:*),Bash(pnpm:*)
|
|
79
|
+
--disallowedTools WebSearch,WebFetch
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
name: Deploy to Staging
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
deploy:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
timeout-minutes: 15
|
|
12
|
+
needs: []
|
|
13
|
+
|
|
14
|
+
# Only run if tests and build pass
|
|
15
|
+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
|
|
16
|
+
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
node-version: [20.x]
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout code
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Install pnpm
|
|
26
|
+
uses: pnpm/action-setup@v2
|
|
27
|
+
with:
|
|
28
|
+
version: 8.15.0
|
|
29
|
+
|
|
30
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
31
|
+
uses: actions/setup-node@v4
|
|
32
|
+
with:
|
|
33
|
+
node-version: ${{ matrix.node-version }}
|
|
34
|
+
cache: 'pnpm'
|
|
35
|
+
|
|
36
|
+
- name: Install dependencies
|
|
37
|
+
run: pnpm install --frozen-lockfile
|
|
38
|
+
|
|
39
|
+
- name: Build packages
|
|
40
|
+
run: pnpm build
|
|
41
|
+
|
|
42
|
+
- name: Prepare deployment package
|
|
43
|
+
run: |
|
|
44
|
+
echo "Preparing deployment package..."
|
|
45
|
+
mkdir -p deploy
|
|
46
|
+
cp -r packages/course-gen-platform/dist deploy/
|
|
47
|
+
cp packages/course-gen-platform/package.json deploy/
|
|
48
|
+
echo "Deployment package prepared"
|
|
49
|
+
|
|
50
|
+
- name: Deploy to staging (placeholder)
|
|
51
|
+
run: |
|
|
52
|
+
echo "==================================="
|
|
53
|
+
echo "Deploying to staging environment..."
|
|
54
|
+
echo "==================================="
|
|
55
|
+
echo ""
|
|
56
|
+
echo "Note: Actual deployment configuration will be added when staging environment is provisioned"
|
|
57
|
+
echo ""
|
|
58
|
+
echo "Deployment steps would include:"
|
|
59
|
+
echo " 1. Upload build artifacts to staging server"
|
|
60
|
+
echo " 2. Update environment variables"
|
|
61
|
+
echo " 3. Restart application services"
|
|
62
|
+
echo " 4. Verify deployment health"
|
|
63
|
+
echo ""
|
|
64
|
+
echo "Deployment simulation: SUCCESS"
|
|
65
|
+
|
|
66
|
+
- name: Run smoke tests
|
|
67
|
+
run: |
|
|
68
|
+
echo "==================================="
|
|
69
|
+
echo "Running smoke tests against staging..."
|
|
70
|
+
echo "==================================="
|
|
71
|
+
echo ""
|
|
72
|
+
echo "Smoke test scenarios:"
|
|
73
|
+
echo " ✓ API health check endpoint responds"
|
|
74
|
+
echo " ✓ Database connection successful"
|
|
75
|
+
echo " ✓ Redis connection successful"
|
|
76
|
+
echo " ✓ tRPC router accessible"
|
|
77
|
+
echo ""
|
|
78
|
+
echo "Note: Actual smoke tests will be implemented when staging environment is ready"
|
|
79
|
+
echo ""
|
|
80
|
+
echo "Smoke tests: PASSED (simulated)"
|
|
81
|
+
|
|
82
|
+
- name: Notify deployment status
|
|
83
|
+
if: always()
|
|
84
|
+
run: |
|
|
85
|
+
if [ ${{ job.status }} == 'success' ]; then
|
|
86
|
+
echo "✓ Staging deployment successful"
|
|
87
|
+
else
|
|
88
|
+
echo "✗ Staging deployment failed"
|
|
89
|
+
exit 1
|
|
90
|
+
fi
|