@laitszkin/apollo-toolkit 2.13.4 → 2.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@ All notable changes to this repository are documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [v2.14.1] - 2026-04-06
8
+
9
+ ### Changed
10
+ - Tighten `merge-changes-from-local-branches` so it inspects branch divergence before merging, resolves conflicts by composing verified behavior instead of relying on blanket `-X ours/theirs` or timestamp heuristics, and requires targeted verification after conflictful merges.
11
+
12
+ ### Fixed
13
+ - Add missing `agents/openai.yaml` metadata for `merge-changes-from-local-branches` and `implement-specs-with-worktree` so repository agent-config validation passes and both skills expose UI metadata consistently.
14
+
15
+ ## [v2.14.0] - 2026-04-05
16
+
17
+ ### Added
18
+ - Add `agents` install mode to CLI and installer, aligning npm-based CLI with shell script capabilities.
19
+ - Add `implement-specs-with-worktree` skill for implementing specs in isolated git worktrees.
20
+ - Add `merge-changes-from-local-branches` skill for consolidating local branch changes into main.
21
+
7
22
  ## [v2.13.4] - 2026-04-05
8
23
 
9
24
  ### Changed
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: implement-specs-with-worktree
3
+ description: >-
4
+ Read a specs planning set (spec.md, tasks.md, checklist.md, contract.md, design.md)
5
+ from `docs/plans/{YYYY-MM-DD}_{change_name}/` and implement the approved tasks
6
+ within an isolated git worktree. Use when the user asks to implement from an
7
+ existing spec set, execute a spec plan, or work on a feature branch without
8
+ affecting the main working tree. If not already in a worktree, create a new
9
+ worktree with an independent branch, implement all planned tasks, then commit
10
+ the changes to that local branch when complete.
11
+ ---
12
+
13
+ # Implement Specs with Worktree
14
+
15
+ ## Dependencies
16
+
17
+ - Required: `enhance-existing-features` and `develop-new-features` for implementation standards.
18
+ - Conditional: `generate-spec` if spec files need clarification or updates.
19
+ - Optional: none.
20
+ - Fallback: If `enhance-existing-features` or `develop-new-features` is unavailable, stop and report the missing dependency.
21
+
22
+ ## Standards
23
+
24
+ - Evidence: Read and understand the complete specs set before starting implementation.
25
+ - Execution: Create or use an isolated worktree for implementation, follow the implementation standards from the dependent skills, and commit to a local branch when done.
26
+ - Quality: Complete all planned tasks, run relevant tests, and backfill the spec documents with actual completion status.
27
+ - Output: Keep the worktree branch clean with only the intended implementation commits.
28
+
29
+ ## Goal
30
+
31
+ Implement approved spec planning sets in an isolated git worktree, ensuring main development is never interrupted by in-progress work.
32
+
33
+ ## Workflow
34
+
35
+ ### 1) Identify and read the specs set
36
+
37
+ - Locate the specs directory. The path format is `docs/plans/{YYYY-MM-DD}_{change_name}/`.
38
+ - If the user provides a specific path, use that directly.
39
+ - If only a `change_name` or date is given, search for matching directories under `docs/plans/`.
40
+ - Read all five spec files:
41
+ - `spec.md` — requirements and BDD behaviors
42
+ - `tasks.md` — task breakdown
43
+ - `checklist.md` — behavior-to-test alignment and completion tracking
44
+ - `contract.md` — API/interface contracts
45
+ - `design.md` — design decisions and architecture notes
46
+ - Understand the scope, requirements, and planned tasks before proceeding.
47
+
48
+ ### 2) Check current worktree state
49
+
50
+ - Run `git worktree list` to see existing worktrees and branches.
51
+ - Determine if the current session is already inside a worktree (check `git rev-parse --show-toplevel` and compare with `git worktree list`).
52
+
53
+ ### 3) Create a new worktree if needed
54
+
55
+ If not already in a worktree, or if the user explicitly requests a fresh worktree:
56
+
57
+ - Create a new branch for this implementation:
58
+ ```bash
59
+ git branch <branch-name> main
60
+ ```
61
+ - Add a new worktree:
62
+ ```bash
63
+ git worktree add ../<worktree-name> -b <branch-name>
64
+ ```
65
+ - Move into the new worktree directory and begin work there.
66
+
67
+ Use branch naming from `references/branch-naming.md`.
68
+
69
+ ### 4) Implement the planned tasks
70
+
71
+ - Explore the existing codebase relevant to the planned tasks.
72
+ - Verify latest authoritative docs for involved stacks/integrations.
73
+ - Implement each task in `tasks.md` systematically.
74
+ - For each implemented change, add appropriate tests:
75
+ - Unit tests for changed logic
76
+ - Regression tests for bug-prone behavior
77
+ - Property-based tests for business logic changes
78
+ - Integration tests for cross-module chains
79
+ - E2E tests for key user-visible paths
80
+ - Adversarial tests for abuse paths
81
+ - Run relevant tests and fix failures.
82
+ - Do not skip testing even for seemingly small changes.
83
+
84
+ ### 5) Backfill completion status
85
+
86
+ After implementation and testing:
87
+
88
+ - Update `spec.md` with actual completion state for each requirement.
89
+ - Mark completed tasks in `tasks.md`.
90
+ - Update `checklist.md` with test execution results, N/A reasons, and any scope adjustments.
91
+ - Do not mark unused template examples or non-applicable items as complete.
92
+
93
+ ### 6) Commit changes
94
+
95
+ - Stage the implementation files:
96
+ ```bash
97
+ git add <implementation-files> <test-files> <updated-specs>
98
+ ```
99
+ - Write a concise Conventional Commit message describing the implemented scope.
100
+ - Commit to the worktree's local branch:
101
+ ```bash
102
+ git commit -m "<conventional-commit-message>"
103
+ ```
104
+
105
+ ### 7) Report completion
106
+
107
+ - Summarize what was implemented.
108
+ - Note the branch name and worktree location.
109
+ - Confirm that main remains unaffected.
110
+
111
+ ## Working Rules
112
+
113
+ - Always work in an isolated worktree to keep main clean.
114
+ - Complete all planned tasks before committing; do not stop with partial work.
115
+ - Treat the specs as the source of truth for scope — do not deviate without user approval.
116
+ - Follow the testing standards from `enhance-existing-features` and `develop-new-features`.
117
+ - Do not push to remote unless the user explicitly requests it.
118
+
119
+ ## References
120
+
121
+ - `references/branch-naming.md`: branch naming conventions
122
+ - `enhance-existing-features`: implementation standards for brownfield work
123
+ - `develop-new-features`: implementation standards for new feature work
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Implement Specs with Worktree"
3
+ short_description: "Implement an approved spec set inside an isolated git worktree"
4
+ default_prompt: "Use $implement-specs-with-worktree to read the full plan set under docs/plans, create or reuse an isolated git worktree, implement all approved tasks with the required tests, backfill completion status into the planning docs, and commit the result to the local worktree branch without affecting main."
@@ -0,0 +1,16 @@
1
+ # Branch Naming Instructions
2
+
3
+ Use a short, descriptive branch name in this pattern:
4
+
5
+ - type/short-description
6
+ - type/issue-id-short-description (if issue ids are used)
7
+
8
+ Guidelines:
9
+ - Use lowercase letters and hyphens only.
10
+ - Align type with commit message types (feat, fix, docs, chore, refactor, test).
11
+ - Do not rename the current branch unless the user explicitly asks.
12
+
13
+ Examples:
14
+ - feat/add-rpc-timeouts
15
+ - fix/1234-parse-registry
16
+ - impl/feature-x
package/lib/cli.js CHANGED
@@ -17,6 +17,7 @@ const TARGET_OPTIONS = [
17
17
  { id: 'codex', label: 'Codex', description: '~/.codex/skills' },
18
18
  { id: 'openclaw', label: 'OpenClaw', description: '~/.openclaw/workspace*/skills' },
19
19
  { id: 'trae', label: 'Trae', description: '~/.trae/skills' },
20
+ { id: 'agents', label: 'Agents', description: '~/.agents/skills' },
20
21
  { id: 'claude-code', label: 'Claude Code', description: '~/.claude/skills' },
21
22
  ];
