Skip to content

Commit a0d2ec0

Browse files
authored
Add i18n examples and revise the AI integration page for clarity. (#774)
* Add i18n examples and revise the AI integration page for clarity. * fix list numbers * fix yaml identation * fix copy paste error
1 parent 0ba4ce5 commit a0d2ec0

File tree

8 files changed

+149
-142
lines changed

8 files changed

+149
-142
lines changed

CLAUDE.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Repository Overview
6+
7+
This is the gitStream repository - a workflow automation tool for git repositories that allows users to create automated code review workflows using YAML and Jinja2 templates. gitStream processes Continuous Merge (CM) files (`.cm` extension) that define automations for pull/merge requests across GitHub, GitLab, and Bitbucket.
8+
9+
## Development Commands
10+
11+
### Documentation Server
12+
The documentation is built using MkDocs Material theme.
13+
14+
```bash
15+
# Set up Python virtual environment (Python <= 3.10 required)
16+
python -m venv .venv
17+
. ./.venv/bin/activate
18+
19+
# Install dependencies
20+
pip install -r requirements.txt
21+
22+
# Run documentation server locally
23+
mkdocs serve # Runs at http://127.0.0.1:8000/
24+
25+
# Build documentation
26+
mkdocs build
27+
```
28+
29+
## Code Architecture
30+
31+
### Project Structure
32+
- **docs/** - Documentation source files (Markdown)
33+
- `automations/` - Automation examples and library
34+
- `downloads/` - Downloadable CM files and templates
35+
- `integrations/` - Third-party integration documentation
36+
- `screenshots/` - Documentation images
37+
- **plugins/filters/** - JavaScript filter function plugins that extend gitStream capabilities
38+
- Each plugin has its own directory with `index.js`, `README.md`, and optional test files
39+
- Plugins enable custom data processing and external API integrations
40+
- **site/** - Generated documentation site (do not edit directly)
41+
- **automations/** - Example automation configurations
42+
- **tutorials/** - Tutorial projects demonstrating gitStream usage
43+
44+
### Core Concepts
45+
46+
1. **CM Files (.cm)**: YAML + Jinja2 configuration files that define automation rules
47+
- Located in `.cm/` directory at repository root
48+
- Can also be defined at organization level in a special `cm` repository
49+
- Each file must contain `manifest:` and `automations:` sections
50+
51+
2. **Automation Components**:
52+
- **Context Variables**: Pre-defined objects like `files`, `branch`, `repo` providing PR metadata
53+
- **Filter Functions**: Functions applied to variables using pipe operator `|`
54+
- **Automation Actions**: Actions like `add-comment`, `set-required-approvals`, `add-label`
55+
- **Custom Expressions**: Reusable Jinja2 expressions defined in CM files
56+
57+
3. **Plugin System**: JavaScript plugins in `plugins/filters/` that create new filter functions
58+
- Each plugin exports a filter function that can be used in CM files
59+
- Plugins can connect to external APIs or perform complex data processing
60+
61+
### Key Files
62+
- `mkdocs.yml` - Documentation site configuration
63+
- `requirements.txt` - Python dependencies for documentation
64+
- `.cm/*.cm` - Repository-level automation rules
65+
- `docs/downloads/gitstream.cm` - Default automation template
66+
67+
## Important Notes
68+
69+
- When editing CM files, preserve YAML indentation as it's significant
70+
- Organization-level rules can be overridden by repository-level rules with the same identifier
71+
- The identifier is composed of filename + automation name (e.g., `gitstream/safe_changes`)
72+
- gitStream triggers on PR creation and updates by default, with configurable explicit triggers
73+
- Draft PRs are ignored by default (configurable via explicit triggers on GitHub)

docs/automations/integrations/LinearBAI/code-review/README.md

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ category: [quality, genai, efficiency, quickstart]
55
starter_kits: [genai]
66
quickstart: true
77
---
8-
# Code Review Using LinearB's AI :material-star-circle:
8+
# Code Review Using LinearB's AI
99

1010
<!-- --8<-- [start:example]-->
1111
Use LinearB's AI with the [`code-review`](/automation-actions/#code-review) action to automatically review the introduced changes to the code.
@@ -24,8 +24,6 @@ Use LinearB's AI with the [`code-review`](/automation-actions/#code-review) acti
2424
* Perform an AI-driven code review and append the review comments to the PR.
2525
* Use `guidelines` to add your prompts to the team or org review
2626

27-
=== "For GitHub"
28-
2927
!!! example "Configuration Example"
3028
```yaml+jinja
3129
--8<-- "docs/downloads/automation-library/integrations/LinearBAI/code-review.cm"
@@ -36,38 +34,44 @@ Use LinearB's AI with the [`code-review`](/automation-actions/#code-review) acti
3634
</span>
3735
</div>
3836

39-
=== "For GitLab"
37+
#### Localization Support
4038

41-
!!! example "Configuration Example"
42-
```yaml+jinja
43-
--8<-- "docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm"
44-
```
45-
<div class="result" markdown>
46-
<span>
47-
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm){ .md-button }
48-
</span>
49-
</div>
39+
You can request the AI to provide code review comments in your preferred language by adding it to the guidelines:
5040

51-
=== "For Bitbucket"
41+
```yaml+jinja
42+
automations:
43+
linearb_ai_review:
44+
if:
45+
- {{ not pr.draft }}
46+
run:
47+
- action: code-review@v1
48+
args:
49+
guidelines: |
50+
- Use Spanish language for all comments
51+
- Focus on code quality and best practices
52+
```
5253

53-
!!! example "Configuration Example"
54-
```yaml+jinja
55-
--8<-- "docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm"
56-
```
57-
<div class="result" markdown>
58-
<span>
59-
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm){ .md-button }
60-
</span>
61-
</div>
54+
#### Repository rules file example
6255

63-
!!! tip "`./REVIEW_RULES.md` example"
56+
1. Add the rules file to your repo root:
57+
58+
```title="./REVIEW_RULES.md"
59+
- Do not comment on missing documentation.
60+
- Do not comment on missing tests.
61+
- For JavaScript code, enforce using camelCase for variables and functions.
62+
```
6463
65-
This file should be created in your repo root:
64+
2. Load the file in the code review automation:
6665
6766
```
68-
1. Do not comment on missing documentation.
69-
2. Do not comment on missing tests.
70-
3. For JavaScript code, enforce using camelCase for variables and functions.
67+
automations:
68+
linearb_ai_review:
69+
if:
70+
- {{ not pr.draft }}
71+
run:
72+
- action: code-review@v1
73+
args:
74+
guidelines: {{ "./REVIEW_RULES.md" | readFile() | dump }}
7175
```
7276
7377
<!-- --8<-- [end:example]-->

docs/automations/integrations/LinearBAI/describe-pr/README.md

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ category: [quality, genai, efficiency, quickstart]
55
starter_kits: [genai]
66
quickstart: true
77
---
8-
# Add PR Description Using LinearB's AI :material-star-circle:
8+
# PR Description Using LinearB's AI
99

1010
<!-- --8<-- [start:example]-->
1111
Use the [`describe-changes`](/automation-actions/#describe-changes) automation action to automatically generate and append a concise, AI-generated description to a pull request. This ensures that all PRs include meaningful and helpful descriptions, improving review efficiency.
@@ -22,8 +22,6 @@ Use the [`describe-changes`](/automation-actions/#describe-changes) automation a
2222

2323
* Append the AI-generated description to the PR description.
2424

25-
=== "For GitHub"
26-
2725
!!! example "Configuration Example"
2826
```yaml+jinja
2927
--8<-- "docs/downloads/automation-library/integrations/LinearBAI/describe-pr.cm"
@@ -34,29 +32,47 @@ Use the [`describe-changes`](/automation-actions/#describe-changes) automation a
3432
</span>
3533
</div>
3634

37-
=== "For GitLab"
38-
39-
!!! example "Configuration Example"
40-
```yaml+jinja
41-
--8<-- "docs/downloads/automation-library/integrations/LinearBAI/describe-pr-gl.cm"
42-
```
43-
<div class="result" markdown>
44-
<span>
45-
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/describe-pr-gl.cm){ .md-button }
46-
</span>
47-
</div>
35+
#### Localization Support
36+
37+
You can request the AI to add PR descriptions in your preferred language by adding it to the guidelines:
38+
39+
```yaml+jinja
40+
automations:
41+
linearb_ai_desc:
42+
if:
43+
- {{ not pr.draft }}
44+
run:
45+
- action: describe-changes@v1
46+
args:
47+
concat_mode: append
48+
guidelines: |
49+
- Use Korean language for all comments
50+
```
51+
52+
#### Repository rules file example
53+
54+
1. Add the rules file to your repo root:
55+
56+
```title="./DESCRIPTION_RULES.md"
57+
- Add emojis to highlight important changes.
58+
- Use clear and concise language.
59+
- Avoid using jargon or technical terms.
60+
```
61+
62+
2. Load the file in the PR descriptions automation:
63+
64+
```
65+
automations:
66+
linearb_ai_desc:
67+
if:
68+
- {{ not pr.draft }}
69+
run:
70+
- action: describe-changes@v1
71+
args:
72+
concat_mode: append
73+
guidelines: {{ "./DESCRIPTION_RULES.md" | readFile() | dump }}
74+
```
4875
49-
=== "For Bitbucket"
50-
51-
!!! example "Configuration Example"
52-
```yaml+jinja
53-
--8<-- "docs/downloads/automation-library/integrations/LinearBAI/describe-pr-bb.cm"
54-
```
55-
<div class="result" markdown>
56-
<span>
57-
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/describe-pr-bb.cm){ .md-button }
58-
</span>
59-
</div>
6076
<!-- --8<-- [end:example]-->
6177
6278
## Additional Resources

docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm

Lines changed: 0 additions & 27 deletions
This file was deleted.

docs/downloads/automation-library/integrations/LinearBAI/describe-pr-bb.cm

Lines changed: 0 additions & 16 deletions
This file was deleted.

docs/downloads/automation-library/integrations/LinearBAI/describe-pr-gl.cm

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/integrations/LinearBAI.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ category: [quality, genai, copilot, tests, efficiency]
77

88
!!! tip "User Commands"
99

10-
LinearB's AI is available also with user commands, read more about them [here](/user-commands)
10+
LinearB's AI is available also with `/gs` user commands, read more about them [here](/user-commands).
1111

1212
<!-- --8<-- [start:examples]-->
1313

1414
## Automation Examples
1515

16-
### Use LinearB's AI for a comprehensive Code Review :material-star-circle:
16+
### Code Review using LinearB's AI
1717

1818
--8<-- "docs/automations/integrations/LinearBAI/code-review/README.md:example"
1919

20-
### Add PR Description Using LinearB's AI :material-star-circle:
20+
### PR Description Using LinearB's AI
2121

2222
--8<-- "docs/automations/integrations/LinearBAI/describe-pr/README.md:example"
2323

0 commit comments

Comments
 (0)