Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit 1b9aa33

Browse files
committed
ci: Add GitHub Action workflow for JSDoc analysis
Creates a workflow that: - Triggers on JavaScript file changes in refactor-core branch - Analyzes changed files for JSDoc coverage - Reports on classes, functions, and existing documentation - Ready to integrate with Claude API when configured This sets up the infrastructure for P1.T011 (comprehensive JSDoc) to be completed automatically via GitHub Actions. When CLAUDE_CODE_OAUTH_TOKEN is added to secrets, uncomment the Claude step to enable automatic PR creation with JSDoc enhancements.
1 parent 2a4d6be commit 1b9aa33

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/claude-jsdoc.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Claude JSDoc Enhancement
2+
3+
on:
4+
push:
5+
branches: [refactor-core]
6+
paths:
7+
- "**/*.js"
8+
- "**/*.mjs"
9+
- "starfleet/**/*.js"
10+
11+
jobs:
12+
analyze-jsdoc:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
pull-requests: write
17+
issues: write
18+
id-token: write
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 2
25+
26+
- name: Get changed files
27+
id: changed-files
28+
run: |
29+
echo "Changed JavaScript files in this push:"
30+
git diff --name-only HEAD^ HEAD | grep -E '\.(js|mjs)$' || echo "No JS files changed"
31+
echo "files=$(git diff --name-only HEAD^ HEAD | grep -E '\.(js|mjs)$' | head -5 | tr '\n' ' ')" >> $GITHUB_OUTPUT
32+
33+
- name: Analyze JSDoc Coverage
34+
if: steps.changed-files.outputs.files != ''
35+
run: |
36+
echo "📚 JSDoc Coverage Analysis for Changed Files"
37+
echo "============================================"
38+
for file in ${{ steps.changed-files.outputs.files }}; do
39+
if [ -f "$file" ]; then
40+
echo ""
41+
echo "File: $file"
42+
echo "Classes: $(grep -c "^class " "$file" || echo 0)"
43+
echo "Functions: $(grep -c "^function \|^async function" "$file" || echo 0)"
44+
echo "Existing JSDoc: $(grep -c "/\*\*" "$file" || echo 0)"
45+
fi
46+
done
47+
echo ""
48+
echo "This workflow detected changed JavaScript files."
49+
echo "In production, Claude would analyze these and create a PR with JSDoc enhancements."
50+
51+
# Uncomment when Claude is configured:
52+
# - name: Run Claude JSDoc Enhancement
53+
# if: steps.changed-files.outputs.files != ''
54+
# uses: anthropics/claude-code-action@v1
55+
# with:
56+
# claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
57+
# prompt: |
58+
# Analyze these JavaScript files and add comprehensive JSDoc where missing:
59+
# ${{ steps.changed-files.outputs.files }}
60+
#
61+
# Follow the patterns from docs/decisions/000-javascript-not-typescript.md
62+
# Create a PR with the enhancements.
63+
# claude_args: '--allowed-tools "Read,Edit,MultiEdit,Bash(gh pr create:*)"'

0 commit comments

Comments
 (0)