@pi-unipi/milestone 0.1.8 → 2.0.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
@@ -1,17 +1,47 @@
1
1
  # @pi-unipi/milestone
2
2
 
3
- Lifecycle layer for project-level goals. Track progress across multiple workflow cycles via a `MILESTONES.md` file with automatic context injection and sync.
3
+ Track project goals across workflow cycles. A `MILESTONES.md` file with phases and checkbox items that stays in sync with your specs, plans, and completed work.
4
4
 
5
- ## Why
5
+ Workflow operates at the task level — brainstorm, plan, work, review. Project goals scatter across those documents. Milestone gives you a single view of what's done and what's left, and keeps the agent aligned with your goals across sessions.
6
6
 
7
- Workflow operates at the task level — brainstorm, plan, work, review. But project goals are scattered across specs, plans, and quick-work docs. Milestone provides a unified view of "what's left to do" and keeps the agent aligned with project goals across sessions.
7
+ ## Commands
8
8
 
9
- ## How It Works
9
+ | Command | Description |
10
+ |---------|-------------|
11
+ | `/unipi:milestone-onboard` | Create MILESTONES.md from existing workflow docs |
12
+ | `/unipi:milestone-update` | Sync MILESTONES.md with completed work |
10
13
 
11
- 1. **MILESTONES.md** — A markdown file with phases and checkbox items that tracks your project goals
12
- 2. **Session start hook** — Reads milestones and injects progress summary into the system prompt
13
- 3. **Session end hook** — Scans modified workflow docs, detects completed items, auto-updates milestones
14
- 4. **Coexist triggers** — Hooks into brainstorm/plan/consolidate to suggest milestone updates
14
+ ## Special Triggers
15
+
16
+ ### Session Start
17
+
18
+ On `before_agent_start`, milestone reads `.unipi/docs/MILESTONES.md` and appends a progress summary to the system prompt:
19
+
20
+ ```
21
+ ## Project Milestones
22
+ Overall progress: 5/10 items (50%)
23
+ Phase 1: Foundation: 3/5 done
24
+ Phase 2: Features: 2/5 done
25
+ Current focus: Phase 1: Foundation
26
+ ```
27
+
28
+ If MILESTONES.md doesn't exist, no context is injected.
29
+
30
+ ### Session End
31
+
32
+ On `session_shutdown`, milestone scans workflow docs modified during the session. Detects items that changed from `- [ ]` to `- [x]` and auto-updates MILESTONES.md using exact text matching.
33
+
34
+ ### Coexist Triggers
35
+
36
+ | Trigger | Behavior |
37
+ |---------|----------|
38
+ | After brainstorm | Checks if new spec items map to milestones, logs suggestions |
39
+ | After plan | Maps plan tasks to milestone items, logs coverage |
40
+ | After consolidate | References auto-sync from session shutdown |
41
+
42
+ All triggers are non-blocking and skip gracefully if MILESTONES.md doesn't exist.
43
+
44
+ Milestone registers with the info-screen dashboard, showing progress, current phase, and remaining items.
15
45
 
16
46
  ## MILESTONES.md Format
17
47
 
@@ -40,26 +70,12 @@ updated: 2026-04-28
40
70
  - [ ] Notification service
41
71
  ```
42
72
 
43
- ## Skills
44
-
45
- ### `/unipi:milestone-onboard`
46
-
47
- Create MILESTONES.md from existing workflow docs. Scans specs, plans, quick-work, debug, fix, and chore docs to group scattered tasks into coherent milestone phases.
48
-
49
- **Phases:** Explore → Propose → Refine → Write → Report
50
-
51
- ### `/unipi:milestone-update`
52
-
53
- Sync MILESTONES.md with completed work. Detects checkbox changes in workflow docs and updates milestone items.
54
-
55
- **Phases:** Scan → Diff → Resolve → Write → Report
56
-
57
73
  ## API Exports
58
74
 
59
75
  ```typescript
60
76
  import {
61
- parseMilestones, // Parse MILESTONES.md MilestoneDoc
62
- writeMilestones, // Write MilestoneDoc MILESTONES.md
77
+ parseMilestones, // Parse MILESTONES.md to MilestoneDoc
78
+ writeMilestones, // Write MilestoneDoc to MILESTONES.md
63
79
  updateItemStatus, // Toggle a checkbox item
64
80
  getProgressSummary, // Get progress stats
65
81
  } from "@pi-unipi/milestone";
@@ -73,51 +89,10 @@ import type {
73
89
  } from "@pi-unipi/milestone";
74
90
  ```
75
91
 
76
- ## Lifecycle Hooks
77
-
78
- ### Session Start
79
-
80
- On `before_agent_start`, reads `.unipi/docs/MILESTONES.md` and appends a progress summary to the system prompt:
81
-
82
- ```
83
- ## Project Milestones
84
- Overall progress: 5/10 items (50%)
85
- Phase 1: Foundation: 3/5 done
86
- Phase 2: Features: 2/5 done
87
- Current focus: Phase 1: Foundation
88
- ```
89
-
90
- If MILESTONES.md doesn't exist, no context is injected.
91
-
92
- ### Session End
93
-
94
- On `session_shutdown`, scans workflow docs modified during the session. Detects items that changed from `- [ ]` to `- [x]` and auto-updates MILESTONES.md using exact text matching.
95
-
96
- Unmatched items are logged as warnings — resolve manually with `/unipi:milestone-update`.
97
-
98
- ## Coexist Triggers
99
-
100
- | Trigger | Behavior |
101
- |---------|----------|
102
- | After brainstorm | Checks if new spec items map to milestones, logs suggestions |
103
- | After plan | Maps plan tasks to milestone items, logs coverage |
104
- | After consolidate | References auto-sync from session shutdown |
105
-
106
- All triggers are non-blocking and skip gracefully if MILESTONES.md doesn't exist.
107
-
108
- ## Info Screen
109
-
110
- Registers a "Milestones" group in the info-screen dashboard showing:
111
- - **Progress** — completed/total items with percentage
112
- - **Current Phase** — phase name with per-phase breakdown
113
- - **Remaining** — items left to complete
114
-
115
- ## Configuration
92
+ ## Configurables
116
93
 
117
94
  No configuration needed. Place MILESTONES.md at `.unipi/docs/MILESTONES.md` and the extension handles the rest.
118
95
 
119
- ## Dependencies
96
+ ## License
120
97
 
121
- - `@pi-unipi/core` — shared constants and utilities
122
- - `@mariozechner/pi-coding-agent` — extension API
123
- - `@mariozechner/pi-tui` — TUI types
98
+ MIT
package/commands.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * loads SKILL.md content and sends it as a user message.
7
7
  */
8
8
 
9
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
9
+ import type { ExtensionAPI, ExtensionCommandContext } from "@mariozechner/pi-coding-agent";
10
10
  import { UNIPI_PREFIX, MILESTONE_COMMANDS, MILESTONE_DIRS } from "@pi-unipi/core";
11
11
  import { parseMilestones } from "./milestone.js";
12
12
  import { readFileSync } from "node:fs";
@@ -33,7 +33,7 @@ export function registerCommands(pi: ExtensionAPI): void {
33
33
  // milestone-onboard — create milestones from existing work
34
34
  pi.registerCommand(`${UNIPI_PREFIX}${MILESTONE_COMMANDS.ONBOARD}`, {
35
35
  description: "Create MILESTONES.md from existing workflow docs — scan, propose, refine, write",
36
- handler: async (args: string, ctx: any) => {
36
+ handler: async (args: string, ctx: ExtensionCommandContext) => {
37
37
  const skillContent = loadSkill("milestone-onboard");
38
38
 
39
39
  let message = "Execute the milestone-onboard workflow.";
@@ -55,7 +55,7 @@ export function registerCommands(pi: ExtensionAPI): void {
55
55
  // milestone-update — sync milestones with completed work
56
56
  pi.registerCommand(`${UNIPI_PREFIX}${MILESTONE_COMMANDS.UPDATE}`, {
57
57
  description: "Sync MILESTONES.md with completed work — scan docs, diff checkboxes, auto-update",
58
- handler: async (args: string, ctx: any) => {
58
+ handler: async (args: string, ctx: ExtensionCommandContext) => {
59
59
  const skillContent = loadSkill("milestone-update");
60
60
 
61
61
  let message = "Execute the milestone-update workflow.";
package/index.ts CHANGED
@@ -21,8 +21,7 @@ export default function milestoneExtension(pi: ExtensionAPI): void {
21
21
  registerCommands(pi);
22
22
 
23
23
  // Register info-screen group
24
- const globalObj = globalThis as any;
25
- const registry = globalObj.__unipi_info_registry;
24
+ const registry = globalThis.__unipi_info_registry;
26
25
  if (registry) {
27
26
  registry.registerGroup({
28
27
  id: "milestone",
@@ -63,7 +62,7 @@ export default function milestoneExtension(pi: ExtensionAPI): void {
63
62
  }
64
63
 
65
64
  // Emit module ready event
66
- emitEvent(pi as any, UNIPI_EVENTS.MODULE_READY, {
65
+ emitEvent(pi, UNIPI_EVENTS.MODULE_READY, {
67
66
  name: MODULES.MILESTONE,
68
67
  version: "0.1.0",
69
68
  commands: Object.values(MILESTONE_COMMANDS),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/milestone",
3
- "version": "0.1.8",
3
+ "version": "2.0.0",
4
4
  "description": "Lifecycle layer for project-level goals — MILESTONES.md tracking, session hooks, auto-sync",
5
5
  "type": "module",
6
6
  "license": "MIT",