Skip to content

Commit 1d2d811

Browse files
committed
chore: restore .husky and .roo files accidentally dropped during upstream merge
These 50 files were deleted in 0a3f847 ("Merge upstream/main — sync to v3.58.0") during squash-merge conflict resolution, leaving the fork diverged from upstream. Restored from upstream/main to match exactly. Add .prettierignore to exclude .husky/ and .roo/ from formatting, ensuring these upstream-managed files stay identical to their source. Restores: .husky/pre-commit, pre-push (2 files) .roo/commands, guidance, rules, rules-*, skills (48 files)
1 parent dcd026a commit 1d2d811

51 files changed

Lines changed: 5951 additions & 0 deletions

Some content is hidden

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

.husky/pre-commit

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
branch="$(git rev-parse --abbrev-ref HEAD)"
2+
3+
if [ "$branch" = "main" ]; then
4+
echo "You can't commit directly to main - please check out a branch."
5+
exit 1
6+
fi
7+
8+
# Detect if running on Windows and use pnpm.cmd, otherwise use pnpm.
9+
if [ "$OS" = "Windows_NT" ]; then
10+
pnpm_cmd="pnpm.cmd"
11+
else
12+
if command -v pnpm >/dev/null 2>&1; then
13+
pnpm_cmd="pnpm"
14+
else
15+
pnpm_cmd="npx pnpm"
16+
fi
17+
fi
18+
19+
# Detect if running on Windows and use npx.cmd, otherwise use npx.
20+
if [ "$OS" = "Windows_NT" ]; then
21+
npx_cmd="npx.cmd"
22+
else
23+
npx_cmd="npx"
24+
fi
25+
26+
$npx_cmd lint-staged
27+
$pnpm_cmd lint

.husky/pre-push

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
branch="$(git rev-parse --abbrev-ref HEAD)"
2+
3+
if [ "$branch" = "main" ]; then
4+
echo "You can't push directly to main - please check out a branch."
5+
exit 1
6+
fi
7+
8+
# Detect if running on Windows and use pnpm.cmd, otherwise use pnpm.
9+
if [ "$OS" = "Windows_NT" ]; then
10+
pnpm_cmd="pnpm.cmd"
11+
else
12+
if command -v pnpm >/dev/null 2>&1; then
13+
pnpm_cmd="pnpm"
14+
else
15+
pnpm_cmd="npx pnpm"
16+
fi
17+
fi
18+
19+
$pnpm_cmd run check-types
20+
21+
# Use dotenvx to securely load .env.local and run commands that depend on it
22+
if [ -f ".env.local" ]; then
23+
# Check if RUN_TESTS_ON_PUSH is set to true and run tests with dotenvx
24+
if npx dotenvx get RUN_TESTS_ON_PUSH -f .env.local 2>/dev/null | grep -q "^true$"; then
25+
npx dotenvx run -f .env.local -- $pnpm_cmd run test
26+
fi
27+
else
28+
# Fallback: run tests if RUN_TESTS_ON_PUSH is set in regular environment
29+
if [ "$RUN_TESTS_ON_PUSH" = "true" ]; then
30+
$pnpm_cmd run test
31+
fi
32+
fi
33+
34+
# Check for new changesets.
35+
NEW_CHANGESETS=$(find .changeset -name "*.md" ! -name "README.md" | wc -l | tr -d ' ')
36+
echo "Changeset files: $NEW_CHANGESETS"
37+
38+
if [ "$NEW_CHANGESETS" = "0" ]; then
39+
echo "-------------------------------------------------------------------------------------"
40+
echo "Changes detected. Please run 'pnpm changeset' to create a changeset if applicable."
41+
echo "-------------------------------------------------------------------------------------"
42+
fi

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.husky/
2+
.roo/

