opencodekit 0.21.4 → 0.21.6

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 (32) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/AGENTS.md +55 -36
  3. package/dist/template/.opencode/agent/build.md +13 -3
  4. package/dist/template/.opencode/agent/explore.md +14 -0
  5. package/dist/template/.opencode/agent/general.md +13 -2
  6. package/dist/template/.opencode/agent/painter.md +9 -0
  7. package/dist/template/.opencode/agent/plan.md +26 -4
  8. package/dist/template/.opencode/agent/review.md +10 -0
  9. package/dist/template/.opencode/agent/scout.md +16 -1
  10. package/dist/template/.opencode/agent/vision.md +23 -0
  11. package/dist/template/.opencode/command/design.md +27 -8
  12. package/dist/template/.opencode/command/plan.md +22 -0
  13. package/dist/template/.opencode/command/ship.md +31 -5
  14. package/dist/template/.opencode/command/status.md +14 -5
  15. package/dist/template/.opencode/command/ui-review.md +38 -18
  16. package/dist/template/.opencode/command/ui-slop-check.md +30 -7
  17. package/dist/template/.opencode/command/verify.md +3 -0
  18. package/dist/template/.opencode/memory.db +0 -0
  19. package/dist/template/.opencode/memory.db-shm +0 -0
  20. package/dist/template/.opencode/memory.db-wal +0 -0
  21. package/dist/template/.opencode/plugin/copilot-auth.ts +66 -41
  22. package/dist/template/.opencode/plugin/sdk/copilot/chat/convert-to-openai-compatible-chat-messages.ts +162 -168
  23. package/dist/template/.opencode/plugin/sdk/copilot/chat/map-openai-compatible-finish-reason.ts +16 -16
  24. package/dist/template/.opencode/plugin/sdk/copilot/chat/openai-compatible-chat-language-model.ts +807 -805
  25. package/dist/template/.opencode/plugin/sdk/copilot/chat/openai-compatible-prepare-tools.ts +77 -77
  26. package/dist/template/.opencode/plugin/sdk/copilot/copilot-provider.ts +75 -80
  27. package/dist/template/.opencode/skill/playwright/SKILL.md +51 -2
  28. package/dist/template/.opencode/skill/portless/SKILL.md +109 -0
  29. package/dist/template/.opencode/skill/terse-output-mode/SKILL.md +95 -0
  30. package/dist/template/.opencode/skill/think-in-code/SKILL.md +136 -0
  31. package/dist/template/.opencode/skill/ux-quality-gates/SKILL.md +137 -0
  32. package/package.json +1 -1
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: think-in-code
3
+ description: Use when answering questions that require counting, filtering, parsing, joining, or summarizing data — write a small script that prints only the answer instead of reading large files into context. Saves 90%+ tokens vs raw reads. Adapted from context-mode (mksglu/context-mode).
4
+ version: 1.0.0
5
+ tags: [context, workflow]
6
+ dependencies: []
7
+ ---
8
+
9
+ # Think in Code
10
+
11
+ Compute answers with a small script. Don't drag raw data through context.
12
+
13
+ ## Core Principle
14
+
15
+ > The model's job is to think. The script's job is to count, parse, filter, join. Then `console.log` only the answer.
16
+
17
+ When you need a fact derived from data (logs, JSON, CSV, command output, file lists), the cheapest path is:
18
+
19
+ 1. Write 5–30 lines of code that produces the answer
20
+ 2. Run it
21
+ 3. Read **only** the printed answer
22
+
23
+ Reading the raw data into context first is almost always wrong.
24
+
25
+ ## When to Use
26
+
27
+ - Counting things in files / API output / logs ("how many failed runs in the last 100?")
28
+ - Filtering large lists ("which dependencies haven't been updated in 6 months?")
29
+ - Parsing structured output (`gh pr list --json`, `git log --pretty=...`, large JSON config)
30
+ - Joining data across sources ("which files in `git diff` also have failing tests?")
31
+ - Summarizing logs (top 10 error messages, error rate over time)
32
+ - Computing diffs/intersections between two lists
33
+
34
+ ## When NOT to Use
35
+
36
+ - The data is already small (<50 lines and you need most of it)
37
+ - You need to **read** the content for understanding, not extract a fact (e.g. reviewing a PR)
38
+ - The script itself would be longer than just reading the slice you need
39
+ - A single `grep -c` or `wc -l` already answers it — just run that
40
+
41
+ ## Quick Decision
42
+
43
+ | Situation | Approach |
44
+ | --------------------------------------- | ----------------------------------------------- |
45
+ | "How many X in Y?" | Script → `console.log(count)` |
46
+ | "Which Z match condition?" | Script → `console.log(matches.join('\n'))` |
47
+ | "Top N by metric?" | Script → `console.log(top.map(...).join('\n'))` |
48
+ | "What does this code do?" | Read the file |
49
+ | "What's broken in this 30-line config?" | Read the file |
50
+ | "Count errors in 2MB log" | Script — never `cat` it |
51
+
52
+ ## Patterns
53
+
54
+ ### Node one-liner (preferred for JSON / npm / fs work)
55
+
56
+ ```bash
57
+ node -e "
58
+ const fs = require('fs');
59
+ const data = JSON.parse(fs.readFileSync('package-lock.json', 'utf8'));
60
+ const deps = Object.keys(data.packages || {}).filter(k => k.startsWith('node_modules/'));
61
+ console.log('Total deps:', deps.length);
62
+ console.log('Unique top-level:', new Set(deps.map(d => d.split('/')[1])).size);
63
+ "
64
+ ```
65
+
66
+ ### Python one-liner (preferred for CSV / data crunching)
67
+
68
+ ```bash
69
+ python3 -c "
70
+ import csv, sys
71
+ with open('data.csv') as f:
72
+ rows = list(csv.DictReader(f))
73
+ errors = [r for r in rows if r['status'] == 'error']
74
+ print(f'errors: {len(errors)} / {len(rows)}')
75
+ print(f'top hosts:', sorted({r[\"host\"] for r in errors})[:5])
76
+ "
77
+ ```
78
+
79
+ ### Bash (only when output is guaranteed small)
80
+
81
+ ```bash
82
+ # OK — output is one number
83
+ git log --since='1 week ago' --oneline | wc -l
84
+
85
+ # OK — already filtered small
86
+ gh pr list --state open --json number,title --jq '.[] | select(.title | contains("fix")) | .number'
87
+
88
+ # NOT OK — dumps everything into context
89
+ cat huge-log.txt | grep ERROR
90
+ # Better:
91
+ grep -c ERROR huge-log.txt # if you only need the count
92
+ grep ERROR huge-log.txt | head -20 # if you need samples
93
+ ```
94
+
95
+ ### Save script to a file when it's reusable
96
+
97
+ ```bash
98
+ cat > /tmp/count-deps.js <<'EOF'
99
+ const fs = require('fs');
100
+ const lock = JSON.parse(fs.readFileSync(process.argv[2], 'utf8'));
101
+ const pkgs = Object.keys(lock.packages || {});
102
+ const stale = pkgs.filter(p => p.includes('node_modules/') && !p.includes('node_modules/.'));
103
+ console.log(JSON.stringify({ total: pkgs.length, packages: stale.length }, null, 2));
104
+ EOF
105
+ node /tmp/count-deps.js package-lock.json
106
+ ```
107
+
108
+ ## Anti-Patterns
109
+
110
+ | Anti-Pattern | Why It's Wrong | Do Instead |
111
+ | --------------------------------------------------------- | -------------------------------------------- | ------------------------------------------- |
112
+ | `cat huge.json` then "let me parse this in my head" | Pulls 100KB+ into context for one answer | `node -e "..."` to compute and print answer |
113
+ | `gh pr list --json ...` printing all fields | Dumps 50+ PRs of metadata you don't need | `--jq` to filter to just the field you want |
114
+ | `find . -name '*.ts'` to count files | Lists every path | `find . -name '*.ts' \| wc -l` |
115
+ | Reading 5 large logs to compare error rates | 5x context bloat for one comparison | Script that opens all 5 and prints summary |
116
+ | `curl https://api/...` raw piped to read | Whole response body in context | `curl ... \| jq '.field'` or save to file |
117
+ | Asking the model to "estimate" instead of running a count | Hallucination risk; counts are deterministic | Run the script |
118
+
119
+ ## Verification
120
+
121
+ Before considering an answer "done":
122
+
123
+ 1. The script ran without error
124
+ 2. The printed output is what you reasoned about (don't substitute memory for output)
125
+ 3. If the question was "how many", the script printed a number — not raw rows you then counted manually
126
+
127
+ ## Why This Skill Exists
128
+
129
+ Adapted from the **Think in Code** pillar of [context-mode](https://github.com/mksglu/context-mode). The original ships a sandboxed executor that _forces_ this pattern; we keep the discipline as a prompt-level skill so it works without bundling new infrastructure.
130
+
131
+ The savings compound: a single avoided 100KB read pays for many script iterations, and downstream summarization/handoff becomes cheaper too.
132
+
133
+ ## References
134
+
135
+ - context-mode: https://github.com/mksglu/context-mode
136
+ - Pairs with: `verification-before-completion`, `code-search-patterns`, `rtk-command-compression`
@@ -0,0 +1,137 @@
1
+ ---
2
+ name: ux-quality-gates
3
+ description: Use when designing, reviewing, planning, or shipping user-facing UI where UX correctness matters — applies information architecture, usability heuristics, forms, recovery, loading states, semantic HTML, and component consistency checks.
4
+ version: 1.0.0
5
+ tags: [ui, design, code-quality]
6
+ dependencies: []
7
+ ---
8
+
9
+ # UX Quality Gates
10
+
11
+ ## Overview
12
+
13
+ UX quality is not visual polish. A screen passes only when users can understand scope, complete the primary task, recover from errors, and use it with keyboard/screen reader support.
14
+
15
+ This skill consolidates high-signal UX review patterns into gates for `/design`, `/ui-review`, `/ui-slop-check`, `/plan`, and `/ship`.
16
+
17
+ ## When to Use
18
+
19
+ - Designing or reviewing user-facing components, pages, dashboards, forms, or flows.
20
+ - Planning UI PRDs that include loading, error, empty, success, destructive, or async states.
21
+ - Auditing changed UI files before shipping.
22
+ - Checking enterprise/data-heavy UIs with selection, bulk actions, filters, or tables.
23
+
24
+ ## When NOT to Use
25
+
26
+ - Backend-only work.
27
+ - Pure visual asset generation with no interaction or user flow.
28
+ - Trivial copy/color tweaks where no behavior, state, or structure changes.
29
+
30
+ ## Core Gates
31
+
32
+ | Gate | Pass Condition | Failure Signals |
33
+ | ------------------------ | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
34
+ | Information architecture | UI names match user vocabulary; scope and relationships are visible | Engineer terms, mixed synonyms, hidden side effects |
35
+ | Primary action | One dominant action per view/section | Multiple filled buttons, equal cancel/confirm, destructive action beside primary |
36
+ | Forms | Label, helper, validation, and error wiring are explicit | Placeholder-as-label, errors not associated, disabled submit hiding issues |
37
+ | Recovery | Every failure path offers retry, undo, fallback, or support | Dead-end errors, disappearing error toasts, no rollback for optimistic UI |
38
+ | State coverage | Empty/loading/error/success states exist and match final layout | Global spinner, mismatched skeleton, no no-results state |
39
+ | Accessibility | WCAG 2.2 AA baseline, keyboard path, focus, semantic HTML | No skip path, focus trap, unlabeled controls, ARIA replacing native HTML |
40
+ | Semantic web | Correct landmarks/headings/native controls; SEO only when page is indexable | Div buttons, multiple h1s, missing route focus/scroll handling |
41
+ | Component family | Shared token DNA across related components | One-off radius/color/height/shadow, inconsistent focus/error states |
42
+
43
+ ## Usability Heuristic Pass
44
+
45
+ Check every UI against these ten questions:
46
+
47
+ 1. **System status** — Does the UI show what is happening now?
48
+ 2. **Real-world language** — Does copy use user vocabulary, not implementation terms?
49
+ 3. **User control** — Can users cancel, undo, go back, or recover?
50
+ 4. **Consistency** — Are names, controls, and patterns reused consistently?
51
+ 5. **Error prevention** — Are dangerous or invalid actions prevented before they happen?
52
+ 6. **Recognition over recall** — Are options, context, and relationships visible?
53
+ 7. **Efficiency** — Are shortcuts or bulk actions available where volume requires them?
54
+ 8. **Minimalism** — Is each visible element serving the current task?
55
+ 9. **Error recovery** — Does error copy say what happened, why, and how to fix it?
56
+ 10. **Help** — Is guidance present where users may be stuck?
57
+
58
+ ## Pattern Rules
59
+
60
+ ### Destructive Actions
61
+
62
+ Require confirmation for permanent deletion, bulk destructive actions, permission/security changes, billing/account scope changes, and irreversible workflow transitions.
63
+
64
+ Confirmation anatomy:
65
+
66
+ - Title names the entity/action specifically.
67
+ - Body lists concrete consequences.
68
+ - Primary label is explicit, e.g. `Delete project`, not `OK` or `Yes`.
69
+ - Cancel is easy and default-focused.
70
+ - Highest-risk actions require typing the entity name.
71
+
72
+ Prefer undo for low-stakes reversible actions.
73
+
74
+ ### Forms
75
+
76
+ - Labels are always visible; placeholders are examples only.
77
+ - Helper text explains expected input or consequences.
78
+ - Validate on blur by default; use debounced real-time validation for complex fields.
79
+ - Submit catches all errors and moves focus/scroll to the first error.
80
+ - Use `aria-describedby`, `aria-invalid`, and `role="alert"` for errors.
81
+ - Required/optional marker shows the minority case.
82
+ - Use correct `type`, `autocomplete`, `fieldset`, and `legend`.
83
+ - Disable submit only for short forms where all validity is visible; otherwise allow submit and show errors.
84
+
85
+ ### Loading and Async States
86
+
87
+ | Wait | Pattern |
88
+ | ---- | -------------------------------------------- |
89
+ | <1s | Inline spinner or optimistic update |
90
+ | 1-3s | Skeleton matching final layout |
91
+ | >3s | Determinate/progressive status when possible |
92
+
93
+ - Button loading prevents duplicate submit without shifting layout.
94
+ - Skeletons are recessive and match final dimensions.
95
+ - Optimistic updates must have rollback.
96
+ - Error toasts persist until dismissed or replaced by a visible recovery path.
97
+
98
+ ### Notifications and Recovery
99
+
100
+ - Success toast: auto-dismiss after 4-6s unless action is needed.
101
+ - Error toast/banner: persists until resolved or dismissed.
102
+ - Toasts have at most one action.
103
+ - Inline errors live beside the affected control.
104
+ - Failed sections degrade locally instead of blanking the whole app.
105
+ - Transient failures get retry; repeated failures escalate to support or alternative path.
106
+
107
+ ### Data Display and Selection
108
+
109
+ Use for data-heavy UIs only:
110
+
111
+ - Offer grid/list/table only when each view changes task value.
112
+ - Persist view choice when useful.
113
+ - Selection supports row/card click, checkbox indicator, keyboard Space, and range selection where expected.
114
+ - Bulk action toolbar shows selected count.
115
+ - Destructive bulk actions name the count and scope.
116
+ - Distinguish filtered no-results from genuinely empty state.
117
+ - Tables may need sticky headers/first column, row actions, and resize/reorder for enterprise density.
118
+
119
+ ## Review Output
120
+
121
+ When reporting findings, include:
122
+
123
+ - Gate name.
124
+ - Severity: Critical, Warning, or Info.
125
+ - Location with `file:line` when reviewing code.
126
+ - User impact.
127
+ - Concrete fix.
128
+
129
+ ## Common Mistakes
130
+
131
+ | Mistake | Fix |
132
+ | --------------------------------------- | ---------------------------------------------------------------- |
133
+ | Treating UX as aesthetics | Check task completion, recovery, and state coverage first |
134
+ | Adding every UX rule to every task | Apply data/table/SEO rules only when relevant |
135
+ | Using ARIA to patch non-semantic markup | Prefer native elements, add ARIA only when semantics are missing |
136
+ | Making errors transient | Persistent errors need persistent recovery |
137
+ | Importing many overlapping skills | Use this consolidated gate and existing design/a11y skills |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencodekit",
3
- "version": "0.21.4",
3
+ "version": "0.21.6",
4
4
  "description": "CLI tool for bootstrapping and managing OpenCodeKit projects",
5
5
  "keywords": [
6
6
  "agents",