Skip to content

Commit 61eb2f1

Browse files
authored
Merge pull request #64 from alex-feel/alex-feel-dev
Refactor and update docs
2 parents 15da550 + 31458c0 commit 61eb2f1

Some content is hidden

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

48 files changed

+545
-309
lines changed

.github/badges/agents.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"schemaVersion": 1,
3+
"label": "Agents",
4+
"message": "9",
5+
"color": "green"
6+
}

.github/badges/commands.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"schemaVersion": 1,
3+
"label": "Commands",
4+
"message": "6",
5+
"color": "yellow"
6+
}

.github/badges/entity-counts.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"counts": {
3+
"environments": 1,
4+
"env_templates": 1,
5+
"agents": 9,
6+
"agent_templates": 1,
7+
"commands": 6,
8+
"command_templates": 1,
9+
"prompts": 3,
10+
"prompt_templates": 1,
11+
"styles": 6,
12+
"style_templates": 1,
13+
"hooks": 1,
14+
"total_components": 26
15+
},
16+
"badges": {
17+
"environments": {
18+
"label": "Environments",
19+
"message": "1",
20+
"color": "blue"
21+
},
22+
"agents": {
23+
"label": "Agents",
24+
"message": "9",
25+
"color": "green"
26+
},
27+
"commands": {
28+
"label": "Commands",
29+
"message": "6",
30+
"color": "yellow"
31+
},
32+
"prompts": {
33+
"label": "Prompts",
34+
"message": "3",
35+
"color": "orange"
36+
},
37+
"styles": {
38+
"label": "Styles",
39+
"message": "6",
40+
"color": "purple"
41+
},
42+
"hooks": {
43+
"label": "Hooks",
44+
"message": "1",
45+
"color": "red"
46+
},
47+
"total": {
48+
"label": "Total Components",
49+
"message": "26",
50+
"color": "brightgreen"
51+
}
52+
}
53+
}

.github/badges/environments.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"schemaVersion": 1,
3+
"label": "Environments",
4+
"message": "1",
5+
"color": "blue"
6+
}

.github/badges/hooks.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"schemaVersion": 1,
3+
"label": "Hooks",
4+
"message": "1",
5+
"color": "red"
6+
}

.github/badges/prompts.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"schemaVersion": 1,
3+
"label": "Prompts",
4+
"message": "3",
5+
"color": "orange"
6+
}

.github/badges/styles.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"schemaVersion": 1,
3+
"label": "Styles",
4+
"message": "6",
5+
"color": "purple"
6+
}

.github/badges/total.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"schemaVersion": 1,
3+
"label": "Total Components",
4+
"message": "26",
5+
"color": "brightgreen"
6+
}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Update Entity Badges
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'agents/library/**'
9+
- 'environments/library/**'
10+
- 'hooks/library/**'
11+
- 'slash-commands/library/**'
12+
- 'system-prompts/library/**'
13+
- 'output-styles/library/**'
14+
- 'scripts/count_entities.py'
15+
- '.github/workflows/update-badges.yml'
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: write
20+
21+
jobs:
22+
update-badges:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
with:
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Setup Python with uv
32+
uses: astral-sh/setup-uv@v5
33+
with:
34+
version: "latest"
35+
36+
- name: Setup Python 3.12
37+
run: |
38+
uv python install 3.12
39+
uv python pin 3.12
40+
41+
- name: Install dependencies
42+
run: |
43+
uv venv
44+
uv pip install pyyaml
45+
46+
- name: Count entities and generate badge data
47+
run: |
48+
uv run python scripts/count_entities.py
49+
50+
- name: Upload badge data to Gist
51+
id: gist
52+
uses: actions/github-script@v7
53+
with:
54+
github-token: ${{ secrets.GITHUB_TOKEN }}
55+
script: |
56+
const fs = require('fs');
57+
const path = require('path');
58+
59+
// Read the generated badge data
60+
const badgeDir = path.join(process.cwd(), '.github', 'badges');
61+
const files = {};
62+
63+
// Read all JSON files
64+
const fileNames = fs.readdirSync(badgeDir).filter(f => f.endsWith('.json'));
65+
for (const fileName of fileNames) {
66+
const content = fs.readFileSync(path.join(badgeDir, fileName), 'utf8');
67+
files[fileName] = { content };
68+
}
69+
70+
// Get or create gist
71+
const gistId = '${{ secrets.GIST_ID }}'; // Store gist ID as secret after first creation
72+
73+
if (gistId) {
74+
// Update existing gist
75+
await github.rest.gists.update({
76+
gist_id: gistId,
77+
files: files
78+
});
79+
console.log(`Updated gist: ${gistId}`);
80+
} else {
81+
// Create new gist (first run only)
82+
const result = await github.rest.gists.create({
83+
description: 'Claude Code Toolbox Entity Counts',
84+
public: true,
85+
files: files
86+
});
87+
console.log(`Created gist: ${result.data.id}`);
88+
console.log('Add this ID as GIST_ID secret in repository settings');
89+
core.setOutput('gist_id', result.data.id);
90+
}
91+
92+
- name: Commit badge data (alternative approach)
93+
run: |
94+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
95+
git config --local user.name "github-actions[bot]"
96+
97+
# Check if there are changes
98+
if git diff --quiet .github/badges/; then
99+
echo "No changes to badge data"
100+
else
101+
git add .github/badges/
102+
git commit -m "chore: update entity count badges [skip ci]"
103+
git push
104+
fi

.github/workflows/validate-configs.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@ name: Validate Environment Configs
33
on:
44
pull_request:
55
paths:
6-
- 'environments/examples/**/*.yaml'
7-
- 'environments/examples/**/*.yml'
6+
- 'environments/library/**/*.yaml'
7+
- 'environments/library/**/*.yml'
88
- 'environments/templates/**/*.yaml'
99
- 'environments/templates/**/*.yml'
1010
- 'scripts/validate_environment_config.py'
1111
- 'scripts/models/environment_config.py'
1212
- '.github/workflows/validate-configs.yml'
1313

14+
permissions:
15+
contents: read
16+
pull-requests: write
17+
1418
jobs:
15-
validate-pr:
19+
validate:
1620
name: Validate Environment Configurations
1721
runs-on: ubuntu-latest
1822

@@ -57,12 +61,12 @@ jobs:
5761
echo "----------------------------------------"
5862
echo "Validating: $config_file"
5963
60-
# Check if it's a template or example
64+
# Check if it's a template or library config
6165
if [[ "$config_file" == *"templates/"* ]]; then
6266
echo "Note: Template file - allowing placeholder values"
6367
python scripts/validate_environment_config.py "$config_file" || true
6468
else
65-
# Examples must pass strict validation
69+
# Library configs must pass strict validation
6670
if ! python scripts/validate_environment_config.py "$config_file" --strict; then
6771
exit_code=1
6872
fi
@@ -106,7 +110,7 @@ jobs:
106110
Please check the workflow logs for details.
107111
108112
**Note:** Template files in \`environments/templates/\` are allowed to have placeholder values.
109-
Example files in \`environments/examples/\` must be fully valid.
113+
Configuration files in \`environments/library/\` must be fully valid.
110114
111115
To validate locally, run:
112116
\`\`\`bash

0 commit comments

Comments
 (0)