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
67 changes: 67 additions & 0 deletions spectr/specs/shell-utilities/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Shell Utilities Specification

## Purpose

TODO: Add purpose description
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fill in the Purpose section before archiving.

This PR is marked as archiving a "completed change," but the Purpose section contains a TODO placeholder. Since the change is considered complete, the purpose should be documented to provide context for consumers of this specification.

Suggested addition:

 ## Purpose
 
-TODO: Add purpose description
+Defines the `nvimf` fuzzy file selection utility that integrates fzf for interactive file discovery with bat-powered syntax highlighting and Neovim integration for seamless editing workflows.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
TODO: Add purpose description
Defines the `nvimf` fuzzy file selection utility that integrates fzf for interactive file discovery with bat-powered syntax highlighting and Neovim integration for seamless editing workflows.
🤖 Prompt for AI Agents
In spectr/specs/shell-utilities/spec.md at line 5, the Purpose section contains
a TODO placeholder; replace the placeholder with a concise purpose statement
describing what this specification covers (who the consumers are, the problem it
solves, and the intended scope/behavior) so the document documents its intent
before archiving.


## Requirements

### Requirement: Fuzzy File Opening (nvimf)
The system SHALL provide an `nvimf` command that enables interactive fuzzy file selection with syntax-highlighted preview and opens the selected file in Neovim.

#### Scenario: Interactive file selection
- **WHEN** user runs `nvimf` without arguments in a directory
- **THEN** the system displays an interactive fuzzy finder listing all files in the current directory and subdirectories
- **AND** shows a syntax-highlighted preview using bat for the selected file
- **AND** opens the selected file in Neovim upon confirmation

#### Scenario: No file selected
- **WHEN** user runs `nvimf` and cancels the selection (ESC or Ctrl-C)
- **THEN** the system exits without opening any file
- **AND** returns a zero exit code (graceful cancellation)

#### Scenario: Empty directory
- **WHEN** user runs `nvimf` in a directory with no files
- **THEN** the system displays an empty fuzzy finder
- **AND** exits gracefully when canceled

#### Scenario: Editor integration
- **WHEN** user selects a file from the fuzzy finder
- **THEN** the system opens the file in Neovim
- **AND** preserves the terminal state and working directory

### Requirement: Cross-Platform File Selection Deployment
The `nvimf` program SHALL be deployed as a packaged Nix derivation with proper dependency management.

#### Scenario: NixOS installation
- **WHEN** nvimf module is enabled on a NixOS system
- **THEN** the `nvimf` command is available in system PATH
- **AND** required dependencies (fzf, bat, neovim) are automatically available

#### Scenario: Darwin installation
- **WHEN** nvimf module is enabled on a macOS system via nix-darwin
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove redundant "system" after macOS.

"macOS" already denotes the operating system, so appending "system" is redundant.

Apply this diff:

-- **WHEN** nvimf module is enabled on a macOS system via nix-darwin
+- **WHEN** nvimf module is enabled on macOS via nix-darwin
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **WHEN** nvimf module is enabled on a macOS system via nix-darwin
- **WHEN** nvimf module is enabled on macOS via nix-darwin
🧰 Tools
🪛 LanguageTool

[style] ~42-~42: This phrase is redundant (‘OS’ stands for ‘operating system’). Use simply “macOS”.
Context: ...- WHEN nvimf module is enabled on a macOS system via nix-darwin - THEN the nvimf c...

(ACRONYM_TAUTOLOGY)

🤖 Prompt for AI Agents
In spectr/specs/shell-utilities/spec.md around line 42, remove the redundant
word "system" from the phrase "macOS system" so it reads "macOS"; update the
line to: "**WHEN** nvimf module is enabled on a macOS via nix-darwin" (or
preferably "**WHEN** nvimf module is enabled on macOS via nix-darwin") to
eliminate redundancy and keep wording natural.

- **THEN** the `nvimf` command is available in system PATH
- **AND** required dependencies are automatically available

#### Scenario: Engineer feature integration
- **WHEN** the engineer feature is enabled
- **THEN** nvimf is automatically available alongside other development tools

### Requirement: Preview and Dependency Management
The nvimf program SHALL explicitly declare its runtime dependencies (fzf, bat, neovim) and provide syntax-highlighted file previews.

#### Scenario: Syntax highlighting in preview
- **WHEN** user navigates through files in the fuzzy finder
- **THEN** the preview pane shows syntax-highlighted content for recognized file types
- **AND** uses bat's automatic language detection

#### Scenario: Missing dependencies handled by Nix
- **WHEN** nvimf module is installed via Nix
- **THEN** all runtime dependencies are available in the wrapped script's PATH
- **AND** the script does not fail due to missing commands

#### Scenario: Script wrapper isolation
- **WHEN** nvimf script is executed
- **THEN** it uses the Nix-provided versions of fzf, bat, and neovim
- **AND** does not rely on system-installed versions of these tools