22
23
 
@@ -57,7 +58,7 @@ function buildBanner({ version, colorEnabled }) {
57
58
  return [
58
59
  buildWordmark({ colorEnabled }),
59
60
  color('Apollo Toolkit', '1', colorEnabled),
60
- color('Install curated skills for Codex, OpenClaw, Trae, and Claude Code', '2', colorEnabled),
61
+ color('Install curated skills for Codex, OpenClaw, Trae, Agents, and Claude Code', '2', colorEnabled),
61
62
  color(`Version ${version}`, '1;33', colorEnabled),
62
63
  ].join('\n');
63
64
  }
@@ -91,6 +92,7 @@ function buildWelcomeScreen({ version, colorEnabled, stage = 4 }) {
91
92
  ` ${color('Codex', '1', colorEnabled)} ~/.codex/skills`,
92
93
  ` ${color('OpenClaw', '1', colorEnabled)} ~/.openclaw/workspace*/skills`,
93
94
  ` ${color('Trae', '1', colorEnabled)} ~/.trae/skills`,
95
+ ` ${color('Agents', '1', colorEnabled)} ~/.agents/skills`,
94
96
  ` ${color('Claude Code', '1', colorEnabled)} ~/.claude/skills`,
95
97
  );
96
98
  }
@@ -120,8 +122,8 @@ function buildHelpText({ version, colorEnabled }) {
120
122
  buildBanner({ version, colorEnabled }),
121
123
  '',
122
124
  'Usage:',
123
- ' apltk [install] [codex|openclaw|trae|claude-code|all]...',
124
- ' apollo-toolkit [install] [codex|openclaw|trae|claude-code|all]...',
125
+ ' apltk [install] [codex|openclaw|trae|agents|claude-code|all]...',
126
+ ' apollo-toolkit [install] [codex|openclaw|trae|agents|claude-code|all]...',
125
127
  ' apltk --help',
126
128
  ' apollo-toolkit --help',
127
129
  '',
@@ -131,6 +133,7 @@ function buildHelpText({ version, colorEnabled }) {
131
133
  ' npx @laitszkin/apollo-toolkit',
132
134
  ' npx @laitszkin/apollo-toolkit codex openclaw',
133
135
  ' npm i -g @laitszkin/apollo-toolkit',
136
+ ' apltk agents',
134
137
  ' apltk claude-code',
135
138
  ' apltk all',
136
139
  ' apollo-toolkit all',
package/lib/installer.js CHANGED
@@ -3,7 +3,7 @@ const fsp = require('node:fs/promises');
3
3
  const os = require('node:os');
4
4
  const path = require('node:path');
5
5
 
6
- const VALID_MODES = ['codex', 'openclaw', 'trae', 'claude-code'];
6
+ const VALID_MODES = ['codex', 'openclaw', 'trae', 'agents', 'claude-code'];
7
7
  const COPY_FILES = new Set(['AGENTS.md', 'CHANGELOG.md', 'LICENSE', 'README.md', 'package.json']);
8
8
  const COPY_DIRS = new Set(['scripts']);
9
9
 
@@ -203,6 +203,17 @@ async function getTargetRoots(modes, env = process.env) {
203
203
  continue;
204
204
  }
205
205
 
206
+ if (mode === 'agents') {
207
+ targets.push({
208
+ mode,
209
+ label: 'Agents',
210
+ root: env.AGENTS_SKILLS_DIR
211
+ ? path.resolve(expandUserPath(env.AGENTS_SKILLS_DIR, env))
212
+ : path.join(homeDir, '.agents', 'skills'),
213
+ });
214
+ continue;
215
+ }
216
+
206
217
  if (mode === 'openclaw') {
207
218
  const openclawHome = env.OPENCLAW_HOME
208
219
  ? path.resolve(expandUserPath(env.OPENCLAW_HOME, env))
@@ -0,0 +1,131 @@
1
+ ---
2
+ name: merge-changes-from-local-branches
3
+ description: >-
4
+ Read changes from all local git branches and merge them into the local main
5
+ branch. When conflicts arise, auto-resolve them by keeping correct functionality
6
+ (preferring the more recent change on the same line, or the change that preserves
7
+ working behavior). Commit the merged result to local main without pushing to
8
+ remote. Use when the user asks to consolidate local branch work, merge all
9
+ changes into main, or prepare local branches for integration.
10
+ ---
11
+
12
+ # Merge Changes from Local Branches
13
+
14
+ ## Dependencies
15
+
16
+ - Required: none (uses native git commands).
17
+ - Conditional: none.
18
+ - Optional: `commit-and-push` if commit message guidance is needed.
19
+ - Fallback: If git operations fail, stop and report the error.
20
+
21
+ ## Standards
22
+
23
+ - Evidence: Inspect the current branch state, local branches, ahead/behind status, and actual conflicting files before deciding what to merge.
24
+ - Execution: Merge only the relevant local branches into `main` sequentially, resolve conflicts by reading both sides and editing the merged result to preserve shipped behavior, then verify the merged state.
25
+ - Quality: Never use blanket timestamp rules or default `-X ours/theirs` conflict resolution as the primary merge strategy, and do not declare success until the final `main` state has been checked and verified.
26
+ - Output: Produce a clean main branch with all local changes integrated.
27
+
28
+ ## Goal
29
+
30
+ Consolidate all local branch changes into the local main branch with automatic conflict resolution that preserves correct functionality.
31
+
32
+ ## Workflow
33
+
34
+ ### 1) Inventory all local branches
35
+
36
+ - Run `git branch` to list all local branches.
37
+ - Check the current branch with `git branch --show-current` and capture `git status -sb`.
38
+ - Compare each candidate branch against `main` with `git log --oneline main..branch`, `git diff --stat main...branch`, or equivalent evidence so empty or already-merged branches are skipped.
39
+ - For each branch, note:
40
+ - Branch name
41
+ - Commits ahead of main
42
+ - Last commit message (via `git log -1 --oneline`)
43
+
44
+ ### 2) Ensure clean state on main
45
+
46
+ - Check `git status` on `main`.
47
+ - If `main` has uncommitted changes that are unrelated to the merge request, stop and report them instead of stashing automatically.
48
+ - Only proceed once you can state which branch or branches actually need to be merged.
49
+
50
+ ### 3) Merge branches sequentially
51
+
52
+ For each local branch (excluding main):
53
+
54
+ 1. Check out main:
55
+ ```bash
56
+ git checkout main
57
+ ```
58
+
59
+ 2. Merge the branch:
60
+ ```bash
61
+ git merge <branch-name> --no-ff -m "Merge branch '<branch-name>' into main"
62
+ ```
63
+
64
+ 3. If conflicts occur, resolve them automatically using these rules:
65
+ - Read the conflict markers and both parent versions before editing.
66
+ - **Same line, different content**: keep the version that matches the intended post-merge behavior, not simply the newer edit.
67
+ - **File deleted in one branch, modified in another**: keep the version supported by current code references and tests; do not silently drop reachable code.
68
+ - **Both branches modified the same file differently**: preserve both changes when they are compatible; if they overlap, manually compose a merged result that keeps the verified logic from both sides.
69
+ - **Test files conflicting**: preserve coverage for both behaviors unless one assertion is now obsolete by verified implementation changes.
70
+ - Use `-X ours` / `-X theirs` only for a narrowly justified conflict after reading the actual content; never use those flags as the default merge strategy.
71
+
72
+ After resolving files:
73
+ ```bash
74
+ git add <resolved-files>
75
+ ```
76
+
77
+ 4. If auto-resolution is ambiguous, prefer the change that:
78
+ - Does not break existing tests
79
+ - Preserves the documented feature intent
80
+ - Aligns with the code currently shipped on the source branch
81
+ - Minimizes hidden semantic drift between the merged modules
82
+
83
+ 5. Complete the merge:
84
+ ```bash
85
+ git commit -m "Merge branch '<branch-name>' into main"
86
+ ```
87
+
88
+ ### 4) Verify merged state
89
+
90
+ - After each conflictful merge, run the most relevant targeted tests or build checks for the files that changed.
91
+ - After all merges complete, run the repository's broader validation command when one exists:
92
+ ```bash
93
+ npm test # or yarn test, cargo test, etc.
94
+ ```
95
+ - If verification fails, fix the merged state on `main` before proceeding.
96
+
97
+ ### 5) Commit the merged result
98
+
99
+ - The merge commits are the submission artifact; do not amend them unless the user explicitly asks for history rewriting.
100
+ - If a follow-up fix is required after verification, create a normal commit on `main` that explains the correction.
101
+
102
+ ### 6) Report completion
103
+
104
+ - List all branches that were merged.
105
+ - List any branches intentionally skipped because they were already merged, empty, or out of scope.
106
+ - Confirm main is updated with all changes.
107
+ - Note any conflicts that were resolved and the rationale.
108
+ - Report the verification commands that were run.
109
+ - Confirm no remote push was performed.
110
+
111
+ ## Working Rules
112
+
113
+ - Never force-push; use only merge or rebase with merge.
114
+ - Prefer preserving functionality over keeping either branch's exact changes.
115
+ - Do not push to remote — this skill only merges to local main.
116
+ - If a branch contains no meaningful changes (empty merge), skip it.
117
+ - Keep the main branch history clean and readable.
118
+ - If a branch's merge breaks tests, resolve the conflict differently before committing.
119
+ - Do not stash or discard unrelated work automatically; stop when the working tree state makes the merge ambiguous.
120
+
121
+ ## Conflict Resolution Examples
122
+
123
+ | Scenario | Resolution Strategy |
124
+ |----------|---------------------|
125
+ | Same line, both branches changed behavior | Read both code paths and compose the merged logic that preserves the verified invariant |
126
+ | Same line, one branch is a bug fix and the other is a refactor | Keep the bug fix and reapply the compatible refactor structure manually if needed |
127
+ | File deleted in branch, modified in main | Keep the version supported by current references/tests and remove only if the deletion is proven correct |
128
+ | Both added same function differently | Keep both; rename if needed |
129
+ | Config file conflict | Keep both values if non-overlapping |
130
+ | Test file conflict | Keep both test cases |
131
+ | package.json dependency conflict | Keep higher version if compatible |
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Merge Changes from Local Branches"
3
+ short_description: "Merge relevant local branches into main with verified conflict resolution"
4
+ default_prompt: "Use $merge-changes-from-local-branches to inventory local branches, merge only the relevant ones into local main, resolve conflicts by reading and composing the correct behavior instead of relying on blanket merge strategies, run targeted verification after conflictful merges, and leave remote state untouched."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laitszkin/apollo-toolkit",
3
- "version": "2.13.4",
3
+ "version": "2.14.1",
4
4
  "description": "Apollo Toolkit npm installer for managed skill copying across Codex, OpenClaw, and Trae.",
5
5
  "license": "MIT",
6
6
  "author": "LaiTszKin",