Skip to content

Improve data directory resolution for development environments #29

@luojiyin1987

Description

@luojiyin1987

Summary

Improve data directory resolution for development environments

Problem

The current data directory resolution logic is not flexible enough for development workflows. When running locally with cargo run, the binary is located in target/debug/ or target/release/, which makes the current ../ parent traversal logic unreliable.

Proposed Solution

  1. Add support for PAYMENT_SKILL_DATA_DIR environment variable to allow explicit override
  2. Improve detection between:
    • Installed skill layout (<skill-root>/scripts/<binary>)
    • Local cargo development (target/{debug,release}/<binary>)
  3. Fall back to current working directory for local development

Affected Files

  • payment-common/src/lib.rs - Core directory resolution logic
  • README.md - Documentation updates
  • CLAUDE.md - Project structure documentation

Acceptance Criteria

  • PAYMENT_SKILL_DATA_DIR environment variable is respected
  • Installed skill layout works as before
  • cargo run uses current working directory
  • All existing tests pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions