Skip to content

Commit 41868fd

Browse files
author
phernandez
committed
Add contributing docs and github workflows
1 parent a307270 commit 41868fd

7 files changed

Lines changed: 272 additions & 8 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve Basic Memory
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Bug Description
10+
A clear and concise description of what the bug is.
11+
12+
## Steps To Reproduce
13+
Steps to reproduce the behavior:
14+
1. Install version '...'
15+
2. Run command '...'
16+
3. Use tool/feature '...'
17+
4. See error
18+
19+
## Expected Behavior
20+
A clear and concise description of what you expected to happen.
21+
22+
## Actual Behavior
23+
What actually happened, including error messages and output.
24+
25+
## Environment
26+
- OS: [e.g. macOS 14.2, Ubuntu 22.04]
27+
- Python version: [e.g. 3.12.1]
28+
- Basic Memory version: [e.g. 0.1.0]
29+
- Installation method: [e.g. pip, uv, source]
30+
- Claude Desktop version (if applicable):
31+
32+
## Additional Context
33+
- Configuration files (if relevant)
34+
- Logs or screenshots
35+
- Any special configuration or environment variables
36+
37+
## Possible Solution
38+
If you have any ideas on what might be causing the issue or how to fix it, please share them here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Basic Memory Discussions
4+
url: https://github.com/basicmachines-co/basic-memory/discussions
5+
about: For questions, ideas, or more open-ended discussions
6+
- name: Documentation
7+
url: https://github.com/basicmachines-co/basic-memory#readme
8+
about: Please check the documentation first before reporting an issue
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Documentation improvement
3+
about: Suggest improvements or report issues with documentation
4+
title: '[DOCS] '
5+
labels: documentation
6+
assignees: ''
7+
---
8+
9+
## Documentation Issue
10+
Describe what's missing, unclear, or incorrect in the current documentation.
11+
12+
## Location
13+
Where is the problematic documentation? (URL, file path, or section)
14+
15+
## Suggested Improvement
16+
How would you improve this documentation? Please be as specific as possible.
17+
18+
## Additional Context
19+
Any additional information or screenshots that might help explain the issue or improvement.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for Basic Memory
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Feature Description
10+
A clear and concise description of the feature you'd like to see implemented.
11+
12+
## Problem This Feature Solves
13+
Describe the problem or limitation you're experiencing that this feature would address.
14+
15+
## Proposed Solution
16+
Describe how you envision this feature working. Include:
17+
- User workflow
18+
- Interface design (if applicable)
19+
- Technical approach (if you have ideas)
20+
21+
## Alternative Solutions
22+
Have you considered any alternative solutions or workarounds?
23+
24+
## Additional Context
25+
Add any other context, screenshots, or examples about the feature request here.
26+
27+
## Impact
28+
How would this feature benefit you and other users of Basic Memory?

.github/workflows/dco.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: DCO Check
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
jobs:
8+
dco:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out code
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Set up DCO check
17+
uses: dcoapp/app@v1.1.0
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
with:
21+
fail-on-error: true
22+
require-all-contributors: true
23+
require-signoff: true

CONTRIBUTING.md

Lines changed: 150 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,159 @@
11
# Contributing to Basic Memory
22

3-
Thank you for considering contributing to Basic Memory! Your help is greatly appreciated to improve this project.
3+
Thank you for considering contributing to Basic Memory! This document outlines the process for contributing to the project and how to get started as a developer.
44

5-
## How to Contribute
5+
## Getting Started
66

7-
1. **Fork the Repo**: Fork the repository and clone your copy.
8-
1. **Create a Branch**: Create a new branch for your feature or fix.
9-
1. **Test Your Changes**: Ensure tests pass locally and include new tests when necessary to ensure 100& test coverage.
10-
1. **Format Your Code**: Run `make format` to ensure code is formatted appropriately.
11-
4. **Submit a PR**: Submit a pull request with a detailed description of your changes.
7+
### Development Environment
128

