Skip to content

Commit 9e81f4a

Browse files
committed
Merge branch 'feature/beads-centralized-rules-mait-local-override-support'
2 parents 404c2de + d7eb82b commit 9e81f4a

11 files changed

Lines changed: 2118 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Release workflow for centralized-rules
2+
# Triggers on version tags (v*) and creates GitHub releases with assets
3+
#
4+
# Usage: git tag -a v0.1.0 -m "Release v0.1.0" && git push origin v0.1.0
5+
6+
name: Release
7+
8+
on:
9+
push:
10+
tags:
11+
- 'v*'
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
# Run all tests before creating release
18+
test:
19+
name: Validate Release
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Install dependencies
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y jq shellcheck
29+
30+
- name: Run shellcheck on scripts
31+
run: |
32+
shellcheck install-hooks.sh || true
33+
shellcheck sync-ai-rules.sh || true
34+
shellcheck .claude/hooks/activate-rules.sh || true
35+
36+
- name: Run test suite
37+
run: |
38+
chmod +x tests/*.sh
39+
./tests/test-override.sh
40+
./tests/test-override-e2e.sh
41+
42+
- name: Validate install script syntax
43+
run: bash -n install-hooks.sh
44+
45+
# Build release assets
46+
build:
47+
name: Build Release Assets
48+
needs: test
49+
runs-on: ubuntu-latest
50+
outputs:
51+
version: ${{ steps.version.outputs.version }}
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v4
55+
56+
- name: Extract version from tag
57+
id: version
58+
run: |
59+
VERSION=${GITHUB_REF#refs/tags/}
60+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
61+
echo "Building release assets for $VERSION"
62+
63+
- name: Create release tarball
64+
run: |
65+
VERSION=${{ steps.version.outputs.version }}
66+
67+
# Create a clean directory for the release
68+
mkdir -p release-staging
69+
70+
# Copy essential files for the release
71+
cp -r base release-staging/
72+
cp -r languages release-staging/
73+
cp -r frameworks release-staging/
74+
cp -r cloud release-staging/
75+
cp -r lib release-staging/
76+
cp -r .claude release-staging/
77+
cp install-hooks.sh release-staging/
78+
cp sync-ai-rules.sh release-staging/
79+
cp README.md release-staging/
80+
cp LICENSE release-staging/
81+
cp CHANGELOG.md release-staging/
82+
83+
# Create tarball
84+
tar -czvf "centralized-rules-${VERSION}.tar.gz" -C release-staging .
85+
86+
# Copy standalone installer
87+
cp install-hooks.sh "install-hooks-${VERSION}.sh"
88+
89+
- name: Generate checksums
90+
run: |
91+
VERSION=${{ steps.version.outputs.version }}
92+
sha256sum "centralized-rules-${VERSION}.tar.gz" > checksums.txt
93+
sha256sum "install-hooks-${VERSION}.sh" >> checksums.txt
94+
cat checksums.txt
95+
96+
- name: Upload release artifacts
97+
uses: actions/upload-artifact@v4
98+
with:
99+
name: release-assets
100+
path: |
101+
centralized-rules-*.tar.gz
102+
install-hooks-*.sh
103+
checksums.txt
104+
105+
# Create GitHub release
106+
release:
107+
name: Create GitHub Release
108+
needs: build
109+
runs-on: ubuntu-latest
110+
steps:
111+
- name: Checkout code
112+
uses: actions/checkout@v4
113+
114+
- name: Download release artifacts
115+
uses: actions/download-artifact@v4
116+
with:
117+
name: release-assets
118+
119+
- name: Extract changelog for this version
120+
id: changelog
121+
run: |
122+
VERSION=${{ needs.build.outputs.version }}
123+
# Remove 'v' prefix for changelog lookup
124+
VERSION_NUM=${VERSION#v}
125+
126+
# Extract the changelog section for this version
127+
# Looks for ## [version] and captures until next ## or end
128+
CHANGELOG=$(awk -v ver="$VERSION_NUM" '
129+
/^## \[/ {
130+
if (found) exit
131+
if ($0 ~ "\\[" ver "\\]") found=1
132+
}
133+
found {print}
134+
' CHANGELOG.md)
135+
136+
# If no changelog found, use default message
137+
if [ -z "$CHANGELOG" ]; then
138+
CHANGELOG="Release $VERSION"
139+
fi
140+
141+
# Write to file for multiline support
142+
echo "$CHANGELOG" > release_notes.md
143+
echo "Release notes:"
144+
cat release_notes.md
145+
146+
- name: Create GitHub Release
147+
uses: softprops/action-gh-release@v2
148+
with:
149+
name: ${{ needs.build.outputs.version }}
150+
body_path: release_notes.md
151+
draft: false
152+
prerelease: ${{ contains(needs.build.outputs.version, '-') }}
153+
files: |
154+
centralized-rules-*.tar.gz
155+
install-hooks-*.sh
156+
checksums.txt
157+
env:
158+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ All notable changes to centralized-rules will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
---
11+
12+
## [0.1.0] - 2026-01-21
13+
14+
First versioned release with GitHub Releases infrastructure.
15+
16+
### Added
17+
- GitHub Actions release workflow (`.github/workflows/release.yml`)
18+
- Release documentation (`RELEASING.md`)
19+
- Version badge in README
20+
- `--edge` flag for install-hooks.sh (install from main branch)
21+
- `--version` flag for install-hooks.sh (install specific version)
22+
- Automatic latest release detection via GitHub API
23+
24+
### Changed
25+
- install-hooks.sh now fetches from GitHub releases by default
26+
- Falls back to main branch if no releases exist
27+
28+
---
29+
830
## [1.3.1] - 2025-12-21
931

1032
### Fixed

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Centralized AI Development Rules
22

3+
[![Latest Release](https://img.shields.io/github/v/release/paulduvall/centralized-rules?label=latest)](https://github.com/paulduvall/centralized-rules/releases/latest)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
5+
36
Progressive disclosure framework for AI coding tools. Loads only relevant development rules based on project context and task type.
47

58
## Features
@@ -33,6 +36,16 @@ curl -fsSL https://raw.githubusercontent.com/paulduvall/centralized-rules/main/i
3336

3437
No prompts, no conflicts, just works.
3538

39+
**Advanced options:**
40+
41+
```bash
42+
# Install specific version
43+
curl -fsSL https://raw.githubusercontent.com/paulduvall/centralized-rules/main/install-hooks.sh | bash -s -- --version v0.1.0
44+
45+
# Install from main branch (developers/testing)
46+
curl -fsSL https://raw.githubusercontent.com/paulduvall/centralized-rules/main/install-hooks.sh | bash -s -- --edge
47+
```
48+
3649
### What You'll See
3750

3851
Hook displays concise banner showing detected rules:
@@ -155,6 +168,48 @@ Include keywords in prompt: "Write a Python function **with tests**"
155168

156169
## Customization
157170

171+
### Local Rule Overrides
172+
173+
Customize rules for your project without forking:
174+
175+
```bash
176+
# Create override directory
177+
mkdir -p .claude/rules-local/base
178+
179+
# Add project-specific security requirements
180+
cat > .claude/rules-local/base/security.md << 'EOF'
181+
# Additional Security Requirements
182+
- All API endpoints require authentication
183+
- Rate limiting on public routes
184+
EOF
185+
186+
# Sync with overrides applied
187+
./sync-ai-rules.sh --tool claude
188+
```
189+
190+
Configure merge behavior in `.claude/rules-config.local.json`:
191+
192+
```json
193+
{
194+
"merge_strategy": "extend",
195+
"overrides": {
196+
"base/security.md": "replace"
197+
},
198+
"exclude": ["base/chaos-engineering.md"]
199+
}
200+
```
201+
202+
**Merge strategies:**
203+
- `extend` (default): Append local after central
204+
- `replace`: Local completely replaces central
205+
- `prepend`: Local appears before central
206+
207+
Preview changes without applying: `./sync-ai-rules.sh --dry-run`
208+
209+
See [Local Override Documentation](docs/overrides.md) for full reference.
210+
211+
### Keyword Detection
212+
158213
Edit `.claude/skills/skill-rules.json` to add keywords:
159214

160215
```json
@@ -190,6 +245,7 @@ git add .claude/
190245

191246
- [Installation Guide](docs/installation.md) - Setup instructions
192247
- [Hook System](docs/hook-system.md) - Automatic rule loading and quality gates
248+
- [Local Overrides](docs/overrides.md) - Project-level rule customization
193249
- [Classification System](docs/architecture/classification-system.md) - Prompt classification
194250
- [Bash Code Quality](docs/architecture/BASH_BRITTLE_AREAS.md) - Engineering analysis
195251

0 commit comments

Comments
 (0)