sneakoscope 0.7.25 → 0.7.26
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/README.md +52 -0
- package/package.json +3 -1
- package/src/cli/main.mjs +16 -3
- package/src/cli/openclaw-command.mjs +83 -0
- package/src/core/fsx.mjs +1 -1
- package/src/core/openclaw.mjs +161 -0
- package/src/core/routes.mjs +2 -1
package/README.md
CHANGED
|
@@ -45,6 +45,7 @@ sks selftest --mock
|
|
|
45
45
|
| --- | --- |
|
|
46
46
|
| CLI runtime | `sks tmux open` and `sks --mad` explicitly launch Codex CLI with tmux; bare `sks` only prints help/readiness surfaces. |
|
|
47
47
|
| Codex App commands | Installs generated skills so `$Team`, `$From-Chat-IMG`, `$DFix`, `$QA-LOOP`, `$PPT`, `$Goal`, `$DB`, `$Wiki`, `$Help`, and related routes are visible in prompt workflows. |
|
|
48
|
+
| OpenClaw agents | Generates an OpenClaw skill package so OpenClaw agents can attach `sneakoscope-codex`, enable the `shell` tool, and discover/use SKS commands from the target repo root. |
|
|
48
49
|
| Pipeline plans | Writes `pipeline-plan.json` for stateful routes so the runtime lane, kept stages, skipped stages, verification commands, and no-unrequested-fallback invariant are visible with `sks pipeline plan`. |
|
|
49
50
|
| Team orchestration | Runs substantial work through score-based ambiguity handling, scouts, TriWiki refresh, debate, runtime task graphs, worker inboxes, implementation, review, cleanup, reflection, and Honest Mode; narrow work should use Proof Field evidence to skip unrelated pipeline work instead of expanding Team. |
|
|
50
51
|
| Skill dreaming | Records cheap generated-skill usage counters in JSON and only periodically scans `.agents/skills` for keep, merge, prune, and improvement candidates. Reports are recommendation-only and never delete skills automatically. |
|
|
@@ -301,6 +302,57 @@ Use `sks dollar-commands` to confirm that terminal discovery and Codex App promp
|
|
|
301
302
|
|
|
302
303
|
TriWiki is intentionally sparse: `sks wiki sweep` records demote, soft-forget, archive, delete, promote-to-skill, and promote-to-rule candidates instead of injecting every old claim into future prompts. `sks harness fixture` validates the broader Harness Growth Factory contract: deliberate forgetting fixtures, skill card metadata, experiment schema, tool-error taxonomy, permission profiles, MultiAgentV2 defaults, and tmux cockpit view coverage. `sks code-structure scan` flags handwritten files above 1000/2000/3000-line thresholds so new logic can be extracted before command files become harder to maintain.
|
|
303
304
|
|
|
305
|
+
## OpenClaw Agent Usage
|
|
306
|
+
|
|
307
|
+
Sneakoscope can generate an OpenClaw skill package for agents that need to operate SKS-enabled repositories.
|
|
308
|
+
|
|
309
|
+
```sh
|
|
310
|
+
sks openclaw install
|
|
311
|
+
sks openclaw path
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
By default this writes:
|
|
315
|
+
|
|
316
|
+
```text
|
|
317
|
+
~/.openclaw/skills/sneakoscope-codex/
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
The generated skill contains `manifest.yaml`, `SKILL.md`, a skill README, and `openclaw-agent-config.example.yaml`. If you use a custom OpenClaw home, set `OPENCLAW_HOME` or pass `--dir`:
|
|
321
|
+
|
|
322
|
+
```sh
|
|
323
|
+
OPENCLAW_HOME=/opt/openclaw sks openclaw install
|
|
324
|
+
sks openclaw install --dir /opt/openclaw/skills/sneakoscope-codex
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
Attach the skill to an OpenClaw agent with the built-in `shell` tool enabled:
|
|
328
|
+
|
|
329
|
+
```yaml
|
|
330
|
+
agents:
|
|
331
|
+
coding-agent:
|
|
332
|
+
tools:
|
|
333
|
+
- shell
|
|
334
|
+
skills:
|
|
335
|
+
- sneakoscope-codex
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
Then prompt the OpenClaw agent from the target repo root:
|
|
339
|
+
|
|
340
|
+
```text
|
|
341
|
+
Run sks root, inspect AGENTS.md, then use the SKS Team route to implement this fix and verify it.
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Useful commands for OpenClaw agents:
|
|
345
|
+
|
|
346
|
+
```sh
|
|
347
|
+
sks root
|
|
348
|
+
sks commands
|
|
349
|
+
sks dollar-commands
|
|
350
|
+
sks deps check
|
|
351
|
+
sks proof-field scan --intent "small CLI change" --changed src/cli/main.mjs
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
If OpenClaw runs the skill inside a sandbox, grant shell execution only for the trusted local workspace. Database, Supabase, migration, and destructive filesystem work should still follow the repo's SKS safety route and require explicit write scope.
|
|
355
|
+
|
|
304
356
|
## Prompt `$` Commands
|
|
305
357
|
|
|
306
358
|
Use these inside Codex App or another agent prompt. They are prompt commands, not terminal commands.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sneakoscope",
|
|
3
3
|
"displayName": "ㅅㅋㅅ",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.26",
|
|
5
5
|
"description": "Sneakoscope Codex: database-safe Codex CLI/App harness with Team, Goal, AutoResearch, TriWiki, and Honest Mode.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"homepage": "https://github.com/mandarange/Sneakoscope-Codex#readme",
|
|
@@ -48,6 +48,8 @@
|
|
|
48
48
|
"sks",
|
|
49
49
|
"openai",
|
|
50
50
|
"openai-codex",
|
|
51
|
+
"openclaw",
|
|
52
|
+
"openclaw-skill",
|
|
51
53
|
"cli",
|
|
52
54
|
"developer-tools",
|
|
53
55
|
"ai-coding",
|
package/src/cli/main.mjs
CHANGED
|
@@ -56,11 +56,13 @@ import { buildPromptContext } from '../core/prompt-context-builder.mjs';
|
|
|
56
56
|
import { renderTeamDashboardState, writeTeamDashboardState } from '../core/team-dashboard-renderer.mjs';
|
|
57
57
|
import { GOAL_WORKFLOW_ARTIFACT } from '../core/goal-workflow.mjs';
|
|
58
58
|
import { CODEX_APP_DOCS_URL, codexAppIntegrationStatus, formatCodexAppStatus } from '../core/codex-app.mjs';
|
|
59
|
+
import { OPENCLAW_SKILL_NAME, installOpenClawSkill } from '../core/openclaw.mjs';
|
|
59
60
|
import { buildTmuxLaunchPlan, buildTmuxOpenArgs, createTmuxSession, isTmuxShellSession, runTmuxLaunchPlanSyntaxCheck, tmuxReadiness, tmuxStatusKind, defaultTmuxSessionName, formatTmuxBanner, launchTmuxTeamView, launchTmuxUi, platformTmuxInstallHint, runTmuxStatus, sanitizeTmuxSessionName, teamLaneStyle } from '../core/tmux-ui.mjs';
|
|
60
61
|
import { autoReviewProfileName, autoReviewStatus, autoReviewSummary, enableAutoReview, disableAutoReview, enableMadHighProfile, madHighProfileName } from '../core/auto-review.mjs';
|
|
61
62
|
import { context7Command } from './context7-command.mjs';
|
|
62
63
|
import { askPostinstallQuestion, checkContext7, checkRequiredSkills, ensureCodexCliTool, ensureGlobalCodexSkillsDuringInstall, ensureProjectContext7Config, ensureRelatedCliTools, ensureSksCommandDuringInstall, globalCodexSkillsRoot, postinstall, postinstallBootstrapDecision } from './install-helpers.mjs';
|
|
63
64
|
import { buildTeamPlan, codeStructureCommand, dbCommand, defaultBeta, defaultVGraph, evalCommand, gcCommand, goalCommand, gxCommand, harnessCommand, hproofCommand, memoryCommand, migrateWikiContextPack, parseTeamCreateArgs, perfCommand, profileCommand, projectWikiClaims, proofFieldCommand, qaLoopCommand, quickstartCommand, researchCommand, skillDreamCommand, statsCommand, team, teamWorkflowMarkdown, validateArtifactsCommand, wikiCommand, wikiVoxelRowCount, writeWikiContextPack } from './maintenance-commands.mjs';
|
|
65
|
+
import { openClawCommand } from './openclaw-command.mjs';
|
|
64
66
|
|
|
65
67
|
const flag = (args, name) => args.includes(name);
|
|
66
68
|
const promptOf = (args) => args.filter((x) => !String(x).startsWith('--')).join(' ').trim();
|
|
@@ -88,7 +90,7 @@ export async function main(args) {
|
|
|
88
90
|
if (cmd === 'dollar-commands' || cmd === 'dollars' || cmd === '$') return dollarCommands(tail);
|
|
89
91
|
if (String(cmd).toLowerCase() === 'dfix') return dfixHelp();
|
|
90
92
|
const handlers = {
|
|
91
|
-
postinstall: () => postinstall({ bootstrap }), wizard: () => wizard(tail), ui: () => wizard(tail), 'update-check': () => updateCheck(tail), help: () => help(tail), commands: () => commands(tail), usage: () => usage(tail), root: () => rootCommand(tail), quickstart: () => quickstartCommand(), 'codex-app': () => codexAppHelp(tail), bootstrap: () => bootstrap(tail), deps: () => deps(sub, rest),
|
|
93
|
+
postinstall: () => postinstall({ bootstrap }), wizard: () => wizard(tail), ui: () => wizard(tail), 'update-check': () => updateCheck(tail), help: () => help(tail), commands: () => commands(tail), usage: () => usage(tail), root: () => rootCommand(tail), quickstart: () => quickstartCommand(), 'codex-app': () => codexAppHelp(tail), openclaw: () => openClawCommand(tail), bootstrap: () => bootstrap(tail), deps: () => deps(sub, rest),
|
|
92
94
|
'qa-loop': () => qaLoopCommand(sub, rest), ppt: () => pptCommand(sub, rest), context7: () => context7Command(sub, rest), pipeline: () => pipeline(sub, rest), guard: () => guard(sub, rest), conflicts: () => conflicts(sub, rest), versioning: () => versioning(sub, rest), reasoning: () => reasoningCommand(tail), aliases: () => aliases(), setup: () => setup(tail), 'fix-path': () => fixPath(tail), doctor: () => doctor(tail), init: () => init(tail), selftest: () => selftest(tail),
|
|
93
95
|
goal: () => goalCommand(sub, rest), research: () => researchCommand(sub, rest), hook: () => emitHook(sub), profile: () => profileCommand(sub, rest), hproof: () => hproofCommand(sub, rest), 'validate-artifacts': () => validateArtifactsCommand(tail), perf: () => perfCommand(sub, rest), 'proof-field': () => proofFieldCommand(sub, rest), 'skill-dream': () => skillDreamCommand(sub, rest), 'code-structure': () => codeStructureCommand(sub, rest), memory: () => memoryCommand(sub, rest), gx: () => gxCommand(sub, rest),
|
|
94
96
|
team: () => team(tail), db: () => dbCommand(sub, rest), eval: () => evalCommand(sub, rest), harness: () => harnessCommand(sub, rest), wiki: () => wikiCommand(sub, rest), gc: () => gcCommand(tail), stats: () => statsCommand(tail)
|
|
@@ -116,6 +118,7 @@ Usage:
|
|
|
116
118
|
sks bootstrap [--install-scope global|project] [--local-only] [--json]
|
|
117
119
|
sks deps check|install [tmux|codex|context7|all] [--yes] [--json]
|
|
118
120
|
sks codex-app
|
|
121
|
+
sks openclaw install|path|print [--dir path] [--force] [--json]
|
|
119
122
|
sks --mad [--high]
|
|
120
123
|
sks auto-review status|enable|start [--high]
|
|
121
124
|
sks --Auto-review [--high]
|
|
@@ -1192,6 +1195,7 @@ function usage(args = []) {
|
|
|
1192
1195
|
root: ['Root', '', ' sks root [--json]', '', 'Inside a project, SKS uses that project root. Outside any project marker, runtime commands use the per-user global SKS root instead of writing .sneakoscope into the current random folder.'],
|
|
1193
1196
|
deps: ['Dependencies', '', ' sks deps check [--json]', ' sks deps install [tmux|codex|context7|all] [--yes]', '', 'tmux on macOS uses Homebrew only after approval.'],
|
|
1194
1197
|
tmux: ['tmux', '', ' sks tmux open', ' sks tmux check', ' sks tmux status --once', ' sks deps install tmux', '', 'tmux launch is explicit. Running bare `sks` prints help and never opens tmux by itself.'],
|
|
1198
|
+
openclaw: ['OpenClaw', '', ' sks openclaw install', ' sks openclaw path', ' sks openclaw print SKILL.md', '', 'Installs an OpenClaw skill package under ~/.openclaw/skills/sneakoscope-codex so OpenClaw agents can attach skills: [sneakoscope-codex] with the shell tool and call local SKS commands from a project root.'],
|
|
1195
1199
|
team: ['Team', '', ' sks team "task" executor:5 reviewer:2 user:1', ' sks team watch latest', ' sks team lane latest --agent analysis_scout_1 --follow', ' sks team message latest --from analysis_scout_1 --to executor_1 --message "handoff note"', ' sks team cleanup-tmux latest', '', '$Team runs questions -> contract -> scouts -> TriWiki attention -> debate -> runtime graph/inbox -> fresh executors -> review -> cleanup -> reflection -> Honest.'],
|
|
1196
1200
|
'qa-loop': ['QA-LOOP', '', ' sks qa-loop prepare "QA this app"', ' sks qa-loop answer <MISSION_ID> answers.json', ' sks qa-loop run <MISSION_ID> --max-cycles 8', '', 'Report: YYYY-MM-DD-v<version>-qa-report.md'],
|
|
1197
1201
|
ppt: ['PPT', '', ' $PPT 투자자용 피치덱을 HTML 기반 PDF로 만들어줘', ' $PPT 우리 SaaS 소개자료 만들어줘', ' sks ppt build latest --json', ' sks ppt status latest --json', '', '$PPT asks delivery context, audience profile, STP strategy, decision context, and 3+ pain-point/solution/aha mappings before source research, design-system work, HTML/PDF export, and render QA. Independent strategy/render/file-write phases run in parallel where inputs allow and are recorded in ppt-parallel-report.json. The visual system must stay simple, restrained, and information-first; editable source HTML is kept under source-html/, PPT-only temporary build files are cleaned, and installed skills/MCPs outside the $PPT allowlist are ignored. Design uses getdesign-reference plus the built-in PPT design pipeline; imagegen and Context7 are conditional only when the sealed PPT contract needs raster assets or current external docs.'],
|
|
@@ -1653,7 +1657,7 @@ function readMaxCycles(args, fallback) {
|
|
|
1653
1657
|
|
|
1654
1658
|
function positionalArgs(args = []) {
|
|
1655
1659
|
const out = [];
|
|
1656
|
-
const valueFlags = new Set(['--format', '--iterations', '--out', '--baseline', '--candidate', '--install-scope', '--max-cycles', '--depth', '--scope', '--transport', '--query', '--topic', '--tokens', '--timeout-ms', '--sql', '--command', '--project-ref', '--agent', '--phase', '--message', '--role', '--max-anchors', '--lines']);
|
|
1660
|
+
const valueFlags = new Set(['--format', '--iterations', '--out', '--baseline', '--candidate', '--install-scope', '--max-cycles', '--depth', '--scope', '--transport', '--query', '--topic', '--tokens', '--timeout-ms', '--sql', '--command', '--project-ref', '--agent', '--phase', '--message', '--role', '--max-anchors', '--lines', '--dir']);
|
|
1657
1661
|
for (let i = 0; i < args.length; i++) {
|
|
1658
1662
|
const arg = String(args[i]);
|
|
1659
1663
|
if (valueFlags.has(arg)) {
|
|
@@ -2062,7 +2066,16 @@ async function selftest() {
|
|
|
2062
2066
|
if (!DOLLAR_DEFAULT_PIPELINE_TEXT.includes('$Team')) throw new Error('selftest failed: dollar-commands missing Team default routing guidance');
|
|
2063
2067
|
if (!DOLLAR_DEFAULT_PIPELINE_TEXT.includes('$From-Chat-IMG')) throw new Error('selftest failed: dollar-commands missing From-Chat-IMG guidance');
|
|
2064
2068
|
if (!DOLLAR_DEFAULT_PIPELINE_TEXT.includes('$MAD-SKS')) throw new Error('selftest failed: dollar-commands missing MAD-SKS scoped override guidance');
|
|
2065
|
-
if (!COMMAND_CATALOG.some((c) => c.name === 'context7') || !COMMAND_CATALOG.some((c) => c.name === 'pipeline') || !COMMAND_CATALOG.some((c) => c.name === 'qa-loop') || !COMMAND_CATALOG.some((c) => c.name === 'root')) throw new Error('selftest failed: context7/pipeline/qa-loop/root commands missing from catalog');
|
|
2069
|
+
if (!COMMAND_CATALOG.some((c) => c.name === 'context7') || !COMMAND_CATALOG.some((c) => c.name === 'pipeline') || !COMMAND_CATALOG.some((c) => c.name === 'qa-loop') || !COMMAND_CATALOG.some((c) => c.name === 'root') || !COMMAND_CATALOG.some((c) => c.name === 'openclaw')) throw new Error('selftest failed: context7/pipeline/qa-loop/root/openclaw commands missing from catalog');
|
|
2070
|
+
const openClawTmp = tmpdir();
|
|
2071
|
+
const openClawResult = await installOpenClawSkill({ targetDir: path.join(openClawTmp, 'skills', OPENCLAW_SKILL_NAME) });
|
|
2072
|
+
if (!openClawResult.ok) throw new Error(`selftest failed: OpenClaw skill install blocked: ${openClawResult.reason}`);
|
|
2073
|
+
const openClawSkillText = await safeReadText(path.join(openClawResult.target_dir, 'SKILL.md'));
|
|
2074
|
+
const openClawManifestText = await safeReadText(path.join(openClawResult.target_dir, 'manifest.yaml'));
|
|
2075
|
+
const openClawConfigText = await safeReadText(path.join(openClawResult.target_dir, 'openclaw-agent-config.example.yaml'));
|
|
2076
|
+
if (!openClawSkillText.includes('sks root') || !openClawSkillText.includes('$Team') || !openClawSkillText.includes('OpenClaw agent must have the built-in `shell` tool enabled')) throw new Error('selftest failed: OpenClaw skill missing SKS agent guidance');
|
|
2077
|
+
if (!openClawManifestText.includes('generated_by: sneakoscope') || !openClawManifestText.includes(`version: ${PACKAGE_VERSION}`)) throw new Error('selftest failed: OpenClaw manifest missing generated marker or version');
|
|
2078
|
+
if (!openClawConfigText.includes(`- ${OPENCLAW_SKILL_NAME}`) || !openClawConfigText.includes('- shell')) throw new Error('selftest failed: OpenClaw agent config example missing skill or shell tool');
|
|
2066
2079
|
const registryDollarCommands = DOLLAR_COMMANDS.map((c) => c.command);
|
|
2067
2080
|
const manifest = await readJson(path.join(tmp, '.sneakoscope', 'manifest.json'));
|
|
2068
2081
|
const policy = await readJson(path.join(tmp, '.sneakoscope', 'policy.json'));
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { OPENCLAW_SKILL_NAME, buildOpenClawSkillFiles, defaultOpenClawSkillDir, installOpenClawSkill } from '../core/openclaw.mjs';
|
|
3
|
+
|
|
4
|
+
const flag = (args, name) => args.includes(name);
|
|
5
|
+
|
|
6
|
+
function readFlagValue(args, name, fallback) {
|
|
7
|
+
const i = args.indexOf(name);
|
|
8
|
+
return i >= 0 && args[i + 1] ? args[i + 1] : fallback;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function positionalArgs(args = []) {
|
|
12
|
+
const out = [];
|
|
13
|
+
const valueFlags = new Set(['--dir']);
|
|
14
|
+
for (let i = 0; i < args.length; i++) {
|
|
15
|
+
const arg = String(args[i]);
|
|
16
|
+
if (valueFlags.has(arg)) {
|
|
17
|
+
i++;
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
if (!arg.startsWith('--')) out.push(arg);
|
|
21
|
+
}
|
|
22
|
+
return out;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export async function openClawCommand(args = []) {
|
|
26
|
+
const action = args[0] || 'help';
|
|
27
|
+
const targetDir = readFlagValue(args, '--dir', defaultOpenClawSkillDir());
|
|
28
|
+
const resultOptions = {
|
|
29
|
+
targetDir,
|
|
30
|
+
force: flag(args, '--force'),
|
|
31
|
+
dryRun: flag(args, '--dry-run')
|
|
32
|
+
};
|
|
33
|
+
if (action === 'path') {
|
|
34
|
+
const result = { skill: OPENCLAW_SKILL_NAME, target_dir: path.resolve(targetDir) };
|
|
35
|
+
if (flag(args, '--json')) return console.log(JSON.stringify(result, null, 2));
|
|
36
|
+
console.log(result.target_dir);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (action === 'print') {
|
|
40
|
+
const file = positionalArgs(args.slice(1))[0] || 'SKILL.md';
|
|
41
|
+
const files = buildOpenClawSkillFiles();
|
|
42
|
+
if (!files[file]) {
|
|
43
|
+
console.error(`Unknown OpenClaw skill file: ${file}`);
|
|
44
|
+
console.error(`Files: ${Object.keys(files).join(', ')}`);
|
|
45
|
+
process.exitCode = 1;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
console.log(files[file]);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (action === 'install') {
|
|
52
|
+
const result = await installOpenClawSkill(resultOptions);
|
|
53
|
+
if (flag(args, '--json')) return console.log(JSON.stringify(result, null, 2));
|
|
54
|
+
if (!result.ok) {
|
|
55
|
+
console.error(`OpenClaw skill install blocked: ${result.reason}`);
|
|
56
|
+
console.error(`Target: ${result.target_dir}`);
|
|
57
|
+
process.exitCode = 1;
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
console.log(`OpenClaw skill ${result.status}: ${result.target_dir}`);
|
|
61
|
+
console.log(`Attach it to an agent with skills: [${OPENCLAW_SKILL_NAME}] and tools: [shell].`);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
console.log(`OpenClaw
|
|
65
|
+
|
|
66
|
+
Usage:
|
|
67
|
+
sks openclaw install [--dir path] [--force] [--dry-run] [--json]
|
|
68
|
+
sks openclaw path [--dir path] [--json]
|
|
69
|
+
sks openclaw print [SKILL.md|manifest.yaml|README.md|openclaw-agent-config.example.yaml]
|
|
70
|
+
|
|
71
|
+
Default skill: ${OPENCLAW_SKILL_NAME}
|
|
72
|
+
Default path: ${defaultOpenClawSkillDir()}
|
|
73
|
+
|
|
74
|
+
After install, add this to an OpenClaw agent config:
|
|
75
|
+
|
|
76
|
+
agents:
|
|
77
|
+
coding-agent:
|
|
78
|
+
tools:
|
|
79
|
+
- shell
|
|
80
|
+
skills:
|
|
81
|
+
- ${OPENCLAW_SKILL_NAME}
|
|
82
|
+
`);
|
|
83
|
+
}
|
package/src/core/fsx.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import os from 'node:os';
|
|
|
5
5
|
import crypto from 'node:crypto';
|
|
6
6
|
import { spawn } from 'node:child_process';
|
|
7
7
|
|
|
8
|
-
export const PACKAGE_VERSION = '0.7.
|
|
8
|
+
export const PACKAGE_VERSION = '0.7.26';
|
|
9
9
|
export const DEFAULT_PROCESS_TAIL_BYTES = 256 * 1024;
|
|
10
10
|
export const DEFAULT_PROCESS_TIMEOUT_MS = 30 * 60 * 1000;
|
|
11
11
|
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import { exists, readText, writeTextAtomic, PACKAGE_VERSION } from './fsx.mjs';
|
|
4
|
+
|
|
5
|
+
export const OPENCLAW_SKILL_NAME = 'sneakoscope-codex';
|
|
6
|
+
|
|
7
|
+
export function defaultOpenClawHome(env = process.env) {
|
|
8
|
+
return path.resolve(env.OPENCLAW_HOME || path.join(env.HOME || os.homedir(), '.openclaw'));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function defaultOpenClawSkillDir(env = process.env) {
|
|
12
|
+
return path.join(defaultOpenClawHome(env), 'skills', OPENCLAW_SKILL_NAME);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function buildOpenClawSkillFiles(options = {}) {
|
|
16
|
+
const sksCommand = options.sksCommand || 'sks';
|
|
17
|
+
const version = options.version || PACKAGE_VERSION;
|
|
18
|
+
const skillName = options.skillName || OPENCLAW_SKILL_NAME;
|
|
19
|
+
return {
|
|
20
|
+
'manifest.yaml': openClawManifest({ skillName, version }),
|
|
21
|
+
'SKILL.md': openClawSkillMarkdown({ sksCommand, skillName, version }),
|
|
22
|
+
'README.md': openClawSkillReadme({ sksCommand, skillName, version }),
|
|
23
|
+
'openclaw-agent-config.example.yaml': openClawAgentConfigExample({ skillName })
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export async function installOpenClawSkill(options = {}) {
|
|
28
|
+
const targetDir = path.resolve(options.targetDir || defaultOpenClawSkillDir(options.env || process.env));
|
|
29
|
+
const files = buildOpenClawSkillFiles(options);
|
|
30
|
+
const existingManifest = path.join(targetDir, 'manifest.yaml');
|
|
31
|
+
const existing = await exists(existingManifest);
|
|
32
|
+
if (existing && !options.force) {
|
|
33
|
+
const text = await readText(existingManifest, '');
|
|
34
|
+
if (!text.includes('generated_by: sneakoscope')) {
|
|
35
|
+
return {
|
|
36
|
+
ok: false,
|
|
37
|
+
status: 'blocked_existing_skill',
|
|
38
|
+
target_dir: targetDir,
|
|
39
|
+
reason: 'Existing OpenClaw skill is not marked as generated by Sneakoscope. Re-run with --force to overwrite.'
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (options.dryRun) {
|
|
44
|
+
return { ok: true, status: existing ? 'would_update' : 'would_create', target_dir: targetDir, files: Object.keys(files) };
|
|
45
|
+
}
|
|
46
|
+
for (const [name, content] of Object.entries(files)) {
|
|
47
|
+
await writeTextAtomic(path.join(targetDir, name), content);
|
|
48
|
+
}
|
|
49
|
+
return { ok: true, status: existing ? 'updated' : 'created', target_dir: targetDir, files: Object.keys(files) };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function openClawManifest({ skillName, version }) {
|
|
53
|
+
return `name: ${skillName}
|
|
54
|
+
version: ${version}
|
|
55
|
+
description: Expose Sneakoscope Codex (sks) workflows to OpenClaw agents.
|
|
56
|
+
author: mandarange
|
|
57
|
+
license: MIT
|
|
58
|
+
generated_by: sneakoscope
|
|
59
|
+
homepage: https://github.com/mandarange/Sneakoscope-Codex
|
|
60
|
+
entrypoint: SKILL.md
|
|
61
|
+
permissions:
|
|
62
|
+
shell: execute
|
|
63
|
+
filesystem: read_write_project
|
|
64
|
+
tags:
|
|
65
|
+
- codex
|
|
66
|
+
- coding-agent
|
|
67
|
+
- orchestration
|
|
68
|
+
- qa
|
|
69
|
+
- safety
|
|
70
|
+
`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function openClawSkillMarkdown({ sksCommand, skillName, version }) {
|
|
74
|
+
return `---
|
|
75
|
+
name: ${skillName}
|
|
76
|
+
version: ${version}
|
|
77
|
+
description: Use Sneakoscope Codex routes, checks, and release gates from an OpenClaw agent.
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
# Sneakoscope Codex For OpenClaw
|
|
81
|
+
|
|
82
|
+
Use this skill when the user asks an OpenClaw agent to work in a codebase that uses Sneakoscope Codex, SKS, Team, QA-LOOP, TriWiki, Context7, DB safety, Honest Mode, release gates, or \`$...\` prompt routes.
|
|
83
|
+
|
|
84
|
+
## Required Tool Access
|
|
85
|
+
|
|
86
|
+
The OpenClaw agent must have the built-in \`shell\` tool enabled. Prefer running commands in the target repository root.
|
|
87
|
+
|
|
88
|
+
## Core Commands
|
|
89
|
+
|
|
90
|
+
- \`${sksCommand} root\` checks whether SKS is using a project root or the global runtime root.
|
|
91
|
+
- \`${sksCommand} bootstrap\` installs or repairs SKS project files, Codex App skills, hooks, and runtime state.
|
|
92
|
+
- \`${sksCommand} commands\` lists terminal commands the agent can call.
|
|
93
|
+
- \`${sksCommand} dollar-commands\` lists prompt routes such as \`$Team\`, \`$DFix\`, \`$QA-LOOP\`, \`$PPT\`, \`$Goal\`, \`$DB\`, \`$Wiki\`, and \`$Help\`.
|
|
94
|
+
- \`${sksCommand} deps check\` checks Codex, Context7, tmux, and related local readiness.
|
|
95
|
+
- \`${sksCommand} proof-field scan --intent "<task>" --changed file1,file2\` checks whether a narrow change can stay on a lightweight proof path.
|
|
96
|
+
- \`${sksCommand} release:check\` is not a terminal command; use \`npm run release:check\` inside the Sneakoscope package repository.
|
|
97
|
+
|
|
98
|
+
## Agent Operating Rules
|
|
99
|
+
|
|
100
|
+
1. Before substantive work, run \`${sksCommand} root\` and inspect the repository's \`AGENTS.md\` if present.
|
|
101
|
+
2. For implementation, prefer the repository's requested SKS route. General code work normally routes to \`$Team\`; tiny design or copy edits can use \`$DFix\`; UI/browser dogfood uses \`$QA-LOOP\`; database or Supabase work uses \`$DB\`.
|
|
102
|
+
3. Do not invent fallback implementation code when the requested SKS path is blocked. Report the blocker with command output and source paths.
|
|
103
|
+
4. For database, migration, and Supabase tasks, default to read-only inspection unless the user explicitly authorizes a write/migration scope.
|
|
104
|
+
5. Before claiming completion, run the most relevant verification command and summarize what passed, what was not verified, and any remaining blocker.
|
|
105
|
+
|
|
106
|
+
## Example Prompts For An OpenClaw Agent
|
|
107
|
+
|
|
108
|
+
- "In this repo, run \`${sksCommand} root\`, inspect \`AGENTS.md\`, then use the SKS Team route to implement the bug fix and verify it."
|
|
109
|
+
- "Use SKS QA-LOOP against localhost:3000. Do not run destructive tests."
|
|
110
|
+
- "Prepare this project for Codex App use: run \`${sksCommand} bootstrap\`, \`${sksCommand} codex-app check\`, and \`${sksCommand} dollar-commands\`."
|
|
111
|
+
`;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function openClawSkillReadme({ sksCommand, skillName, version }) {
|
|
115
|
+
return `# ${skillName}
|
|
116
|
+
|
|
117
|
+
Version: ${version}
|
|
118
|
+
|
|
119
|
+
This OpenClaw skill lets an OpenClaw agent discover and use Sneakoscope Codex through the local \`${sksCommand}\` command.
|
|
120
|
+
|
|
121
|
+
## Install
|
|
122
|
+
|
|
123
|
+
\`\`\`sh
|
|
124
|
+
${sksCommand} openclaw install
|
|
125
|
+
\`\`\`
|
|
126
|
+
|
|
127
|
+
Then attach the skill to an OpenClaw agent:
|
|
128
|
+
|
|
129
|
+
\`\`\`yaml
|
|
130
|
+
agents:
|
|
131
|
+
coding-agent:
|
|
132
|
+
tools:
|
|
133
|
+
- shell
|
|
134
|
+
skills:
|
|
135
|
+
- ${skillName}
|
|
136
|
+
\`\`\`
|
|
137
|
+
|
|
138
|
+
## Verify
|
|
139
|
+
|
|
140
|
+
\`\`\`sh
|
|
141
|
+
openclaw skill run ${skillName} --help
|
|
142
|
+
${sksCommand} root
|
|
143
|
+
${sksCommand} commands
|
|
144
|
+
\`\`\`
|
|
145
|
+
|
|
146
|
+
If OpenClaw runs skills in a sandbox, allow shell execution for this skill and run it from the target repository root so SKS can find \`.git\`, \`.sneakoscope\`, or \`.dcodex\`.
|
|
147
|
+
`;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function openClawAgentConfigExample({ skillName }) {
|
|
151
|
+
return `agents:
|
|
152
|
+
coding-agent:
|
|
153
|
+
model: openai/gpt-4o
|
|
154
|
+
channels:
|
|
155
|
+
- terminal
|
|
156
|
+
tools:
|
|
157
|
+
- shell
|
|
158
|
+
skills:
|
|
159
|
+
- ${skillName}
|
|
160
|
+
`;
|
|
161
|
+
}
|
package/src/core/routes.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export const FROM_CHAT_IMG_CHECKLIST_ARTIFACT = 'from-chat-img-checklist.md';
|
|
|
7
7
|
export const FROM_CHAT_IMG_TEMP_TRIWIKI_ARTIFACT = 'from-chat-img-temp-triwiki.json';
|
|
8
8
|
export const FROM_CHAT_IMG_QA_LOOP_ARTIFACT = 'from-chat-img-qa-loop.json';
|
|
9
9
|
export const FROM_CHAT_IMG_TEMP_TRIWIKI_SESSIONS = 5;
|
|
10
|
-
export const USAGE_TOPICS = 'install|setup|bootstrap|root|deps|tmux|auto-review|team|qa-loop|ppt|goal|research|db|codex-app|dfix|design|imagegen|dollar|context7|pipeline|reasoning|guard|conflicts|versioning|eval|harness|hproof|gx|wiki|code-structure|proof-field|skill-dream';
|
|
10
|
+
export const USAGE_TOPICS = 'install|setup|bootstrap|root|deps|tmux|auto-review|team|qa-loop|ppt|goal|research|db|codex-app|openclaw|dfix|design|imagegen|dollar|context7|pipeline|reasoning|guard|conflicts|versioning|eval|harness|hproof|gx|wiki|code-structure|proof-field|skill-dream';
|
|
11
11
|
export const CODEX_COMPUTER_USE_EVIDENCE_SOURCE = 'codex_computer_use';
|
|
12
12
|
export const CODEX_APP_IMAGE_GENERATION_DOC_URL = 'https://developers.openai.com/codex/app/features#image-generation';
|
|
13
13
|
export const CODEX_COMPUTER_USE_ONLY_POLICY = 'Pipeline UI/browser verification and visual inspection must use Codex Computer Use only. Do not use Playwright, Chrome MCP, Browser Use, Selenium, Puppeteer, or any other browser automation substitute; if Codex Computer Use is unavailable, mark the UI/browser evidence unverified instead of substituting another tool.';
|
|
@@ -456,6 +456,7 @@ export const COMMAND_CATALOG = [
|
|
|
456
456
|
{ name: 'root', usage: 'sks root [--json]', description: 'Show whether SKS is using a project root or the per-user global SKS runtime root.' },
|
|
457
457
|
{ name: 'deps', usage: 'sks deps check|install [tmux|codex|context7|all] [--yes]', description: 'Check or guided-install Node/npm PATH, Codex CLI/App, Context7, Browser Use, Computer Use, tmux, and Homebrew on macOS.' },
|
|
458
458
|
{ name: 'codex-app', usage: 'sks codex-app [check|open]', description: 'Check Codex App install and first-party MCP/plugin readiness, then show app setup files and examples.' },
|
|
459
|
+
{ name: 'openclaw', usage: 'sks openclaw install|path|print [--dir path] [--force] [--json]', description: 'Generate an OpenClaw skill package so OpenClaw agents can discover and use local SKS workflows.' },
|
|
459
460
|
{ name: 'tmux', usage: 'sks tmux open|check|status [--workspace name]', description: 'Explicitly open the SKS tmux runtime, or check/status without launching tmux.' },
|
|
460
461
|
{ name: 'mad', usage: 'sks --mad [--high]', description: 'Open a one-shot tmux Codex CLI workspace with the SKS MAD full-access auto-review profile.' },
|
|
461
462
|
{ name: 'auto-review', usage: 'sks auto-review status|enable|start [--high] | sks --Auto-review --high', description: 'Enable Codex automatic approval review and launch SKS tmux with the auto-review profile.' },
|