minimal-vibe-coding-kit 0.4.0 → 0.4.2

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 (96) hide show
  1. package/.agents/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +28 -3
  2. package/.agents/skills/coding-level/SKILL.md +8 -1
  3. package/.agents/skills/path-sensitive-shell-safety/SKILL.md +1 -0
  4. package/.agents/skills/prompt-sharpener/SKILL.md +54 -0
  5. package/.agents/skills/vibekit-init/SKILL.md +2 -2
  6. package/.claude/rules/safe-delete.md +11 -0
  7. package/.claude/settings.json +10 -3
  8. package/.claude/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +28 -3
  9. package/.claude/skills/coding-level/SKILL.md +8 -1
  10. package/.claude/skills/path-sensitive-shell-safety/SKILL.md +1 -0
  11. package/.claude/skills/prompt-sharpener/SKILL.md +54 -0
  12. package/.claude/skills/vibekit-init/SKILL.md +2 -2
  13. package/.codex/rules/vibekit.rules +77 -0
  14. package/.codex-plugin/plugin.json +1 -1
  15. package/.cursor/cli.json +18 -0
  16. package/.cursor/rules/040-safe-delete.mdc +16 -0
  17. package/.cursor/settings.json +15 -8
  18. package/.cursor/skills/coding-level/SKILL.md +8 -1
  19. package/.cursor/skills/path-sensitive-shell-safety/SKILL.md +1 -0
  20. package/.cursor/skills/prompt-sharpener/SKILL.md +54 -0
  21. package/.grok/README.md +13 -0
  22. package/.grok/config.example.toml +13 -0
  23. package/.grok/config.toml +29 -0
  24. package/.grok/rules/safe-delete.md +11 -0
  25. package/.grok/rules/security.md +5 -0
  26. package/.grok/rules/vibe-core.md +8 -0
  27. package/.grok/skills/agentshield-security-review/SKILL.md +75 -0
  28. package/.grok/skills/agentshield-security-review/agents/openai.yaml +5 -0
  29. package/.grok/skills/agentshield-security-review/references/native-install.md +97 -0
  30. package/.grok/skills/agentshield-security-review/references/report-template.md +54 -0
  31. package/.grok/skills/agentshield-security-review/references/review-checklist.md +45 -0
  32. package/.grok/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +135 -0
  33. package/.grok/skills/autoresearch-coding/README.md +15 -0
  34. package/.grok/skills/autoresearch-coding/SKILL.md +101 -0
  35. package/.grok/skills/autoresearch-coding/references/experiment-contract.md +13 -0
  36. package/.grok/skills/autoresearch-coding/references/metric-extraction.md +8 -0
  37. package/.grok/skills/autoresearch-coding/references/result-ledger.md +15 -0
  38. package/.grok/skills/autoresearch-coding/scripts/log_result.py +24 -0
  39. package/.grok/skills/autoresearch-coding/scripts/run_logged.py +30 -0
  40. package/.grok/skills/clearthought/SKILL.md +100 -0
  41. package/.grok/skills/clearthought/examples/decision-framework.md +441 -0
  42. package/.grok/skills/clearthought/examples/metagame-examples.md +536 -0
  43. package/.grok/skills/clearthought/examples/sequential-thinking.md +380 -0
  44. package/.grok/skills/clearthought/references/output-schemas.md +494 -0
  45. package/.grok/skills/clearthought/references/parameter-reference.md +482 -0
  46. package/.grok/skills/coding-level/SKILL.md +34 -0
  47. package/.grok/skills/coding-level/references/level-0.md +131 -0
  48. package/.grok/skills/coding-level/references/level-1.md +118 -0
  49. package/.grok/skills/coding-level/references/level-2.md +140 -0
  50. package/.grok/skills/coding-level/references/level-3.md +142 -0
  51. package/.grok/skills/coding-level/references/level-4.md +152 -0
  52. package/.grok/skills/coding-level/references/level-5.md +84 -0
  53. package/.grok/skills/daily-workflow-curator/SKILL.md +52 -0
  54. package/.grok/skills/memento/SKILL.md +36 -0
  55. package/.grok/skills/parallel-analysis/SKILL.md +160 -0
  56. package/.grok/skills/path-sensitive-shell-safety/SKILL.md +69 -0
  57. package/.grok/skills/path-sensitive-shell-safety/references/workflow.md +127 -0
  58. package/.grok/skills/prompt-sharpener/SKILL.md +54 -0
  59. package/.grok/skills/reviewing-4p-priorities/SKILL.md +72 -0
  60. package/.grok/skills/reviewing-4p-priorities/examples.md +298 -0
  61. package/.grok/skills/sequential-thinking/SKILL.md +106 -0
  62. package/.grok/skills/sequential-thinking/examples/adaptive-depth.md +542 -0
  63. package/.grok/skills/sequential-thinking/examples/branching-exploration.md +474 -0
  64. package/.grok/skills/sequential-thinking/examples/linear-reasoning.md +210 -0
  65. package/.grok/skills/sequential-thinking/examples/revision-pattern.md +304 -0
  66. package/.grok/skills/sequential-thinking/references/output-schema.md +483 -0
  67. package/.grok/skills/sequential-thinking/references/parameters.md +463 -0
  68. package/.grok/skills/sequential-thinking/references/patterns.md +666 -0
  69. package/.grok/skills/vibekit-init/SKILL.md +52 -0
  70. package/.grok/skills/visual-design-loop/SKILL.md +103 -0
  71. package/.grok/skills/visual-design-loop/agents/openai.yaml +4 -0
  72. package/.vibekit/docs/BACKBONE_REFERENCE.md +1 -1
  73. package/.vibekit/docs/INSTALL.md +21 -7
  74. package/.vibekit/docs/SECURITY_MODEL.md +1 -1
  75. package/.vibekit/docs/TOOLING_GUIDE.md +5 -0
  76. package/.vibekit/docs/templates/CONTEXT_TEMPLATE.md +1 -1
  77. package/.vibekit/init/CLAUDE-template.md +3 -0
  78. package/.vibekit/init/FIRST_PROMPT.md +1 -1
  79. package/.vibekit/init/FIRST_TIME_INIT.md +34 -2
  80. package/.vibekit/scripts/doctor.mjs +27 -5
  81. package/.vibekit/scripts/init-backbone.mjs +9 -0
  82. package/.vibekit/scripts/mvck.mjs +24 -9
  83. package/.vibekit/scripts/test-install.mjs +8 -0
  84. package/.vibekit/scripts/validate-kit.mjs +104 -39
  85. package/.vibekit/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +28 -3
  86. package/.vibekit/skills/coding-level/SKILL.md +8 -1
  87. package/.vibekit/skills/path-sensitive-shell-safety/SKILL.md +1 -0
  88. package/.vibekit/skills/prompt-sharpener/SKILL.md +54 -0
  89. package/.vibekit/skills/vibekit-init/SKILL.md +2 -2
  90. package/AGENTS.md +3 -2
  91. package/CHANGELOG.md +21 -0
  92. package/README.md +60 -19
  93. package/backbone.yml +2 -1
  94. package/docs/README.vi.md +273 -0
  95. package/package.json +8 -3
  96. package/README.vi.md +0 -232
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: memento
3
+ description: Leave yourself a note before closing a multi-day task, then read it back at the start of the next session — it's the only memory that survives the gap.
4
+ argument-hint: "'resume' to read it back, or a hint for what's next when writing it"
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ Leonard, in *Memento*, can't hold a new memory for more than a few minutes, so he writes down only what his future self must act on, and never trusts a note loose enough to misread later. A session runs out the same way: once it ends, the goal, the plan, and every trap you hit are gone unless they were on paper first. `MEMENTO.md`, at the repo root, is that paper — read and rewritten every session for as long as the task spans days or weeks.
9
+
10
+ Same file, two moments: ending a session, or watching context run low, means **Wrap up**. Starting one with nothing said yet, or told to resume, means **Resume**.
11
+
12
+ ## Wrap up
13
+
14
+ Read `MEMENTO.md` first if it exists — you're merging into a running note, not drafting a fresh one. Write back exactly these headers:
15
+
16
+ - **Goal** — the task this spans, not just what this session touched.
17
+ - **Done** — milestones so far. Append; never drop one an earlier session recorded.
18
+ - **Stuck** — the current blocker, stated plainly. None? Say so.
19
+ - **Next** — the immediate next step, concrete enough to start cold, including which skill to reach for if one applies. Fold in any hint the user gave about what's next.
20
+ - **Traps** — every dead end and why it failed. Append — a trap logged three sessions ago still belongs here. A generic summary always loses this section first, and it's the one that costs the most to relearn.
21
+
22
+ Every section answers one test: could a reader with none of this conversation, and no way to ask you anything, act correctly from the page alone? That's the bar — not length, not polish.
23
+
24
+ Reference other artifacts (PRDs, ADRs, issues, diffs) by path instead of restating them, and redact secrets or anything personally identifying before you write. If the repo has a `.gitignore` and `MEMENTO.md` isn't in it, add it — this is a scratchpad, not something to ship in a PR.
25
+
26
+ If **Goal** is now fully done, delete the file instead of writing a fifth version of "nothing left to do" — a stale memento left behind just confuses whatever this repo works on next.
27
+
28
+ ## Resume
29
+
30
+ Read `MEMENTO.md` at the repo root. Missing? Say so and ask what to work on instead of inventing a goal to fill the gap.
31
+
32
+ Found it: treat it as ground truth, but not blind faith — the note that undoes Leonard is the one he stops questioning. If it claims a file exists or a step landed and the repo says otherwise, flag the mismatch before building on top of it. Hand the human two or three lines — the goal, the immediate next step — before spending any work, so they can redirect first. Then pick up **Next**, invoking whatever skill it names, and treat every **Traps** entry as a closed door — don't reopen it.
33
+
34
+ ## Not `handoff`
35
+
36
+ `handoff` and `claude-handoff` pass work to a *different* agent, right now, in parallel. Memento is one worker leaving a note for their own next session, days later, alone. Reach for this one when you're closing the laptop, not when you're spinning up a second agent.
@@ -0,0 +1,160 @@
1
+ ---
2
+ name: parallel-analysis
3
+ description: Fan out 2-5 independent read-only analysis lanes across the repo using your configured executor (Cursor CLI Composer, Claude subagents, or Codex CLI), then merge the lane reports and verify them with a refutation pass. Use for repo-wide questions, large uncommitted-diff reviews, multi-doc reading, impact analysis, or consistency audits. On first use it asks which provider/model to use and saves the answer so it never asks again.
4
+ argument-hint: "<analysis question, diff, or review target>"
5
+ user-invocable: true
6
+ effort: medium
7
+ ---
8
+
9
+ # Parallel Analysis (Multi-Agent Fan-Out)
10
+
11
+ Split a large analysis into independent read-only lanes, run them concurrently
12
+ with the configured executor, merge the lane reports, and verify merged claims
13
+ with a skeptical refutation pass. One round of parallel lanes replaces slow
14
+ serial reading; the verification lane replaces manual double-checking.
15
+
16
+ This skill is project-agnostic: it works in any repo where the kit is
17
+ installed, using that repo's `backbone.yml` (if present) for boundaries.
18
+
19
+ ## Best Use
20
+
21
+ - Repo-wide questions ("where is X handled, what depends on Y").
22
+ - Reviewing a large uncommitted diff by concern (backend vs frontend vs i18n
23
+ vs scripts).
24
+ - Reading several large docs, plans, or reference trees at once.
25
+ - Pre-change impact analysis across packages/apps listed in `backbone.yml`
26
+ `paths.apps`.
27
+ - Consistency audits (docs vs code, rules vs skills, config vs actual layout).
28
+
29
+ Do NOT use for single-file questions or quick lookups; direct reads are faster.
30
+
31
+ ## Executor Setup (first use only)
32
+
33
+ Lane execution is delegated to ONE configured executor. The choice is stored
34
+ in `.vibekit/parallel-analysis.json`; while that file exists and its preflight
35
+ passes, NEVER ask again.
36
+
37
+ 1. **If `.vibekit/parallel-analysis.json` exists**: read it, run the matching
38
+ preflight below, and proceed silently on success. If preflight fails
39
+ (binary missing, logged out), tell the user what broke, offer to re-run
40
+ setup, and update the file with their answer.
41
+ 2. **If it does not exist**: detect what is available, then ask the user ONE
42
+ question — "Which provider should run parallel analysis lanes?" — using the
43
+ harness-native prompt (AskUserQuestion in Claude Code; a plain chat
44
+ question in Cursor/Codex). Offer, in this order:
45
+ - **Cursor CLI + Composer 2.5 Fast (recommended)** — fastest lane executor;
46
+ requires `cursor-agent` installed and logged in.
47
+ - **Claude subagents** — no extra install; lanes run as read-only Claude
48
+ Code subagents (Explore/general-purpose). Choose this automatically if
49
+ the user declines external CLIs.
50
+ - **Codex CLI** — lanes run via `codex exec` in a read-only sandbox with
51
+ the best available Codex model.
52
+ 3. **Resolve the model** for the chosen provider (see per-executor notes),
53
+ confirm the resolved value in one line, and write the config file. Include
54
+ a fallback executor so lanes still run when the primary is unavailable.
55
+
56
+ ### Preflights and model resolution
57
+
58
+ - `cursor-cli`: `cursor-agent status` must report logged in (otherwise the
59
+ user runs `cursor-agent login` once). Resolve the model with
60
+ `cursor-agent --list-models` and prefer the Composer 2.5 fast variant
61
+ (e.g. `composer-2.5-fast`); if absent, use the newest Composer model and
62
+ record what was picked.
63
+ - `claude-subagents`: available whenever running inside Claude Code; no
64
+ binary needed. Use read-only subagent types only.
65
+ - `codex-cli`: `codex --version` must succeed. Use the CLI's default/best
66
+ coding model unless the user names one; record the resolved model.
67
+
68
+ ### Config file — `.vibekit/parallel-analysis.json`
69
+
70
+ ```json
71
+ {
72
+ "executor": "cursor-cli",
73
+ "model": "composer-2.5-fast",
74
+ "fallback": "claude-subagents",
75
+ "configuredAt": "2026-07-16T07:30:00Z"
76
+ }
77
+ ```
78
+
79
+ `executor` is one of `cursor-cli` | `claude-subagents` | `codex-cli`. The file
80
+ is local state (gitignored by default); a team may commit it deliberately to
81
+ share a default. To change the choice later, delete the file or ask for
82
+ "parallel-analysis setup" again.
83
+
84
+ ## Running a lane (per executor)
85
+
86
+ Every lane is READ-ONLY: search, read, summarize — never edit files, execute
87
+ project binaries, run hooks, or trigger installs/deploys/migrations.
88
+
89
+ - `cursor-cli`:
90
+
91
+ ```sh
92
+ cursor-agent -p --mode ask --output-format text \
93
+ --model "<configured-model>" \
94
+ --workspace "<repo-root>" \
95
+ "<lane brief>"
96
+ ```
97
+
98
+ Never pass `--force` or `--yolo`; `--mode ask` keeps Composer read-only.
99
+ One workspace per lane; a question spanning multiple repos becomes one lane
100
+ per repo.
101
+ - `claude-subagents`: launch each lane as a read-only subagent with the lane
102
+ brief as its prompt, all lanes in ONE message so they run concurrently.
103
+ - `codex-cli`:
104
+
105
+ ```sh
106
+ codex exec --sandbox read-only -C "<repo-root>" "<lane brief>"
107
+ ```
108
+
109
+ If the harness cannot run lanes concurrently (plain CLI loop), run them
110
+ back-to-back without changing the briefs — merge and verification stay the
111
+ same.
112
+
113
+ ## Workflow
114
+
115
+ 1. **Scope.** State the question in one sentence. Split it into 2-5 lanes that
116
+ are independent of each other (by directory, package, concern, or doc set).
117
+ If lanes would depend on each other's output, merge them or run two rounds.
118
+ 2. **Brief.** Give each lane a numbered brief: exact paths, the questions to
119
+ answer, and the required return format ("facts only, numbered sections,
120
+ findings as `file:line — issue — why it matters`").
121
+ 3. **Launch all lanes at once** with the configured executor.
122
+ 4. **Prepare while waiting.** Build the merge skeleton; do not duplicate lane
123
+ work.
124
+ 5. **Merge.** Combine lane reports into one findings list. Mark conflicts
125
+ between lanes and unknowns explicitly — never average away a disagreement.
126
+ 6. **Verify.** Run one verification lane that receives the merged claims (not
127
+ the reasoning) with the instruction: "Default-skeptical: confirm or refute
128
+ each claim against the repo with file:line evidence." Drop or re-investigate
129
+ every refuted claim; never silently keep one.
130
+ 7. **Deliver.** Report merged findings, what was verified, and remaining
131
+ unknowns. For issue triage, classify surviving findings with the
132
+ `reviewing-4p-priorities` skill (P0-P4). Decisions and edits stay in the
133
+ main session under the repo's normal review rules.
134
+
135
+ ## Lane brief template
136
+
137
+ ```text
138
+ Lane <n>: <one-line purpose>
139
+ Workspace: <repo root>
140
+ Paths: <exact dirs/files>
141
+ Read-only. Do not modify anything or execute binaries/scripts.
142
+ Questions:
143
+ 1. <specific question>
144
+ 2. <specific question>
145
+ Return: numbered sections matching the questions, facts only,
146
+ findings as file:line — issue — why it matters.
147
+ ```
148
+
149
+ ## Guardrails
150
+
151
+ - 2-5 lanes per round; needing more means the question is under-scoped.
152
+ - Lanes are read-only; only the main session edits files. Agent-surface edits
153
+ (`backbone.yml`, `AGENTS.md`, `CLAUDE.md`, `.claude/**`, `.cursor/**`,
154
+ `.agents/**`, `.codex/**`, kit skills/commands) additionally require the
155
+ `agentshield-security-review` skill afterwards.
156
+ - Respect `backbone.yml` `policy.protected_paths` in every lane brief.
157
+ - Never put secrets in lane briefs or executor prompts: no `.env*` contents,
158
+ credentials, tokens, private keys, or customer data.
159
+ - This skill produces analysis, not decisions; a lane may not conclude
160
+ "therefore change X" without main-session review.
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: path-sensitive-shell-safety
3
+ description: Guardrail workflow for shell changes that use path variables, remote base directories, repo folders, checkout repair, or destructive filesystem commands such as rm, mv, cp, rsync, find -delete, git clean, or git reset.
4
+ argument-hint: "<script path, command, or safety review target>"
5
+ user-invocable: true
6
+ effort: medium
7
+ ---
8
+
9
+ # Path-Sensitive Shell Safety
10
+
11
+ Use this skill before editing or reviewing shell, deploy, installer, cleanup, or repair logic that builds filesystem paths from variables or touches remote repositories.
12
+
13
+ Common triggers:
14
+
15
+ - Path variables such as `remote_base`, `repo_dir`, `repo_folder`, `target_dir`, `backup_dir`, `worktree`, `site`, `app`, or user-entered folder names.
16
+ - Destructive or path-sensitive commands: `rm`, `mv`, `cp -a`, `rsync --delete`, `find -delete`, `docker volume rm`, `git clean`, `git reset`, checkout repair, clone replacement, or symlink-sensitive copy.
17
+ - Git sync that decides which branch or remote checkout will be deployed.
18
+
19
+ ## Safety objective
20
+
21
+ No empty, unset, broad, symlinked, or unintended path may reach a destructive command. Validate values before joining paths, validate the joined path before use, and validate containment immediately before the command.
22
+
23
+ ## Required workflow
24
+
25
+ 1. Identify the command with the highest blast radius.
26
+ 2. List every variable that contributes to its path or repository target.
27
+ 3. Classify each variable:
28
+ - trusted constant;
29
+ - config value;
30
+ - remote/server value;
31
+ - user/operator input;
32
+ - derived path.
33
+ 4. Validate raw inputs before joining:
34
+ - required and non-empty;
35
+ - expected shape: absolute base path or safe single folder segment;
36
+ - no traversal, newlines, glob metacharacters, leading option dash, or control characters;
37
+ - explicit allowlist for server roots when possible.
38
+ 5. Join paths with quoted expansions only. Do not use `eval`.
39
+ 6. Canonicalize existing paths with physical resolution (`pwd -P` or `realpath`) before destructive work.
40
+ 7. Assert containment:
41
+ - target is inside the approved base;
42
+ - target is not `/`, `.`, `..`, `$HOME`, the base root itself, or another broad system directory;
43
+ - target is not a symlink unless the operation explicitly supports symlinks.
44
+ 8. Put the final guard directly next to the dangerous command.
45
+ 9. Use command terminators and quoting: `-- "$path"` where supported.
46
+ 10. For Git sync, verify expected origin, selected branch policy, fetch success, clean worktree, fast-forward state, and final `HEAD == origin/<branch>` before build/deploy.
47
+ 11. Run the repo validation command and AgentShield probe when this changes agent surfaces or automation rules.
48
+
49
+ ## Required outcomes
50
+
51
+ - Prefer a recoverable delete (`trash`) over permanent `rm` for user files; permanent deletion requires explicit confirmation of the exact paths. If `trash` is missing, recommend installing it (macOS 14+ built-in; older macOS `brew install trash`; Linux `sudo apt install trash-cli`; any OS with Node `npm i -g trash-cli`).
52
+ - A blank branch may follow the documented default-branch fallback policy.
53
+ - An explicit branch must fail if missing; never silently deploy another branch.
54
+ - A blank folder/base value must fail before any `rm`, `mv`, `cp`, `rsync`, `find`, Docker, or Git cleanup command runs.
55
+ - A repair flow may move an unusable checkout to a timestamped backup only after a verified replacement exists.
56
+ - No automatic cleanup should delete backups, locks, runtime data, uploads, volumes, databases, or environment files without separate explicit confirmation.
57
+
58
+ ## Review priority
59
+
60
+ Use `reviewing-4p-priorities` if triage is needed:
61
+
62
+ - P0: unsafe path command already caused data loss or can expose/delete secrets in the active environment.
63
+ - P1: unchecked empty/broad variable can reach destructive commands in deploy/repair/install paths.
64
+ - P2: guard exists but misses edge cases such as symlinks, traversal, explicit branch fallback, or wrong origin.
65
+ - P3/P4: documentation clarity or minor naming improvements after the safety invariant is already enforced.
66
+
67
+ ## Reference
68
+
69
+ Use `references/workflow.md` for copy-ready guard patterns and review checklist.
@@ -0,0 +1,127 @@
1
+ # Path-Sensitive Shell Safety Reference
2
+
3
+ This reference gives reusable guard patterns for shell scripts. Adapt names and allowlists to the repo, but keep the invariant: validate raw input, validate the joined path, then guard immediately before the dangerous command.
4
+
5
+ ## Baseline guard functions
6
+
7
+ ```bash
8
+ die() {
9
+ printf 'ERROR: %s\n' "$*" >&2
10
+ exit 1
11
+ }
12
+
13
+ require_nonempty() {
14
+ local name="${1:?missing name}"
15
+ local value="${2-}"
16
+ [[ -n "$value" ]] || die "$name is required"
17
+ [[ "$value" != *$'\n'* && "$value" != *$'\r'* ]] || die "$name contains a newline"
18
+ }
19
+
20
+ validate_abs_base_path() {
21
+ local name="${1:?missing name}"
22
+ local value="${2-}"
23
+ require_nonempty "$name" "$value"
24
+ [[ "$value" == /* ]] || die "$name must be an absolute path: $value"
25
+ [[ "$value" != "/" && "$value" != "." && "$value" != ".." ]] || die "$name is too broad: $value"
26
+ [[ "$value" != *"/../"* && "$value" != *"/./"* && "$value" != *"//"* ]] || die "$name contains unsafe traversal: $value"
27
+ case "$value" in
28
+ /bin|/boot|/dev|/etc|/home|/lib|/lib64|/opt|/private|/root|/sbin|/srv|/sys|/tmp|/usr|/var)
29
+ die "$name points at a broad system directory: $value"
30
+ ;;
31
+ esac
32
+ }
33
+
34
+ validate_folder_segment() {
35
+ local name="${1:?missing name}"
36
+ local value="${2-}"
37
+ require_nonempty "$name" "$value"
38
+ [[ "$value" != -* ]] || die "$name must not start with '-': $value"
39
+ [[ "$value" != "." && "$value" != ".." ]] || die "$name is unsafe: $value"
40
+ [[ "$value" != */* && "$value" != *\\* ]] || die "$name must be one folder segment: $value"
41
+ [[ "$value" =~ ^[A-Za-z0-9._#@+=:-]+$ ]] || die "$name contains unsupported characters: $value"
42
+ }
43
+
44
+ join_child_path() {
45
+ local base="${1:?missing base}"
46
+ local child="${2:?missing child}"
47
+ printf '%s/%s\n' "${base%/}" "$child"
48
+ }
49
+ ```
50
+
51
+ ## Containment guard
52
+
53
+ ```bash
54
+ canonical_existing_dir() {
55
+ local path_value="${1:?missing path}"
56
+ [[ -d "$path_value" ]] || die "not a directory: $path_value"
57
+ [[ ! -L "$path_value" ]] || die "refusing symlink directory: $path_value"
58
+ (cd -P -- "$path_value" && pwd) || die "cannot resolve directory: $path_value"
59
+ }
60
+
61
+ assert_child_under_parent() {
62
+ local parent="${1:?missing parent}"
63
+ local child="${2:?missing child}"
64
+ [[ "$child" != "$parent" ]] || die "refusing to operate on parent directory itself: $child"
65
+ case "$child" in
66
+ "$parent"/*) ;;
67
+ *) die "path escapes parent: child=$child parent=$parent" ;;
68
+ esac
69
+ }
70
+ ```
71
+
72
+ ## Safer remove wrapper
73
+
74
+ Use a wrapper instead of inline deletion when a path contains variables.
75
+
76
+ ```bash
77
+ safe_rm_rf_dir() {
78
+ local label="${1:?missing label}"
79
+ local target="${2-}"
80
+ local allowed_parent="${3-}"
81
+
82
+ validate_abs_base_path "$label target" "$target"
83
+ validate_abs_base_path "$label allowed parent" "$allowed_parent"
84
+
85
+ [[ -d "$target" ]] || die "$label target is not an existing directory: $target"
86
+ [[ ! -L "$target" ]] || die "$label target is a symlink: $target"
87
+
88
+ local parent_real
89
+ parent_real="$(canonical_existing_dir "$allowed_parent")"
90
+
91
+ local target_real
92
+ target_real="$(canonical_existing_dir "$target")"
93
+
94
+ assert_child_under_parent "$parent_real" "$target_real"
95
+ rm -rf -- "$target_real"
96
+ }
97
+ ```
98
+
99
+ Never call the wrapper with a broad parent such as `/`, `/opt`, `/var`, `/tmp`, or `$HOME`. Use the narrowest app-owned parent.
100
+
101
+ ## Git sync guard checklist
102
+
103
+ - Validate the checkout directory is inside the approved app base.
104
+ - Validate the origin URL or host matches the expected repository.
105
+ - Fetch with bounded timeout and non-interactive credentials.
106
+ - Explicit branch:
107
+ - require the exact remote branch;
108
+ - fail with an actionable message if it is missing.
109
+ - Blank branch:
110
+ - current valid upstream;
111
+ - remote default branch;
112
+ - `main`;
113
+ - `master`.
114
+ - Refuse dirty, local-ahead, or diverged worktrees unless the operator chooses a guided repair command.
115
+ - After sync, verify `git rev-parse HEAD` equals `git rev-parse "origin/<branch>"`.
116
+ - Build or deploy only after the equality check passes.
117
+
118
+ ## Review checklist
119
+
120
+ - Are all path variables checked with `[[ -n "$value" ]]` or a stronger helper before use?
121
+ - Are folder names validated as segments before joining?
122
+ - Is the final path canonicalized or otherwise proven inside the base?
123
+ - Is the destructive command adjacent to its guard?
124
+ - Does the command use quoted expansions and `--` where available?
125
+ - Does the code fail closed for missing explicit branches?
126
+ - Does repair preserve runtime data and keep backups instead of deleting them?
127
+ - Does validation cover empty values, traversal, symlink, wrong origin, dirty checkout, branch with `#`, and missing branch?
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: prompt-sharpener
3
+ description: Sharpen a rough prompt into a precise one — same intent, sharper not longer — then execute the sharpened version immediately in the same turn.
4
+ argument-hint: "the rough prompt to sharpen and execute"
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Prompt Sharpener
9
+
10
+ The text the user types after the invocation is the **raw prompt**. Upgrade it into a prompt that is **sharper, not longer** — keep the original intent, constraints, and language — then execute the upgraded version immediately in the same turn. No text after the invocation → ask the user what they want and stop.
11
+
12
+ ## Step 1 — Diagnose the raw prompt
13
+
14
+ Scan for every ailment below; each ailment found gets its cure applied directly in the upgraded prompt. Cure silently; call out a cure only when it could shift the user's intent.
15
+
16
+ - Vague verbs or adjectives ("help me", "make it nicer") → concrete, measurable operations and parameters.
17
+ - Two tasks in one prompt → split into an explicit execution order.
18
+ - No success criteria → add a binary pass/fail `Done when`.
19
+ - Emotional description ("everything is broken") → extract the specific technical symptom.
20
+ - "The whole app" scope → pin exact files/functions/directories; coding tasks always get a **scope lock** (edit only inside X, leave the rest untouched).
21
+ - Relies on memory of an old session → copy the decisions already settled in this conversation (stack, architecture, what was tried and failed) into the `Context` block.
22
+ - Invitation to fabricate ("what do experts say about X?") → anchor grounding: state only what can be verified; when unsure, say so explicitly.
23
+ - No output format → fix the structure and length; when the format is hard to describe in words, include 2-3 sample examples (including an edge case) in the `Output Contract`.
24
+
25
+ Done when: the raw prompt has been checked against the full list and no ailment is left without its cure in the upgraded prompt.
26
+
27
+ ## Step 2 — Build the upgraded prompt
28
+
29
+ Classify the task (coding / research / writing / analysis / planning / review), then assemble blocks in this order — add a block only when it raises precision; small tasks need just 2-3 blocks:
30
+
31
+ `Objective` → `Context` → `Work Style` → `Tool Rules` → `Output Contract` → `Verification` → `Done Criteria`
32
+
33
+ Focus per task type:
34
+
35
+ - Coding: scope lock, smallest correct change, validation after the edit — default to the `validate` command in `backbone.yml` when the repo has one.
36
+ - Research: source quality, citations, explicit uncertainty.
37
+ - Writing: audience, voice, length.
38
+ - Review: group findings by severity, name the failure mode.
39
+
40
+ Construction rules:
41
+
42
+ - Write constraints with the strongest signal words: MUST instead of "should", NEVER instead of "avoid".
43
+ - Missing information → state the assumption in `Context` and keep going; stop to ask only when the task is destructive or irreversible.
44
+ - Say _what_ to verify; let the model regulate its own depth of thought.
45
+ - Repo work MUST respect `backbone.yml` conventions and protected paths; when the upgraded task is a large decomposition or a risky decision, its `Work Style` block may direct Step 3 to open with the `sequential-thinking` or `clearthought` skill.
46
+ - Closing audit: reread every sentence; if cutting it would not change the output, cut it — every remaining word is **load-bearing**.
47
+
48
+ Done when the upgraded prompt scores on all 6 points: intent preserved — ambiguity reduced — right depth — clear output — has verification — has a stopping point.
49
+
50
+ ## Step 3 — Present and execute
51
+
52
+ Print the upgraded prompt in a single code block, with at most 2 sentences on the key changes. Then treat it as the user's official request: start executing immediately in the same turn, researching and editing according to its own `Tool Rules`.
53
+
54
+ Done when the upgraded prompt's `Done Criteria` are satisfied.
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: reviewing-4p-priorities
3
+ description: P0-P4 issue and task triage for vibe coding. Use when reviewing bugs, risks, feature requests, agent-surface changes, or deciding which work must happen first.
4
+ argument-hint: "<issue, review finding, or task list>"
5
+ user-invocable: true
6
+ effort: medium
7
+ ---
8
+
9
+ # Reviewing 4P Priorities
10
+
11
+ Use this skill to classify work from P0 to P4 and convert review findings into a practical fix order.
12
+
13
+ ## Priority Scale
14
+
15
+ | Priority | Meaning | Response |
16
+ | --- | --- | --- |
17
+ | P0 | Critical outage, data loss, security exposure, or all users blocked | Stop and fix immediately |
18
+ | P1 | Major user-facing or release-blocking failure for many users | Fix before other planned work |
19
+ | P2 | Important bug, maintainability risk, or strategic enhancement | Schedule in the current cycle |
20
+ | P3 | Local polish, minor edge case, or narrow productivity improvement | Routine backlog |
21
+ | P4 | Nice-to-have, exploratory idea, or low-confidence request | Capture, defer, or discard |
22
+
23
+ ## Vibe Coding Review Flow
24
+
25
+ 1. Identify the affected user, workflow, or agent surface.
26
+ 2. Separate evidence from guesses.
27
+ 3. Classify the current impact, not hypothetical worst cases.
28
+ 4. Explain why the item is not one level higher or lower.
29
+ 5. Convert each P0-P2 item into a small fix task and validation check.
30
+ 6. Leave P3-P4 items as optional follow-up unless they reduce risk cheaply.
31
+
32
+ ## Output
33
+
34
+ ```markdown
35
+ ## 4P Review
36
+
37
+ Classification: P<0-4>
38
+ Issue: <short description>
39
+ Evidence:
40
+ - <observed fact>
41
+ Impact:
42
+ - Users/workflows affected: <scope>
43
+ - Failure mode: <what breaks>
44
+ Rationale:
45
+ - Why this priority:
46
+ - Why not higher:
47
+ - Why not lower:
48
+ Fix order:
49
+ 1. <small task>
50
+ 2. <small task>
51
+ Validation:
52
+ - <command or manual check>
53
+ ```
54
+
55
+ ## Priority Boundaries
56
+
57
+ - P0 requires immediate action because harm is happening now or secrets/data are exposed.
58
+ - P1 is urgent but does not require emergency response for every user.
59
+ - P2 is important and should be planned, but users have a workaround or impact is bounded.
60
+ - P3 improves quality but does not materially block the workflow.
61
+ - P4 is a candidate for a note, not an implementation commitment.
62
+
63
+ ## Examples
64
+
65
+ Use `examples.md` when a priority boundary is ambiguous, especially P0 vs P1, P1 vs P2, security edge cases, or agent-surface risk classification.
66
+
67
+ ## Guardrails
68
+
69
+ - Do not classify without impact evidence.
70
+ - Do not use P0 for personal urgency.
71
+ - Do not expand scope while triaging. Classify the current issue first.
72
+ - For agent-surface changes, include security and prompt-injection risk in the impact section.