@laitszkin/apollo-toolkit 2.13.4 → 2.14.0

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,11 @@ All notable changes to this repository are documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ### Added
8
+ - Add `agents` install mode to CLI and installer, aligning npm-based CLI with shell script capabilities.
9
+ - Add `implement-specs-with-worktree` skill for implementing specs in isolated git worktrees.
10
+ - Add `merge-changes-from-local-branches` skill for consolidating local branch changes into main.
11
+
7
12
  ## [v2.13.4] - 2026-04-05
8
13
 
9
14
  ### 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,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,137 @@
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 all local branches and their changes before merging.
24
+ - Execution: Merge each branch into main, auto-resolve conflicts to preserve functionality, and commit the result.
25
+ - Quality: Ensure the final merged state is functional with no broken code.
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
+ - For each branch, note:
38
+ - Branch name
39
+ - Commits ahead of main
40
+ - Last commit message (via `git log -1 --oneline`)
41
+
42
+ ### 2) Ensure clean state on main
43
+
44
+ - Check `git status` on main branch.
45
+ - If there are uncommitted changes on main, stash them:
46
+ ```bash
47
+ git stash push -m "WIP: temporary stash before branch merging"
48
+ ```
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
+ - **Same line, different content**: Prefer the change with:
66
+ - More recent timestamp, OR
67
+ - The change that preserves existing functionality (analyze context to determine which branch's change maintains correct behavior)
68
+ - **File deleted in one branch, modified in another**: Keep the modification unless the deletion is explicitly required for the feature
69
+ - **Both branches modified same file differently**: Keep both sets of changes if non-overlapping; if overlapping, use the more recent change
70
+ - **Test files conflicting**: Keep both test cases unless they test mutually exclusive behaviors
71
+
72
+ Auto-resolve using git's merge strategies:
73
+ ```bash
74
+ git merge -X ours <branch-name> # Prefer main's version for conflicts
75
+ git merge -X theirs <branch-name> # Prefer the merged branch's version
76
+ ```
77
+ Or manually edit conflicted files and:
78
+ ```bash
79
+ git add <resolved-files>
80
+ ```
81
+
82
+ 4. If auto-resolution is ambiguous, prefer the change that:
83
+ - Does not break existing tests
84
+ - Preserves the documented feature intent
85
+ - Keeps more recent bug fixes
86
+
87
+ 5. Complete the merge:
88
+ ```bash
89
+ git commit -m "Merge branch '<branch-name>' into main"
90
+ ```
91
+
92
+ ### 4) Verify merged state
93
+
94
+ - Run relevant tests to ensure nothing is broken:
95
+ ```bash
96
+ # Run tests if a test command exists
97
+ npm test # or yarn test, cargo test, etc.
98
+ ```
99
+ - If tests fail, investigate and fix the conflict resolution.
100
+
101
+ ### 5) Commit the merged result
102
+
103
+ The merge commits already serve as commits. If additional staging is needed:
104
+
105
+ ```bash
106
+ git status
107
+ git add -A
108
+ git commit --amend --no-edit # Amend the last merge commit if needed
109
+ ```
110
+
111
+ ### 6) Report completion
112
+
113
+ - List all branches that were merged.
114
+ - Confirm main is updated with all changes.
115
+ - Note any conflicts that were resolved and the rationale.
116
+ - Confirm no remote push was performed.
117
+
118
+ ## Working Rules
119
+
120
+ - Never force-push; use only merge or rebase with merge.
121
+ - Prefer preserving functionality over keeping either branch's exact changes.
122
+ - Do not push to remote — this skill only merges to local main.
123
+ - If a branch contains no meaningful changes (empty merge), skip it.
124
+ - Keep the main branch history clean and readable.
125
+ - If a branch's merge breaks tests, resolve the conflict differently before committing.
126
+
127
+ ## Conflict Resolution Examples
128
+
129
+ | Scenario | Resolution Strategy |
130
+ |----------|---------------------|
131
+ | Same line, main has older change | Keep branch's change |
132
+ | Same line, branch has older change | Keep main's change |
133
+ | File deleted in branch, modified in main | Keep main's modification |
134
+ | Both added same function differently | Keep both; rename if needed |
135
+ | Config file conflict | Keep both values if non-overlapping |
136
+ | Test file conflict | Keep both test cases |
137
+ | package.json dependency conflict | Keep higher version if compatible |
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.0",
4
4
  "description": "Apollo Toolkit npm installer for managed skill copying across Codex, OpenClaw, and Trae.",
5
5
  "license": "MIT",
6
6
  "author": "LaiTszKin",