Skip to content

Commit 76db5b2

Browse files
authored
Merge pull request #4 from sprice/feature/improve-leg-embeddings
✨(legislation): Improve legislation RAG system with enhanced embeddings
2 parents 608d91e + 55a3a35 commit 76db5b2

File tree

118 files changed

+104846
-9737
lines changed

Some content is hidden

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

118 files changed

+104846
-9737
lines changed

.claude/commands/code-review.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Code Review Command
2+
3+
Perform the type of critical code review an expert software engineer and/or an expert software architect would do.
4+
5+
**IMPORTANT** Follow the coding standards and best practices outlined in the
6+
`CLAUDE.md` and `biome.jsonc` files for this review.
7+
8+
## Steps
9+
10+
1. **Check Diff**
11+
12+
- Check the diff between the current branch against `main`
13+
14+
2. **Analyze each file thoroughly**
15+
16+
- For every file in the diff:
17+
- Read the full file content if it's a new/modified file to understand context
18+
- Examine the specific changes line by line from the diff
19+
- Check against project coding standards from CLAUDE.md
20+
- All coding standards are important, but pay special attention to the
21+
Frontend Rules and React coding styles and best practices.
22+
- Identify potential issues:
23+
- Security vulnerabilities or exposed sensitive data
24+
- Performance bottlenecks or inefficiencies
25+
- Logic bugs or edge cases not handled
26+
- Code maintainability and readability concerns
27+
- Missing error handling or validation
28+
- Breaking changes that affect other parts of the codebase
29+
- For each issue found, note the specific file path and line number references
30+
- Assess the broader impact: how changes in each file affect related components,
31+
APIs, database schemas, or user workflows
32+
33+
3. **Create comprehensive review**
34+
35+
- Write a complete and accurate code review document that covers:
36+
- **Executive Summary**: Brief overview of changes, risk level, and key
37+
concerns
38+
- **Files Changed**: List all modified files with change summary
39+
- **Critical Issues**: Security, breaking changes, or major bugs requiring
40+
immediate attention
41+
- **Detailed Analysis**: For each file with issues:
42+
- `### path/to/file.ext`
43+
- **Changes**: What was modified
44+
- **Issues Found**: Specific problems with file:line references
45+
- **Recommendations**: Actionable fixes with code examples where helpful
46+
- **Impact**: How changes affect other parts of the system
47+
- **Overall Assessment**: System-wide impact, testing recommendations,
48+
deployment considerations
49+
- **Action Items**: Prioritized checklist of required fixes and improvements
50+
51+
Be constructive and helpful in your feedback.

