-
Notifications
You must be signed in to change notification settings - Fork 2
fix: inject ~30k token knowledge base into @claude GitHub Actions (documentation as code) #1185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0594da7
11fe37e
42ebf45
272ee07
77b752a
92a0d3a
43a9f5c
5e48ab9
f76032a
8ba10e5
49c873c
ceb0042
a8cdd45
8871a76
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,4 @@ | ||
| # Close Issue Command Template | ||
| Complete and implement GitHub issue #{{ ISSUE_NUMBER }}. | ||
|
|
||
| ## Core Principle: Target-First Development | ||
| {{ INJECT:principles/tracer-bullets.md }} | ||
|
|
||
| ## Analyze Issue #{{ ISSUE_NUMBER }} | ||
| First, use `mcp__github__get_issue` to understand the issue and determine the appropriate workflow path. | ||
|
|
||
| {{ INJECT:procedures/close-issue-procedure.md }} | ||
|
|
||
| ## Apply to Issue #{{ ISSUE_NUMBER }} | ||
| When following the procedure: | ||
| - Use issue #{{ ISSUE_NUMBER }} for all GitHub API calls | ||
| - Replace <NUMBER> with {{ ISSUE_NUMBER }} in branch names | ||
| - Replace <description> with issue title slug | ||
| - Reference "Closes #{{ ISSUE_NUMBER }}" in PR body | ||
|
|
||
| ## Final Step: Retro | ||
| Let's retro this context and wring out the gleanings. | ||
|
|
||
| {{ INJECT:principles/eager-evolution.md }} | ||
|
|
||
| **Consider capturing any ghost procedures** that emerged during this work - see [Procedure Creation](knowledge/procedures/procedure-creation.md). | ||
|
|
||
| **What would you like to focus on?** | ||
| - Do you have a specific aspect you want to double-click on? | ||
| - Or would you like me to suggest the top 3 areas I predict you'll find most valuable to explore? | ||
| {{ INJECT:knowledge/procedures/close-issue-procedure.md }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| #!/bin/bash | ||
| # Aggregate knowledge base for GitHub Actions | ||
| # This script reads ALL knowledge files (matching Claude Code's behavior) | ||
| # and outputs them as a single text block for injection into Claude's prompt | ||
| # Principle: systems-stewardship | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| # Get the repository root (two levels up from .github/scripts) | ||
| REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" | ||
| KNOWLEDGE_DIR="$REPO_ROOT/knowledge" | ||
|
|
||
| # Start with a header | ||
| echo "# Knowledge Base Context" | ||
| echo "" | ||
| echo "This context is automatically injected to provide Claude with understanding of:" | ||
| echo "- Core development principles and procedures" | ||
| echo "- Personality models for retrospectives" | ||
| echo "- System architecture patterns and tools" | ||
| echo "- The North Star throughput definition" | ||
| echo "" | ||
|
|
||
| # Note: CLAUDE.md is not included here as it's a user-specific file | ||
| # that lives in ~/.claude/CLAUDE.md (not in the repository). | ||
| # GitHub Actions only has access to committed repository files. | ||
|
|
||
| # Process all .md files in knowledge/ recursively to match Claude Code behavior | ||
| # This ensures GitHub Actions has the exact same context as local development | ||
| process_directory() { | ||
| local dir="$1" | ||
| local relative_path="${dir#$KNOWLEDGE_DIR}" | ||
| relative_path="${relative_path#/}" # Remove leading slash if present | ||
|
|
||
| # Process files in current directory first | ||
| for file in "$dir"/*.md; do | ||
| if [[ -f "$file" ]]; then | ||
| filename=$(basename "$file" .md) | ||
|
|
||
| # Skip README files in subdirectories (but include the main one) | ||
| if [[ "$filename" == "README" && "$relative_path" != "" ]]; then | ||
| continue | ||
| fi | ||
|
|
||
| # Create section header based on location | ||
| if [[ "$relative_path" == "" ]]; then | ||
| # Root knowledge files | ||
| title=$(echo "$filename" | sed 's/-/ /g' | sed 's/\b\(.\)/\u\1/g') | ||
| echo "# $title" | ||
| elif [[ "$relative_path" == "principles" ]]; then | ||
| title=$(echo "$filename" | sed 's/-/ /g' | sed 's/\b\(.\)/\u\1/g') | ||
| echo "## Principle: $title" | ||
| elif [[ "$relative_path" == "procedures" ]]; then | ||
| title=$(echo "$filename" | sed 's/-/ /g' | sed 's/\b\(.\)/\u\1/g') | ||
| echo "## Procedure: $title" | ||
| elif [[ "$relative_path" == "personalities" ]]; then | ||
| title=$(echo "$filename" | sed 's/-/ /g' | sed 's/\b\(.\)/\u\1/g') | ||
| echo "## Personality: $title" | ||
| elif [[ "$relative_path" == "tools" ]]; then | ||
| title=$(echo "$filename" | sed 's/-/ /g' | sed 's/\b\(.\)/\u\1/g') | ||
| echo "## Tool: $title" | ||
| else | ||
| # Other directories | ||
| title=$(echo "$filename" | sed 's/-/ /g' | sed 's/\b\(.\)/\u\1/g') | ||
| echo "## $relative_path: $title" | ||
| fi | ||
|
|
||
| echo "" | ||
| cat "$file" | ||
| echo "" | ||
| echo "---" | ||
| echo "" | ||
| fi | ||
| done | ||
|
|
||
| # Process subdirectories | ||
| for subdir in "$dir"/*; do | ||
| if [[ -d "$subdir" ]]; then | ||
| dirname=$(basename "$subdir") | ||
| # Add section header for new directory | ||
| if [[ "$relative_path" == "" ]]; then | ||
| echo "# $(echo "$dirname" | sed 's/\b\(.\)/\u\1/g')" | ||
| echo "" | ||
| fi | ||
| process_directory "$subdir" | ||
| fi | ||
| done | ||
|
atxtechbro marked this conversation as resolved.
|
||
| } | ||
|
|
||
| # Process the entire knowledge directory | ||
| if [[ -d "$KNOWLEDGE_DIR" ]]; then | ||
| process_directory "$KNOWLEDGE_DIR" | ||
| else | ||
| echo "Knowledge directory not found at: $KNOWLEDGE_DIR" | ||
| echo "" | ||
| fi | ||
|
|
||
| # Add a footer note | ||
| echo "" | ||
| echo "# Context Note" | ||
| echo "" | ||
| echo "This knowledge base was automatically aggregated for this GitHub Action workflow." | ||
| echo "Follow these principles and procedures to maintain consistency with the codebase patterns." | ||
| echo "Reference: Principles are in knowledge/principles/, Procedures are in knowledge/procedures/" | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,16 +2,20 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # THE SINGLE SOURCE OF TRUTH for @claude mentions in issues and PRs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This is the ONLY workflow that responds to @claude mentions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Uses the official anthropics/claude-code-action@beta to: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - Implement issues when @claude is mentioned | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Uses the official anthropics/claude-code-base-action@beta to: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - Implement issues when @claude is mentioned WITH FULL KNOWLEDGE BASE CONTEXT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - Review PRs when @claude is mentioned | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - Create branches and push changes with proper permissions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Note: Both claude[bot] and github-actions[bot] comments come from this workflow. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # The bot identity depends on the context and step being executed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # KNOWLEDGE INJECTION: This workflow now aggregates and injects the full knowledge base | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # into Claude's context, providing the same rich context as local /close-issue commands. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Principle: subtraction-creates-value (removed duplicate workflow) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Principle: systems-stewardship (single clear workflow to maintain) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Principle: snowball-method (knowledge persistence and compound improvement) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Claude Implementation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -69,8 +73,64 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: anthropics/claude-code-action@beta | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Aggregate knowledge base | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: knowledge | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Aggregating knowledge base for Claude..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| KNOWLEDGE=$(.github/scripts/aggregate-knowledge.sh) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Use EOF delimiter to handle multi-line content | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "content<<EOF" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "$KNOWLEDGE" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "EOF" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Log size for debugging | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Knowledge base size: $(echo "$KNOWLEDGE" | wc -c) characters" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Prepare implementation prompt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: prepare-prompt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Warning Description: Untrusted input has been detected in GitHub Actions workflow run commands. This creates a significant security risk for script injection attacks, where malicious actors could exploit workflow inputs to execute unauthorized commands. GitHub Actions workflows should validate and sanitize all user-provided inputs, especially those used in run commands. Consider using GitHub's built-in security features like actions/github-script for safer command execution, or implement proper input validation before using dynamic values in run commands. Similar issue at line numbers 93, 94, 95, 96, 97, 98, 99, 100, 101, and 128. Severity: High
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The remediation replaces the vulnerable
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Determine if this is an issue or PR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| IS_ISSUE="${{ github.event.issue && !github.event.issue.pull_request }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "$IS_ISSUE" == "true" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Preparing prompt for issue implementation..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Get issue details | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ISSUE_NUMBER="${{ github.event.issue.number }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ISSUE_TITLE="${{ github.event.issue.title }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ISSUE_BODY="${{ github.event.issue.body }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Load the procedure (which IS the implementation) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TEMPLATE=$(cat knowledge/procedures/close-issue-procedure.md) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Replace placeholders | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PROMPT="${TEMPLATE//\{\{ KNOWLEDGE_BASE \}\}/${{ steps.knowledge.outputs.content }}}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PROMPT="${PROMPT//\{\{ ISSUE_NUMBER \}\}/$ISSUE_NUMBER}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PROMPT="${PROMPT//\{\{ ISSUE_TITLE \}\}/$ISSUE_TITLE}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PROMPT="${PROMPT//\{\{ ISSUE_BODY \}\}/$ISSUE_BODY}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PROMPT="${PROMPT//\{\{ REPO \}\}/${{ github.repository }}}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Preparing prompt for PR review..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # For PR reviews, use the comment directly with knowledge context | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PROMPT="${{ steps.knowledge.outputs.content }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## PR Review Request | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The user has requested: ${{ github.event.comment.body }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Please review and respond to this pull request comment with the full context of the codebase principles and procedures available above." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Output the prompt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "prompt<<EOF" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "$PROMPT" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "EOF" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: anthropics/claude-code-base-action@beta | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| prompt: ${{ steps.prepare-prompt.outputs.prompt }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| allowed_tools: "Bash(*),LS,Read,Write,Edit,MultiEdit,Glob,Grep,Task,TodoWrite,WebFetch(domain:*),WebSearch,mcp__git,mcp__github" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| allowed_tools: "Bash(*),LS,Read,Write,Edit,MultiEdit,Glob,Grep,Task,TodoWrite,WebFetch(domain:*),WebSearch,mcp__git,mcp__github" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| timeout_minutes: "30" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,47 @@ | ||
| # Close Issue Procedure | ||
| # | ||
| # This IS the implementation - the procedure documents itself by being the code. | ||
| # Used by both: | ||
| # - Local /close-issue command (via relative path injection) | ||
| # - GitHub Actions @claude workflow (with knowledge base injection) | ||
| # | ||
| # IMPORTANT: How {{ KNOWLEDGE_BASE }} works: | ||
| # - For GitHub Actions: Gets replaced with aggregated knowledge files via string substitution | ||
| # - For local /close-issue: Remains as literal text "{{ KNOWLEDGE_BASE }}" in the prompt | ||
| # (harmless since knowledge is already preloaded in Claude's context) | ||
| # | ||
| # This is NOT smart placeholder logic - it's simple: | ||
| # - GitHub Actions: Does string replacement: {{ KNOWLEDGE_BASE }} → actual content | ||
| # - Local command: Does NO replacement: {{ KNOWLEDGE_BASE }} → stays as literal text | ||
| # | ||
| # Principle: systems-stewardship (single source of truth, documentation as code) | ||
|
|
||
| Analyze GitHub issues and determine the path: quick close, spike research, or full implementation to PR. | ||
| Complete and implement GitHub issue #{{ ISSUE_NUMBER }}. | ||
|
|
||
| **When to use**: Processing any GitHub issue with the /close-issue command | ||
| **Details**: See [close-issue-guide.md](/.github/ISSUE_TEMPLATE/close-issue-guide.md) | ||
| {{ KNOWLEDGE_BASE }} | ||
| <!-- Note: If you see "{{ KNOWLEDGE_BASE }}" above as literal text, you're running locally and knowledge is already preloaded --> | ||
|
|
||
| ## Core Principle: Target-First Development | ||
| {{ INJECT:principles/tracer-bullets.md }} | ||
|
|
||
| ## Analyze Issue #{{ ISSUE_NUMBER }} | ||
| <!-- This procedure IS the implementation - executable documentation --> | ||
| First, use `mcp__github__get_issue` to understand the issue and determine the appropriate workflow path. | ||
|
|
||
| ## Apply to Issue #{{ ISSUE_NUMBER }} | ||
| When following the procedure: | ||
| - Use issue #{{ ISSUE_NUMBER }} for all GitHub API calls | ||
| - Replace <NUMBER> with {{ ISSUE_NUMBER }} in branch names | ||
| - Replace <description> with issue title slug | ||
| - Reference "Closes #{{ ISSUE_NUMBER }}" in PR body | ||
|
|
||
| ## Final Step: Retro | ||
| Let's retro this context and wring out the gleanings. | ||
|
|
||
| {{ INJECT:principles/eager-evolution.md }} | ||
|
|
||
| **Consider capturing any ghost procedures** that emerged during this work - see [Procedure Creation](knowledge/procedures/procedure-creation.md). | ||
|
|
||
| **What would you like to focus on?** | ||
| - Do you have a specific aspect you want to double-click on? | ||
| - Or would you like me to suggest the top 3 areas I predict you'll find most valuable to explore? |
Uh oh!
There was an error while loading. Please reload this page.