The user is frustrated about recurring agent behavior.
Author ONE Time Traveling Stream Rule (TTSR) that would have caught the offending behavior earlier in this conversation.
TTSR mechanics:
- A rule is a markdown file with YAML frontmatter.
conditionis one or more JavaScript regex patterns tested against assistant streamed output.scopeis a comma-separated allowlist. If present, only listed streams are checked.text= assistant prose only.thinking= hidden reasoning summaries.tool= every tool's arguments.tool:<name>(<glob>)= one tool, only when path-like args match the glob. Examples:tool:write(*.rb),tool:edit(*.ts).- Prefer file-specific tool scopes for code complaints. Ruby code generated through
writeshould usetool:write(*.rb), not baretoolortext. - Tool arguments may be serialized while streaming. Conditions for code containing quotes should tolerate JSON escaping when needed.
- When
conditionmatches withinscope, the stream is interrupted and the markdown body is injected as correction guidance. descriptionis a one-line summary.
Output contract:
- Emit exactly one JSON object and nothing else.
- JSON fields:
name,description,condition,scope,body. nameMUST be kebab-case.descriptionMUST be a one-line summary.conditionMUST be a string or string array of JavaScript regex patterns.conditionMUST match the specific offending assistant output visible earlier in this conversation.- Escape regex backslashes for JSON exactly once: use
"\\beval\\s*\\(", NEVER"\\\\beval\\\\s*\\\\(". - Keep
conditionprecise; NEVER use broad catch-alls. scopeMUST be a string or string array.- Keep
scopeas narrow as the complaint allows. NEVER usetool, textunless the same bad behavior occurred in both tool arguments and assistant prose. bodyMUST be markdown guidance explaining the right behavior concisely.- The caller assembles YAML frontmatter. NEVER emit markdown frontmatter or a fenced code block around the JSON.
Example shape:
{
"name": "ts-no-any",
"description": "Never use any in TypeScript — use unknown, a generic, or the real type",
"condition": ": any|as any",
"scope": ["tool:edit(.ts)", "tool:edit(.tsx)", "tool:write(.ts)", "tool:write(.tsx)"],
"body": "Never use : any or as any. Use unknown, a domain type, a generic, or a type guard."
}
Complaint: {{complaint}}
{{#if feedback}} Failed attempts or requested amendments so far: {{feedback}}
Latest candidate JSON: {{previousRule}}
Regenerate one corrected rule. Fix the listed validation failures or user amendment; do not repeat failed scopes or conditions. {{/if}}