Skip to content

Design community template ecosystem via create-apm-* packages#36

Closed
Copilot wants to merge 4 commits into
mainfrom
copilot/design-community-template-ecosystem
Closed

Design community template ecosystem via create-apm-* packages#36
Copilot wants to merge 4 commits into
mainfrom
copilot/design-community-template-ecosystem

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 26, 2025

📖 Documentation Update

Changes

Documents the community-driven template ecosystem following npm's initializer pattern (npm init <initializer>npx create-<initializer>).

Template Ecosystem Spec (docs/templates.md)

  • Package naming convention: create-apm-<template-name>
  • Required structure: package.json, bin/index.js, templates/
  • Variable substitution: {{project_name}}, {{author}}, {{year}}
  • Publishing workflow and best practices

Example Package (templates/create-apm-hello-world/)

  • Working reference implementation of a create-apm-* npm package
  • Includes executable CLI, template files, instructions, and chatmode

CLI Integration Design

apm init hello-world my-app
        ↓
npx create-apm-hello-world my-app

Scope

  • README updates
  • API documentation
  • User guides
  • Code comments
  • Other: Example template package structure

Checklist

  • LABEL: Apply documentation or docs label to this PR
  • Content is accurate and up-to-date
  • Links and references work correctly
  • Formatting is consistent

Fixes #21

Original prompt

This section details on the original issue you should resolve

<issue_title>[Future] Design community template ecosystem via create-apm-* packages</issue_title>
<issue_description>## Summary
Design community-driven template ecosystem using create-apm-* packages that follow npm's initializer pattern. This is future work and not a blocker for the core init/install redesign.

Background

npm's Approach

npm init <initializer>  # Runs: npx create-<initializer>

# Examples:
npm init react-app my-app    # → npx create-react-app my-app
npm init vite@latest my-app  # → npx create-vite@latest my-app
npm init next-app my-app     # → npx create-next-app my-app

Key insight: Templates live as separate npm packages, not bundled with core CLI.

Proposed APM Pattern

apm init <initializer>  # Runs: npx create-apm-<initializer>

# Examples:
apm init hello-world my-app    # → npx create-apm-hello-world my-app
apm init express-api my-app    # → npx create-apm-express-api my-app
apm init compliance-template   # → npx create-apm-compliance-template

Design Requirements

1. Package Naming Convention

  • Format: create-apm-<template-name>
  • Registry: npm (standard Node.js packages)
  • Discoverability: Searchable by create-apm prefix

2. Template Package Structure

create-apm-hello-world/
├── package.json
├── bin/
│   └── index.js          # Entry point
├── templates/
│   ├── apm.yml
│   ├── hello-world.prompt.md
│   ├── .apm/
│   │   ├── instructions/
│   │   └── chatmodes/
│   └── README.md
└── README.md             # Template documentation

3. Template Package API

// bin/index.js
#!/usr/bin/env node

const args = process.argv.slice(2);
const projectName = args[0] || 'my-apm-project';

// Create project directory
// Copy template files
// Substitute variables ({{project_name}}, etc.)
// Run post-creation tasks (apm install, etc.)

4. APM CLI Integration

def init(ctx, initializer, project_name, yes):
    if initializer:
        # Delegate to npx
        cmd = ['npx', f'create-apm-{initializer}']
        if project_name:
            cmd.append(project_name)
        subprocess.run(cmd)
    else:
        # Minimal init (default)
        _create_minimal_apm_yml()

Community Template Examples

Official Templates (Future)

  • create-apm-hello-world - Basic workflow examples
  • create-apm-express-api - Express.js backend
  • create-apm-frontend-app - Frontend SPA
  • create-apm-fullstack - Full-stack application

Community Templates (Examples)

  • create-apm-compliance - GDPR, legal review workflows
  • create-apm-design-system - UI component standards
  • create-apm-data-pipeline - Data engineering workflows

Documentation Needs

Template Author Guide

# Creating APM Templates

1. Create npm package named `create-apm-<name>`
2. Add executable entry point in `bin/`
3. Structure templates in `templates/` directory
4. Use variable substitution for customization
5. Publish to npm registry

See: https://github.com/danielmeppiel/create-apm-hello-world (example)

Template Discovery

  • Website/registry listing available templates
  • apm templates command to search npm for create-apm-* packages
  • GitHub topic for template repositories

Non-Goals (Out of Scope)

  • ❌ Built-in template bundling in APM CLI
  • ❌ Custom template registry (use npm)
  • ❌ Template versioning system (use npm semver)
  • ❌ Template validation/certification program

Benefits

Separation of Concerns - Core CLI stays minimal
Community Ownership - Anyone can publish templates
Standard Tooling - Uses npm/npx (no new tools)
Versioning - Templates can evolve independently
Discoverability - Standard npm search works

Implementation Phases

Phase 1: Design (This Issue)

  • Research npm init pattern thoroughly
  • Design template package spec
  • Create example template package
  • Document template authoring guide

Phase 2: CLI Integration (Future)

  • Add apm init <template>npx create-apm-<template> delegation
  • Add apm templates search command (optional)
  • Update docs with template usage

Phase 3: Ecosystem (Future)

  • Publish official create-apm-hello-world
  • Migrate existing hello-world template
  • Encourage community templates

Acceptance Criteria

  • Template package spec documented
  • Example create-apm-hello-world package created
  • Template authoring guide written
  • CLI integration design reviewed
  • No implementation required yet

Related

<agent_instructions>Hey, don't overcomplicate things</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits November 26, 2025 15:55
Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@danielmeppiel danielmeppiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot I don't liek this, you need to do it in this way:


Copilot AI changed the title [WIP] Design community template ecosystem via create-apm packages Design community template ecosystem via create-apm-* packages Nov 26, 2025
Copilot AI requested a review from danielmeppiel November 26, 2025 16:08
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 26, 2025

@copilot I don't liek this, you need to do it in this way:


It looks like your instructions got cut off. Could you share how you'd like me to approach this?

danielmeppiel added a commit that referenced this pull request May 7, 2026
…) (#1181)

* chore(aw): bump microsoft/apm-action v1.6.0 -> v1.7.1

Picks up the v0.12.3 strict-detection fix series:
- #33 (apm-action): forwards target: input into the generated apm.yml
  in isolated mode (all four uses in shared/apm.md are isolated mode
  with target: all, so this is the relevant fix).
- #33 (apm-action): pins the action's apm-version default to 0.12.3
  instead of latest, removing the silent-breakage exposure that
  burned this repo when v0.12.3 shipped.
- #34 (apm-action): strict allowlist validation on target: input.
- #36 (apm-action): forwards --target to additive 'apm install'
  invocations (not used here today but ships with the bundle).

Without this bump the lock'd v1.6.0 still resolves apm-version=latest,
so every triage-panel / pr-review-panel run that hits the APM pack
step would now fail with 'No harness detected' under v0.12.3.

Lock-file refresh side effects (from gh aw compile v0.71.5):
- github/gh-aw-actions/setup v0.71.2 -> v0.71.5
- new actions/github-script@v9.0.0 entry pulled in

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(audit): re-anchor in-package asset rewrite onto package_root during replay (#1182)

The replay path of `apm audit --ci` deploys to a scratch tmpdir while
`package_root` for self-packages still points at the real project tree.
`os.path.relpath(candidate, target_location)` therefore produced a
tmpdir traversal (e.g. `../../../../Users/.../MANIFESTO.md`) instead of
the project-relative form real install writes (`../../MANIFESTO.md`),
flagging every primitive with a `../<repo-root-file>` link as drifted.

Detect the cross-frame case (candidate outside `base_dir`) in
`_resolve_in_package_asset_link` and re-anchor `target_location` onto
`package_root` so the rewrite mirrors install-time output. Dependency
packages are unaffected (their `install_path` materialises inside the
scratch tree, so candidate stays in-frame).

Also lands the .agents/skills convergence: v0.12.3 made
`.agents/skills/` the cross-client default, so the 10 self-package
skill bundles move from `.github/skills/` -> `.agents/skills/`. The
lockfile is regenerated to match. Running `apm install` then
`apm audit --ci` against this branch is now a clean no-op.

Bundled together with the `apm-action@v1.7.1` workflow bump from the
prior commit because the audit gate (broken on `main` since v0.12.3)
would otherwise stay red and the skills convergence cannot land
without the bug fix above.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(release): cut v0.12.4

Bumps pyproject.toml 0.12.3 -> 0.12.4 and rolls the [Unreleased]
entries (orphan-cleanup #1173 + audit-replay #1182) into the [0.12.4]
section. Tag will be cut post-merge.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Daniel Meppiel <copilot-rework@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
sergio-sisternes-epam pushed a commit that referenced this pull request May 19, 2026
…) (#1181)

* chore(aw): bump microsoft/apm-action v1.6.0 -> v1.7.1

Picks up the v0.12.3 strict-detection fix series:
- #33 (apm-action): forwards target: input into the generated apm.yml
  in isolated mode (all four uses in shared/apm.md are isolated mode
  with target: all, so this is the relevant fix).
- #33 (apm-action): pins the action's apm-version default to 0.12.3
  instead of latest, removing the silent-breakage exposure that
  burned this repo when v0.12.3 shipped.
- #34 (apm-action): strict allowlist validation on target: input.
- #36 (apm-action): forwards --target to additive 'apm install'
  invocations (not used here today but ships with the bundle).

Without this bump the lock'd v1.6.0 still resolves apm-version=latest,
so every triage-panel / pr-review-panel run that hits the APM pack
step would now fail with 'No harness detected' under v0.12.3.

Lock-file refresh side effects (from gh aw compile v0.71.5):
- github/gh-aw-actions/setup v0.71.2 -> v0.71.5
- new actions/github-script@v9.0.0 entry pulled in

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(audit): re-anchor in-package asset rewrite onto package_root during replay (#1182)

The replay path of `apm audit --ci` deploys to a scratch tmpdir while
`package_root` for self-packages still points at the real project tree.
`os.path.relpath(candidate, target_location)` therefore produced a
tmpdir traversal (e.g. `../../../../Users/.../MANIFESTO.md`) instead of
the project-relative form real install writes (`../../MANIFESTO.md`),
flagging every primitive with a `../<repo-root-file>` link as drifted.

Detect the cross-frame case (candidate outside `base_dir`) in
`_resolve_in_package_asset_link` and re-anchor `target_location` onto
`package_root` so the rewrite mirrors install-time output. Dependency
packages are unaffected (their `install_path` materialises inside the
scratch tree, so candidate stays in-frame).

Also lands the .agents/skills convergence: v0.12.3 made
`.agents/skills/` the cross-client default, so the 10 self-package
skill bundles move from `.github/skills/` -> `.agents/skills/`. The
lockfile is regenerated to match. Running `apm install` then
`apm audit --ci` against this branch is now a clean no-op.

Bundled together with the `apm-action@v1.7.1` workflow bump from the
prior commit because the audit gate (broken on `main` since v0.12.3)
would otherwise stay red and the skills convergence cannot land
without the bug fix above.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(release): cut v0.12.4

Bumps pyproject.toml 0.12.3 -> 0.12.4 and rolls the [Unreleased]
entries (orphan-cleanup #1173 + audit-replay #1182) into the [0.12.4]
section. Tag will be cut post-merge.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Daniel Meppiel <copilot-rework@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Future] Design community template ecosystem via create-apm-* packages

2 participants