Skip to main content

/verify-installation Command

System Prompt

⚠️ EXECUTION DIRECTIVE: When the user invokes this command, you MUST:

  1. IMMEDIATELY execute - no questions, no explanations first
  2. ALWAYS show full output from script/tool execution
  3. ALWAYS provide summary after execution completes

DO NOT:

  • Say "I don't need to take action" - you ALWAYS execute when invoked
  • Ask for confirmation unless requires_confirmation: true in frontmatter
  • Skip execution even if it seems redundant - run it anyway

The user invoking the command IS the confirmation.


Purpose

Comprehensive installation verification to ensure binaries are correctly installed, accessible, and match expected checksums and versions.

Usage

# Verify current installation
/verify-installation

# Verify specific product
/verify-installation coditect

# Verify checksum against manifest
/verify-installation --checksum --manifest https://cdn.example.com/stable/manifest.json

# Verify PATH accessibility
/verify-installation --path

# Verify expected version
/verify-installation --version 1.2.0

# Run all checks
/verify-installation --all

# Verify and attempt fixes
/verify-installation --all --fix

Action Policy

Verification Checks

CheckDescriptionSeverity
Binary existsFile present at expected pathCritical
ExecutableHas execute permissionsCritical
In PATHAccessible without full pathWarning
Version matchMatches expected versionWarning
Checksum validSHA256 matches manifestCritical
Not corruptedBinary runs without errorCritical

Verification Workflow

1. Locate Installation
└─> Search standard paths
└─> Check PATH directories
└─> Identify binary location

2. Binary Validation
└─> Check file exists
└─> Verify executable permission
└─> Test basic execution (--version)

3. Checksum Verification (if --checksum)
└─> Fetch manifest from CDN
└─> Calculate local SHA256
└─> Compare against manifest

4. Version Verification (if --version)
└─> Run binary --version
└─> Parse version output
└─> Compare against expected

5. Report Results
└─> Display check results
└─> Provide fix suggestions
└─> Exit with appropriate code

Output

Success Output (--all)

╭─────────────────────────────────────────────╮
│ Installation Verification │
├─────────────────────────────────────────────┤
│ Product: coditect │
│ Path: /usr/local/bin/coditect │
│ Version: 1.2.0 │
├─────────────────────────────────────────────┤
│ Checks: │
│ ✓ Binary exists │
│ ✓ Executable permissions │
│ ✓ In PATH │
│ ✓ Version matches (1.2.0) │
│ ✓ Checksum valid │
│ ✓ Binary executes correctly │
├─────────────────────────────────────────────┤
│ Status: HEALTHY │
╰─────────────────────────────────────────────╯

Failure Output

╭─────────────────────────────────────────────╮
│ Installation Verification │
├─────────────────────────────────────────────┤
│ Product: coditect │
│ Path: ~/.local/bin/coditect │
├─────────────────────────────────────────────┤
│ Checks: │
│ ✓ Binary exists │
│ ✓ Executable permissions │
│ ✗ Not in PATH │
│ ✓ Version matches (1.2.0) │
│ ✗ Checksum mismatch │
│ ✓ Binary executes correctly │
├─────────────────────────────────────────────┤
│ Issues Found: │
│ │
│ PATH not configured: │
│ Add to ~/.zshrc: │
│ export PATH="$PATH:$HOME/.local/bin" │
│ │
│ Checksum mismatch: │
│ Expected: abc123... │
│ Actual: def456... │
│ Binary may be corrupted or tampered. │
│ Re-install with: curl ... | bash │
├─────────────────────────────────────────────┤
│ Status: ISSUES FOUND (2 warnings, 1 error) │
╰─────────────────────────────────────────────╯

Fix Mode Output (--fix)

