@xenonbyte/xsk 0.1.0 → 0.1.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.
- package/README.md +46 -24
- package/README.zh-CN.md +46 -24
- package/bin/xsk.js +10 -1
- package/lib/adapters/opencode.js +7 -1
- package/lib/capability.js +29 -2
- package/lib/install.js +96 -7
- package/lib/manifest.js +21 -1
- package/lib/skills.js +16 -2
- package/lib/status.js +33 -4
- package/lib/uninstall.js +88 -10
- package/package.json +1 -1
- package/skills/archive-req/SKILL.md +11 -6
- package/skills/check/SKILL.md +1 -1
- package/skills/consume-point/SKILL.md +43 -0
- package/skills/point/SKILL.md +68 -0
- package/skills/skill-scaffold/SKILL.md +5 -2
- package/skills/write-req/SKILL.md +14 -7
- package/templates/fragments/archive-req.behavior.md +8 -3
- package/templates/fragments/archive-req.output.md +1 -1
- package/templates/fragments/archive-req.purpose.md +1 -1
- package/templates/fragments/check.behavior.md +1 -1
- package/templates/fragments/consume-point.behavior.md +13 -0
- package/templates/fragments/consume-point.output.md +1 -0
- package/templates/fragments/consume-point.purpose.md +1 -0
- package/templates/fragments/consume-point.triggers.md +5 -0
- package/templates/fragments/point.behavior.md +35 -0
- package/templates/fragments/point.output.md +1 -0
- package/templates/fragments/point.purpose.md +3 -0
- package/templates/fragments/point.triggers.md +6 -0
- package/templates/fragments/skill-scaffold.behavior.md +5 -2
- package/templates/fragments/write-req.behavior.md +11 -4
- package/templates/fragments/write-req.output.md +1 -1
- package/templates/fragments/write-req.purpose.md +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
**1. Ground in the current project.** Read the relevant code, config, and docs before forming any opinion. Never rely on memory for project-specific facts. Identify the one aspect under investigation and state it as a single sentence.
|
|
2
|
+
|
|
3
|
+
**2. Research with xsk-think's discipline.** Apply the same depth-matching, option-weighing, and premise-collapse discipline that `xsk-think` uses: match depth to the problem (lightweight, evaluation, or triage), declare premise collapse explicitly if one assumption invalidates everything, and reach a decision-complete landed plan. Do not stop at "it depends" - resolve the options and commit to one. If a blocking decision can only be resolved by the user, surface it as a single question before writing anything.
|
|
4
|
+
|
|
5
|
+
**3. Re-invoke-by-slug to refine.** If the user supplies a slug and `.xsk/points/<slug>.md` already exists, load it, treat the existing `## Research` and `## Landed plan` as prior context, and refine in place rather than starting over. Update the file with the refined content; do not create a duplicate.
|
|
6
|
+
|
|
7
|
+
**4. Persist the point document.** Write `.xsk/points/<slug>.md` where `<slug>` is generated from the aspect title using the pattern `^[a-z0-9]+(-[a-z0-9]+)*$`. Set `status: researching` while work is in progress; promote to `status: ready` only when the `## Landed plan` is decision-complete and the user confirms.
|
|
8
|
+
|
|
9
|
+
Point document schema:
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
---
|
|
13
|
+
status: researching | ready
|
|
14
|
+
slug: <slug>
|
|
15
|
+
created_at: <ISO date>
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# <title>
|
|
19
|
+
|
|
20
|
+
## Aspect
|
|
21
|
+
|
|
22
|
+
One-sentence statement of the aspect under investigation.
|
|
23
|
+
|
|
24
|
+
## Research
|
|
25
|
+
|
|
26
|
+
Evidence gathered, options considered, and tradeoffs weighed. Grounded in project reality.
|
|
27
|
+
|
|
28
|
+
## Landed plan
|
|
29
|
+
|
|
30
|
+
The concrete, decision-complete outcome. No "TBD". No open forks.
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**5. Ensure the gitignore line.** Ensure `.xsk/.gitignore` contains the line `points/archive/` (relative to `.xsk/`). Create `.xsk/` and `.xsk/.gitignore` if absent; append the line only if it is missing; never overwrite an existing `.xsk/.gitignore`.
|
|
34
|
+
|
|
35
|
+
**6. Drop only on user confirmation.** If the user asks to drop a point, confirm before writing. On confirmation, set `status: dropped`, add `dropped_at: <ISO date>` and a one-line `dropped_reason` to the frontmatter. Before writing, check the archive target `.xsk/points/archive/<slug>.md`: if it already exists, stop, ask the user how to proceed, and leave everything unchanged, writing nothing. Otherwise move the file to `.xsk/points/archive/<slug>.md` using write-before-remove (write the archive copy first, confirm it landed, then remove the source).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The path of the point document and its current `status`: active points (`researching`, `ready`) are at `.xsk/points/<slug>.md`; dropped points are at `.xsk/points/archive/<slug>.md`.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Research one aspect of the current project to a decision-complete landed plan and persist it as a point document in `.xsk/points/`. The result is a concrete, slug-named file an implementer can consume without re-doing the research.
|
|
2
|
+
|
|
3
|
+
It is research-and-persist only. It writes no code, no scaffolding, and no requirement document.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Match the intent, not the exact words. Common cues:
|
|
2
|
+
|
|
3
|
+
- "研究一下", "调研一下", "先搞清楚", "这块需要研究"
|
|
4
|
+
- "spike this", "research this", "figure out the approach for", "investigate"
|
|
5
|
+
- any request to explore and nail down one aspect before writing a requirement or starting implementation
|
|
6
|
+
- a slug argument that names an existing point (triggers a refinement of that point, not a new one)
|
|
@@ -13,11 +13,14 @@
|
|
|
13
13
|
- Unknown options fail loud.
|
|
14
14
|
- `status` validates manifest **shape**, not just parse success.
|
|
15
15
|
- Removed or renamed commands leave no stale references (grep-clean across CLI, help, README, generated text, `AGENTS.md`, `CLAUDE.md`).
|
|
16
|
-
- Four platforms
|
|
17
|
-
-
|
|
16
|
+
- Four platforms covered: Claude Code, Codex, opencode, Gemini.
|
|
17
|
+
- User-invocable on every platform, not merely present. Installing a skill must make it invocable on each target platform. Platforms that do not auto-expose skill files as slash commands need a verified platform-specific invocation artifact carrying the skill body and the platform's argument placeholder so invocation arguments are not dropped. This project currently implements that artifact for opencode as a command file; do not claim it for another platform until adapter, install, uninstall, status, docs, and tests all cover that platform. Claude exposes skill files directly. Verify per platform rather than assuming.
|
|
18
|
+
- Manifest-backed install safety: owned-only removal, ownership markers, atomic writes, symlink refusal, and content-hash modification detection. The manifest records a hash per owned file; a previously generated install is recognized by that hash even without the marker (markerless detection), so a user-edited owned file is detected and refused or rolled back rather than silently overwritten.
|
|
18
19
|
- `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.
|
|
20
|
+
- Built from source: skills are generated from a single per-skill source, not hand-maintained per platform or per file. The reference composes each skill from per-section fragments (`purpose`, `triggers`, `behavior`, `output`) plus a shared common body and a template, with one registry listing the skills. The build is deterministic, and the committed packed skill output stays byte-for-byte in sync with the generator, enforced by a test. The golden snapshot below is the masked form of that output.
|
|
19
21
|
- A golden snapshot of the generated skill shell, masking embedded `shared/` body.
|
|
20
22
|
- A bilingual README (`README.md` plus `README.zh-CN.md`) with identical headings, English literals preserved, and content-pinning tests.
|
|
23
|
+
- Test coverage spans the install surface, not only generation and docs: install, uninstall, uninstall-first reset, transactional rollback, and the safety refusals (a user-edited owned file, symlinked paths) are exercised by executable tests, alongside the golden snapshot, README parity, and self-conformance tests.
|
|
21
24
|
|
|
22
25
|
### Self-conformance
|
|
23
26
|
|
|
@@ -1,15 +1,16 @@
|
|
|
1
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
2
|
|
|
3
|
-
**2. Locate or create the active requirement doc.** Scan
|
|
3
|
+
**2. Locate or create the active requirement doc.** Scan `.xsk/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 `.xsk/requirements/<slug>.md` with `status: active` and a slug generated from the need.
|
|
4
4
|
|
|
5
|
-
**3. Ensure the directory convention.**
|
|
5
|
+
**3. Ensure the directory convention.** Ensure `.xsk/.gitignore` contains the line `requirements/archive/` (create `.xsk/` and `.xsk/.gitignore` if absent; append only if the line is missing; never overwrite an existing `.xsk/.gitignore`).
|
|
6
6
|
|
|
7
7
|
**4. Convert fuzzy into concrete.** Match the document structure to the input richness:
|
|
8
8
|
|
|
9
9
|
- A minimal one-liner becomes a concise requirement: Goal, Scope, Acceptance. Do not force a Background section that would be filler.
|
|
10
10
|
- Richer input becomes Background, Goal, Scope (in and out), Requirements, Open Questions, Checkpoints.
|
|
11
|
+
- Open Questions holds only non-blocking items, and each one names its disposition: escalate it to the user to decide (step 5), or defer it to a named owner at a named checkpoint. A choice that would fork the implementation is never parked here. Resolve it inline, or raise it as a decision point.
|
|
11
12
|
|
|
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
|
|
13
|
+
**5. Decision points go to the user, resolved one at a time.** 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. When several genuine decisions exist, take them in dependency order rather than all at once. Surface the most upstream open one first, fold the answer in, then re-derive what remains before surfacing the next. A resolved decision often removes or reshapes the forks beneath it, so never surface a fork whose options still depend on an open decision.
|
|
13
14
|
|
|
14
15
|
**6. Brainstorm the genuinely open-ended.** Where the need is open-ended, run a short exploration with the user before writing.
|
|
15
16
|
|
|
@@ -19,8 +20,9 @@
|
|
|
19
20
|
|
|
20
21
|
- **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
22
|
- **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.
|
|
23
|
+
- **Open-questions check:** verify every Open Question is non-blocking and names a disposition (escalated to the user, or deferred to a named owner at a named checkpoint). Resolve or raise anything that would block or fork implementation before finalizing. A finalized doc parks no blocking or unowned question.
|
|
22
24
|
- **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
|
-
|
|
25
|
+
The audit is a loop, not a single pass. If it surfaces issues only the user can resolve, take them one at a time in dependency order (as in step 5), then re-run the checks before finalizing. Repeat until one full pass finds zero conflicts, zero blocking ambiguity, and nothing left for the user to resolve. Do not write a contradictory or under-specified doc.
|
|
24
26
|
|
|
25
27
|
The document frontmatter:
|
|
26
28
|
|
|
@@ -31,3 +33,8 @@ slug: <slug>
|
|
|
31
33
|
created_at: <ISO date>
|
|
32
34
|
---
|
|
33
35
|
```
|
|
36
|
+
|
|
37
|
+
**9. Offer to commit, git-aware.** Only after the doc passes the self-audit and is finalized, decide whether to offer a commit. If the project is not a git repository (`git rev-parse --is-inside-work-tree` fails), or the requirement doc is byte-identical to what git already tracks, skip silently and say nothing about committing. Otherwise ask the user once whether to commit this requirement, and act on the answer:
|
|
38
|
+
|
|
39
|
+
- On yes, commit only the paths this run wrote: the requirement doc, plus `.xsk/.gitignore` if this run created it. Stage those exact paths first, then commit only them: `git add -- <those paths> && git commit -m "docs(xsk): write requirement <slug>" -- <those paths>`. Stage first because a bare `git commit -- <path>` rejects an untracked new doc. Never `git add -A` or `git add .`, so unrelated working-tree changes are never swept in.
|
|
40
|
+
- On no, leave the doc uncommitted and report that it was left for the user to commit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
The path of the requirement file, with confirmation that it is now the single active doc.
|
|
1
|
+
The path of the requirement file, with confirmation that it is now the single active doc, and, when a commit was offered, whether the user committed it or left it uncommitted.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Convert plain-language ("白话") needs into a compliant requirement document in
|
|
1
|
+
Convert plain-language ("白话") needs into a compliant requirement document in `.xsk/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.
|