arreio 1.0.0-dev.1 → 1.0.1-dev.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/README.md CHANGED
@@ -78,4 +78,4 @@ Initialize a new project, enabling the project to follow the four phases of the
78
78
 
79
79
  #### /end-session
80
80
 
81
- Preserve session context with a well-documented commit capturing state, decisions, and next steps.
81
+ Preserve session context with a well-documented commit capturing state, decisions, and next steps — saved as a traceable session artifact (with agent attribution) in `docs/plans/.end-session/`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arreio",
3
- "version": "1.0.0-dev.1",
3
+ "version": "1.0.1-dev.0",
4
4
  "description": "Arreio transforms agentic coding workflows into a predictable, safe, and high-quality software delivery pipeline. Master the four core phases—Plan, Work, Review, Learn—to orchestrate a highly reliable development cycle.",
5
5
  "license": "MIT",
6
6
  "author": "Wicttor",
@@ -159,7 +159,17 @@ _No review reports yet._
159
159
 
160
160
  **Action:** Create all four directories if they don't exist.
161
161
 
162
- ### Step 11: Create Learn Category Folders
162
+ ### Step 11: Create End-Session Skill Hidden Artifact Directory
163
+
164
+ **Folder:**
165
+
166
+ - `docs/plans/.end-session/` — Stores session-end artifacts
167
+
168
+ **Rationale:** The `end-session/SKILL.md` skill saves a session artifact here for every session-end commit, providing a traceable record of what was done, why, and by which agent.
169
+
170
+ **Action:** Create the directory if it doesn't exist.
171
+
172
+ ### Step 12: Create Learn Category Folders
163
173
 
164
174
  **Folders:**
165
175
 
@@ -190,6 +200,8 @@ After initialization, verify:
190
200
  - `docs/plans/.review/index.md` (review reports registry)
191
201
  - ✓ Learn skill hidden artifact directories exist:
192
202
  - `docs/plans/.learn/.capture/`, `docs/plans/.learn/.refine/`, `docs/plans/.learn/.index/`, `docs/plans/.learn/.maintain/`
203
+ - ✓ End-session skill hidden artifact directory exists:
204
+ - `docs/plans/.end-session/`
193
205
  - ✓ Learn category folders exist:
194
206
  - `docs/learn/decision/`, `docs/learn/pattern/`, `docs/learn/gotcha/`, `docs/learn/workflow/`
195
207
  - ✓ Per-plan task indexes created on-demand by plan skill: `docs/tasks/<plan-id>/index.md` (created when Tasks phase runs)
@@ -203,6 +215,7 @@ Downstream skills (plan, learn, work, review) automatically create missing folde
203
215
  - **work** skill creates missing `docs/plans/.work/` directories (`.triage/`, `.prepare/`, `.execute/`, `.review/`) on first execution.
204
216
  - **review** skill creates missing `docs/plans/.review/` directories and `index.md` registry on first review.
205
217
  - **learn** skill creates missing `docs/plans/.learn/` directories and `docs/learn/` category folders on first learning capture.
218
+ - **end-session** skill creates missing `docs/plans/.end-session/` directory (and the `## Session Ends` section in `docs/plans/index.md`) on first session end.
206
219
 
207
220
  **However**, running `arreio-init` upfront provides several benefits:
