geminize 1.0.0 → 1.2.0
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.
- checksums.yaml +4 -4
- data/.cursor/mcp.json +3 -0
- data/.cursor/rules/isolation_rules/Core/command-execution.mdc +235 -0
- data/.cursor/rules/isolation_rules/Core/complexity-decision-tree.mdc +187 -0
- data/.cursor/rules/isolation_rules/Core/creative-phase-enforcement.mdc +145 -0
- data/.cursor/rules/isolation_rules/Core/creative-phase-metrics.mdc +195 -0
- data/.cursor/rules/isolation_rules/Core/file-verification.mdc +198 -0
- data/.cursor/rules/isolation_rules/Core/platform-awareness.mdc +71 -0
- data/.cursor/rules/isolation_rules/Level3/planning-comprehensive.mdc +159 -0
- data/.cursor/rules/isolation_rules/Level3/task-tracking-intermediate.mdc +135 -0
- data/.cursor/rules/isolation_rules/Phases/CreativePhase/creative-phase-architecture.mdc +187 -0
- data/.cursor/rules/isolation_rules/main.mdc +123 -0
- data/.cursor/rules/isolation_rules/visual-maps/archive-mode-map.mdc +277 -0
- data/.cursor/rules/isolation_rules/visual-maps/creative-mode-map.mdc +224 -0
- data/.cursor/rules/isolation_rules/visual-maps/implement-mode-map.mdc +321 -0
- data/.cursor/rules/isolation_rules/visual-maps/plan-mode-map.mdc +269 -0
- data/.cursor/rules/isolation_rules/visual-maps/qa-mode-map.mdc +495 -0
- data/.cursor/rules/isolation_rules/visual-maps/reflect-mode-map.mdc +234 -0
- data/.cursor/rules/isolation_rules/visual-maps/van-mode-map.mdc +902 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-complexity-determination.mdc +60 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-file-verification.mdc +49 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-mode-map.mdc +49 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-platform-detection.mdc +50 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-checks/build-test.mdc +117 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-checks/config-check.mdc +103 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-checks/dependency-check.mdc +147 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-checks/environment-check.mdc +104 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-checks/file-verification.mdc +1 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-main.mdc +142 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-utils/common-fixes.mdc +92 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-utils/mode-transitions.mdc +101 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-utils/reports.mdc +149 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-utils/rule-calling-guide.mdc +66 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-utils/rule-calling-help.mdc +19 -0
- data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-validation.md.old +363 -0
- data/.env.example +7 -0
- data/.memory_bank/activeContext.md +102 -0
- data/.memory_bank/progress.md +93 -0
- data/.memory_bank/projectbrief.md +45 -0
- data/.memory_bank/systemPatterns.md +90 -0
- data/.memory_bank/tasks.md +142 -0
- data/.memory_bank/techContext.md +73 -0
- data/.tool-versions +1 -0
- data/CHANGELOG.md +42 -0
- data/README.md +223 -5
- data/examples/function_calling.rb +218 -0
- data/examples/models_api.rb +125 -0
- data/examples/safety_settings.rb +82 -0
- data/lib/geminize/configuration.rb +4 -4
- data/lib/geminize/model_info.rb +87 -8
- data/lib/geminize/models/content_request_extensions.rb +219 -0
- data/lib/geminize/models/content_request_safety.rb +123 -0
- data/lib/geminize/models/content_response_extensions.rb +120 -0
- data/lib/geminize/models/function_declaration.rb +112 -0
- data/lib/geminize/models/function_response.rb +70 -0
- data/lib/geminize/models/model.rb +101 -109
- data/lib/geminize/models/model_list.rb +70 -28
- data/lib/geminize/models/safety_setting.rb +102 -0
- data/lib/geminize/models/tool.rb +47 -0
- data/lib/geminize/models/tool_config.rb +52 -0
- data/lib/geminize/module_extensions.rb +228 -0
- data/lib/geminize/module_safety.rb +135 -0
- data/lib/geminize/request_builder.rb +29 -0
- data/lib/geminize/version.rb +1 -1
- data/lib/geminize.rb +83 -14
- metadata +57 -2
data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-complexity-determination.mdc
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
---
|
2
|
+
description: Visual process map for VAN mode complexity determination
|
3
|
+
globs: van-complexity-determination.mdc
|
4
|
+
alwaysApply: false
|
5
|
+
---
|
6
|
+
# VAN MODE: EARLY COMPLEXITY DETERMINATION
|
7
|
+
|
8
|
+
> **TL;DR:** Analyzes the task to determine complexity level. For Level 1, VAN mode completes. For Levels 2-4, triggers a mandatory switch to PLAN mode.
|
9
|
+
|
10
|
+
## 🧩 COMPLEXITY DETERMINATION PROCESS
|
11
|
+
|
12
|
+
```mermaid
|
13
|
+
graph TD
|
14
|
+
CD["Complexity<br>Determination"] --> AnalyzeTask["Analyze Task<br>Requirements"]
|
15
|
+
|
16
|
+
AnalyzeTask --> CheckKeywords["Check Task<br>Keywords"]
|
17
|
+
CheckKeywords --> ScopeCheck["Assess<br>Scope Impact"]
|
18
|
+
ScopeCheck --> RiskCheck["Evaluate<br>Risk Level"]
|
19
|
+
RiskCheck --> EffortCheck["Estimate<br>Implementation Effort"]
|
20
|
+
|
21
|
+
EffortCheck --> DetermineLevel{"Determine<br>Complexity Level"}
|
22
|
+
DetermineLevel -->|"Level 1"| L1["Level 1:<br>Quick Bug Fix"]
|
23
|
+
DetermineLevel -->|"Level 2"| L2["Level 2:<br>Simple Enhancement"]
|
24
|
+
DetermineLevel -->|"Level 3"| L3["Level 3:<br>Intermediate Feature"]
|
25
|
+
DetermineLevel -->|"Level 4"| L4["Level 4:<br>Complex System"]
|
26
|
+
|
27
|
+
L1 --> CDComplete["Complexity Determination<br>Complete (Level 1)"]
|
28
|
+
L2 & L3 & L4 --> ModeSwitch["Force Mode Switch<br>to PLAN"]
|
29
|
+
|
30
|
+
style CD fill:#4da6ff,stroke:#0066cc,color:white
|
31
|
+
style CDComplete fill:#10b981,stroke:#059669,color:white
|
32
|
+
style ModeSwitch fill:#ff0000,stroke:#990000,color:white
|
33
|
+
style DetermineLevel fill:#f6546a,stroke:#c30052,color:white
|
34
|
+
```
|
35
|
+
|
36
|
+
## 🚨 MODE TRANSITION TRIGGER (VAN to PLAN)
|
37
|
+
|
38
|
+
If complexity is determined to be Level 2, 3, or 4:
|
39
|
+
|
40
|
+
```
|
41
|
+
🚫 LEVEL [2-4] TASK DETECTED
|
42
|
+
Implementation in VAN mode is BLOCKED
|
43
|
+
This task REQUIRES PLAN mode
|
44
|
+
You MUST switch to PLAN mode for proper documentation and planning
|
45
|
+
Type 'PLAN' to switch to planning mode
|
46
|
+
```
|
47
|
+
|
48
|
+
## 📋 CHECKPOINT VERIFICATION TEMPLATE (Example)
|
49
|
+
|
50
|
+
```
|
51
|
+
✓ SECTION CHECKPOINT: COMPLEXITY DETERMINATION
|
52
|
+
- Task Analyzed? [YES/NO]
|
53
|
+
- Complexity Level Determined? [YES/NO]
|
54
|
+
|
55
|
+
→ If Level 1: Proceed to VAN Mode Completion.
|
56
|
+
→ If Level 2-4: Trigger PLAN Mode transition.
|
57
|
+
```
|
58
|
+
|
59
|
+
**Next Step (Level 1):** Complete VAN Initialization (e.g., initialize Memory Bank if needed).
|
60
|
+
**Next Step (Level 2-4):** Exit VAN mode and initiate PLAN mode.
|
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
description: Visual process map for VAN mode file verification
|
3
|
+
globs: van-file-verification.mdc
|
4
|
+
alwaysApply: false
|
5
|
+
---
|
6
|
+
# VAN MODE: FILE VERIFICATION
|
7
|
+
|
8
|
+
> **TL;DR:** Checks for the existence and basic structure of essential Memory Bank and documentation components.
|
9
|
+
|
10
|
+
## 📁 FILE VERIFICATION PROCESS
|
11
|
+
|
12
|
+
```mermaid
|
13
|
+
graph TD
|
14
|
+
FV["File Verification"] --> CheckFiles["Check Essential Files"]
|
15
|
+
CheckFiles --> CheckMB["Check Memory Bank<br>Structure"]
|
16
|
+
CheckMB --> MBExists{"Memory Bank<br>Exists?"}
|
17
|
+
|
18
|
+
MBExists -->|"Yes"| VerifyMB["Verify Memory Bank<br>Contents (Basic)"]
|
19
|
+
MBExists -->|"No"| CreateMB["Create Memory Bank<br>Structure (Basic)"]
|
20
|
+
|
21
|
+
CheckFiles --> CheckDocs["Check Documentation<br>Files (e.g., tasks.md)"]
|
22
|
+
CheckDocs --> DocsExist{"Docs<br>Exist?"}
|
23
|
+
|
24
|
+
DocsExist -->|"Yes"| VerifyDocs["Verify Documentation<br>Presence"]
|
25
|
+
DocsExist -->|"No"| CreateDocs["Create Essential<br>Documentation Files"]
|
26
|
+
|
27
|
+
VerifyMB & CreateMB --> MBCP["Memory Bank<br>Checkpoint"]
|
28
|
+
VerifyDocs & CreateDocs --> DocsCP["Documentation<br>Checkpoint"]
|
29
|
+
|
30
|
+
MBCP & DocsCP --> FileComplete["File Verification<br>Complete"]
|
31
|
+
|
32
|
+
style FV fill:#4da6ff,stroke:#0066cc,color:white
|
33
|
+
style FileComplete fill:#10b981,stroke:#059669,color:white
|
34
|
+
style MBCP fill:#f6546a,stroke:#c30052,color:white
|
35
|
+
style DocsCP fill:#f6546a,stroke:#c30052,color:white
|
36
|
+
```
|
37
|
+
|
38
|
+
## 📋 CHECKPOINT VERIFICATION TEMPLATE (Example)
|
39
|
+
|
40
|
+
```
|
41
|
+
✓ SECTION CHECKPOINT: FILE VERIFICATION
|
42
|
+
- Memory Bank Directory Exists/Created? [YES/NO]
|
43
|
+
- Essential Docs (tasks.md) Exist/Created? [YES/NO]
|
44
|
+
|
45
|
+
→ If all YES: File Verification Complete.
|
46
|
+
→ If any NO: Resolve before proceeding.
|
47
|
+
```
|
48
|
+
|
49
|
+
**Next Step:** Load and process `van-complexity-determination.mdc`.
|
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
description: Visual process map for VAN mode (Index/Entry Point)
|
3
|
+
globs: van-mode-map.mdc
|
4
|
+
alwaysApply: false
|
5
|
+
---
|
6
|
+
# VAN MODE: INITIALIZATION PROCESS MAP (INDEX)
|
7
|
+
|
8
|
+
> **TL;DR:** This is the entry point for VAN mode. It handles initial activation and directs the process to subsequent steps stored in separate files for optimization.
|
9
|
+
|
10
|
+
## 🚀 VAN MODE ACTIVATION
|
11
|
+
|
12
|
+
When the user types "VAN", respond with a confirmation and start the process:
|
13
|
+
|
14
|
+
```
|
15
|
+
User: VAN
|
16
|
+
|
17
|
+
Response: OK VAN - Beginning Initialization Process
|
18
|
+
Loading Platform Detection map...
|
19
|
+
```
|
20
|
+
|
21
|
+
## 🧭 VAN MODE PROCESS FLOW (High Level)
|
22
|
+
|
23
|
+
This graph shows the main stages. Each stage is detailed in a separate file loaded sequentially.
|
24
|
+
|
25
|
+
```mermaid
|
26
|
+
graph TD
|
27
|
+
Start["START VAN MODE"] --> PlatformDetect["1. PLATFORM DETECTION
|
28
|
+
(van-platform-detection.mdc)"]
|
29
|
+
PlatformDetect --> FileVerify["2. FILE VERIFICATION
|
30
|
+
(van-file-verification.mdc)"]
|
31
|
+
FileVerify --> Complexity["3. EARLY COMPLEXITY
|
32
|
+
DETERMINATION
|
33
|
+
(van-complexity-determination.mdc)"]
|
34
|
+
Complexity --> Decision{"Level?"}
|
35
|
+
Decision -- "Level 1" --> L1Complete["Level 1 Init Complete"]
|
36
|
+
Decision -- "Level 2-4" --> ExitToPlan["Exit to PLAN Mode"]
|
37
|
+
|
38
|
+
%% Link to QA (Loaded separately)
|
39
|
+
QA_Entry["VAN QA MODE
|
40
|
+
(Loaded Separately via
|
41
|
+
'VAN QA' command)"] -.-> QA_Map["(van-qa-validation.mdc)"]
|
42
|
+
|
43
|
+
style PlatformDetect fill:#ccf,stroke:#333
|
44
|
+
style FileVerify fill:#ccf,stroke:#333
|
45
|
+
style Complexity fill:#ccf,stroke:#333
|
46
|
+
style QA_Map fill:#fcc,stroke:#333
|
47
|
+
```
|
48
|
+
|
49
|
+
**Next Step:** Load and process `van-platform-detection.mdc`.
|
@@ -0,0 +1,50 @@
|
|
1
|
+
---
|
2
|
+
description: Visual process map for VAN mode platform detection
|
3
|
+
globs: van-platform-detection.mdc
|
4
|
+
alwaysApply: false
|
5
|
+
---
|
6
|
+
# VAN MODE: PLATFORM DETECTION
|
7
|
+
|
8
|
+
> **TL;DR:** Detects the OS, determines path separators, and notes command adaptations required.
|
9
|
+
|
10
|
+
## 🌐 PLATFORM DETECTION PROCESS
|
11
|
+
|
12
|
+
```mermaid
|
13
|
+
graph TD
|
14
|
+
PD["Platform Detection"] --> CheckOS["Detect Operating System"]
|
15
|
+
CheckOS --> Win["Windows"]
|
16
|
+
CheckOS --> Mac["macOS"]
|
17
|
+
CheckOS --> Lin["Linux"]
|
18
|
+
|
19
|
+
Win & Mac & Lin --> Adapt["Adapt Commands<br>for Platform"]
|
20
|
+
|
21
|
+
Win --> WinPath["Path: Backslash (\\)"]
|
22
|
+
Mac --> MacPath["Path: Forward Slash (/)"]
|
23
|
+
Lin --> LinPath["Path: Forward Slash (/)"]
|
24
|
+
|
25
|
+
Win --> WinCmd["Command Adaptations:<br>dir, icacls, etc."]
|
26
|
+
Mac --> MacCmd["Command Adaptations:<br>ls, chmod, etc."]
|
27
|
+
Lin --> LinCmd["Command Adaptations:<br>ls, chmod, etc."]
|
28
|
+
|
29
|
+
WinPath & MacPath & LinPath --> PathCP["Path Separator<br>Checkpoint"]
|
30
|
+
WinCmd & MacCmd & LinCmd --> CmdCP["Command<br>Checkpoint"]
|
31
|
+
|
32
|
+
PathCP & CmdCP --> PlatformComplete["Platform Detection<br>Complete"]
|
33
|
+
|
34
|
+
style PD fill:#4da6ff,stroke:#0066cc,color:white
|
35
|
+
style PlatformComplete fill:#10b981,stroke:#059669,color:white
|
36
|
+
```
|
37
|
+
|
38
|
+
## 📋 CHECKPOINT VERIFICATION TEMPLATE (Example)
|
39
|
+
|
40
|
+
```
|
41
|
+
✓ SECTION CHECKPOINT: PLATFORM DETECTION
|
42
|
+
- Operating System Detected? [YES/NO]
|
43
|
+
- Path Separator Confirmed? [YES/NO]
|
44
|
+
- Command Adaptations Noted? [YES/NO]
|
45
|
+
|
46
|
+
→ If all YES: Platform Detection Complete.
|
47
|
+
→ If any NO: Resolve before proceeding.
|
48
|
+
```
|
49
|
+
|
50
|
+
**Next Step:** Load and process `van-file-verification.mdc`.
|
@@ -0,0 +1,117 @@
|
|
1
|
+
---
|
2
|
+
description: Process map for VAN QA minimal build test
|
3
|
+
globs: van-qa-checks/build-test.mdc
|
4
|
+
alwaysApply: false
|
5
|
+
---
|
6
|
+
# VAN QA: MINIMAL BUILD TEST
|
7
|
+
|
8
|
+
> **TL;DR:** This component performs a minimal build test to ensure core build functionality works properly.
|
9
|
+
|
10
|
+
## 4️⃣ MINIMAL BUILD TEST PROCESS
|
11
|
+
|
12
|
+
```mermaid
|
13
|
+
graph TD
|
14
|
+
Start["Minimal Build Test"] --> CreateTest["Create Minimal<br>Test Project"]
|
15
|
+
CreateTest --> BuildTest["Attempt<br>Build"]
|
16
|
+
BuildTest --> BuildStatus{"Build<br>Successful?"}
|
17
|
+
|
18
|
+
BuildStatus -->|"Yes"| RunTest["Run Basic<br>Functionality Test"]
|
19
|
+
BuildStatus -->|"No"| FixBuild["Fix Build<br>Issues"]
|
20
|
+
FixBuild --> RetryBuild["Retry Build"]
|
21
|
+
RetryBuild --> BuildStatus
|
22
|
+
|
23
|
+
RunTest --> TestStatus{"Test<br>Passed?"}
|
24
|
+
TestStatus -->|"Yes"| TestSuccess["Minimal Build Test<br>✅ PASS"]
|
25
|
+
TestStatus -->|"No"| FixTest["Fix Test<br>Issues"]
|
26
|
+
FixTest --> RetryTest["Retry Test"]
|
27
|
+
RetryTest --> TestStatus
|
28
|
+
|
29
|
+
style Start fill:#4da6ff,stroke:#0066cc,color:white
|
30
|
+
style TestSuccess fill:#10b981,stroke:#059669,color:white
|
31
|
+
style BuildStatus fill:#f6546a,stroke:#c30052,color:white
|
32
|
+
style TestStatus fill:#f6546a,stroke:#c30052,color:white
|
33
|
+
```
|
34
|
+
|
35
|
+
### Minimal Build Test Implementation:
|
36
|
+
```powershell
|
37
|
+
# Example: Perform minimal build test for a React project
|
38
|
+
function Perform-MinimalBuildTest {
|
39
|
+
$buildSuccess = $false
|
40
|
+
$testSuccess = $false
|
41
|
+
|
42
|
+
# Create minimal test project
|
43
|
+
$testDir = ".__build_test"
|
44
|
+
if (Test-Path $testDir) {
|
45
|
+
Remove-Item -Path $testDir -Recurse -Force
|
46
|
+
}
|
47
|
+
|
48
|
+
try {
|
49
|
+
# Create minimal test directory
|
50
|
+
New-Item -Path $testDir -ItemType Directory | Out-Null
|
51
|
+
Push-Location $testDir
|
52
|
+
|
53
|
+
# Initialize minimal package.json
|
54
|
+
@"
|
55
|
+
{
|
56
|
+
"name": "build-test",
|
57
|
+
"version": "1.0.0",
|
58
|
+
"description": "Minimal build test",
|
59
|
+
"main": "index.js",
|
60
|
+
"scripts": {
|
61
|
+
"build": "echo Build test successful"
|
62
|
+
}
|
63
|
+
}
|
64
|
+
"@ | Set-Content -Path "package.json"
|
65
|
+
|
66
|
+
# Attempt build
|
67
|
+
npm run build | Out-Null
|
68
|
+
$buildSuccess = $true
|
69
|
+
|
70
|
+
# Create minimal test file
|
71
|
+
@"
|
72
|
+
console.log('Test successful');
|
73
|
+
"@ | Set-Content -Path "index.js"
|
74
|
+
|
75
|
+
# Run basic test
|
76
|
+
node index.js | Out-Null
|
77
|
+
$testSuccess = $true
|
78
|
+
|
79
|
+
} catch {
|
80
|
+
Write-Output "❌ Build test failed: $($_.Exception.Message)"
|
81
|
+
} finally {
|
82
|
+
Pop-Location
|
83
|
+
if (Test-Path $testDir) {
|
84
|
+
Remove-Item -Path $testDir -Recurse -Force
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
# Display results
|
89
|
+
if ($buildSuccess -and $testSuccess) {
|
90
|
+
Write-Output "✅ Minimal build test passed successfully"
|
91
|
+
return $true
|
92
|
+
} else {
|
93
|
+
if (-not $buildSuccess) {
|
94
|
+
Write-Output "❌ Build process failed"
|
95
|
+
}
|
96
|
+
if (-not $testSuccess) {
|
97
|
+
Write-Output "❌ Basic functionality test failed"
|
98
|
+
}
|
99
|
+
return $false
|
100
|
+
}
|
101
|
+
}
|
102
|
+
```
|
103
|
+
|
104
|
+
## 📋 MINIMAL BUILD TEST CHECKPOINT
|
105
|
+
|
106
|
+
```
|
107
|
+
✓ CHECKPOINT: MINIMAL BUILD TEST
|
108
|
+
- Test project creation successful? [YES/NO]
|
109
|
+
- Build process completed successfully? [YES/NO]
|
110
|
+
- Basic functionality test passed? [YES/NO]
|
111
|
+
|
112
|
+
→ If all YES: QA Validation complete, proceed to generate success report.
|
113
|
+
→ If any NO: Fix build issues before continuing.
|
114
|
+
```
|
115
|
+
|
116
|
+
**Next Step (on PASS):** Load `van-qa-utils/reports.mdc` to generate success report.
|
117
|
+
**Next Step (on FAIL):** Check `van-qa-utils/common-fixes.mdc` for build test fixes.
|
@@ -0,0 +1,103 @@
|
|
1
|
+
---
|
2
|
+
description: Process map for VAN QA configuration validation
|
3
|
+
globs: van-qa-checks/config-check.mdc
|
4
|
+
alwaysApply: false
|
5
|
+
---
|
6
|
+
# VAN QA: CONFIGURATION VALIDATION
|
7
|
+
|
8
|
+
> **TL;DR:** This component validates configuration files for proper syntax and compatibility with the project and platform.
|
9
|
+
|
10
|
+
## 2️⃣ CONFIGURATION VALIDATION PROCESS
|
11
|
+
|
12
|
+
```mermaid
|
13
|
+
graph TD
|
14
|
+
Start["Configuration Validation"] --> IdentifyConfigs["Identify Configuration<br>Files"]
|
15
|
+
IdentifyConfigs --> ReadConfigs["Read Configuration<br>Files"]
|
16
|
+
ReadConfigs --> ValidateSyntax["Validate Syntax<br>and Format"]
|
17
|
+
ValidateSyntax --> SyntaxStatus{"Syntax<br>Valid?"}
|
18
|
+
|
19
|
+
SyntaxStatus -->|"Yes"| CheckCompatibility["Check Compatibility<br>with Platform"]
|
20
|
+
SyntaxStatus -->|"No"| FixSyntax["Fix Syntax<br>Errors"]
|
21
|
+
FixSyntax --> RetryValidate["Retry Validation"]
|
22
|
+
RetryValidate --> SyntaxStatus
|
23
|
+
|
24
|
+
CheckCompatibility --> CompatStatus{"Compatible with<br>Platform?"}
|
25
|
+
CompatStatus -->|"Yes"| ConfigSuccess["Configurations Validated<br>✅ PASS"]
|
26
|
+
CompatStatus -->|"No"| AdaptConfigs["Adapt Configurations<br>for Platform"]
|
27
|
+
AdaptConfigs --> RetryCompat["Retry Compatibility<br>Check"]
|
28
|
+
RetryCompat --> CompatStatus
|
29
|
+
|
30
|
+
style Start fill:#4da6ff,stroke:#0066cc,color:white
|
31
|
+
style ConfigSuccess fill:#10b981,stroke:#059669,color:white
|
32
|
+
style SyntaxStatus fill:#f6546a,stroke:#c30052,color:white
|
33
|
+
style CompatStatus fill:#f6546a,stroke:#c30052,color:white
|
34
|
+
```
|
35
|
+
|
36
|
+
### Configuration Validation Implementation:
|
37
|
+
```powershell
|
38
|
+
# Example: Validate configuration files for a web project
|
39
|
+
function Validate-Configurations {
|
40
|
+
$configFiles = @(
|
41
|
+
"package.json",
|
42
|
+
"tsconfig.json",
|
43
|
+
"vite.config.js"
|
44
|
+
)
|
45
|
+
|
46
|
+
$invalidConfigs = @()
|
47
|
+
$incompatibleConfigs = @()
|
48
|
+
|
49
|
+
foreach ($configFile in $configFiles) {
|
50
|
+
if (Test-Path $configFile) {
|
51
|
+
# Check JSON syntax for JSON files
|
52
|
+
if ($configFile -match "\.json$") {
|
53
|
+
try {
|
54
|
+
Get-Content $configFile -Raw | ConvertFrom-Json | Out-Null
|
55
|
+
} catch {
|
56
|
+
$invalidConfigs += "$configFile (JSON syntax error: $($_.Exception.Message))"
|
57
|
+
continue
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
# Specific configuration compatibility checks
|
62
|
+
if ($configFile -eq "vite.config.js") {
|
63
|
+
$content = Get-Content $configFile -Raw
|
64
|
+
# Check for React plugin in Vite config
|
65
|
+
if ($content -notmatch "react\(\)") {
|
66
|
+
$incompatibleConfigs += "$configFile (Missing React plugin for React project)"
|
67
|
+
}
|
68
|
+
}
|
69
|
+
} else {
|
70
|
+
$invalidConfigs += "$configFile (file not found)"
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
# Display results
|
75
|
+
if ($invalidConfigs.Count -eq 0 -and $incompatibleConfigs.Count -eq 0) {
|
76
|
+
Write-Output "✅ All configurations validated and compatible"
|
77
|
+
return $true
|
78
|
+
} else {
|
79
|
+
if ($invalidConfigs.Count -gt 0) {
|
80
|
+
Write-Output "❌ Invalid configurations: $($invalidConfigs -join ', ')"
|
81
|
+
}
|
82
|
+
if ($incompatibleConfigs.Count -gt 0) {
|
83
|
+
Write-Output "❌ Incompatible configurations: $($incompatibleConfigs -join ', ')"
|
84
|
+
}
|
85
|
+
return $false
|
86
|
+
}
|
87
|
+
}
|
88
|
+
```
|
89
|
+
|
90
|
+
## 📋 CONFIGURATION VALIDATION CHECKPOINT
|
91
|
+
|
92
|
+
```
|
93
|
+
✓ CHECKPOINT: CONFIGURATION VALIDATION
|
94
|
+
- All configuration files found? [YES/NO]
|
95
|
+
- All configuration syntax valid? [YES/NO]
|
96
|
+
- All configurations compatible with platform? [YES/NO]
|
97
|
+
|
98
|
+
→ If all YES: Continue to Environment Validation.
|
99
|
+
→ If any NO: Fix configuration issues before continuing.
|
100
|
+
```
|
101
|
+
|
102
|
+
**Next Step (on PASS):** Load `van-qa-checks/environment-check.mdc`.
|
103
|
+
**Next Step (on FAIL):** Check `van-qa-utils/common-fixes.mdc` for configuration fixes.
|
data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-checks/dependency-check.mdc
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
---
|
2
|
+
description: Process map for VAN QA dependency verification
|
3
|
+
globs: van-qa-checks/dependency-check.mdc
|
4
|
+
alwaysApply: false
|
5
|
+
---
|
6
|
+
# VAN QA: DEPENDENCY VERIFICATION
|
7
|
+
|
8
|
+
> **TL;DR:** This component verifies that all required dependencies are installed and compatible with the project requirements.
|
9
|
+
|
10
|
+
## 1️⃣ DEPENDENCY VERIFICATION PROCESS
|
11
|
+
|
12
|
+
```mermaid
|
13
|
+
graph TD
|
14
|
+
Start["Dependency Verification"] --> ReadDeps["Read Required Dependencies<br>from Creative Phase"]
|
15
|
+
ReadDeps --> CheckInstalled["Check if Dependencies<br>are Installed"]
|
16
|
+
CheckInstalled --> DepStatus{"All Dependencies<br>Installed?"}
|
17
|
+
|
18
|
+
DepStatus -->|"Yes"| VerifyVersions["Verify Versions<br>and Compatibility"]
|
19
|
+
DepStatus -->|"No"| InstallMissing["Install Missing<br>Dependencies"]
|
20
|
+
InstallMissing --> VerifyVersions
|
21
|
+
|
22
|
+
VerifyVersions --> VersionStatus{"Versions<br>Compatible?"}
|
23
|
+
VersionStatus -->|"Yes"| DepSuccess["Dependencies Verified<br>✅ PASS"]
|
24
|
+
VersionStatus -->|"No"| UpgradeVersions["Upgrade/Downgrade<br>as Needed"]
|
25
|
+
UpgradeVersions --> RetryVerify["Retry Verification"]
|
26
|
+
RetryVerify --> VersionStatus
|
27
|
+
|
28
|
+
style Start fill:#4da6ff,stroke:#0066cc,color:white
|
29
|
+
style DepSuccess fill:#10b981,stroke:#059669,color:white
|
30
|
+
style DepStatus fill:#f6546a,stroke:#c30052,color:white
|
31
|
+
style VersionStatus fill:#f6546a,stroke:#c30052,color:white
|
32
|
+
```
|
33
|
+
|
34
|
+
### Windows (PowerShell) Implementation:
|
35
|
+
```powershell
|
36
|
+
# Example: Verify Node.js dependencies for a React project
|
37
|
+
function Verify-Dependencies {
|
38
|
+
$requiredDeps = @{ "node" = ">=14.0.0"; "npm" = ">=6.0.0" }
|
39
|
+
$missingDeps = @(); $incompatibleDeps = @()
|
40
|
+
|
41
|
+
# Check Node.js version
|
42
|
+
try {
|
43
|
+
$nodeVersion = node -v
|
44
|
+
if ($nodeVersion -match "v(\d+)\.(\d+)\.(\d+)") {
|
45
|
+
$major = [int]$Matches[1]
|
46
|
+
if ($major -lt 14) {
|
47
|
+
$incompatibleDeps += "node (found $nodeVersion, required >=14.0.0)"
|
48
|
+
}
|
49
|
+
}
|
50
|
+
} catch {
|
51
|
+
$missingDeps += "node"
|
52
|
+
}
|
53
|
+
|
54
|
+
# Check npm version
|
55
|
+
try {
|
56
|
+
$npmVersion = npm -v
|
57
|
+
if ($npmVersion -match "(\d+)\.(\d+)\.(\d+)") {
|
58
|
+
$major = [int]$Matches[1]
|
59
|
+
if ($major -lt 6) {
|
60
|
+
$incompatibleDeps += "npm (found $npmVersion, required >=6.0.0)"
|
61
|
+
}
|
62
|
+
}
|
63
|
+
} catch {
|
64
|
+
$missingDeps += "npm"
|
65
|
+
}
|
66
|
+
|
67
|
+
# Display results
|
68
|
+
if ($missingDeps.Count -eq 0 -and $incompatibleDeps.Count -eq 0) {
|
69
|
+
Write-Output "✅ All dependencies verified and compatible"
|
70
|
+
return $true
|
71
|
+
} else {
|
72
|
+
if ($missingDeps.Count -gt 0) {
|
73
|
+
Write-Output "❌ Missing dependencies: $($missingDeps -join ', ')"
|
74
|
+
}
|
75
|
+
if ($incompatibleDeps.Count -gt 0) {
|
76
|
+
Write-Output "❌ Incompatible versions: $($incompatibleDeps -join ', ')"
|
77
|
+
}
|
78
|
+
return $false
|
79
|
+
}
|
80
|
+
}
|
81
|
+
```
|
82
|
+
|
83
|
+
### Mac/Linux (Bash) Implementation:
|
84
|
+
```bash
|
85
|
+
#!/bin/bash
|
86
|
+
|
87
|
+
# Example: Verify Node.js dependencies for a React project
|
88
|
+
verify_dependencies() {
|
89
|
+
local missing_deps=()
|
90
|
+
local incompatible_deps=()
|
91
|
+
|
92
|
+
# Check Node.js version
|
93
|
+
if command -v node &> /dev/null; then
|
94
|
+
local node_version=$(node -v)
|
95
|
+
if [[ $node_version =~ v([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
|
96
|
+
local major=${BASH_REMATCH[1]}
|
97
|
+
if (( major < 14 )); then
|
98
|
+
incompatible_deps+=("node (found $node_version, required >=14.0.0)")
|
99
|
+
fi
|
100
|
+
fi
|
101
|
+
else
|
102
|
+
missing_deps+=("node")
|
103
|
+
fi
|
104
|
+
|
105
|
+
# Check npm version
|
106
|
+
if command -v npm &> /dev/null; then
|
107
|
+
local npm_version=$(npm -v)
|
108
|
+
if [[ $npm_version =~ ([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
|
109
|
+
local major=${BASH_REMATCH[1]}
|
110
|
+
if (( major < 6 )); then
|
111
|
+
incompatible_deps+=("npm (found $npm_version, required >=6.0.0)")
|
112
|
+
fi
|
113
|
+
fi
|
114
|
+
else
|
115
|
+
missing_deps+=("npm")
|
116
|
+
fi
|
117
|
+
|
118
|
+
# Display results
|
119
|
+
if [ ${#missing_deps[@]} -eq 0 ] && [ ${#incompatible_deps[@]} -eq 0 ]; then
|
120
|
+
echo "✅ All dependencies verified and compatible"
|
121
|
+
return 0
|
122
|
+
else
|
123
|
+
if [ ${#missing_deps[@]} -gt 0 ]; then
|
124
|
+
echo "❌ Missing dependencies: ${missing_deps[*]}"
|
125
|
+
fi
|
126
|
+
if [ ${#incompatible_deps[@]} -gt 0 ]; then
|
127
|
+
echo "❌ Incompatible versions: ${incompatible_deps[*]}"
|
128
|
+
fi
|
129
|
+
return 1
|
130
|
+
fi
|
131
|
+
}
|
132
|
+
```
|
133
|
+
|
134
|
+
## 📋 DEPENDENCY VERIFICATION CHECKPOINT
|
135
|
+
|
136
|
+
```
|
137
|
+
✓ CHECKPOINT: DEPENDENCY VERIFICATION
|
138
|
+
- Required dependencies identified? [YES/NO]
|
139
|
+
- All dependencies installed? [YES/NO]
|
140
|
+
- All versions compatible? [YES/NO]
|
141
|
+
|
142
|
+
→ If all YES: Continue to Configuration Validation.
|
143
|
+
→ If any NO: Fix dependency issues before continuing.
|
144
|
+
```
|
145
|
+
|
146
|
+
**Next Step (on PASS):** Load `van-qa-checks/config-check.mdc`.
|
147
|
+
**Next Step (on FAIL):** Check `van-qa-utils/common-fixes.mdc` for dependency fixes.
|
data/.cursor/rules/isolation_rules/visual-maps/van_mode_split/van-qa-checks/environment-check.mdc
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
---
|
2
|
+
description: Process map for VAN QA environment validation
|
3
|
+
globs: van-qa-checks/environment-check.mdc
|
4
|
+
alwaysApply: false
|
5
|
+
---
|
6
|
+
# VAN QA: ENVIRONMENT VALIDATION
|
7
|
+
|
8
|
+
> **TL;DR:** This component verifies that the build environment is properly set up with required tools and permissions.
|
9
|
+
|
10
|
+
## 3️⃣ ENVIRONMENT VALIDATION PROCESS
|
11
|
+
|
12
|
+
```mermaid
|
13
|
+
graph TD
|
14
|
+
Start["Environment Validation"] --> CheckEnv["Check Build Environment"]
|
15
|
+
CheckEnv --> VerifyBuildTools["Verify Build Tools"]
|
16
|
+
VerifyBuildTools --> ToolsStatus{"Build Tools<br>Available?"}
|
17
|
+
|
18
|
+
ToolsStatus -->|"Yes"| CheckPerms["Check Permissions<br>and Access"]
|
19
|
+
ToolsStatus -->|"No"| InstallTools["Install Required<br>Build Tools"]
|
20
|
+
InstallTools --> RetryTools["Retry Verification"]
|
21
|
+
RetryTools --> ToolsStatus
|
22
|
+
|
23
|
+
CheckPerms --> PermsStatus{"Permissions<br>Sufficient?"}
|
24
|
+
PermsStatus -->|"Yes"| EnvSuccess["Environment Validated<br>✅ PASS"]
|
25
|
+
PermsStatus -->|"No"| FixPerms["Fix Permission<br>Issues"]
|
26
|
+
FixPerms --> RetryPerms["Retry Permission<br>Check"]
|
27
|
+
RetryPerms --> PermsStatus
|
28
|
+
|
29
|
+
style Start fill:#4da6ff,stroke:#0066cc,color:white
|
30
|
+
style EnvSuccess fill:#10b981,stroke:#059669,color:white
|
31
|
+
style ToolsStatus fill:#f6546a,stroke:#c30052,color:white
|
32
|
+
style PermsStatus fill:#f6546a,stroke:#c30052,color:white
|
33
|
+
```
|
34
|
+
|
35
|
+
### Environment Validation Implementation:
|
36
|
+
```powershell
|
37
|
+
# Example: Validate environment for a web project
|
38
|
+
function Validate-Environment {
|
39
|
+
$requiredTools = @(
|
40
|
+
@{Name = "git"; Command = "git --version"},
|
41
|
+
@{Name = "node"; Command = "node --version"},
|
42
|
+
@{Name = "npm"; Command = "npm --version"}
|
43
|
+
)
|
44
|
+
|
45
|
+
$missingTools = @()
|
46
|
+
$permissionIssues = @()
|
47
|
+
|
48
|
+
# Check build tools
|
49
|
+
foreach ($tool in $requiredTools) {
|
50
|
+
try {
|
51
|
+
Invoke-Expression $tool.Command | Out-Null
|
52
|
+
} catch {
|
53
|
+
$missingTools += $tool.Name
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
# Check write permissions in project directory
|
58
|
+
try {
|
59
|
+
$testFile = ".__permission_test"
|
60
|
+
New-Item -Path $testFile -ItemType File -Force | Out-Null
|
61
|
+
Remove-Item -Path $testFile -Force
|
62
|
+
} catch {
|
63
|
+
$permissionIssues += "Current directory (write permission denied)"
|
64
|
+
}
|
65
|
+
|
66
|
+
# Check if port 3000 is available (commonly used for dev servers)
|
67
|
+
try {
|
68
|
+
$listener = New-Object System.Net.Sockets.TcpListener([System.Net.IPAddress]::Loopback, 3000)
|
69
|
+
$listener.Start()
|
70
|
+
$listener.Stop()
|
71
|
+
} catch {
|
72
|
+
$permissionIssues += "Port 3000 (already in use or access denied)"
|
73
|
+
}
|
74
|
+
|
75
|
+
# Display results
|
76
|
+
if ($missingTools.Count -eq 0 -and $permissionIssues.Count -eq 0) {
|
77
|
+
Write-Output "✅ Environment validated successfully"
|
78
|
+
return $true
|
79
|
+
} else {
|
80
|
+
if ($missingTools.Count -gt 0) {
|
81
|
+
Write-Output "❌ Missing tools: $($missingTools -join ', ')"
|
82
|
+
}
|
83
|
+
if ($permissionIssues.Count -gt 0) {
|
84
|
+
Write-Output "❌ Permission issues: $($permissionIssues -join ', ')"
|
85
|
+
}
|
86
|
+
return $false
|
87
|
+
}
|
88
|
+
}
|
89
|
+
```
|
90
|
+
|
91
|
+
## 📋 ENVIRONMENT VALIDATION CHECKPOINT
|
92
|
+
|
93
|
+
```
|
94
|
+
✓ CHECKPOINT: ENVIRONMENT VALIDATION
|
95
|
+
- All required build tools installed? [YES/NO]
|
96
|
+
- Project directory permissions sufficient? [YES/NO]
|
97
|
+
- Required ports available? [YES/NO]
|
98
|
+
|
99
|
+
→ If all YES: Continue to Minimal Build Test.
|
100
|
+
→ If any NO: Fix environment issues before continuing.
|
101
|
+
```
|
102
|
+
|
103
|
+
**Next Step (on PASS):** Load `van-qa-checks/build-test.mdc`.
|
104
|
+
**Next Step (on FAIL):** Check `van-qa-utils/common-fixes.mdc` for environment fixes.
|