@chankov/agent-skills 0.1.0 → 0.2.0

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 (164) hide show
  1. package/.pi/extensions/agent-skills-update-check/README.md +58 -0
  2. package/.pi/extensions/agent-skills-update-check/index.ts +161 -0
  3. package/.pi/extensions/agent-skills-update-check/package.json +6 -0
  4. package/.versions/0.2.0/.claude/commands/build.md +18 -0
  5. package/.versions/0.2.0/.claude/commands/code-simplify.md +22 -0
  6. package/.versions/0.2.0/.claude/commands/design-agent.md +14 -0
  7. package/.versions/0.2.0/.claude/commands/doctor.md +13 -0
  8. package/.versions/0.2.0/.claude/commands/plan.md +16 -0
  9. package/.versions/0.2.0/.claude/commands/prime.md +22 -0
  10. package/.versions/0.2.0/.claude/commands/review.md +16 -0
  11. package/.versions/0.2.0/.claude/commands/setup.md +19 -0
  12. package/.versions/0.2.0/.claude/commands/ship.md +17 -0
  13. package/.versions/0.2.0/.claude/commands/spec.md +15 -0
  14. package/.versions/0.2.0/.claude/commands/test.md +19 -0
  15. package/.versions/0.2.0/.opencode/commands/as-build.md +17 -0
  16. package/.versions/0.2.0/.opencode/commands/as-code-simplify.md +16 -0
  17. package/.versions/0.2.0/.opencode/commands/as-design-agent.md +15 -0
  18. package/.versions/0.2.0/.opencode/commands/as-doctor.md +11 -0
  19. package/.versions/0.2.0/.opencode/commands/as-plan.md +16 -0
  20. package/.versions/0.2.0/.opencode/commands/as-prime.md +22 -0
  21. package/.versions/0.2.0/.opencode/commands/as-review.md +15 -0
  22. package/.versions/0.2.0/.opencode/commands/as-setup.md +11 -0
  23. package/.versions/0.2.0/.opencode/commands/as-ship.md +16 -0
  24. package/.versions/0.2.0/.opencode/commands/as-spec.md +16 -0
  25. package/.versions/0.2.0/.opencode/commands/as-test.md +21 -0
  26. package/.versions/0.2.0/.pi/agents/agent-chain.yaml +49 -0
  27. package/.versions/0.2.0/.pi/agents/bowser.md +19 -0
  28. package/.versions/0.2.0/.pi/agents/pi-pi/agent-expert.md +98 -0
  29. package/.versions/0.2.0/.pi/agents/pi-pi/cli-expert.md +41 -0
  30. package/.versions/0.2.0/.pi/agents/pi-pi/config-expert.md +63 -0
  31. package/.versions/0.2.0/.pi/agents/pi-pi/ext-expert.md +43 -0
  32. package/.versions/0.2.0/.pi/agents/pi-pi/keybinding-expert.md +134 -0
  33. package/.versions/0.2.0/.pi/agents/pi-pi/pi-orchestrator.md +57 -0
  34. package/.versions/0.2.0/.pi/agents/pi-pi/prompt-expert.md +70 -0
  35. package/.versions/0.2.0/.pi/agents/pi-pi/skill-expert.md +42 -0
  36. package/.versions/0.2.0/.pi/agents/pi-pi/theme-expert.md +40 -0
  37. package/.versions/0.2.0/.pi/agents/pi-pi/tui-expert.md +85 -0
  38. package/.versions/0.2.0/.pi/agents/teams.yaml +31 -0
  39. package/.versions/0.2.0/.pi/damage-control-rules.yaml +278 -0
  40. package/.versions/0.2.0/.pi/extensions/agent-skills-update-check/README.md +58 -0
  41. package/.versions/0.2.0/.pi/extensions/agent-skills-update-check/index.ts +161 -0
  42. package/.versions/0.2.0/.pi/extensions/agent-skills-update-check/package.json +6 -0
  43. package/.versions/0.2.0/.pi/extensions/chrome-devtools-mcp/README.md +39 -0
  44. package/.versions/0.2.0/.pi/extensions/chrome-devtools-mcp/index.ts +61 -0
  45. package/.versions/0.2.0/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  46. package/.versions/0.2.0/.pi/extensions/compact-and-continue/README.md +42 -0
  47. package/.versions/0.2.0/.pi/extensions/compact-and-continue/index.ts +120 -0
  48. package/.versions/0.2.0/.pi/extensions/compact-and-continue/package.json +6 -0
  49. package/.versions/0.2.0/.pi/extensions/mcp-bridge/README.md +46 -0
  50. package/.versions/0.2.0/.pi/extensions/mcp-bridge/index.ts +206 -0
  51. package/.versions/0.2.0/.pi/extensions/mcp-bridge/package.json +6 -0
  52. package/.versions/0.2.0/.pi/extensions/package-lock.json +1143 -0
  53. package/.versions/0.2.0/.pi/extensions/package.json +9 -0
  54. package/.versions/0.2.0/.pi/harnesses/agent-chain/README.md +37 -0
  55. package/.versions/0.2.0/.pi/harnesses/agent-chain/index.ts +795 -0
  56. package/.versions/0.2.0/.pi/harnesses/agent-chain/package.json +6 -0
  57. package/.versions/0.2.0/.pi/harnesses/agent-team/README.md +38 -0
  58. package/.versions/0.2.0/.pi/harnesses/agent-team/index.ts +732 -0
  59. package/.versions/0.2.0/.pi/harnesses/agent-team/package.json +6 -0
  60. package/.versions/0.2.0/.pi/harnesses/coms/README.md +36 -0
  61. package/.versions/0.2.0/.pi/harnesses/coms/index.ts +1595 -0
  62. package/.versions/0.2.0/.pi/harnesses/coms/package.json +6 -0
  63. package/.versions/0.2.0/.pi/harnesses/coms-net/README.md +46 -0
  64. package/.versions/0.2.0/.pi/harnesses/coms-net/index.ts +1637 -0
  65. package/.versions/0.2.0/.pi/harnesses/coms-net/package.json +6 -0
  66. package/.versions/0.2.0/.pi/harnesses/damage-control/README.md +38 -0
  67. package/.versions/0.2.0/.pi/harnesses/damage-control/index.ts +207 -0
  68. package/.versions/0.2.0/.pi/harnesses/damage-control/package.json +6 -0
  69. package/.versions/0.2.0/.pi/harnesses/damage-control-continue/README.md +37 -0
  70. package/.versions/0.2.0/.pi/harnesses/damage-control-continue/index.ts +234 -0
  71. package/.versions/0.2.0/.pi/harnesses/damage-control-continue/package.json +6 -0
  72. package/.versions/0.2.0/.pi/harnesses/minimal/README.md +27 -0
  73. package/.versions/0.2.0/.pi/harnesses/minimal/index.ts +32 -0
  74. package/.versions/0.2.0/.pi/harnesses/minimal/package.json +6 -0
  75. package/.versions/0.2.0/.pi/harnesses/package-lock.json +35 -0
  76. package/.versions/0.2.0/.pi/harnesses/package.json +9 -0
  77. package/.versions/0.2.0/.pi/harnesses/pi-pi/README.md +39 -0
  78. package/.versions/0.2.0/.pi/harnesses/pi-pi/index.ts +631 -0
  79. package/.versions/0.2.0/.pi/harnesses/pi-pi/package.json +6 -0
  80. package/.versions/0.2.0/.pi/harnesses/purpose-gate/README.md +27 -0
  81. package/.versions/0.2.0/.pi/harnesses/purpose-gate/index.ts +82 -0
  82. package/.versions/0.2.0/.pi/harnesses/purpose-gate/package.json +6 -0
  83. package/.versions/0.2.0/.pi/harnesses/session-replay/README.md +28 -0
  84. package/.versions/0.2.0/.pi/harnesses/session-replay/index.ts +214 -0
  85. package/.versions/0.2.0/.pi/harnesses/session-replay/package.json +6 -0
  86. package/.versions/0.2.0/.pi/harnesses/subagent-widget/README.md +36 -0
  87. package/.versions/0.2.0/.pi/harnesses/subagent-widget/index.ts +479 -0
  88. package/.versions/0.2.0/.pi/harnesses/subagent-widget/package.json +6 -0
  89. package/.versions/0.2.0/.pi/harnesses/system-select/README.md +39 -0
  90. package/.versions/0.2.0/.pi/harnesses/system-select/index.ts +165 -0
  91. package/.versions/0.2.0/.pi/harnesses/system-select/package.json +6 -0
  92. package/.versions/0.2.0/.pi/harnesses/tilldone/README.md +35 -0
  93. package/.versions/0.2.0/.pi/harnesses/tilldone/index.ts +724 -0
  94. package/.versions/0.2.0/.pi/harnesses/tilldone/package.json +6 -0
  95. package/.versions/0.2.0/.pi/harnesses/tool-counter/README.md +31 -0
  96. package/.versions/0.2.0/.pi/harnesses/tool-counter/index.ts +100 -0
  97. package/.versions/0.2.0/.pi/harnesses/tool-counter/package.json +6 -0
  98. package/.versions/0.2.0/.pi/harnesses/tool-counter-widget/README.md +27 -0
  99. package/.versions/0.2.0/.pi/harnesses/tool-counter-widget/index.ts +66 -0
  100. package/.versions/0.2.0/.pi/harnesses/tool-counter-widget/package.json +6 -0
  101. package/.versions/0.2.0/.pi/prompts/build.md +24 -0
  102. package/.versions/0.2.0/.pi/prompts/code-simplify.md +22 -0
  103. package/.versions/0.2.0/.pi/prompts/doctor.md +13 -0
  104. package/.versions/0.2.0/.pi/prompts/plan.md +16 -0
  105. package/.versions/0.2.0/.pi/prompts/review.md +16 -0
  106. package/.versions/0.2.0/.pi/prompts/setup.md +19 -0
  107. package/.versions/0.2.0/.pi/prompts/ship.md +17 -0
  108. package/.versions/0.2.0/.pi/prompts/spec.md +15 -0
  109. package/.versions/0.2.0/.pi/prompts/test.md +19 -0
  110. package/.versions/0.2.0/.pi/skills/bowser/SKILL.md +114 -0
  111. package/.versions/0.2.0/.version +1 -0
  112. package/.versions/0.2.0/agents/builder.md +6 -0
  113. package/.versions/0.2.0/agents/code-reviewer.md +93 -0
  114. package/.versions/0.2.0/agents/documenter.md +6 -0
  115. package/.versions/0.2.0/agents/plan-reviewer.md +22 -0
  116. package/.versions/0.2.0/agents/planner.md +6 -0
  117. package/.versions/0.2.0/agents/scout.md +6 -0
  118. package/.versions/0.2.0/agents/security-auditor.md +97 -0
  119. package/.versions/0.2.0/agents/test-engineer.md +89 -0
  120. package/.versions/0.2.0/hooks/SIMPLIFY-IGNORE.md +90 -0
  121. package/.versions/0.2.0/hooks/hooks.json +14 -0
  122. package/.versions/0.2.0/hooks/session-start.sh +74 -0
  123. package/.versions/0.2.0/hooks/simplify-ignore-test.sh +247 -0
  124. package/.versions/0.2.0/hooks/simplify-ignore.sh +302 -0
  125. package/.versions/0.2.0/references/accessibility-checklist.md +159 -0
  126. package/.versions/0.2.0/references/performance-checklist.md +121 -0
  127. package/.versions/0.2.0/references/prompting-patterns.md +380 -0
  128. package/.versions/0.2.0/references/security-checklist.md +134 -0
  129. package/.versions/0.2.0/references/testing-patterns.md +236 -0
  130. package/.versions/0.2.0/skills/api-and-interface-design/SKILL.md +294 -0
  131. package/.versions/0.2.0/skills/browser-testing-with-devtools/SKILL.md +335 -0
  132. package/.versions/0.2.0/skills/ci-cd-and-automation/SKILL.md +390 -0
  133. package/.versions/0.2.0/skills/code-review-and-quality/SKILL.md +347 -0
  134. package/.versions/0.2.0/skills/code-simplification/SKILL.md +331 -0
  135. package/.versions/0.2.0/skills/context-engineering/SKILL.md +291 -0
  136. package/.versions/0.2.0/skills/debugging-and-error-recovery/SKILL.md +300 -0
  137. package/.versions/0.2.0/skills/deprecation-and-migration/SKILL.md +206 -0
  138. package/.versions/0.2.0/skills/designing-agents/SKILL.md +394 -0
  139. package/.versions/0.2.0/skills/designing-agents/pi-harness-authoring.md +213 -0
  140. package/.versions/0.2.0/skills/documentation-and-adrs/SKILL.md +278 -0
  141. package/.versions/0.2.0/skills/frontend-ui-engineering/SKILL.md +322 -0
  142. package/.versions/0.2.0/skills/git-workflow-and-versioning/SKILL.md +316 -0
  143. package/.versions/0.2.0/skills/guided-workspace-setup/SKILL.md +293 -0
  144. package/.versions/0.2.0/skills/idea-refine/SKILL.md +178 -0
  145. package/.versions/0.2.0/skills/idea-refine/examples.md +238 -0
  146. package/.versions/0.2.0/skills/idea-refine/frameworks.md +99 -0
  147. package/.versions/0.2.0/skills/idea-refine/refinement-criteria.md +113 -0
  148. package/.versions/0.2.0/skills/idea-refine/scripts/idea-refine.sh +15 -0
  149. package/.versions/0.2.0/skills/incremental-implementation/SKILL.md +279 -0
  150. package/.versions/0.2.0/skills/performance-optimization/SKILL.md +350 -0
  151. package/.versions/0.2.0/skills/planning-and-task-breakdown/SKILL.md +237 -0
  152. package/.versions/0.2.0/skills/security-and-hardening/SKILL.md +349 -0
  153. package/.versions/0.2.0/skills/shipping-and-launch/SKILL.md +309 -0
  154. package/.versions/0.2.0/skills/source-driven-development/SKILL.md +194 -0
  155. package/.versions/0.2.0/skills/spec-driven-development/SKILL.md +237 -0
  156. package/.versions/0.2.0/skills/test-driven-development/SKILL.md +379 -0
  157. package/.versions/0.2.0/skills/using-agent-skills/SKILL.md +176 -0
  158. package/CHANGELOG.md +36 -0
  159. package/bin/cli.js +42 -7
  160. package/bin/lib/update-notifier.js +195 -0
  161. package/docs/npm-install.md +60 -0
  162. package/hooks/session-start.sh +66 -12
  163. package/package.json +1 -1
  164. package/skills/guided-workspace-setup/SKILL.md +1 -1
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: theme-expert
3
+ description: Pi themes expert — knows the JSON format, all 51 color tokens, vars system, hex/256-color values, hot reload, and theme distribution
4
+ tools: read,grep,find,ls,bash
5
+ ---
6
+ You are a themes expert for the Pi coding agent. You know EVERYTHING about creating and distributing Pi themes.
7
+
8
+ ## Your Expertise
9
+ - Theme JSON format with $schema, name, vars, colors sections
10
+ - All 51 required color tokens across 7 categories:
11
+ - Core UI (11): accent, border, borderAccent, borderMuted, success, error, warning, muted, dim, text, thinkingText
12
+ - Backgrounds & Content (11): selectedBg, userMessageBg, userMessageText, customMessageBg, customMessageText, customMessageLabel, toolPendingBg, toolSuccessBg, toolErrorBg, toolTitle, toolOutput
13
+ - Markdown (10): mdHeading, mdLink, mdLinkUrl, mdCode, mdCodeBlock, mdCodeBlockBorder, mdQuote, mdQuoteBorder, mdHr, mdListBullet
14
+ - Tool Diffs (3): toolDiffAdded, toolDiffRemoved, toolDiffContext
15
+ - Syntax Highlighting (9): syntaxComment, syntaxKeyword, syntaxFunction, syntaxVariable, syntaxString, syntaxNumber, syntaxType, syntaxOperator, syntaxPunctuation
16
+ - Thinking Borders (6): thinkingOff, thinkingMinimal, thinkingLow, thinkingMedium, thinkingHigh, thinkingXhigh
17
+ - Bash Mode (1): bashMode
18
+ - Optional HTML export section (pageBg, cardBg, infoBg)
19
+ - Color value formats: hex (#ff0000), 256-color index (0-255), variable reference, empty string for default
20
+ - vars system for reusable color definitions
21
+ - Theme locations: ~/.pi/agent/themes/, .pi/themes/
22
+ - Hot reload when editing active custom theme
23
+ - Selection via /settings or settings.json
24
+ - $schema URL for editor validation
25
+
26
+ ## CRITICAL: First Action
27
+ Before answering ANY question, you MUST fetch the latest Pi themes documentation:
28
+
29
+ ```bash
30
+ firecrawl scrape https://raw.githubusercontent.com/badlogic/pi-mono/refs/heads/main/packages/coding-agent/docs/themes.md -f markdown -o /tmp/pi-theme-docs.md || curl -sL https://raw.githubusercontent.com/badlogic/pi-mono/refs/heads/main/packages/coding-agent/docs/themes.md -o /tmp/pi-theme-docs.md
31
+ ```
32
+
33
+ Then read /tmp/pi-theme-docs.md to have the freshest reference. Also search the local codebase (.pi/themes/) for existing theme examples.
34
+
35
+ ## How to Respond
36
+ - Provide COMPLETE theme JSON with ALL 51 color tokens (no partial themes)
37
+ - Use vars for palette consistency
38
+ - Include the $schema for validation
39
+ - Suggest color harmonies based on the user's aesthetic preference
40
+ - Mention hot reload and testing tips
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: tui-expert
3
+ description: Pi TUI expert — knows all built-in components (Text, Box, Container, Markdown, Image, SelectList, SettingsList, BorderedLoader), custom components, overlays, keyboard input, widgets, footers, and custom editors
4
+ tools: read,grep,find,ls,bash
5
+ ---
6
+ You are a TUI (Terminal User Interface) expert for the Pi coding agent. You know EVERYTHING about building custom UI components and rendering.
7
+
8
+ ## Your Expertise
9
+
10
+ ### Component Interface
11
+ - render(width: number): string[] — lines must not exceed width
12
+ - handleInput?(data: string) — keyboard input when focused
13
+ - wantsKeyRelease? — for Kitty protocol key release events
14
+ - invalidate() — clear cached render state
15
+
16
+ ### Built-in Components (from @mariozechner/pi-tui)
17
+ - Text: multi-line text with word wrapping, paddingX, paddingY, background function
18
+ - Box: container with padding and background color
19
+ - Container: groups children vertically, addChild/removeChild
20
+ - Spacer: empty vertical space
21
+ - Markdown: renders markdown with syntax highlighting
22
+ - Image: renders images in supported terminals (Kitty, iTerm2, Ghostty, WezTerm)
23
+ - SelectList: selection dialog with theme, onSelect/onCancel
24
+ - SettingsList: toggle settings with theme
25
+
26
+ ### From @mariozechner/pi-coding-agent
27
+ - DynamicBorder: border with color function — ALWAYS type the param: (s: string) => theme.fg("accent", s)
28
+ - BorderedLoader: spinner with abort support
29
+ - CustomEditor: base class for custom editors (vim mode, etc.)
30
+
31
+ ### Keyboard Input
32
+ - matchesKey(data, Key.up/down/enter/escape/etc.)
33
+ - Key modifiers: Key.ctrl("c"), Key.shift("tab"), Key.alt("left"), Key.ctrlShift("p")
34
+ - String format: "enter", "ctrl+c", "shift+tab"
35
+
36
+ ### Width Utilities
37
+ - visibleWidth(str) — display width ignoring ANSI codes
38
+ - truncateToWidth(str, width, ellipsis?) — truncate with ellipsis
39
+ - wrapTextWithAnsi(str, width) — word wrap preserving ANSI codes
40
+
41
+ ### UI Patterns (copy-paste ready)
42
+ 1. Selection Dialog: SelectList + DynamicBorder + ctx.ui.custom()
43
+ 2. Async with Cancel: BorderedLoader with signal
44
+ 3. Settings/Toggles: SettingsList + getSettingsListTheme()
45
+ 4. Status Indicator: ctx.ui.setStatus(key, styledText)
46
+ 5. Widgets: ctx.ui.setWidget(key, lines | factory, { placement })
47
+ 6. Custom Footer: ctx.ui.setFooter(factory)
48
+ 7. Custom Editor: extend CustomEditor, ctx.ui.setEditorComponent(factory)
49
+ 8. Overlays: ctx.ui.custom(component, { overlay: true, overlayOptions })
50
+
51
+ ### Focusable Interface (IME Support)
52
+ - CURSOR_MARKER for hardware cursor positioning
53
+ - Container propagation for embedded inputs
54
+
55
+ ### Theming in Components
56
+ - theme.fg(color, text) for foreground
57
+ - theme.bg(color, text) for background
58
+ - theme.bold(text) for bold
59
+ - Invalidation pattern: rebuild themed content in invalidate()
60
+ - getMarkdownTheme() for Markdown components
61
+
62
+ ### Key Rules
63
+ 1. Always use theme from callback — not imported directly
64
+ 2. Always type DynamicBorder color param: (s: string) =>
65
+ 3. Call tui.requestRender() after state changes in handleInput
66
+ 4. Return { render, invalidate, handleInput } for custom components
67
+ 5. Use Text with padding (0, 0) — Box handles padding
68
+ 6. Cache rendered output with cachedWidth/cachedLines pattern
69
+
70
+ ## CRITICAL: First Action
71
+ Before answering ANY question, you MUST fetch the latest Pi TUI documentation:
72
+
73
+ ```bash
74
+ firecrawl scrape https://raw.githubusercontent.com/badlogic/pi-mono/refs/heads/main/packages/coding-agent/docs/tui.md -f markdown -o /tmp/pi-tui-docs.md || curl -sL https://raw.githubusercontent.com/badlogic/pi-mono/refs/heads/main/packages/coding-agent/docs/tui.md -o /tmp/pi-tui-docs.md
75
+ ```
76
+
77
+ Then read /tmp/pi-tui-docs.md to have the freshest reference. Also search the local codebase for existing TUI component examples in extensions/.
78
+
79
+ ## How to Respond
80
+ - Provide COMPLETE, WORKING component code
81
+ - Include all imports from @mariozechner/pi-tui and @mariozechner/pi-coding-agent
82
+ - Show the ctx.ui.custom() wrapper for interactive components
83
+ - Handle invalidation properly for theme changes
84
+ - Include keyboard input handling where relevant
85
+ - Show both the component class and the registration/usage code
@@ -0,0 +1,31 @@
1
+ full:
2
+ - scout
3
+ - planner
4
+ - builder
5
+ - code-reviewer
6
+ - documenter
7
+ - security-auditor
8
+
9
+ plan-build:
10
+ - planner
11
+ - builder
12
+ - code-reviewer
13
+
14
+ info:
15
+ - scout
16
+ - documenter
17
+ - code-reviewer
18
+
19
+ frontend:
20
+ - planner
21
+ - builder
22
+ - bowser
23
+
24
+ pi-pi:
25
+ - ext-expert
26
+ - theme-expert
27
+ - skill-expert
28
+ - config-expert
29
+ - tui-expert
30
+ - prompt-expert
31
+ - agent-expert
@@ -0,0 +1,278 @@
1
+ bashToolPatterns:
2
+ - pattern: '\brm\s+(-[^\s]*)*-[rRf]'
3
+ reason: rm with recursive or force flags
4
+ - pattern: '\brm\s+-[rRf]'
5
+ reason: rm with recursive or force flags
6
+ - pattern: '\brm\s+--recursive'
7
+ reason: rm with --recursive flag
8
+ - pattern: '\brm\s+--force'
9
+ reason: rm with --force flag
10
+ - pattern: '\bsudo\s+rm\b'
11
+ reason: sudo rm
12
+ - pattern: '\brmdir\s+--ignore-fail-on-non-empty'
13
+ reason: rmdir ignore-fail
14
+ - pattern: '\bchmod\s+(-[^\s]+\s+)*777\b'
15
+ reason: chmod 777 (world writable)
16
+ - pattern: '\bchmod\s+-[Rr].*777'
17
+ reason: recursive chmod 777
18
+ - pattern: '\bchown\s+-[Rr].*\broot\b'
19
+ reason: recursive chown to root
20
+ - pattern: '\bgit\s+reset\s+--hard\b'
21
+ reason: git reset --hard (use --soft or stash)
22
+ - pattern: '\bgit\s+clean\s+(-[^\s]*)*-[fd]'
23
+ reason: git clean with force/directory flags
24
+ - pattern: '\bgit\s+push\s+.*--force(?!-with-lease)'
25
+ reason: git push --force (use --force-with-lease)
26
+ - pattern: '\bgit\s+push\s+(-[^\s]*)*-f\b'
27
+ reason: git push -f (use --force-with-lease)
28
+ - pattern: '\bgit\s+stash\s+clear\b'
29
+ reason: git stash clear (deletes ALL stashes)
30
+ - pattern: '\bgit\s+reflog\s+expire\b'
31
+ reason: git reflog expire (destroys recovery mechanism)
32
+ - pattern: '\bgit\s+gc\s+.*--prune=now'
33
+ reason: git gc --prune=now (can lose dangling commits)
34
+ - pattern: '\bgit\s+filter-branch\b'
35
+ reason: git filter-branch (rewrites entire history)
36
+ - pattern: '\bgit\s+checkout\s+--\s*\.'
37
+ reason: Discards all uncommitted changes
38
+ ask: true
39
+ - pattern: '\bgit\s+restore\s+\.'
40
+ reason: Discards all uncommitted changes
41
+ ask: true
42
+ - pattern: '\bgit\s+stash\s+drop\b'
43
+ reason: Permanently deletes a stash
44
+ ask: true
45
+ - pattern: '\bgit\s+branch\s+(-[^\s]*)*-D'
46
+ reason: Force deletes branch (even if unmerged)
47
+ ask: true
48
+ - pattern: '\bgit\s+push\s+\S+\s+--delete\b'
49
+ reason: Deletes remote branch
50
+ ask: true
51
+ - pattern: '\bgit\s+push\s+\S+\s+:\S+'
52
+ reason: Deletes remote branch (old syntax)
53
+ ask: true
54
+ - pattern: '\bmkfs\.'
55
+ reason: filesystem format command
56
+ - pattern: '\bdd\s+.*of=/dev/'
57
+ reason: dd writing to device
58
+ - pattern: '\bkill\s+-9\s+-1\b'
59
+ reason: kill all processes
60
+ - pattern: '\bkillall\s+-9\b'
61
+ reason: killall -9
62
+ - pattern: '\bpkill\s+-9\b'
63
+ reason: pkill -9
64
+ - pattern: '\bhistory\s+-c\b'
65
+ reason: clearing shell history
66
+ - pattern: '\baws\s+s3\s+rm\s+.*--recursive'
67
+ reason: aws s3 rm --recursive (deletes all objects)
68
+ - pattern: '\baws\s+s3\s+rb\s+.*--force'
69
+ reason: aws s3 rb --force (force removes bucket)
70
+ - pattern: '\baws\s+ec2\s+terminate-instances\b'
71
+ reason: aws ec2 terminate-instances
72
+ - pattern: '\baws\s+rds\s+delete-db-instance\b'
73
+ reason: aws rds delete-db-instance
74
+ - pattern: '\baws\s+cloudformation\s+delete-stack\b'
75
+ reason: aws cloudformation delete-stack (deletes infrastructure)
76
+ - pattern: '\baws\s+dynamodb\s+delete-table\b'
77
+ reason: aws dynamodb delete-table
78
+ - pattern: '\baws\s+eks\s+delete-cluster\b'
79
+ reason: aws eks delete-cluster
80
+ - pattern: '\baws\s+lambda\s+delete-function\b'
81
+ reason: aws lambda delete-function
82
+ - pattern: '\baws\s+iam\s+delete-role\b'
83
+ reason: aws iam delete-role
84
+ - pattern: '\baws\s+iam\s+delete-user\b'
85
+ reason: aws iam delete-user
86
+ - pattern: '\bgcloud\s+projects\s+delete\b'
87
+ reason: gcloud projects delete (DELETES ENTIRE PROJECT)
88
+ - pattern: '\bgcloud\s+compute\s+instances\s+delete\b'
89
+ reason: gcloud compute instances delete
90
+ - pattern: '\bgcloud\s+sql\s+instances\s+delete\b'
91
+ reason: gcloud sql instances delete
92
+ - pattern: '\bgcloud\s+container\s+clusters\s+delete\b'
93
+ reason: gcloud container clusters delete (GKE)
94
+ - pattern: '\bgcloud\s+storage\s+rm\s+.*-r'
95
+ reason: gcloud storage rm -r (recursive delete)
96
+ - pattern: '\bgcloud\s+functions\s+delete\b'
97
+ reason: gcloud functions delete
98
+ - pattern: '\bgcloud\s+iam\s+service-accounts\s+delete\b'
99
+ reason: gcloud iam service-accounts delete
100
+ - pattern: '\bgcloud\s+run\s+services\s+delete\b'
101
+ reason: gcloud run services delete (deletes Cloud Run service)
102
+ - pattern: '\bgcloud\s+run\s+jobs\s+delete\b'
103
+ reason: gcloud run jobs delete (deletes Cloud Run job)
104
+ - pattern: '\bgcloud\s+services\s+disable\b'
105
+ reason: gcloud services disable (disables GCP APIs)
106
+ - pattern: '\bgcloud\s+iam\s+roles\s+delete\b'
107
+ reason: gcloud iam roles delete (deletes IAM role)
108
+ - pattern: '\bgcloud\s+iam\s+policies\b'
109
+ reason: gcloud iam policies (modifies IAM policies)
110
+ ask: true
111
+ - pattern: '\bfirebase\s+projects:delete\b'
112
+ reason: firebase projects:delete (deletes entire project)
113
+ - pattern: '\bfirebase\s+firestore:delete\s+.*--all-collections'
114
+ reason: firebase firestore:delete --all-collections (wipes all data)
115
+ - pattern: '\bfirebase\s+database:remove\b'
116
+ reason: firebase database:remove (wipes Realtime DB)
117
+ - pattern: '\bfirebase\s+hosting:disable\b'
118
+ reason: firebase hosting:disable
119
+ - pattern: '\bfirebase\s+functions:delete\b'
120
+ reason: firebase functions:delete
121
+ - pattern: '\bvercel\s+remove\s+.*--yes'
122
+ reason: vercel remove --yes (removes deployment)
123
+ - pattern: '\bvercel\s+projects\s+rm\b'
124
+ reason: vercel projects rm (deletes project)
125
+ - pattern: '\bvercel\s+env\s+rm\b'
126
+ reason: vercel env rm (removes env variables)
127
+ - pattern: '\bvercel\s+rm\b'
128
+ reason: vercel rm (removes deployment)
129
+ - pattern: '\bvercel\s+remove\b'
130
+ reason: vercel remove (removes deployment)
131
+ - pattern: '\bvercel\s+domains\s+rm\b'
132
+ reason: vercel domains rm (removes custom domain)
133
+ - pattern: '\bnetlify\s+sites:delete\b'
134
+ reason: netlify sites:delete (deletes entire site)
135
+ - pattern: '\bnetlify\s+functions:delete\b'
136
+ reason: netlify functions:delete
137
+ - pattern: '\bwrangler\s+delete\b'
138
+ reason: wrangler delete (deletes Worker)
139
+ - pattern: '\bwrangler\s+r2\s+bucket\s+delete\b'
140
+ reason: wrangler r2 bucket delete
141
+ - pattern: '\bwrangler\s+kv:namespace\s+delete\b'
142
+ reason: wrangler kv:namespace delete
143
+ - pattern: '\bwrangler\s+d1\s+delete\b'
144
+ reason: wrangler d1 delete (deletes database)
145
+ - pattern: '\bwrangler\s+queues\s+delete\b'
146
+ reason: wrangler queues delete
147
+ - pattern: 'DELETE\s+FROM\s+\w+\s*;'
148
+ reason: DELETE without WHERE clause (will delete ALL rows)
149
+ - pattern: 'DELETE\s+\*\s+FROM'
150
+ reason: DELETE * (will delete ALL rows)
151
+ - pattern: '\bTRUNCATE\s+TABLE\b'
152
+ reason: TRUNCATE TABLE (will delete ALL rows)
153
+ - pattern: '\bDROP\s+TABLE\b'
154
+ reason: DROP TABLE
155
+ - pattern: '\bDROP\s+DATABASE\b'
156
+ reason: DROP DATABASE
157
+ - pattern: '\bDROP\s+SCHEMA\b'
158
+ reason: DROP SCHEMA
159
+ - pattern: '\bDELETE\s+FROM\s+\w+\s+WHERE\b.*\bid\s*='
160
+ reason: SQL DELETE with specific ID
161
+ ask: true
162
+
163
+ zeroAccessPaths:
164
+ - ".env"
165
+ - ".env.local"
166
+ - ".env.development"
167
+ - ".env.production"
168
+ - ".env.staging"
169
+ - ".env.test"
170
+ - ".env.*.local"
171
+ - "*.env"
172
+ - "~/.ssh/"
173
+ - "~/.gnupg/"
174
+ - "~/.aws/"
175
+ - "~/.config/gcloud/"
176
+ - "*-credentials.json"
177
+ - "*serviceAccount*.json"
178
+ - "*service-account*.json"
179
+ - "~/.azure/"
180
+ - "~/.kube/"
181
+ - "kubeconfig"
182
+ - "*-secret.yaml"
183
+ - "secrets.yaml"
184
+ - "~/.docker/"
185
+ - "*.pem"
186
+ - "*.key"
187
+ - "*.p12"
188
+ - "*.pfx"
189
+ - "*.tfstate"
190
+ - "*.tfstate.backup"
191
+ - ".terraform/"
192
+ - ".vercel/"
193
+ - ".netlify/"
194
+ - "firebase-adminsdk*.json"
195
+ - "serviceAccountKey.json"
196
+ - ".supabase/"
197
+ - "~/.netrc"
198
+ - "~/.npmrc"
199
+ - "~/.pypirc"
200
+ - "~/.git-credentials"
201
+ - ".git-credentials"
202
+ - "dump.sql"
203
+ - "backup.sql"
204
+ - "*.dump"
205
+
206
+ readOnlyPaths:
207
+ - /etc/
208
+ - /usr/
209
+ - /bin/
210
+ - /sbin/
211
+ - /boot/
212
+ - /root/
213
+ - ~/.bash_history
214
+ - ~/.zsh_history
215
+ - ~/.node_repl_history
216
+ - ~/.bashrc
217
+ - ~/.zshrc
218
+ - ~/.profile
219
+ - ~/.bash_profile
220
+ - "package-lock.json"
221
+ - "yarn.lock"
222
+ - "pnpm-lock.yaml"
223
+ - "Gemfile.lock"
224
+ - "poetry.lock"
225
+ - "Pipfile.lock"
226
+ - "composer.lock"
227
+ - "Cargo.lock"
228
+ - "go.sum"
229
+ - "flake.lock"
230
+ - "bun.lockb"
231
+ - "uv.lock"
232
+ - "npm-shrinkwrap.json"
233
+ - "*.lock"
234
+ - "*.lockb"
235
+ - "*.min.js"
236
+ - "*.min.css"
237
+ - "*.bundle.js"
238
+ - "*.chunk.js"
239
+ - dist/
240
+ - build/
241
+ - .next/
242
+ - .nuxt/
243
+ - .output/
244
+ - __pycache__/
245
+ - .venv/
246
+ - venv/
247
+ - target/
248
+
249
+ noDeletePaths:
250
+ - ~/.claude/
251
+ - CLAUDE.md
252
+ - "LICENSE"
253
+ - "LICENSE.*"
254
+ - "COPYING"
255
+ - "COPYING.*"
256
+ - "NOTICE"
257
+ - "PATENTS"
258
+ - "README.md"
259
+ - "README.*"
260
+ - "CONTRIBUTING.md"
261
+ - "CHANGELOG.md"
262
+ - "CODE_OF_CONDUCT.md"
263
+ - "SECURITY.md"
264
+ - .git/
265
+ - .gitignore
266
+ - .gitattributes
267
+ - .gitmodules
268
+ - .github/
269
+ - .gitlab-ci.yml
270
+ - .circleci/
271
+ - Jenkinsfile
272
+ - .travis.yml
273
+ - azure-pipelines.yml
274
+ - Dockerfile
275
+ - "Dockerfile.*"
276
+ - docker-compose.yml
277
+ - "docker-compose.*.yml"
278
+ - .dockerignore
@@ -0,0 +1,58 @@
1
+ # agent-skills-update-check
2
+
3
+ A pi extension that surfaces an "update available" banner once per session when `@chankov/agent-skills` has a newer published version than the one recorded in `.ai/agent-skills-setup.md`.
4
+
5
+ ## What it does
6
+
7
+ On the first `agent_start` event of a pi session, the extension:
8
+
9
+ 1. Reads `version:` from `.ai/agent-skills-setup.md` in the current working directory. If the record is missing (workspace was never set up via `/setup`), the check is skipped.
10
+ 2. Reads the cached latest version from `$XDG_CACHE_HOME/agent-skills/latest-version.json` (falling back to `~/.cache/agent-skills/`).
11
+ 3. If the cache is older than 24 hours or absent, fetches the latest version from the npm registry with a 3-second timeout.
12
+ 4. If the published version is greater than the recorded version, emits an `info`-level notification via `ctx.ui.notify`.
13
+
14
+ The check runs **once per session** and is bounded to a single network call. It shares its cache file with the CLI update-notifier so the two never double-fetch.
15
+
16
+ ## When the banner fires
17
+
18
+ ```
19
+ agent-skills update available: 0.1.0 → 0.2.0. Run "npx @chankov/agent-skills@latest update" then /setup to apply.
20
+ ```
21
+
22
+ The banner appears in pi's UI notification area — the same surface used by other extensions for non-fatal status. It does not block, prompt, or modify any file. The user decides when to act on it.
23
+
24
+ ## When the banner does NOT fire
25
+
26
+ - The workspace has no `.ai/agent-skills-setup.md` install record.
27
+ - The published version equals or is older than the recorded version.
28
+ - The cache shows the published version is current (≤24h since last fetch).
29
+ - The registry is unreachable, returns non-200, or times out.
30
+ - `AGENT_SKILLS_NO_UPDATE_CHECK=1`, `NO_UPDATE_NOTIFIER=1`, or `CI=true` is set in the environment.
31
+
32
+ Every error path silently aborts. Update checks must never disrupt a session.
33
+
34
+ ## Install
35
+
36
+ Installed via `/setup` as part of Group 10 — pi extensions. Or symlink manually:
37
+
38
+ ```bash
39
+ ln -s /path/to/@chankov/agent-skills/.pi/extensions/agent-skills-update-check \
40
+ .pi/extensions/agent-skills-update-check
41
+ ```
42
+
43
+ No runtime deps beyond pi's own `@mariozechner/pi-coding-agent` types and Node built-ins (`fs`, `os`, `path`, `https`).
44
+
45
+ ## Opt-out
46
+
47
+ The check honours three environment variables (any of them disables it):
48
+
49
+ - `AGENT_SKILLS_NO_UPDATE_CHECK=1` — agent-skills-specific opt-out
50
+ - `NO_UPDATE_NOTIFIER=1` — the conventional opt-out used by many CLI tools
51
+ - `CI=true` — auto-disabled in CI so the banner never spams build logs
52
+
53
+ ## Behavior notes
54
+
55
+ - The check runs once per pi session; restarting pi triggers a new check.
56
+ - The cache file is shared with the CLI (`agent-skills check-update`) so both update paths benefit from a single fetch per 24h window.
57
+ - If the install record is *pre-versioning* (no `version:` line), the check is skipped — there's no recorded baseline to compare against. Run `/setup` once to stamp the current version.
58
+ - The extension only reads; it never writes the install record itself.
@@ -0,0 +1,161 @@
1
+ // agent-skills-update-check — pi extension that surfaces an "update available"
2
+ // banner once per session when @chankov/agent-skills has a newer published
3
+ // version than the one recorded in .ai/agent-skills-setup.md.
4
+ //
5
+ // Design constraints:
6
+ // - Never blocks pi startup. The check runs once on the first agent_start
7
+ // event with a soft 3s timeout.
8
+ // - Shares the same XDG cache file as the CLI (~/.cache/agent-skills/
9
+ // latest-version.json) so the CLI and pi don't double-fetch.
10
+ // - Honors AGENT_SKILLS_NO_UPDATE_CHECK / NO_UPDATE_NOTIFIER / CI opt-outs.
11
+ // - Network errors, missing record files, and missing node-fetch all fall
12
+ // through to "do nothing" — never an error notification.
13
+
14
+ import type { ExtensionAPI, ExtensionContext } from '@mariozechner/pi-coding-agent';
15
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
16
+ import { homedir } from 'node:os';
17
+ import { join } from 'node:path';
18
+ import { request } from 'node:https';
19
+
20
+ const PACKAGE_NAME = '@chankov/agent-skills';
21
+ const REGISTRY = 'https://registry.npmjs.org';
22
+ const CACHE_TTL_MS = 24 * 60 * 60 * 1000;
23
+ const FETCH_TIMEOUT_MS = 3000;
24
+
25
+ const CACHE_DIR = join(
26
+ process.env.XDG_CACHE_HOME || join(homedir(), '.cache'),
27
+ 'agent-skills',
28
+ );
29
+ const CACHE_FILE = join(CACHE_DIR, 'latest-version.json');
30
+
31
+ interface CachePayload {
32
+ latest: string;
33
+ checkedAt: number;
34
+ }
35
+
36
+ export default function updateCheckExtension(pi: ExtensionAPI) {
37
+ let checked = false;
38
+
39
+ pi.on('agent_start', async (_event, ctx) => {
40
+ if (checked) return;
41
+ checked = true;
42
+
43
+ try {
44
+ await runCheck(ctx);
45
+ } catch {
46
+ // Update checks must never disrupt a session — swallow everything.
47
+ }
48
+ });
49
+ }
50
+
51
+ async function runCheck(ctx: ExtensionContext): Promise<void> {
52
+ if (isDisabled()) return;
53
+
54
+ const recorded = readRecordedVersion();
55
+ if (!recorded) return; // workspace was never set up via /setup — nothing to compare
56
+
57
+ let latest = readCacheFresh();
58
+ if (!latest) {
59
+ latest = await fetchLatest(FETCH_TIMEOUT_MS);
60
+ if (latest) writeCache({ latest, checkedAt: Date.now() });
61
+ }
62
+ if (!latest) return;
63
+
64
+ if (!isGreater(latest, recorded)) return;
65
+
66
+ ctx.ui.notify(
67
+ `agent-skills update available: ${recorded} → ${latest}. ` +
68
+ `Run "npx ${PACKAGE_NAME}@latest update" then /setup to apply.`,
69
+ 'info',
70
+ );
71
+ }
72
+
73
+ // ── Helpers ──────────────────────────────────────────────────────────────
74
+
75
+ function isDisabled(): boolean {
76
+ return process.env.AGENT_SKILLS_NO_UPDATE_CHECK === '1'
77
+ || process.env.NO_UPDATE_NOTIFIER === '1'
78
+ || process.env.CI === 'true';
79
+ }
80
+
81
+ function readRecordedVersion(): string | null {
82
+ // pi runs from the workspace root; the install record lives at .ai/...
83
+ const recordPath = join(process.cwd(), '.ai', 'agent-skills-setup.md');
84
+ if (!existsSync(recordPath)) return null;
85
+ try {
86
+ const text = readFileSync(recordPath, 'utf8');
87
+ const m = text.match(/^version:\s*([^\s#]+)/m);
88
+ return m ? m[1].trim() : null;
89
+ } catch {
90
+ return null;
91
+ }
92
+ }
93
+
94
+ function readCacheFresh(): string | null {
95
+ try {
96
+ if (!existsSync(CACHE_FILE)) return null;
97
+ const payload = JSON.parse(readFileSync(CACHE_FILE, 'utf8')) as CachePayload;
98
+ if (Date.now() - payload.checkedAt >= CACHE_TTL_MS) return null;
99
+ return payload.latest;
100
+ } catch {
101
+ return null;
102
+ }
103
+ }
104
+
105
+ function writeCache(payload: CachePayload): void {
106
+ try {
107
+ mkdirSync(CACHE_DIR, { recursive: true });
108
+ writeFileSync(CACHE_FILE, JSON.stringify(payload, null, 2), 'utf8');
109
+ } catch {
110
+ // Cache write failed — fine, we'll re-fetch next session.
111
+ }
112
+ }
113
+
114
+ function fetchLatest(timeoutMs: number): Promise<string | null> {
115
+ return new Promise((resolve) => {
116
+ const url = `${REGISTRY}/${encodeURIComponent(PACKAGE_NAME).replace('%40', '@')}/latest`;
117
+ const req = request(
118
+ url,
119
+ { method: 'GET', headers: { accept: 'application/json' } },
120
+ (res) => {
121
+ if (res.statusCode !== 200) {
122
+ res.resume();
123
+ resolve(null);
124
+ return;
125
+ }
126
+ let body = '';
127
+ res.setEncoding('utf8');
128
+ res.on('data', (chunk) => { body += chunk; });
129
+ res.on('end', () => {
130
+ try {
131
+ const parsed = JSON.parse(body);
132
+ resolve(typeof parsed.version === 'string' ? parsed.version : null);
133
+ } catch {
134
+ resolve(null);
135
+ }
136
+ });
137
+ },
138
+ );
139
+ req.on('error', () => resolve(null));
140
+ req.setTimeout(timeoutMs, () => {
141
+ req.destroy();
142
+ resolve(null);
143
+ });
144
+ req.end();
145
+ });
146
+ }
147
+
148
+ function isGreater(a: string, b: string): boolean {
149
+ const [aMain, aPre = ''] = a.split('-', 2);
150
+ const [bMain, bPre = ''] = b.split('-', 2);
151
+ const aParts = aMain.split('.').map(Number);
152
+ const bParts = bMain.split('.').map(Number);
153
+ for (let i = 0; i < 3; i++) {
154
+ const ai = aParts[i] ?? 0;
155
+ const bi = bParts[i] ?? 0;
156
+ if (ai !== bi) return ai > bi;
157
+ }
158
+ if (!aPre && bPre) return true;
159
+ if (aPre && !bPre) return false;
160
+ return aPre > bPre;
161
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "agent-skills-pi-update-check",
3
+ "private": true,
4
+ "type": "module",
5
+ "main": "index.ts"
6
+ }