@ethlete/agent-rules 0.1.0-next.31 → 0.1.0-next.32

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 (38) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +7 -1
  3. package/content/hooks/background-design-commands.py +140 -0
  4. package/content/hooks/builder-chat-words.py +74 -0
  5. package/content/hooks/context-warning.py +47 -19
  6. package/content/hooks/git-safety.py +181 -0
  7. package/content/mods/plugins/e2e-progress/.claude-plugin/plugin.json +1 -1
  8. package/content/rules/nx-layout.md +5 -2
  9. package/content/rules/subagent-models.md +2 -2
  10. package/content/skills/agent-sessions/SKILL.md +5 -3
  11. package/content/skills/agent-sessions/agent-sessions.mjs +20 -4
  12. package/content/skills/design-exploration/SKILL.md +47 -547
  13. package/content/skills/design-exploration/reference-check-and-notes.md +92 -0
  14. package/content/skills/design-exploration/reference-flows-and-wireframes.md +78 -0
  15. package/content/skills/design-exploration/reference-inbox-and-mcp.md +54 -0
  16. package/content/skills/design-exploration/reference-order-and-design-system.md +124 -0
  17. package/content/skills/design-exploration/reference-products-and-sketches.md +199 -0
  18. package/content/skills/design-exploration/reference-shots.md +25 -0
  19. package/content/skills/git-commit/SKILL.md +10 -0
  20. package/content/skills/grilling/SKILL.md +1 -0
  21. package/content/skills/handoff/SKILL.md +20 -4
  22. package/package.json +1 -1
  23. package/src/index.js +2 -1
  24. package/src/index.js.map +1 -1
  25. package/src/lib/git-flow-repair.d.ts +1 -1
  26. package/src/lib/git-flow-start.d.ts +1 -1
  27. package/src/lib/migrate.js +2 -1
  28. package/src/lib/migrate.js.map +1 -1
  29. package/src/lib/output-style-command.d.ts +1 -1
  30. package/src/lib/prettier.d.ts +21 -0
  31. package/src/lib/prettier.js +51 -0
  32. package/src/lib/prettier.js.map +1 -0
  33. package/src/lib/sync.d.ts +1 -1
  34. package/src/lib/sync.js +9 -2
  35. package/src/lib/sync.js.map +1 -1
  36. package/src/lib/targets/hooks-shared.d.ts +3 -3
  37. package/src/lib/targets/hooks-shared.js +58 -20
  38. package/src/lib/targets/hooks-shared.js.map +1 -1
@@ -61,6 +61,7 @@ const remove = takeFlag(args, '--remove', false);
61
61
  const afterSeconds = takeFlag(args, '--after', true);
62
62
  const now = takeFlag(args, '--now', false);
63
63
  const dryRun = takeFlag(args, '--dry-run', false);
64
+ const role = takeFlag(args, '--role', true);
64
65
  const [command, sender, ...words] = args;
65
66
 
66
67
  const help = `Shared agent mailbox: ${mailbox}
@@ -74,7 +75,9 @@ Claim: node ${script} claim <name> <path...> [--ttl <hours>] [--force]
74
75
  Release: node ${script} release <name> [path...] (no path: release every claim of <name>)
75
76
  Claims: node ${script} claims
76
77
  Up: node ${script} up <name>[=<command>]... (start a tmux session per agent, plus one that runs dispatch)
77
- Run: node ${script} run <name> <command...> (start or attach the agent in its tmux session; starts dispatch)
78
+ Run: node ${script} run <name> <command...> [--role builder] [--dry-run]
79
+ (start or attach the agent in its tmux session; starts dispatch;
80
+ the builder role sets ETHLETE_AGENT_ROLE and gives claude a terse system prompt)
78
81
  Install: node ${script} shell-install [<agent>...] [--file <path>] [--remove] [--dry-run]
79
82
  (write the shell functions into ~/.zshrc or ~/.bashrc)
80
83
  Shell: node ${script} shell-init [<agent>...] (print shell functions that wrap each agent with run; default: claude codex)
@@ -94,6 +97,10 @@ Keep credentials and personal data out of the mailbox. No agent is started autom
94
97
 
95
98
  const tmux = (...tmuxArgs) => spawnSync('tmux', tmuxArgs, { encoding: 'utf8' });
96
99
  const quote = (text) => `'${text.replaceAll("'", "'\\''")}'`;
100
+ const BUILDER_PROMPT =
101
+ 'The user does not read this chat. Write no text between tool calls; end each turn with at most one line. Reports go to the grill session via SendMessage.';
102
+ const withRole = (words) =>
103
+ role === 'builder' && basename(words[0]) === 'claude' ? [...words, '--append-system-prompt', BUILDER_PROMPT] : words;
97
104
  const sessionExists = (name) => tmux('has-session', '-t', `=${name}`).status === 0;
98
105
  const ONE_SHOT_FLAGS = new Set(['-p', '--print', '-v', '--version', '-h', '--help']);
99
106
  const runsInSession = (agentArgs) =>
@@ -271,15 +278,24 @@ if (command === 'send' && sender) {
271
278
  const [name, ...rest] = spec.split('=');
272
279
  startSession(sessionFor(name), rest.join('=') || undefined);
273
280
  });
281
+ } else if (command === 'run' && sender && words.length && role !== undefined && role !== 'builder') {
282
+ process.stderr.write(`Unknown role ${role}. Only builder exists.\n`);
283
+ process.exitCode = 1;
284
+ } else if (command === 'run' && sender && words.length && dryRun) {
285
+ process.stdout.write(`${role ? `ETHLETE_AGENT_ROLE=${role} ` : ''}${withRole(words).map(quote).join(' ')}\n`);
274
286
  } else if (command === 'run' && sender && words.length && !runsInSession(words.slice(1))) {
275
- const [program, ...programArgs] = words;
276
- process.exitCode = spawnSync(program, programArgs, { stdio: 'inherit' }).status ?? 1;
287
+ const [program, ...programArgs] = withRole(words);
288
+ process.exitCode =
289
+ spawnSync(program, programArgs, {
290
+ stdio: 'inherit',
291
+ env: role ? { ...process.env, ETHLETE_AGENT_ROLE: role } : process.env,
292
+ }).status ?? 1;
277
293
  } else if (command === 'run' && sender && words.length) {
278
294
  const withEnv = process.env.AGENT_MAILBOX ? `AGENT_MAILBOX=${quote(process.env.AGENT_MAILBOX)} ` : '';
279
295
  if (!sessionExists(DISPATCH_SESSION))
280
296
  startSession(DISPATCH_SESSION, `${withEnv}node ${quote(script)} dispatch`, true);
281
297
  const session = freeSessionFor(sender);
282
- const shellCommand = words.map(quote).join(' ');
298
+ const shellCommand = `${role ? `ETHLETE_AGENT_ROLE=${role} ` : ''}${withRole(words).map(quote).join(' ')}`;
283
299
  if (process.env.TMUX) {
284
300
  if (!sessionExists(session)) tmux('new-session', '-d', '-s', session, '-c', process.cwd(), shellCommand);
285
301
  process.exitCode = spawnSync('tmux', ['switch-client', '-t', `=${session}`], { stdio: 'inherit' }).status ?? 1;