.roo/commands/cli-release.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
description: "Prepare a new release of the Roo Code CLI"
3+
argument-hint: "[version-description]"
4+
mode: code
5+
---
6+
7+
1. Identify changes since the last CLI release:
8+
9+
- Get the last CLI release tag: `gh release list --limit 10 | grep "cli-v"`
10+
- View changes since last release: `git log cli-v<last-version>..HEAD -- apps/cli --oneline`
11+
- Or for uncommitted changes: `git diff --stat -- apps/cli`
12+
13+
2. Review and summarize the changes to determine an appropriate changelog entry. Group changes by type:
14+
15+
- **Added**: New features
16+
- **Changed**: Changes to existing functionality
17+
- **Fixed**: Bug fixes
18+
- **Removed**: Removed features
19+
- **Tests**: New or updated tests
20+
21+
3. Bump the version in `apps/cli/package.json`:
22+
23+
- Increment the patch version (e.g., 0.0.43 → 0.0.44) for bug fixes and minor changes
24+
- Increment the minor version (e.g., 0.0.43 → 0.1.0) for new features
25+
- Increment the major version (e.g., 0.0.43 → 1.0.0) for breaking changes
26+
27+
4. Update `apps/cli/CHANGELOG.md` with a new entry:
28+
29+
- Add a new section at the top (below the header) following this format:
30+
31+
```markdown
32+
## [X.Y.Z] - YYYY-MM-DD
33+
34+
### Added
35+
36+
- Description of new features
37+
38+
### Changed
39+
40+
- Description of changes
41+
42+
### Fixed
43+
44+
- Description of bug fixes
45+
```
46+
47+
- Use the current date in YYYY-MM-DD format
48+
- Include links to relevant source files where helpful
49+
- Describe changes from the user's perspective
50+
51+
5. Create a release branch and commit the changes:
52+
53+
```bash
54+
# Ensure you're on main and up to date
55+
git checkout main
56+
git pull origin main
57+
58+
# Create a new branch for the release
59+
git checkout -b cli-release-v<version>
60+
61+
# Commit the version bump and changelog update
62+
git add apps/cli/package.json apps/cli/CHANGELOG.md
63+
git commit -m "chore(cli): prepare release v<version>"
64+
65+
# Push the branch to origin
66+
git push -u origin cli-release-v<version>
67+
```
68+
69+
6. Create a pull request for the release:
70+
71+
```bash
72+
gh pr create --title "chore(cli): prepare release v<version>" \
73+
--body "## CLI Release v<version>
74+
75+
This PR prepares the CLI release v<version>.
76+
77+
### Changes
78+
- Version bump in package.json
79+
- Changelog update
80+
81+
### Checklist
82+
- [ ] Version number is correct
83+
- [ ] Changelog entry is complete and accurate
84+
- [ ] All CI checks pass" \
85+
--base main
86+
```

.roo/commands/commit.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
description: "Commit and push changes with a descriptive message"
3+
argument-hint: "[optional-context]"
4+
mode: code
5+
---
6+
7+
1. Analyze the current changes to understand what needs to be committed:
8+
9+
```bash
10+
# Check for staged and unstaged changes
11+
git status --short
12+
13+
# View the diff of all changes (staged and unstaged)
14+
git diff HEAD
15+
```
16+
17+
2. Based on the diff output, formulate a commit message following conventional commit format:
18+
19+
- **feat**: New feature or functionality
20+
- **fix**: Bug fix
21+
- **refactor**: Code restructuring without behavior change
22+
- **docs**: Documentation changes
23+
- **test**: Adding or updating tests
24+
- **chore**: Maintenance tasks, dependencies, configs
25+
- **style**: Formatting, whitespace, no logic changes
26+
27+
Format: `type(scope): brief description`
28+
29+
Examples:
30+
31+
- `feat(api): add user authentication endpoint`
32+
- `fix(ui): resolve button alignment on mobile`
33+
- `refactor(core): simplify error handling logic`
34+
- `docs(readme): update installation instructions`
35+
36+
3. Stage all unstaged changes:
37+
38+
```bash
39+
git add -A
40+
```
41+
42+
4. Commit with the generated message:
43+
44+
```bash
45+
git commit -m "type(scope): brief description"
46+
```
47+
48+
**If pre-commit hooks fail:**
49+
50+
- Review the error output (linter errors, type checking errors, etc.)
51+
- Fix the identified issues in the affected files
52+
- Re-stage the fixes: `git add -A`
53+
- Retry the commit: `git commit -m "type(scope): brief description"`
54+
55+
5. Push to the remote repository:
56+
57+
```bash
58+
git push
59+
```
60+
61+
**If pre-push hooks fail:**
62+
63+
- Review the error output (test failures, linter errors, etc.)
64+
- Fix the identified issues in the affected files
65+
- Stage and commit the fixes using steps 3-4
66+
- Retry the push: `git push`
67+
68+
**Tips for good commit messages:**
69+
70+
- Keep the first line under 72 characters
71+
- Use imperative mood ("add", "fix", "update", not "added", "fixes", "updated")
72+
- Be specific but concise
73+
- If multiple unrelated changes exist, consider splitting into separate commits
74+
75+
**Common hook failures and fixes:**
76+
77+
- **Linter errors**: Run the project's linter (e.g., `npm run lint` or `pnpm lint`) to see all issues, then fix them
78+
- **Type checking errors**: Run type checker (e.g., `npx tsc --noEmit`) to identify type issues
79+
- **Test failures**: Run tests (e.g., `npm test` or `pnpm test`) to identify failing tests and fix them
80+
- **Format issues**: Run formatter (e.g., `npm run format` or `pnpm format`) to auto-fix formatting
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
description: "Resolve merge conflicts intelligently using git history analysis"
3+
argument-hint: "#PR-number"
4+
mode: merge-resolver
5+
---
6+
7+
Resolve merge conflicts for a specific pull request by analyzing git history, commit messages, and code changes to make intelligent resolution decisions.
8+
9+
## Quick Start
10+
11+
1. **Provide a PR number** (e.g., `#123` or just `123`)
12+
13+
2. The workflow will automatically:
14+
- Fetch PR information (title, description, branches)
15+
- Checkout the PR branch
16+
- Rebase onto the target branch to reveal conflicts
17+
- Analyze and resolve conflicts using git history
18+
19+
## Workflow Steps
20+
21+
### 1. Initialize PR Resolution
22+
23+
```bash
24+
# Fetch PR info
25+
gh pr view [PR_NUMBER] --json title,body,headRefName,baseRefName
26+
27+
# Checkout and rebase
28+
gh pr checkout [PR_NUMBER] --force
29+
git fetch origin main
30+
GIT_EDITOR=true git rebase origin/main
31+
```
32+
33+
### 2. Identify Conflicts
34+
35+
```bash
36+
git status --porcelain | grep "^UU"
37+
```
38+
39+
### 3. Analyze Each Conflict
40+
41+
For each conflicted file:
42+
- Read the conflict markers
43+
- Run `git blame` on conflicting sections
44+
- Fetch commit messages for context
45+
- Determine the intent behind each change
46+
47+
### 4. Apply Resolution Strategy
48+
49+
Based on the analysis:
50+
- **Bugfixes** generally take precedence over features
51+
- **Recent changes** are often more relevant (unless older is a security fix)
52+
- **Combine** non-conflicting changes when possible
53+
- **Preserve** test updates alongside code changes
54+
55+
### 5. Complete Resolution
56+
57+
```bash
58+
git add [resolved-files]
59+
GIT_EDITOR=true git rebase --continue
60+
```
61+
62+
## Key Guidelines
63+
64+
- Always escape conflict markers with `\` when using `apply_diff`
65+
- Document resolution decisions in the summary
66+
- Verify no syntax errors after resolution
67+
- Preserve valuable changes from both sides when possible
68+
69+
## Examples
70+
71+
- `/roo-resolve-conflicts #123` - Resolve conflicts for PR #123
72+
- `/roo-resolve-conflicts 456` - Resolve conflicts for PR #456

