@xenonbyte/xsk 0.1.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 (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +107 -0
  3. package/README.zh-CN.md +107 -0
  4. package/bin/xsk.js +164 -0
  5. package/lib/adapters/claude.js +14 -0
  6. package/lib/adapters/codex.js +14 -0
  7. package/lib/adapters/gemini.js +14 -0
  8. package/lib/adapters/opencode.js +14 -0
  9. package/lib/capability.js +126 -0
  10. package/lib/content-hash.js +13 -0
  11. package/lib/generator.js +44 -0
  12. package/lib/input.js +93 -0
  13. package/lib/install.js +496 -0
  14. package/lib/manifest.js +288 -0
  15. package/lib/ownership.js +85 -0
  16. package/lib/skills.js +58 -0
  17. package/lib/status.js +171 -0
  18. package/lib/uninstall.js +577 -0
  19. package/package.json +36 -0
  20. package/shared/skill-common.md +6 -0
  21. package/skills/archive-req/SKILL.md +37 -0
  22. package/skills/bypass-claude/SKILL.md +53 -0
  23. package/skills/check/SKILL.md +73 -0
  24. package/skills/skill-scaffold/SKILL.md +56 -0
  25. package/skills/think/SKILL.md +56 -0
  26. package/skills/write-req/SKILL.md +63 -0
  27. package/templates/fragments/archive-req.behavior.md +7 -0
  28. package/templates/fragments/archive-req.output.md +1 -0
  29. package/templates/fragments/archive-req.purpose.md +1 -0
  30. package/templates/fragments/archive-req.triggers.md +5 -0
  31. package/templates/fragments/bypass-claude.behavior.md +23 -0
  32. package/templates/fragments/bypass-claude.output.md +1 -0
  33. package/templates/fragments/bypass-claude.purpose.md +1 -0
  34. package/templates/fragments/bypass-claude.triggers.md +5 -0
  35. package/templates/fragments/check.behavior.md +29 -0
  36. package/templates/fragments/check.output.md +13 -0
  37. package/templates/fragments/check.purpose.md +3 -0
  38. package/templates/fragments/check.triggers.md +5 -0
  39. package/templates/fragments/skill-scaffold.behavior.md +24 -0
  40. package/templates/fragments/skill-scaffold.output.md +3 -0
  41. package/templates/fragments/skill-scaffold.purpose.md +1 -0
  42. package/templates/fragments/skill-scaffold.triggers.md +5 -0
  43. package/templates/fragments/think.behavior.md +15 -0
  44. package/templates/fragments/think.output.md +9 -0
  45. package/templates/fragments/think.purpose.md +3 -0
  46. package/templates/fragments/think.triggers.md +6 -0
  47. package/templates/fragments/write-req.behavior.md +33 -0
  48. package/templates/fragments/write-req.output.md +1 -0
  49. package/templates/fragments/write-req.purpose.md +1 -0
  50. package/templates/fragments/write-req.triggers.md +5 -0
  51. package/templates/skill.md.tmpl +22 -0
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: xsk-check
3
+ description: Review a code change before it ships. Check scope drift, enforce hard stops, gate findings on evidence, then verify and sign off. Distilled from Waza /check.
4
+ ---
5
+
6
+ # xsk-check
7
+
8
+ Review a code change against its goal and the available evidence before it merges or ships. Read the diff, find the real problems, fix what is safe to fix, surface the rest, and verify before calling anything done. Distilled from the default-review discipline of Waza `/check`.
9
+
10
+ It reviews code diffs and changes, not prose. A clean review is a valid result: do not invent findings to look thorough, and do not approve a risky change just to seem agreeable.
11
+
12
+ ## When to use
13
+
14
+ Match the intent, not the exact words. Common cues:
15
+
16
+ - "看看代码", "检查一下", "有没有问题", "是否需要优化", "合并前"
17
+ - "review my code", "check this change", "before merge", "code review"
18
+ - any request to review a diff, a pull request, or a pending change for correctness and quality before it ships
19
+
20
+ ## How it works
21
+
22
+ **1. Read the worktree and the diff first.** Start from `git status` and the full diff against the base branch. Treat modified, staged, and untracked files as the user's work: read them, and never discard, stash, or overwrite them without explicit approval. If the base or the review range is unclear, ask before guessing.
23
+
24
+ **2. Did the change build what was asked? Check scope drift.** Every changed file and every new surface must trace back to the stated goal in one sentence. A pure refactor folded into a bug fix, a new dependency the goal never mentioned, or a new abstraction nothing requires is drift until justified. Label the change on target, drift, or incomplete.
25
+
26
+ **3. Classify depth, then state it.** Quick for a small, low-risk change. Standard for a medium one. Deep when the diff is large or touches auth, payments, data mutation, or destructive operations. A deeper change earns a wider read of its callers and consumers, not just the changed lines.
27
+
28
+ **4. Apply the hard stops. Fix or flag before merge.**
29
+
30
+ - No unverified claims. Never write "tests pass", "I verified", or "this fixes it" unless the command output is in front of you this session. If the judgment comes from reading the code, say that instead.
31
+ - Re-read before citing a fact. Line numbers, file state, branch position, and fallback behavior go stale. Re-check them in this pass rather than trusting memory.
32
+ - Secrets and injection. No credential hardcoded, logged, or committed. Watch for SQL, shell, and path injection at every entry point.
33
+ - Unexpected dependencies. Flag any added or version-bumped dependency the goal does not obviously require.
34
+ - Unknown identifiers. Grep before approving any symbol the diff introduces. No match outside the diff means it does not exist.
35
+ - Dead-code deletion needs proof. A "zero callers" claim must be checked across the whole repo, including tests, scripts, and dynamic lookups, before anything is removed.
36
+ - Safety sinks. Destructive file operations, path or symlink traversal, and approval-boundary changes need explicit validation, rollback, and confirmation review.
37
+ - Generated-artifact drift. If sources change, the generated or bundled output must be regenerated and included.
38
+ - String-matching on captured output. A subprocess run with inherited stdio streams its diagnostics to the terminal, not into the error message, which then holds only the command line. A matcher on that string silently matches the command, not the output. Probe the real value, or branch on a structured fact such as the exit code.
39
+ - Audit before restore. When the diff re-adds a symbol, string, or field that history removed, grep first to confirm anything still uses it. A rule or test that merely names it is not proof of life.
40
+ - Migration code for unshipped features. Reject "carry the old key forward" logic when the key never shipped. Check the last release tag: if it is absent there, no migration is needed, so ship the default.
41
+ - Install and runtime proof. For a skill, plugin, package, or installer, metadata and source tests are not enough. Build or install through the real user path, or mark that layer unverified.
42
+ - Verifier failure layer. When a check fails before its assertions run, from setup, a missing optional dependency, or the environment, classify setup failure versus product failure. Do not call the code broken until the real test body actually ran.
43
+
44
+ **5. Sweep the pattern, not just the instance.** When the change fixes one case of a bug class, grep the repo for siblings of the same shape and confirm they were handled too. List any that were missed.
45
+
46
+ **6. Gate every finding on evidence.** A HIGH or CRITICAL finding needs three things: the exact file and line, the concrete trigger that produces the bad outcome, and why existing guards do not already prevent it. Missing any one, downgrade it or drop it. Do not pad the report with low-confidence noise that trains the reader to ignore the real findings.
47
+
48
+ **7. Route the fixes.** Apply safe, risk-free fixes (typos, missing imports, obvious style) right away. Batch behavior-changing fixes (added null checks, new error handling) into one confirmation block instead of asking one at a time. Leave architecture and security tradeoffs for the user to decide, and mark informational notes as advisory.
49
+
50
+ **8. Verify before claiming done.** Run the project's own verification (its tests, lint, type check, build, or syntax check) and read the output. For a bug fix, a regression test that fails on the old code must exist before the fix counts as done. If no verification command is available, say so plainly and call it a gap. Never present unverified work as passing.
51
+
52
+ ## Output
53
+
54
+ Lead with the findings, most severe first, each with its file and line, the trigger, and the fix or the open question. When there are none, say so plainly: a clean review with a stated review surface is a complete result.
55
+
56
+ Then a short sign-off block:
57
+
58
+ - files changed, and the size of the diff
59
+ - scope: on target, or the specific drift
60
+ - review depth: quick, standard, or deep
61
+ - hard stops: how many found, fixed, and deferred
62
+ - new tests, if the change needed them
63
+ - doc debt: any invariant the change introduced that the project docs do not yet capture
64
+ - verification: the command that ran, and whether it passed
65
+
66
+ Then stop. Do not merge, push, tag, or publish unless the user asks for it.
67
+
68
+ ## Conventions shared across xsk skills
69
+
70
+ - Triggers are matched by intent, not by exact wording. The phrases listed under "When to use" are cues, not a required incantation.
71
+ - Write in natural, direct prose. No formulaic openers, no filler conclusions, no restating the request before you answer it.
72
+ - When a decision would change the implementation, surface it as a short question and let the user decide. Do not pick silently.
73
+ - These are instruction skills. They shape how work is approached, not what the agent is technically capable of.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: xsk-skill-scaffold
3
+ description: Bring an agent-skill project up to the xsk standard, or refuse if the target is not an agent-skill project.
4
+ ---
5
+
6
+ # xsk-skill-scaffold
7
+
8
+ Bring an agent-skill project up to the `xsk` standard, or refuse if the target is not an agent-skill project. The standard is self-owned and canonical: it lives in this skill, not in an external file that can drift.
9
+
10
+ ## When to use
11
+
12
+ Match the intent, not the exact words. Common cues:
13
+
14
+ - "scaffold skill project", "make this a skill installer", "conform to skill standard"
15
+ - "项目规范化", "agent 技能项目脚手架"
16
+ - any request to bring a project up to a multi-platform agent-skill installer standard
17
+
18
+ ## How it works
19
+
20
+ **1. Gate first.** Before mutating anything, decide whether the current directory is an agent-skill project: one that has, or is intended to have, a CLI that generates and installs skill files into agent config dirs. Heuristics: a `bin/` plus `skills/` or `shared/` or `templates/`, or a `package.json` whose purpose is skill installation. If it is clearly **not** an agent-skill project (an application, a library with no install surface), **error out** with a one-sentence reason and stop. Do not mutate a non-agent-skill project.
21
+
22
+ **2. Audit** the project against the canonical checklist below. Record each item as met or missing, with the concrete file or gap.
23
+
24
+ **3. Propose** the gap-closing changes as a concrete, reviewable patch plan: which files to add or edit, with targets. Patch what is missing or non-conforming; do not rewrite the project wholesale.
25
+
26
+ **4. Apply on approval.** Wait for explicit approval, then make the changes: add the missing `lib/` modules, wire the CLI commands, add templates, add README parity tests, add `LICENSE`. Do not apply before approval.
27
+
28
+ ### Canonical checklist (the standard this skill enforces)
29
+
30
+ - CLI surface: `version` / `--version` / `-v`, `help` / `--help` / `-h`, `install [--platform <list>]`, `uninstall [--platform <list>]`, `status` (read-only), optional `doctor`.
31
+ - `--platform` is optional, comma-separated, defaults to all platforms; unknown and duplicate values are rejected.
32
+ - Unknown options fail loud.
33
+ - `status` validates manifest **shape**, not just parse success.
34
+ - Removed or renamed commands leave no stale references (grep-clean across CLI, help, README, generated text, `AGENTS.md`, `CLAUDE.md`).
35
+ - Four platforms, all full: Claude Code, Codex, opencode, Gemini.
36
+ - Manifest-backed install safety: owned-only removal, ownership markers, atomic writes, symlink refusal.
37
+ - `install` is uninstall-first: a reinstall resets the previously-owned files (pruning skills no longer installed) before regenerating, so no manual `uninstall` is needed. It still refuses to overwrite a user-edited owned file and rolls back instead of destroying it.
38
+ - A golden snapshot of the generated skill shell, masking embedded `shared/` body.
39
+ - A bilingual README (`README.md` plus `README.zh-CN.md`) with identical headings, English literals preserved, and content-pinning tests.
40
+
41
+ ### Self-conformance
42
+
43
+ A project that ships this standard must conform to it itself. The machine-checkable part is an executable self-conformance test (the five core commands resolve, EN/CN README headings match, the manifest module and `LICENSE` exist, `package.json` carries the required fields). The remainder is this skill's judgment when applied to its own source.
44
+
45
+ ## Output
46
+
47
+ For a non-agent-skill project: a one-sentence refusal and stop, with nothing mutated.
48
+
49
+ For an agent-skill project: the audit result (each checklist item, met or missing), followed by the proposed patch plan. On approval, the applied changes. Then stop.
50
+
51
+ ## Conventions shared across xsk skills
52
+
53
+ - Triggers are matched by intent, not by exact wording. The phrases listed under "When to use" are cues, not a required incantation.
54
+ - Write in natural, direct prose. No formulaic openers, no filler conclusions, no restating the request before you answer it.
55
+ - When a decision would change the implementation, surface it as a short question and let the user decide. Do not pick silently.
56
+ - These are instruction skills. They shape how work is approached, not what the agent is technically capable of.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: xsk-think
3
+ description: Plan before coding. Weigh options, surface ambiguities, and produce a decision-complete design, then stop for approval.
4
+ ---
5
+
6
+ # xsk-think
7
+
8
+ Turn a rough idea into a decision-complete plan before any code is written. xsk-think does the weighing, the option-trimming, and the ambiguity-surfacing up front, so that once you approve, the implementation is mostly mechanical.
9
+
10
+ It is planning-only. It writes no code, no scaffolding, and no pseudo-code.
11
+
12
+ ## When to use
13
+
14
+ Match the intent, not the exact words. Common cues:
15
+
16
+ - "出方案", "给方案", "怎么设计", "用什么方案"
17
+ - "判断一下", "有没有必要", "值不值得"
18
+ - "plan this", "how should I", "should we keep this"
19
+ - any request to design something, choose between approaches, or judge whether a piece of work is worth doing
20
+
21
+ ## How it works
22
+
23
+ **1. Preflight on durable context.** Before designing, scan `AGENTS.md`, `CLAUDE.md`, and any repo rules or config for hard constraints that would forbid or force a choice: lint rules, test conventions, locked decisions, "never do X" rules. If a hard rule conflicts with the likely plan, name it before going further.
24
+
25
+ **2. Check for an existing solution first.** If a library, framework, CLI, or the codebase already solves the problem, prefer that over inventing something. Only design custom when no adequate existing solution exists.
26
+
27
+ **3. Match the depth to the problem.**
28
+
29
+ - **Lightweight.** Small, reversible, low-stakes. One paragraph, one recommendation, done.
30
+ - **Evaluation.** A genuine choice between approaches. Lay out the realistic options, weigh the tradeoffs that actually matter, and recommend one with rationale. Mention a second option only if the tradeoff is genuinely close. Do not manufacture alternatives just to look thorough.
31
+ - **Triage.** Unclear or multi-part problem. Decompose first: separate the parts, order them, and identify which part actually needs design versus which is mechanical. Then design only the part that needs it.
32
+
33
+ **4. Declare premise collapse explicitly.** If the whole plan rests on one assumption that, if wrong, invalidates everything, say so as a single sentence up front: "This assumes X; if X is false, the rest does not hold."
34
+
35
+ **5. No placeholders in an approved plan.** A plan is not done until every decision is concrete. No "TBD", no "figure out later", no "we'll decide". If a decision is genuinely open, it goes into Open Questions for the user to resolve, not into the plan body.
36
+
37
+ **6. Stop at the design.** Output the plan, surface blocking ambiguities as one-sentence questions, then stop. Implementation starts only on explicit approval.
38
+
39
+ ## Output
40
+
41
+ A **Proposed Design Summary** with these parts:
42
+
43
+ - The recommended approach, with rationale.
44
+ - The premise-collapse assumption, if there is one.
45
+ - The concrete steps, structured so an executor can act without re-deciding (the handoff is execution-shaped, not exploration-shaped).
46
+ - A short **Gotchas** table of the traps to avoid.
47
+ - **Open Questions**, if any, that only the user can resolve.
48
+
49
+ Then stop and wait for approval. Do not begin implementation.
50
+
51
+ ## Conventions shared across xsk skills
52
+
53
+ - Triggers are matched by intent, not by exact wording. The phrases listed under "When to use" are cues, not a required incantation.
54
+ - Write in natural, direct prose. No formulaic openers, no filler conclusions, no restating the request before you answer it.
55
+ - When a decision would change the implementation, surface it as a short question and let the user decide. Do not pick silently.
56
+ - These are instruction skills. They shape how work is approached, not what the agent is technically capable of.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: xsk-write-req
3
+ description: Turn plain-language needs into a grounded requirement document in requirements/, with a self-audit gate before it is finalized.
4
+ ---
5
+
6
+ # xsk-write-req
7
+
8
+ Convert plain-language ("白话") needs into a compliant requirement document in `requirements/`, grounded in the current project's actual code. The output is a doc an implementer can act on without guessing, not a transcript of the request.
9
+
10
+ ## When to use
11
+
12
+ Match the intent, not the exact words. Common cues:
13
+
14
+ - "写需求", "需求文档", "把这个需求写清楚", "需求整理"
15
+ - "write a requirement", "turn this into a spec"
16
+ - any request to capture a fuzzy need as a structured, grounded requirement doc
17
+
18
+ ## How it works
19
+
20
+ **1. Read the project first.** `grep` and `read` the current project structure, config files (`package.json` and the like), and relevant code to ground the requirement in reality. Never quote defaults from memory.
21
+
22
+ **2. Locate or create the active requirement doc.** Scan `requirements/*.md` for frontmatter `status: active`. There is **at most one** active doc at a time. If more than one exists, stop, list the offending paths, and report the broken invariant for the user to resolve. If one exists, lock onto it and append or refine. If none exists, create `requirements/<slug>.md` with `status: active` and a slug generated from the need.
23
+
24
+ **3. Ensure the directory convention.** Auto-create `requirements/.gitignore` containing `archive/` if it is absent (creating `requirements/` and `requirements/archive/` as needed). Never overwrite an existing `.gitignore`; append `archive/` only if the line is missing.
25
+
26
+ **4. Convert fuzzy into concrete.** Match the document structure to the input richness:
27
+
28
+ - A minimal one-liner becomes a concise requirement: Goal, Scope, Acceptance. Do not force a Background section that would be filler.
29
+ - Richer input becomes Background, Goal, Scope (in and out), Requirements, Open Questions, Checkpoints.
30
+
31
+ **5. Decision points go to the user.** When a genuine technical or scoping choice would change the implementation, stop and ask the user to decide. Surface the options and the tradeoffs; let them pick. Do not pick silently.
32
+
33
+ **6. Brainstorm the genuinely open-ended.** Where the need is open-ended, run a short exploration with the user before writing.
34
+
35
+ **7. Wording.** Natural, fluent English (or match the project's language). No em-dash (U+2014) or en-dash (U+2013). No formulaic phrasing, no filler conclusions. The author's voice wins; most editing is subtraction.
36
+
37
+ **8. Self-audit checkpoint.** Before finalizing, audit the requirement against itself. A document that fails this gate is not ready.
38
+
39
+ - **Conflict check:** verify no internal contradictions (Goal versus Scope, in-scope versus out-of-scope, Requirements versus Open Questions, any two statements that cannot both hold). Resolve every conflict, or surface it to the user. A finalized doc contains zero conflicts.
40
+ - **Ambiguity check:** verify no undefined terms, unstated assumptions, or vague qualifiers ("fast", "supported", "as needed") that would force the implementer to guess. Tighten each to a concrete, testable statement. A finalized doc leaves no ambiguity that blocks implementation.
41
+ - **Checkpoint gates:** ensure the requirement defines the verification points where downstream implementation must pause and confirm against the requirement (acceptance criteria, integration gates, review gates). If it lacks them, add them before finalizing.
42
+ - If the audit surfaces issues only the user can resolve, stop, list them, and ask. Do not write a contradictory or under-specified doc.
43
+
44
+ The document frontmatter:
45
+
46
+ ```markdown
47
+ ---
48
+ status: active
49
+ slug: <slug>
50
+ created_at: <ISO date>
51
+ ---
52
+ ```
53
+
54
+ ## Output
55
+
56
+ The path of the requirement file, with confirmation that it is now the single active doc.
57
+
58
+ ## Conventions shared across xsk skills
59
+
60
+ - Triggers are matched by intent, not by exact wording. The phrases listed under "When to use" are cues, not a required incantation.
61
+ - Write in natural, direct prose. No formulaic openers, no filler conclusions, no restating the request before you answer it.
62
+ - When a decision would change the implementation, surface it as a short question and let the user decide. Do not pick silently.
63
+ - These are instruction skills. They shape how work is approached, not what the agent is technically capable of.
@@ -0,0 +1,7 @@
1
+ 1. Scan `requirements/*.md` (excluding `requirements/archive/`) for the single document whose frontmatter has `status: active`. If more than one exists, stop, list the offending paths, and report the broken invariant for the user to resolve.
2
+ 2. If there is no active document, refuse with a one-line reason and stop. Do not archive anything.
3
+ 3. Read the active doc slug and validate it against `^[a-z0-9]+(-[a-z0-9]+)*$`. If the slug is missing/invalid, stop with the reason before any write.
4
+ 4. Check the archive target `requirements/archive/<slug>.md`. If it already exists, stop, ask the user how to proceed, and leave it unchanged, writing nothing.
5
+ 5. Write the fully-updated archived content to `requirements/archive/<slug>.md`: set `status: archived`, add `archived_at: <ISO date>`, and preserve every other frontmatter field and the entire body unchanged.
6
+ 6. Confirm it landed as written, then remove the source active doc.
7
+ 7. After archiving, confirm zero active documents remain.
@@ -0,0 +1 @@
1
+ Either a one-line refusal that names the missing/invalid slug, a stop-and-ask response when `requirements/archive/<slug>.md` already exists and it was left unchanged, writing nothing, or the archived path (`requirements/archive/<slug>.md`) plus confirmation that it landed before the source active doc was removed and that no active requirement docs remain.
@@ -0,0 +1 @@
1
+ Archive the active requirement document into `requirements/archive/`. After it runs, zero active requirement docs remain.
@@ -0,0 +1,5 @@
1
+ Match the intent, not the exact words. Common cues:
2
+
3
+ - "归档需求", "需求归档", "把这个需求存档"
4
+ - "archive requirement"
5
+ - any request to file away the current active requirement doc
@@ -0,0 +1,23 @@
1
+ Operate on the **current project directory** only. The target is always `.claude/settings.local.json`.
2
+
3
+ 1. If the current agent is not Claude Code, refuse the request, state that this is a Claude Code-only skill, write nothing, and stop.
4
+
5
+ 2. Never write or modify `.claude/settings.json`.
6
+
7
+ 3. If `.claude/settings.local.json` does not exist, create the `.claude/` directory and write exactly:
8
+
9
+ ```json
10
+ {
11
+ "permissions": {
12
+ "defaultMode": "bypassPermissions"
13
+ }
14
+ }
15
+ ```
16
+
17
+ 4. If `.claude/settings.local.json` already exists, read it. If the file is invalid JSON or is not a JSON object, report that `.claude/settings.local.json` is malformed, write nothing, and stop.
18
+
19
+ 5. Otherwise, set only `permissions.defaultMode` to `"bypassPermissions"` in `.claude/settings.local.json`, preserve every other field and its value, and write back with 2-space indentation and a trailing newline. Do not reorder, reformat, or drop existing keys.
20
+
21
+ 6. If `permissions.defaultMode` is already `"bypassPermissions"`, make no change (idempotent no-op).
22
+
23
+ `permissions.defaultMode = "bypassPermissions"` is the verified Claude Code setting for auto-approving tools.
@@ -0,0 +1 @@
1
+ Report only the path written (`.claude/settings.local.json`) and that `permissions.defaultMode` is `bypassPermissions`. Do not include preserved setting values. Take no further action.
@@ -0,0 +1 @@
1
+ Set the current project to Claude Code bypass-permissions mode (auto-approve tools) by writing `.claude/settings.local.json`. This is a Claude Code-only skill; it has no effect on Codex, opencode, or Gemini.
@@ -0,0 +1,5 @@
1
+ Match the intent, not the exact words. Common cues:
2
+
3
+ - "bypass permissions", "auto approve", "set bypassPermissions"
4
+ - "跳过权限", "免确认", "设置 bypassPermissions"
5
+ - any request to make Claude Code stop asking for tool approval in the current project
@@ -0,0 +1,29 @@
1
+ **1. Read the worktree and the diff first.** Start from `git status` and the full diff against the base branch. Treat modified, staged, and untracked files as the user's work: read them, and never discard, stash, or overwrite them without explicit approval. If the base or the review range is unclear, ask before guessing.
2
+
3
+ **2. Did the change build what was asked? Check scope drift.** Every changed file and every new surface must trace back to the stated goal in one sentence. A pure refactor folded into a bug fix, a new dependency the goal never mentioned, or a new abstraction nothing requires is drift until justified. Label the change on target, drift, or incomplete.
4
+
5
+ **3. Classify depth, then state it.** Quick for a small, low-risk change. Standard for a medium one. Deep when the diff is large or touches auth, payments, data mutation, or destructive operations. A deeper change earns a wider read of its callers and consumers, not just the changed lines.
6
+
7
+ **4. Apply the hard stops. Fix or flag before merge.**
8
+
9
+ - No unverified claims. Never write "tests pass", "I verified", or "this fixes it" unless the command output is in front of you this session. If the judgment comes from reading the code, say that instead.
10
+ - Re-read before citing a fact. Line numbers, file state, branch position, and fallback behavior go stale. Re-check them in this pass rather than trusting memory.
11
+ - Secrets and injection. No credential hardcoded, logged, or committed. Watch for SQL, shell, and path injection at every entry point.
12
+ - Unexpected dependencies. Flag any added or version-bumped dependency the goal does not obviously require.
13
+ - Unknown identifiers. Grep before approving any symbol the diff introduces. No match outside the diff means it does not exist.
14
+ - Dead-code deletion needs proof. A "zero callers" claim must be checked across the whole repo, including tests, scripts, and dynamic lookups, before anything is removed.
15
+ - Safety sinks. Destructive file operations, path or symlink traversal, and approval-boundary changes need explicit validation, rollback, and confirmation review.
16
+ - Generated-artifact drift. If sources change, the generated or bundled output must be regenerated and included.
17
+ - String-matching on captured output. A subprocess run with inherited stdio streams its diagnostics to the terminal, not into the error message, which then holds only the command line. A matcher on that string silently matches the command, not the output. Probe the real value, or branch on a structured fact such as the exit code.
18
+ - Audit before restore. When the diff re-adds a symbol, string, or field that history removed, grep first to confirm anything still uses it. A rule or test that merely names it is not proof of life.
19
+ - Migration code for unshipped features. Reject "carry the old key forward" logic when the key never shipped. Check the last release tag: if it is absent there, no migration is needed, so ship the default.
20
+ - Install and runtime proof. For a skill, plugin, package, or installer, metadata and source tests are not enough. Build or install through the real user path, or mark that layer unverified.
21
+ - Verifier failure layer. When a check fails before its assertions run, from setup, a missing optional dependency, or the environment, classify setup failure versus product failure. Do not call the code broken until the real test body actually ran.
22
+
23
+ **5. Sweep the pattern, not just the instance.** When the change fixes one case of a bug class, grep the repo for siblings of the same shape and confirm they were handled too. List any that were missed.
24
+
25
+ **6. Gate every finding on evidence.** A HIGH or CRITICAL finding needs three things: the exact file and line, the concrete trigger that produces the bad outcome, and why existing guards do not already prevent it. Missing any one, downgrade it or drop it. Do not pad the report with low-confidence noise that trains the reader to ignore the real findings.
26
+
27
+ **7. Route the fixes.** Apply safe, risk-free fixes (typos, missing imports, obvious style) right away. Batch behavior-changing fixes (added null checks, new error handling) into one confirmation block instead of asking one at a time. Leave architecture and security tradeoffs for the user to decide, and mark informational notes as advisory.
28
+
29
+ **8. Verify before claiming done.** Run the project's own verification (its tests, lint, type check, build, or syntax check) and read the output. For a bug fix, a regression test that fails on the old code must exist before the fix counts as done. If no verification command is available, say so plainly and call it a gap. Never present unverified work as passing.
@@ -0,0 +1,13 @@
1
+ Lead with the findings, most severe first, each with its file and line, the trigger, and the fix or the open question. When there are none, say so plainly: a clean review with a stated review surface is a complete result.
2
+
3
+ Then a short sign-off block:
4
+
5
+ - files changed, and the size of the diff
6
+ - scope: on target, or the specific drift
7
+ - review depth: quick, standard, or deep
8
+ - hard stops: how many found, fixed, and deferred
9
+ - new tests, if the change needed them
10
+ - doc debt: any invariant the change introduced that the project docs do not yet capture
11
+ - verification: the command that ran, and whether it passed
12
+
13
+ Then stop. Do not merge, push, tag, or publish unless the user asks for it.
@@ -0,0 +1,3 @@
1
+ Review a code change against its goal and the available evidence before it merges or ships. Read the diff, find the real problems, fix what is safe to fix, surface the rest, and verify before calling anything done. Distilled from the default-review discipline of Waza `/check`.
2
+
3
+ It reviews code diffs and changes, not prose. A clean review is a valid result: do not invent findings to look thorough, and do not approve a risky change just to seem agreeable.
@@ -0,0 +1,5 @@
1
+ Match the intent, not the exact words. Common cues:
2
+
3
+ - "看看代码", "检查一下", "有没有问题", "是否需要优化", "合并前"
4
+ - "review my code", "check this change", "before merge", "code review"
5
+ - any request to review a diff, a pull request, or a pending change for correctness and quality before it ships
@@ -0,0 +1,24 @@
1
+ **1. Gate first.** Before mutating anything, decide whether the current directory is an agent-skill project: one that has, or is intended to have, a CLI that generates and installs skill files into agent config dirs. Heuristics: a `bin/` plus `skills/` or `shared/` or `templates/`, or a `package.json` whose purpose is skill installation. If it is clearly **not** an agent-skill project (an application, a library with no install surface), **error out** with a one-sentence reason and stop. Do not mutate a non-agent-skill project.
2
+
3
+ **2. Audit** the project against the canonical checklist below. Record each item as met or missing, with the concrete file or gap.
4
+
5
+ **3. Propose** the gap-closing changes as a concrete, reviewable patch plan: which files to add or edit, with targets. Patch what is missing or non-conforming; do not rewrite the project wholesale.
6
+
7
+ **4. Apply on approval.** Wait for explicit approval, then make the changes: add the missing `lib/` modules, wire the CLI commands, add templates, add README parity tests, add `LICENSE`. Do not apply before approval.
8
+
9
+ ### Canonical checklist (the standard this skill enforces)
10
+
11
+ - CLI surface: `version` / `--version` / `-v`, `help` / `--help` / `-h`, `install [--platform <list>]`, `uninstall [--platform <list>]`, `status` (read-only), optional `doctor`.
12
+ - `--platform` is optional, comma-separated, defaults to all platforms; unknown and duplicate values are rejected.
13
+ - Unknown options fail loud.
14
+ - `status` validates manifest **shape**, not just parse success.
15
+ - Removed or renamed commands leave no stale references (grep-clean across CLI, help, README, generated text, `AGENTS.md`, `CLAUDE.md`).
16
+ - Four platforms, all full: Claude Code, Codex, opencode, Gemini.
17
+ - Manifest-backed install safety: owned-only removal, ownership markers, atomic writes, symlink refusal.
18
+ - `install` is uninstall-first: a reinstall resets the previously-owned files (pruning skills no longer installed) before regenerating, so no manual `uninstall` is needed. It still refuses to overwrite a user-edited owned file and rolls back instead of destroying it.
19
+ - A golden snapshot of the generated skill shell, masking embedded `shared/` body.
20
+ - A bilingual README (`README.md` plus `README.zh-CN.md`) with identical headings, English literals preserved, and content-pinning tests.
21
+
22
+ ### Self-conformance
23
+
24
+ A project that ships this standard must conform to it itself. The machine-checkable part is an executable self-conformance test (the five core commands resolve, EN/CN README headings match, the manifest module and `LICENSE` exist, `package.json` carries the required fields). The remainder is this skill's judgment when applied to its own source.
@@ -0,0 +1,3 @@
1
+ For a non-agent-skill project: a one-sentence refusal and stop, with nothing mutated.
2
+
3
+ For an agent-skill project: the audit result (each checklist item, met or missing), followed by the proposed patch plan. On approval, the applied changes. Then stop.
@@ -0,0 +1 @@
1
+ Bring an agent-skill project up to the `xsk` standard, or refuse if the target is not an agent-skill project. The standard is self-owned and canonical: it lives in this skill, not in an external file that can drift.
@@ -0,0 +1,5 @@
1
+ Match the intent, not the exact words. Common cues:
2
+
3
+ - "scaffold skill project", "make this a skill installer", "conform to skill standard"
4
+ - "项目规范化", "agent 技能项目脚手架"
5
+ - any request to bring a project up to a multi-platform agent-skill installer standard
@@ -0,0 +1,15 @@
1
+ **1. Preflight on durable context.** Before designing, scan `AGENTS.md`, `CLAUDE.md`, and any repo rules or config for hard constraints that would forbid or force a choice: lint rules, test conventions, locked decisions, "never do X" rules. If a hard rule conflicts with the likely plan, name it before going further.
2
+
3
+ **2. Check for an existing solution first.** If a library, framework, CLI, or the codebase already solves the problem, prefer that over inventing something. Only design custom when no adequate existing solution exists.
4
+
5
+ **3. Match the depth to the problem.**
6
+
7
+ - **Lightweight.** Small, reversible, low-stakes. One paragraph, one recommendation, done.
8
+ - **Evaluation.** A genuine choice between approaches. Lay out the realistic options, weigh the tradeoffs that actually matter, and recommend one with rationale. Mention a second option only if the tradeoff is genuinely close. Do not manufacture alternatives just to look thorough.
9
+ - **Triage.** Unclear or multi-part problem. Decompose first: separate the parts, order them, and identify which part actually needs design versus which is mechanical. Then design only the part that needs it.
10
+
11
+ **4. Declare premise collapse explicitly.** If the whole plan rests on one assumption that, if wrong, invalidates everything, say so as a single sentence up front: "This assumes X; if X is false, the rest does not hold."
12
+
13
+ **5. No placeholders in an approved plan.** A plan is not done until every decision is concrete. No "TBD", no "figure out later", no "we'll decide". If a decision is genuinely open, it goes into Open Questions for the user to resolve, not into the plan body.
14
+
15
+ **6. Stop at the design.** Output the plan, surface blocking ambiguities as one-sentence questions, then stop. Implementation starts only on explicit approval.
@@ -0,0 +1,9 @@
1
+ A **Proposed Design Summary** with these parts:
2
+
3
+ - The recommended approach, with rationale.
4
+ - The premise-collapse assumption, if there is one.
5
+ - The concrete steps, structured so an executor can act without re-deciding (the handoff is execution-shaped, not exploration-shaped).
6
+ - A short **Gotchas** table of the traps to avoid.
7
+ - **Open Questions**, if any, that only the user can resolve.
8
+
9
+ Then stop and wait for approval. Do not begin implementation.
@@ -0,0 +1,3 @@
1
+ Turn a rough idea into a decision-complete plan before any code is written. xsk-think does the weighing, the option-trimming, and the ambiguity-surfacing up front, so that once you approve, the implementation is mostly mechanical.
2
+
3
+ It is planning-only. It writes no code, no scaffolding, and no pseudo-code.
@@ -0,0 +1,6 @@
1
+ Match the intent, not the exact words. Common cues:
2
+
3
+ - "出方案", "给方案", "怎么设计", "用什么方案"
4
+ - "判断一下", "有没有必要", "值不值得"
5
+ - "plan this", "how should I", "should we keep this"
6
+ - any request to design something, choose between approaches, or judge whether a piece of work is worth doing
@@ -0,0 +1,33 @@
1
+ **1. Read the project first.** `grep` and `read` the current project structure, config files (`package.json` and the like), and relevant code to ground the requirement in reality. Never quote defaults from memory.
2
+
3
+ **2. Locate or create the active requirement doc.** Scan `requirements/*.md` for frontmatter `status: active`. There is **at most one** active doc at a time. If more than one exists, stop, list the offending paths, and report the broken invariant for the user to resolve. If one exists, lock onto it and append or refine. If none exists, create `requirements/<slug>.md` with `status: active` and a slug generated from the need.
4
+
5
+ **3. Ensure the directory convention.** Auto-create `requirements/.gitignore` containing `archive/` if it is absent (creating `requirements/` and `requirements/archive/` as needed). Never overwrite an existing `.gitignore`; append `archive/` only if the line is missing.
6
+
7
+ **4. Convert fuzzy into concrete.** Match the document structure to the input richness:
8
+
9
+ - A minimal one-liner becomes a concise requirement: Goal, Scope, Acceptance. Do not force a Background section that would be filler.
10
+ - Richer input becomes Background, Goal, Scope (in and out), Requirements, Open Questions, Checkpoints.
11
+
12
+ **5. Decision points go to the user.** When a genuine technical or scoping choice would change the implementation, stop and ask the user to decide. Surface the options and the tradeoffs; let them pick. Do not pick silently.
13
+
14
+ **6. Brainstorm the genuinely open-ended.** Where the need is open-ended, run a short exploration with the user before writing.
15
+
16
+ **7. Wording.** Natural, fluent English (or match the project's language). No em-dash (U+2014) or en-dash (U+2013). No formulaic phrasing, no filler conclusions. The author's voice wins; most editing is subtraction.
17
+
18
+ **8. Self-audit checkpoint.** Before finalizing, audit the requirement against itself. A document that fails this gate is not ready.
19
+
20
+ - **Conflict check:** verify no internal contradictions (Goal versus Scope, in-scope versus out-of-scope, Requirements versus Open Questions, any two statements that cannot both hold). Resolve every conflict, or surface it to the user. A finalized doc contains zero conflicts.
21
+ - **Ambiguity check:** verify no undefined terms, unstated assumptions, or vague qualifiers ("fast", "supported", "as needed") that would force the implementer to guess. Tighten each to a concrete, testable statement. A finalized doc leaves no ambiguity that blocks implementation.
22
+ - **Checkpoint gates:** ensure the requirement defines the verification points where downstream implementation must pause and confirm against the requirement (acceptance criteria, integration gates, review gates). If it lacks them, add them before finalizing.
23
+ - If the audit surfaces issues only the user can resolve, stop, list them, and ask. Do not write a contradictory or under-specified doc.
24
+
25
+ The document frontmatter:
26
+
27
+ ```markdown
28
+ ---
29
+ status: active
30
+ slug: <slug>
31
+ created_at: <ISO date>
32
+ ---
33
+ ```
@@ -0,0 +1 @@
1
+ The path of the requirement file, with confirmation that it is now the single active doc.
@@ -0,0 +1 @@
1
+ Convert plain-language ("白话") needs into a compliant requirement document in `requirements/`, grounded in the current project's actual code. The output is a doc an implementer can act on without guessing, not a transcript of the request.
@@ -0,0 +1,5 @@
1
+ Match the intent, not the exact words. Common cues:
2
+
3
+ - "写需求", "需求文档", "把这个需求写清楚", "需求整理"
4
+ - "write a requirement", "turn this into a spec"
5
+ - any request to capture a fuzzy need as a structured, grounded requirement doc
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: {{NAME}}
3
+ description: {{DESCRIPTION}}
4
+ ---
5
+
6
+ # {{NAME}}
7
+
8
+ {{PURPOSE}}
9
+
10
+ ## When to use
11
+
12
+ {{TRIGGERS}}
13
+
14
+ ## How it works
15
+
16
+ {{BEHAVIOR}}
17
+
18
+ ## Output
19
+
20
+ {{OUTPUT}}
21
+
22
+ {{SHARED}}