Add the pure ste-style.ts module and inject the style block into the Grill Me prompt #291

Closed
opened 2026-10-09 21:19:19 +00:00 by david · 1 comment
Owner

Summary

Create extensions/grillme/ste-style.ts — a dependency-free module that owns the paraphrased ASD-STE100 (STE) style text, the exemption list, the self-check, and the credit line — and export buildSteStyleBlock(). Call it from the before_agent_start handler in extensions/grillme/index.ts so the style block applies for the whole session.

Background

The grillme extension lives in extensions/grillme/. Its entry point is index.ts, which builds the injected Grill Me prompt inline inside pi.on("before_agent_start", ...) and returns { systemPrompt: event.systemPrompt + prompt }. That handler is not exported and cannot be tested, so the style text must live in a pure module.

The style is always on: no toggle, no command, no persisted setting.

Licensing constrains the text. docs/adr/0001-grill-me-ste-response-style.md records the decision: the official standard is free to download but not free to redistribute, and a personal pi extension is not in any of the eight reproduction-permitted categories. The extension therefore paraphrases the rule categories in its own words, credits the standard, and links it. Do not fetch, vendor, or paste the standard's rule text, dictionary entries, or excerpts, and do not create a docs/reference/ folder for it.

Implementation Details

Create extensions/grillme/ste-style.ts. Match the style of the existing pure modules (bash-filter.ts, widget.ts): a short header comment, export const / export function, tab indentation.

No imports at all — not pi, not TypeBox, not index.ts. The existing tests (bash-filter.test.ts, widget.test.ts) load pure modules with no node_modules, and this module must keep that property.

Exports (these names are a contract — later steps import them)

  • STE_RULE_CATEGORIES: readonly string[]
  • STE_EXEMPTIONS: readonly string[]
  • STE_SELF_CHECK: string
  • STE_CREDIT: string
  • buildSteStyleBlock(): string

STE_RULE_CATEGORIES — our own words, not the standard's

  1. Keep sentences short. Aim for about 20 words or fewer when you give an instruction. Aim for about 25 words or fewer when you describe something.
  2. Put one idea in each sentence.
  3. Use the active voice.
  4. Use simple tenses: past, present, future, and the imperative.
  5. Do not use an `-ing` verb form when a simple tense works.
  6. Use one word for one meaning. Do not trade between synonyms.
  7. Do not use a phrasal verb when one verb does the work.
  8. Keep a group of nouns to three words or fewer.
  9. Use short, common words.
  10. Keep the articles (`a`, `an`, `the`).

STE_EXEMPTIONS — three entries

  • Probing questions and the alternatives offered with them.
  • Code, file paths, identifiers, tool names, and commands.
  • Text quoted from the user.

Add one sentence stating that exempt text is left as it is and that everything else in a reply follows the rule categories.

STE_SELF_CHECK

Before you send a reply, read it once. Check the points above. Fix the sentences that break them. Then send the reply.

Place it last in the block.

STE_CREDIT (exact)

Response style follows ASD-STE100 Simplified Technical English (Issue 9, January 2025), a copyright and trademark of ASD, Brussels. Rules paraphrased. See https://www.asd-ste100.org.

buildSteStyleBlock()

Return the whole block as one string. Use a findable fence in the same spirit as the existing [GRILL ME EXTENSION ACTIVE] fence — for example open with [GRILL ME STE STYLE] and close with [/GRILL ME STE STYLE] — so later steps can count occurrences and a reviewer can find it. Include, in order: the rule categories as a bullet list, the exemptions, the sentence about exemption scope, the self-check, and the credit line.

The block must contain the credit line and the https://www.asd-ste100.org link, name all three exemptions, include the self-check, and never contain the phrase STE compliant.

Wiring into index.ts

  • Import buildSteStyleBlock from ./ste-style.ts (local imports in index.ts use the .ts suffix — match that).
  • In the before_agent_start handler, insert the returned block into the prompt string next to the existing Behavior: guidance. The block is additive: the Socratic Behavior lines stay.
  • Do not add a state field, a command, or a setting.

Acceptance Criteria

  • extensions/grillme/ste-style.ts exists, imports nothing, and exports STE_RULE_CATEGORIES, STE_EXEMPTIONS, STE_SELF_CHECK, STE_CREDIT, and buildSteStyleBlock().
  • buildSteStyleBlock() contains the ten rule categories, all three exemptions, the self-check, the credit line, and the https://www.asd-ste100.org link.
  • The block never contains the phrase STE compliant.
  • index.ts imports buildSteStyleBlock from ./ste-style.ts and calls it inside the before_agent_start prompt.
  • The existing Behavior: guidance is still in the prompt (the block is additive).
  • No new state field, command, or setting was added.
  • cd extensions/grillme && npm test passes (bash-filter.test.ts and widget.test.ts untouched and green).

Test Plan

cd extensions/grillme
npm test

Expected: all existing tests pass.

# the module must stay dependency-free
grep -n "^import\|require(" extensions/grillme/ste-style.ts

Expected: no output.

# exactly one import and one call site in index.ts
grep -c "buildSteStyleBlock" extensions/grillme/index.ts

Expected: 2.

Manual: start pi in this repo, run /grill a small topic, and confirm the session starts normally (the prompt now carries the style block).

## Summary Create `extensions/grillme/ste-style.ts` — a dependency-free module that owns the paraphrased ASD-STE100 (STE) style text, the exemption list, the self-check, and the credit line — and export `buildSteStyleBlock()`. Call it from the `before_agent_start` handler in `extensions/grillme/index.ts` so the style block applies for the whole session. ## Background The `grillme` extension lives in `extensions/grillme/`. Its entry point is `index.ts`, which builds the injected Grill Me prompt inline inside `pi.on("before_agent_start", ...)` and returns `{ systemPrompt: event.systemPrompt + prompt }`. That handler is not exported and cannot be tested, so the style text must live in a pure module. The style is **always on**: no toggle, no command, no persisted setting. Licensing constrains the text. `docs/adr/0001-grill-me-ste-response-style.md` records the decision: the official standard is free to download but **not free to redistribute**, and a personal pi extension is not in any of the eight reproduction-permitted categories. The extension therefore **paraphrases the rule categories in its own words**, credits the standard, and links it. Do **not** fetch, vendor, or paste the standard's rule text, dictionary entries, or excerpts, and do not create a `docs/reference/` folder for it. ## Implementation Details Create `extensions/grillme/ste-style.ts`. Match the style of the existing pure modules (`bash-filter.ts`, `widget.ts`): a short header comment, `export const` / `export function`, tab indentation. **No imports at all** — not pi, not TypeBox, not `index.ts`. The existing tests (`bash-filter.test.ts`, `widget.test.ts`) load pure modules with no `node_modules`, and this module must keep that property. ### Exports (these names are a contract — later steps import them) - `STE_RULE_CATEGORIES: readonly string[]` - `STE_EXEMPTIONS: readonly string[]` - `STE_SELF_CHECK: string` - `STE_CREDIT: string` - `buildSteStyleBlock(): string` ### `STE_RULE_CATEGORIES` — our own words, not the standard's 1. `Keep sentences short. Aim for about 20 words or fewer when you give an instruction. Aim for about 25 words or fewer when you describe something.` 2. `Put one idea in each sentence.` 3. `Use the active voice.` 4. `Use simple tenses: past, present, future, and the imperative.` 5. ``Do not use an `-ing` verb form when a simple tense works.`` 6. `Use one word for one meaning. Do not trade between synonyms.` 7. `Do not use a phrasal verb when one verb does the work.` 8. `Keep a group of nouns to three words or fewer.` 9. `Use short, common words.` 10. ``Keep the articles (`a`, `an`, `the`).`` ### `STE_EXEMPTIONS` — three entries - `Probing questions and the alternatives offered with them.` - `Code, file paths, identifiers, tool names, and commands.` - `Text quoted from the user.` Add one sentence stating that exempt text is left as it is and that everything else in a reply follows the rule categories. ### `STE_SELF_CHECK` `Before you send a reply, read it once. Check the points above. Fix the sentences that break them. Then send the reply.` Place it **last** in the block. ### `STE_CREDIT` (exact) `Response style follows ASD-STE100 Simplified Technical English (Issue 9, January 2025), a copyright and trademark of ASD, Brussels. Rules paraphrased. See https://www.asd-ste100.org.` ### `buildSteStyleBlock()` Return the whole block as one string. Use a findable fence in the same spirit as the existing `[GRILL ME EXTENSION ACTIVE]` fence — for example open with `[GRILL ME STE STYLE]` and close with `[/GRILL ME STE STYLE]` — so later steps can count occurrences and a reviewer can find it. Include, in order: the rule categories as a bullet list, the exemptions, the sentence about exemption scope, the self-check, and the credit line. The block must contain the credit line and the `https://www.asd-ste100.org` link, name all three exemptions, include the self-check, and **never** contain the phrase `STE compliant`. ### Wiring into `index.ts` - Import `buildSteStyleBlock` from `./ste-style.ts` (local imports in `index.ts` use the `.ts` suffix — match that). - In the `before_agent_start` handler, insert the returned block into the `prompt` string next to the existing `Behavior:` guidance. The block is **additive**: the Socratic `Behavior` lines stay. - Do not add a state field, a command, or a setting. ## Acceptance Criteria - [ ] `extensions/grillme/ste-style.ts` exists, imports nothing, and exports `STE_RULE_CATEGORIES`, `STE_EXEMPTIONS`, `STE_SELF_CHECK`, `STE_CREDIT`, and `buildSteStyleBlock()`. - [ ] `buildSteStyleBlock()` contains the ten rule categories, all three exemptions, the self-check, the credit line, and the `https://www.asd-ste100.org` link. - [ ] The block never contains the phrase `STE compliant`. - [ ] `index.ts` imports `buildSteStyleBlock` from `./ste-style.ts` and calls it inside the `before_agent_start` prompt. - [ ] The existing `Behavior:` guidance is still in the prompt (the block is additive). - [ ] No new state field, command, or setting was added. - [ ] `cd extensions/grillme && npm test` passes (`bash-filter.test.ts` and `widget.test.ts` untouched and green). ## Test Plan ```bash cd extensions/grillme npm test ``` Expected: all existing tests pass. ```bash # the module must stay dependency-free grep -n "^import\|require(" extensions/grillme/ste-style.ts ``` Expected: no output. ```bash # exactly one import and one call site in index.ts grep -c "buildSteStyleBlock" extensions/grillme/index.ts ``` Expected: `2`. Manual: start pi in this repo, run `/grill a small topic`, and confirm the session starts normally (the prompt now carries the style block).
david self-assigned this 2026-10-09 21:19:19 +00:00
david closed this issue 2026-10-09 21:36:32 +00:00
Author
Owner

pi-loop opened and merged a pull request for this issue: #301

pi-loop opened and merged a pull request for this issue: https://git.excelera.net/david/pi-extensions-and-skills/pulls/301
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
david/pi-extensions-and-skills#291
No description provided.