repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

refactor(the-system): keep format skills focused on formats

7917b1f46788e51a11a01827d10841a633b208db

Oliver Jan Krylow <oliver@bugabinga.net> ·

SSH signature · not checked

Browse filesCompare with HEAD

Changed files (6)

+42 / −26 text lines

Diff layout

extensions/the-system/README.md

Modified

+2 / −1 text lines

7979The extension exports no System skills or prompt templates statically.
8080Resource discovery always exposes the generic, manually invocable `vertical-slices` skill.
8181For valid initialized projects, it additionally exposes `the-system-gfm`, `the-system-tex`, and `the-system-mermaid`.
82Each format skill requires the injected System Markdown contract and an already-selected format, so syntax guidance cannot select a format, create bundles, or spill into unrelated projects.
82Format skills cover syntax and modeling; `/system` stage prompts select formats and govern System documents.
83Outside `/system` stages, format skills can also guide related work within a valid System project.
8384Projects initialized during a live session require `/reload` before those format skills become available.

extensions/the-system/__tests__/workflow-skills.test.ts

Modified

+29 / −4 text lines

22import { readFileSync } from "node:fs";
33import path from "node:path";
44import { describe, it } from "vitest";
5import { systemPromptFor } from "../system-prompts.ts";
67const root = path.resolve(import.meta.dirname, "..");
78const packageJson = () =>
3435 "utf8",
3536 );
3637 assert.match(skill, new RegExp(`name: ${name}`));
37 assert.match(
38 assert.match(skill, /description: Use when /);
39 assert.doesNotMatch(
3840 skill,
39 /current instructions contain The System Markdown contract/,
41 /Apply the active System contracts|create another System bundle|board state|stage progression/,
4042 );
41 assert.match(skill, /already been selected/);
4243 assert.doesNotMatch(
4344 skill.split("---", 3)[1] ?? "",
44 /bundle|create|author/,
45 /System Markdown contract|already been selected|bundle|create|author/,
4546 );
4647 }
4748 });
6869 assert.doesNotMatch(skill, /The System|\.system/);
6970 });
72 it("governs System document formats in each Markdown stage", () => {
73 for (const stage of [
74 "init",
75 "research",
76 "spec",
77 "spec-verify",
78 "phase",
79 "plan",
80 "issue",
81 ]) {
82 const prompt = systemPromptFor(stage, "");
83 assert.match(
84 prompt,
85 /Task lists contain only static checkable criteria and remain unchecked/,
86 );
87 assert.match(
88 prompt,
89 /Never diagram \/system stage progression or plan, spec, issue, or board progress/,
90 );
91 assert.match(prompt, /Replace or remove obsolete canonical text/);
92 assert.match(prompt, /use absolute HTTPS links for external sources/);
93 }
94 });
7196 it("keeps System instructions internal to the /system command", () => {
7297 const prompts = readFileSync(path.join(root, "system-prompts.ts"), "utf8");
7398 assert.match(prompts, /The System document contract/);

extensions/the-system/skills/the-system-gfm/SKILL.md

Modified

+2 / −10 text lines

11---
22name: the-system-gfm
3description: "Use only when current instructions contain The System Markdown contract and a GitHub Flavored Markdown (GFM) table, task list, footnote, autolink, or strikethrough has already been selected for the System document."
3description: Use when writing GFM tables, task lists, footnotes, links, or strikethrough.
44---
6# The System GFM
7
8Do not choose a rich format or create another System bundle.
9Apply the active System contracts first.
6# GFM
118## Tables
2421## Task lists
26Use task lists only for static checkable criteria, never progress or completion state.
27Keep criteria unchecked because `.system/board.json` owns operational state.
2923```markdown
3024- [ ] The invalid input is rejected.
3125- [ ] The rejection explains the violated rule.
4539## Links and strikethrough
4741Use descriptive links instead of bare autolinks.
48Keep local document and asset links relative; external sources use absolute HTTPS links.
49Do not use strikethrough to retain obsolete canonical text; replace or remove that text.
5143Prefer ordinary prose or lists when these extensions add no structure.

extensions/the-system/skills/the-system-mermaid/SKILL.md

Modified

+3 / −6 text lines

11---
22name: the-system-mermaid
3description: "Use only when current instructions contain The System Markdown contract and a Mermaid diagram has already been selected to explain structure, decisions, interactions, states, entities, cardinality, or conceptual type relationships in the System document."
3description: Use when modeling structure, decisions, interactions, states, entities, or relationships with Mermaid.
44---
6# The System Mermaid
6# Mermaid
8Do not choose a diagram or create another System bundle.
9Apply the active System contracts first.
108Use one model per `mermaid` fence and introduce its claim in prose.
11Never diagram `/system` stage progression or duplicate board state.
1310## Select the narrowest model
5148### State
5350Use `[*]` for start or terminal state and label meaningful transitions.
54Model domain behavior, never plan, spec, issue, or board progress.
51Model domain behavior.
5653```mermaid
5754stateDiagram-v2

extensions/the-system/skills/the-system-tex/SKILL.md

Modified

+2 / −4 text lines

11---
22name: the-system-tex
3description: "Use only when current instructions contain The System Markdown contract and TeX or LaTeX math has already been selected for an equation, formula, logical relation, set relation, or mathematical notation in the System document."
3description: Use when writing TeX or LaTeX equations and mathematical notation.
44---
6# The System TeX
6# TeX
8Do not choose math or create another System bundle.
9Apply the active System contracts first.
108The renderer accepts MathJax TeX input, not complete TeX or LaTeX documents.
1210## Delimiters

extensions/the-system/system-prompts.ts

Modified

+4 / −1 text lines

3838When content is a structure, flow, state machine, relation, comparison, or branch, select a format first, then load its matching the-system-* skill.
3939Mermaid models systems, GFM tables enumerate comparisons, TeX states formal relations, raw HTML mockups show visual or interactive surfaces.
4040Terse governs prose, not models; a diagram that replaces a paragraph is the terse form.
41Keep local Markdown links relative so /system view and /system book can resolve them.
41Keep local Markdown links relative so /system view and /system book can resolve them; use absolute HTTPS links for external sources.
42Task lists contain only static checkable criteria and remain unchecked; operational state belongs in .system/board.json.
43Never diagram /system stage progression or plan, spec, issue, or board progress.
44Replace or remove obsolete canonical text instead of retaining it with strikethrough.
4245System documents contain no real code snippets; use terse pseudocode only when essential.
4346`;