╭─────────────────────────────────────────────╮
│ Installation Verification (Fix Mode) │
├─────────────────────────────────────────────┤
│ Issue: Not in PATH │
│ Action: Added ~/.local/bin to ~/.zshrc │
│ Result: ✓ Fixed │
├─────────────────────────────────────────────┤
│ Issue: Checksum mismatch │
│ Action: Re-downloading binary... │
│ Result: ✓ Fixed (new checksum matches) │
├─────────────────────────────────────────────┤
│ Status: ALL ISSUES RESOLVED │
╰─────────────────────────────────────────────╯

Exit Codes

CodeMeaning
0All checks passed
1One or more checks failed
2Binary not found
3Checksum mismatch (potential tampering)

Standard Search Paths

Unix/Linux/macOS

~/.local/bin/               # XDG user bin (preferred)
/usr/local/bin/ # System local bin
~/bin/ # Legacy user bin
/opt/product/bin/ # Optional packages

Windows

%LOCALAPPDATA%\product\bin\  # User local (preferred)
%PROGRAMFILES%\product\ # Program Files
%USERPROFILE%\bin\ # User bin

Error Handling

Common Errors

Binary not found:

ERROR: coditect binary not found
SEARCH PATHS:
- ~/.local/bin/coditect (not found)
- /usr/local/bin/coditect (not found)
FIX: Install using:
curl -fsSL https://example.com/install.sh | bash

Checksum mismatch:

ERROR: Checksum verification failed
This may indicate a corrupted download or tampering.
EXPECTED: abc123def456...
ACTUAL: xyz789uvw012...
FIX: Re-download the binary
curl -fsSL https://example.com/install.sh | bash
Or verify manually: sha256sum /path/to/binary

Version mismatch:

WARNING: Version mismatch
Installed: 1.1.0
Expected: 1.2.0
FIX: Upgrade using:
curl -fsSL https://example.com/install.sh | bash -s 1.2.0

Examples

Quick Health Check

User: /verify-installation

Agent: Running installation verification for auto-detected product...

✓ Binary exists at ~/.local/bin/coditect
✓ Executable permissions set
✓ Found in PATH
✓ Version: 1.2.0

Status: HEALTHY

Full Verification with Fix

User: /verify-installation coditect --all --fix

Agent: Running comprehensive verification with auto-fix...

[Checking binary existence... ✓]
[Checking permissions... ✓]
[Checking PATH... ✗ Not in PATH]
→ Adding ~/.local/bin to ~/.zshrc
→ Fixed ✓
[Verifying checksum... ✓]
[Verifying version... ✓]

All checks passed after fixes applied.
Run `source ~/.zshrc` to update PATH in current session.

Action Policy

<default_behavior> This command analyzes installation status without making changes unless --fix specified. Provides:

  • Comprehensive verification results
  • Specific fix commands for issues
  • Clear pass/fail status

User decides whether to apply fixes. </default_behavior>

After verification, confirm: - All checks executed - Issues clearly identified - Fix commands accurate - Exit code matches status

Success Output

When installation verification completes:

✅ COMMAND COMPLETE: /verify-installation
Product: <product-name>
Path: <install-path>
Version: <version>
Checks: N/N passed
Status: HEALTHY|ISSUES FOUND

Completion Checklist

Before marking complete:

  • Binary located
  • Permissions verified
  • PATH checked
  • Version validated
  • Checksum verified (if requested)

Failure Indicators

This command has FAILED if:

  • ❌ Binary not found
  • ❌ Checksum mismatch (tampering risk)
  • ❌ Binary not executable
  • ❌ Version cannot be determined

When NOT to Use

Do NOT use when:

  • Need to install (use installer script)
  • Need to upgrade version
  • Binary never installed

Anti-Patterns (Avoid)

Anti-PatternProblemSolution
Ignore checksum mismatchSecurity riskRe-download binary
Skip PATH checkUsage confusionEnsure PATH configured
Force fix without reviewUnintended changesReview issues first

Principles

This command embodies:

  • #9 Based on Facts - Verify actual state
  • #6 Clear, Understandable - Visual pass/fail

Full Standard: CODITECT-STANDARD-AUTOMATION.md