Skip to content

Commit e994950

Browse files
committed
feat: enhance development setup with automatic Git hooks for changelog generation
1 parent b31e26a commit e994950

File tree

5 files changed

+121
-3
lines changed

5 files changed

+121
-3
lines changed

.githooks/pre-commit

100644100755
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ echo "Updating changelog with new entries..."
2424
if [ -f "CHANGELOG.md" ]; then
2525
# Changelog exists, only add new unreleased entries
2626
echo "Existing changelog found. Adding new unreleased entries..."
27-
git-cliff --unreleased --prepend CHANGELOG.md
27+
# Generate unreleased entries and prepend to existing changelog
28+
git-cliff --unreleased --output /tmp/new_entries.md
29+
if [ -s /tmp/new_entries.md ]; then
30+
# If there are new entries, prepend them to existing changelog
31+
cat /tmp/new_entries.md CHANGELOG.md > /tmp/updated_changelog.md
32+
mv /tmp/updated_changelog.md CHANGELOG.md
33+
rm -f /tmp/new_entries.md
34+
fi
2835
else
2936
# No changelog exists, create it from scratch
3037
echo "No existing changelog found. Creating new changelog..."

CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,70 @@
44

55
### 🚀 Features
66

7+
- Add initial documentation and setup files for codebase interface _(2025-10-15)_
8+
- Enhance documentation across multiple files for clarity and usability _(2025-10-15)_
9+
- Enhance MkDocs setup and documentation, add .gitignore for project files _(2025-10-15)_
10+
- Expand documentation in index.md with principles and benefits for users and contributors _(2025-10-15)_
11+
- Add GitHub Actions workflow for deploying MkDocs to GitHub Pages _(2025-10-15)_
12+
- Add benefits documentation for users and contributors, and update navigation _(2025-10-15)_
13+
- Restructure documentation navigation and add tooling section _(2025-10-15)_
14+
- Enhance README with Codebase Interface Principles badges and description _(2025-10-15)_
15+
- Update tooling documentation and add new user and interface sections _(2025-10-15)_
16+
- Add audience documentation for Users, AI Agents, Build Agents, Contributors, and Operators _(2025-10-15)_
17+
- Add initial changelog documentation for primary and secondary audiences _(2025-10-15)_
18+
- Update documentation structure and add language interface section _(2025-10-15)_
19+
- Rename Home section to Welcome in documentation _(2025-10-15)_
20+
- Enhance documentation structure with principles, examples, and audience sections _(2025-10-15)_
21+
- Restructure documentation by moving Welcome content to README and removing index file _(2025-10-16)_
22+
- Restore pull request template with structured guidelines _(2025-10-16)_
23+
- Add CHANGELOG and enhance README with documentation navigation _(2025-10-16)_
24+
- Add commit message validation script for Conventional Commits _(2025-10-16)_
25+
- Enhance changelog generation and update Taskfile with new tasks _(2025-10-16)_
26+
- Enhance changelog generation and update Taskfile with new hooks and tasks _(2025-10-16)_
27+
- Enhance changelog generation and update Taskfile with new hooks _(2025-10-16)_
28+
- Update changelog generation and add pre-commit hook for automatic updates _(2025-10-16)_
29+
- Add interface for contributors to understand outstanding tasks via TODO.md _(2025-10-16)_
30+
31+
### 🐛 Bug Fixes
32+
33+
- Correct spelling error in principles section of index.md _(2025-10-15)_
34+
- Update upload-pages-artifact action to v3 in deploy-docs.yml _(2025-10-15)_
35+
- Clarify instructions for supporting codebase principles in documentation _(2025-10-15)_
36+
- Reorder links in README for better clarity and navigation _(2025-10-16)_
37+
38+
### 💼 Other
39+
40+
- Initial commit _(2025-10-15)_
41+
- Add initial documentation files and pull request template _(2025-10-15)_
42+
- Added pre-commit hook _(2025-10-15)_
43+
- Update tooling.md _(2025-10-16)_
44+
- Merge branch 'main' of https://github.com/codebase-interface/codebaseinterface _(2025-10-16)_
45+
46+
### 🚜 Refactor
47+
48+
- Streamline GitHub Actions workflow for MkDocs deployment _(2025-10-15)_
49+
50+
### 📚 Documentation
51+
52+
- Ensured link opens new tab _(2025-10-15)_
53+
- Updated links to open in new tab and corrected docs github url _(2025-10-15)_
54+
- Updated links open new tab _(2025-10-15)_
55+
- Correcting link syntax _(2025-10-15)_
56+
- Fixing link _(2025-10-15)_
57+
58+
### ⚙️ Miscellaneous Tasks
59+
60+
- Add initial .editorconfig, .gitattributes, and .gitmessage files for consistent coding styles and commit message guidelines _(2025-10-15)_
61+
- Add mention of technical agnostic helper files in AGENTS.md _(2025-10-15)_
62+
- Update AGENTS.md to include guidelines for conventional commits and pull request templates _(2025-10-15)_
63+
- Reorganize Codebase Interfaces section in AGENTS.md for improved clarity _(2025-10-15)_
64+
<!-- generated by git-cliff -->
65+
# Changelog
66+
67+
## [unreleased]
68+
69+
### 🚀 Features
70+
771
- Add initial documentation and setup files for codebase interface _(2025-10-15)_
872
- Enhance documentation across multiple files for clarity and usability _(2025-10-15)_
973
- Enhance MkDocs setup and documentation, add .gitignore for project files _(2025-10-15)_

