-
Notifications
You must be signed in to change notification settings - Fork 0
feat(pstack): map Cursor Task slugs for pstack roles #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # pstack model configuration | ||
|
|
||
| Per-role model overrides for pstack skills. Each pstack SKILL.md names its defaults in a Models section; the values here override those defaults. Delete a line to fall back to the skill default. A value of `inherit-parent` or `auto` runs that role on the parent session's model (the `Agent` call omits `model`); an alias entry in a panel list still counts toward that panel's fan-out. | ||
|
|
||
| These values are Cursor Task slugs confirmed in this workspace. Claude Code defaults (`claude-opus-4-8`, `claude-opus-5`, `claude-fable-5`, `claude-sonnet-5`, `claude-haiku-4-5`) do not resolve on Cursor Task. Opus 4.8 maps to `claude-opus-5-thinking-high`. Haiku maps to `composer-2.5-fast`. Strongest judgment uses Fable 5 xhigh. | ||
|
|
||
| feature, refactoring: claude-opus-5-thinking-high | ||
| bug-fix: claude-opus-5-thinking-high | ||
| perf-issue: claude-opus-5-thinking-high | ||
| hillclimb: claude-opus-5-thinking-high | ||
| judgment and prose: claude-opus-5-thinking-high | ||
| strongest judgment: claude-fable-5-thinking-xhigh | ||
| how explorer: claude-opus-5-thinking-high | ||
| how explainer: claude-opus-5-thinking-high | ||
| how critics: claude-opus-5-thinking-high, claude-fable-5-thinking-high, claude-sonnet-5-thinking-high, composer-2.5-fast | ||
| why investigators: claude-opus-5-thinking-high | ||
| why synthesizer: claude-opus-5-thinking-high | ||
| reflect tooling: claude-opus-5-thinking-high | ||
| reflect judgment, divergent, synthesizer: claude-opus-5-thinking-high | ||
| arena runners: claude-opus-5-thinking-high, claude-fable-5-thinking-high, claude-sonnet-5-thinking-high, composer-2.5-fast | ||
| arena cross-judge pool: claude-opus-5-thinking-high, claude-fable-5-thinking-high, claude-sonnet-5-thinking-high | ||
| swarm workers: claude-opus-5-thinking-high | ||
| architect runners: claude-opus-5-thinking-high, claude-fable-5-thinking-high, claude-sonnet-5-thinking-high, composer-2.5-fast | ||
| interrogate reviewers: claude-opus-5-thinking-high, claude-fable-5-thinking-high, claude-sonnet-5-thinking-high, composer-2.5-fast |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| const { spawnSync } = require('child_process'); | ||
| const fs = require('fs'); | ||
| const os = require('os'); | ||
| const path = require('path'); | ||
|
|
||
| const REPO_ROOT = path.resolve(__dirname, '..'); | ||
| const SCRIPT = path.join(REPO_ROOT, 'scripts', 'link-agent-skills.sh'); | ||
| const SHEET = path.join(REPO_ROOT, '.cursor', 'pstack-models.md'); | ||
| const INCLUDE_LINE = '@~/.claude/pstack-models.md'; | ||
|
|
||
| const REQUIRED_ROLES = [ | ||
| 'feature, refactoring', | ||
| 'bug-fix', | ||
| 'perf-issue', | ||
| 'hillclimb', | ||
| 'judgment and prose', | ||
| 'strongest judgment', | ||
| 'how explorer', | ||
| 'how explainer', | ||
| 'how critics', | ||
| 'why investigators', | ||
| 'why synthesizer', | ||
| 'reflect tooling', | ||
| 'reflect judgment, divergent, synthesizer', | ||
| 'arena runners', | ||
| 'arena cross-judge pool', | ||
| 'swarm workers', | ||
| 'architect runners', | ||
| 'interrogate reviewers' | ||
| ]; | ||
|
|
||
| const CURSOR_TASK_SLUGS = new Set([ | ||
| 'inherit-parent', | ||
| 'auto', | ||
| 'claude-fable-5-thinking-high', | ||
| 'claude-fable-5-thinking-xhigh', | ||
| 'claude-opus-5-thinking-high', | ||
| 'claude-opus-5-thinking-high-fast', | ||
| 'claude-sonnet-5-thinking-high', | ||
| 'claude-sonnet-5-thinking-xhigh', | ||
| 'composer-2.5', | ||
| 'composer-2.5-fast', | ||
| 'cursor-grok-4.5-high', | ||
| 'cursor-grok-4.5-high-fast', | ||
| 'cursor-grok-4.6-high-fast', | ||
| 'gemini-3.7-flash-high', | ||
| 'gpt-5.6-luna-high', | ||
| 'gpt-5.6-sol-high', | ||
| 'gpt-5.6-sol-high-fast', | ||
| 'gpt-5.6-sol-xhigh', | ||
| 'gpt-5.6-sol-xhigh-fast' | ||
| ]); | ||
|
|
||
| const SLUG = /^[a-z0-9][a-z0-9.-]*$/; | ||
|
|
||
| function parseRoleLines(markdown) { | ||
| const roles = new Map(); | ||
| for (const line of markdown.split('\n')) { | ||
| if (!line || line.startsWith('#') || !line.includes(':')) { | ||
| continue; | ||
| } | ||
| const idx = line.indexOf(':'); | ||
| const role = line.slice(0, idx).trim(); | ||
| const models = line.slice(idx + 1).split(',').map((s) => s.trim()).filter(Boolean); | ||
| if (!role || !models.length || !models.every((slug) => SLUG.test(slug))) { | ||
| continue; | ||
| } | ||
| roles.set(role, models); | ||
| } | ||
| return roles; | ||
| } | ||
|
|
||
| function runLink(homeDir, envExtra = {}) { | ||
| return spawnSync('bash', [SCRIPT], { | ||
| encoding: 'utf8', | ||
| env: { ...process.env, HOME: homeDir, ...envExtra } | ||
| }); | ||
| } | ||
|
|
||
| describe('pstack model sheet', () => { | ||
| test('every role uses a confirmed Cursor Task slug', () => { | ||
| const markdown = fs.readFileSync(SHEET, 'utf8'); | ||
| const roles = parseRoleLines(markdown); | ||
|
|
||
| for (const role of REQUIRED_ROLES) { | ||
| expect(roles.has(role)).toBe(true); | ||
| } | ||
|
|
||
| for (const models of roles.values()) { | ||
| for (const slug of models) { | ||
| expect(CURSOR_TASK_SLUGS.has(slug)).toBe(true); | ||
| } | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| describe('link-agent-skills.sh pstack models', () => { | ||
| let tmpHome; | ||
|
|
||
| beforeEach(() => { | ||
| tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'pstack-models-')); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| fs.rmSync(tmpHome, { recursive: true, force: true }); | ||
| }); | ||
|
|
||
| test('copies the sheet and wires CLAUDE.md when CURSOR_AGENT=1', () => { | ||
| const result = runLink(tmpHome, { CURSOR_AGENT: '1' }); | ||
| expect(result.status).toBe(0); | ||
|
|
||
| const dest = path.join(tmpHome, '.claude', 'pstack-models.md'); | ||
| const claudeMd = path.join(tmpHome, '.claude', 'CLAUDE.md'); | ||
| expect(fs.readFileSync(dest, 'utf8')).toBe(fs.readFileSync(SHEET, 'utf8')); | ||
| expect(fs.readFileSync(claudeMd, 'utf8').trim()).toBe(INCLUDE_LINE); | ||
| }); | ||
|
|
||
| test('appends the include once when CLAUDE.md already has other text', () => { | ||
| const claudeDir = path.join(tmpHome, '.claude'); | ||
| fs.mkdirSync(claudeDir, { recursive: true }); | ||
| const claudeMd = path.join(claudeDir, 'CLAUDE.md'); | ||
| fs.writeFileSync(claudeMd, '# existing rules\n'); | ||
|
|
||
| expect(runLink(tmpHome, { CURSOR_AGENT: '1' }).status).toBe(0); | ||
| expect(runLink(tmpHome, { CURSOR_AGENT: '1' }).status).toBe(0); | ||
|
|
||
| const body = fs.readFileSync(claudeMd, 'utf8'); | ||
| expect(body.startsWith('# existing rules')).toBe(true); | ||
| expect(body.split(INCLUDE_LINE).length - 1).toBe(1); | ||
| }); | ||
|
|
||
| test('leaves home pstack-models untouched when CURSOR_AGENT is unset', () => { | ||
| const result = runLink(tmpHome, { CURSOR_AGENT: '' }); | ||
| expect(result.status).toBe(0); | ||
| expect(fs.existsSync(path.join(tmpHome, '.claude', 'pstack-models.md'))).toBe(false); | ||
| }); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a user runs
/setup-pstackto change a role, that skill rewrites~/.claude/pstack-models.md, or~/.codex/pstack-models.mdon Codex, but this new rule tells subsequent spawns to keep reading the unchanged.cursor/pstack-models.md. The advertised customization is therefore ignored, and non-Cursor agents are directed to submit Cursor-only model slugs. Point agents to the installed runtime-specific override and reserve.cursor/pstack-models.mdfor Cursor bootstrap.AGENTS.md reference: AGENTS.md:L14-L16
Useful? React with 👍 / 👎.