mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-05 05:05:08 +02:00
d1c2fd3aee
Break the 3000-line monolith into 10 domain modules under scripts/resolvers/: types, constants, preamble, utility, browse, design, testing, review, codex-helpers, and index. Each module owns one domain of template generation. The preamble module introduces a 4-tier composition system (T1-T4) so skills only pay for the preamble sections they actually need, reducing token usage for lightweight skills by ~40%. Adds a token budget dashboard that prints after every generation run showing per-skill and total token counts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
33 lines
787 B
TypeScript
33 lines
787 B
TypeScript
export type Host = 'claude' | 'codex';
|
|
|
|
export interface HostPaths {
|
|
skillRoot: string;
|
|
localSkillRoot: string;
|
|
binDir: string;
|
|
browseDir: string;
|
|
}
|
|
|
|
export const HOST_PATHS: Record<Host, HostPaths> = {
|
|
claude: {
|
|
skillRoot: '~/.claude/skills/gstack',
|
|
localSkillRoot: '.claude/skills/gstack',
|
|
binDir: '~/.claude/skills/gstack/bin',
|
|
browseDir: '~/.claude/skills/gstack/browse/dist',
|
|
},
|
|
codex: {
|
|
skillRoot: '$GSTACK_ROOT',
|
|
localSkillRoot: '.agents/skills/gstack',
|
|
binDir: '$GSTACK_BIN',
|
|
browseDir: '$GSTACK_BROWSE',
|
|
},
|
|
};
|
|
|
|
export interface TemplateContext {
|
|
skillName: string;
|
|
tmplPath: string;
|
|
benefitsFrom?: string[];
|
|
host: Host;
|
|
paths: HostPaths;
|
|
preambleTier?: number; // 1-4, controls which preamble sections are included
|
|
}
|