Skip to content

feat(init): bridge to APM during init for cross-team distribution #93

@danielmeppiel

Description

@danielmeppiel

Summary

When agentrc init finishes generating instructions, it should detect APM (Agent Package Manager) and offer to initialize it — enabling developers to distribute their agentrc-generated instructions across teams via apm install.

Motivation

agentrc generates high-quality, repo-aware instructions. APM distributes them. Today, going from "I have instructions" to "my org can install them" requires manually creating apm.yml — a step most developers skip because they do not know about APM or how to set it up.

agentrc init is the natural place to bridge this gap: it already runs interactive prompts (via @inquirer/prompts) and calls out to external tools (git, GitHub API). Adding APM detection follows the same pattern.

Behavior

APM state Interactive mode --yes / headless
apm in PATH + no apm.yml Prompt: "Initialize APM for cross-team distribution? (Y/n)" → runs apm init --yes Skip
apm in PATH + apm.yml exists Skip Skip
apm not in PATH Tip: "💡 Install APM to distribute instructions across your org. See: https://github.com/microsoft/apm" Skip (respects --quiet)

Design principles

  • Delegation, not duplication: agentrc never writes apm.yml — it shells out to apm init --yes. APM owns its manifest.
  • Explicit opt-in: the prompt defaults to No. --yes skips it entirely.
  • No new I/O paradigm: init already uses @inquirer/prompts and respects --yes/--quiet/--json.
  • Graceful degradation: when APM is not installed, a single tip line (respecting --quiet) is the only change.

Implementation

Single file change: src/commands/init.ts — add APM detection and conditional prompt/tip after the generation phase.

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