208
221
 
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: end-session
3
+ description: "Create a single clear commit at session end capturing state. Saves a session artifact to docs/plans/.end-session/ with agent attribution from file changes."
4
+ argument-hint: "[Optional: reason for ending session]"
5
+ disable-model-invocation: true
6
+ version: 2.0.0
7
+ timestamp: "2026-09-01"
8
+ ---
9
+
10
+ # End Session
11
+
12
+ Create a well-documented commit when a work session ends, with a persistent session artifact for continuity.
13
+
14
+ ## Usage
15
+
16
+ ```text
17
+ /end-session # End current session
18
+ /end-session "switching to bugfix" # End with context note
19
+ ```
20
+
21
+ ## Workflow
22
+
23
+ ### 1. Pre-flight: Verify Changes
24
+
25
+ 1. Check working tree for modifications
26
+ 2. If no changes, inform the user and exit
27
+ 3. Show list of changed files; ask if all should be included
28
+ 4. Create `docs/plans/.end-session/` if missing (self-healing)
29
+
30
+ **Critical failure:** Working tree is unreadable or inaccessible → exit with error.
31
+
32
+ ### 2. Confirm & Prepare
33
+
34
+ 1. Ask user: "Ready to end this session?" (yes/no)
35
+ 2. If no, list incomplete work and exit
36
+ 3. Draft commit message:
37
+ - Subject: imperative mood, ≤50 chars, no period (e.g., "Add feature" not "Added")
38
+ - Body: explain **why**, not what; include skills used (e.g., "Used: -plan, -work")
39
+ - Add `[AGENT: {AGENT_NAME}]` as last line (mandatory)
40
+ 4. Show message for user approval; allow edits
41
+
42
+ **Critical failure:** User declines or message is empty after body prompt → exit without committing.
43
+
44
+ ### 3. Create & Record
45
+
46
+ 1. Stage approved files and create commit
47
+ 2. Capture commit SHA
48
+ 3. Allocate session ID: `YYYY-MM-DD-NNN` (date + sequential counter)
49
+ 4. Write session artifact to `docs/plans/.end-session/<session-id>.md`
50
+ 5. Register in `docs/plans/index.md` under `## Session Ends` (create section if missing)
51
+ 6. Report: commit SHA + artifact path + suggest `/learn maintain` if learnings were touched
52
+
53
+ **Critical failure:** Commit creation fails or artifact write fails → surface error with SHA (if captured) so user can recover manually.
54
+
55
+ ## Session Artifact Format
56
+
57
+ ```markdown
58
+ ---
59
+ type: session
60
+ session-id: 2026-09-01-001
61
+ timestamp: "2026-09-01T14:30:00"
62
+ commit-sha: "<short sha>"
63
+ agent: "<agent name>"
64
+ files-changed: <count>
65
+ status: complete
66
+ ---
67
+
68
+ # Session End: <commit subject>
69
+
70
+ ## Reason
71
+
72
+ <context note or "session complete">
73
+
74
+ ## Changed Files
75
+
76
+ - <path> (added | modified | deleted)
77
+
78
+ ## Commit Message
79
+
80
+ <verbatim subject + body>
81
+
82
+ ## Next Steps
83
+
84
+ <open todos or "none">
85
+ ```
86
+
87
+ ## Requirements
88
+
89
+ - **Changes required**: session ends only if there are staged changes
90
+ - **User approval**: commit message always shown before committing
91
+ - **No push**: changes remain local; user pushes manually
92
+ - **Attribution**: `[AGENT: ...]` trailer derived from session file changes (current agent if mixed)
93
+ - **Artifact**: saved to `docs/plans/.end-session/` and indexed in `docs/plans/index.md`
94
+
95
+ ## References
96
+
97
+ | Reference | Purpose |
98
+ | ------------------------------------------------- | ----------------------------------------- |
99
+ | [error-handling.md](references/error-handling.md) | Critical failure modes and recovery steps |
@@ -0,0 +1,80 @@
1
+ ---
2
+ title: Error Handling & Recovery
3
+ description: Critical failure modes and recovery steps for end-session
4
+ type: reference
5
+ version: 2.0
6
+ timestamp: "2026-09-01"
7
+ ---
8
+
9
+ # Error Handling & Recovery
10
+
11
+ Minimal reference for critical failures only. Surface errors explicitly; never silently skip or fabricate data.
12
+
13
+ ## Critical Failures (Exit Immediately)
14
+
15
+ | Scenario | Recovery Action |
16
+ | --------------------------------------------------------------- | ---------------------------------------------------------- |
17
+ | Working tree is unreadable (repo access issue) | Log error; ask user to verify repository is accessible |
18
+ | Working tree is clean (no changes) | Inform user, exit gracefully (nothing to commit) |
19
+ | User declines session completion (Phase 2) | List incomplete work, exit without committing |
20
+ | Commit message is empty or invalid | Re-prompt user; never commit with placeholder |
21
+ | Commit creation fails (identity not configured, hook rejection) | Log failure reason; do not fabricate SHA; suggest fix |
22
+ | File write fails (artifact or index permission denied) | Log error; provide commit SHA so user can recover manually |
23
+
24
+ ## Self-Healing (Non-Blocking)
25
+
26
+ - **Missing `docs/plans/.end-session/`** → create it automatically
27
+ - **Missing `## Session Ends` in `docs/plans/index.md`** → create section before appending
28
+ - **Missing `docs/plans/index.md` entirely** → create minimal index with section
29
+
30
+ ## User Decisions Always Required
31
+
32
+ - Confirm session completion (Phase 2)
33
+ - Approve commit message before committing
34
+ - Approve staging files before commit creation
35
+
36
+ 4. If terminate = Yes: stop and inform the user with:
37
+ - Error category and trigger
38
+ - Recovery action attempted
39
+ - Reason for termination
40
+ 5. If terminate = No: after recovery, continue to the next step of the phase
41
+
42
+ ````
43
+
44
+ ## Retry Limits
45
+
46
+ - **Maximum retries per error:** 1
47
+ - **Maximum total retries per phase:** 2
48
+ - After exhausting retries, terminate with a clear error explaining what failed and suggesting the user resolve the underlying issue and re-run `/end-session`.
49
+
50
+ ## Error Reporting Format
51
+
52
+ When reporting an error to the user, use this format:
53
+
54
+ ```yaml
55
+ error:
56
+ phase: pre-flight | confirm-completion | prepare-commit | create-commit | save-artifact | post-commit
57
+ step: 0 | 1 | 2 | ...
58
+ category: 1 | 2 | 3 | 4 | 5 | 6
59
+ trigger: "[specific trigger description]"
60
+ recovery_attempted: "[action taken]"
61
+ outcome: recovered | terminated
62
+ suggestion: "[next step for the user]"
63
+ ````
64
+
65
+ ## Cross-Phase Consistency Checks
66
+
67
+ | Check | Action on Failure |
68
+ | -------------------------------------------------------------------------- | -------------------------------------------------------- |
69
+ | `interactionMode` is identical across all phases | Log warning; use the earliest non-default value |
70
+ | Change list in Phase 3/4 matches the Pre-flight list (no silent additions) | Reject; return to Pre-flight |
71
+ | Session artifact `commit-sha` matches the commit reported in Phase 4 | Reject the artifact; re-run Phase 5 with the correct SHA |
72
+ | Session artifact `agent` matches the attribution confirmed in Phase 3 | Reject the artifact; re-run Phase 5 |
73
+ | `session-id` date matches today's date | Reject; re-allocate the session-id |
74
+
75
+ ## Notes
76
+
77
+ - All errors and warnings should be logged with a timestamp for debugging.
78
+ - Graceful exits (clean tree, user-declined completion) are **not** failures — they are valid outcomes of Phases 1–2 and must be reported as such.
79
+ - The skill is not resume-safe by design: a failed session end is re-run from Phase 1 with a fresh look at the working tree. The only idempotent write is the session artifact (overwrite on the same `session-id`, never duplicate).
80
+ - This reference is shared by all six phases; phase-specific handling is documented inline in the SKILL.md workflow.