-
Notifications
You must be signed in to change notification settings - Fork 1
Add User QoL install considerations to AI_AGENTS.md #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -131,3 +131,177 @@ If this returns results, something violated the rules. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| *This file is the source of truth for AI agent behavior in this workspace.* | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## User QoL (Quality of Life) Considerations on Install | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| *SAIF-processes/methodology — Structured AI Integration Framework* | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| When setting up the Wave Toolkit or any SpiralSafe ecosystem repository, follow these installation QoL principles to ensure smooth onboarding and consistent execution across sessions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### 1. Absolute References | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Always use absolute paths** rather than relative paths in scripts and configurations: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```powershell | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # ✅ Good: Absolute references | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $WaveToolkitPath = "$HOME\wave-toolkit" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $ScriptPath = Join-Path $WaveToolkitPath "scripts\system" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| # ❌ Bad: Relative paths that break when working directory changes | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $ScriptPath = ".\scripts\system" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Why it matters:** | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - AI agents may execute from different working directories | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Cron jobs and scheduled tasks don't inherit the expected `$PWD` | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Sub-processes spawned by agents start with unpredictable paths | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Cross-session persistence requires stable path anchors | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Use these environment-aware patterns:** | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```powershell | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Repository root detection (PowerShell 7+ ternary, or if-else for 5.1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $gitRoot = git rev-parse --show-toplevel 2>$null | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $RepoRoot = if ($gitRoot) { $gitRoot } else { $PSScriptRoot } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Cross-platform home directory | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $UserHome = if ($IsWindows) { $env:USERPROFILE } else { $env:HOME } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+168
to
+169
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Cross-platform home directory | |
| $UserHome = if ($IsWindows) { $env:USERPROFILE } else { $env:HOME } | |
| # Cross-platform home directory (PowerShell 5.1+ safe) | |
| $UserHome = if ($env:HOME) { $env:HOME } else { $env:USERPROFILE } |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alias touch pointing to New-Item is incomplete and will not work as expected for creating empty files (the typical Unix touch behavior). New-Item requires additional parameters like -ItemType File. Consider changing this to a function wrapper instead: function touch { New-Item -ItemType File -Path $args }
| Set-Alias -Name touch -Value New-Item -Scope Global | |
| function touch { | |
| New-Item -ItemType File -Path $args | |
| } |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Set-Alias command with -Scope Global may not work as expected within a script context unless the script is dot-sourced. When run in a script, global aliases typically only persist for the script's session and do not automatically persist to the user's profile. Consider clarifying that these aliases should be added to the PowerShell profile for persistence, or that the script containing them should be dot-sourced.
| Set-Alias -Name ll -Value Get-ChildItem -Scope Global | |
| Set-Alias -Name grep -Value Select-String -Scope Global | |
| Set-Alias -Name touch -Value New-Item -Scope Global | |
| Set-Alias -Name which -Value Get-Command -Scope Global | |
| # Export for persistence | |
| # For persistence, add these lines to your PowerShell profile (e.g. $PROFILE) | |
| # or dot-source a script that defines them: . "$WaveRoot\tools\aliases.ps1" | |
| Set-Alias -Name ll -Value Get-ChildItem | |
| Set-Alias -Name grep -Value Select-String | |
| Set-Alias -Name touch -Value New-Item | |
| Set-Alias -Name which -Value Get-Command | |
| # Export for persistence when used inside a module |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Export-ModuleMember -Alias * -Function * command should only be used in module files (.psm1), not in profile scripts or standalone scripts. If these aliases are being defined in a profile or script, this line will cause an error. Consider clarifying the context where this command should be used, or providing separate examples for module vs profile scenarios.
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PowerShell module cache path ~/.local/share/powershell/Modules is the Linux/macOS path for PowerShell modules. On Windows, the user module path is typically $HOME\Documents\PowerShell\Modules (PowerShell 7+) or $HOME\Documents\WindowsPowerShell\Modules (PowerShell 5.1). Consider using a platform-specific path or providing examples for different operating systems to ensure the cache works correctly in CI environments.
| # PowerShell module caching (manual) | |
| - name: Cache PowerShell modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.local/share/powershell/Modules | |
| key: ${{ runner.os }}-pwsh-${{ hashFiles('**/requirements.psd1') }} | |
| # PowerShell module caching (manual, OS-specific paths) | |
| # Linux/macOS | |
| - name: Cache PowerShell modules (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.local/share/powershell/Modules | |
| key: ${{ runner.os }}-pwsh-${{ hashFiles('**/requirements.psd1') }} | |
| # Windows | |
| - name: Cache PowerShell modules (Windows) | |
| if: runner.os == 'Windows' | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ env.USERPROFILE }}\Documents\PowerShell\Modules | |
| ${{ env.USERPROFILE }}\Documents\WindowsPowerShell\Modules | |
| key: ${{ runner.os }}-pwsh-${{ hashFiles('**/requirements.psd1') }} |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table row for "Profile is writable" checks Test-Path $PROFILE, but this command only verifies if the profile file exists, not whether it's writable. To actually verify write permissions, consider using: Test-Path $PROFILE -PathType Leaf -ErrorAction SilentlyContinue; (Get-Item $PROFILE -ErrorAction SilentlyContinue).IsReadOnly -eq $false or a similar approach that specifically checks write access.
| | Profile is writable | `Test-Path $PROFILE` | Create profile directory | | |
| | Profile is writable | `Test-Path $PROFILE -PathType Leaf -ErrorAction SilentlyContinue -and -not (Get-Item $PROFILE -ErrorAction SilentlyContinue).IsReadOnly` | Create profile directory | |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command git branch --show-current requires Git 2.22 or later (released in June 2019). While this is generally safe to assume in modern environments, for broader compatibility with older Git installations, consider using: git rev-parse --abbrev-ref HEAD as an alternative, or document the Git version requirement in the prerequisites.
| Branch = git branch --show-current | |
| Branch = git rev-parse --abbrev-ref HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment mentions "PowerShell 7+ ternary" but the code example shown uses the if-else syntax that is compatible with PowerShell 5.1, not the ternary operator. The ternary operator in PowerShell 7+ would be:
$RepoRoot = $gitRoot ?? $PSScriptRoot. Consider updating the comment to accurately reflect that this example is specifically for PowerShell 5.1 compatibility, or clarify that both syntaxes work but this one is more compatible.