dev-sesssion 2.0.0 → 2.0.1

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 (2) hide show
  1. package/README.md +220 -0
  2. package/package.json +2 -3
package/README.md ADDED
@@ -0,0 +1,220 @@
1
+ # dev-sesssion
2
+
3
+ **Keep your AI coding assistant oriented across sessions — a `.session/` directory tracks tasks and state, and generates a ≤15-line prompt for every new conversation.**
4
+
5
+ ```bash
6
+ npx dev-sesssion@latest init
7
+ ```
8
+
9
+ ---
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ # No global install needed
15
+ npx dev-sesssion@latest init
16
+
17
+ # Or install globally
18
+ npm install -g dev-sesssion
19
+ dev-sesssion init
20
+ ```
21
+
22
+ **Requires:** Node.js ≥ 20.
23
+
24
+ ---
25
+
26
+ ## Quick start
27
+
28
+ ```bash
29
+ # 1. Initialize — wizard splits your plan into chunks and indexes your codebase
30
+ npx dev-sesssion@latest init
31
+
32
+ # 2. Start each coding session by pasting the generated prompt
33
+ dev-sesssion prompt # print NEXT_PROMPT.md
34
+ # paste into Claude, Cursor, opencode, or any AI chat
35
+
36
+ # 3. After the session — mark tasks done and regenerate the prompt
37
+ dev-sesssion update
38
+
39
+ # 4. When a chunk is fully done — archive it and move to the next
40
+ dev-sesssion advance
41
+
42
+ # Check progress anytime
43
+ dev-sesssion status # task %, token budget, health warnings
44
+ ```
45
+
46
+ ---
47
+
48
+ ## Core concepts
49
+
50
+ ### Context snapshot
51
+
52
+ Every session starts with `NEXT_PROMPT.md` — a ≤15-line file that tells the AI exactly what chunk is active, which files to load, which tasks are pending, and how much context budget is available. `dev-sesssion prompt` prints it; you paste it. The AI is fully oriented in under a minute.
53
+
54
+ The underlying data lives in `SESSION_STATE.md`: task statuses, notes from the session, and the last-touched files. `dev-sesssion update` writes back to it interactively. Nothing accumulates in your AI tool's global config — the session brain is entirely in `.session/`.
55
+
56
+ ### File registry
57
+
58
+ `FILE_INDEX.md` is an annotated table of every file the AI should know about, tagged by plan chunk. It tracks each file's purpose and a token-cost estimate. `dev-sesssion index add <files>` appends entries; `dev-sesssion index audit` flags stale ones when files are deleted or moved.
59
+
60
+ The registry keeps context budgets honest. `dev-sesssion status` shows a per-file breakdown so you know exactly how many tokens you're handing to the AI before the session starts — not mid-conversation when it's too late.
61
+
62
+ ### Plan chunks
63
+
64
+ Your project plan lives in numbered `PLAN_*.md` files — one chunk per meaningful slice of work. Chunking is what keeps context permanently lean: the AI loads only the active chunk's plan, files, and state. Everything prior is archived.
65
+
66
+ `dev-sesssion advance` closes the current chunk automatically: marks it complete, rotates the FILE_INDEX to the next chunk's files, and regenerates `NEXT_PROMPT.md` for chunk N+1. The session brain resets with zero manual intervention.
67
+
68
+ ---
69
+
70
+ ## Toy example
71
+
72
+ You're building a payments service. After `init`, your `.session/` looks like:
73
+
74
+ ```
75
+ .session/
76
+ ├── SESSION_STATE.md ← active chunk, task list, notes
77
+ ├── FILE_INDEX.md ← 12 files tagged to chunks 1-3
78
+ ├── NEXT_PROMPT.md ← ≤15 lines to paste at session start
79
+ ├── PLAN_1.md ← "Stripe integration" — 5 tasks
80
+ ├── PLAN_2.md ← "Webhooks" — not started yet
81
+ └── ROUTINES.md ← session start/end checklist
82
+ ```
83
+
84
+ Paste `NEXT_PROMPT.md` into Claude. It loads `src/payments/stripe-client.ts` and `src/payments/types.ts` — nothing else. After the session:
85
+
86
+ ```bash
87
+ dev-sesssion update # ✓ mark 3 of 5 tasks done, add a note
88
+ dev-sesssion status # 3/5 tasks · 14,200/200,000 tokens (7%)
89
+ ```
90
+
91
+ When chunk 1 is fully done:
92
+
93
+ ```bash
94
+ dev-sesssion advance # archives chunk 1 → activates chunk 2 → new NEXT_PROMPT.md written
95
+ ```
96
+
97
+ The next session opens on the Webhooks chunk. No manual file wrangling, no stale context.
98
+
99
+ ---
100
+
101
+ ## Commands
102
+
103
+ | Command | Description |
104
+ |---|---|
105
+ | `dev-sesssion init` | Initialize `.session/` — wizard: plan, mode, file index |
106
+ | `dev-sesssion status` | Task progress, context budget, health warnings |
107
+ | `dev-sesssion update` | Mark tasks done interactively, add notes |
108
+ | `dev-sesssion advance` | Archive current chunk, move to next, regenerate prompt |
109
+ | `dev-sesssion prompt` | Print `NEXT_PROMPT.md` to stdout |
110
+ | `dev-sesssion index add <files>` | Add files to `FILE_INDEX.md` |
111
+ | `dev-sesssion index audit` | Detect stale or missing FILE_INDEX entries |
112
+ | `dev-sesssion health` | Full session audit — staleness, budget, missing files |
113
+ | `dev-sesssion health --fix` | Auto-remove stale FILE_INDEX entries |
114
+ | `dev-sesssion import --from claude` | Pull CLAUDE.md sections into session notes |
115
+ | `dev-sesssion import --from cursor` | Pull `.cursor/rules` globs into FILE_INDEX |
116
+ | `dev-sesssion export --to claude` | Sync session state back to CLAUDE.md |
117
+ | `dev-sesssion export --to cursor` | Sync FILE_INDEX tags to `.cursor/rules` |
118
+ | `dev-sesssion migrate` | Initialize dev-sesssion in each monorepo package |
119
+
120
+ **Global flags:**
121
+
122
+ | Flag | Description |
123
+ |---|---|
124
+ | `--cwd <path>` | Run in a different directory |
125
+ | `-y, --yes` | Skip prompts, use defaults |
126
+ | `--dry-run` | Preview writes without writing |
127
+ | `-v, --verbose` | Detailed output |
128
+ | `--strict` | Block on secret detection instead of warning |
129
+ | `--adapter <name>` | Override adapter detection (`claude`, `opencode`, `cursor`) |
130
+
131
+ ---
132
+
133
+ ## Adapters
134
+
135
+ `dev-sesssion` auto-detects your AI tool and generates output in the format it expects:
136
+
137
+ | Tool | Detected by | Output |
138
+ |---|---|---|
139
+ | **Claude Code** | `CLAUDE.md` present | `@`-file mentions in `NEXT_PROMPT.md` |
140
+ | **opencode** | `AGENTS.md` present | `Exclude:` directives |
141
+ | **Cursor** | `.cursorrules` present | `Ignore:` directives |
142
+
143
+ Override detection with `--adapter <name>`.
144
+
145
+ ---
146
+
147
+ ## Team mode
148
+
149
+ ```bash
150
+ dev-sesssion init --team
151
+ ```
152
+
153
+ In team mode:
154
+
155
+ - `SESSION_STATE.md` and `NEXT_PROMPT.md` → `.gitignore` (per-developer, ephemeral)
156
+ - `FILE_INDEX.md` → `.gitattributes` with `merge=ours` (no merge conflicts)
157
+ - `PLAN_*.md` and `ROUTINES.md` → committed and shared
158
+
159
+ Everyone runs `init` once. The shared plan keeps the team on the same chunk; each developer maintains their own session state.
160
+
161
+ ---
162
+
163
+ ## Monorepo support
164
+
165
+ ```bash
166
+ dev-sesssion migrate # interactive package selection
167
+ dev-sesssion migrate --yes # initialize all packages with defaults
168
+ ```
169
+
170
+ Detects pnpm, npm, Yarn, Nx, and Turborepo workspaces.
171
+
172
+ ---
173
+
174
+ ## Security
175
+
176
+ `dev-sesssion` is built with defense-in-depth:
177
+
178
+ - **Secret scanning** — 10 regex patterns (AWS keys, GitHub tokens, private keys, etc.) on every file write. Warns by default; blocks in `--strict` mode.
179
+ - **Atomic writes** — all writes go `.tmp` → `rename()`. No partial files ever reach disk.
180
+ - **Path validation** — every external file path goes through `PathValidator.safeResolvePath()`. Path traversal attacks are rejected at the boundary.
181
+ - **Safe YAML** — uses `@11ty/gray-matter` with the JS engine disabled. No `eval()` RCE possible.
182
+
183
+ ---
184
+
185
+ ## Documentation
186
+
187
+ | Doc | What's in it |
188
+ |---|---|
189
+ | [docs/getting-started.md](./docs/getting-started.md) | Installation, `.session/` structure, first-session walkthrough |
190
+ | [docs/commands.md](./docs/commands.md) | Full command reference + global flags |
191
+ | [docs/adapters.md](./docs/adapters.md) | Using the Claude Code / opencode / Cursor / Windsurf adapters |
192
+ | [docs/authoring-adapters.md](./docs/authoring-adapters.md) | How to write a new adapter |
193
+ | [docs/team-mode.md](./docs/team-mode.md) | Shared vs personal files, gitattributes, monorepos |
194
+ | [PROTOCOL.md](./PROTOCOL.md) | The Session Protocol v1.0 spec (the `.session/` format) |
195
+ | [SECURITY.md](./SECURITY.md) | Threat model and vulnerability disclosure |
196
+
197
+ ---
198
+
199
+ ## Contributing
200
+
201
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup, conventions, and the pull request process.
202
+
203
+ ```bash
204
+ pnpm install && pnpm build && pnpm test
205
+ ```
206
+
207
+ The project is a pnpm monorepo:
208
+
209
+ | Package | Role |
210
+ |---|---|
211
+ | `packages/security` | Path validation, secret scanning, atomic writes, error types |
212
+ | `packages/core` | Session managers, plan parser, formatters, project detector |
213
+ | `packages/cli` | Commander commands, `@clack/prompts` wizard flows |
214
+ | `packages/adapters` | Claude Code, opencode, Cursor, and Windsurf adapter implementations |
215
+
216
+ ---
217
+
218
+ ## License
219
+
220
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dev-sesssion",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {
@@ -28,8 +28,7 @@
28
28
  "scripts": {
29
29
  "build": "tsup",
30
30
  "dev": "tsup --watch",
31
- "typecheck": "tsc --noEmit",
32
- "prepack": "cp ../../README.md README.md"
31
+ "typecheck": "tsc --noEmit"
33
32
  },
34
33
  "dependencies": {
35
34
  "@anthropic-ai/sdk": "0.54.0",