CONTRIBUTING.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,26 @@ task --version
2222
task --list
2323
```
2424

25-
## Docs
25+
## Development Setup
26+
27+
Run the setup task to configure your development environment:
2628

2729
```bash
28-
pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin
30+
task setup
2931
```
32+
33+
This will:
34+
35+
- Install MkDocs and required plugins
36+
- Configure Git hooks for automatic changelog generation
37+
- Set up pre-commit hooks that follow conventional commits
38+
39+
## Important: Git Hooks
40+
41+
This project uses Git hooks to automatically generate changelog entries from conventional commits. The setup task above configures this automatically, but if you need to set it up manually:
42+
43+
```bash
44+
task setup:hooks
45+
```
46+
47+
Make sure to follow [Conventional Commits](https://conventionalcommits.org) specification in your commit messages for proper changelog generation.

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The codebase interface is a set of principles that aim to promote the ease of us
77
- [Codebase Interface](#codebase-interface)
88
- [Badges](#badges)
99
- [Docs Navigation](#docs-navigation)
10+
- [Quick Start for Contributors](#quick-start-for-contributors)
1011

1112
## Badges
1213

@@ -26,3 +27,23 @@ The codebase interface is a set of principles that aim to promote the ease of us
2627
| [CHANGELOG](CHANGELOG.md) | A log of all notable changes made to this service. |
2728
| [TODO](TODO.md) | Outstanding tasks and ideas for this service. |
2829
| [AGENTS](AGENTS.md) | AI agent based documentation to support with AI assisted tasks. |
30+
31+
## Quick Start for Contributors
32+
33+
To set up the development environment and enable automatic changelog generation:
34+
35+
```bash
36+
# Install dependencies and configure hooks
37+
task setup
38+
39+
# Or manually configure hooks
40+
task setup:hooks
41+
```
42+
43+
This will:
44+
45+
- Install required dependencies (MkDocs, plugins)
46+
- Configure Git to use project hooks for automatic changelog generation
47+
- Enable pre-commit hook that updates CHANGELOG.md automatically
48+
49+
**Note**: The pre-commit hook automatically generates changelog entries from your conventional commits, so make sure to follow the [Conventional Commits](https://conventionalcommits.org) specification.

Taskfile.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,16 @@ tasks:
1818
- pip install mkdocs-material
1919
- pip install mkdocs-git-revision-date-localized-plugin
2020
- pip install pymdown-extensions
21+
- task: setup:hooks
2122
silent: true
2223

24+
setup:hooks:
25+
desc: Configure Git to use project hooks directory
26+
cmds:
27+
- git config core.hooksPath .githooks
28+
- chmod +x .githooks/pre-commit
29+
- echo "Git hooks configured! Pre-commit hook is now active for changelog generation."
30+
2331
build:
2432
desc: Build the MkDocs site
2533
cmds:

0 commit comments

Comments
 (0)