claude-code-modes 0.1.0
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/LICENSE +21 -0
- package/README.md +304 -0
- package/package.json +35 -0
- package/prompts/axis/agency/autonomous.md +9 -0
- package/prompts/axis/agency/collaborative.md +9 -0
- package/prompts/axis/agency/surgical.md +9 -0
- package/prompts/axis/quality/architect.md +24 -0
- package/prompts/axis/quality/minimal.md +19 -0
- package/prompts/axis/quality/pragmatic.md +21 -0
- package/prompts/axis/scope/adjacent.md +9 -0
- package/prompts/axis/scope/narrow.md +9 -0
- package/prompts/axis/scope/unrestricted.md +8 -0
- package/prompts/base/actions.md +9 -0
- package/prompts/base/base.json +12 -0
- package/prompts/base/doing-tasks.md +12 -0
- package/prompts/base/env.md +16 -0
- package/prompts/base/intro.md +5 -0
- package/prompts/base/session-guidance.md +7 -0
- package/prompts/base/system.md +7 -0
- package/prompts/base/tone.md +5 -0
- package/prompts/base/tools.md +10 -0
- package/prompts/chill/actions.md +16 -0
- package/prompts/chill/base.json +8 -0
- package/prompts/chill/core.md +60 -0
- package/prompts/chill/env.md +15 -0
- package/prompts/chill/tools.md +12 -0
- package/prompts/modifiers/context-pacing.md +14 -0
- package/prompts/modifiers/readonly.md +10 -0
- package/src/args.ts +118 -0
- package/src/assemble.ts +187 -0
- package/src/build-prompt.ts +119 -0
- package/src/cli.ts +132 -0
- package/src/config-cli.ts +320 -0
- package/src/config.ts +300 -0
- package/src/embedded-prompts.ts +366 -0
- package/src/env.ts +64 -0
- package/src/inspect.ts +315 -0
- package/src/presets.ts +39 -0
- package/src/resolve.ts +278 -0
- package/src/types.ts +99 -0
- package/src/usage.ts +51 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export const AGENCY_VALUES = ["autonomous", "collaborative", "surgical"] as const;
|
|
2
|
+
export type Agency = (typeof AGENCY_VALUES)[number];
|
|
3
|
+
|
|
4
|
+
export const QUALITY_VALUES = ["architect", "pragmatic", "minimal"] as const;
|
|
5
|
+
export type Quality = (typeof QUALITY_VALUES)[number];
|
|
6
|
+
|
|
7
|
+
export const SCOPE_VALUES = ["unrestricted", "adjacent", "narrow"] as const;
|
|
8
|
+
export type Scope = (typeof SCOPE_VALUES)[number];
|
|
9
|
+
|
|
10
|
+
export const PRESET_NAMES = [
|
|
11
|
+
"create",
|
|
12
|
+
"extend",
|
|
13
|
+
"safe",
|
|
14
|
+
"refactor",
|
|
15
|
+
"explore",
|
|
16
|
+
"none",
|
|
17
|
+
] as const;
|
|
18
|
+
export type PresetName = (typeof PRESET_NAMES)[number];
|
|
19
|
+
export function isPresetName(value: string): value is PresetName {
|
|
20
|
+
return (PRESET_NAMES as readonly string[]).includes(value);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Built-in modifier names — used for collision checking in config validation
|
|
24
|
+
export const BUILTIN_MODIFIER_NAMES = ["readonly", "context-pacing"] as const;
|
|
25
|
+
export type BuiltinModifier = (typeof BUILTIN_MODIFIER_NAMES)[number];
|
|
26
|
+
export function isBuiltinModifier(value: string): value is BuiltinModifier {
|
|
27
|
+
return (BUILTIN_MODIFIER_NAMES as readonly string[]).includes(value);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Built-in base names — "standard" is the existing base, "chill" is the new alternative
|
|
31
|
+
export const BUILTIN_BASE_NAMES = ["standard", "chill"] as const;
|
|
32
|
+
export type BuiltinBaseName = (typeof BUILTIN_BASE_NAMES)[number];
|
|
33
|
+
export function isBuiltinBase(value: string): value is BuiltinBaseName {
|
|
34
|
+
return (BUILTIN_BASE_NAMES as readonly string[]).includes(value);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Reserved manifest entries — "axes" and "modifiers" trigger insertion
|
|
38
|
+
export const MANIFEST_RESERVED = ["axes", "modifiers"] as const;
|
|
39
|
+
export type ManifestReserved = (typeof MANIFEST_RESERVED)[number];
|
|
40
|
+
|
|
41
|
+
// A manifest is a flat array of strings
|
|
42
|
+
export type BaseManifest = string[];
|
|
43
|
+
|
|
44
|
+
/** Maps each axis to its built-in values — single source of truth for collision checks */
|
|
45
|
+
export const AXIS_BUILTINS: Record<"agency" | "quality" | "scope", readonly string[]> = {
|
|
46
|
+
agency: AGENCY_VALUES,
|
|
47
|
+
quality: QUALITY_VALUES,
|
|
48
|
+
scope: SCOPE_VALUES,
|
|
49
|
+
};
|
|
50
|
+
export function isBuiltinAxisValue(axis: "agency" | "quality" | "scope", value: string): boolean {
|
|
51
|
+
return (AXIS_BUILTINS[axis] as readonly string[]).includes(value);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Axis values are strings: either a built-in name or an absolute path to a custom fragment
|
|
55
|
+
export interface AxisConfig {
|
|
56
|
+
agency: string;
|
|
57
|
+
quality: string;
|
|
58
|
+
scope: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface ModeConfig {
|
|
62
|
+
base: string; // built-in name ("standard", "chill") or absolute path to base directory
|
|
63
|
+
axes: AxisConfig | null; // null for "none" mode
|
|
64
|
+
modifiers: {
|
|
65
|
+
readonly: boolean;
|
|
66
|
+
contextPacing: boolean;
|
|
67
|
+
custom: string[]; // ordered list of absolute paths to custom modifier files
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface EnvInfo {
|
|
72
|
+
cwd: string;
|
|
73
|
+
isGit: boolean;
|
|
74
|
+
gitBranch: string | null;
|
|
75
|
+
gitStatus: string | null;
|
|
76
|
+
gitLog: string | null;
|
|
77
|
+
platform: string;
|
|
78
|
+
shell: string;
|
|
79
|
+
osVersion: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Template variables for env.md substitution */
|
|
83
|
+
export interface TemplateVars {
|
|
84
|
+
CWD: string;
|
|
85
|
+
IS_GIT: string;
|
|
86
|
+
PLATFORM: string;
|
|
87
|
+
SHELL: string;
|
|
88
|
+
OS_VERSION: string;
|
|
89
|
+
MODEL_NAME: string;
|
|
90
|
+
MODEL_ID: string;
|
|
91
|
+
KNOWLEDGE_CUTOFF: string;
|
|
92
|
+
GIT_STATUS: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface AssembleOptions {
|
|
96
|
+
mode: ModeConfig;
|
|
97
|
+
templateVars: TemplateVars;
|
|
98
|
+
promptsDir: string; // path to prompts/ directory
|
|
99
|
+
}
|
package/src/usage.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export function printUsage(): void {
|
|
2
|
+
const usage = `Usage: claude-mode [preset] [options] [-- claude-args...]
|
|
3
|
+
|
|
4
|
+
Subcommands:
|
|
5
|
+
config Manage configuration
|
|
6
|
+
inspect [--print] Show prompt assembly plan with provenance and warnings
|
|
7
|
+
|
|
8
|
+
Presets:
|
|
9
|
+
create autonomous / architect / unrestricted
|
|
10
|
+
extend autonomous / pragmatic / adjacent
|
|
11
|
+
safe collaborative / minimal / narrow
|
|
12
|
+
refactor autonomous / pragmatic / unrestricted
|
|
13
|
+
explore collaborative / architect / narrow (readonly)
|
|
14
|
+
none no behavioral instructions
|
|
15
|
+
|
|
16
|
+
Base:
|
|
17
|
+
--base <name|path> Built-in: standard, chill
|
|
18
|
+
Base can also be a config-defined name or a directory path.
|
|
19
|
+
|
|
20
|
+
Axis overrides:
|
|
21
|
+
--agency <value> Built-in: autonomous, collaborative, surgical
|
|
22
|
+
--quality <value> Built-in: architect, pragmatic, minimal
|
|
23
|
+
--scope <value> Built-in: unrestricted, adjacent, narrow
|
|
24
|
+
Axis values can also be config-defined names or file paths (.md files).
|
|
25
|
+
|
|
26
|
+
Modifiers:
|
|
27
|
+
--readonly Prevent file modifications
|
|
28
|
+
--context-pacing Include context pacing prompt
|
|
29
|
+
--modifier <name|path> Add a custom modifier (repeatable)
|
|
30
|
+
--print Print assembled prompt instead of launching claude
|
|
31
|
+
|
|
32
|
+
Forwarded to claude:
|
|
33
|
+
--append-system-prompt <text>
|
|
34
|
+
--append-system-prompt-file <path>
|
|
35
|
+
|
|
36
|
+
Config: .claude-mode.json (project) or ~/.config/claude-mode/config.json (global)
|
|
37
|
+
|
|
38
|
+
Everything after -- is passed to claude verbatim.
|
|
39
|
+
|
|
40
|
+
Examples:
|
|
41
|
+
claude-mode create
|
|
42
|
+
claude-mode create --base chill # use the chill base
|
|
43
|
+
claude-mode create --quality pragmatic
|
|
44
|
+
claude-mode create --modifier ./my-rules.md
|
|
45
|
+
claude-mode --agency autonomous --quality ./team-quality.md
|
|
46
|
+
claude-mode team-default # custom preset from config
|
|
47
|
+
claude-mode explore --print
|
|
48
|
+
claude-mode create -- --verbose --model sonnet`;
|
|
49
|
+
|
|
50
|
+
process.stdout.write(usage + "\n");
|
|
51
|
+
}
|