@codedir/mimir-code 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -47
- package/dist/binaries/resources/sql-wasm.wasm +0 -0
- package/dist/{cli.js → cli.mjs} +424 -1407
- package/dist/cli.mjs.map +1 -0
- package/dist/index.d.ts +19 -19
- package/dist/index.js +6 -10
- package/dist/index.js.map +1 -1
- package/package.json +23 -11
- package/scripts/templates/commands/{docs.yml → update-docs.yml} +5 -5
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js.map +0 -1
- package/scripts/templates/commands/perf.yml +0 -56
- package/scripts/templates/commands/refactor.yml +0 -52
- package/scripts/templates/commands/review.yml +0 -62
- package/scripts/templates/commands/security.yml +0 -51
- package/scripts/templates/commands/test.yml +0 -50
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Performance Analysis Command
|
|
2
|
-
# Analyzes code for performance issues and optimizations
|
|
3
|
-
# Usage: /perf [file-or-function]
|
|
4
|
-
|
|
5
|
-
name: perf
|
|
6
|
-
description: Analyze code for performance issues and optimizations
|
|
7
|
-
usage: /perf [file-or-function]
|
|
8
|
-
aliases: [performance, optimize]
|
|
9
|
-
prompt: |
|
|
10
|
-
Analyze the specified code for performance issues and optimization opportunities:
|
|
11
|
-
|
|
12
|
-
**Algorithmic Complexity:**
|
|
13
|
-
- Identify O(n²) or worse algorithms
|
|
14
|
-
- Suggest more efficient data structures
|
|
15
|
-
- Spot unnecessary iterations
|
|
16
|
-
- Recommend parallelization opportunities
|
|
17
|
-
|
|
18
|
-
**Resource Usage:**
|
|
19
|
-
- Memory leaks and excessive allocations
|
|
20
|
-
- File handle/connection leaks
|
|
21
|
-
- Large object creation in hot paths
|
|
22
|
-
- Unnecessary cloning/copying
|
|
23
|
-
|
|
24
|
-
**I/O Operations:**
|
|
25
|
-
- N+1 query problems (database)
|
|
26
|
-
- Missing pagination/batching
|
|
27
|
-
- Synchronous I/O in async contexts
|
|
28
|
-
- Missing caching layers
|
|
29
|
-
|
|
30
|
-
**Frontend-Specific:**
|
|
31
|
-
- Unnecessary re-renders (React/Vue)
|
|
32
|
-
- Large bundle sizes
|
|
33
|
-
- Missing lazy loading
|
|
34
|
-
- Unoptimized images/assets
|
|
35
|
-
- Blocking JavaScript
|
|
36
|
-
|
|
37
|
-
**Backend-Specific:**
|
|
38
|
-
- Missing database indexes
|
|
39
|
-
- Inefficient ORM queries
|
|
40
|
-
- Missing connection pooling
|
|
41
|
-
- Blocking event loop (Node.js)
|
|
42
|
-
|
|
43
|
-
**Target:**
|
|
44
|
-
$ARGUMENTS
|
|
45
|
-
|
|
46
|
-
**Output:**
|
|
47
|
-
1. Performance hotspots ranked by impact
|
|
48
|
-
2. For each issue:
|
|
49
|
-
- Current implementation
|
|
50
|
-
- Optimized version
|
|
51
|
-
- Expected improvement (with reasoning)
|
|
52
|
-
- Complexity analysis (before/after)
|
|
53
|
-
3. Quick wins vs long-term refactors
|
|
54
|
-
|
|
55
|
-
If no target specified, analyze the current working directory.
|
|
56
|
-
Focus on high-impact optimizations. Include benchmark suggestions.
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# Code Refactoring Command
|
|
2
|
-
# Suggests refactoring improvements for better code quality
|
|
3
|
-
# Usage: /refactor [file-or-pattern]
|
|
4
|
-
|
|
5
|
-
name: refactor
|
|
6
|
-
description: Suggest refactoring improvements for code quality
|
|
7
|
-
usage: /refactor [file-or-pattern]
|
|
8
|
-
aliases: [ref, improve]
|
|
9
|
-
prompt: |
|
|
10
|
-
Analyze the specified code and suggest refactoring improvements. Focus on:
|
|
11
|
-
|
|
12
|
-
**Code Smells:**
|
|
13
|
-
- Long methods/functions (>50 lines)
|
|
14
|
-
- Large classes (>300 lines)
|
|
15
|
-
- Duplicate code (DRY violations)
|
|
16
|
-
- Dead code and unused variables
|
|
17
|
-
- Magic numbers and hardcoded values
|
|
18
|
-
- Deeply nested conditionals (>3 levels)
|
|
19
|
-
- Feature envy (accessing other objects' data excessively)
|
|
20
|
-
|
|
21
|
-
**Design Patterns:**
|
|
22
|
-
- Missing abstractions or interfaces
|
|
23
|
-
- Inappropriate coupling (tight coupling where loose is better)
|
|
24
|
-
- Single Responsibility Principle violations
|
|
25
|
-
- Open/Closed Principle violations
|
|
26
|
-
- Dependency injection opportunities
|
|
27
|
-
|
|
28
|
-
**Performance:**
|
|
29
|
-
- Inefficient algorithms (O(n²) where O(n log n) possible)
|
|
30
|
-
- Unnecessary computations in loops
|
|
31
|
-
- Memory leaks or excessive allocations
|
|
32
|
-
- Missing caching opportunities
|
|
33
|
-
|
|
34
|
-
**Readability:**
|
|
35
|
-
- Poor naming (unclear variable/function names)
|
|
36
|
-
- Missing documentation for complex logic
|
|
37
|
-
- Inconsistent code style
|
|
38
|
-
- Complex boolean expressions
|
|
39
|
-
|
|
40
|
-
**Target:**
|
|
41
|
-
$ARGUMENTS
|
|
42
|
-
|
|
43
|
-
**Output:**
|
|
44
|
-
1. Priority-ranked list of refactorings (high/medium/low impact)
|
|
45
|
-
2. For each suggestion:
|
|
46
|
-
- Before/after code comparison
|
|
47
|
-
- Rationale (why this improves the code)
|
|
48
|
-
- Estimated effort (quick win / medium / large refactor)
|
|
49
|
-
3. No-regret moves (safe refactorings with minimal risk)
|
|
50
|
-
|
|
51
|
-
If no target specified, analyze files changed in the last commit.
|
|
52
|
-
Provide actionable, specific suggestions with code examples.
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# Code Review Command
|
|
2
|
-
# Performs comprehensive code review with best practices
|
|
3
|
-
# Usage: /review [file-or-commit]
|
|
4
|
-
|
|
5
|
-
name: review
|
|
6
|
-
description: Perform comprehensive code review
|
|
7
|
-
usage: /review [file-or-commit]
|
|
8
|
-
aliases: [cr, check]
|
|
9
|
-
prompt: |
|
|
10
|
-
Conduct a thorough code review of the specified changes. Evaluate:
|
|
11
|
-
|
|
12
|
-
**Correctness:**
|
|
13
|
-
- Logic errors and bugs
|
|
14
|
-
- Off-by-one errors
|
|
15
|
-
- Null pointer/undefined access
|
|
16
|
-
- Race conditions and concurrency issues
|
|
17
|
-
- Error handling completeness
|
|
18
|
-
|
|
19
|
-
**Code Quality:**
|
|
20
|
-
- Readability and maintainability
|
|
21
|
-
- Naming conventions (clear, consistent)
|
|
22
|
-
- Function/method length and complexity
|
|
23
|
-
- Code duplication (DRY principle)
|
|
24
|
-
- Single Responsibility Principle
|
|
25
|
-
|
|
26
|
-
**Performance:**
|
|
27
|
-
- Algorithmic complexity (O(n) analysis)
|
|
28
|
-
- Unnecessary database queries (N+1 problems)
|
|
29
|
-
- Memory inefficiencies
|
|
30
|
-
- Blocking operations in async contexts
|
|
31
|
-
|
|
32
|
-
**Testing:**
|
|
33
|
-
- Test coverage for new code
|
|
34
|
-
- Test quality (meaningful assertions)
|
|
35
|
-
- Edge cases covered
|
|
36
|
-
- Mocking strategy appropriateness
|
|
37
|
-
|
|
38
|
-
**Security:**
|
|
39
|
-
- Input validation
|
|
40
|
-
- SQL injection, XSS, CSRF risks
|
|
41
|
-
- Authentication/authorization checks
|
|
42
|
-
- Sensitive data exposure
|
|
43
|
-
|
|
44
|
-
**Architecture:**
|
|
45
|
-
- Consistency with project patterns
|
|
46
|
-
- API design (backward compatibility)
|
|
47
|
-
- Dependency management
|
|
48
|
-
- Separation of concerns
|
|
49
|
-
|
|
50
|
-
**Target:**
|
|
51
|
-
$ARGUMENTS
|
|
52
|
-
|
|
53
|
-
**Output Format:**
|
|
54
|
-
1. Overall assessment (LGTM, Needs Work, Requires Changes)
|
|
55
|
-
2. Critical issues (must fix before merge)
|
|
56
|
-
3. Suggestions (nice-to-have improvements)
|
|
57
|
-
4. Positive feedback (what's done well)
|
|
58
|
-
5. Line-specific comments with file:line references
|
|
59
|
-
|
|
60
|
-
If no target specified, review the current staged changes.
|
|
61
|
-
Be constructive and specific. Provide code snippets for fixes.
|
|
62
|
-
Balance thoroughness with pragmatism.
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# Security Analysis Command
|
|
2
|
-
# Analyzes git diffs for security vulnerabilities and issues
|
|
3
|
-
# Usage: /security [file-or-commit]
|
|
4
|
-
|
|
5
|
-
name: security
|
|
6
|
-
description: Analyze git changes for security vulnerabilities
|
|
7
|
-
usage: /security [file-or-commit]
|
|
8
|
-
aliases: [sec, vuln]
|
|
9
|
-
prompt: |
|
|
10
|
-
Perform a comprehensive security analysis of the git diff. Focus on:
|
|
11
|
-
|
|
12
|
-
**Critical Security Issues:**
|
|
13
|
-
- SQL injection vulnerabilities (unsanitized input in queries)
|
|
14
|
-
- XSS vulnerabilities (unescaped output in HTML/templates)
|
|
15
|
-
- Command injection (unsanitized shell execution)
|
|
16
|
-
- Path traversal (directory traversal attacks via user input)
|
|
17
|
-
- Authentication/authorization bypass
|
|
18
|
-
- Hardcoded secrets, API keys, passwords, or tokens
|
|
19
|
-
- Insecure cryptography (weak algorithms, hardcoded keys)
|
|
20
|
-
- CSRF vulnerabilities (missing tokens on state-changing operations)
|
|
21
|
-
|
|
22
|
-
**High-Priority Issues:**
|
|
23
|
-
- Input validation gaps (missing sanitization, type checking)
|
|
24
|
-
- Unsafe deserialization
|
|
25
|
-
- Race conditions in concurrent code
|
|
26
|
-
- Information disclosure in error messages
|
|
27
|
-
- Insecure defaults or misconfigurations
|
|
28
|
-
- Missing security headers
|
|
29
|
-
- Weak password policies
|
|
30
|
-
|
|
31
|
-
**Best Practices:**
|
|
32
|
-
- Principle of least privilege violations
|
|
33
|
-
- Missing rate limiting
|
|
34
|
-
- Inadequate logging of security events
|
|
35
|
-
- Unencrypted sensitive data transmission
|
|
36
|
-
- Missing input length/size limits
|
|
37
|
-
|
|
38
|
-
**Analysis Target:**
|
|
39
|
-
$ARGUMENTS
|
|
40
|
-
|
|
41
|
-
**Output Format:**
|
|
42
|
-
1. Executive Summary (severity: critical/high/medium/low)
|
|
43
|
-
2. Detailed findings with:
|
|
44
|
-
- File path and line numbers
|
|
45
|
-
- Vulnerability type (OWASP category)
|
|
46
|
-
- Proof of concept/exploit scenario
|
|
47
|
-
- Remediation code snippet
|
|
48
|
-
3. Risk assessment and prioritization
|
|
49
|
-
|
|
50
|
-
If no target specified, analyze the current staged changes (git diff --staged).
|
|
51
|
-
Be thorough but concise. Flag false positives as "Needs Review".
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# Test Generation Command
|
|
2
|
-
# Generates comprehensive test cases for code
|
|
3
|
-
# Usage: /test [file-or-function]
|
|
4
|
-
|
|
5
|
-
name: test
|
|
6
|
-
description: Generate comprehensive test cases
|
|
7
|
-
usage: /test [file-or-function]
|
|
8
|
-
aliases: [tests, spec]
|
|
9
|
-
prompt: |
|
|
10
|
-
Generate comprehensive test cases for the specified code. Cover:
|
|
11
|
-
|
|
12
|
-
**Test Types:**
|
|
13
|
-
- Unit tests (isolated function/class behavior)
|
|
14
|
-
- Integration tests (component interaction)
|
|
15
|
-
- Edge cases and boundary conditions
|
|
16
|
-
- Error handling and exceptions
|
|
17
|
-
- Async/concurrent behavior (if applicable)
|
|
18
|
-
|
|
19
|
-
**Coverage Areas:**
|
|
20
|
-
- Happy path (normal expected inputs)
|
|
21
|
-
- Invalid inputs (type errors, null/undefined, empty values)
|
|
22
|
-
- Boundary values (min/max, empty collections, single item)
|
|
23
|
-
- Error conditions (network failures, timeouts, rejected promises)
|
|
24
|
-
- State transitions (if stateful)
|
|
25
|
-
- Side effects (file I/O, database, external APIs)
|
|
26
|
-
|
|
27
|
-
**Test Quality:**
|
|
28
|
-
- Arrange-Act-Assert pattern
|
|
29
|
-
- Clear test names describing behavior
|
|
30
|
-
- Minimal mocking (use real objects when possible)
|
|
31
|
-
- One assertion per test (where logical)
|
|
32
|
-
- Setup/teardown for resource cleanup
|
|
33
|
-
|
|
34
|
-
**Target:**
|
|
35
|
-
$ARGUMENTS
|
|
36
|
-
|
|
37
|
-
**Output:**
|
|
38
|
-
1. Test file structure (describe/it blocks or equivalent)
|
|
39
|
-
2. Test cases with:
|
|
40
|
-
- Descriptive test name
|
|
41
|
-
- Setup code (arrange)
|
|
42
|
-
- Invocation (act)
|
|
43
|
-
- Assertions (assert)
|
|
44
|
-
- Mock/stub setup if needed
|
|
45
|
-
3. Coverage estimate (% of code paths tested)
|
|
46
|
-
4. Missing test scenarios (if any)
|
|
47
|
-
|
|
48
|
-
Use the project's testing framework (detect from package.json/imports).
|
|
49
|
-
If no target specified, analyze the most recently modified files.
|
|
50
|
-
Prioritize high-value tests over exhaustive coverage.
|