Skip to content

[vfs-agent-search.mdc] Convert Human-Readable ASCII Graph to LLM-Readable Format #35

Description

@loclv

Issue: Convert Human-Readable ASCII Graph to LLM-Readable Format

Current State

The code search workflow uses a human-friendly ASCII graph with arrows and boxes (lines 39-56 in vfs-agent-search.mdc). While visually intuitive for humans, this format is difficult for LLMs to parse programmatically.

Current format:


STEP 1: Try MCP → CallMcpTool(server: "user-user-vfs", toolName: "search", ...)
  │
  ├─ Works? → Use MCP for all vfs operations.
  │
  └─ MCP not available or errors?
      │
      ▼
STEP 2: Try CLI fallback → run `command -v vfs` in Shell
  │
  ├─ Found? → Use `vfs <path> -f <pattern>` via Shell.
  │
  └─ Not found?
      │
      ▼
STEP 3: vfs unavailable → Fall back to Grep/Read silently.
  Notify user once per session if needed. Do NOT block progress.

Proposed Change

Convert the ASCII decision tree to a structured format that's easier for LLMs to parse:

Option 1: Numbered List with Conditions


1. Try MCP: CallMcpTool(server: "user-user-vfs", toolName: "search", ...)
   - On success: Use MCP for all vfs operations (end)
   - On failure/error: Go to step 2

2. Try CLI fallback: run `command -v vfs` in Shell
   - If found: Use `vfs <path> -f <pattern>` via Shell (end)
   - If not found: Go to step 3

3. vfs unavailable: Fall back to Grep/Read silently
   - Notify user once per session if needed
   - Do NOT block progress (end)

Option 2: Mermaid Diagram (if supported)

flowchart TD
    A[STEP 1: Try MCP] -->|Success| B[Use MCP]
    A -->|Failure/Error| C[STEP 2: Try CLI]
    C -->|Found| D[Use CLI vfs]
    C -->|Not Found| E[STEP 3: Grep/Read]
    E --> F[Notify user once, do not block]
Loading

Option 3: Structured CSV - Simple and machine-readable and save tokens (https://github.com/toon-format/toon?tab=readme-ov-file#token-efficiency)

Step,Name,Action,Condition,Result
1,MCP,"CallMcpTool(server: user-user-vfs, toolName: search, ...)",success,Use MCP for all vfs operations
1,MCP,"CallMcpTool(server: user-user-vfs, toolName: search, ...)",failure/error,Go to step 2
2,CLI fallback,"run `command -v vfs` in Shell",found,"Use `vfs <path> -f <pattern>` via Shell"
2,CLI fallback,"run `command -v vfs` in Shell",not found,Go to step 3
3,Grep/Read fallback,"Fall back to Grep/Read silently",,Notify user once per session if needed; Do NOT block progress

Acceptance Criteria

  • Choose one of the LLM-readable formats (numbered list recommended for simplicity)
  • Update lines 39-56 in .cursor/rules/vfs-agent-search.mdc
  • Ensure the logic flow remains identical (same decision branches, same actions)
  • Verify all other references to this workflow remain valid
  • Test that LLMs can correctly interpret the new format

Benefits

  1. Better programmatic parsing: LLMs can more easily extract the decision logic
  2. Consistent indentation: No special Unicode characters (├─, └─, ▼, │)
  3. Clear step progression: Numbered/structured format shows execution order explicitly
  4. Easier maintenance: Adding new fallback steps is straightforward

Files to Modify

  • .cursor/rules/vfs-agent-search.mdc (lines 39-56)

Priority

Low - The current format works, this is a quality-of-life improvement for LLM parsing.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions