Skip to content

Commit f6abc67

Browse files
committed
feat: initial commit - Claude Code documentation mirror
0 parents  commit f6abc67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+21403
-0
lines changed

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
types:
11+
- closed
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: write
16+
issues: write
17+
pull-requests: write
18+
19+
jobs:
20+
release:
21+
name: Release
22+
runs-on: ubuntu-latest
23+
# Only run on direct pushes to main or when PRs are merged
24+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Setup Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: '20'
37+
cache: 'npm'
38+
39+
- name: Install dependencies
40+
run: npm ci
41+
42+
- name: Make scripts executable
43+
run: chmod +x scripts/bin/*.sh
44+
45+
- name: Release
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
run: npx semantic-release

.github/workflows/update-docs.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Update Claude Code Documentation
2+
3+
on:
4+
schedule:
5+
# Run every 3 hours (at 00:00, 03:00, 06:00, 09:00, 12:00, 15:00, 18:00, 21:00 UTC)
6+
- cron: '0 */3 * * *'
7+
workflow_dispatch: # Allow manual trigger
8+
9+
permissions:
10+
contents: write
11+
issues: write
12+
13+
jobs:
14+
update-docs:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
ref: main
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.11'
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -r scripts/requirements.txt
33+
34+
- name: Fetch latest documentation
35+
id: fetch-docs
36+
env:
37+
GITHUB_REPOSITORY: ${{ github.repository }}
38+
GITHUB_REF_NAME: ${{ github.ref_name }}
39+
run: |
40+
python scripts/fetch_claude_docs.py || echo "fetch_failed=true" >> $GITHUB_OUTPUT
41+
continue-on-error: true
42+
43+
- name: Check for changes
44+
id: verify-changed-files
45+
run: |
46+
git diff --exit-code || echo "changed=true" >> $GITHUB_OUTPUT
47+
48+
- name: Generate commit message
49+
if: steps.verify-changed-files.outputs.changed == 'true'
50+
id: commit-msg
51+
run: |
52+
# Stage changes to see what will be committed
53+
git add -A docs/
54+
55+
# Get list of changed files
56+
CHANGED_FILES=$(git diff --name-status --cached | grep "^M" | cut -f2 | grep -E "\.md$" | sed 's/docs\///' | paste -sd ", " -)
57+
ADDED_FILES=$(git diff --name-status --cached | grep "^A" | cut -f2 | grep -E "\.md$" | sed 's/docs\///' | paste -sd ", " -)
58+
DELETED_FILES=$(git diff --name-status --cached | grep "^D" | cut -f2 | grep -E "\.md$" | sed 's/docs\///' | paste -sd ", " -)
59+
60+
# Build commit message
61+
COMMIT_MSG="Update Claude Code docs - $(date +'%Y-%m-%d')"
62+
63+
if [ -n "$CHANGED_FILES" ]; then
64+
COMMIT_MSG="$COMMIT_MSG | Updated: $CHANGED_FILES"
65+
fi
66+
67+
if [ -n "$ADDED_FILES" ]; then
68+
COMMIT_MSG="$COMMIT_MSG | Added: $ADDED_FILES"
69+
fi
70+
71+
if [ -n "$DELETED_FILES" ]; then
72+
COMMIT_MSG="$COMMIT_MSG | Removed: $DELETED_FILES"
73+
fi
74+
75+
echo "message=$COMMIT_MSG" >> $GITHUB_OUTPUT
76+
77+
- name: Commit and push if changed
78+
if: steps.verify-changed-files.outputs.changed == 'true'
79+
run: |
80+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
81+
git config --local user.name "github-actions[bot]"
82+
# Files already staged in previous step
83+
git commit -m "${{ steps.commit-msg.outputs.message }}"
84+
git push
85+
86+
- name: Create issue on failure
87+
if: steps.fetch-docs.outputs.fetch_failed == 'true'
88+
uses: actions/github-script@v7
89+
with:
90+
script: |
91+
const date = new Date().toISOString().split('T')[0];
92+
await github.rest.issues.create({
93+
owner: context.repo.owner,
94+
repo: context.repo.repo,
95+
title: `Documentation update failed - ${date}`,
96+
body: `The automated documentation update failed on ${date}.\n\nPlease check the [workflow run](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}) for details.`,
97+
labels: ['bug', 'automation']
98+
})

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
.venv/
8+
venv/
9+
ENV/
10+
env/
11+
12+
# Node/npm
13+
node_modules/
14+
npm-debug.log*
15+
yarn-error.log*
16+
.npm
17+
18+
# IDE
19+
.vscode/
20+
.idea/
21+
*.swp
22+
*.swo
23+
*~
24+
25+
# OS
26+
.DS_Store
27+
Thumbs.db
28+
29+
# Project specific
30+
*.log
31+
.claude/settings.local.json
32+
.last_pull
33+
.last_check
34+
CLAUDE.md
35+
36+
# Test files
37+
test_*.txt
38+
test_*.md
39+
*.test
40+
*.tmp

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit "$1"

