Skip to content

False positive: 'Referenced file not found' for files that exist but aren't in scan list #2

@vikramarun

Description

@vikramarun

Description

AgentLinter reports 'Referenced file not found' for files that do exist in the workspace, but aren't in the hardcoded scan list.

Reproduction

  1. Create a workspace with standard files (AGENTS.md, SOUL.md, etc.)
  2. Create an additional file like IMPROVEMENT.md
  3. Reference it from AGENTS.md: See IMPROVEMENT.md for details
  4. Run npx agentlinter

Expected

Linter finds IMPROVEMENT.md and validates the reference.

Actual

🔴 CRITICAL  AGENTS.md
   Referenced file "IMPROVEMENT.md" not found in workspace.

But the file exists:

$ ls -la IMPROVEMENT.md
-rw-r--r--  1 user  staff  1319 Feb  7 11:53 IMPROVEMENT.md

Root Cause

The linter only scans a hardcoded list of files:

📄 Files: AGENTS.md, SOUL.md, IDENTITY.md, USER.md, TOOLS.md, HEARTBEAT.md, MEMORY.md, clawdbot.json, skills/*

When checking references, it only looks at scanned files, not all files in the workspace.

Suggested Fix

For the 'referenced file' check, use fs.existsSync() against the actual filesystem rather than checking against the scanned files list.

Environment

  • agentlinter v0.1.7
  • macOS
  • Node 25.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions