Skip to content

Vendor apm-generated .claude/ and .opencode/ into git#52

Merged
srid merged 17 commits into
mainfrom
vendor-apm
Apr 7, 2026
Merged

Vendor apm-generated .claude/ and .opencode/ into git#52
srid merged 17 commits into
mainfrom
vendor-apm

Conversation

@srid

@srid srid commented Apr 7, 2026

Copy link
Copy Markdown
Member

Commits apm-generated config trees to the repo instead of gitignoring them, following the pattern established in juspay/kolu. This makes the vendored files available as plain nix store paths — no runtime apm dependency needed for oneclick builds.

The .claude/ directory was already being generated by apm install -t claude; now .opencode/ joins it via -t opencode. Both are committed and kept in sync by an apm-sync CI recipe that regenerates from the lock file and fails if the working tree is dirty.

The justfile splits the old apm recipe into apm (single-target, for dev sessions) and apm-vendor (both targets, for updating vendored files). This avoids complecting "prep my agent session" with "regenerate all vendored output".

This is groundwork for a follow-up PR that replaces the juspay/skills flake input with an apm dependency, letting the nix oneclick build source skills directly from the vendored tree.

@srid

srid commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

Hickey Analysis

Finding: The apm recipe in agent/mod.just currently serves one purpose — prep before running an agent (single target). Changing it to install both -t claude and -t opencode would complect the dev workflow (run agent) with the vendoring workflow (update committed files).

When a developer runs just agent::run to launch claude, they don't need .opencode/ regenerated. These are independent concerns braided by a shared recipe.

Simplification: Split into composed recipes:

  • apm — single target (current behavior), used by run
  • apm-vendor — both targets, used for updating vendored files
  • apm-sync — runs apm-vendor + git status --porcelain check for CI

No other complecting found. The rest (gitignore edits, committing vendored dirs) is plain data, no abstractions or state braiding.

Instead of gitignoring apm output, commit it so nix builds can
reference vendored skills/commands without a runtime apm dependency.

Split justfile: `apm` (single target for dev), `apm-vendor` (both
targets for updating vendored files), `apm-sync` (CI freshness check).
@srid srid marked this pull request as ready for review April 7, 2026 00:15
@srid

srid commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

/do results

Step Status Duration Verification
sync 9s git fetch succeeded
research 45s Understood gitignore, apm.yml, justfile structure
hickey 35s Split apm recipe to avoid complecting dev/vendor
branch 52s Draft PR #52 opened, hickey comment posted
implement 72s Gitignore updated, justfile split, .opencode/ generated
docs 6s No docs to update
police 42s All 3 passes clean
fmt 5s No format command configured
commit 21s d17f1fb pushed
test 7s No relevant tests (no nix changes)
ci 42s vira ci -b passed, 3 VM tests built
update-pr 10s Marked ready for review
Total 5m 46s

Optimization suggestions

  • CI dominated wall-clock time at ~42s (but ran in background, overlapping with update-pr). For re-runs, use --from ci-only.
  • Research was fast because the talk-mode conversation already explored the design space thoroughly. Pre-discussion before /do is effective.
  • Branch step included PR creation — the gh CLI round-trip added ~20s. Unavoidable but worth noting.

Workflow completed at 2026-04-07T00:15:51Z.

srid added 15 commits April 6, 2026 20:17
Collapses .claude/ and .opencode/ diffs in GitHub PR reviews.
GitHub Actions workflow regenerates vendored .claude/ and .opencode/
then fails if git status shows drift. Pre-cleans settings.json to
work around apm's additive hook duplication bug (#561).

Also: `just agent::run` no longer runs apm install first since
vendored files are committed.
project.md is now maintained directly in the vendored .claude/rules/
tree — no need for the .apm/instructions indirection.
Faster — no nix eval/build overhead, just pip install + run.
The previous check ran apm on top of the existing tree, so files
no longer produced by apm (like project.md) went undetected.
Consistent tooling — no nix dependency for apm. Pinned to v0.8.10
because v0.8.11 drops commands/rules deployment.
The lock file only records the last target's deployed files, making
it useless for multi-target workflows. Pin commits in apm.yml instead
and rely on vendored output as the source of truth.

See: microsoft/apm#529
@srid srid merged commit 0da9d41 into main Apr 7, 2026
5 checks passed
@srid srid deleted the vendor-apm branch April 7, 2026 00:41
srid added a commit that referenced this pull request Apr 7, 2026
**Drops both the `juspay/skills` flake input and `flake-parts`**,
simplifying the flake to plain nix outputs. Skills are now sourced from
the vendored `.opencode/skills/` directory populated by apm.

The `apm.yml` references `juspay/skills` as a whole-repo package — apm
discovers all 9 skills automatically and vendors them alongside
`srid/agency`'s skills into `.claude/` and `.opencode/`. The oneclick
nix build reads directly from the vendored tree.

*Lock file is deleted between target runs to work around apm's content
hash mismatch across targets
([#529](microsoft/apm#529

> Completes the migration started in #52.
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.

1 participant