stratagem-x7 0.3.23 → 0.3.24
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/dist/cli.mjs +72 -34
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -156826,13 +156826,17 @@ function getProjectDirsUpToHome(subdir, cwd2) {
|
|
|
156826
156826
|
if (normalizePathForComparison(current) === normalizePathForComparison(home)) {
|
|
156827
156827
|
break;
|
|
156828
156828
|
}
|
|
156829
|
+
const stratagemSubdir = join33(current, ".stratagem", subdir);
|
|
156829
156830
|
const claudeSubdir = join33(current, ".claude", subdir);
|
|
156830
|
-
|
|
156831
|
-
|
|
156832
|
-
|
|
156833
|
-
|
|
156834
|
-
|
|
156835
|
-
|
|
156831
|
+
for (const candidate of [stratagemSubdir, claudeSubdir]) {
|
|
156832
|
+
try {
|
|
156833
|
+
statSync4(candidate);
|
|
156834
|
+
dirs.push(candidate);
|
|
156835
|
+
break;
|
|
156836
|
+
} catch (e) {
|
|
156837
|
+
if (!isFsInaccessible(e))
|
|
156838
|
+
throw e;
|
|
156839
|
+
}
|
|
156836
156840
|
}
|
|
156837
156841
|
if (gitRoot && normalizePathForComparison(current) === normalizePathForComparison(gitRoot)) {
|
|
156838
156842
|
break;
|
|
@@ -156964,12 +156968,22 @@ var init_markdownConfigLoader = __esm(() => {
|
|
|
156964
156968
|
const gitRoot = findGitRoot(cwd2);
|
|
156965
156969
|
const canonicalRoot = findCanonicalGitRoot(cwd2);
|
|
156966
156970
|
if (gitRoot && canonicalRoot && canonicalRoot !== gitRoot) {
|
|
156967
|
-
const
|
|
156968
|
-
const
|
|
156971
|
+
const worktreeStratagemSubdir = normalizePathForComparison(join33(gitRoot, ".stratagem", subdir));
|
|
156972
|
+
const worktreeClaudeSubdir = normalizePathForComparison(join33(gitRoot, ".claude", subdir));
|
|
156973
|
+
const worktreeHasSubdir = projectDirs.some((dir) => {
|
|
156974
|
+
const norm = normalizePathForComparison(dir);
|
|
156975
|
+
return norm === worktreeStratagemSubdir || norm === worktreeClaudeSubdir;
|
|
156976
|
+
});
|
|
156969
156977
|
if (!worktreeHasSubdir) {
|
|
156978
|
+
const mainStratagemSubdir = join33(canonicalRoot, ".stratagem", subdir);
|
|
156970
156979
|
const mainClaudeSubdir = join33(canonicalRoot, ".claude", subdir);
|
|
156971
|
-
if (!projectDirs.includes(mainClaudeSubdir)) {
|
|
156972
|
-
|
|
156980
|
+
if (!projectDirs.includes(mainStratagemSubdir) && !projectDirs.includes(mainClaudeSubdir)) {
|
|
156981
|
+
try {
|
|
156982
|
+
statSync4(mainStratagemSubdir);
|
|
156983
|
+
projectDirs.push(mainStratagemSubdir);
|
|
156984
|
+
} catch {
|
|
156985
|
+
projectDirs.push(mainClaudeSubdir);
|
|
156986
|
+
}
|
|
156973
156987
|
}
|
|
156974
156988
|
}
|
|
156975
156989
|
}
|
|
@@ -157557,9 +157571,13 @@ function convertToSandboxRuntimeConfig(settings) {
|
|
|
157557
157571
|
if (cwd2 !== originalCwd) {
|
|
157558
157572
|
denyWrite.push(resolve17(cwd2, ".claude", "settings.json"));
|
|
157559
157573
|
denyWrite.push(resolve17(cwd2, ".claude", "settings.local.json"));
|
|
157574
|
+
denyWrite.push(resolve17(cwd2, ".stratagem", "settings.json"));
|
|
157575
|
+
denyWrite.push(resolve17(cwd2, ".stratagem", "settings.local.json"));
|
|
157560
157576
|
}
|
|
157577
|
+
denyWrite.push(resolve17(originalCwd, ".stratagem", "skills"));
|
|
157561
157578
|
denyWrite.push(resolve17(originalCwd, ".claude", "skills"));
|
|
157562
157579
|
if (cwd2 !== originalCwd) {
|
|
157580
|
+
denyWrite.push(resolve17(cwd2, ".stratagem", "skills"));
|
|
157563
157581
|
denyWrite.push(resolve17(cwd2, ".claude", "skills"));
|
|
157564
157582
|
}
|
|
157565
157583
|
bareGitRepoScrubPaths.length = 0;
|
|
@@ -382970,7 +382988,7 @@ function getAnthropicEnvMetadata() {
|
|
|
382970
382988
|
function getBuildAgeMinutes() {
|
|
382971
382989
|
if (false)
|
|
382972
382990
|
;
|
|
382973
|
-
const buildTime = new Date("2026-04-29T03:
|
|
382991
|
+
const buildTime = new Date("2026-04-29T03:43:04.326Z").getTime();
|
|
382974
382992
|
if (isNaN(buildTime))
|
|
382975
382993
|
return;
|
|
382976
382994
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -410147,7 +410165,7 @@ function buildPrimarySection() {
|
|
|
410147
410165
|
}, undefined, false, undefined, this);
|
|
410148
410166
|
return [{
|
|
410149
410167
|
label: "Version",
|
|
410150
|
-
value: "0.3.
|
|
410168
|
+
value: "0.3.24"
|
|
410151
410169
|
}, {
|
|
410152
410170
|
label: "Session name",
|
|
410153
410171
|
value: nameValue
|
|
@@ -424888,7 +424906,7 @@ Detect:
|
|
|
424888
424906
|
- Project structure (monorepo with workspaces, multi-module, or single project)
|
|
424889
424907
|
- Code style rules that differ from language defaults
|
|
424890
424908
|
- Non-obvious gotchas, required env vars, or workflow quirks
|
|
424891
|
-
- Existing .
|
|
424909
|
+
- Existing .stratagem/skills/ and .stratagem/rules/ directories
|
|
424892
424910
|
- Formatter configuration (prettier, biome, ruff, black, gofmt, rustfmt, or a unified format script like \`npm run format\` / \`make fmt\`)
|
|
424893
424911
|
- Git worktree usage: run \`git worktree list\` to check if this repo has multiple worktrees (only relevant if the user wants a personal CLAUDE.local.md)
|
|
424894
424912
|
|
|
@@ -424969,7 +424987,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
424969
424987
|
|
|
424970
424988
|
If AGENTS.md already exists: read it, propose specific changes as diffs, and explain why each change improves it. Do not silently overwrite.
|
|
424971
424989
|
|
|
424972
|
-
For projects with multiple concerns, suggest organizing instructions into \`.
|
|
424990
|
+
For projects with multiple concerns, suggest organizing instructions into \`.stratagem/rules/\` as separate focused files (e.g., \`code-style.md\`, \`testing.md\`, \`security.md\`). These are loaded automatically alongside AGENTS.md and can be scoped to specific file paths using \`paths\` frontmatter.
|
|
424973
424991
|
|
|
424974
424992
|
For projects with distinct subdirectories (monorepos, multi-module projects, etc.): mention that subdirectory AGENTS.md files can be added for module-specific instructions (they're loaded automatically when Claude works in those directories). Offer to create them if the user wants.
|
|
424975
424993
|
|
|
@@ -425005,9 +425023,9 @@ Skills add capabilities Claude can use on demand without bloating every session.
|
|
|
425005
425023
|
|
|
425006
425024
|
For each suggested skill, provide: name, one-line purpose, and why it fits this repo.
|
|
425007
425025
|
|
|
425008
|
-
If \`.
|
|
425026
|
+
If \`.stratagem/skills/\` already exists with skills, review them first. Do not overwrite existing skills — only propose new ones that complement what is already there.
|
|
425009
425027
|
|
|
425010
|
-
Create each skill at \`.
|
|
425028
|
+
Create each skill at \`.stratagem/skills/<skill-name>/SKILL.md\`:
|
|
425011
425029
|
|
|
425012
425030
|
\`\`\`yaml
|
|
425013
425031
|
---
|
|
@@ -425034,7 +425052,7 @@ Check the environment and ask about each gap you find (use AskUserQuestion):
|
|
|
425034
425052
|
|
|
425035
425053
|
For each hook preference (from the queue or the formatter fallback):
|
|
425036
425054
|
|
|
425037
|
-
1. Target file: default based on the Phase 1 instruction-file choice — project → \`.
|
|
425055
|
+
1. Target file: default based on the Phase 1 instruction-file choice — project → \`.stratagem/settings.json\` (team-shared, committed); personal → \`.stratagem/settings.local.json\`. Only ask if the user chose "both" in Phase 1 or the preference is ambiguous. Ask once for all hooks, not per-hook.
|
|
425038
425056
|
|
|
425039
425057
|
2. Pick the event and matcher from the preference:
|
|
425040
425058
|
- "after every edit" → \`PostToolUse\` with matcher \`Write|Edit\`
|
|
@@ -425043,7 +425061,7 @@ Check the environment and ask about each gap you find (use AskUserQuestion):
|
|
|
425043
425061
|
- "before committing" (literal git-commit gate) → **not a hooks.json hook.** Matchers can't filter Bash by command content, so there's no way to target only \`git commit\`. Route this to a git pre-commit hook (\`.git/hooks/pre-commit\`, husky, pre-commit framework) instead — offer to write one. If the user actually means "before I review and commit Claude's output", that's \`Stop\` — probe to disambiguate.
|
|
425044
425062
|
Probe if the preference is ambiguous.
|
|
425045
425063
|
|
|
425046
|
-
3. **Load the hook reference** (once per \`/init\` run, before the first hook): invoke the Skill tool with \`skill: 'update-config'\` and args starting with \`[hooks-only]\` followed by a one-line summary of what you're building — e.g., \`[hooks-only] Constructing a PostToolUse/Write|Edit format hook for .
|
|
425064
|
+
3. **Load the hook reference** (once per \`/init\` run, before the first hook): invoke the Skill tool with \`skill: 'update-config'\` and args starting with \`[hooks-only]\` followed by a one-line summary of what you're building — e.g., \`[hooks-only] Constructing a PostToolUse/Write|Edit format hook for .stratagem/settings.json using ruff\`. This loads the hooks schema and verification flow into context. Subsequent hooks reuse it — don't re-invoke.
|
|
425047
425065
|
|
|
425048
425066
|
4. Follow the skill's **"Constructing a Hook"** flow: dedup check → construct for THIS project → pipe-test raw → wrap → write JSON → \`jq -e\` validate → live-proof (for \`Pre|PostToolUse\` on triggerable matchers) → cleanup → handoff. Target file and event/matcher come from steps 1–2 above.
|
|
425049
425067
|
|
|
@@ -425250,9 +425268,9 @@ Based on the areas detected in Phase 1, you may need to create multiple verifier
|
|
|
425250
425268
|
|
|
425251
425269
|
## Phase 4: Generate Verifier Skill
|
|
425252
425270
|
|
|
425253
|
-
**All verifier skills are created in the project root's \`.
|
|
425271
|
+
**All verifier skills are created in the project root's \`.stratagem/skills/\` directory.** This ensures they are automatically loaded when Claude runs in the project.
|
|
425254
425272
|
|
|
425255
|
-
Write the skill file to \`.
|
|
425273
|
+
Write the skill file to \`.stratagem/skills/<verifier-name>/SKILL.md\`.
|
|
425256
425274
|
|
|
425257
425275
|
### Skill Template Structure
|
|
425258
425276
|
|
|
@@ -425336,7 +425354,7 @@ allowed-tools:
|
|
|
425336
425354
|
## Phase 5: Confirm Creation
|
|
425337
425355
|
|
|
425338
425356
|
After writing the skill file(s), inform the user:
|
|
425339
|
-
1. Where each skill was created (always in \`.
|
|
425357
|
+
1. Where each skill was created (always in \`.stratagem/skills/\`)
|
|
425340
425358
|
2. How the Verify agent will discover them — the folder name must contain "verifier" (case-insensitive) for automatic discovery
|
|
425341
425359
|
3. That they can edit the skills to customize them
|
|
425342
425360
|
4. That they can run /init-verifiers again to add more verifiers for other areas
|
|
@@ -449803,7 +449821,7 @@ function getStartupLines(termWidth) {
|
|
|
449803
449821
|
const sLen = ` ● ${sL} buffer ready — /help for breach controls`.length;
|
|
449804
449822
|
out.push(centerAnsiLine(boxRow(sRow, W2, sLen), tw));
|
|
449805
449823
|
out.push(centerAnsiLine(`${rgb3(...BORDER)}└${"─".repeat(W2 - 2)}┘${RESET2}`, tw));
|
|
449806
|
-
out.push(centerAnsiLine(`${rgb3(...DIMCOL)}STRATAGEM X7${RESET2} ${rgb3(...ACCENT)}v${"0.3.
|
|
449824
|
+
out.push(centerAnsiLine(`${rgb3(...DIMCOL)}STRATAGEM X7${RESET2} ${rgb3(...ACCENT)}v${"0.3.24"}${RESET2} ${rgb3(...CYAN)}// breach link stable${RESET2}`, tw));
|
|
449807
449825
|
out.push("");
|
|
449808
449826
|
return out;
|
|
449809
449827
|
}
|
|
@@ -456947,7 +456965,7 @@ function SkillsMenu(t0) {
|
|
|
456947
456965
|
t32 = /* @__PURE__ */ jsx_dev_runtime270.jsxDEV(FullWidthRow, {
|
|
456948
456966
|
children: /* @__PURE__ */ jsx_dev_runtime270.jsxDEV(ThemedText, {
|
|
456949
456967
|
dimColor: true,
|
|
456950
|
-
children: "Create skills in .
|
|
456968
|
+
children: "Create skills in .stratagem/skills/ or ~/.stratagem/skills/"
|
|
456951
456969
|
}, undefined, false, undefined, this)
|
|
456952
456970
|
}, undefined, false, undefined, this);
|
|
456953
456971
|
$2[6] = t32;
|
|
@@ -478392,7 +478410,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
478392
478410
|
var call60 = async () => {
|
|
478393
478411
|
return {
|
|
478394
478412
|
type: "text",
|
|
478395
|
-
value: `${"99.0.0"} (built ${"2026-04-29T03:
|
|
478413
|
+
value: `${"99.0.0"} (built ${"2026-04-29T03:43:04.326Z"})`
|
|
478396
478414
|
};
|
|
478397
478415
|
}, version2, version_default;
|
|
478398
478416
|
var init_version = __esm(() => {
|
|
@@ -488834,7 +488852,7 @@ Include 3 friction categories with 2 examples each.`,
|
|
|
488834
488852
|
- Good for: database queries, Slack integration, GitHub issue lookup, connecting to internal APIs
|
|
488835
488853
|
|
|
488836
488854
|
2. **Custom Skills**: Reusable prompts you define as markdown files that run with a single /command.
|
|
488837
|
-
- How to use: Create \`.
|
|
488855
|
+
- How to use: Create \`.stratagem/skills/commit/SKILL.md\` with instructions. Then type \`/commit\` to run it.
|
|
488838
488856
|
- Good for: repetitive workflows - /commit, /review, /test, /deploy, /pr, or complex multi-step workflows
|
|
488839
488857
|
|
|
488840
488858
|
3. **Hooks**: Shell commands that auto-run at specific lifecycle events.
|
|
@@ -493107,10 +493125,18 @@ function getClaudeSkillScope(filePath) {
|
|
|
493107
493125
|
const absolutePath = expandPath(filePath);
|
|
493108
493126
|
const absolutePathLower = normalizeCaseForComparison(absolutePath);
|
|
493109
493127
|
const bases = [
|
|
493128
|
+
{
|
|
493129
|
+
dir: expandPath(join137(getOriginalCwd(), ".stratagem", "skills")),
|
|
493130
|
+
prefix: "/.stratagem/skills/"
|
|
493131
|
+
},
|
|
493110
493132
|
{
|
|
493111
493133
|
dir: expandPath(join137(getOriginalCwd(), ".claude", "skills")),
|
|
493112
493134
|
prefix: "/.claude/skills/"
|
|
493113
493135
|
},
|
|
493136
|
+
{
|
|
493137
|
+
dir: expandPath(join137(homedir34(), ".stratagem", "skills")),
|
|
493138
|
+
prefix: "~/.stratagem/skills/"
|
|
493139
|
+
},
|
|
493114
493140
|
{
|
|
493115
493141
|
dir: expandPath(join137(homedir34(), ".claude", "skills")),
|
|
493116
493142
|
prefix: "~/.claude/skills/"
|
|
@@ -493158,7 +493184,7 @@ function getSettingsPaths() {
|
|
|
493158
493184
|
function isClaudeSettingsPath(filePath) {
|
|
493159
493185
|
const expandedPath = expandPath(filePath);
|
|
493160
493186
|
const normalizedPath = normalizeCaseForComparison(expandedPath);
|
|
493161
|
-
if (normalizedPath.endsWith(`${sep34}.openclaude${sep34}settings.json`) || normalizedPath.endsWith(`${sep34}.openclaude${sep34}settings.local.json`) || normalizedPath.endsWith(`${sep34}.claude${sep34}settings.json`) || normalizedPath.endsWith(`${sep34}.claude${sep34}settings.local.json`)) {
|
|
493187
|
+
if (normalizedPath.endsWith(`${sep34}.openclaude${sep34}settings.json`) || normalizedPath.endsWith(`${sep34}.openclaude${sep34}settings.local.json`) || normalizedPath.endsWith(`${sep34}.claude${sep34}settings.json`) || normalizedPath.endsWith(`${sep34}.claude${sep34}settings.local.json`) || normalizedPath.endsWith(`${sep34}.stratagem${sep34}settings.json`) || normalizedPath.endsWith(`${sep34}.stratagem${sep34}settings.local.json`)) {
|
|
493162
493188
|
return true;
|
|
493163
493189
|
}
|
|
493164
493190
|
return getSettingsPaths().some((settingsPath) => normalizeCaseForComparison(settingsPath) === normalizedPath);
|
|
@@ -493173,7 +493199,10 @@ function isClaudeConfigFilePath(filePath) {
|
|
|
493173
493199
|
const openCommandsDir = join137(getOriginalCwd(), ".openclaude", "commands");
|
|
493174
493200
|
const openAgentsDir = join137(getOriginalCwd(), ".openclaude", "agents");
|
|
493175
493201
|
const openSkillsDir = join137(getOriginalCwd(), ".openclaude", "skills");
|
|
493176
|
-
|
|
493202
|
+
const stratagemCommandsDir = join137(getOriginalCwd(), ".stratagem", "commands");
|
|
493203
|
+
const stratagemAgentsDir = join137(getOriginalCwd(), ".stratagem", "agents");
|
|
493204
|
+
const stratagemSkillsDir = join137(getOriginalCwd(), ".stratagem", "skills");
|
|
493205
|
+
return pathInWorkingPath(filePath, commandsDir) || pathInWorkingPath(filePath, agentsDir) || pathInWorkingPath(filePath, skillsDir) || pathInWorkingPath(filePath, openCommandsDir) || pathInWorkingPath(filePath, openAgentsDir) || pathInWorkingPath(filePath, openSkillsDir) || pathInWorkingPath(filePath, stratagemCommandsDir) || pathInWorkingPath(filePath, stratagemAgentsDir) || pathInWorkingPath(filePath, stratagemSkillsDir);
|
|
493177
493206
|
}
|
|
493178
493207
|
function isSessionPlanFile(absolutePath) {
|
|
493179
493208
|
const expectedPrefix = join137(getPlansDirectory(), getPlanSlug());
|
|
@@ -493959,7 +493988,8 @@ var init_filesystem = __esm(() => {
|
|
|
493959
493988
|
".vscode",
|
|
493960
493989
|
".idea",
|
|
493961
493990
|
".claude",
|
|
493962
|
-
".openclaude"
|
|
493991
|
+
".openclaude",
|
|
493992
|
+
".stratagem"
|
|
493963
493993
|
];
|
|
493964
493994
|
DIR_SEP = posix8.sep;
|
|
493965
493995
|
getClaudeTempDir = memoize_default(function getClaudeTempDir2() {
|
|
@@ -535835,7 +535865,15 @@ async function applySkillImprovement(skillName, updates) {
|
|
|
535835
535865
|
return;
|
|
535836
535866
|
const { join: join143 } = await import("path");
|
|
535837
535867
|
const fs4 = await import("fs/promises");
|
|
535838
|
-
const
|
|
535868
|
+
const stratagemPath = join143(getCwd(), ".stratagem", "skills", skillName, "SKILL.md");
|
|
535869
|
+
const claudePath = join143(getCwd(), ".claude", "skills", skillName, "SKILL.md");
|
|
535870
|
+
let filePath;
|
|
535871
|
+
try {
|
|
535872
|
+
await fs4.access(stratagemPath);
|
|
535873
|
+
filePath = stratagemPath;
|
|
535874
|
+
} catch {
|
|
535875
|
+
filePath = claudePath;
|
|
535876
|
+
}
|
|
535839
535877
|
let currentContent;
|
|
535840
535878
|
try {
|
|
535841
535879
|
currentContent = await fs4.readFile(filePath, "utf-8");
|
|
@@ -543321,7 +543359,7 @@ var init_tipRegistry = __esm(() => {
|
|
|
543321
543359
|
},
|
|
543322
543360
|
{
|
|
543323
543361
|
id: "custom-commands",
|
|
543324
|
-
content: async () => "Create skills by adding .md files to .
|
|
543362
|
+
content: async () => "Create skills by adding .md files to .stratagem/skills/ in your project or ~/.stratagem/skills/ for skills that work in any project",
|
|
543325
543363
|
cooldownSessions: 15,
|
|
543326
543364
|
async isRelevant() {
|
|
543327
543365
|
const config3 = getGlobalConfig();
|
|
@@ -553804,7 +553842,7 @@ function WelcomeV2() {
|
|
|
553804
553842
|
dimColor: true,
|
|
553805
553843
|
children: [
|
|
553806
553844
|
"v",
|
|
553807
|
-
"0.3.
|
|
553845
|
+
"0.3.24",
|
|
553808
553846
|
" "
|
|
553809
553847
|
]
|
|
553810
553848
|
}, undefined, true, undefined, this)
|
|
@@ -573821,7 +573859,7 @@ Usage: stx7 --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
573821
573859
|
pendingHookMessages
|
|
573822
573860
|
}, renderAndRun);
|
|
573823
573861
|
}
|
|
573824
|
-
}).version("0.3.
|
|
573862
|
+
}).version("0.3.24 (STRATAGEM X7)", "-v, --version", "Output the version number");
|
|
573825
573863
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
573826
573864
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
573827
573865
|
if (canUserConfigureAdvisor()) {
|
|
@@ -574349,7 +574387,7 @@ if (false) {}
|
|
|
574349
574387
|
async function main2() {
|
|
574350
574388
|
const args = process.argv.slice(2);
|
|
574351
574389
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
574352
|
-
console.log(`${"0.3.
|
|
574390
|
+
console.log(`${"0.3.24"} (STRATAGEM X7)`);
|
|
574353
574391
|
return;
|
|
574354
574392
|
}
|
|
574355
574393
|
if (args.includes("--provider")) {
|
|
@@ -574471,4 +574509,4 @@ async function main2() {
|
|
|
574471
574509
|
}
|
|
574472
574510
|
main2();
|
|
574473
574511
|
|
|
574474
|
-
//# debugId=
|
|
574512
|
+
//# debugId=F5D81AF49661736F64756E2164756E21
|