stratagem-x7 0.3.23 → 0.3.25

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +87 -35
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -55532,8 +55532,22 @@ function getAutoMemPathSetting() {
55532
55532
  function hasAutoMemPathOverride() {
55533
55533
  return getAutoMemPathOverride() !== undefined;
55534
55534
  }
55535
+ function isFilesystemRoot(p) {
55536
+ const normalized = normalize3(p);
55537
+ if (normalized === sep4)
55538
+ return true;
55539
+ if (/^[A-Za-z]:[/\\]?$/.test(normalized))
55540
+ return true;
55541
+ if (normalized.length <= 3 && /^[A-Za-z]:/.test(normalized))
55542
+ return true;
55543
+ return false;
55544
+ }
55535
55545
  function getAutoMemBase() {
55536
- return findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot();
55546
+ const gitRoot = findCanonicalGitRoot(getProjectRoot());
55547
+ if (gitRoot && !isFilesystemRoot(gitRoot)) {
55548
+ return gitRoot;
55549
+ }
55550
+ return getProjectRoot();
55537
55551
  }
55538
55552
  function getAutoMemEntrypoint() {
55539
55553
  return join24(getAutoMemPath(), AUTO_MEM_ENTRYPOINT_NAME);
@@ -156826,13 +156840,17 @@ function getProjectDirsUpToHome(subdir, cwd2) {
156826
156840
  if (normalizePathForComparison(current) === normalizePathForComparison(home)) {
156827
156841
  break;
156828
156842
  }
156843
+ const stratagemSubdir = join33(current, ".stratagem", subdir);
156829
156844
  const claudeSubdir = join33(current, ".claude", subdir);
156830
- try {
156831
- statSync4(claudeSubdir);
156832
- dirs.push(claudeSubdir);
156833
- } catch (e) {
156834
- if (!isFsInaccessible(e))
156835
- throw e;
156845
+ for (const candidate of [stratagemSubdir, claudeSubdir]) {
156846
+ try {
156847
+ statSync4(candidate);
156848
+ dirs.push(candidate);
156849
+ break;
156850
+ } catch (e) {
156851
+ if (!isFsInaccessible(e))
156852
+ throw e;
156853
+ }
156836
156854
  }
156837
156855
  if (gitRoot && normalizePathForComparison(current) === normalizePathForComparison(gitRoot)) {
156838
156856
  break;
@@ -156964,12 +156982,22 @@ var init_markdownConfigLoader = __esm(() => {
156964
156982
  const gitRoot = findGitRoot(cwd2);
156965
156983
  const canonicalRoot = findCanonicalGitRoot(cwd2);
156966
156984
  if (gitRoot && canonicalRoot && canonicalRoot !== gitRoot) {
156967
- const worktreeSubdir = normalizePathForComparison(join33(gitRoot, ".claude", subdir));
156968
- const worktreeHasSubdir = projectDirs.some((dir) => normalizePathForComparison(dir) === worktreeSubdir);
156985
+ const worktreeStratagemSubdir = normalizePathForComparison(join33(gitRoot, ".stratagem", subdir));
156986
+ const worktreeClaudeSubdir = normalizePathForComparison(join33(gitRoot, ".claude", subdir));
156987
+ const worktreeHasSubdir = projectDirs.some((dir) => {
156988
+ const norm = normalizePathForComparison(dir);
156989
+ return norm === worktreeStratagemSubdir || norm === worktreeClaudeSubdir;
156990
+ });
156969
156991
  if (!worktreeHasSubdir) {
156992
+ const mainStratagemSubdir = join33(canonicalRoot, ".stratagem", subdir);
156970
156993
  const mainClaudeSubdir = join33(canonicalRoot, ".claude", subdir);
156971
- if (!projectDirs.includes(mainClaudeSubdir)) {
156972
- projectDirs.push(mainClaudeSubdir);
156994
+ if (!projectDirs.includes(mainStratagemSubdir) && !projectDirs.includes(mainClaudeSubdir)) {
156995
+ try {
156996
+ statSync4(mainStratagemSubdir);
156997
+ projectDirs.push(mainStratagemSubdir);
156998
+ } catch {
156999
+ projectDirs.push(mainClaudeSubdir);
157000
+ }
156973
157001
  }
156974
157002
  }
156975
157003
  }
@@ -157557,9 +157585,13 @@ function convertToSandboxRuntimeConfig(settings) {
157557
157585
  if (cwd2 !== originalCwd) {
157558
157586
  denyWrite.push(resolve17(cwd2, ".claude", "settings.json"));
157559
157587
  denyWrite.push(resolve17(cwd2, ".claude", "settings.local.json"));
157588
+ denyWrite.push(resolve17(cwd2, ".stratagem", "settings.json"));
157589
+ denyWrite.push(resolve17(cwd2, ".stratagem", "settings.local.json"));
157560
157590
  }
157591
+ denyWrite.push(resolve17(originalCwd, ".stratagem", "skills"));
157561
157592
  denyWrite.push(resolve17(originalCwd, ".claude", "skills"));
157562
157593
  if (cwd2 !== originalCwd) {
157594
+ denyWrite.push(resolve17(cwd2, ".stratagem", "skills"));
157563
157595
  denyWrite.push(resolve17(cwd2, ".claude", "skills"));
157564
157596
  }
157565
157597
  bareGitRepoScrubPaths.length = 0;
@@ -382970,7 +383002,7 @@ function getAnthropicEnvMetadata() {
382970
383002
  function getBuildAgeMinutes() {
382971
383003
  if (false)
382972
383004
  ;
382973
- const buildTime = new Date("2026-04-29T03:31:13.511Z").getTime();
383005
+ const buildTime = new Date("2026-04-29T05:21:22.801Z").getTime();
382974
383006
  if (isNaN(buildTime))
382975
383007
  return;
382976
383008
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -410147,7 +410179,7 @@ function buildPrimarySection() {
410147
410179
  }, undefined, false, undefined, this);
410148
410180
  return [{
410149
410181
  label: "Version",
410150
- value: "0.3.23"
410182
+ value: "0.3.25"
410151
410183
  }, {
410152
410184
  label: "Session name",
410153
410185
  value: nameValue
@@ -424888,7 +424920,7 @@ Detect:
424888
424920
  - Project structure (monorepo with workspaces, multi-module, or single project)
424889
424921
  - Code style rules that differ from language defaults
424890
424922
  - Non-obvious gotchas, required env vars, or workflow quirks
424891
- - Existing .claude/skills/ and .claude/rules/ directories
424923
+ - Existing .stratagem/skills/ and .stratagem/rules/ directories
424892
424924
  - Formatter configuration (prettier, biome, ruff, black, gofmt, rustfmt, or a unified format script like \`npm run format\` / \`make fmt\`)
424893
424925
  - 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
424926
 
@@ -424969,7 +425001,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
424969
425001
 
424970
425002
  If AGENTS.md already exists: read it, propose specific changes as diffs, and explain why each change improves it. Do not silently overwrite.
424971
425003
 
424972
- For projects with multiple concerns, suggest organizing instructions into \`.claude/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.
425004
+ 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
425005
 
424974
425006
  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
425007
 
@@ -425005,9 +425037,9 @@ Skills add capabilities Claude can use on demand without bloating every session.
425005
425037
 
425006
425038
  For each suggested skill, provide: name, one-line purpose, and why it fits this repo.
425007
425039
 
425008
- If \`.claude/skills/\` already exists with skills, review them first. Do not overwrite existing skills — only propose new ones that complement what is already there.
425040
+ 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
425041
 
425010
- Create each skill at \`.claude/skills/<skill-name>/SKILL.md\`:
425042
+ Create each skill at \`.stratagem/skills/<skill-name>/SKILL.md\`:
425011
425043
 
425012
425044
  \`\`\`yaml
425013
425045
  ---
@@ -425034,7 +425066,7 @@ Check the environment and ask about each gap you find (use AskUserQuestion):
425034
425066
 
425035
425067
  For each hook preference (from the queue or the formatter fallback):
425036
425068
 
425037
- 1. Target file: default based on the Phase 1 instruction-file choice — project → \`.claude/settings.json\` (team-shared, committed); personal → \`.claude/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.
425069
+ 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
425070
 
425039
425071
  2. Pick the event and matcher from the preference:
425040
425072
  - "after every edit" → \`PostToolUse\` with matcher \`Write|Edit\`
@@ -425043,7 +425075,7 @@ Check the environment and ask about each gap you find (use AskUserQuestion):
425043
425075
  - "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
425076
  Probe if the preference is ambiguous.
425045
425077
 
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 .claude/settings.json using ruff\`. This loads the hooks schema and verification flow into context. Subsequent hooks reuse it — don't re-invoke.
425078
+ 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
425079
 
425048
425080
  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
425081
 
@@ -425250,9 +425282,9 @@ Based on the areas detected in Phase 1, you may need to create multiple verifier
425250
425282
 
425251
425283
  ## Phase 4: Generate Verifier Skill
425252
425284
 
425253
- **All verifier skills are created in the project root's \`.claude/skills/\` directory.** This ensures they are automatically loaded when Claude runs in the project.
425285
+ **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
425286
 
425255
- Write the skill file to \`.claude/skills/<verifier-name>/SKILL.md\`.
425287
+ Write the skill file to \`.stratagem/skills/<verifier-name>/SKILL.md\`.
425256
425288
 
425257
425289
  ### Skill Template Structure
425258
425290
 
@@ -425336,7 +425368,7 @@ allowed-tools:
425336
425368
  ## Phase 5: Confirm Creation
425337
425369
 
425338
425370
  After writing the skill file(s), inform the user:
425339
- 1. Where each skill was created (always in \`.claude/skills/\`)
425371
+ 1. Where each skill was created (always in \`.stratagem/skills/\`)
425340
425372
  2. How the Verify agent will discover them — the folder name must contain "verifier" (case-insensitive) for automatic discovery
425341
425373
  3. That they can edit the skills to customize them
425342
425374
  4. That they can run /init-verifiers again to add more verifiers for other areas
@@ -449803,7 +449835,7 @@ function getStartupLines(termWidth) {
449803
449835
  const sLen = ` ● ${sL} buffer ready — /help for breach controls`.length;
449804
449836
  out.push(centerAnsiLine(boxRow(sRow, W2, sLen), tw));
449805
449837
  out.push(centerAnsiLine(`${rgb3(...BORDER)}└${"─".repeat(W2 - 2)}┘${RESET2}`, tw));
449806
- out.push(centerAnsiLine(`${rgb3(...DIMCOL)}STRATAGEM X7${RESET2} ${rgb3(...ACCENT)}v${"0.3.23"}${RESET2} ${rgb3(...CYAN)}// breach link stable${RESET2}`, tw));
449838
+ out.push(centerAnsiLine(`${rgb3(...DIMCOL)}STRATAGEM X7${RESET2} ${rgb3(...ACCENT)}v${"0.3.25"}${RESET2} ${rgb3(...CYAN)}// breach link stable${RESET2}`, tw));
449807
449839
  out.push("");
449808
449840
  return out;
449809
449841
  }
@@ -456947,7 +456979,7 @@ function SkillsMenu(t0) {
456947
456979
  t32 = /* @__PURE__ */ jsx_dev_runtime270.jsxDEV(FullWidthRow, {
456948
456980
  children: /* @__PURE__ */ jsx_dev_runtime270.jsxDEV(ThemedText, {
456949
456981
  dimColor: true,
456950
- children: "Create skills in .claude/skills/ or ~/.claude/skills/"
456982
+ children: "Create skills in .stratagem/skills/ or ~/.stratagem/skills/"
456951
456983
  }, undefined, false, undefined, this)
456952
456984
  }, undefined, false, undefined, this);
456953
456985
  $2[6] = t32;
@@ -478392,7 +478424,7 @@ var init_bridge_kick = __esm(() => {
478392
478424
  var call60 = async () => {
478393
478425
  return {
478394
478426
  type: "text",
478395
- value: `${"99.0.0"} (built ${"2026-04-29T03:31:13.511Z"})`
478427
+ value: `${"99.0.0"} (built ${"2026-04-29T05:21:22.801Z"})`
478396
478428
  };
478397
478429
  }, version2, version_default;
478398
478430
  var init_version = __esm(() => {
@@ -488834,7 +488866,7 @@ Include 3 friction categories with 2 examples each.`,
488834
488866
  - Good for: database queries, Slack integration, GitHub issue lookup, connecting to internal APIs
488835
488867
 
488836
488868
  2. **Custom Skills**: Reusable prompts you define as markdown files that run with a single /command.
488837
- - How to use: Create \`.claude/skills/commit/SKILL.md\` with instructions. Then type \`/commit\` to run it.
488869
+ - How to use: Create \`.stratagem/skills/commit/SKILL.md\` with instructions. Then type \`/commit\` to run it.
488838
488870
  - Good for: repetitive workflows - /commit, /review, /test, /deploy, /pr, or complex multi-step workflows
488839
488871
 
488840
488872
  3. **Hooks**: Shell commands that auto-run at specific lifecycle events.
@@ -493107,10 +493139,18 @@ function getClaudeSkillScope(filePath) {
493107
493139
  const absolutePath = expandPath(filePath);
493108
493140
  const absolutePathLower = normalizeCaseForComparison(absolutePath);
493109
493141
  const bases = [
493142
+ {
493143
+ dir: expandPath(join137(getOriginalCwd(), ".stratagem", "skills")),
493144
+ prefix: "/.stratagem/skills/"
493145
+ },
493110
493146
  {
493111
493147
  dir: expandPath(join137(getOriginalCwd(), ".claude", "skills")),
493112
493148
  prefix: "/.claude/skills/"
493113
493149
  },
493150
+ {
493151
+ dir: expandPath(join137(homedir34(), ".stratagem", "skills")),
493152
+ prefix: "~/.stratagem/skills/"
493153
+ },
493114
493154
  {
493115
493155
  dir: expandPath(join137(homedir34(), ".claude", "skills")),
493116
493156
  prefix: "~/.claude/skills/"
@@ -493158,7 +493198,7 @@ function getSettingsPaths() {
493158
493198
  function isClaudeSettingsPath(filePath) {
493159
493199
  const expandedPath = expandPath(filePath);
493160
493200
  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`)) {
493201
+ 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
493202
  return true;
493163
493203
  }
493164
493204
  return getSettingsPaths().some((settingsPath) => normalizeCaseForComparison(settingsPath) === normalizedPath);
@@ -493173,7 +493213,10 @@ function isClaudeConfigFilePath(filePath) {
493173
493213
  const openCommandsDir = join137(getOriginalCwd(), ".openclaude", "commands");
493174
493214
  const openAgentsDir = join137(getOriginalCwd(), ".openclaude", "agents");
493175
493215
  const openSkillsDir = join137(getOriginalCwd(), ".openclaude", "skills");
493176
- return pathInWorkingPath(filePath, commandsDir) || pathInWorkingPath(filePath, agentsDir) || pathInWorkingPath(filePath, skillsDir) || pathInWorkingPath(filePath, openCommandsDir) || pathInWorkingPath(filePath, openAgentsDir) || pathInWorkingPath(filePath, openSkillsDir);
493216
+ const stratagemCommandsDir = join137(getOriginalCwd(), ".stratagem", "commands");
493217
+ const stratagemAgentsDir = join137(getOriginalCwd(), ".stratagem", "agents");
493218
+ const stratagemSkillsDir = join137(getOriginalCwd(), ".stratagem", "skills");
493219
+ 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
493220
  }
493178
493221
  function isSessionPlanFile(absolutePath) {
493179
493222
  const expectedPrefix = join137(getPlansDirectory(), getPlanSlug());
@@ -493959,7 +494002,8 @@ var init_filesystem = __esm(() => {
493959
494002
  ".vscode",
493960
494003
  ".idea",
493961
494004
  ".claude",
493962
- ".openclaude"
494005
+ ".openclaude",
494006
+ ".stratagem"
493963
494007
  ];
493964
494008
  DIR_SEP = posix8.sep;
493965
494009
  getClaudeTempDir = memoize_default(function getClaudeTempDir2() {
@@ -535835,7 +535879,15 @@ async function applySkillImprovement(skillName, updates) {
535835
535879
  return;
535836
535880
  const { join: join143 } = await import("path");
535837
535881
  const fs4 = await import("fs/promises");
535838
- const filePath = join143(getCwd(), ".claude", "skills", skillName, "SKILL.md");
535882
+ const stratagemPath = join143(getCwd(), ".stratagem", "skills", skillName, "SKILL.md");
535883
+ const claudePath = join143(getCwd(), ".claude", "skills", skillName, "SKILL.md");
535884
+ let filePath;
535885
+ try {
535886
+ await fs4.access(stratagemPath);
535887
+ filePath = stratagemPath;
535888
+ } catch {
535889
+ filePath = claudePath;
535890
+ }
535839
535891
  let currentContent;
535840
535892
  try {
535841
535893
  currentContent = await fs4.readFile(filePath, "utf-8");
@@ -543321,7 +543373,7 @@ var init_tipRegistry = __esm(() => {
543321
543373
  },
543322
543374
  {
543323
543375
  id: "custom-commands",
543324
- content: async () => "Create skills by adding .md files to .claude/skills/ in your project or ~/.claude/skills/ for skills that work in any project",
543376
+ 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
543377
  cooldownSessions: 15,
543326
543378
  async isRelevant() {
543327
543379
  const config3 = getGlobalConfig();
@@ -553804,7 +553856,7 @@ function WelcomeV2() {
553804
553856
  dimColor: true,
553805
553857
  children: [
553806
553858
  "v",
553807
- "0.3.23",
553859
+ "0.3.25",
553808
553860
  " "
553809
553861
  ]
553810
553862
  }, undefined, true, undefined, this)
@@ -573821,7 +573873,7 @@ Usage: stx7 --remote "your task description"`, () => gracefulShutdown(1));
573821
573873
  pendingHookMessages
573822
573874
  }, renderAndRun);
573823
573875
  }
573824
- }).version("0.3.23 (STRATAGEM X7)", "-v, --version", "Output the version number");
573876
+ }).version("0.3.25 (STRATAGEM X7)", "-v, --version", "Output the version number");
573825
573877
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
573826
573878
  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
573879
  if (canUserConfigureAdvisor()) {
@@ -574349,7 +574401,7 @@ if (false) {}
574349
574401
  async function main2() {
574350
574402
  const args = process.argv.slice(2);
574351
574403
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
574352
- console.log(`${"0.3.23"} (STRATAGEM X7)`);
574404
+ console.log(`${"0.3.25"} (STRATAGEM X7)`);
574353
574405
  return;
574354
574406
  }
574355
574407
  if (args.includes("--provider")) {
@@ -574471,4 +574523,4 @@ async function main2() {
574471
574523
  }
574472
574524
  main2();
574473
574525
 
574474
- //# debugId=42DBD89575FFBCEC64756E2164756E21
574526
+ //# debugId=80183EEC7BF25FB764756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stratagem-x7",
3
- "version": "0.3.23",
3
+ "version": "0.3.25",
4
4
  "description": "STRATAGEM X7 is a cyberpunk coding-agent CLI for cloud and local model providers",
5
5
  "type": "module",
6
6
  "bin": {