.roo/commands/roo-translate.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
description: "Translate and localize strings in the Roo Code extension"
3+
argument-hint: "[language-code or 'all'] [string-key or file-path]"
4+
mode: translate
5+
---
6+
7+
Perform translation and localization tasks for the Roo Code extension. This command activates the translation workflow with comprehensive i18n guidelines.
8+
9+
## Quick Start
10+
11+
1. **Identify the translation scope:**
12+
- If a specific language code is provided (e.g., `de`, `zh-CN`), focus on that language
13+
- If `all` is specified, translate to all supported languages
14+
- If a string key is provided, locate and translate that specific string
15+
- If a file path is provided, work with that translation file
16+
17+
2. **Supported languages:** ca, de, en, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW
18+
19+
3. **Translation locations:**
20+
- Core Extension: `src/i18n/locales/`
21+
- WebView UI: `webview-ui/src/i18n/locales/`
22+
23+
## Workflow
24+
25+
1. If adding new strings:
26+
- Add the English string first
27+
- Ask for confirmation before translating to other languages
28+
- Use `apply_diff` for efficient file updates
29+
30+
2. If updating existing strings:
31+
- Identify all affected language files
32+
- Update English first, then propagate changes
33+
34+
3. Validate your changes:
35+
```bash
36+
node scripts/find-missing-translations.js
37+
```
38+
39+
## Key Guidelines
40+
41+
- Use informal speech (e.g., "du" not "Sie" in German)
42+
- Keep technical terms like "token", "Prompt" in English
43+
- Preserve all `{{variable}}` placeholders exactly
44+
- Use `apply_diff` instead of `write_to_file` for existing files
45+
46+
## Examples
47+
48+
- `/roo-translate de` - Focus on German translations
49+
- `/roo-translate all welcome.title` - Translate a specific key to all languages
50+
- `/roo-translate zh-CN src/i18n/locales/zh-CN/core.json` - Work on specific file

.roo/guidance/roo-translator.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Roo Code Translation Guidance
2+
3+
This file contains brand voice, tone, and word choice guidelines for Roo Code translations.
4+
5+
## Brand Voice
6+
7+
<!-- Add brand voice guidelines here -->
8+
9+
## Tone
10+
11+
<!-- Add tone guidelines here -->
12+
13+
## Word Choice
14+
15+
<!-- Add word choice preferences here -->

.roo/roomotes.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: "1.0"
2+
3+
commands:
4+
- name: Install dependencies
5+
run: pnpm install
6+
timeout: 60
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# JSON File Writing Must Be Atomic
2+
3+
- You MUST use `safeWriteJson(filePath: string, data: any): Promise<void>` from `src/utils/safeWriteJson.ts` instead of `JSON.stringify` with file-write operations
4+
- `safeWriteJson` will create parent directories if necessary, so do not call `mkdir` prior to `safeWriteJson`
5+
- `safeWriteJson` prevents data corruption via atomic writes with locking and streams the write to minimize memory footprint
6+
- Test files are exempt from this rule

0 commit comments

Comments
 (0)