@davidorex/pi-project-workflows 0.14.6 → 0.28.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/CHANGELOG.md ADDED
@@ -0,0 +1,84 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ## [0.28.0] - 2026-06-03
6
+ - Lockstep changes accumulating since v0.26.0; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch). The v0.27.0 tag is unpublished, so its bundled member changes remain unreleased here until the next publish.
7
+
8
+ ## [0.26.0] - 2026-05-25
9
+ - Lockstep release to 0.26.0; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
10
+
11
+ ## [0.14.6] - 2026-04-28
12
+ - Lockstep release to 0.14.6; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
13
+
14
+ ## [0.14.4] - 2026-04-07
15
+ - Lockstep release to 0.14.4; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
16
+
17
+ ## [0.14.2] - 2026-04-06
18
+ - Lockstep release to 0.14.2; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
19
+
20
+ ## [0.14.1] - 2026-04-06
21
+ - Lockstep release to 0.14.1; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
22
+
23
+ ## [0.13.0] - 2026-04-06
24
+ - Lockstep release to 0.13.0; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
25
+
26
+ ## [0.12.0] - 2026-04-06
27
+ - Lockstep release to 0.12.0; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
28
+
29
+ ## [0.11.3] - 2026-04-04
30
+ - Lockstep release to 0.11.3; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
31
+
32
+ ## [0.11.0] - 2026-04-04
33
+ - Lockstep release to 0.11.0; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
34
+
35
+ ## [0.10.5] - 2026-04-02
36
+ - Lockstep release to 0.10.5; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
37
+
38
+ ## [0.10.3] - 2026-04-02
39
+ - Lockstep release to 0.10.3; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
40
+
41
+ ## [0.10.2] - 2026-04-02
42
+ - Lockstep release to 0.10.2; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
43
+
44
+ ## [0.10.1] - 2026-04-02
45
+ - Lockstep release to 0.10.1; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
46
+
47
+ ## [0.10.0] - 2026-04-02
48
+ - Lockstep release to 0.10.0; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
49
+
50
+ ## [0.9.2] - 2026-03-31
51
+ - Lockstep release to 0.9.2; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
52
+
53
+ ## [0.9.1] - 2026-03-31
54
+ - Lockstep release to 0.9.1; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
55
+
56
+ ## [0.9.0] - 2026-03-29
57
+ - Lockstep release to 0.9.0; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
58
+
59
+ ## [0.6.1] - 2026-03-28
60
+ - Lockstep release to 0.6.1; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
61
+
62
+ ## [0.5.0] - 2026-03-28
63
+ - Lockstep release to 0.5.0; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
64
+
65
+ ## [0.4.1] - 2026-03-27
66
+ - Lockstep release to 0.4.1; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
67
+
68
+ ## [0.4.0] - 2026-03-27
69
+ - Lockstep release to 0.4.0; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
70
+
71
+ ## [0.3.4] - 2026-03-27
72
+ - Lockstep release to 0.3.4; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
73
+
74
+ ## [0.3.2] - 2026-03-26
75
+ - Lockstep release to 0.3.2; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
76
+
77
+ ## [0.3.1] - 2026-03-25
78
+ - Lockstep release to 0.3.1; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
79
+
80
+ ## [0.3.0] - 2026-03-19
81
+ - Lockstep release to 0.3.0; see member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
82
+
83
+ ## [0.2.0] - 2026-03-17
84
+ - Initial publish of the meta re-export package bundling the member Pi extensions; lockstep release to 0.2.0. See member-package changelogs (pi-context, pi-workflows, pi-behavior-monitors, pi-agent-dispatch).
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @davidorex/pi-project-workflows
2
2
 
3
- Convenience meta-package that re-exports all three [Pi](https://github.com/badlogic/pi-mono) extensions structured project state, workflow orchestration, and behavior monitoring in a single install.
3
+ Convenience meta-package that re-exports FOUR [Pi](https://github.com/badlogic/pi-mono) extensions plus the shared pi-jit-agents library. The four: pi-context (substrate), pi-workflows (orchestration), pi-behavior-monitors (classification/steering), pi-agent-dispatch (in-pi agent-as-tool dispatch + capability composition + the bounded north-star work-order loop). pi-jit-agents is a library consumed directly by pi-workflows and pi-agent-dispatch (no separate extension registration).
4
4
 
5
5
  ## Install
6
6
 
@@ -8,17 +8,19 @@ Convenience meta-package that re-exports all three [Pi](https://github.com/badlo
8
8
  pi install npm:@davidorex/pi-project-workflows
9
9
  ```
10
10
 
11
- This installs all three extensions:
12
- - **[@davidorex/pi-project](https://github.com/davidorex/pi-project-workflows/tree/main/packages/pi-project)** — schema-driven project state (typed blocks, validation, derived state)
11
+ This installs the five constituent packages (four Pi extensions plus the shared library):
12
+ - **[@davidorex/pi-context](https://github.com/davidorex/pi-project-workflows/tree/main/packages/pi-context)** — schema-driven project state (typed blocks, validation, derived state)
13
+ - **[@davidorex/pi-jit-agents](https://github.com/davidorex/pi-project-workflows/tree/main/packages/pi-jit-agents)** — agent spec compilation and in-process dispatch runtime (library, not a Pi extension)
13
14
  - **[@davidorex/pi-workflows](https://github.com/davidorex/pi-project-workflows/tree/main/packages/pi-workflows)** — workflow orchestration (YAML specs, DAG execution, checkpoint/resume)
14
15
  - **[@davidorex/pi-behavior-monitors](https://github.com/davidorex/pi-project-workflows/tree/main/packages/pi-behavior-monitors)** — behavior monitors (autonomous watchdogs, pattern classification, steering corrections)
16
+ - **[@davidorex/pi-agent-dispatch](https://github.com/davidorex/pi-project-workflows/tree/main/packages/pi-agent-dispatch)** — in-pi agent-as-tool dispatch + capability composition + bounded work-order loop (call-agent / author-agent-spec / run-real-checks / commit-attested / author-tool-grant / run-work-order-loop; dynamic composite-loader)
15
17
 
16
18
  ## Getting Started
17
19
 
18
20
  ```
19
- /project init # scaffolds .project/ with schemas and starter blocks
21
+ /context init <substrate-dir> # create the empty substrate skeleton (pointer + dirs only; no config/schemas/blocks)
20
22
  /workflow init # scaffolds .workflows/ for run state
21
- /project status # see derived project state
23
+ /context status # see derived project state
22
24
  /workflow list # discover and run workflows
23
25
  /monitors # list all monitors, scope, and state
24
26
  ```
@@ -26,6 +28,8 @@ This installs all three extensions:
26
28
  ## Documentation
27
29
 
28
30
  See the package READMEs for full API docs, source maps, and LLM guidance:
29
- - [pi-project README](https://github.com/davidorex/pi-project-workflows/tree/main/packages/pi-project)
31
+ - [pi-context README](https://github.com/davidorex/pi-project-workflows/tree/main/packages/pi-context)
32
+ - [pi-jit-agents README](https://github.com/davidorex/pi-project-workflows/tree/main/packages/pi-jit-agents)
30
33
  - [pi-workflows README](https://github.com/davidorex/pi-project-workflows/tree/main/packages/pi-workflows)
31
34
  - [pi-behavior-monitors README](https://github.com/davidorex/pi-project-workflows/tree/main/packages/pi-behavior-monitors)
35
+ - [pi-agent-dispatch README](https://github.com/davidorex/pi-project-workflows/tree/main/packages/pi-agent-dispatch)
@@ -0,0 +1 @@
1
+ export { default } from "@davidorex/pi-agent-dispatch";
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "@davidorex/pi-project-workflows",
3
- "version": "0.14.6",
3
+ "version": "0.28.0",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
4
7
  "description": "Pi extensions for structured project state, workflow orchestration, and behavior monitoring — single install for all three",
5
8
  "license": "MIT",
6
9
  "author": "David Ryan",
@@ -22,15 +25,17 @@
22
25
  "extensions": [
23
26
  "./project-extension.ts",
24
27
  "./workflows-extension.ts",
25
- "./monitors-extension.ts"
28
+ "./monitors-extension.ts",
29
+ "./dispatch-extension.ts"
26
30
  ],
27
31
  "skills": [
28
32
  "./skills"
29
33
  ]
30
34
  },
31
35
  "dependencies": {
32
- "@davidorex/pi-project": "^0.14.6",
33
- "@davidorex/pi-workflows": "^0.14.6",
34
- "@davidorex/pi-behavior-monitors": "^0.14.6"
36
+ "@davidorex/pi-context": "^0.28.0",
37
+ "@davidorex/pi-workflows": "^0.28.0",
38
+ "@davidorex/pi-behavior-monitors": "^0.28.0",
39
+ "@davidorex/pi-agent-dispatch": "^0.28.0"
35
40
  }
36
41
  }
@@ -1 +1 @@
1
- export { default } from "@davidorex/pi-project";
1
+ export { default } from "@davidorex/pi-context";
@@ -0,0 +1,138 @@
1
+ ---
2
+ name: pi-agent-dispatch
3
+ description: >
4
+ Sibling Pi extension that registers in-pi agent-as-tool dispatch, capability
5
+ composition, real-check execution, attested commits, and the bounded north-star
6
+ work-order loop. Use when authoring agent specs, granting tool capabilities,
7
+ running deterministic checks, committing with writer attestation, loading
8
+ config-declared composite operations, or driving end-to-end work-orders through
9
+ their bounded retry loop.
10
+ ---
11
+
12
+ <tools_reference>
13
+ <tool name="author-agent-spec">
14
+ Write a new .agent.yaml spec to the agents tier. Requires user authorization via interactive confirmation at the pi-dispatch auth-gate; on confirm, the verified terminal-operator identity is stamped as writer. The written file is AJV-validated against AgentSpec before persisting.
15
+
16
+ *Author a privileged JIT-agent spec — declares input, prompts, tools grant, output schema, contextBlocks.*
17
+
18
+ | Parameter | Type | Required | Description |
19
+ |-----------|------|----------|-------------|
20
+ | `name` | string | yes | Agent name (becomes <name>.agent.yaml filename + AgentSpec.name). |
21
+ | `spec` | unknown | yes | AgentSpec object body (will be serialized to YAML). Must conform to AgentSpec shape. |
22
+ | `writer` | object | yes | DispatchContext.writer payload; see pi-context/src/dispatch-context.ts for the discriminated union. |
23
+ </tool>
24
+
25
+ <tool name="call-agent">
26
+ Dispatch a privileged JIT-agent as a typed tool call. Loads the named .agent.yaml, compiles with input, composes the tool grant (intersection of caller's parentGrant and the agent's requestedGrant), and executes via pi-jit-agents executeAgent (clamp enforces child ⊆ parent at dispatch boundary).
27
+
28
+ *Dispatch a typed sub-agent with scoped capability grant.*
29
+
30
+ | Parameter | Type | Required | Description |
31
+ |-----------|------|----------|-------------|
32
+ | `spec_name` | string | yes | Name of the agent spec to load (resolves to <name>.agent.yaml in the agents tier). |
33
+ | `input` | unknown | yes | Typed input passed to the agent's compileAgent context. |
34
+ | `parent_grant` | array | no | The caller's own tool grant. Default-empty. |
35
+ | `requested_grant` | array | no | The grant requested for the dispatched sub-agent. Will be clamped to the intersection with parent_grant. |
36
+ | `max_tokens` | number | no | Max tokens for the LLM call. Defaults to 1024. |
37
+ </tool>
38
+
39
+ <tool name="run-real-checks">
40
+ Run the deterministic real-checks declared on a work-order (build/check/test exit + runtime-demo + adversarial-probe). Returns a structured RealCheckResult. NEVER LLM self-report; verdict is the actual exit code.
41
+
42
+ *Run a work-order's declared real-checks for verdict gating.*
43
+
44
+ | Parameter | Type | Required | Description |
45
+ |-----------|------|----------|-------------|
46
+ | `work_order_id` | string | yes | ID of the work-order whose real_check_criteria to run (e.g. 'WO-NNN'). |
47
+ | `max_check_time_ms` | number | no | Max total time per check in milliseconds. Defaults to 600000 (10 minutes). |
48
+ </tool>
49
+
50
+ <tool name="commit-attested">
51
+ Stage declared files + invoke git commit with DispatchContext writer.kind=agent attestation footer. Husky pre-commit runs as backup gate; never bypass (--no-verify forbidden per feedback_no_destructive_git_ops). The primary gate is run-real-checks called BEFORE this tool.
52
+
53
+ *Commit agent-authored work-product files with attestation footer.*
54
+
55
+ | Parameter | Type | Required | Description |
56
+ |-----------|------|----------|-------------|
57
+ | `files` | array | yes | Files to stage + commit. Empty array refused. |
58
+ | `message` | string | yes | Commit message body (the attestation footer is appended automatically). |
59
+ | `agent_id` | string | yes | Agent id for writer.kind=agent attestation (e.g. 'spec-implementer-001'). |
60
+ | `work_order_id` | string | no | Optional work-order id for the attestation footer. |
61
+ </tool>
62
+
63
+ <tool name="author-tool-grant">
64
+ Add or remove an entry in config.tool_operations[] or config.tool_operations_forbidden[]. Requires user authorization via interactive confirmation at the pi-dispatch auth-gate; on confirm, the verified terminal-operator identity is stamped as writer. Refuses any attempt to register a framework-forbidden wholesale token.
65
+
66
+ *Author a config tool-grant entry (operation registration or project-forbidden token).*
67
+
68
+ | Parameter | Type | Required | Description |
69
+ |-----------|------|----------|-------------|
70
+ | `target` | unknown | yes | Which config registry to mutate. |
71
+ | `operation` | unknown | yes | amendConfigEntry operation. |
72
+ | `key` | string | yes | For tool_operations: the canonical_id (must match entry.canonical_id). For tool_operations_forbidden: the token string. |
73
+ | `entry` | unknown | no | ToolOperationDecl object — required for target=tool_operations + operation=add. |
74
+ | `writer` | object | yes | DispatchContext.writer payload; see pi-context/src/dispatch-context.ts for the discriminated union. |
75
+ </tool>
76
+
77
+ <tool name="run-work-order-loop">
78
+ Execute the bounded work-order loop: dispatch target_agent (via direct pi-jit-agents library) → run-real-checks (deterministic verdict — the actual exit code, never an LLM self-report) → on-pass commit-attested → on-fail human-OK retry at the iteration boundary. Bounded iterations (default 3); human-OK gate governs retry.
79
+
80
+ *Execute the end-to-end work-order loop for a declared spec.*
81
+
82
+ | Parameter | Type | Required | Description |
83
+ |-----------|------|----------|-------------|
84
+ | `work_order_id` | string | yes | ID of the work-order to execute (loads from .project/work-orders.json schema). |
85
+ | `max_iterations` | number | no | Max iteration count before fail-final. Default 3. |
86
+ | `agent_grant` | array | no | Tool grant for the dispatched privileged agent (capability composition). Default empty. |
87
+ </tool>
88
+
89
+ </tools_reference>
90
+
91
+ <events>
92
+ `tool_call`, `tool_result`
93
+ </events>
94
+
95
+ <objective>
96
+ pi-agent-dispatch is the harness-confined orchestrator's in-pi surface. It registers Pi tools the orchestrator agent invokes to dispatch sub-agents, author specs and tool grants, run deterministic checks the executive cannot fake, commit with writer attestation, and drive bounded work-order loops. It is the sibling-consumer registration site; pi-jit-agents stays a library consumed directly by this package and by pi-workflows.
97
+ </objective>
98
+
99
+ <dispatch_tools>
100
+ | Tool | Purpose |
101
+ |------|---------|
102
+ | `call-agent` | Dispatch a declared agent spec with a composed tool grant (parent ∩ requested ∩ spec.tools). |
103
+ | `author-agent-spec` | Write an `.agent.yaml` spec to the substrate. Human-authorized via auth-gate confirm at the pi-dispatch layer; the verified terminal-operator identity is stamped as writer on confirm. |
104
+ | `run-work-order-loop` | Execute the bounded work-order loop: dispatch → run-real-checks → on-pass commit-attested → on-fail human-OK retry. |
105
+ </dispatch_tools>
106
+
107
+ <real_check_tools>
108
+ | Tool | Purpose |
109
+ |------|---------|
110
+ | `run-real-checks` | Execute declared deterministic checks (build/check/test exit codes, schema validations, git diff probes, runtime event probes). Verdict is the actual exit code, never an LLM self-report. |
111
+ | `commit-attested` | Stage + commit with writer-identity footer. Refuses on missing agent_id, files, or message. |
112
+ </real_check_tools>
113
+
114
+ <capability_authoring>
115
+ Tool grants are config-declared (bounded composites) and authored only via the `author-tool-grant` Pi tool, which is human-authorized at the pi-dispatch auth-gate (interactive confirmation; on confirm the verified terminal-operator identity is stamped as writer). Default grant is empty; widening goes through the auth-gate. The FORBIDDEN_WHOLESALE_OPERATIONS set blocks shipping wholesale L1 surfaces (bash, write, edit) as a single composite token; the L1 ∪ L5 forbidden union check refuses tokens that already appear on the L1 wholesale-forbidden list.
116
+ </capability_authoring>
117
+
118
+ <composite_loader>
119
+ On extension load, `composite-loader` reads the active substrate's `config.tool_operations[]` and dynamically registers each declared bounded composite as a Pi tool. Config-absent (no pointer or unbootstrapped substrate) degrades gracefully: extension still registers the 6 static tools; the absence is observed via the `extension_load_warning` TraceEntry and (when available) surfaced through `pi.ui.notify`. The substrate is the single source of truth — no parallel ungated path widens capability outside the loader.
120
+ </composite_loader>
121
+
122
+ <canonical_intention>
123
+ Anchors:
124
+ - Harness-confined orchestrator (positive clause: substrate-write + call-agent + author-agent-spec + run-real-checks + commit-attested + author-tool-grant + run-work-order-loop + declared composites; negative clause: NO bash/edit/write).
125
+ - Sibling-consumer scope; pi-jit-agents stays a library.
126
+ - Human-authorized authoring at the pi-dispatch auth-gate; default empty; terminal verdict = real deterministic checks.
127
+ - Capability composition + end-to-end work-order loop + bounded-composite vocabulary + launch-chain integration.
128
+ - Orchestrator uses jit-agents directly; capability composition lives in the dispatch layer.
129
+ </canonical_intention>
130
+
131
+ <success_criteria>
132
+ - 6 static tools register on every load: call-agent, author-agent-spec, author-tool-grant, run-real-checks, commit-attested, run-work-order-loop.
133
+ - Composite tools register from config.tool_operations[] when present; load proceeds with warning when absent.
134
+ - Every write-bearing tool routes through the pi-dispatch auth-gate; the verified terminal-operator identity is stamped as writer on confirm.
135
+ - Work-order loop honors max_iterations + human-OK retry gate + on-pass attested commit.
136
+ </success_criteria>
137
+
138
+ *Generated from source by `scripts/generate-skills.js` — do not edit by hand.*
@@ -76,11 +76,11 @@ Subcommands: `on`, `off`, `help`, `commit-hygiene`, `fragility`, `hedge`, `unaut
76
76
  </commands_reference>
77
77
 
78
78
  <events>
79
- `session_start`, `agent_end`, `turn_start`, `message_end`, `turn_end`, `tool_call`
79
+ `session_start`, `agent_end`, `turn_start`, `tool_call`
80
80
  </events>
81
81
 
82
82
  <bundled_resources>
83
- 5 agents, 3 schemas, 21 examples bundled.
83
+ 5 agents, 5 schemas, 21 examples bundled.
84
84
  See references/bundled-resources.md for full inventory.
85
85
  </bundled_resources>
86
86
 
@@ -95,8 +95,8 @@ See references/bundled-resources.md for full inventory.
95
95
  | `tool_results` | `{tool_results}` / `{{ tool_results }}` | Tool results with tool name and error status | Last 5, truncated 2000 chars |
96
96
  | `tool_calls` | `{tool_calls}` / `{{ tool_calls }}` | Tool calls and results interleaved | Last 20, truncated 2000 chars |
97
97
  | `custom_messages` | `{custom_messages}` / `{{ custom_messages }}` | Custom extension messages since last user message | — |
98
- | `project_vision` | `{project_vision}` / `{{ project_vision }}` | .project/project.json vision, core_value, name | — |
99
- | `project_conventions` | `{project_conventions}` / `{{ project_conventions }}` | .project/conformance-reference.json principle names | — |
98
+ | `project_vision` | `{project_vision}` / `{{ project_vision }}` | <substrate-dir>/project.json vision, core_value, name | — |
99
+ | `project_conventions` | `{project_conventions}` / `{{ project_conventions }}` | <substrate-dir>/conformance-reference.json principle names | — |
100
100
  | `git_status` | `{git_status}` / `{{ git_status }}` | Output of git status --porcelain | 5s timeout |
101
101
  | `conversation_history` | `{conversation_history}` / `{{ conversation_history }}` | Prior turn summaries (user request + actions + assistant response) | 1-3 turns adaptive, 2000 char max |
102
102
 
@@ -209,7 +209,7 @@ A `.monitor.json` file conforms to `schemas/monitor.schema.json`:
209
209
  "on_flag": {
210
210
  "steer": "Fix the issue.",
211
211
  "write": {
212
- "path": ".project/issues.json",
212
+ "path": "<substrate-dir>/issues.json",
213
213
  "merge": "append",
214
214
  "array_field": "issues",
215
215
  "template": {
@@ -475,7 +475,7 @@ acknowledgment support:
475
475
  **fragility** (`message_end`, `when: has_tool_results`)
476
476
  Watches for unaddressed fragilities after tool use — errors, warnings, or broken state the
477
477
  agent noticed but chose not to fix. Steers with "Fix the issue you left behind." Writes
478
- findings to `.project/issues.json` under `category: "fragility"`. Excludes: none. Ceiling: 5.
478
+ findings to `<substrate-dir>/issues.json` under `category: "fragility"`. Excludes: none. Ceiling: 5.
479
479
  12 bundled patterns across categories: avoidance (dismiss-preexisting, not-my-change,
480
480
  blame-environment, workaround-over-root-cause, elaborate-workaround-for-fixable),
481
481
  error-handling (empty-catch, happy-path-only, early-return-on-unexpected,
@@ -493,7 +493,7 @@ deflection (ask-permission, qualify-yesno, counter-question).
493
493
 
494
494
  **work-quality** (`command`, `when: always`)
495
495
  On-demand work quality analysis invoked via `/work-quality`. Analyzes user request, tool
496
- calls, and assistant response for quality issues. Writes findings to `.project/issues.json`
496
+ calls, and assistant response for quality issues. Writes findings to `<substrate-dir>/issues.json`
497
497
  under `category: "work-quality"`. Ceiling: 3.
498
498
  11 bundled patterns across categories: methodology (trial-and-error, symptom-fix,
499
499
  double-edit, edit-without-read, insanity-retry, no-plan), verification (no-verify),
@@ -8,8 +8,10 @@
8
8
  - `agents/unauthorized-action-classifier.agent.yaml`
9
9
  - `agents/work-quality-classifier.agent.yaml`
10
10
 
11
- ## schemas/ (3 files)
11
+ ## schemas/ (5 files)
12
12
 
13
+ - `schemas/monitor-instruction-list.schema.json`
14
+ - `schemas/monitor-pattern-list.schema.json`
13
15
  - `schemas/monitor-pattern.schema.json`
14
16
  - `schemas/monitor.schema.json`
15
17
  - `schemas/verdict.schema.json`
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: pi-project-workflows
3
3
  description: >
4
- Meta-package re-exporting pi-project (schema-driven project state),
4
+ Meta-package re-exporting pi-context (schema-driven project state),
5
5
  pi-workflows (workflow orchestration), and pi-behavior-monitors (autonomous
6
6
  behavior monitoring). Install once to get all three extensions.
7
7
  ---
@@ -15,17 +15,17 @@ pi install npm:@davidorex/pi-project-workflows
15
15
  </objective>
16
16
 
17
17
  <included_extensions>
18
- <extension name="@davidorex/pi-project">
18
+ <extension name="@davidorex/pi-context">
19
19
  Schema-driven project state management for Pi
20
20
 
21
- **Tools:** `append-block-item`, `update-block-item`, `read-block`, `write-block`, `project-status`, `project-validate`, `project-init`, `complete-task`
22
- **Commands:** `/project`
21
+ **Tools:** `append-block-item`, `update-block-item`, `append-relation`, `promote-item`, `append-block-nested-item`, `update-block-nested-item`, `remove-block-item`, `remove-block-nested-item`, `read-block-dir`, `read-block`, `write-block`, `context-status`, `context-validate`, `read-config`, `list-tools`, `read-samples-catalog`, `context-current-state`, `context-bootstrap-state`, `rename-canonical-id`, `amend-config`, `read-schema`, `write-schema`, `write-schema-migration`, `context-init`, `context-accept-all`, `context-switch`, `context-list`, `context-archive`, `filter-block-items`, `resolve-item-by-id`, `read-block-item`, `read-block-page`, `join-blocks`, `resolve-items-by-id`, `complete-task`, `context-validate-relations`, `context-edges-for-lens`, `context-walk-descendants`, `walk-ancestors`, `find-references`, `gather-execution-context`, `context-roadmap-load`, `context-roadmap-render`, `context-roadmap-validate`, `context-roadmap-list`
22
+ **Commands:** `/context`
23
23
  </extension>
24
24
 
25
25
  <extension name="@davidorex/pi-workflows">
26
26
  Workflow orchestration extension for Pi
27
27
 
28
- **Tools:** `workflow`, `workflow-list`, `workflow-agents`, `workflow-validate`, `workflow-status`, `workflow-init`
28
+ **Tools:** `workflow-execute`, `workflow-resume`, `workflow-list`, `workflow-agents`, `workflow-validate`, `workflow-status`, `workflow-init`, `render-item-by-id`, `enforce-budget`
29
29
  **Commands:** `/workflow`
30
30
  **Shortcuts:** ctrl+h (Pause running workflow), ctrl+j (Resume paused workflow)
31
31
  </extension>
@@ -37,6 +37,12 @@ Behavior monitors for pi that watch agent activity and steer corrections
37
37
  **Commands:** `/work-quality`, `/monitors`
38
38
  </extension>
39
39
 
40
+ <extension name="@davidorex/pi-agent-dispatch">
41
+ In-pi agent-as-tool dispatch + capability composition extension
42
+
43
+ **Tools:** `author-agent-spec`, `call-agent`, `run-real-checks`, `commit-attested`, `author-tool-grant`, `run-work-order-loop`
44
+ </extension>
45
+
40
46
  </included_extensions>
41
47
 
42
48
  *Generated from source by `scripts/generate-skills.js` — do not edit by hand.*
@@ -8,10 +8,10 @@ description: >
8
8
  ---
9
9
 
10
10
  <tools_reference>
11
- <tool name="workflow">
12
- Run a named workflow with typed input. Discovers workflows from .workflows/ and ~/.pi/agent/workflows/.
11
+ <tool name="workflow-execute">
12
+ Execute a named workflow with typed input. Discovers workflows from .workflows/ and ~/.pi/agent/workflows/. Auto-resumes the most recent compatible incomplete run unless fresh='true'. Use workflow-resume for explicit-only resume by runId.
13
13
 
14
- *Run a multi-step workflow with typed data flow between agents*
14
+ *Execute a multi-step workflow with typed data flow (auto-resumes compatible incomplete runs)*
15
15
 
16
16
  | Parameter | Type | Required | Description |
17
17
  |-----------|------|----------|-------------|
@@ -20,6 +20,18 @@ Run a named workflow with typed input. Discovers workflows from .workflows/ and
20
20
  | `fresh` | string | no | Set to 'true' to start a fresh run, ignoring any incomplete prior runs |
21
21
  </tool>
22
22
 
23
+ <tool name="workflow-resume">
24
+ Explicitly resume an incomplete workflow run by name + runId. Rejects when no incomplete run exists for the workflow OR when runId does not match the most recent incomplete run. Use workflow-execute for default auto-resume; this surface is for explicit-only scenarios where the caller wants to fail loudly if the run is gone or has been superseded.
25
+
26
+ *Explicitly resume an incomplete workflow run by name + runId (rejects on no-match)*
27
+
28
+ | Parameter | Type | Required | Description |
29
+ |-----------|------|----------|-------------|
30
+ | `workflow` | string | yes | Workflow name |
31
+ | `runId` | string | yes | Incomplete run ID — required, no auto-detect |
32
+ | `input` | unknown | no | Optional input override; defaults to the original run's input |
33
+ </tool>
34
+
23
35
  <tool name="workflow-list">
24
36
  List available workflows with names, descriptions, and sources.
25
37
 
@@ -61,6 +73,29 @@ Initialize .workflows/ directory for workflow run state.
61
73
 
62
74
  </tool>
63
75
 
76
+ <tool name="render-item-by-id">
77
+ Render a project block item by ID through its registered per-item macro. Resolves the item via the cross-block resolver, looks up the macro via the renderer registry, and renders with the supplied depth and depth-aware cross-reference recursion. Returns `[not-found: <id>]` on resolver miss and `[unrendered: <kind>/<id>]` on registry miss — same fallback markers `render_recursive` emits inside agent prompts.
78
+
79
+ *Render a project block item as prompt text via its per-item macro (with depth-controlled cross-ref recursion)*
80
+
81
+ | Parameter | Type | Required | Description |
82
+ |-----------|------|----------|-------------|
83
+ | `id` | string | yes | Kind-prefixed ID, e.g., DEC-NNNN / FEAT-NNN |
84
+ | `depth` | number | no | 0 = bare-ID refs (default), 1 = inline direct cross-references, 2+ = recurse further |
85
+ </tool>
86
+
87
+ <tool name="enforce-budget">
88
+ Check rendered text against an `x-prompt-budget` annotation on a schema field. Returns `{ output, warning }` — `output` is the original text passed through when under budget, or tail-truncated text with `[…truncated to budget]` marker when over; `warning` is null when no truncation occurred or a structured BudgetWarning record otherwise. Annotation absence is pass-through (no error). Mirrors the behaviour of the `enforceBudget` Nunjucks global registered by compileAgent.
89
+
90
+ *Validate rendered text against a schema field's prompt budget — returns truncated output and warning*
91
+
92
+ | Parameter | Type | Required | Description |
93
+ |-----------|------|----------|-------------|
94
+ | `rendered` | string | yes | Rendered text to check against the field's prompt budget |
95
+ | `blockName` | string | yes | Block schema name (without .schema.json suffix), e.g. 'decisions' or 'features' |
96
+ | `fieldPath` | string | yes | JSON-pointer-style path to the field, e.g. '/properties/decisions/items/properties/context' |
97
+ </tool>
98
+
64
99
  </tools_reference>
65
100
 
66
101
  <commands_reference>
@@ -78,7 +113,7 @@ Subcommands: `init`, `list`, `run`, `resume`, `validate`, `status`, `help`
78
113
  </keyboard_shortcuts>
79
114
 
80
115
  <bundled_resources>
81
- 26 agents, 15 schemas, 15 workflows, 33 templates bundled.
116
+ 26 agents, 15 schemas, 15 workflows bundled.
82
117
  See references/bundled-resources.md for full inventory.
83
118
  </bundled_resources>
84
119
 
@@ -127,7 +162,7 @@ See references/bundled-resources.md for full inventory.
127
162
  </agent_input>
128
163
 
129
164
  <agent_input name="handoff-writer">
130
- - `project_state` [required] — Current project state (from projectState() or /project status — includes phases, blocks, gaps, decisions, recent commits)
165
+ - `project_state` [required] — Current project state (from contextState() or /context status — includes phases, blocks, gaps, decisions, recent commits)
131
166
  - `path` string [required] — Root path of the project
132
167
  </agent_input>
133
168
 
@@ -212,7 +247,7 @@ See references/bundled-resources.md for full inventory.
212
247
  | `filter-names` | warning | Expression filters are recognized |
213
248
  | `steptype-metadata` | error | retry/input/output declarations match step type capabilities |
214
249
  | `inputschema-required` | error | Agent required input keys are provided by step |
215
- | `contextblocks-existence` | warning | Declared context blocks exist in .project/ |
250
+ | `contextblocks-existence` | warning | Declared context blocks exist in the substrate dir |
216
251
  | `template-alignment` | error | Template variables match step inputs and source schemas |
217
252
 
218
253
  </validation_vocabulary>
@@ -239,7 +274,9 @@ Workflows are discovered from three locations (first match wins):
239
274
  | loop | `loop: { maxAttempts, steps }` | Repeat sub-steps until gate breaks or max reached |
240
275
  | parallel | `parallel: { a: ..., b: ... }` | Run named sub-steps concurrently |
241
276
  | pause | `pause: true` or `pause: "message"` | Pause execution, resumable later |
242
- | forEach | `forEach: "${{ expr }}"` | Iterate over an array, executing the step per element |
277
+ | block | `block: { op: read\|write\|append\|update\|remove\|… }` | Validated in-process substrate block I/O via the block API no LLM, no subprocess |
278
+
279
+ `forEach: "${{ expr }}"` (iterate the step per array element) and `as:` are step MODIFIERS, not step types — they combine with any type above.
243
280
  </step_types>
244
281
 
245
282
  <expression_syntax>
@@ -275,7 +312,7 @@ Incomplete runs (failed or paused) are detected on next invocation. If the workf
275
312
  <output_validation>
276
313
  Steps with `output.schema` validate the agent's JSON output against a JSON Schema file. Validation failure marks the step as failed.
277
314
 
278
- Use `block:<name>` to reference project block schemas portably: `output.schema: block:project` resolves to `.project/schemas/project.schema.json` from cwd. Works across monorepo, npm install, and user-customized schemas. Combined with `retry: { maxAttempts: 2 }`, the agent gets the schema validation error injected into its retry prompt and can self-correct.
315
+ Use `block:<name>` to reference project block schemas portably: `output.schema: block:project` resolves to `<substrate-dir>/schemas/project.schema.json` from cwd. Works across monorepo, npm install, and user-customized schemas. Combined with `retry: { maxAttempts: 2 }`, the agent gets the schema validation error injected into its retry prompt and can self-correct.
279
316
  </output_validation>
280
317
 
281
318
  <retry>
@@ -290,7 +327,7 @@ After execution, the workflow result is injected into the main LLM conversation.
290
327
  </completion_messages>
291
328
 
292
329
  <artifacts>
293
- Workflows can write post-completion files via the `artifacts` field. Paths may contain `${{ }}` expressions. Artifacts targeting `.project/*.json` are routed through `writeBlock()` for schema validation.
330
+ Workflows can write post-completion files via the `artifacts` field. Paths may contain `${{ }}` expressions. Artifacts targeting `<substrate-dir>/*.json` are routed through `writeBlock()` for schema validation.
294
331
 
295
332
  Block artifact write failures are fatal — if the data doesn't conform to the block's schema, the workflow fails. Non-block artifact failures remain non-fatal (warning). On resume, all steps are preserved; only artifact processing re-runs, so fixing the schema issue or agent output and resuming avoids re-running expensive LLM steps.
296
333
  </artifacts>
@@ -64,39 +64,3 @@
64
64
  - `workflows/resumable-analysis.workflow.yaml`
65
65
  - `workflows/self-implement.workflow.yaml`
66
66
  - `workflows/typed-analysis.workflow.yaml`
67
-
68
- ## templates/ (33 files)
69
-
70
- - `templates/analyzers/base-analyzer.md`
71
- - `templates/analyzers/patterns-task.md`
72
- - `templates/analyzers/patterns.md`
73
- - `templates/analyzers/quality-task.md`
74
- - `templates/analyzers/quality.md`
75
- - `templates/analyzers/structure-task.md`
76
- - `templates/analyzers/structure.md`
77
- - `templates/architecture-designer/task.md`
78
- - `templates/architecture-inferrer/task.md`
79
- - `templates/audit-finding-verifier/task.md`
80
- - `templates/audit-fixer/task.md`
81
- - `templates/audit-results-router/task.md`
82
- - `templates/decomposer/task.md`
83
- - `templates/explorer/system.md`
84
- - `templates/explorer/task.md`
85
- - `templates/gap-identifier/task.md`
86
- - `templates/gap-resolution-assessor/task.md`
87
- - `templates/handoff-writer/task.md`
88
- - `templates/investigator/task.md`
89
- - `templates/phase-author/task.md`
90
- - `templates/plan-creator/task.md`
91
- - `templates/plan-decomposer/task.md`
92
- - `templates/project-definer/task.md`
93
- - `templates/project-inferrer/task.md`
94
- - `templates/requirements-gatherer/task.md`
95
- - `templates/researcher/task.md`
96
- - `templates/shared/macros.md`
97
- - `templates/spec-implementer/task.md`
98
- - `templates/synthesizer/system.md`
99
- - `templates/synthesizer/task.md`
100
- - `templates/task-verifier/task.md`
101
- - `templates/task-worker/task.md`
102
- - `templates/verifier/task.md`
@@ -1,242 +0,0 @@
1
- ---
2
- name: pi-project
3
- description: >
4
- Schema-driven project state management with typed JSON blocks, schema
5
- validation, planning lifecycle, and cross-block referential integrity. Use when
6
- managing .project/ blocks, scaffolding project structure, validating project
7
- state, or adding work items.
8
- ---
9
-
10
- <tools_reference>
11
- <tool name="append-block-item">
12
- Append an item to an array in a project block file. Schema validation is automatic.
13
-
14
- *Append items to project blocks (issues, decisions, or any user-defined block)*
15
-
16
- | Parameter | Type | Required | Description |
17
- |-----------|------|----------|-------------|
18
- | `block` | string | yes | Block name (e.g., 'issues', 'decisions') |
19
- | `arrayKey` | string | yes | Array key in the block (e.g., 'issues', 'decisions') |
20
- | `item` | unknown | yes | Item object to append — must conform to block schema |
21
- </tool>
22
-
23
- <tool name="update-block-item">
24
- Update fields on an item in a project block array. Finds by predicate field match.
25
-
26
- *Update items in project blocks — change status, add details, mark resolved*
27
-
28
- | Parameter | Type | Required | Description |
29
- |-----------|------|----------|-------------|
30
- | `block` | string | yes | Block name (e.g., 'issues', 'decisions') |
31
- | `arrayKey` | string | yes | Array key in the block |
32
- | `match` | object | yes | Fields to match (e.g., { id: 'issue-123' }) |
33
- | `updates` | object | yes | Fields to update (e.g., { status: 'resolved' }) |
34
- </tool>
35
-
36
- <tool name="read-block">
37
- Read a project block file as structured JSON.
38
-
39
- *Read a project block as structured JSON*
40
-
41
- | Parameter | Type | Required | Description |
42
- |-----------|------|----------|-------------|
43
- | `block` | string | yes | Block name (e.g., 'issues', 'tasks', 'requirements') |
44
- </tool>
45
-
46
- <tool name="write-block">
47
- Write or replace an entire project block with schema validation.
48
-
49
- *Write or replace a project block with schema validation*
50
-
51
- | Parameter | Type | Required | Description |
52
- |-----------|------|----------|-------------|
53
- | `block` | string | yes | Block name (e.g., 'project', 'architecture') |
54
- | `data` | unknown | yes | Complete block data — must conform to block schema |
55
- </tool>
56
-
57
- <tool name="project-status">
58
- Get derived project state — source metrics, block summaries, planning lifecycle status.
59
-
60
- *Get project state — source metrics, block summaries, planning lifecycle status*
61
-
62
- </tool>
63
-
64
- <tool name="project-validate">
65
- Validate cross-block referential integrity — check that IDs referenced across blocks exist.
66
-
67
- *Validate cross-block referential integrity*
68
-
69
- </tool>
70
-
71
- <tool name="project-init">
72
- Initialize .project/ directory with default schemas and empty block files.
73
-
74
- *Initialize .project/ directory with default schemas and blocks*
75
-
76
- </tool>
77
-
78
- <tool name="complete-task">
79
- Complete a task with verification gate — requires a passing verification entry targeting the task.
80
-
81
- *Complete a task — gates on passing verification before updating status*
82
-
83
- | Parameter | Type | Required | Description |
84
- |-----------|------|----------|-------------|
85
- | `taskId` | string | yes | Task ID to complete |
86
- | `verificationId` | string | yes | Verification entry ID (must target this task with status 'passed') |
87
- </tool>
88
-
89
- </tools_reference>
90
-
91
- <commands_reference>
92
- <command name="/project">
93
- Project state management
94
-
95
- Subcommands: `init`, `status`, `add-work`, `validate`, `help`
96
- </command>
97
-
98
- </commands_reference>
99
-
100
- <events>
101
- `session_start`
102
- </events>
103
-
104
- <bundled_resources>
105
- 22 defaults bundled.
106
- See references/bundled-resources.md for full inventory.
107
- </bundled_resources>
108
-
109
- <planning_vocabulary>
110
-
111
- **Block Types:**
112
-
113
- | Block | Title | Array Key | Item Fields |
114
- |-------|-------|-----------|-------------|
115
- | `architecture` | Architecture | `modules` | name, file, responsibility, dependencies? (array), lines? (integer) |
116
- | `audit` | Audit | `checks` | id, description, status (string (pass|fail|warn|skip)), category?, details? |
117
- | `conformance-reference` | Conformance Reference | `principles` | id, name, description?, rules (array) |
118
- | `decisions` | Decisions | `decisions` | id, decision, rationale, phase? (string|integer), status (string (decided|tentative|revisit|superseded)), context?, task? |
119
- | `domain` | Domain Knowledge | `entries` | id, title, content, category (string (research|reference|domain-rule|prior-art|constraint)), source?, confidence? (string (high|medium|low)), related_requirements? (array), tags? (array) |
120
- | `handoff` | Handoff | `current_tasks` | |
121
- | `issues` | Issues | `issues` | id, title, body, location, status (string (open|resolved|deferred)), category (string (primitive|issue|cleanup|capability|composition)), priority (string (low|medium|high|critical)), package, source? (string (human|agent|monitor|workflow)), resolved_by? |
122
- | `phase` | Phase | `success_criteria` | criterion, verify_method (string (command|inspect|test)) |
123
- | `project` | Project Identity | `target_users` | |
124
- | `rationale` | Design Rationale | `rationales` | id, title, narrative, related_decisions? (array), phase? (string|integer), context? |
125
- | `requirements` | Requirements | `requirements` | id, description, type (string (functional|non-functional|constraint|integration)), status (string (proposed|accepted|deferred|implemented|verified)), priority (string (must|should|could|wont)), acceptance_criteria? (array), source? (string (human|agent|analysis)), traces_to? (array), depends_on? (array) |
126
- | `tasks` | Tasks | `tasks` | id, description, status (string (planned|in-progress|completed|blocked|cancelled)), phase? (string|integer), files? (array), acceptance_criteria? (array), depends_on? (array), assigned_agent?, verification?, notes? |
127
- | `verification` | Verification | `verifications` | id, target, target_type (string (task|phase|requirement)), status (string (passed|failed|partial|skipped)), method (string (command|inspect|test)), evidence?, timestamp?, criteria_results? (array) |
128
-
129
- **Status Enums:**
130
-
131
- | Block | Field | Values |
132
- |-------|-------|--------|
133
- | `audit` | `status` | pass, fail, warn, skip |
134
- | `audit` | `severity` | error, warning, info |
135
- | `decisions` | `status` | decided, tentative, revisit, superseded |
136
- | `domain` | `category` | research, reference, domain-rule, prior-art, constraint |
137
- | `domain` | `confidence` | high, medium, low |
138
- | `issues` | `status` | open, resolved, deferred |
139
- | `issues` | `category` | primitive, issue, cleanup, capability, composition |
140
- | `issues` | `priority` | low, medium, high, critical |
141
- | `issues` | `source` | human, agent, monitor, workflow |
142
- | `phase` | `status` | planned, in-progress, completed |
143
- | `phase` | `verify_method` | command, inspect, test |
144
- | `phase` | `status` | planned, in-progress, completed |
145
- | `project` | `status` | inception, planning, development, maintenance, complete |
146
- | `requirements` | `type` | functional, non-functional, constraint, integration |
147
- | `requirements` | `status` | proposed, accepted, deferred, implemented, verified |
148
- | `requirements` | `priority` | must, should, could, wont |
149
- | `requirements` | `source` | human, agent, analysis |
150
- | `tasks` | `status` | planned, in-progress, completed, blocked, cancelled |
151
- | `verification` | `target_type` | task, phase, requirement |
152
- | `verification` | `status` | passed, failed, partial, skipped |
153
- | `verification` | `method` | command, inspect, test |
154
-
155
- </planning_vocabulary>
156
-
157
- <objective>
158
- pi-project manages structured project state in `.project/` — a directory of JSON block files validated against schemas.
159
- </objective>
160
-
161
- <block_files>
162
- Blocks are JSON files in `.project/` (e.g., `gaps.json`, `decisions.json`). Each block has a corresponding schema in `.project/schemas/`. When you write to a block via the tools, the data is validated against its schema before persisting. Writes are atomic (tmp file + rename).
163
- </block_files>
164
-
165
- <schema_validation>
166
- Every block write validates against `.project/schemas/<blockname>.schema.json`. If the schema file doesn't exist, writes proceed without validation. Validation errors include the specific JSON Schema violations.
167
- </schema_validation>
168
-
169
- <project_init>
170
- `/project init` scaffolds the `.project/` directory with default schemas and empty block files from the package's `defaults/` directory. Idempotent — skips files that already exist.
171
- </project_init>
172
-
173
- <project_status>
174
- `/project status` derives project state dynamically from the filesystem:
175
- - Source file count and line count (`.ts` files excluding tests)
176
- - Test count and test file count
177
- - Schema count, block count, phase count
178
- - Block summaries with array item counts and status distributions
179
- - Requirements summary (total, by status, by priority) — from requirements.json
180
- - Tasks summary (total, by status) — from tasks.json
181
- - Domain entry count — from domain.json
182
- - Verification summary (total, passed, failed) — from verification.json
183
- - Handoff presence — whether handoff.json exists
184
- - Recent git commits
185
- - Current phase detection
186
- </project_status>
187
-
188
- <project_add_work>
189
- `/project add-work` discovers appendable blocks (blocks with array schemas), reads their schemas, and sends a structured instruction to the LLM to extract items from the conversation into the typed blocks. This is a follow-up message that triggers the LLM to use the `append-block-item` tool.
190
- </project_add_work>
191
-
192
- <duplicate_detection>
193
- `append-block-item` checks for duplicate items by `id` field before appending. If an item with the same `id` already exists in the target array, it returns a message instead of appending.
194
- </duplicate_detection>
195
-
196
- <project_validate>
197
- `/project validate` checks cross-block referential integrity:
198
- - task.phase references a valid phase
199
- - task.depends_on references valid task IDs
200
- - decision.phase references a valid phase
201
- - gap.resolved_by references a valid ID
202
- - requirement.traces_to references valid phase/task IDs
203
- - requirement.depends_on references valid requirement IDs
204
- - verification.target references a valid target ID
205
- - rationale.related_decisions references valid decision IDs
206
-
207
- Returns errors (broken dependency references) and warnings (unresolved cross-references).
208
- </project_validate>
209
-
210
- <planning_lifecycle>
211
- The default schemas support a full planning lifecycle:
212
- - **project.json** — identity, vision, goals, constraints, scope, status
213
- - **domain.json** — research findings, reference material, domain rules
214
- - **requirements.json** — functional/non-functional requirements with MoSCoW priority and lifecycle states
215
- - **architecture.json** — modules, patterns, boundaries
216
- - **phases/** — ordered delivery units with goals, success criteria, inputs/outputs
217
- - **tasks.json** — standalone task registry with status lifecycle and phase linkage
218
- - **decisions.json** — choices with rationale and phase association
219
- - **gaps.json** — open items with priority, category, and resolution tracking
220
- - **rationale.json** — design rationale with decision cross-references
221
- - **handoff.json** — session context snapshot (created on-demand, not by /project init)
222
- - **verification.json** — completion evidence per task/phase/requirement
223
- - **conformance-reference.json** — executable code conventions with principles, rules, check methods (grep/command/ast/inspect), and check patterns. Ships empty, populated per-project by agents or users.
224
- - **audit** (schema only, no default block) — structured audit results produced by running conformance checks.
225
-
226
- All schemas are user-customizable. Edit `.project/schemas/*.schema.json` to add fields, change enums, or restructure blocks without modifying code.
227
- </planning_lifecycle>
228
-
229
- <update_check>
230
- On `session_start`, checks npm registry for newer versions of `@davidorex/pi-project-workflows` and notifies via UI if an update is available. Non-blocking — failures are silently ignored.
231
- </update_check>
232
-
233
- <success_criteria>
234
- - `.project/` directory exists with schemas and block files after `/project init`
235
- - Block writes validate against schemas — invalid data rejected with specific error
236
- - `/project status` returns current derived state without errors
237
- - `/project validate` returns no errors for well-formed cross-block references
238
- - `append-block-item` rejects duplicate IDs
239
- - Schema customizations (field additions, enum changes) take effect on next write
240
- </success_criteria>
241
-
242
- *Generated from source by `scripts/generate-skills.js` — do not edit by hand.*
@@ -1,26 +0,0 @@
1
- # Bundled Resources
2
-
3
- ## defaults/ (22 files)
4
-
5
- - `defaults/blocks/conformance-reference.json`
6
- - `defaults/blocks/decisions.json`
7
- - `defaults/blocks/domain.json`
8
- - `defaults/blocks/issues.json`
9
- - `defaults/blocks/project.json`
10
- - `defaults/blocks/rationale.json`
11
- - `defaults/blocks/requirements.json`
12
- - `defaults/blocks/tasks.json`
13
- - `defaults/blocks/verification.json`
14
- - `defaults/schemas/architecture.schema.json`
15
- - `defaults/schemas/audit.schema.json`
16
- - `defaults/schemas/conformance-reference.schema.json`
17
- - `defaults/schemas/decisions.schema.json`
18
- - `defaults/schemas/domain.schema.json`
19
- - `defaults/schemas/handoff.schema.json`
20
- - `defaults/schemas/issues.schema.json`
21
- - `defaults/schemas/phase.schema.json`
22
- - `defaults/schemas/project.schema.json`
23
- - `defaults/schemas/rationale.schema.json`
24
- - `defaults/schemas/requirements.schema.json`
25
- - `defaults/schemas/tasks.schema.json`
26
- - `defaults/schemas/verification.schema.json`