@laitszkin/apollo-toolkit 2.12.4 → 2.12.6
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/AGENTS.md +10 -0
- package/CHANGELOG.md +20 -0
- package/README.md +3 -0
- package/commit-and-push/SKILL.md +6 -1
- package/develop-new-features/SKILL.md +5 -0
- package/enhance-existing-features/SKILL.md +4 -0
- package/lib/cli.js +28 -1
- package/lib/updater.js +193 -0
- package/maintain-project-constraints/SKILL.md +26 -2
- package/maintain-project-constraints/agents/openai.yaml +2 -2
- package/package.json +3 -2
- package/production-sim-debug/SKILL.md +15 -2
package/AGENTS.md
CHANGED
|
@@ -58,6 +58,16 @@ This repository enables users to install and run a curated set of reusable agent
|
|
|
58
58
|
- Users can prepare and publish versioned releases with changelog and tag workflows.
|
|
59
59
|
- Users can generate long-form videos by orchestrating storyboard, voice, and Remotion-based production steps.
|
|
60
60
|
|
|
61
|
+
## Common Commands
|
|
62
|
+
|
|
63
|
+
- `npm test` - 執行 Node 測試套件。
|
|
64
|
+
- `node bin/apollo-toolkit.js` - 直接從倉庫啟動 Apollo Toolkit CLI。
|
|
65
|
+
- `node bin/apollo-toolkit.js codex openclaw trae` - 以非互動方式將技能安裝到指定目標。
|
|
66
|
+
- `python3 scripts/validate_skill_frontmatter.py` - 驗證所有頂層技能 `SKILL.md` 的 frontmatter。
|
|
67
|
+
- `python3 scripts/validate_openai_agent_config.py` - 驗證所有技能 `agents/openai.yaml` 設定。
|
|
68
|
+
- `./scripts/install_skills.sh codex` - 用本地安裝腳本把技能安裝到 Codex 目錄。
|
|
69
|
+
- `./scripts/install_skills.sh all` - 用本地安裝腳本同步安裝到所有支援目標。
|
|
70
|
+
|
|
61
71
|
## Core Project Purpose
|
|
62
72
|
|
|
63
73
|
- Provide a curated set of reusable agent skills that can be installed into Codex/OpenClaw/Trae skill directories.
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@ All notable changes to this repository are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [v2.12.6] - 2026-04-02
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Add the global `apltk` CLI alias so the Apollo Toolkit installer can be launched with a shorter command after npm installation.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Update `develop-new-features` and `enhance-existing-features` so any spec-backed change affecting more than three modules must be split into independent, non-conflicting, non-dependent spec sets.
|
|
14
|
+
- Expand `commit-and-push` with stricter worktree replay and cleanup rules so temporary worktree delivery verifies the authoritative target branch before removing the worktree.
|
|
15
|
+
- Strengthen `production-sim-debug` so protocol-sensitive simulation claims must be checked against official docs or upstream source, and infeasible local-simulation designs must be collapsed quickly instead of left as pending implementation.
|
|
16
|
+
- Update the Apollo Toolkit CLI so interactive global runs can start from `apltk`, check npm for newer published packages, and offer an in-place global update before continuing.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- Fix updater version comparison so prerelease builds such as `2.12.5-beta.1` no longer suppress available stable-release upgrade prompts.
|
|
20
|
+
|
|
21
|
+
## [v2.12.5] - 2026-04-01
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- Update `maintain-project-constraints` so generated `AGENTS.md` templates must include a factual `Common Commands` section grounded in repository-owned command entry points such as CLIs, package scripts, and task runners.
|
|
25
|
+
- Refresh the Apollo Toolkit root `AGENTS.md` guidance with repository-specific common commands for the local CLI, validation scripts, tests, and install flows.
|
|
26
|
+
|
|
7
27
|
## [v2.12.4] - 2026-04-01
|
|
8
28
|
|
|
9
29
|
### Added
|
package/README.md
CHANGED
|
@@ -70,9 +70,12 @@ The interactive installer:
|
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
72
|
npm i -g @laitszkin/apollo-toolkit
|
|
73
|
+
apltk
|
|
73
74
|
apollo-toolkit
|
|
74
75
|
```
|
|
75
76
|
|
|
77
|
+
Global install 後,`apltk` 與 `apollo-toolkit` 都會啟動同一個 Apollo Toolkit CLI。直接執行 `apltk` 會打開互動安裝頁,並在互動模式下先檢查 npm registry 是否有新版可用;若有,CLI 會先詢問,再自動執行全域更新。
|
|
78
|
+
|
|
76
79
|
### Non-interactive install
|
|
77
80
|
|
|
78
81
|
```bash
|
package/commit-and-push/SKILL.md
CHANGED
|
@@ -15,7 +15,7 @@ description: "Guide the agent to submit local changes with commit and push only
|
|
|
15
15
|
## Standards
|
|
16
16
|
|
|
17
17
|
- Evidence: Inspect git state and classify the change set before deciding which quality gates apply, then compare the actual pending diff against root `CHANGELOG.md` `Unreleased` before committing.
|
|
18
|
-
- Execution: Run the required quality-gate skills when applicable, and treat every conditional gate whose scenario is met as blocking before submission; hand the repository to `submission-readiness-check` for changelog/docs/plan finalization, preserve staging intent, honor any explicit user-specified target branch, and when the worktree is already clean inspect local `HEAD`, upstream state, and the most recent relevant commit before deciding the request is a no-op; then commit and push without release steps; run dependent git mutations sequentially and verify the remote branch actually contains the new local `HEAD` before reporting success.
|
|
18
|
+
- Execution: Run the required quality-gate skills when applicable, and treat every conditional gate whose scenario is met as blocking before submission; hand the repository to `submission-readiness-check` for changelog/docs/plan finalization, preserve staging intent, honor any explicit user-specified target branch, and when the worktree is already clean inspect local `HEAD`, upstream state, and the most recent relevant commit before deciding the request is a no-op; when worktree-based delivery is involved, verify where the authoritative target branch lives before moving history, re-validate on that target branch after replay or merge, and remove the temporary worktree only after the target branch is safely updated; then commit and push without release steps; run dependent git mutations sequentially and verify the remote branch actually contains the new local `HEAD` before reporting success.
|
|
19
19
|
- Quality: Re-run relevant validation for runtime changes, preserve unrelated local work safely when branch switching or post-push local sync is required, and do not bypass blocking readiness findings such as missing/stale `Unreleased` bullets or unsynchronized project docs.
|
|
20
20
|
- Output: Produce a concise Conventional Commit, push it to the intended branch, and report any temporary stash/restore or local branch sync that was required.
|
|
21
21
|
|
|
@@ -51,6 +51,9 @@ Load only when needed:
|
|
|
51
51
|
- Preserve unrelated uncommitted work safely before branch operations, for example with `git stash push`, and restore it after the target branch has been updated.
|
|
52
52
|
- If the fix was committed on the wrong branch, move it to the requested branch with safe history-preserving operations such as `cherry-pick`, `merge --ff-only`, or a clean replay; do not force-push unless the user explicitly asks for it.
|
|
53
53
|
- If the user asks to sync the local target branch after pushing, fast-forward or pull that branch locally and then restore any preserved worktree changes.
|
|
54
|
+
- If the implementation lives in a detached or temporary `git worktree`, inspect both the temporary worktree and the main worktree before deciding the replay method.
|
|
55
|
+
- When the main worktree already contains staged or partially overlapping copies of the same changes, compare file content and branch tips first; do not create an unnecessary merge commit when a direct replay onto the authoritative target branch is safer.
|
|
56
|
+
- When the worktree diff is broader than the requested issue, stop and separate the requested commit scope before replaying anything to the target branch.
|
|
54
57
|
4. Run code-affecting dependency skills (when applicable)
|
|
55
58
|
- Run `review-change-set` for every code-affecting change before continuing; treat unresolved review findings as blocking.
|
|
56
59
|
- Run `discover-edge-cases` and `harden-app-security` for the same code-affecting scope when the reviewed risk profile or repository context says their coverage is needed; treat them as blocking review gates, not optional polish, whenever that condition is met.
|
|
@@ -71,6 +74,7 @@ Load only when needed:
|
|
|
71
74
|
- After pushing, verify the remote branch tip matches the local `HEAD`, for example by comparing `git rev-parse HEAD` with the target branch hash from `git rev-parse @{u}` or `git ls-remote --heads <remote> <branch>`.
|
|
72
75
|
- If the push result is ambiguous, out of order, or the hashes do not match, rerun the missing git step sequentially and re-check before reporting success.
|
|
73
76
|
- Confirm the local branch state matches the user's requested destination when post-push synchronization was requested.
|
|
77
|
+
- When the user explicitly asks to merge work back from a temporary worktree and delete that worktree, do the final verification on the authoritative target branch first, then remove the temporary worktree and prune stale worktree records before reporting completion.
|
|
74
78
|
|
|
75
79
|
## Notes
|
|
76
80
|
|
|
@@ -80,6 +84,7 @@ Load only when needed:
|
|
|
80
84
|
- Never downgrade `discover-edge-cases` or `harden-app-security` to optional follow-up when the change risk says they apply.
|
|
81
85
|
- Never claim the repository is ready to commit while root `CHANGELOG.md` `Unreleased` is missing the current change or still describes superseded work.
|
|
82
86
|
- Never fabricate a commit/push result when the worktree is already clean; either identify the exact existing commit/upstream state that satisfies the user's request or say that no matching new submission exists.
|
|
87
|
+
- Never delete a temporary worktree before the target branch has been updated, tested, and verified to contain the intended final content.
|
|
83
88
|
- If release/version/tag work is requested, use `version-release` instead.
|
|
84
89
|
- If a new branch is required, follow `references/branch-naming.md`.
|
|
85
90
|
- A pushed implementation can still leave an active spec set behind; commit completion and spec archival are separate decisions.
|
|
@@ -56,6 +56,10 @@ Use a shared spec-generation workflow for non-trivial new feature work, then imp
|
|
|
56
56
|
- narrowly scoped adjustments that touch only a few files/modules and do not require cross-team alignment or approval artifacts
|
|
57
57
|
- In those cases, do not create `spec.md` / `tasks.md` / `checklist.md`; instead use the appropriate direct implementation workflow (for example `enhance-existing-features` for small brownfield adjustments or `systematic-debug` for bug fixes).
|
|
58
58
|
- Specs are required when the request is truly a non-trivial new feature, product behavior change, or greenfield project that needs shared planning.
|
|
59
|
+
- Treat each spec set as a narrowly scoped workstream that covers at most three modules.
|
|
60
|
+
- If the requested change would require edits across more than three modules, do not force it into one oversized spec set.
|
|
61
|
+
- Instead, split the work into multiple independent spec sets, each covering no more than three modules.
|
|
62
|
+
- Define those spec sets so they do not conflict with each other and do not depend on another spec set being implemented first in order to be valid.
|
|
59
63
|
- Follow `$generate-spec` completely for:
|
|
60
64
|
- generating `docs/plans/{YYYY-MM-DD}_{change_name}/spec.md`, `tasks.md`, and `checklist.md`
|
|
61
65
|
- filling BDD requirements and risk-driven test plans
|
|
@@ -117,6 +121,7 @@ Rules:
|
|
|
117
121
|
|
|
118
122
|
- By default, write planning docs in the user's language.
|
|
119
123
|
- Keep implementation traceable to approved requirement IDs and planned risks.
|
|
124
|
+
- Keep each spec set limited to at most three modules; split larger changes into independent, non-conflicting, non-dependent spec sets before approval.
|
|
120
125
|
- Prefer realism over rigid templates: add or remove test coverage only when the risk profile justifies it.
|
|
121
126
|
- Every planned test should justify a distinct risk; remove shallow duplicates that only prove the code "still runs".
|
|
122
127
|
- Treat starter template alternatives as mutually exclusive options, not as boxes that all need to be checked.
|
|
@@ -66,6 +66,9 @@ When in doubt, prefer direct implementation for genuinely low-risk localized cha
|
|
|
66
66
|
If triggered:
|
|
67
67
|
- Run `$generate-spec` and follow its workflow completely.
|
|
68
68
|
- Use it to create or update `docs/plans/{YYYY-MM-DD}_{change_name}/spec.md`, `tasks.md`, and `checklist.md`.
|
|
69
|
+
- Keep each spec set scoped to at most three modules.
|
|
70
|
+
- If the requested change would require edits across more than three modules, split it into multiple spec sets instead of drafting one large coupled plan.
|
|
71
|
+
- Design the split spec sets so they are independently valid, do not conflict with each other, and do not require another spec set to land first.
|
|
69
72
|
- Ensure planned behaviors and edge cases cover external dependency states, abuse/adversarial paths, and any relevant authorization/idempotency/concurrency/data-integrity risks.
|
|
70
73
|
- After implementation and testing, update the same plan set so `spec.md` reflects requirement completion status in addition to task and checklist progress.
|
|
71
74
|
- If users answer clarification questions, update the planning docs and obtain explicit approval again before implementation.
|
|
@@ -130,6 +133,7 @@ Rules:
|
|
|
130
133
|
|
|
131
134
|
- Keep the solution minimal and executable.
|
|
132
135
|
- Always decide the need for specs only after exploring the existing codebase.
|
|
136
|
+
- When specs are used, keep each spec set limited to at most three modules; split broader work into independent, non-conflicting, non-dependent spec sets before approval.
|
|
133
137
|
- Maintain traceability between requirements, tasks, and tests when specs are present.
|
|
134
138
|
- Treat checklists as living artifacts: adjust items to match real change scope.
|
|
135
139
|
- Treat mutually exclusive template choices as a decision to record, not multiple boxes to finish.
|
package/lib/cli.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const { createInterface } = require('node:readline/promises');
|
|
2
|
+
const fs = require('node:fs');
|
|
2
3
|
const path = require('node:path');
|
|
3
4
|
|
|
4
5
|
const {
|
|
@@ -9,6 +10,7 @@ const {
|
|
|
9
10
|
syncToolkitHome,
|
|
10
11
|
getTargetRoots,
|
|
11
12
|
} = require('./installer');
|
|
13
|
+
const { checkForPackageUpdate } = require('./updater');
|
|
12
14
|
|
|
13
15
|
const TARGET_OPTIONS = [
|
|
14
16
|
{ id: 'all', label: 'All', description: 'Install every supported target below' },
|
|
@@ -116,13 +118,18 @@ function buildHelpText({ version, colorEnabled }) {
|
|
|
116
118
|
buildBanner({ version, colorEnabled }),
|
|
117
119
|
'',
|
|
118
120
|
'Usage:',
|
|
121
|
+
' apltk [install] [codex|openclaw|trae|all]...',
|
|
119
122
|
' apollo-toolkit [install] [codex|openclaw|trae|all]...',
|
|
123
|
+
' apltk --help',
|
|
120
124
|
' apollo-toolkit --help',
|
|
121
125
|
'',
|
|
122
126
|
'Examples:',
|
|
127
|
+
' apltk',
|
|
128
|
+
' apltk codex openclaw',
|
|
123
129
|
' npx @laitszkin/apollo-toolkit',
|
|
124
130
|
' npx @laitszkin/apollo-toolkit codex openclaw',
|
|
125
131
|
' npm i -g @laitszkin/apollo-toolkit',
|
|
132
|
+
' apltk all',
|
|
126
133
|
' apollo-toolkit all',
|
|
127
134
|
'',
|
|
128
135
|
'Options:',
|
|
@@ -131,6 +138,10 @@ function buildHelpText({ version, colorEnabled }) {
|
|
|
131
138
|
].join('\n');
|
|
132
139
|
}
|
|
133
140
|
|
|
141
|
+
function readPackageJson(sourceRoot) {
|
|
142
|
+
return JSON.parse(fs.readFileSync(path.join(sourceRoot, 'package.json'), 'utf8'));
|
|
143
|
+
}
|
|
144
|
+
|
|
134
145
|
function parseArguments(argv) {
|
|
135
146
|
const args = [...argv];
|
|
136
147
|
const result = {
|
|
@@ -343,7 +354,7 @@ async function run(argv, context = {}) {
|
|
|
343
354
|
const stderr = context.stderr || process.stderr;
|
|
344
355
|
const stdin = context.stdin || process.stdin;
|
|
345
356
|
const env = context.env || process.env;
|
|
346
|
-
|
|
357
|
+
let packageJson = readPackageJson(sourceRoot);
|
|
347
358
|
|
|
348
359
|
try {
|
|
349
360
|
const parsed = parseArguments(argv);
|
|
@@ -352,6 +363,21 @@ async function run(argv, context = {}) {
|
|
|
352
363
|
return 0;
|
|
353
364
|
}
|
|
354
365
|
|
|
366
|
+
const updateResult = await checkForPackageUpdate({
|
|
367
|
+
packageName: packageJson.name,
|
|
368
|
+
currentVersion: packageJson.version,
|
|
369
|
+
env,
|
|
370
|
+
stdin,
|
|
371
|
+
stdout,
|
|
372
|
+
stderr,
|
|
373
|
+
exec: context.execCommand,
|
|
374
|
+
confirmUpdate: context.confirmUpdate,
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
if (updateResult.updated) {
|
|
378
|
+
packageJson = readPackageJson(sourceRoot);
|
|
379
|
+
}
|
|
380
|
+
|
|
355
381
|
const toolkitHome = parsed.toolkitHome || resolveToolkitHome(env);
|
|
356
382
|
const modes = parsed.modes.length > 0
|
|
357
383
|
? normalizeModes(parsed.modes)
|
|
@@ -401,5 +427,6 @@ module.exports = {
|
|
|
401
427
|
buildHelpText,
|
|
402
428
|
parseArguments,
|
|
403
429
|
promptForModes,
|
|
430
|
+
readPackageJson,
|
|
404
431
|
run,
|
|
405
432
|
};
|
package/lib/updater.js
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
const { spawn } = require('node:child_process');
|
|
2
|
+
const { createInterface } = require('node:readline/promises');
|
|
3
|
+
|
|
4
|
+
function normalizeVersion(version) {
|
|
5
|
+
return String(version || '')
|
|
6
|
+
.trim()
|
|
7
|
+
.replace(/^v/i, '');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function parseVersion(version) {
|
|
11
|
+
const normalized = normalizeVersion(version);
|
|
12
|
+
const [core, prerelease = ''] = normalized.split('-', 2);
|
|
13
|
+
const parts = core.split('.').map((part) => Number.parseInt(part, 10) || 0);
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
parts,
|
|
17
|
+
prerelease,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function compareVersions(left, right) {
|
|
22
|
+
const leftVersion = parseVersion(left);
|
|
23
|
+
const rightVersion = parseVersion(right);
|
|
24
|
+
const leftParts = leftVersion.parts;
|
|
25
|
+
const rightParts = rightVersion.parts;
|
|
26
|
+
const length = Math.max(leftParts.length, rightParts.length);
|
|
27
|
+
|
|
28
|
+
for (let index = 0; index < length; index += 1) {
|
|
29
|
+
const delta = (leftParts[index] || 0) - (rightParts[index] || 0);
|
|
30
|
+
if (delta !== 0) {
|
|
31
|
+
return delta;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (leftVersion.prerelease && !rightVersion.prerelease) {
|
|
36
|
+
return -1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!leftVersion.prerelease && rightVersion.prerelease) {
|
|
40
|
+
return 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (leftVersion.prerelease !== rightVersion.prerelease) {
|
|
44
|
+
return leftVersion.prerelease.localeCompare(rightVersion.prerelease);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function shouldSkipUpdateCheck({ env = process.env, stdin = process.stdin, stdout = process.stdout }) {
|
|
51
|
+
return env.APOLLO_TOOLKIT_SKIP_UPDATE_CHECK === '1' || !stdin.isTTY || !stdout.isTTY;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function execCommand(command, args, { env = process.env, stdout, stderr } = {}) {
|
|
55
|
+
return new Promise((resolve, reject) => {
|
|
56
|
+
const child = spawn(command, args, {
|
|
57
|
+
env,
|
|
58
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
let capturedStdout = '';
|
|
62
|
+
let capturedStderr = '';
|
|
63
|
+
|
|
64
|
+
child.stdout.on('data', (chunk) => {
|
|
65
|
+
capturedStdout += chunk.toString('utf8');
|
|
66
|
+
if (stdout) {
|
|
67
|
+
stdout.write(chunk);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
child.stderr.on('data', (chunk) => {
|
|
72
|
+
capturedStderr += chunk.toString('utf8');
|
|
73
|
+
if (stderr) {
|
|
74
|
+
stderr.write(chunk);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
child.on('error', reject);
|
|
79
|
+
child.on('close', (code) => {
|
|
80
|
+
if (code !== 0) {
|
|
81
|
+
reject(new Error(capturedStderr.trim() || `${command} exited with code ${code}`));
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
resolve({
|
|
86
|
+
stdout: capturedStdout,
|
|
87
|
+
stderr: capturedStderr,
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async function defaultConfirmUpdate({ stdin, stdout, currentVersion, latestVersion, packageName }) {
|
|
94
|
+
const rl = createInterface({ input: stdin, output: stdout });
|
|
95
|
+
try {
|
|
96
|
+
const answer = await rl.question(
|
|
97
|
+
`A newer ${packageName} release is available (${currentVersion} -> ${latestVersion}). Update now? [Y/n] `,
|
|
98
|
+
);
|
|
99
|
+
const normalized = answer.trim().toLowerCase();
|
|
100
|
+
return normalized === '' || normalized === 'y';
|
|
101
|
+
} finally {
|
|
102
|
+
rl.close();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async function getLatestPublishedVersion({
|
|
107
|
+
packageName,
|
|
108
|
+
env = process.env,
|
|
109
|
+
exec = execCommand,
|
|
110
|
+
}) {
|
|
111
|
+
const result = await exec('npm', ['view', packageName, 'version', '--json'], { env });
|
|
112
|
+
const parsed = JSON.parse(result.stdout.trim());
|
|
113
|
+
|
|
114
|
+
if (Array.isArray(parsed)) {
|
|
115
|
+
return String(parsed[parsed.length - 1] || '').trim();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return String(parsed || '').trim();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async function checkForPackageUpdate({
|
|
122
|
+
packageName,
|
|
123
|
+
currentVersion,
|
|
124
|
+
env = process.env,
|
|
125
|
+
stdin = process.stdin,
|
|
126
|
+
stdout = process.stdout,
|
|
127
|
+
stderr = process.stderr,
|
|
128
|
+
exec = execCommand,
|
|
129
|
+
confirmUpdate = defaultConfirmUpdate,
|
|
130
|
+
}) {
|
|
131
|
+
if (shouldSkipUpdateCheck({ env, stdin, stdout })) {
|
|
132
|
+
return {
|
|
133
|
+
checked: false,
|
|
134
|
+
updated: false,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
try {
|
|
139
|
+
const latestVersion = await getLatestPublishedVersion({ packageName, env, exec });
|
|
140
|
+
if (!latestVersion || compareVersions(latestVersion, currentVersion) <= 0) {
|
|
141
|
+
return {
|
|
142
|
+
checked: true,
|
|
143
|
+
updated: false,
|
|
144
|
+
latestVersion,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const approved = await confirmUpdate({
|
|
149
|
+
stdin,
|
|
150
|
+
stdout,
|
|
151
|
+
currentVersion,
|
|
152
|
+
latestVersion,
|
|
153
|
+
packageName,
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
if (!approved) {
|
|
157
|
+
stdout.write(`Continuing with ${packageName} ${currentVersion}.\n`);
|
|
158
|
+
return {
|
|
159
|
+
checked: true,
|
|
160
|
+
updated: false,
|
|
161
|
+
latestVersion,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
stdout.write(`Updating ${packageName} to ${latestVersion}...\n`);
|
|
166
|
+
await exec('npm', ['install', '-g', `${packageName}@latest`], { env, stdout, stderr });
|
|
167
|
+
stdout.write(`Update complete. Continuing with ${packageName} ${latestVersion}.\n`);
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
checked: true,
|
|
171
|
+
updated: true,
|
|
172
|
+
latestVersion,
|
|
173
|
+
};
|
|
174
|
+
} catch (error) {
|
|
175
|
+
stderr.write(`Warning: unable to check or install package updates: ${error.message}\n`);
|
|
176
|
+
return {
|
|
177
|
+
checked: false,
|
|
178
|
+
updated: false,
|
|
179
|
+
error,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
module.exports = {
|
|
185
|
+
checkForPackageUpdate,
|
|
186
|
+
compareVersions,
|
|
187
|
+
defaultConfirmUpdate,
|
|
188
|
+
execCommand,
|
|
189
|
+
getLatestPublishedVersion,
|
|
190
|
+
normalizeVersion,
|
|
191
|
+
parseVersion,
|
|
192
|
+
shouldSkipUpdateCheck,
|
|
193
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: maintain-project-constraints
|
|
3
|
-
description: Automatically create and maintain AGENTS.md so it stays aligned with the current repository architecture, core business flow, project purpose, and coding conventions. Use when AGENTS.md is missing or may be outdated after code changes.
|
|
3
|
+
description: Automatically create and maintain AGENTS.md so it stays aligned with the current repository architecture, core business flow, common commands, project purpose, and coding conventions. Use when AGENTS.md is missing or may be outdated after code changes.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Maintain Project Constraints
|
|
@@ -17,7 +17,7 @@ description: Automatically create and maintain AGENTS.md so it stays aligned wit
|
|
|
17
17
|
- Evidence: Infer repository architecture, business flow, and conventions from current code and docs rather than assumptions.
|
|
18
18
|
- Execution: Create or align `AGENTS.md` only after building a concrete inventory of implemented capabilities.
|
|
19
19
|
- Quality: Keep every statement traceable, remove stale guidance, and ensure `Core business flow` stays exhaustive and concrete.
|
|
20
|
-
- Output: Maintain a concise root-level `AGENTS.md` with the required sections
|
|
20
|
+
- Output: Maintain a concise root-level `AGENTS.md` with the required sections, repository-specific wording, and a factual `Common Commands` section when the repository exposes stable command entry points.
|
|
21
21
|
|
|
22
22
|
## Goal
|
|
23
23
|
|
|
@@ -38,9 +38,18 @@ After completing any code modification task, proactively run this skill to verif
|
|
|
38
38
|
|
|
39
39
|
- Project architecture
|
|
40
40
|
- Core business flow
|
|
41
|
+
- Common commands
|
|
41
42
|
- Core project purpose
|
|
42
43
|
- Code style and coding conventions
|
|
43
44
|
|
|
45
|
+
For the `Common Commands` section, always use this format:
|
|
46
|
+
|
|
47
|
+
1. Include only commands that are real, current, and useful in this repository.
|
|
48
|
+
2. Prefer repository-owned entry points such as package scripts, CLIs, `bin/` programs, `scripts/`, `Makefile`, `justfile`, or other documented task runners.
|
|
49
|
+
3. For each command, explain when to use it in one short phrase instead of listing bare commands with no context.
|
|
50
|
+
4. Prioritize commands that help an agent inspect, validate, build, test, or operate repository-specific workflows.
|
|
51
|
+
5. Do not invent commands, aliases, flags, or task names that are not traceable to the repository.
|
|
52
|
+
|
|
44
53
|
For the `Core business flow` section, always use this format:
|
|
45
54
|
|
|
46
55
|
1. One short sentence that summarizes what the repository currently enables.
|
|
@@ -51,6 +60,13 @@ Example:
|
|
|
51
60
|
|
|
52
61
|
```markdown
|
|
53
62
|
|
|
63
|
+
## Common Commands
|
|
64
|
+
|
|
65
|
+
- `npm test` — run the repository's automated test suite.
|
|
66
|
+
- `python3 scripts/validate_skill_frontmatter.py` — validate every top-level `SKILL.md` frontmatter block.
|
|
67
|
+
- `python3 scripts/validate_openai_agent_config.py` — validate every `agents/openai.yaml` interface config.
|
|
68
|
+
- `./scripts/install_skills.sh codex` — install the current toolkit into the local Codex skills directory.
|
|
69
|
+
|
|
54
70
|
## Core Business Flow
|
|
55
71
|
|
|
56
72
|
This project enables users to manage and run reusable automation workflows.
|
|
@@ -69,11 +85,13 @@ This project enables users to manage and run reusable automation workflows.
|
|
|
69
85
|
- Read the repository before writing:
|
|
70
86
|
- root docs (`README`, contribution docs, design docs)
|
|
71
87
|
- key source directories and entry points
|
|
88
|
+
- repository command surfaces such as `package.json`, `bin/`, `scripts/`, `Makefile`, `justfile`, or equivalent task runners
|
|
72
89
|
- user-facing features such as commands, routes, workflows, tasks, or installable modules
|
|
73
90
|
- representative modules that show coding patterns
|
|
74
91
|
- test directories and tooling/config files
|
|
75
92
|
- Infer architecture and conventions from real code, not assumptions.
|
|
76
93
|
- Build a concrete inventory of all currently implemented capabilities before drafting `Core business flow`.
|
|
94
|
+
- Build a separate inventory of stable, repository-specific commands before drafting `Common Commands`.
|
|
77
95
|
|
|
78
96
|
### 2) Create AGENTS.md when missing
|
|
79
97
|
|
|
@@ -81,7 +99,9 @@ When `AGENTS.md` is absent:
|
|
|
81
99
|
|
|
82
100
|
- Create a new root-level `AGENTS.md`.
|
|
83
101
|
- Document architecture, business flow, purpose, and coding conventions from observed facts.
|
|
102
|
+
- Document the repository's common commands from observed command entry points and docs.
|
|
84
103
|
- Write `Core business flow` as one summary sentence followed by unordered bullets that cover every current capability found in the repository.
|
|
104
|
+
- Write `Common commands` as short bullets in the style of ``- `command` — when to use it.``.
|
|
85
105
|
- Keep language specific to this repository; avoid generic boilerplate.
|
|
86
106
|
|
|
87
107
|
### 3) Align AGENTS.md when drift is detected
|
|
@@ -91,12 +111,15 @@ When `AGENTS.md` exists but is outdated:
|
|
|
91
111
|
- Re-read changed or high-impact modules.
|
|
92
112
|
- Update only sections that no longer match reality.
|
|
93
113
|
- Expand or trim the `Core business flow` bullet list so it still covers all currently implemented capabilities.
|
|
114
|
+
- Expand, trim, or replace the `Common Commands` list whenever command entry points or recommended workflows have changed.
|
|
94
115
|
- Preserve correct existing content and structure where possible.
|
|
95
116
|
|
|
96
117
|
### 4) Quality checks before finishing
|
|
97
118
|
|
|
98
119
|
- Ensure every statement in `AGENTS.md` is traceable to current repository files.
|
|
99
120
|
- Remove stale paths, renamed components, and obsolete workflows.
|
|
121
|
+
- Remove stale commands, flags, or task names that no longer exist.
|
|
122
|
+
- Verify every command in `Common Commands` is either documented in repository docs or directly supported by the current codebase.
|
|
100
123
|
- Verify the `Core business flow` section includes a one-sentence summary plus unordered bullets for all currently existing capabilities; do not leave major functions unlisted.
|
|
101
124
|
- Keep instructions concise, concrete, and operational for future agents.
|
|
102
125
|
|
|
@@ -106,4 +129,5 @@ When `AGENTS.md` exists but is outdated:
|
|
|
106
129
|
- Prefer repository terms already used in code/docs.
|
|
107
130
|
- Do not include speculative architecture claims.
|
|
108
131
|
- In `Core business flow`, prefer many short bullets over a few vague bullets; when the product grows, add more bullets so the list remains exhaustive.
|
|
132
|
+
- In `Common Commands`, prefer the smallest useful set of high-signal commands over an exhaustive dump of every helper script.
|
|
109
133
|
- Keep the document focused on how agents should understand and operate in this project.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Maintain Project Constraints"
|
|
3
|
-
short_description: "Automatically create and maintain AGENTS.md so it stays aligned with the current repository architecture, core business flow, project purpose, and coding conventions. Use when AGENTS.md is missing or may be outdated after code changes."
|
|
4
|
-
default_prompt: "Use $maintain-project-constraints to automatically create and maintain AGENTS.md so it stays aligned with the current repository architecture, core business flow, project purpose, and coding conventions. Use when AGENTS.md is missing or may be outdated after code changes."
|
|
3
|
+
short_description: "Automatically create and maintain AGENTS.md so it stays aligned with the current repository architecture, core business flow, common commands, project purpose, and coding conventions. Use when AGENTS.md is missing or may be outdated after code changes."
|
|
4
|
+
default_prompt: "Use $maintain-project-constraints to automatically create and maintain AGENTS.md so it stays aligned with the current repository architecture, core business flow, common commands, project purpose, and coding conventions. Use when AGENTS.md is missing or may be outdated after code changes."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@laitszkin/apollo-toolkit",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.6",
|
|
4
4
|
"description": "Apollo Toolkit npm installer for managed skill copying across Codex, OpenClaw, and Trae.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "LaiTszKin",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
},
|
|
15
15
|
"type": "commonjs",
|
|
16
16
|
"bin": {
|
|
17
|
-
"apollo-toolkit": "bin/apollo-toolkit.js"
|
|
17
|
+
"apollo-toolkit": "bin/apollo-toolkit.js",
|
|
18
|
+
"apltk": "bin/apollo-toolkit.js"
|
|
18
19
|
},
|
|
19
20
|
"scripts": {
|
|
20
21
|
"test": "node --test"
|
|
@@ -14,8 +14,8 @@ description: Investigate production or local simulation runs for runtime-toolcha
|
|
|
14
14
|
|
|
15
15
|
## Standards
|
|
16
16
|
|
|
17
|
-
- Evidence: Base conclusions on the actual preset, runtime command, logs, SQLite event store, local stub responses,
|
|
18
|
-
- Execution: Reproduce with the exact scenario first, verify the bounded-run contract against the actual script/env implementation before launch, separate product logic failures from simulation-toolchain failures, make the smallest realistic toolchain fix, and rerun the same bounded scenario to validate.
|
|
17
|
+
- Evidence: Base conclusions on the actual preset, runtime command, logs, SQLite event store, local stub responses, the code paths that generated them, and official protocol or validator documentation whenever feasibility or instruction legality is in question.
|
|
18
|
+
- Execution: Reproduce with the exact scenario first, verify the bounded-run contract against the actual script/env implementation before launch, separate product logic failures from simulation-toolchain failures, verify protocol-sensitive claims against official docs or upstream source before changing code or specs, make the smallest realistic toolchain fix, and rerun the same bounded scenario to validate.
|
|
19
19
|
- Quality: Prefer harness or stub fixes that improve realism over one-off scenario hacks, avoid duplicating existing workflow skills, and record reusable presets when a scenario becomes part of the regular test suite.
|
|
20
20
|
- Output: Return the scenario contract, observed outcomes, root-cause chain, fixes applied, validation evidence, and any remaining realism gaps.
|
|
21
21
|
|
|
@@ -69,6 +69,7 @@ Use this skill to debug simulation workflows where the repository exposes a prod
|
|
|
69
69
|
### 4) Separate product failures from toolchain realism failures
|
|
70
70
|
|
|
71
71
|
- When the suspected blocker touches protocol rules, instruction legality, quote semantics, or liquidation invariants, verify the claim against the relevant official docs or upstream source before assigning blame.
|
|
72
|
+
- When the current spec or planned fix assumes a local-simulation capability, verify that the capability is actually supported by the validator and program ownership model before implementing it.
|
|
72
73
|
- For every major blocker, explicitly classify the result as one of:
|
|
73
74
|
- production bot problem
|
|
74
75
|
- simulation environment problem
|
|
@@ -87,6 +88,17 @@ Use this skill to debug simulation workflows where the repository exposes a prod
|
|
|
87
88
|
- If a local stub inflates or distorts profitability, preserve the runtime behavior and calibrate the stub.
|
|
88
89
|
- If a scenario intentionally stresses one dimension, make sure the harness is not accidentally stressing unrelated dimensions.
|
|
89
90
|
|
|
91
|
+
### 4.3) Collapse infeasible simulation designs quickly
|
|
92
|
+
|
|
93
|
+
- If official docs or upstream source prove that the proposed local-simulation design is impossible under the current architecture, stop trying to force the implementation through.
|
|
94
|
+
- Treat this as a first-class debugging outcome, not as an implementation blocker to hand-wave away.
|
|
95
|
+
- Name the precise external constraint, such as:
|
|
96
|
+
- validator preload behavior only applying at genesis/startup
|
|
97
|
+
- account data mutability being restricted to the owner program
|
|
98
|
+
- protocol instruction allowlists rejecting the proposed transaction shape
|
|
99
|
+
- When a live spec or plan still claims that infeasible design as in scope, update the spec artifacts immediately so they only describe the remaining feasible scope.
|
|
100
|
+
- Prefer narrowing the scenario to the strongest still-valid readiness or realism checks rather than leaving impossible tasks marked as pending.
|
|
101
|
+
|
|
90
102
|
### 4.1) Map the observed failure to the real pipeline stage
|
|
91
103
|
|
|
92
104
|
- Do not treat every `liquidation_event` row as evidence that the run reached verification or execution.
|
|
@@ -168,6 +180,7 @@ Use this skill to debug simulation workflows where the repository exposes a prod
|
|
|
168
180
|
- Explain the failing stage in the liquidation pipeline and whether the key counts represent positions, attempts, quotes, or executed outcomes.
|
|
169
181
|
- Summarize the narrow fix and the regression test or rerun evidence.
|
|
170
182
|
- If the final scenario should be reused, state where the preset or docs were added.
|
|
183
|
+
- If official docs disproved part of the planned simulation design, state which spec or plan artifacts were narrowed and why.
|
|
171
184
|
|
|
172
185
|
## Example invocation
|
|
173
186
|
|