Skip to content

pm init --agent-guidance emits run-tests.mjs command that often does not exist #529

Closed

Description

@unbraind

Summary

pm init --agent-guidance add writes an auto-managed AGENTS.md guidance block that includes a linked-test example command:

node scripts/run-tests.mjs test -- ...

In repositories where that script is not present (and pm does not generate it), the guidance is misleading and pushes contributors toward a non-existent command.

Repro

  1. In a repo without scripts/run-tests.mjs, run:
    • pm init
    • pm init --agent-guidance add
  2. Open AGENTS.md and inspect the auto-managed pm Workflow (Agent Quickstart) block.
  3. Observe the line:
    • pm test <id> --add command="node scripts/run-tests.mjs test -- ..."
  4. Verify scripts/run-tests.mjs is absent.

Actual

The generated guidance suggests a command that is not guaranteed to exist.

Expected

Generated guidance should use a command pattern that is always valid (or clearly marked as placeholder), e.g. a repo-agnostic script command that exists in the project, or a generic pm test <id> --add command="<your project test command>" template.

Why this matters

This block is auto-managed and intended as trusted onboarding guidance for both humans and agents. A non-existent command causes avoidable confusion and policy drift in pm-linked test evidence.

Activity

  1. coderabbitai commented on Jul 12, 2026

    @coderabbitai
    🔗 Related PRs

    #142 - Guard pm tracker path targeting for agents [closed]
    #199 - MCP workspace tools (pm_schema/pm_config/pm_append), query_summary, MCP contract snapshot, GH-191 two-token test --add, coverage ratchet 82/74/86/82 [closed]
    #229 - Improve agent UX, linked-test lifecycle, and coverage ratchet [closed]
    #428 - Harden SDK extension runtime packaging [merged]
    #491 - Harden init target safety and package install verification [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. unbraind commented on Jul 13, 2026

    @unbraind
    OwnerAuthor

    pm tracker item: pm-surv

  3. added a commit that references this issue on Jul 13, 2026
  4. unbraind commented on Aug 18, 2026

    @unbraind
    OwnerAuthor

    Canonical PM item: pm-surv.

  5. unbraind commented on Aug 19, 2026

    @unbraind
    OwnerAuthor
  6. unbraind commented on Aug 19, 2026

    @unbraind
    OwnerAuthor

    Resolved by merged PR #1063 at f4cbd5f. Generated agent test guidance now detects project scripts/package-manager intent and uses a safe placeholder when no runnable command exists. Canonical PM item: https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-surv.toon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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