Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 50 additions & 8 deletions .claude/commands/code-review.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Code Review Command

## Trigger Phrases

- "code review"
- "review the code"
- "perform code review"
Expand All @@ -10,20 +11,24 @@
## Instructions

### Prerequisites

1. **Always read CLAUDE.md first** - This contains the tech stack and coding standards
2. **Never modify AGENTS.md** - This file only contains instructions for other coding assistants

### Code Review Process

#### 1. Initial Scan

Analyze the entire codebase focusing on:

- `/src/` - All React/TypeScript frontend code (components, hooks, types)
- `/src-tauri/src/` - All Rust backend code (menu handling, IPC)
- Configuration files: `tauri.conf.json`, `vite.config.ts`, `tsconfig.json`

#### 2. Review Categories (in order of criticality)

**CRITICAL Issues:**

- Security vulnerabilities (XSS in markdown rendering, path traversal in file operations, exposed secrets)
- Tauri command permissions too broad or missing validation
- Unhandled promise rejections or uncaught errors in async operations
Expand All @@ -33,6 +38,7 @@ Analyze the entire codebase focusing on:
- External link handling without security validation

**HIGH Priority:**

- Missing TypeScript documentation comments (TSDoc) on functions and types
- Functions longer than 50 lines that should be split
- Code duplication (same logic in multiple places)
Expand All @@ -43,6 +49,7 @@ Analyze the entire codebase focusing on:
- useState/useEffect hooks that could be extracted to custom hooks

**MEDIUM Priority:**

- Poor naming conventions (not following camelCase/PascalCase/snake_case standards)
- Lack of reusability (logic that could be extracted to utilities/hooks)
- Inconsistent React patterns (mixing class and functional components)
Expand All @@ -53,6 +60,7 @@ Analyze the entire codebase focusing on:
- Large bundle size issues that could benefit from code-splitting

**LOW Priority:**

- Code style inconsistencies (should be caught by ESLint/Prettier)
- Missing comments for complex business logic
- Outdated TODO comments
Expand All @@ -64,6 +72,7 @@ Analyze the entire codebase focusing on:
#### 3. Specific Technology Checks

**Rust Backend (src-tauri/src/):**

- All public functions have Rust doc comments (`///`)
- Tauri commands use proper Result<T, E> return types
- Menu handles stored in State and accessed safely
Expand All @@ -75,6 +84,7 @@ Analyze the entire codebase focusing on:
- Menu event handlers are registered correctly

**React Frontend (src/):**

- All components are functional (no class components)
- TypeScript interfaces defined for all component props
- Custom hooks extracted for reusable logic (see src/hooks/)
Expand All @@ -87,6 +97,7 @@ Analyze the entire codebase focusing on:
- Event listeners properly removed in cleanup

**TypeScript:**

- No `any` types used (use `unknown` and type guards if needed)
- All interfaces/types properly exported from src/types/
- Strict mode enabled in tsconfig.json
Expand All @@ -96,6 +107,7 @@ Analyze the entire codebase focusing on:
- Enums used for fixed sets of values

**Configuration & Build:**

- tauri.conf.json settings appropriate for security and UX
- Vite config optimized for bundle size
- ESLint rules enforced and passing
Expand All @@ -104,10 +116,12 @@ Analyze the entire codebase focusing on:
- Bundle identifier follows conventions (not ending in .app)

**Testing:**

- Note: No test suite currently exists for this project
- Future testing should cover: file operations, menu interactions, markdown rendering, editor functionality

#### 4. Architecture & Patterns

- React components focused on UI (business logic in hooks/utilities)
- TypeScript interfaces/types are just data definitions (no logic)
- Tauri commands are thin (just IPC handling)
Expand All @@ -120,6 +134,7 @@ Analyze the entire codebase focusing on:
- File operations handled by Tauri backend (not in React components)

#### 5. Modern JavaScript/TypeScript Patterns

- ES modules used exclusively (import/export)
- Async/await preferred over .then/.catch
- Destructuring used appropriately
Expand All @@ -133,27 +148,30 @@ Analyze the entire codebase focusing on:
- Readonly arrays/objects for immutable data

#### 6. Documentation & Comments

- TypeScript functions have TSDoc comments with:
- Description
- @param for each parameter (type inferred from TypeScript)
- @returns with description (type inferred from TypeScript)
- @throws for error conditions
- Description
- @param for each parameter (type inferred from TypeScript)
- @returns with description (type inferred from TypeScript)
- @throws for error conditions
- Rust functions have doc comments (`///`) with:
- Description
- `# Arguments` section for parameters
- `# Returns` section
- `# Errors` section for fallible functions
- Description
- `# Arguments` section for parameters
- `# Returns` section
- `# Errors` section for fallible functions
- Complex logic has inline comments explaining "why" not "what"
- README and CLAUDE.md are up to date
- TypeScript interfaces documented with purpose and usage examples

### Output Format

Generate a review document at `/docs/reviews/<datetime>.md` with this structure:

````markdown
# Code Review - <DateTime>

## Executive Summary

- Total Issues Found: X
- Critical: X | High: X | Medium: X | Low: X
- Estimated Total Remediation Time: X hours
Expand All @@ -164,42 +182,53 @@ Generate a review document at `/docs/reviews/<datetime>.md` with this structure:
### CRITICAL Issues

#### [CRIT-001] Issue Title

**File:** `path/to/file.js:lineNumber`
**Category:** Security/Performance/Error Handling
**Description:** Clear explanation of the issue
**Impact:** What problems this causes
**Current Code:**

```typescript
// Show problematic code
```

**Recommended Fix:**

```typescript
// Show corrected code
```

**Effort:** X minutes

---

### HIGH Priority Issues

[Same format as CRITICAL]

### MEDIUM Priority Issues

[Same format as CRITICAL]

### LOW Priority Issues

[Same format as CRITICAL]

---

## Coding Sessions

### Session 1: Critical Security & Error Handling (Est. X hours)

**Focus:** Address all CRITICAL issues first
**Issues to Fix:**

- [CRIT-001] Issue Title - `file.js:line` (X min)
- [CRIT-002] Issue Title - `file.js:line` (X min)

**Instructions for Agent:**

1. Fix [CRIT-001] by implementing the recommended solution
2. Fix [CRIT-002] by implementing the recommended solution
3. Run `npm run build` and `npm run lint` to validate
Expand All @@ -209,12 +238,15 @@ Generate a review document at `/docs/reviews/<datetime>.md` with this structure:
---

### Session 2: High Priority - TSDoc & Code Structure (Est. X hours)

**Focus:** Documentation and code organization
**Issues to Fix:**

- [HIGH-001] Issue Title - `file.ts:line` (X min)
- [HIGH-002] Issue Title - `file.ts:line` (X min)

**Instructions for Agent:**

1. Add TSDoc comments to all TypeScript functions identified
2. Add Rust doc comments to all public Rust functions
3. Refactor large functions into smaller utilities
Expand All @@ -225,19 +257,23 @@ Generate a review document at `/docs/reviews/<datetime>.md` with this structure:
---

### Session 3: Medium Priority - Refactoring & Reusability (Est. X hours)

[Continue pattern]

### Session 4: Low Priority - Polish & Optimization (Est. X hours)

[Continue pattern]

---

## Positive Findings

- List things done well
- Areas that follow best practices
- Well-structured code examples

## Recommendations for Future Development

- Architectural improvements
- Tools or libraries to consider
- Process improvements
Expand All @@ -246,6 +282,7 @@ Generate a review document at `/docs/reviews/<datetime>.md` with this structure:
---

## Notes

- This review was generated based on CLAUDE.md standards
- Run `npm run build` and `npm run lint` after each session to ensure quality
- Test functionality with `npm run tauri dev` before committing
Expand All @@ -256,19 +293,22 @@ Generate a review document at `/docs/reviews/<datetime>.md` with this structure:
### Review Guidelines

**Criticality Scoring:**

- **CRITICAL**: Security risks, data loss potential, production blockers
- **HIGH**: Maintainability issues, missing docs, poor error handling
- **MEDIUM**: Code smells, duplication, suboptimal patterns
- **LOW**: Style issues, minor optimizations, nice-to-haves

**Session Sizing:**

- Target 2-4 hours per session maximum
- Group related issues together (e.g., all TSDoc additions, all type fixes)
- Order by file/directory to minimize context switching
- Include time for testing and validation
- Separate TypeScript and Rust changes when practical

**Agent Instructions:**

- Be specific about which files and functions to modify
- Include line numbers when possible
- Provide concrete code examples in TypeScript/Rust
Expand All @@ -277,12 +317,14 @@ Generate a review document at `/docs/reviews/<datetime>.md` with this structure:
- Include semantic commit messages (conventional commits format)

**Balance:**

- Don't be overly pedantic on LOW issues
- Focus on actionable, specific feedback
- Highlight good practices when found
- Consider effort vs. value trade-offs

### Quality Checks Before Output

1. All issues have clear descriptions and fixes
2. Estimated times are realistic
3. Sessions are balanced and logical
Expand Down
43 changes: 22 additions & 21 deletions .claude/commands/update-docs.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
### Prerequisites

1. **Always read CLAUDE.md first** - This is the single source of truth for all developer information
2. **Never modify AGENTS.md** - This file only contains instructions for other coding assistants to read CLAUDE.md

### Documentation Update Process

1. **Analyze Recent Changes**
- Check git log for recent commits (last 7-14 days or since last release)
- Identify modified/added/removed files in all source code folders
- Note any changes to APIs, functions, configuration, or architecture
- Check git log for recent commits (last 7-14 days or since last release)
- Identify modified/added/removed files in all source code folders
- Note any changes to APIs, functions, configuration, or architecture

2. **Review Current Documentation**
- Read existing documentation files:
- `README.md`
- `CLAUDE.md` (the single source of truth)
- Any files in `/docs` directory
- Any README.md files in any source code folder
- Identify sections that are now outdated or incomplete
- Read existing documentation files:
- `README.md`
- `CLAUDE.md` (the single source of truth)
- Any files in `/docs` directory
- Any README.md files in any source code folder
- Identify sections that are now outdated or incomplete

3. **Update Documentation**
For each documentation file:

**README.md:**
- Update installation instructions if dependencies changed
- Update usage examples if APIs changed
- Update feature list if functionality added/removed
- Ensure quick start guide reflects current setup
- Update installation instructions if dependencies changed
- Update usage examples if APIs changed
- Update feature list if functionality added/removed
- Ensure quick start guide reflects current setup

**CLAUDE.md:**
- Add new architectural decisions or patterns
- Update coding conventions if they've evolved
- Document new dependencies or tools
- Add any new gotchas or important context
- Add new architectural decisions or patterns
- Update coding conventions if they've evolved
- Document new dependencies or tools
- Add any new gotchas or important context

**AGENTS.md:**
- **DO NOT MODIFY** - Leave this file untouched
- **DO NOT MODIFY** - Leave this file untouched

**/docs directory:**
- Update API documentation for changed endpoints/functions
- Refresh architecture diagrams if structure changed
- Update configuration guides if settings changed
- Update API documentation for changed endpoints/functions
- Refresh architecture diagrams if structure changed
- Update configuration guides if settings changed
9 changes: 2 additions & 7 deletions .github/actions-scripts/update-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ const versionType = process.argv[2];
const validVersionTypes = ['major', 'minor', 'patch'];

if (!validVersionTypes.includes(versionType)) {
console.error(
`Invalid version type. Use one of: ${validVersionTypes.join(', ')}`
);
console.error(`Invalid version type. Use one of: ${validVersionTypes.join(', ')}`);
process.exit(1);
}

Expand Down Expand Up @@ -58,10 +56,7 @@ try {
try {
let cargoToml = fs.readFileSync(cargoTomlPath, 'utf8');
// Replace version line in TOML file
cargoToml = cargoToml.replace(
/^version = ".*"$/m,
`version = "${newVersion}"`
);
cargoToml = cargoToml.replace(/^version = ".*"$/m, `version = "${newVersion}"`);
fs.writeFileSync(cargoTomlPath, cargoToml);
console.log(`Updated ${cargoTomlPath} to version ${newVersion}`);
} catch (error) {
Expand Down
Loading
Loading