.claude/commands/commit.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Commit
2+
3+
Create a well-described commit.
4+
5+
## Steps
6+
7+
1. **Analyze all changes:**
8+
- Run `git status`, `git diff` (unstaged), and `git diff --cached` (staged)
9+
- Review the diffs to understand what changed and why
10+
11+
2. **Review and stage changes:**
12+
- Check for files that should NOT be committed:
13+
- `.env` or files with secrets/API keys
14+
- Log files, temp files, debug output
15+
- Files the user intentionally left unstaged
16+
- If all changes are safe to commit: `git add -A`
17+
- Otherwise, stage selectively: `git add <specific-files>`
18+
19+
3. **Write a commit message that:**
20+
- Uses conventional commit format: `(scope): subject`
21+
- Has an imperative subject under 50 chars (e.g., "Add feature" not "Added feature")
22+
- Includes a body explaining the "why" when the change isn't self-explanatory
23+
- Groups related changes coherently
24+
25+
4. **Commit using HEREDOC:**
26+
```bash
27+
git commit -m "$(cat <<'EOF'
28+
(scope): subject
29+
30+
Body explaining why, if needed.
31+
32+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
33+
34+
Co-Authored-By: Claude <noreply@anthropic.com>
35+
EOF
36+
)"
37+
```
38+
39+
5. **Handle pre-commit hook failures:**
40+
If the commit fails due to pre-commit hook errors:
41+
- Review the error output to understand what failed
42+
- Ask: "Pre-commit hook failed. Fix the errors?" (Yes/No)
43+
- If Yes: Fix the errors, re-stage affected files, and retry the commit
44+
- If No: Abort
45+
46+
6. **Verify and show result:**
47+
- Run `git log -1 --stat` to display the commit
48+
- Confirm the commit was created successfully
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# How to Create a Pull Request Using GitHub CLI
2+
3+
This guide explains how to create pull requests using GitHub CLI in our project.
4+
5+
**Important**: All PR titles and descriptions should be written in English.
6+
7+
## Prerequisites
8+
9+
1. Install GitHub CLI if you haven't already:
10+
11+
```bash
12+
# macOS
13+
brew install gh
14+
15+
# Windows
16+
winget install --id GitHub.cli
17+
18+
# Linux
19+
# Follow instructions at https://github.com/cli/cli/blob/trunk/docs/install_linux.md
20+
```
21+
22+
2. Authenticate with GitHub:
23+
```bash
24+
gh auth login
25+
```
26+
27+
## Creating a New Pull Request
28+
29+
1. First, prepare your PR description following the template in @.github/pull_request_template.md
30+
31+
2. Use the `gh pr create --draft` command to create a new pull request:
32+
33+
```bash
34+
# Create PR with proper template structure
35+
gh pr create --draft --title "✨(scope): Your descriptive title" --body-file .github/pull_request_template.md --base main
36+
```
37+
38+
## Best Practices
39+
40+
1. **Language**: Always use English for PR titles and descriptions
41+
42+
2. **PR Title Format**: Use conventional commit format with emojis
43+
44+
- Always include an appropriate emoji at the beginning of the title
45+
- Use the actual emoji character (not the code representation like `:sparkles:`)
46+
- Examples:
47+
- `✨(supabase): Add staging remote configuration`
48+
- `🐛(auth): Fix login redirect issue`
49+
- `📝(readme): Update installation instructions`
50+
51+
3. **Description Template**: Always use our PR template structure from @.github/pull_request_template.md:
52+
53+
4. **Template Accuracy**: Ensure your PR description precisely follows the template structure:
54+
55+
- Don't modify or rename the PR-Agent sections (`pr_agent:summary` and `pr_agent:walkthrough`)
56+
- Keep all section headers exactly as they appear in the template
57+
- Don't add custom sections that aren't in the template
58+
59+
5. **Draft PRs**: Start as draft when the work is in progress
60+
- Use `--draft` flag in the command
61+
- Convert to ready for review when complete using `gh pr ready`
62+
63+
### Common Mistakes to Avoid
64+
65+
1. **Using Non-English Text**: All PR content must be in English
66+
2. **Incorrect Section Headers**: Always use the exact section headers from the template
67+
3. **Adding Custom Sections**: Stick to the sections defined in the template
68+
4. **Using Outdated Templates**: Always refer to the current @.github/pull_request_template.md file
69+
70+
### Missing Sections
71+
72+
Always include all template sections, even if some are marked as "N/A" or "None"
73+
74+
## Additional GitHub CLI PR Commands
75+
76+
Here are some additional useful GitHub CLI commands for managing PRs:
77+
78+
```bash
79+
# List your open pull requests
80+
gh pr list --author "@me"
81+
82+
# Check PR status
83+
gh pr status
84+
85+
# View a specific PR
86+
gh pr view <PR-NUMBER>
87+
88+
# Check out a PR branch locally
89+
gh pr checkout <PR-NUMBER>
90+
91+
# Convert a draft PR to ready for review
92+
gh pr ready <PR-NUMBER>
93+
94+
# Add reviewers to a PR
95+
gh pr edit <PR-NUMBER> --add-reviewer username1,username2
96+
97+
# Merge a PR
98+
gh pr merge <PR-NUMBER> --squash
99+
```
100+
101+
## Using Templates for PR Creation
102+
103+
To simplify PR creation with consistent descriptions, you can create a template file:
104+
105+
1. Create a file named `pr-template.md` with your PR template
106+
2. Use it when creating PRs:
107+
108+
```bash
109+
gh pr create --draft --title "feat(scope): Your title" --body-file pr-template.md --base main
110+
```
111+
112+
## Related Documentation
113+
114+
- [PR Template](.github/pull_request_template.md)
115+
- [Conventional Commits](https://www.conventionalcommits.org/)
116+
- [GitHub CLI documentation](https://cli.github.com/manual/)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Remove AI comment slop
2+
3+
Check the diff against main, and remove all AI generated slop comments introduced in this branch.
4+
5+
This includes:
6+
- Extra comments that a human wouldn't add or that are inconsistent with the rest of the file
7+
8+
Report at the end with only a 1-3 sentence summary of what you changed

.claude/commands/deslop.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Remove AI code slop
2+
3+
Check the diff against main, and remove all AI generated slop introduced in this branch.
4+
5+
This includes:
6+
- Extra comments that a human wouldn't add or is inconsistent with the rest of the file
7+
- Extra defensive checks or try/catch blocks that are abnormal for that area of the codebase (especially if called by trusted / validated codepaths)
8+
- Casts to any to get around type issues
9+
- Any other style that is inconsistent with the file
10+
11+
Report at the end with only a 1-3 sentence summary of what you changed

.env.example

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,5 @@ LEG_RAG_ENABLED=true
3737
# Truthy values disable RAG caching (useful for development)
3838
RAG_CACHE_DISABLE=
3939

40-
# Fixed status Alert message at the top of `/workbench*` routes
41-
# Ex: NEXT_PUBLIC_SYSTEM_STATUS_MESSAGE="We are currently experiencing degraded service from an upstream provider"
42-
NEXT_PUBLIC_SYSTEM_STATUS_MESSAGE=
40+
# Fixed status message at the top of `/workbench` routes.`
41+
NEXT_PUBLIC_SHOW_SYSTEM_STATUS=true

.github/pull_request_template.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## Summary
2+
3+
<!-- What does this PR do? Keep it concise but complete. -->
4+
5+
## Motivation
6+
7+
<!-- Why is this change needed? What problem does it solve? -->
8+
9+
Closes #<!-- issue number -->
10+
11+
## Type of Change
12+
13+
- [ ] Bug fix (non-breaking change that fixes an issue)
14+
- [ ] New feature (non-breaking change that adds functionality)
15+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
16+
- [ ] Refactor (code change that neither fixes a bug nor adds a feature)
17+
- [ ] Documentation update
18+
- [ ] Test update
19+
- [ ] Chore (dependency updates, config changes, etc.)
20+
21+
## Changes Made
22+
23+
<!-- Bullet point the key changes in this PR -->
24+
25+
-
26+
27+
## Testing
28+
29+
<!-- How did you test these changes? Include steps to reproduce if applicable. -->
30+
31+
- [ ] Tested locally
32+
- [ ] Added/updated tests
33+
- [ ] Verified existing tests pass
34+
35+
## Screenshots
36+
37+
<!-- If this PR includes UI changes, add screenshots or screen recordings here. Delete this section if not applicable. -->
38+
39+
## Checklist
40+
41+
- [ ] My code follows the project's coding standards
42+
- [ ] `pnpm check` passes (lint + type check)
43+
- [ ] I have added tests that prove my fix/feature works
44+
- [ ] New and existing tests pass locally
45+
- [ ] I have updated documentation where needed
46+
- [ ] I have reviewed my own code before requesting review
47+
48+
## Additional Notes
49+
50+
<!-- Any other context, concerns, or things reviewers should know? Delete if not needed. -->

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ data/parliament/openparliament.public.sql
5555
scripts/.embedding-progress.db
5656
scripts/.embedding-progress.db-wal
5757
scripts/.embedding-progress.db-shm
58+
scripts/.leg-embedding-progress.db
59+
scripts/.leg-embedding-progress.db-wal
60+
scripts/.leg-embedding-progress.db-shm
61+
scripts/.leg-import-progress.db
62+
scripts/.leg-import-progress.db-shm
63+
scripts/.leg-import-progress.db-wal
5864

5965
# AI Coding
6066
.plans

0 commit comments

Comments
 (0)