driftseal 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.
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "driftseal",
3
+ "version": "0.1.0",
4
+ "description": "Seal intent, verification, and decisions into an auditable workflow for agentic coding",
5
+ "keywords": [
6
+ "driftseal",
7
+ "agents",
8
+ "agentic-coding",
9
+ "agent-safety",
10
+ "developer-tools",
11
+ "intent-log",
12
+ "decision-log",
13
+ "madr"
14
+ ],
15
+ "homepage": "https://github.com/ruanboyu/driftseal#readme",
16
+ "bugs": {
17
+ "url": "https://github.com/ruanboyu/driftseal/issues"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/ruanboyu/driftseal.git"
22
+ },
23
+ "license": "MIT",
24
+ "author": "Ruan Boyu <boyuruan@gmail.com>",
25
+ "type": "commonjs",
26
+ "main": "index.js",
27
+ "bin": {
28
+ "driftseal": "bin/driftseal.js"
29
+ },
30
+ "directories": {
31
+ "test": "test"
32
+ },
33
+ "files": [
34
+ "bin",
35
+ "skills",
36
+ "README.md",
37
+ "README.zh-CN.md",
38
+ "LICENSE"
39
+ ],
40
+ "scripts": {
41
+ "test": "node --test test/*.test.js"
42
+ },
43
+ "engines": {
44
+ "node": ">=18"
45
+ }
46
+ }
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: use-driftseal
3
+ description: Run repository work through the DriftSeal (`driftseal`) intent, verification, and selective decision workflow. Use when the user asks to use DriftSeal, invokes the skill by name, or works in a repository whose instructions require `driftseal`; also use to resume a DriftSeal-managed task after context loss, reconcile scope changes, close work honestly, or preserve decision context that Git and the intent log cannot recover.
4
+ ---
5
+
6
+ # Use DriftSeal
7
+
8
+ Run repository work as small, closed, auditable rounds. Treat the intent log,
9
+ decision log, and Git history as complementary records rather than duplicate
10
+ activity streams.
11
+
12
+ ## Locate DriftSeal
13
+
14
+ - Work from the repository root unless its instructions specify another scope.
15
+ - Prefer `driftseal` from `PATH`. In a DriftSeal source checkout, fall back to
16
+ `node bin/driftseal.js` when the global command is unavailable.
17
+ - Follow the repository's `AGENTS.md` and storage overrides such as `DRIFTSEAL_HOME`.
18
+ - If DriftSeal is unavailable, limit activity to read-only discovery and report the
19
+ blocker. Do not mutate the repository without the required log.
20
+
21
+ Use one command form consistently within a round. The examples below use
22
+ `driftseal`; substitute the local source command when necessary.
23
+
24
+ ## Re-anchor Before Acting
25
+
26
+ 1. Run `driftseal status` at the start of work.
27
+ 2. Run `driftseal log --last 3` after compaction, a resumed session, or uncertainty.
28
+ 3. Continue an open intent when it matches the requested work. Treat it as the
29
+ source of truth; do not open a duplicate intent.
30
+ 4. Close a conflicting intent as `partial` or `abandoned` with an honest note,
31
+ then begin the replacement round.
32
+
33
+ Do not use `--force` merely for convenience. If another live actor owns the
34
+ open intent, stop mutating and coordinate instead of abandoning its work.
35
+
36
+ ## Begin the Round
37
+
38
+ Before modifying a file or running any mutating command, declare one objective
39
+ and its proof:
40
+
41
+ ```sh
42
+ driftseal begin "<small objective for this round>" \
43
+ --verify "<exact command or outcome check>"
44
+ ```
45
+
46
+ Make the intent small enough to finish and verify in one round. Prefer an
47
+ outcome-focused check over a vague activity such as "inspect the result."
48
+ Starting the intent is the first permitted mutation.
49
+
50
+ When the round may change or confirm an existing decision, declare each one at
51
+ the boundary with `--decision <id>`. Do not add decision links speculatively.
52
+
53
+ Read-only inspection needed to choose the objective or verifier may happen
54
+ before `begin`. Do not let that inspection turn into unlogged implementation.
55
+
56
+ ## Execute Without Drift
57
+
58
+ - Change only what the open intent covers.
59
+ - Preserve unrelated worktree changes and other actors' edits.
60
+ - If the objective expands or changes, close the current intent as `partial`
61
+ or `abandoned`, then start a new round before continuing.
62
+ - If the declared verifier becomes invalid, record that honestly and start a
63
+ new round with the correct verifier instead of silently substituting proof.
64
+ - If the user replaces the active request, reconcile the open intent before
65
+ acting on the replacement.
66
+
67
+ ## Record Decisions Selectively
68
+
69
+ Before adding a decision record, ask what useful information would disappear
70
+ if only the intent log and final Git commit remained.
71
+
72
+ Add a MADR record only when it preserves at least one of these:
73
+
74
+ - a rejected path worth preventing future agents from retrying;
75
+ - an unresolved or deliberately deferred path with a concrete revisit trigger;
76
+ - non-obvious rationale or trade-offs behind an accepted choice that is
77
+ long-lived, cross-cutting, or costly to reverse;
78
+ - the reason an earlier decision became deprecated or superseded.
79
+
80
+ Skip routine, local, readily reversible choices. Do not restate an accepted
81
+ change that the intent and commit already explain.
82
+
83
+ Use `proposed` for unresolved choices still under active consideration. Use
84
+ `deferred` for choices that are deliberately postponed, and state the revisit
85
+ trigger in the outcome or consequences. Use `rejected` for an explicitly
86
+ ruled-out choice. Reserve `accepted` for the exceptional accepted decisions
87
+ whose rationale would otherwise be lost.
88
+
89
+ Count postponed choices with `driftseal decision list --status deferred --count`,
90
+ then review them with `driftseal decision list --status deferred` so they do not
91
+ disappear into the chronological log.
92
+
93
+ For every decision explicitly linked by the open intent, reconcile its current
94
+ status and rationale before a successful close:
95
+
96
+ ```sh
97
+ driftseal decision update <id> \
98
+ --status <proposed|accepted|rejected|deferred|deprecated|superseded> \
99
+ --note "<what changed or was confirmed, and why>"
100
+ ```
101
+
102
+ The update appends a decision history entry tied to the open intent. An
103
+ unchanged decision still needs an explicit confirmation note. DriftSeal rejects a
104
+ `completed` or `partial` close if any declared decision remains unreconciled;
105
+ `failed` and `abandoned` remain available as escape paths.
106
+
107
+ Do not edit a linked decision after reconciling it. Run `decision update` again
108
+ so the final content hash is recorded. If an update is interrupted, rerun it or
109
+ successfully close the linked intent; DriftSeal recovers only that intent's pending
110
+ transaction. Closing as `failed` or `abandoned` cancels its pending recovery so
111
+ historical conflicts cannot block future decision work.
112
+
113
+ ```sh
114
+ driftseal decision add "<decision title>" \
115
+ --status deferred \
116
+ --context "<problem and constraints>" \
117
+ --outcome "<current disposition, rationale, and revisit trigger>" \
118
+ --option "<considered option>" \
119
+ --consequence "<result of this disposition>"
120
+ ```
121
+
122
+ ## Verify and Close
123
+
124
+ Run the declared verification exactly as written. Then close the intent before
125
+ reporting success:
126
+
127
+ ```sh
128
+ driftseal end \
129
+ --status completed \
130
+ --note "<what actually happened>" \
131
+ --verify-result "<concise, honest result>"
132
+ ```
133
+
134
+ Choose the status from evidence:
135
+
136
+ - `completed`: achieve the objective and pass the declared verification.
137
+ - `partial`: leave useful work but do not achieve the whole objective.
138
+ - `failed`: fail to produce a usable result or fail essential verification.
139
+ - `abandoned`: intentionally stop or replace the round.
140
+
141
+ Never leave an intent open merely because the work failed. Never report a
142
+ completed result while the log still says `in_progress`.
143
+
144
+ ## Persist the Round in Git
145
+
146
+ Treat a focused Git commit as the third record: the intent says what was
147
+ planned and how it was checked, the decision log preserves otherwise-lost
148
+ context, and the commit shows what actually landed.
149
+
150
+ When the user has authorized a commit, stage and commit only the verified
151
+ changes, the closed intent events, and any relevant decision record. This
152
+ bookkeeping finalizes the just-closed round and does not require a new intent.
153
+
154
+ Keep this exception narrow. Open a new intent before making content changes,
155
+ fixing a hook failure, rewriting history, rebasing, pushing, or including work
156
+ outside the closed round.