fix(kyberforge): bring instructions-author level with apm 0.39.3
The skill still described apm 0.28.0. On 0.39.3 an unquoted applyTo fails install and deploys nothing, the Claude compile writes AGENTS.md behind a CLAUDE.md that only imports it, dedup is per instruction, unscoped rules retire from .claude/rules/ once AGENTS.md carries them, and install skips a hand-authored rule rather than overwriting it. Update the Gotchas, the compatibility line and the target-mapping, schema, verify, improve and create references, the template comment, the tests README and the bats header. Bump metadata.version to 0.1.1. Refs: #273 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
1 parent
bb84e4ac13
commit
598f88b536
10 files changed
+79
-44
No files matched your search
@@ -5,21 +5,23 @@ description: >
|
|||||||
(`.apm/instructions/*.instructions.md`). Not read-only review ->
|
(`.apm/instructions/*.instructions.md`). Not read-only review ->
|
||||||
`factory-audit`. Not skills -> `skill-author`. Not agents -> `agent-author`.
|
`factory-audit`. Not skills -> `skill-author`. Not agents -> `agent-author`.
|
||||||
Not AGENTS.md -> `agentsmd-author`.
|
Not AGENTS.md -> `agentsmd-author`.
|
||||||
compatibility: Requires the apm CLI; behaviour verified against apm 0.28.0.
|
compatibility: Requires the apm CLI, 0.39.2 or later; behaviour verified against apm 0.39.3.
|
||||||
allowed-tools: Bash Read Write Edit
|
allowed-tools: Bash Read Write Edit
|
||||||
metadata:
|
metadata:
|
||||||
version: "0.1.0"
|
version: "0.1.1"
|
||||||
category: factory
|
category: factory
|
||||||
source_keys:
|
source_keys:
|
||||||
- apm-docs-site
|
- apm-docs-site
|
||||||
- apm-cli-0-28-0-experiments
|
- apm-cli-0-39-3-experiments
|
||||||
|
- apm-v0-39-3-source
|
||||||
- claude-code-memory-docs
|
- claude-code-memory-docs
|
||||||
---
|
---
|
||||||
|
|
||||||
## Gotchas
|
## Gotchas
|
||||||
|
|
||||||
- Claude Code drops `description`; only Copilot, grok-build and Cursor keep it. Write a body that explains itself.
|
- Claude Code drops `description`; only Copilot, grok-build and Cursor keep it. Write a body that explains itself.
|
||||||
- Quote every `applyTo`. An unquoted `**/*.py` fails to parse, compile skips the file, and `apm install` still deploys it with no `paths:`, so it loads in every session. Install prints the parse warning once and exits 0.
|
- Quote every `applyTo`. An unquoted `**/*.py` is a YAML alias error: `apm install` exits 1 and deploys nothing, while `apm compile` drops the file and still exits 0.
|
||||||
|
- On Claude a rule can leave `.claude/rules/`: after a compile, unscoped and single-directory rules move into `AGENTS.md`, which `CLAUDE.md` imports. Where a rule loads from is in `references/target-mapping.md`.
|
||||||
|
|
||||||
## Step 1 — Dispatch
|
## Step 1 — Dispatch
|
||||||
|
|
||||||
@@ -40,7 +42,7 @@ Gates on every file, whichever flow wrote it:
|
|||||||
- **One topic per file.** Two topics are two files.
|
- **One topic per file.** Two topics are two files.
|
||||||
- **Scope.** Omit `applyTo` only for a rule that must load in every session, and tell the user it then costs context at every launch.
|
- **Scope.** Omit `applyTo` only for a rule that must load in every session, and tell the user it then costs context at every launch.
|
||||||
- **Source.** Flat in `.apm/instructions/`, named `<stem>.instructions.md`. Anything nested or misnamed is ignored or never installed.
|
- **Source.** Flat in `.apm/instructions/`, named `<stem>.instructions.md`. Anything nested or misnamed is ignored or never installed.
|
||||||
- **Stem.** It becomes the deployed filename, and install overwrites a hand-authored rule of the same name on most targets without a prompt. Check for a collision before choosing it.
|
- **Stem.** It becomes the deployed filename. Install skips a hand-authored file at that path and deploys nothing there, and `--force` overwrites it. Check for a collision before choosing it.
|
||||||
- **Body.** Concrete, checkable bullets, paths in backticks, nothing assuming another file is loaded, under 200 lines. If unsure the content is a rule rather than a procedure or something to enforce, read `references/content.md`.
|
- **Body.** Concrete, checkable bullets, paths in backticks, nothing assuming another file is loaded, under 200 lines. If unsure the content is a rule rather than a procedure or something to enforce, read `references/content.md`.
|
||||||
|
|
||||||
If a field, glob or location is in question, read `references/schema.md`. If the question is which target keeps which field, or what compile does, read `references/target-mapping.md`.
|
If a field, glob or location is in question, read `references/schema.md`. If the question is which target keeps which field, or what compile does, read `references/target-mapping.md`.
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
# Delete these comments once filled in; Copilot receives this file verbatim.
|
# Delete these comments once filled in; Copilot receives this file verbatim.
|
||||||
description: "FILL IN: one line on what this rule covers. Only Copilot, grok-build and Cursor keep it."
|
description: "FILL IN: one line on what this rule covers. Only Copilot, grok-build and Cursor keep it."
|
||||||
applyTo: "FILL IN: quoted glob, e.g. **/*.py"
|
applyTo: "FILL IN: quoted glob, e.g. **/*.py"
|
||||||
# applyTo is always quoted: an unquoted ** is a YAML alias error and the rule
|
# applyTo is always quoted: an unquoted ** is a YAML alias error and apm
|
||||||
# deploys unscoped. Several globs: "**/*.css,**/*.scss". Delete the line only
|
# install fails. Several globs: "**/*.css,**/*.scss". Delete the line only
|
||||||
# for a rule that must load in every session.
|
# for a rule that must load in every session.
|
||||||
---
|
---
|
||||||
# FILL IN: one topic per file
|
# FILL IN: one topic per file
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source_keys:
|
source_keys:
|
||||||
- apm-docs-site
|
- apm-docs-site
|
||||||
- apm-cli-0-28-0-experiments
|
- apm-cli-0-39-3-experiments
|
||||||
---
|
---
|
||||||
|
|
||||||
# Creating a new instructions file
|
# Creating a new instructions file
|
||||||
@@ -18,7 +18,7 @@ Confirm, and ask the user for anything missing:
|
|||||||
|
|
||||||
## Step 1 — Check the stem
|
## Step 1 — Check the stem
|
||||||
|
|
||||||
Install overwrites a hand-authored file at `.claude/rules/<stem>.md`, `.cursor/rules/<stem>.mdc`, `.windsurf/rules/<stem>.md`, `.kiro/steering/<stem>.md` and `.agents/rules/<stem>.md` without a prompt. List those paths in the consuming project and choose another stem on any hit.
|
Install skips a hand-authored file at a deployed path, such as `.claude/rules/<stem>.md` or `.github/instructions/<stem>.instructions.md`, so the new rule never deploys there; `--force` would overwrite the hand-authored one. For each target in `targets:`, list its path from `references/target-mapping.md` in the consuming project and choose another stem on any hit.
|
||||||
|
|
||||||
## Step 2 — Scaffold
|
## Step 2 — Scaffold
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
source_keys:
|
source_keys:
|
||||||
- apm-docs-site
|
- apm-docs-site
|
||||||
- apm-cli-0-28-0-experiments
|
- apm-cli-0-39-3-experiments
|
||||||
---
|
---
|
||||||
|
|
||||||
# Improving an existing instructions file
|
# Improving an existing instructions file
|
||||||
@@ -16,13 +16,16 @@ Read the file whole. Signals are grill output, audit findings, inline feedback,
|
|||||||
|
|
||||||
| Symptom | Cause | Fix |
|
| Symptom | Cause | Fix |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| A scoped rule loads in every Claude session | `applyTo` is unquoted or malformed, so install deployed no `paths:` | Quote it, then confirm with `references/verify.md` |
|
| Install exits 1 with "Rejected frontmatter", or compile warns "Failed to parse" | Broken frontmatter YAML, most often an unquoted `applyTo` | Repair or quote it; do not delete the field |
|
||||||
| Compile warns "Failed to parse" | Broken frontmatter YAML | Repair the YAML; do not delete the field |
|
| A rule meant to be scoped loads in every Claude session | `applyTo` is missing, or apm 0.28.0 installed it unquoted with no `paths:` | Add or quote it, then confirm with `references/verify.md` |
|
||||||
| The rule is in `CLAUDE.md` but not `.claude/rules/` | The file is nested under `.apm/instructions/` | Move it up to the flat directory |
|
| The rule is in `AGENTS.md` but not `.claude/rules/`, and it is scoped to file types | The file is nested under `.apm/instructions/` | Move it up to the flat directory |
|
||||||
|
| An unscoped rule left `.claude/rules/` | apm moved it into `AGENTS.md`, which `CLAUDE.md` imports | Expected; confirm `CLAUDE.md` holds `@AGENTS.md` |
|
||||||
|
| Compile warns "applyTo ... matched no files" | The glob matches nothing in this project | Fix the glob, or confirm the files do not exist yet |
|
||||||
| The rule appears nowhere | The name lacks `.instructions.md` | Rename it |
|
| The rule appears nowhere | The name lacks `.instructions.md` | Rename it |
|
||||||
| Claude ignores guidance written in `description` | Claude Code drops `description` | Move the substance into the body |
|
| Claude ignores guidance written in `description` | Claude Code drops `description` | Move the substance into the body |
|
||||||
| A hand-written rule vanished after install | The stem collided with a deployed name | Restore it from version control and rename the source stem |
|
| The rule did not deploy and install printed "files skipped -- local files exist" | The stem collides with a hand-written file at the deployed path | Rename the source stem. `--force` would overwrite the hand-written file |
|
||||||
| The same rule reaches the agent twice | Cursor, Windsurf, Kiro and Grok get both a native file and an `AGENTS.md` copy | State it to the user; it is apm behaviour, not a defect in the file |
|
| A hand-written rule vanished after install | `--force`, or apm 0.28.0, overwrote it | Restore it from version control and rename the source stem |
|
||||||
|
| The same rule reaches the agent twice | When compile also writes `AGENTS.md` for a target with no dedup, Cursor, Windsurf, Kiro and Grok get both a native file and an `AGENTS.md` copy | State it to the user; it is apm behaviour, not a defect in the file |
|
||||||
|
|
||||||
Cases not in the table: read `references/target-mapping.md`.
|
Cases not in the table: read `references/target-mapping.md`.
|
||||||
|
|
||||||
|
|||||||
@@ -2,20 +2,20 @@
|
|||||||
source_keys:
|
source_keys:
|
||||||
- apm-docs-site
|
- apm-docs-site
|
||||||
- apm-github-repo
|
- apm-github-repo
|
||||||
- apm-cli-0-28-0-experiments
|
- apm-cli-0-39-3-experiments
|
||||||
- claude-code-memory-docs
|
- claude-code-memory-docs
|
||||||
---
|
---
|
||||||
|
|
||||||
# The instructions source file
|
# The instructions source file
|
||||||
|
|
||||||
Verified against apm 0.28.0. Reached from `SKILL.md` Step 2 when a frontmatter field, a glob or the file's location is in question.
|
Verified against apm 0.39.3. Reached from `SKILL.md` Step 2 when a frontmatter field, a glob or the file's location is in question.
|
||||||
|
|
||||||
## Location and name
|
## Location and name
|
||||||
|
|
||||||
`.apm/instructions/<name>.instructions.md`, flat. The double extension is the discovery key and the stem is the primitive's name; there is no `name` field.
|
`.apm/instructions/<name>.instructions.md`, flat. The double extension is the discovery key and the stem is the primitive's name; there is no `name` field.
|
||||||
|
|
||||||
- A plain `.md` in that directory is ignored by both `apm compile` and `apm install`.
|
- A plain `.md` in that directory is ignored by both `apm compile` and `apm install`.
|
||||||
- A file in a subdirectory is folded into compiled root files by compile but never deployed by install, so it reaches `CLAUDE.md` and `AGENTS.md` and no native rules directory.
|
- A file in a subdirectory is folded into compiled root files by compile but never deployed by install, so it reaches `AGENTS.md` and no native rules directory.
|
||||||
- The stem becomes the deployed filename: `<stem>.md`, `<stem>.mdc`, or `<stem>.instructions.md`, by target.
|
- The stem becomes the deployed filename: `<stem>.md`, `<stem>.mdc`, or `<stem>.instructions.md`, by target.
|
||||||
|
|
||||||
## Frontmatter
|
## Frontmatter
|
||||||
@@ -32,7 +32,7 @@ Only `description` and `applyTo` carry meaning. `author` and `version` are parse
|
|||||||
- A YAML sequence is joined into the same comma form.
|
- A YAML sequence is joined into the same comma form.
|
||||||
- Brace alternation is never split: `"**/*.{css,scss},**/*.py"` is two patterns.
|
- Brace alternation is never split: `"**/*.{css,scss},**/*.py"` is two patterns.
|
||||||
- A literal comma in a pattern is `\,`; a literal backslash is `\\`.
|
- A literal comma in a pattern is `\,`; a literal backslash is `\\`.
|
||||||
- Always quote the value. An unquoted `**/*.py` is a YAML alias error; see `SKILL.md` Gotchas for what apm then does.
|
- Always quote the value. An unquoted `**/*.py` is a YAML alias error, and install then fails; see `SKILL.md` Gotchas.
|
||||||
|
|
||||||
## Body
|
## Body
|
||||||
|
|
||||||
@@ -43,8 +43,8 @@ Plain markdown. Official guidance: bullets over prose, one topic per file (`pyth
|
|||||||
`Instruction.validate()` yields three findings, all demoted to warnings: missing `description`, missing `applyTo` ("will apply globally") and empty content. A broken relative link in the body is a fourth, also non-fatal.
|
`Instruction.validate()` yields three findings, all demoted to warnings: missing `description`, missing `applyTo` ("will apply globally") and empty content. A broken relative link in the body is a fourth, also non-fatal.
|
||||||
|
|
||||||
- A real `apm compile` prints them. `apm compile --validate` prints none of them and exits 0 even for a file with all three problems; it exits 1 only when the package has no instructions at all.
|
- A real `apm compile` prints them. `apm compile --validate` prints none of them and exits 0 even for a file with all three problems; it exits 1 only when the package has no instructions at all.
|
||||||
- `apm install` prints none.
|
- `apm install` prints none, and deploys such a file.
|
||||||
- `apm audit --ci` checks lockfile, deployed-file presence, content hash and hidden Unicode, not instruction content.
|
- `apm audit --ci` checks lockfile, deployed-file presence, content hash and hidden Unicode, not instruction content.
|
||||||
- A file whose frontmatter does not parse is skipped by compile ("Failed to parse") but still deployed by install.
|
- A file whose frontmatter does not parse is skipped by compile ("Failed to parse", exit 0) and fails install: `apm install` exits 1 with "Rejected frontmatter in <file>" and commits nothing.
|
||||||
|
|
||||||
No standalone instructions validator exists, so enforcement is this skill's checks and `references/verify.md`.
|
No standalone instructions validator exists, so enforcement is this skill's checks and `references/verify.md`.
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
source_keys:
|
source_keys:
|
||||||
- apm-docs-site
|
- apm-docs-site
|
||||||
- apm-github-repo
|
- apm-github-repo
|
||||||
|
- apm-cli-0-39-3-experiments
|
||||||
|
- apm-v0-39-3-source
|
||||||
- apm-cli-0-28-0-experiments
|
- apm-cli-0-28-0-experiments
|
||||||
- claude-code-memory-docs
|
- claude-code-memory-docs
|
||||||
- github-copilot-custom-instructions-docs
|
- github-copilot-custom-instructions-docs
|
||||||
@@ -26,12 +28,28 @@ source_keys:
|
|||||||
- **Contributing files:** references/schema.md
|
- **Contributing files:** references/schema.md
|
||||||
- **Status:** `extracted`
|
- **Status:** `extracted`
|
||||||
|
|
||||||
|
## apm-cli-0-39-3-experiments
|
||||||
|
|
||||||
|
- **URL:** https://pypi.org/project/apm-cli/0.39.3/
|
||||||
|
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/instructions-gotchas.md)
|
||||||
|
- **Description:** The repo-pinned apm-cli 0.39.3 run in throwaway packages (holocron#273): unquoted and broken frontmatter failing install, the Claude compile writing a `CLAUDE.md` that imports `AGENTS.md`, per-instruction dedup, an unscoped rule's retirement from `.claude/rules/`, hand-authored collisions skipped, stale cleanup, per-target transforms, validation severity and discovery asymmetry. The bats suite in `tests/` re-runs four of these on every push.
|
||||||
|
- **Contributing files:** SKILL.md, references/schema.md, references/target-mapping.md, references/verify.md, references/create.md, references/improve.md
|
||||||
|
- **Status:** `extracted`
|
||||||
|
|
||||||
|
## apm-v0-39-3-source
|
||||||
|
|
||||||
|
- **URL:** https://github.com/microsoft/apm/tree/v0.39.3/src/apm_cli
|
||||||
|
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/instructions-target-mapping.md)
|
||||||
|
- **Description:** apm source at tag v0.39.3: which Claude instruction scopes route to `AGENTS.md`, and the blockers that keep every instruction in `.claude/rules/` (a hand-authored `CLAUDE.md` without the import, a hand-authored `AGENTS.md` without managed-section markers, a symlinked `AGENTS.md`).
|
||||||
|
- **Contributing files:** SKILL.md, references/target-mapping.md
|
||||||
|
- **Status:** `extracted`
|
||||||
|
|
||||||
## apm-cli-0-28-0-experiments
|
## apm-cli-0-28-0-experiments
|
||||||
|
|
||||||
- **URL:** https://pypi.org/project/apm-cli/0.28.0/
|
- **URL:** https://pypi.org/project/apm-cli/0.28.0/
|
||||||
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/instructions-gotchas.md)
|
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/instructions-gotchas.md)
|
||||||
- **Description:** The installed apm-cli 0.28.0 package plus throwaway install, compile and audit experiments confirming validation severity, unquoted-glob handling, discovery asymmetry, dedup and overwrite behaviour.
|
- **Description:** The installed apm-cli 0.28.0 package plus throwaway install, compile and audit experiments. Superseded by `apm-cli-0-39-3-experiments` wherever the two were both run; still the only source for the user-scope deploy rule and the 0.28.0 behaviours the skill names as history.
|
||||||
- **Contributing files:** SKILL.md, references/schema.md, references/target-mapping.md, references/verify.md, references/create.md, references/improve.md
|
- **Contributing files:** references/target-mapping.md
|
||||||
- **Status:** `extracted`
|
- **Status:** `extracted`
|
||||||
|
|
||||||
## claude-code-memory-docs
|
## claude-code-memory-docs
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
---
|
---
|
||||||
source_keys:
|
source_keys:
|
||||||
|
- apm-cli-0-39-3-experiments
|
||||||
|
- apm-v0-39-3-source
|
||||||
- apm-cli-0-28-0-experiments
|
- apm-cli-0-28-0-experiments
|
||||||
- apm-docs-site
|
- apm-docs-site
|
||||||
- claude-code-memory-docs
|
- claude-code-memory-docs
|
||||||
@@ -9,11 +11,11 @@ source_keys:
|
|||||||
|
|
||||||
# What each target receives
|
# What each target receives
|
||||||
|
|
||||||
Verified against apm 0.28.0 and throwaway installs. Reached from `SKILL.md` Step 2 when the question is which target keeps which field. Source-file syntax is in `references/schema.md`.
|
Verified against apm 0.39.3 in throwaway installs, except where a line says otherwise. Reached from `SKILL.md` Step 2 when the question is which target keeps which field. Source-file syntax is in `references/schema.md`.
|
||||||
|
|
||||||
## Two output paths
|
## Two output paths
|
||||||
|
|
||||||
`apm install` writes one native file per instruction into each target's rules directory. `apm compile` writes root context files that concatenate instruction bodies, grouped by `applyTo`. Treat install as the primary path for Claude Code and Copilot, and compile as the path for targets with no native instructions directory.
|
`apm install` writes one native file per instruction into each target's rules directory. `apm compile` writes root context files that concatenate instruction bodies, grouped by `applyTo`. Treat install as the primary path for Copilot and the other rule-directory targets, and compile as the path for targets with no native instructions directory. Claude uses both; see below.
|
||||||
|
|
||||||
## Install: deployed path and transform
|
## Install: deployed path and transform
|
||||||
|
|
||||||
@@ -21,14 +23,23 @@ Verified against apm 0.28.0 and throwaway installs. Reached from `SKILL.md` Step
|
|||||||
|---|---|---|
|
|---|---|---|
|
||||||
| copilot | `.github/instructions/<n>.instructions.md` | Verbatim copy |
|
| copilot | `.github/instructions/<n>.instructions.md` | Verbatim copy |
|
||||||
| claude | `.claude/rules/<n>.md` | `applyTo` becomes a `paths:` list; `description` dropped; no frontmatter at all without `applyTo` |
|
| claude | `.claude/rules/<n>.md` | `applyTo` becomes a `paths:` list; `description` dropped; no frontmatter at all without `applyTo` |
|
||||||
| cursor | `.cursor/rules/<n>.mdc` | `applyTo` becomes `globs`; `description` kept; no `alwaysApply` written |
|
| cursor | `.cursor/rules/<n>.mdc` | `applyTo` becomes `globs`, one comma-separated string even for several patterns; `description` kept; no `alwaysApply` written |
|
||||||
| windsurf | `.windsurf/rules/<n>.md` | `trigger: glob` plus `globs`, or `trigger: always_on`; `description` dropped |
|
| windsurf | `.windsurf/rules/<n>.md` | `trigger: glob` plus `globs`, or `trigger: always_on`; `description` dropped |
|
||||||
| kiro | `.kiro/steering/<n>.md` | `inclusion: fileMatch` plus `fileMatchPattern`, or `inclusion: always`; `description` dropped |
|
| kiro | `.kiro/steering/<n>.md` | `inclusion: fileMatch` plus `fileMatchPattern`, or `inclusion: always`; `description` dropped |
|
||||||
| antigravity | `.agents/rules/<n>.md` | `trigger: glob` plus `globs`, or no frontmatter; `description` dropped |
|
| antigravity | `.agents/rules/<n>.md` | `trigger: glob` plus `globs`, or `trigger: always_on`; `description` dropped |
|
||||||
| grok-build | `.grok/rules/<n>.instructions.md` | Verbatim copy |
|
| grok-build | `.grok/rules/<n>.instructions.md` | Verbatim copy |
|
||||||
| codex, gemini, opencode and the rest | none | Reach instructions only through compile |
|
| codex, gemini, opencode and the rest | none | Reach instructions only through compile |
|
||||||
|
|
||||||
Cursor, Windsurf and Antigravity do not deploy at user scope; Kiro and the rest do.
|
At user scope Cursor, Windsurf and Antigravity do not deploy, and Kiro and the rest do. That is from the 0.28.0 source and was not re-run.
|
||||||
|
|
||||||
|
## Claude: `.claude/rules/` or `AGENTS.md`
|
||||||
|
|
||||||
|
apm 0.38 and later split Claude's instructions between the two.
|
||||||
|
|
||||||
|
- Install deploys every instruction to `.claude/rules/` first.
|
||||||
|
- Compile writes the bodies into `AGENTS.md` and a `CLAUDE.md` that holds only `@AGENTS.md`.
|
||||||
|
- Once a compiled `AGENTS.md` carries an unscoped rule, the next install deletes its `.claude/rules/` copy ("Retired ... AGENTS.md now carries it"). The source also routes a rule scoped to `**`, `**/*` or exactly one literal `dir/**` this way. File-type globs such as `**/*.py`, wildcard directories and lists stay in `.claude/rules/`.
|
||||||
|
- From the source, not run: these keep every instruction in `.claude/rules/`, with a warning: a hand-authored root `CLAUDE.md` without an `@AGENTS.md` import; a hand-authored root `AGENTS.md` without `compilation.agents_md.mode: managed_section` and one pair of `<!-- apm:start -->`/`<!-- apm:end -->` markers; a symlinked `AGENTS.md`. Compile never overwrites a hand-authored root file. User scope never routes to `AGENTS.md`.
|
||||||
|
|
||||||
## Field survival
|
## Field survival
|
||||||
|
|
||||||
@@ -42,22 +53,23 @@ For Claude Code the body's first line or heading is the only descriptive text th
|
|||||||
|
|
||||||
## Ownership and overwrite
|
## Ownership and overwrite
|
||||||
|
|
||||||
- Claude, Cursor, Windsurf, Kiro and Antigravity treat each deployed file as apm-owned: install replaces a hand-authored file at the same path without a prompt. Copilot and grok-build skip an unmanaged file ("local files exist, not managed by APM") until `apm install --force`.
|
- Every rule target skips a hand-authored file at a deployed path: install prints "files skipped -- local files exist, not managed by APM", deploys nothing there and exits 0. `apm install --force` overwrites the hand-authored file. apm 0.28.0 overwrote it silently on Claude, Cursor, Windsurf, Kiro and Antigravity.
|
||||||
- Removing or renaming a source makes the next install delete the file it deployed for Claude, Copilot, Cursor, Windsurf and Kiro. Antigravity and grok-build leave the old file behind in 0.28.0, so delete it by hand.
|
- Removing or renaming a source makes the next install delete the file it deployed, on every rule target.
|
||||||
|
|
||||||
## Compile
|
## Compile
|
||||||
|
|
||||||
- `--target claude` writes `CLAUDE.md`; Gemini writes `GEMINI.md` and `AGENTS.md`; every other target writes `AGENTS.md`.
|
- `--target claude` writes `AGENTS.md` plus a `CLAUDE.md` that imports it. Gemini writes `GEMINI.md`, which also imports `AGENTS.md`. Every other target writes `AGENTS.md`.
|
||||||
- Compile skips instructions already deployed natively, for Claude, Copilot and Antigravity only, and the skip is all-or-nothing: if any instruction has a same-stem file in `.claude/rules/`, compile omits every instruction from `CLAUDE.md`, including a new one never deployed. With rules populated, `--target claude` exits 0, prints "produced no output files" and writes nothing. `--force-instructions` (alias `--no-dedup`) overrides.
|
- For a Claude-only compile, an instruction already deployed to `.claude/rules/` is left out of `AGENTS.md`, one instruction at a time. A nested or newly added one is still compiled. When every instruction is deployed, compile exits 0 and writes no `CLAUDE.md`. `--force-instructions` (alias `--no-dedup`) includes them all.
|
||||||
- Cursor, Windsurf, Kiro and Grok have no dedup: compile writes `AGENTS.md` that repeats rules the tool already loads natively. Codex, Gemini and OpenCode get no native file, so the compiled root file is their only copy.
|
- A compile that also serves a target with no dedup, such as codex, writes every instruction into `AGENTS.md`. Cursor, Windsurf, Kiro and Grok then get each rule twice: natively and through `AGENTS.md`.
|
||||||
- A package with no instruction primitives (skills only) makes plain `apm compile` exit 1 with "No instruction files found"; `apm compile --clean` exits 0.
|
- Compile warns "applyTo for '<n>' matched no files" when a pattern matches nothing in the project, and places that instruction at the root.
|
||||||
|
- A package with skills but no instruction primitives makes plain `apm compile` exit 1 with "No instruction files found"; `apm compile --clean` exits 0.
|
||||||
|
|
||||||
## Native format facts
|
## Native format facts
|
||||||
|
|
||||||
- Claude Code reads `.claude/rules/**/*.md` recursively. `paths` is the only field it reads, as a list or a comma-separated string; other fields are ignored. A rule without `paths` loads at every launch. Frontmatter that fails to parse is ignored and the rule loads without `paths`.
|
- Claude Code reads `.claude/rules/**/*.md` recursively. `paths` is the only field it reads, as a list or a comma-separated string; other fields are ignored. A rule without `paths` loads at every launch. Frontmatter that fails to parse is ignored and the rule loads without `paths`. Claude Code reads `AGENTS.md` only while no `CLAUDE.md` exists or `CLAUDE.md` imports it.
|
||||||
- Copilot path-specific files need `applyTo` as a quoted comma-joined string; `excludeAgent` is the only other documented key. Repository-wide instructions are the separate `.github/copilot-instructions.md`.
|
- Copilot path-specific files need `applyTo` as a quoted comma-joined string; `excludeAgent` is the only other documented key. Repository-wide instructions are the separate `.github/copilot-instructions.md`.
|
||||||
- Cursor ignores a plain `.md` in `.cursor/rules`. A rule with only a `description` is "Apply Intelligently", not always-on.
|
- Cursor ignores a plain `.md` in `.cursor/rules`. A rule with only a `description` is "Apply Intelligently", not always-on.
|
||||||
|
|
||||||
## Unverified
|
## Unverified
|
||||||
|
|
||||||
Cursor's handling of a YAML-list `globs`, Copilot's handling of unknown frontmatter keys, and runtime behaviour on Windsurf, Kiro and Antigravity. Say so rather than asserting any of them.
|
Copilot's handling of unknown frontmatter keys, and runtime behaviour on Windsurf, Kiro and Antigravity. Say so rather than asserting any of them.
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
source_keys:
|
source_keys:
|
||||||
- apm-cli-0-28-0-experiments
|
- apm-cli-0-39-3-experiments
|
||||||
---
|
---
|
||||||
|
|
||||||
# Verifying a file in a throwaway package
|
# Verifying a file in a throwaway package
|
||||||
|
|
||||||
Reached from `SKILL.md` Step 3. Run step 2 outside the repo: `apm install` writes `apm_modules/`, `apm.lock.yaml` and a rules directory, and install overwrites hand-authored rule files without warning.
|
Reached from `SKILL.md` Step 3. Run step 2 outside the repo: `apm install` writes `apm_modules/`, `apm.lock.yaml` and a rules directory. In a repo that pins apm with uv, spell each `apm` below as `uv run --project <repo root> --frozen apm`, so the check runs the repo's apm and not the one on `PATH`.
|
||||||
|
|
||||||
1. From the package root, a real compile. `--validate` hides the missing-`description`, missing-`applyTo` and empty-body warnings and exits 0 whenever the package has an instruction, so it verifies nothing:
|
1. From the package root, a real compile. `--validate` hides the missing-`description`, missing-`applyTo` and empty-body warnings and exits 0 whenever the package has an instruction, so it verifies nothing:
|
||||||
|
|
||||||
@@ -25,8 +25,8 @@ Reached from `SKILL.md` Step 3. Run step 2 outside the repo: `apm install` write
|
|||||||
(cd "$d" && apm install && cat .claude/rules/<name>.md)
|
(cd "$d" && apm install && cat .claude/rules/<name>.md)
|
||||||
```
|
```
|
||||||
|
|
||||||
3. The deployed file must open with `paths:` listing the intended globs. No frontmatter block at all means `applyTo` was missing or did not parse: the rule would load in every session.
|
3. Install must exit 0. Exit 1 with "Rejected frontmatter" means the YAML did not parse, usually an unquoted `applyTo`. The deployed file must open with `paths:` listing the intended globs. No frontmatter block at all means `applyTo` was missing: the rule loads in every session.
|
||||||
|
|
||||||
4. Once rules sit in `.claude/rules/`, `apm compile --target claude` writes no `CLAUDE.md` and still exits 0, so an exit-code check proves nothing. To inspect the compiled root file, pass `--force-instructions`.
|
4. Once every rule sits in `.claude/rules/`, `apm compile --target claude` writes no `CLAUDE.md` and still exits 0, so an exit-code check proves nothing. To inspect the compiled `AGENTS.md`, pass `--force-instructions`. The `CLAUDE.md` it writes holds only `@AGENTS.md`.
|
||||||
|
|
||||||
Delete the directory afterwards. Report only what was observed; Cursor's list-form `globs` and the Windsurf, Kiro and Antigravity runtimes stay unverified.
|
Delete the directory afterwards. Report only what was observed; the Windsurf, Kiro and Antigravity runtimes stay unverified.
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
# tests/
|
# tests/
|
||||||
|
|
||||||
- **`new-instructions.bats`** — covers `scripts/new-instructions.sh` (name validation, package walk-up, no-package refusal, no-op on an existing file, template placeholders) and the apm behaviour the skill's gotchas rest on, run against throwaway packages: a filled scaffold compiles into `CLAUDE.md` and installs into `.claude/rules/` with `description` dropped, compile writes nothing once rules are installed, an unquoted `applyTo` installs unscoped, and `--validate` hides the warnings a real compile prints.
|
- **`new-instructions.bats`** — covers `scripts/new-instructions.sh` (name validation, package walk-up, no-package refusal, no-op on an existing file, template placeholders) and the apm behaviour the skill's gotchas rest on, run against throwaway packages: a filled scaffold compiles into `AGENTS.md` behind a `CLAUDE.md` that imports it, and installs into `.claude/rules/` with `description` dropped; compile writes nothing once rules are installed; an unquoted `applyTo` fails install and deploys nothing; and `--validate` hides the warnings a real compile prints.
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
The test file loads `bats-support` and `bats-assert` from the repo root's `tests/test_helper/`, and runs on the repo's bats submodule at `tests/bats/`. The first `bash tests/run-bats.sh` initialises the submodules.
|
The test file loads `bats-support` and `bats-assert` from the repo root's `tests/test_helper/`, and runs on the repo's bats submodule at `tests/bats/`. The first `bash tests/run-bats.sh` initialises the submodules.
|
||||||
|
|
||||||
The apm tests need the `apm` CLI on `PATH` and skip when it is absent. They assert apm 0.28.0 behaviour, so a failure after an apm upgrade is a finding about the skill's gotchas, not a flaky test.
|
In this repo the apm tests run the repo-pinned apm (`uv run --frozen apm`, through `scripts/lib/apm.sh`) and fail when it is unavailable; run `uv sync --frozen` first. Outside this repo they use the `apm` on `PATH` and skip when it is absent. They assert apm 0.39.3 behaviour, so a failure after an apm upgrade is a finding about the skill's gotchas, not a flaky test.
|
||||||
|
|
||||||
From the repo root:
|
From the repo root:
|
||||||
|
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ need_apm() {
|
|||||||
# re-pinned to the repo's 0.39.3 (#271), where three behaviours changed: compile
|
# re-pinned to the repo's 0.39.3 (#271), where three behaviours changed: compile
|
||||||
# --target claude writes a CLAUDE.md that imports AGENTS.md, an unquoted applyTo
|
# --target claude writes a CLAUDE.md that imports AGENTS.md, an unquoted applyTo
|
||||||
# fails install closed, and compile warns when applyTo matches no file. The
|
# fails install closed, and compile warns when applyTo matches no file. The
|
||||||
# skill's own text still describes 0.28.0 in places; see #271's report.
|
# skill's text was brought level with 0.39.3 under #273.
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
@test "filled scaffold compiles for the Claude target: CLAUDE.md imports AGENTS.md, which drops the description" {
|
@test "filled scaffold compiles for the Claude target: CLAUDE.md imports AGENTS.md, which drops the description" {
|
||||||
|
|||||||
Reference in new issue
Block a user