.husky/pre-commit

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Run any linting or formatting checks here
2+
echo "Running pre-commit checks..."
3+
4+
# Check if scripts are executable
5+
if [ -d "scripts/bin" ]; then
6+
chmod +x scripts/bin/*.sh
7+
fi

.releaserc.json

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
[
5+
"@semantic-release/commit-analyzer",
6+
{
7+
"preset": "conventionalcommits",
8+
"releaseRules": [
9+
{"type": "feat", "release": "minor"},
10+
{"type": "fix", "release": "patch"},
11+
{"type": "perf", "release": "patch"},
12+
{"type": "docs", "scope": "README", "release": "patch"},
13+
{"type": "chore", "scope": "deps", "release": "patch"},
14+
{"type": "refactor", "release": "patch"},
15+
{"breaking": true, "release": "major"}
16+
]
17+
}
18+
],
19+
[
20+
"@semantic-release/release-notes-generator",
21+
{
22+
"preset": "conventionalcommits",
23+
"presetConfig": {
24+
"types": [
25+
{"type": "feat", "section": "✨ Features"},
26+
{"type": "fix", "section": "🐛 Bug Fixes"},
27+
{"type": "perf", "section": "⚡ Performance"},
28+
{"type": "docs", "section": "📚 Documentation"},
29+
{"type": "chore", "section": "🔧 Maintenance"},
30+
{"type": "refactor", "section": "♻️ Code Refactoring"}
31+
]
32+
}
33+
}
34+
],
35+
[
36+
"@semantic-release/changelog",
37+
{
38+
"changelogFile": "CHANGELOG.md"
39+
}
40+
],
41+
[
42+
"@semantic-release/exec",
43+
{
44+
"prepareCmd": "bash scripts/bin/update-version.sh ${nextRelease.version}"
45+
}
46+
],
47+
[
48+
"@semantic-release/git",
49+
{
50+
"assets": [
51+
"CHANGELOG.md",
52+
"package.json",
53+
"package-lock.json",
54+
"scripts/bin/install.sh",
55+
"scripts/bin/claude-docs-helper.sh",
56+
"scripts/bin/uninstall.sh",
57+
"scripts/bin/update-version.sh",
58+
"README.md"
59+
],
60+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
61+
}
62+
],
63+
[
64+
"@semantic-release/github",
65+
{
66+
"assets": [
67+
{
68+
"path": "scripts/bin/install.sh",
69+
"label": "Installer Script (Direct Download)",
70+
"name": "install.sh"
71+
}
72+
]
73+
}
74+
]
75+
]
76+
}

LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Martin Nestorov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
23+
---
24+
25+
Note: This license applies to the mirroring tool and scripts in this repository.
26+
The documentation content itself belongs to Anthropic and is subject to their
27+
terms of use.

0 commit comments

Comments
 (0)