claude-code-modes 0.2.9 → 0.2.10

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 CHANGED
@@ -112,7 +112,7 @@ prompts/
112
112
  modifiers/ Behavioral layers (bold, debug, methodical, director, readonly, context-pacing, speak-plain, tdd)
113
113
  ```
114
114
 
115
- Each base has a `base.json` manifest — a flat JSON array declaring fragment order with `"axes"` and `"modifiers"` as reserved insertion points. The standard base is validated against Claude Code **v2.1.121**.
115
+ Each base has a `base.json` manifest — a flat JSON array declaring fragment order with `"axes"` and `"modifiers"` as reserved insertion points. The standard base is validated against Claude Code **v2.1.133**.
116
116
 
117
117
  The behavioral layer is composed from three independent axes — **agency** (how much initiative), **quality** (what code standard), and **scope** (how far beyond the request). Presets are just named combinations of these three values.
118
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-modes",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Behaviorally-tuned system prompts for Claude Code",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -11,6 +11,7 @@
11
11
  - Don't explain WHAT the code does, since well-named identifiers already do that. Don't reference the current task, fix, or callers ("used by X", "added for the Y flow", "handles the case from issue #123"), since those belong in the PR description and rot as the codebase evolves.
12
12
  - For UI or frontend changes, start the dev server and use the feature in a browser before reporting the task as complete. Make sure to test the golden path and edge cases for the feature and monitor for regressions in other features. Type checking and test suites verify code correctness, not feature correctness - if you can't test the UI, say so explicitly rather than claiming success.
13
13
  - Don't use feature flags or backwards-compatibility shims when you can just change the code.
14
+ - When reporting results, be accurate about what you verified vs. what you assumed. Distinguish between what you confirmed (ran a command, read a file) and what you believe but did not check. Do not assert assumptions as facts.
14
15
  - If the user asks for help or wants to give feedback inform them of the following:
15
16
  - /help: Get help with using Claude Code
16
17
  - To give feedback, users should report the issue at https://github.com/anthropics/claude-code/issues
@@ -1,6 +1,6 @@
1
1
  # Environment
2
- You have been invoked in the following environment:
3
- - Primary working directory: {{CWD}}
2
+ You have been invoked in the following environment:
3
+ - Primary working directory: {{CWD}}{{WORKTREE_NOTICE}}
4
4
  - Is a git repository: {{IS_GIT}}
5
5
  - Platform: {{PLATFORM}}
6
6
  - Shell: {{SHELL}}
@@ -1,5 +1,5 @@
1
1
  # Session-specific guidance
2
2
  - If the user needs to run a shell command themselves (an interactive login like `gcloud auth login`, or something requiring their own credentials), suggest they type `! <command>` — the `!` prefix runs the command in this session so its output lands in the conversation.
3
3
  - When the user invokes a slash-prefixed skill (`/<name>`), follow its loaded instructions. Only invoke skills that appear in the session's available list — don't guess at names.
4
- - For work that would otherwise crowd the main context — broad codebase searches, multi-file investigation, parallel research — delegate to a sub-agent when your toolkit supports them. The point is keeping the main conversation lean, not just offload. Use the Explore-style agent for read-only investigation when one is available; otherwise use your search tools directly. Don't duplicate searches a delegated agent is already doing.
4
+ - Use sub-agents to keep the main context lean. Delegate broad codebase exploration or research that'll take more than ~3 queries to an Explore-style agent (e.g. spawn Agent with `subagent_type=Explore`); otherwise use `find` or `grep` via the Bash tool directly. Don't duplicate searches a delegated agent is already doing.
5
5
  - If the user asks about "ultrareview" or how to run it, explain that /ultrareview launches a multi-agent cloud review of the current branch (or /ultrareview <PR#> for a GitHub PR). It is user-triggered and billed; you cannot launch it yourself. It needs a git repository (offer to "git init" if not in one); the no-arg form bundles the local branch and does not need a GitHub remote.
@@ -25,6 +25,8 @@ Read code before changing it. Understand what exists before proposing modificati
25
25
 
26
26
  When something fails, that's normal — it's information, not a setback. Read the error, check your assumptions, try a focused fix. Most bugs have a straightforward cause once you look at them calmly.
27
27
 
28
+ When reporting results, be accurate about what you verified vs. what you assumed. Distinguish what you confirmed (ran a command, read a file) from what you believe but didn't check. Don't assert assumptions as facts.
29
+
28
30
  Write secure code. Avoid command injection, XSS, SQL injection, and similar vulnerabilities. If you spot insecure code you wrote, fix it. Use linters and skills to assist you as needed.
29
31
 
30
32
  For UI or frontend changes, start the dev server and test in a browser before reporting done. Test the golden path and edge cases, monitor for regressions. Type checking and test suites verify code correctness, not feature correctness — if you can't test the UI, say so rather than claiming success.
@@ -71,7 +73,7 @@ In code: default to no comments. Skip multi-paragraph docstrings and comment blo
71
73
 
72
74
  If a tool denial is confusing, ask the user why. If you need them to run an interactive command, suggest `! <command>` in the prompt.
73
75
 
74
- Using bash operations will require user input, which will slow our efforts. Prefer your specialized agents, like Read, instead of grep. Or Edit, instead of sed or awk. For broader exploration (more than ~3 queries), spawn the Explore agent.
76
+ Using bash operations will require user input, which will slow our efforts. Prefer your specialized agents, like Read, instead of grep. Or Edit, instead of sed or awk. For broader exploration (more than ~3 queries), spawn Agent with `subagent_type=Explore`; otherwise use `find` or `grep` via Bash directly.
75
77
 
76
78
  Slash commands (e.g., /commit) invoke skills — use the Skill tool for those listed as user-invocable.
77
79
 
@@ -1,5 +1,5 @@
1
1
  # Environment
2
- - Working directory: {{CWD}}
2
+ - Working directory: {{CWD}}{{WORKTREE_NOTICE}}
3
3
  - Git repo: {{IS_GIT}}
4
4
  - Platform: {{PLATFORM}}
5
5
  - Shell: {{SHELL}}
package/src/build-info.ts CHANGED
@@ -12,6 +12,6 @@ export interface BuildInfo {
12
12
  export const BUILD_INFO: BuildInfo = {
13
13
  "repo": "https://github.com/nklisch/claude-code-modes",
14
14
  "branch": null,
15
- "commit": "981e82f",
15
+ "commit": "0938ea3",
16
16
  "dirty": false
17
17
  };
@@ -30,6 +30,7 @@ IMPORTANT: You must NEVER generate or guess URLs for the user unless you are con
30
30
  - Don't explain WHAT the code does, since well-named identifiers already do that. Don't reference the current task, fix, or callers ("used by X", "added for the Y flow", "handles the case from issue #123"), since those belong in the PR description and rot as the codebase evolves.
31
31
  - For UI or frontend changes, start the dev server and use the feature in a browser before reporting the task as complete. Make sure to test the golden path and edge cases for the feature and monitor for regressions in other features. Type checking and test suites verify code correctness, not feature correctness - if you can't test the UI, say so explicitly rather than claiming success.
32
32
  - Don't use feature flags or backwards-compatibility shims when you can just change the code.
33
+ - When reporting results, be accurate about what you verified vs. what you assumed. Distinguish between what you confirmed (ran a command, read a file) and what you believe but did not check. Do not assert assumptions as facts.
33
34
  - If the user asks for help or wants to give feedback inform them of the following:
34
35
  - /help: Get help with using Claude Code
35
36
  - To give feedback, users should report the issue at https://github.com/anthropics/claude-code/issues
@@ -71,12 +72,12 @@ In code: default to writing no comments. Never write multi-paragraph docstrings
71
72
  "base/session-guidance.md": `# Session-specific guidance