13-
Thank You!
9+
1. **Clone the Repository**:
10+
```bash
11+
git clone https://github.com/basicmachines-co/basic-memory.git
12+
cd basic-memory
13+
```
14+
15+
2. **Install Dependencies**:
16+
```bash
17+
# Using make (recommended)
18+
make install
19+
20+
# Or using uv
21+
uv install -e ".[dev]"
22+
23+
# Or using pip
24+
pip install -e ".[dev]"
25+
```
26+
27+
3. **Run the Tests**:
28+
```bash
29+
# Run all tests
30+
make test
31+
# or
32+
uv run pytest -p pytest_mock -v
33+
34+
# Run a specific test
35+
pytest tests/path/to/test_file.py::test_function_name
36+
```
37+
38+
### Development Workflow
39+
40+
1. **Fork the Repo**: Fork the repository on GitHub and clone your copy.
41+
2. **Create a Branch**: Create a new branch for your feature or fix.
42+
```bash
43+
git checkout -b feature/your-feature-name
44+
# or
45+
git checkout -b fix/issue-you-are-fixing
46+
```
47+
3. **Make Your Changes**: Implement your changes with appropriate test coverage.
48+
4. **Check Code Quality**:
49+
```bash
50+
# Run all checks at once
51+
make check
52+
53+
# Or run individual checks
54+
make lint # Run linting
55+
make format # Format code
56+
make type-check # Type checking
57+
```
58+
5. **Test Your Changes**: Ensure all tests pass locally and maintain 100% test coverage.
59+
```bash
60+
make test
61+
```
62+
6. **Submit a PR**: Submit a pull request with a detailed description of your changes.
63+
64+
## LLM-Assisted Development
65+
66+
This project is designed for collaborative development between humans and LLMs (Large Language Models):
67+
68+
1. **CLAUDE.md**: The repository includes a `CLAUDE.md` file that serves as a project guide for both humans and LLMs. This file contains:
69+
- Key project information and architectural overview
70+
- Development commands and workflows
71+
- Code style guidelines
72+
- Documentation standards
73+
74+
2. **AI-Human Collaborative Workflow**:
75+
- We encourage using LLMs like Claude for code generation, reviews, and documentation
76+
- When possible, save context in markdown files that can be referenced later
77+
- This enables seamless knowledge transfer between different development sessions
78+
- Claude can help with implementation details while you focus on architecture and design
79+
80+
3. **Adding to CLAUDE.md**:
81+
- If you discover useful project information or common commands, consider adding them to CLAUDE.md
82+
- This helps all contributors (human and AI) maintain consistent knowledge of the project
83+
84+
## Pull Request Process
85+
86+
1. **Create a Pull Request**: Open a PR against the `main` branch with a clear title and description.
87+
2. **Sign the Developer Certificate of Origin (DCO)**: All contributions require signing our DCO, which certifies that you have the right to submit your contributions. This will be automatically checked by our CLA assistant when you create a PR.
88+
3. **PR Description**: Include:
89+
- What the PR changes
90+
- Why the change is needed
91+
- How you tested the changes
92+
- Any related issues (use "Fixes #123" to automatically close issues)
93+
4. **Code Review**: Wait for code review and address any feedback.
94+
5. **CI Checks**: Ensure all CI checks pass.
95+
6. **Merge**: Once approved, a maintainer will merge your PR.
96+
97+
## Developer Certificate of Origin
98+
99+
By contributing to this project, you agree to the [Developer Certificate of Origin (DCO)](CLA.md). This means you certify that:
100+
- You have the right to submit your contributions
101+
- You're not knowingly submitting code with patent or copyright issues
102+
- Your contributions are provided under the project's license (AGPL-3.0)
103+
104+
This is a lightweight alternative to a Contributor License Agreement and helps ensure that all contributions can be properly incorporated into the project and potentially used in commercial applications.
105+
106+
### Signing Your Commits
107+
108+
You can sign your commits in one of two ways:
109+
110+
1. **Using the `-s` or `--signoff` flag**:
111+
```bash
112+
git commit -s -m "Your commit message"
113+
```
114+
This adds a `Signed-off-by` line to your commit message, certifying that you adhere to the DCO.
115+
116+
2. **Configuring Git to automatically sign off**:
117+
```bash
118+
git config --global alias.cs 'commit -s'
119+
```
120+
Then use `git cs -m "Your commit message"` to commit with sign-off.
121+
122+
The sign-off certifies that you have the right to submit your contribution under the project's license and verifies your agreement to the DCO.
123+
124+
## Code Style Guidelines
125+
126+
- **Python Version**: Python 3.12+ with full type annotations
127+
- **Line Length**: 100 characters maximum
128+
- **Formatting**: Use ruff for consistent styling
129+
- **Import Order**: Standard lib, third-party, local imports
130+
- **Naming**: Use snake_case for functions/variables, PascalCase for classes
131+
- **Documentation**: Add docstrings to public functions, classes, and methods
132+
- **Type Annotations**: Use type hints for all functions and methods
133+
134+
## Testing Guidelines
135+
136+
- **Coverage Target**: We aim for 100% test coverage for all code
137+
- **Test Framework**: Use pytest for unit and integration tests
138+
- **Mocking**: Use pytest-mock for mocking dependencies
139+
- **Edge Cases**: Test both normal operation and edge cases
140+
- **Database Testing**: Use in-memory SQLite for testing database operations
141+
- **Fixtures**: Use pytest fixtures for setup and teardown
142+
143+
## Creating Issues
144+
145+
If you're planning to work on something, please create an issue first to discuss the approach. Include:
146+
147+
- A clear title and description
148+
- Steps to reproduce if reporting a bug
149+
- Expected behavior vs. actual behavior
150+
- Any relevant logs or screenshots
151+
- Your proposed solution, if you have one
14152

15153
## Code of Conduct
16154

17155
All contributors must follow the [Code of Conduct](CODE_OF_CONDUCT.md).
156+
157+
## Thank You!
158+
159+
Your contributions help make Basic Memory better for everyone. We appreciate your time and effort!

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Basic Memory
22

3+
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
4+
[![PyPI version](https://badge.fury.io/py/basic-memory.svg)](https://badge.fury.io/py/basic-memory)
5+
[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
6+
[![Tests](https://github.com/basicmachines-co/basic-memory/workflows/Tests/badge.svg)](https://github.com/basicmachines-co/basic-memory/actions)
7+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
8+
39
```
410
██████╗ █████╗ ███████╗██╗ ██████╗ ███╗ ███╗███████╗███╗ ███╗ ██████╗ ██████╗ ██╗ ██╗
511
██╔══██╗██╔══██╗██╔════╝██║██╔════╝ ████╗ ████║██╔════╝████╗ ████║██╔═══██╗██╔══██╗╚██╗ ██╔╝

0 commit comments

Comments
 (0)