Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 0 additions & 11 deletions .actrc

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/ai_pr_review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Claude PR scan (Draft->Ready + Push)

on:
pull_request:
types: [ready_for_review, synchronize, reopened]

concurrency:
group: claude-pr-scan-${{ github.repository }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
review:
if: ${{ github.event.pull_request.draft == false }}
uses: safurrier/python-collab-template/.github/workflows/claude_pr_agent.yml@v1
with:
skill: "codex-code-review"
secrets:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
# Optional: run a local skill from the target repo instead:
# with:
# skill: ".claude/skills/my-custom-review"
# Optional: use a raw prompt instead of a skill file:
# with:
# prompt: |
# Review this diff for security issues only.
44 changes: 0 additions & 44 deletions .github/workflows/ci-debug.yml

This file was deleted.

112 changes: 112 additions & 0 deletions .github/workflows/claude_pr_agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Claude PR agent (skill runner)

on:
workflow_call:
inputs:
skill:
description: |
Skill to run. Either:
- A bare name resolved from this repo's skills/ directory:
"codex-code-review" → skills/codex-code-review/SKILL.md
"context-files" → skills/context-files/SKILL.md
- A target-repo-relative path to a skill directory or file:
".claude/skills/my-skill" → .claude/skills/my-skill/SKILL.md
"./skills/my-skill" → skills/my-skill/SKILL.md
"./skills/my-skill.md" → skills/my-skill.md (flat prompt)
Rule: values containing "/" are resolved from the target repo checkout;
bare names are resolved from this central workflow repo.
type: string
required: false
default: ""
args:
description: |
Substituted for $ARGUMENTS in the skill body.
Example: "auto ." for the context-files skill.
type: string
required: false
default: ""
prompt:
description: |
Raw prompt text used as-is. Alternative to `skill` for quick
one-off instructions without a skill file.
type: string
required: false
default: ""
secrets:
ANTHROPIC_API_KEY:
required: true

jobs:
run-skill:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write

steps:
# Checkout the *target repository* so Claude can read the codebase.
- name: Checkout target repo
uses: actions/checkout@v4

# Checkout this workflow repo to access the skills/ directory.
- name: Checkout workflow repo (for skills)
uses: actions/checkout@v4
with:
repository: safurrier/python-collab-template
path: _ai_workflows

- name: Load skill
id: skill
shell: bash
run: |
SKILL="${{ inputs.skill }}"
ARGS="${{ inputs.args }}"
PROMPT="${{ inputs.prompt }}"

write_output() {
echo "text<<EOF" >> "$GITHUB_OUTPUT"
printf "%s\n" "$1" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
}

# Raw prompt mode — use as-is
if [ -z "$SKILL" ] && [ -n "$PROMPT" ]; then
write_output "$PROMPT"
exit 0
fi

if [ -z "$SKILL" ]; then
echo "Error: either 'skill' or 'prompt' input must be provided." >&2
exit 1
fi

# Resolve skill file path
if [[ "$SKILL" == */* ]]; then
# Contains a slash — path in the target repo
if [ -d "$SKILL" ]; then
skill_file="${SKILL}/SKILL.md" # directory-style skill
else
skill_file="$SKILL" # direct .md file
fi
else
# Bare name — central repo skill
skill_file="_ai_workflows/skills/${SKILL}/SKILL.md"
fi

if [ ! -f "$skill_file" ]; then
echo "Error: skill file not found: $skill_file" >&2
exit 1
fi

# Yank (strip) YAML frontmatter, then substitute $ARGUMENTS
body=$(awk 'BEGIN{fm=0} /^---$/{fm++; next} fm<2{next} {print}' "$skill_file")
body="${body//\$ARGUMENTS/$ARGS}"

write_output "$body"

- name: Run Claude
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: ${{ steps.skill.outputs.text }}
26 changes: 26 additions & 0 deletions .github/workflows/context_files_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Context files agent (PR opened / Draft->Ready)

on:
pull_request:
types: [opened, ready_for_review]

concurrency:
group: context-files-agent-${{ github.repository }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
context-files:
if: ${{ github.event.pull_request.draft == false }}
uses: safurrier/python-collab-template/.github/workflows/claude_pr_agent.yml@v1
with:
skill: "context-files"
args: "auto ."
secrets:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
# Optional: scope to a subdirectory:
# with:
# skill: "context-files"
# args: "auto src/"
# Optional: use a local skill from the target repo:
# with:
# skill: ".claude/skills/context-files"
78 changes: 17 additions & 61 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,38 @@
name: Deploy Documentation
name: Documentation

on:
push:
branches:
- main
branches: [main]
paths:
- 'docs/**'
- 'mkdocs.yml'
- '.github/workflows/docs.yml'
- "docs/**"
- "mkdocs.yml"
pull_request:
branches:
- main
branches: [main]
paths:
- 'docs/**'
- 'mkdocs.yml'

permissions:
contents: write
- "docs/**"
- "mkdocs.yml"

jobs:
deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push'

runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com

- uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Install uv
run: pip install uv

- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV

- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-

- name: Install dependencies
run: uv sync --group dev

- name: Deploy documentation
run: uv run mkdocs gh-deploy --force
python-version: "3.12"
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force

build-check:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Install uv
run: pip install uv

- name: Install dependencies
run: uv sync --group dev

- name: Build documentation
run: uv run mkdocs build --strict

- name: Check build output
run: |
echo "✅ Documentation builds successfully"
echo "📊 Site size: $(du -sh site/ | cut -f1)"
echo "📄 Pages built: $(find site/ -name "*.html" | wc -l)"
python-version: "3.12"
- run: pip install mkdocs-material
- run: mkdocs build --strict
52 changes: 0 additions & 52 deletions .github/workflows/tests.yml

This file was deleted.

Loading