Skip to content

Auto-generate CLAUDE.md in ~/.plotlink-ows/ for agent skill discovery #183

@realproject7

Description

@realproject7

Problem

When agents are spawned via npx plotlink-ows, they have no way to automatically discover the local API endpoints. The CLAUDE.md with API docs exists in the repo but not in the agent's working directory. Agents end up spelunking through npm cache source code to find route definitions.

Solution

On app startup, write/update a CLAUDE.md file in ~/.plotlink-ows/ with the API reference (auth, endpoints, workflows, valid genres/languages).

Why this works

  • The app already owns ~/.plotlink-ows/ as its persistent config directory (lib/paths.ts)
  • Stories live in ~/.plotlink-ows/stories/{name}/
  • Claude Code walks up the directory tree looking for CLAUDE.md files
  • Any Claude session spawned in a story directory auto-discovers ~/.plotlink-ows/CLAUDE.md

Implementation

  1. In lib/paths.ts (or app startup), write ~/.plotlink-ows/CLAUDE.md with the API docs from the repo's CLAUDE.md "Local Writer API" section
  2. Update the file on each startup so it stays in sync with the installed version
  3. Optionally add GET /api/docs as a fallback for agents running outside the ~/.plotlink-ows/ tree

Acceptance Criteria

  • ~/.plotlink-ows/CLAUDE.md is created/updated on app startup
  • Contains auth, all API endpoints, common workflows, valid genres/languages
  • Claude sessions in story directories auto-discover the docs
  • File is updated when a new version of plotlink-ows is installed

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/T3Assigned to T3 builder agentenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions