Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,3 @@ docs/wip/
.env.local
.env.*.local
AGENTS.md

# APM dependencies
apm_modules/
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [0.5.4]

### Added
- **Agent Integration**: Automatic sync of `.agent.md` files to `.github/agents/` with `-apm` suffix (same pattern as prompt integration)

### Fixed
- `sync_integration` URL normalization bug that caused ALL integrated files to be removed during uninstall instead of only the uninstalled package's files
- Root cause: Metadata stored full URLs (`https://github.com/owner/repo`) while dependency list used short form (`owner/repo`)
- Impact: Uninstalling one package would incorrectly remove prompts/agents from ALL other packages
- Fix: Normalize both URL formats to `owner/repo` before comparison
- Added comprehensive test coverage for multi-package scenarios
- Uninstall command now correctly removes only `apm_modules/owner/repo/` directory (not `apm_modules/owner/`)

## [0.5.3] - 2025-11-16

### Changed
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@

📦 **Mix and match what your team needs**:

- **Agents** - Agentic workflows (.prompt.md files)
- **Context** - Company rules, standards, knowledge (.instructions.md files) and domain boundaries (.chatmode.md)
- **Agents** - AI personas (.agent.md files)
- **Prompts** - Executable workflows (.prompt.md files)
- **Context** - Company rules, standards, knowledge (.instructions.md files)

![APM Demo](docs/apm-demo.gif)

Expand Down
5 changes: 3 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,14 @@ This creates a complete Context structure:
my-first-project/
├── apm.yml # Project configuration
└── .apm/
├── chatmodes/ # AI assistant personalities
├── agents/ # AI assistant personalities
├── instructions/ # Context and coding standards
├── prompts/ # Reusable agent workflows
└── context/ # Project knowledge base
```

> **Note**: Legacy `.apm/chatmodes/` directory with `.chatmode.md` files is still supported.

### 2. Explore Generated Files

Let's look at what was created:
Expand Down Expand Up @@ -376,7 +378,6 @@ apm install company/templates/chatmodes/qa-assistant.chatmode.md

- `.prompt.md` - Agent workflows
- `.instructions.md` - Context and rules
- `.chatmode.md` - Chat mode configurations
- `.agent.md` - Agent definitions

**Installation Structure:**
Expand Down
35 changes: 24 additions & 11 deletions docs/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,25 @@ APM works natively with VSCode's Context implementation:

VSCode already implements core Context concepts:

- **Chat Modes**: Domain-specific chat behavior with `.chatmode.md` files in `.github/chatmodes/`
- **Agents**: AI personas and workflows with `.agent.md` files in `.github/agents/` (legacy: `.chatmode.md` in `.github/chatmodes/`)
- **Instructions Files**: Modular instructions with `copilot-instructions.md` and `.instructions.md` files
- **Prompt Files**: Reusable task templates with `.prompt.md` files in `.github/prompts/`

### Automatic Prompt Integration with APM
> **Note**: APM supports both the new `.agent.md` format and legacy `.chatmode.md` format. VSCode provides Quick Fix actions to migrate from `.chatmode.md` to `.agent.md`.

APM automatically integrates prompts from installed packages into VSCode's native structure:
### Automatic Prompt and Agent Integration with APM

APM automatically integrates prompts and agents from installed packages into VSCode's native structure:

```bash
# Install APM packages - integration happens automatically
apm install danielmeppiel/design-guidelines

# Prompts are automatically integrated to:
# .github/prompts/*-apm.prompt.md (with package metadata header)

# Agents are automatically integrated to:
# .github/agents/*-apm.agent.md (with package metadata header)
```

**How Auto-Integration Works**:
Expand All @@ -157,13 +162,14 @@ apm install danielmeppiel/design-guidelines

**Integration Flow**:
1. Run `apm install` to fetch APM packages
2. APM automatically creates `.github/prompts/` directory if needed
3. Discovers `.prompt.md` files in each package
2. APM automatically creates `.github/prompts/` and `.github/agents/` directories if needed
3. Discovers `.prompt.md` and `.agent.md` files in each package
4. Copies prompts to `.github/prompts/` with `-apm` suffix (e.g., `accessibility-audit-apm.prompt.md`)
5. Adds metadata headers for version tracking
6. Updates `.gitignore` to exclude integrated prompts
7. VSCode automatically loads all prompts for your coding agents
8. Run `apm uninstall` to automatically remove integrated prompts
5. Copies agents to `.github/agents/` with `-apm` suffix (e.g., `security-apm.agent.md`)
6. Adds metadata headers for version tracking
7. Updates `.gitignore` to exclude integrated prompts and agents
8. VSCode automatically loads all prompts and agents for your coding agents
9. Run `apm uninstall` to automatically remove integrated prompts and agents

**Intent-First Discovery**:
The `-apm` suffix pattern enables natural autocomplete in VSCode:
Expand All @@ -177,21 +183,27 @@ The `-apm` suffix pattern enables natural autocomplete in VSCode:
apm install danielmeppiel/design-guidelines

# Result in VSCode:
# Prompts:
# .github/prompts/accessibility-audit-apm.prompt.md ✓ Available in chat
# .github/prompts/design-review-apm.prompt.md ✓ Available in chat
# .github/prompts/style-guide-check-apm.prompt.md ✓ Available in chat

# Agents:
# .github/agents/design-reviewer-apm.agent.md ✓ Available as chat mode
# .github/agents/accessibility-expert-apm.agent.md ✓ Available as chat mode

# Use with natural autocomplete:
# Type: /design
# VSCode suggests: design-review-apm.prompt.md ✨
```

**VSCode Native Features**:
- All integrated prompts appear in VSCode's prompt picker
- All integrated agents appear in VSCode's chat mode selector
- Native chat integration with primitives
- Seamless `/prompt` command support
- File-pattern based instruction application
- Chatmode support for different personas
- Agent support for different personas and workflows

## Development Tool Integrations

Expand Down Expand Up @@ -290,7 +302,8 @@ apm install danielmeppiel/design-guidelines

# GitHub Copilot automatically picks up:
# .github/prompts/*-apm.prompt.md (integrated prompts)
# .github/chatmodes/ (chat personalities)
# .github/agents/*-apm.agent.md (integrated agents)
# .github/agents/ or .github/chatmodes/ (AI personas - both formats supported)
# .github/instructions/ (file-pattern rules)
```

Expand Down
72 changes: 30 additions & 42 deletions docs/primitives.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ apm init my-project # Creates complete Context scaffolding + apm.yml
my-project/
├── apm.yml # Project configuration and script definitions
└── .apm/
├── chatmodes/ # Role-based AI expertise with tool boundaries
│ ├── backend-dev.chatmode.md # API development specialist
│ └── frontend-dev.chatmode.md # UI development specialist
├── agents/ # Role-based AI expertise with tool boundaries
│ ├── backend-dev.agent.md # API development specialist
│ └── frontend-dev.agent.md # UI development specialist
├── instructions/ # Targeted guidance by file type and domain
│ ├── security.instructions.md # applyTo: "auth/**"
│ └── testing.instructions.md # applyTo: "**/*test*"
Expand Down Expand Up @@ -70,10 +70,12 @@ apm run review-copilot --param files="src/auth/"

The APM CLI supports three types of primitives:

- **Chatmodes** (`.chatmode.md`) - Define AI assistant personalities and behaviors
- **Agents** (`.agent.md`) - Define AI assistant personalities and behaviors (legacy: `.chatmode.md`)
- **Instructions** (`.instructions.md`) - Provide coding standards and guidelines for specific file types
- **Context** (`.context.md`, `.memory.md`) - Supply background information and project context

> **Note**: Both `.agent.md` (new format) and `.chatmode.md` (legacy format) are fully supported. VSCode provides Quick Fix actions to help migrate from `.chatmode.md` to `.agent.md`.

## File Structure

### Supported Locations
Expand All @@ -83,7 +85,9 @@ APM discovers primitives in these locations:
```
# APM-native structure
.apm/
├── chatmodes/ # AI assistant definitions
├── agents/ # AI assistant definitions (new format)
│ └── *.agent.md
├── chatmodes/ # AI assistant definitions (legacy format)
│ └── *.chatmode.md
├── instructions/ # Coding standards and guidelines
│ └── *.instructions.md
Expand All @@ -94,12 +98,15 @@ APM discovers primitives in these locations:

# VSCode-compatible structure
.github/
├── chatmodes/ # VSCode Copilot chatmodes
├── agents/ # VSCode Copilot agents (new format)
│ └── *.agent.md
├── chatmodes/ # VSCode Copilot chatmodes (legacy format)
│ └── *.chatmode.md
└── instructions/ # VSCode Copilot instructions
└── *.instructions.md

# Generic files (anywhere in project)
*.agent.md
*.chatmode.md
*.instructions.md
*.context.md
Expand Down Expand Up @@ -142,10 +149,10 @@ Use ${input:auth_method} with ${input:session_duration} sessions
Review [security standards](../context/security.context.md) before implementation
```

### Chat Modes (.chatmode.md)
### Agents (.agent.md, legacy: .chatmode.md)
**Agent Specialization Layer** - AI assistant personalities with tool boundaries

Chat modes create specialized AI assistants focused on specific domains. They define expertise areas, communication styles, and available tools.
Agents create specialized AI assistants focused on specific domains. They define expertise areas, communication styles, and available tools.

```yaml
---
Expand All @@ -157,6 +164,8 @@ You are a senior backend engineer with 10+ years experience in API development.
Focus on security, performance, and maintainable architecture patterns.
```

> **File Format**: Use `.agent.md` for new files. Legacy `.chatmode.md` files continue to work and can be migrated using VSCode Quick Fix actions.

### Context (.context.md)
**Knowledge Management Layer** - Optimized project information for AI consumption

Expand All @@ -172,15 +181,14 @@ Context files package project knowledge, architectural decisions, and team stand

## Primitive Types

### Chatmodes
### Agents

Chatmodes define AI assistant personalities and specialized behaviors for different development tasks.
Agents define AI assistant personalities and specialized behaviors for different development tasks.

**Format:** `.chatmode.md`
**Format:** `.agent.md` (new) or `.chatmode.md` (legacy)

**Frontmatter:**
- `description` (required) - Clear explanation of the chatmode purpose
- `applyTo` (optional) - Glob pattern for file targeting (e.g., `"**/*.{py,js}"`)
- `description` (required) - Clear explanation of the agent purpose
- `author` (optional) - Creator information
- `version` (optional) - Version string

Expand All @@ -189,7 +197,6 @@ Chatmodes define AI assistant personalities and specialized behaviors for differ
---
description: AI pair programming assistant for code review
author: Development Team
applyTo: "**/*.{py,js,ts}"
version: "1.0.0"
---

Expand Down Expand Up @@ -312,32 +319,13 @@ Team information (`.apm/memory/team-contacts.memory.md`):

## Discovery and Parsing

The APM CLI automatically discovers and parses all primitive files in your project:

```python
from apm_cli.primitives import discover_primitives

# Discover all primitives in current directory
collection = discover_primitives()

print(f"Found {collection.count()} primitives:")
print(f" Chatmodes: {len(collection.chatmodes)}")
print(f" Instructions: {len(collection.instructions)}")
print(f" Contexts: {len(collection.contexts)}")

# Access individual primitives
for chatmode in collection.chatmodes:
print(f"Chatmode: {chatmode.name}")
print(f" Description: {chatmode.description}")
if chatmode.apply_to:
print(f" Applies to: {chatmode.apply_to}")
```
The APM CLI automatically discovers and parses all primitive files in your project.

## Validation

All primitives are automatically validated during discovery:

- **Chatmodes**: Must have description and content
- **Agents**: Must have description and content (supports both `.agent.md` and `.chatmode.md`)
- **Instructions**: Must have description, applyTo pattern, and content
- **Context**: Must have content (description optional)

Expand All @@ -347,7 +335,7 @@ Invalid files are skipped with warning messages, allowing valid primitives to co

### 1. Clear Naming
Use descriptive names that indicate purpose:
- `code-review-assistant.chatmode.md`
- `code-review-assistant.agent.md`
- `python-documentation.instructions.md`
- `team-contacts.md`

Expand All @@ -364,9 +352,9 @@ Keep primitives in version control alongside your code. Use semantic versioning
Use the structured `.apm/` directories for better organization:
```
.apm/
├── chatmodes/
│ ├── code-reviewer.chatmode.md
│ └── documentation-writer.chatmode.md
├── agents/
│ ├── code-reviewer.agent.md
│ └── documentation-writer.agent.md
├── instructions/
│ ├── python-style.instructions.md
│ └── typescript-conventions.instructions.md
Expand All @@ -385,13 +373,13 @@ Use the structured `.apm/` directories for better organization:
For VSCode Copilot compatibility, place files in `.github/` directories:
```
.github/
├── chatmodes/
│ └── assistant.chatmode.md
├── agents/
│ └── assistant.agent.md
└── instructions/
└── coding-standards.instructions.md
```

These files follow the same format and will be discovered alongside APM-specific primitives.
These files follow the same format and will be discovered alongside APM-specific primitives.

## Error Handling

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "apm-cli"
version = "0.5.3"
version = "0.5.4"
description = "MCP configuration tool"
readme = "README.md"
requires-python = ">=3.9"
Expand Down
Loading
Loading