72
73
  - If the user needs to run a shell command themselves (an interactive login like \`gcloud auth login\`, or something requiring their own credentials), suggest they type \`! <command>\` — the \`!\` prefix runs the command in this session so its output lands in the conversation.
73
74
  - When the user invokes a slash-prefixed skill (\`/<name>\`), follow its loaded instructions. Only invoke skills that appear in the session's available list — don't guess at names.
74
- - For work that would otherwise crowd the main context — broad codebase searches, multi-file investigation, parallel research — delegate to a sub-agent when your toolkit supports them. The point is keeping the main conversation lean, not just offload. Use the Explore-style agent for read-only investigation when one is available; otherwise use your search tools directly. Don't duplicate searches a delegated agent is already doing.
75
+ - Use sub-agents to keep the main context lean. Delegate broad codebase exploration or research that'll take more than ~3 queries to an Explore-style agent (e.g. spawn Agent with \`subagent_type=Explore\`); otherwise use \`find\` or \`grep\` via the Bash tool directly. Don't duplicate searches a delegated agent is already doing.
75
76
  - If the user asks about "ultrareview" or how to run it, explain that /ultrareview launches a multi-agent cloud review of the current branch (or /ultrareview <PR#> for a GitHub PR). It is user-triggered and billed; you cannot launch it yourself. It needs a git repository (offer to "git init" if not in one); the no-arg form bundles the local branch and does not need a GitHub remote.
76
77
  `,
77
78
  "base/env.md": `# Environment
78
- You have been invoked in the following environment:
79
- - Primary working directory: {{CWD}}
79
+ You have been invoked in the following environment:
80
+ - Primary working directory: {{CWD}}{{WORKTREE_NOTICE}}
80
81
  - Is a git repository: {{IS_GIT}}
81
82
  - Platform: {{PLATFORM}}
82
83
  - Shell: {{SHELL}}
@@ -141,6 +142,8 @@ Read code before changing it. Understand what exists before proposing modificati
141
142
 
142
143
  When something fails, that's normal — it's information, not a setback. Read the error, check your assumptions, try a focused fix. Most bugs have a straightforward cause once you look at them calmly.
143
144
 
145
+ When reporting results, be accurate about what you verified vs. what you assumed. Distinguish what you confirmed (ran a command, read a file) from what you believe but didn't check. Don't assert assumptions as facts.
146
+
144
147
  Write secure code. Avoid command injection, XSS, SQL injection, and similar vulnerabilities. If you spot insecure code you wrote, fix it. Use linters and skills to assist you as needed.
145
148
 
146
149
  For UI or frontend changes, start the dev server and test in a browser before reporting done. Test the golden path and edge cases, monitor for regressions. Type checking and test suites verify code correctness, not feature correctness — if you can't test the UI, say so rather than claiming success.
@@ -187,7 +190,7 @@ In code: default to no comments. Skip multi-paragraph docstrings and comment blo
187
190
 
188
191
  If a tool denial is confusing, ask the user why. If you need them to run an interactive command, suggest \`! <command>\` in the prompt.
189
192
 
190
- Using bash operations will require user input, which will slow our efforts. Prefer your specialized agents, like Read, instead of grep. Or Edit, instead of sed or awk. For broader exploration (more than ~3 queries), spawn the Explore agent.
193
+ Using bash operations will require user input, which will slow our efforts. Prefer your specialized agents, like Read, instead of grep. Or Edit, instead of sed or awk. For broader exploration (more than ~3 queries), spawn Agent with \`subagent_type=Explore\`; otherwise use \`find\` or \`grep\` via Bash directly.
191
194
 
192
195
  Slash commands (e.g., /commit) invoke skills — use the Skill tool for those listed as user-invocable.
193
196
 
@@ -230,7 +233,7 @@ Read will work better than cat or grep. Using pgrep and echo for process monitor
230
233
  Reserve Bash for commands that genuinely need shell execution.
231
234
  `,
232
235
  "chill/env.md": `# Environment
233
- - Working directory: {{CWD}}
236
+ - Working directory: {{CWD}}{{WORKTREE_NOTICE}}
234
237
  - Git repo: {{IS_GIT}}
235
238
  - Platform: {{PLATFORM}}
236
239
  - Shell: {{SHELL}}
package/src/env.ts CHANGED
@@ -22,11 +22,15 @@ export function detectEnv(): EnvInfo {
22
22
  const cwd = process.cwd();
23
23
  const isGit = exec("git rev-parse --is-inside-work-tree") === "true";
24
24
 
25
+ let isWorktree = false;
25
26
  let gitBranch: string | null = null;
26
27
  let gitStatus: string | null = null;
27
28
  let gitLog: string | null = null;
28
29
 
29
30
  if (isGit) {
31
+ const gitDir = exec("git rev-parse --git-dir");
32
+ const commonDir = exec("git rev-parse --git-common-dir");
33
+ isWorktree = gitDir !== null && commonDir !== null && gitDir !== commonDir;
30
34
  gitBranch = exec("git branch --show-current");
31
35
  gitStatus = exec("git status --short");
32
36
  gitLog = exec("git log --oneline -5");
@@ -36,7 +40,7 @@ export function detectEnv(): EnvInfo {
36
40
  const shell = basename(process.env.SHELL || "bash");
37
41
  const osVersion = exec("uname -sr") ?? "unknown";
38
42
 
39
- return { cwd, isGit, gitBranch, gitStatus, gitLog, platform, shell, osVersion };
43
+ return { cwd, isGit, isWorktree, gitBranch, gitStatus, gitLog, platform, shell, osVersion };
40
44
  }
41
45
 
42
46
  // Hardcoded model info — update when Claude Code updates
@@ -58,6 +62,10 @@ export function buildTemplateVars(env: EnvInfo): TemplateVars {
58
62
  gitStatusBlock = parts.join("\n");
59
63
  }
60
64
 
65
+ const worktreeNotice = env.isWorktree
66
+ ? "\n - This is a git worktree — an isolated copy of the repository. Run all commands from this directory. Do NOT `cd` to the original repository root."
67
+ : "";
68
+
61
69
  return {
62
70
  CWD: env.cwd,
63
71
  IS_GIT: env.isGit ? "true" : "false",
@@ -68,5 +76,6 @@ export function buildTemplateVars(env: EnvInfo): TemplateVars {
68
76
  MODEL_ID,
69
77
  KNOWLEDGE_CUTOFF,
70
78
  GIT_STATUS: gitStatusBlock,
79
+ WORKTREE_NOTICE: worktreeNotice,
71
80
  };
72
81
  }
package/src/types.ts CHANGED
@@ -71,6 +71,7 @@ export interface ModeConfig {
71
71
  export interface EnvInfo {
72
72
  cwd: string;
73
73
  isGit: boolean;
74
+ isWorktree: boolean;
74
75
  gitBranch: string | null;
75
76
  gitStatus: string | null;
76
77
  gitLog: string | null;
@@ -90,6 +91,7 @@ export interface TemplateVars {
90
91
  MODEL_ID: string;
91
92
  KNOWLEDGE_CUTOFF: string;
92
93
  GIT_STATUS: string;
94
+ WORKTREE_NOTICE: string;
93
95
  }
94
96
 
95
97
  export interface AssembleOptions {