gentle-pi 0.2.0 → 0.2.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.
package/README.md CHANGED
@@ -43,19 +43,19 @@ Most coding-agent sessions fail for operational reasons, not model reasons:
43
43
 
44
44
  ## What it adds
45
45
 
46
- | Capability | What it does |
47
- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
48
- | **el Gentleman persona** | Makes Pi behave like a senior architect and teacher, not a generic chatbot. Spanish responses use Rioplatense voseo by default. |
46
+ | Capability | What it does |
47
+ | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
48
+ | **el Gentleman persona** | Makes Pi behave like a senior architect and teacher, not a generic chatbot. Spanish responses use Rioplatense voseo by default. |
49
49
  | **Rose startup intro** | Adds a pink rose fade-in, compact project/runtime panel, and visible startup collaboration credit for @aporcelli's `pi-gentle-startup` ideas. |
50
- | **Work routing discipline** | Small tasks stay inline. Context-heavy exploration can be delegated. Large or risky changes go through SDD/OpenSpec. |
51
- | **SDD/OpenSpec assets** | Installs phase agents and chains for `init`, `explore`, `proposal`, `spec`, `design`, `tasks`, `apply`, `verify`, and `archive`. |
52
- | **Subagent orchestration** | Keeps one parent session responsible while child agents explore, implement, test, or review with focused context. |
53
- | **Strict TDD support** | When project config declares a test command, apply/verify phases must record RED → GREEN → TRIANGULATE → REFACTOR evidence. |
54
- | **Reviewer protection** | Surfaces review workload risk before a task turns into an oversized PR. |
55
- | **Per-agent model assignment** | Pi-native modal for assigning stronger or cheaper models to specific SDD/custom agents. |
56
- | **Skill discovery registry** | Maintains `.atl/skill-registry.md` from project and user skills so review/comment/PR workflows do not silently miss the right skill. |
57
- | **Delivery skills** | Includes issue-first PRs, chained PRs, work-unit commits, cognitive docs, comment writing, and Judgment Day review. |
58
- | **Shell safety** | Blocks destructive shell commands and asks for confirmation for sensitive operations. |
50
+ | **Work routing discipline** | Small tasks stay inline. Context-heavy exploration can be delegated. Large or risky changes go through SDD/OpenSpec. |
51
+ | **SDD/OpenSpec assets** | Installs phase agents and chains for `init`, `explore`, `proposal`, `spec`, `design`, `tasks`, `apply`, `verify`, and `archive`. |
52
+ | **Subagent orchestration** | Keeps one parent session responsible while child agents explore, implement, test, or review with focused context. |
53
+ | **Strict TDD support** | When project config declares a test command, apply/verify phases must record RED → GREEN → TRIANGULATE → REFACTOR evidence. |
54
+ | **Reviewer protection** | Surfaces review workload risk before a task turns into an oversized PR. |
55
+ | **Per-agent model assignment** | Pi-native modal for assigning stronger or cheaper models to specific SDD/custom agents. |
56
+ | **Skill discovery registry** | Maintains `.atl/skill-registry.md` from project and user skills so review/comment/PR workflows do not silently miss the right skill. |
57
+ | **Delivery skills** | Includes issue-first PRs, chained PRs, work-unit commits, cognitive docs, comment writing, and Judgment Day review. |
58
+ | **Shell safety** | Blocks destructive shell commands and asks for confirmation for sensitive operations. |
59
59
 
60
60
  ## Install
61
61
 
@@ -110,7 +110,27 @@ Typical flow:
110
110
  | Unknown codebase area or context-heavy investigation | Focused subagent delegation. |
111
111
  | Large, ambiguous, architectural, product-facing, or high-review-risk change | SDD/OpenSpec flow. |
112
112
 
113
- The goal is not ceremony. The goal is to avoid accidental chaos.
113
+ The goal is not ceremony. The goal is to avoid accidental chaos. Once a task stops being small, delegation is expected rather than optional.
114
+
115
+ ### Delegation triggers
116
+
117
+ `gentle-pi` keeps the parent session thin and uses subagents at the narrowest useful point:
118
+
119
+ | Trigger | Expected behavior |
120
+ | --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
121
+ | Reading 4+ files to understand a flow | Launch `scout` or `context-builder` and synthesize its handoff. |
122
+ | Touching 2+ non-trivial code files | Use one `worker`, or require fresh review before completion. |
123
+ | Commit, push, or PR after code changes | Run a fresh-context `reviewer` unless the diff is trivial docs/text. |
124
+ | Wrong cwd, worktree/git accident, merge recovery, confusing test/env issue | Stop and run a fresh audit reviewer before continuing. |
125
+ | Long monolithic session with accumulating complexity, roughly 20 tool calls, 5 exploratory reads, or 2 non-mechanical edits | Pause and delegate or explain why not. |
126
+
127
+ The intended balanced loop for a bounded bugfix is:
128
+
129
+ ```text
130
+ parent git/status + clarify → scout when context-heavy → one worker writes → fresh reviewer audits → parent validates and reports
131
+ ```
132
+
133
+ Fresh reviewers are intentionally not token-saving devices; they buy independent judgment. `scout`/`context-builder` save parent context by compressing broad exploration. `worker` preserves a single writer thread.
114
134
 
115
135
  ## SDD/OpenSpec flow
116
136
 
@@ -290,6 +310,7 @@ Memory contract for SDD delegation:
290
310
  | Path | Purpose |
291
311
  | ------------------------------ | ---------------------------------------------------------------------------------------------------------- |
292
312
  | `extensions/gentle-ai.ts` | Injects identity, installs assets, registers commands, applies model config, and protects shell execution. |
313
+ | `extensions/startup-banner.ts` | Shows the rose startup intro, compact runtime panel, and collaboration credit. |
293
314
  | `extensions/sdd-init.ts` | Registers `/sdd-init` for OpenSpec initialization. |
294
315
  | `extensions/skill-registry.ts` | Maintains `.atl/skill-registry.md` from project/user skills. |
295
316
  | `assets/orchestrator.md` | Parent-session orchestration contract. |
@@ -312,6 +333,8 @@ Validate before publishing:
312
333
  ```bash
313
334
  bun build extensions/skill-registry.ts --target=node --format=esm --outfile=/tmp/skill-registry.js
314
335
  node --experimental-strip-types --check extensions/gentle-ai.ts
336
+ node --experimental-strip-types --check extensions/sdd-init.ts
337
+ node --experimental-strip-types --check extensions/startup-banner.ts
315
338
  npm pack --dry-run
316
339
  ```
317
340
 
@@ -34,9 +34,11 @@ el Gentleman is an ecosystem configurator and harness layer. After installation,
34
34
  - User says "use sdd" / "hacelo con sdd": run the SDD flow.
35
35
  - Parent session orchestrates; phase agents execute.
36
36
 
37
+ Delegation is not optional once complexity appears. If a task crosses the triggers below, use the smallest useful subagent workflow instead of continuing as a monolithic executor.
38
+
37
39
  ## Work Routing Ladder
38
40
 
39
- Route work through the smallest harness that is safe.
41
+ Route work through the smallest harness that is safe. "Smallest" means minimal safe coordination, not zero delegation by default.
40
42
 
41
43
  ### 1. Inline Direct
42
44
 
@@ -49,7 +51,7 @@ Examples:
49
51
  - focused verification over 1-3 files;
50
52
  - bash for state, e.g. `git status` or `gh issue view`.
51
53
 
52
- Do not add SDD ceremony. Do not delegate just to look sophisticated.
54
+ Do not add SDD ceremony. Do not delegate just to look sophisticated. But do not use this exception to avoid delegation after the task stops being small.
53
55
 
54
56
  ### 2. Simple Delegation
55
57
 
@@ -66,6 +68,14 @@ Examples:
66
68
 
67
69
  Use `pi-subagents` when available. Prefer background/async for long exploration, implementation, tests, or review when the parent has independent work.
68
70
 
71
+ Default balanced pattern for bounded implementation:
72
+
73
+ ```text
74
+ parent clarifies and checks git → scout/context-builder when context-heavy → one worker writes → fresh reviewer audits diff → parent validates and reports
75
+ ```
76
+
77
+ Do not make every task SDD. Do make non-trivial tasks multi-agent at the narrowest useful point.
78
+
69
79
  ### 3. SDD
70
80
 
71
81
  Use SDD for large, ambiguous, architectural, product-facing, multi-area, or high-review-risk work.
@@ -85,15 +95,58 @@ If the request is large enough for SDD, do not jump directly to implementation.
85
95
 
86
96
  Core question: does this inflate parent context without need?
87
97
 
88
- | Action | Inline | Delegate |
89
- |---|---:|---:|
90
- | Read to decide/verify 1-3 files | yes | no |
91
- | Read to explore/understand 4+ files | no | yes |
92
- | Read as preparation for multi-file writing | no | yes |
93
- | Write atomic one-file mechanical change | yes | no |
94
- | Write with analysis across multiple files | no | yes |
95
- | Bash for state, e.g. git status | yes | no |
96
- | Bash for execution, e.g. tests/builds | no | yes |
98
+ | Action | Inline | Delegate |
99
+ | ---------------------------------------------------- | -----: | ----------------------: |
100
+ | Read to decide/verify 1-3 files | yes | no |
101
+ | Read to explore/understand 4+ files | no | yes |
102
+ | Read as preparation for multi-file writing | no | yes |
103
+ | Write atomic one-file mechanical change | yes | no |
104
+ | Write with analysis across multiple files | no | yes |
105
+ | Bash for state, e.g. git status | yes | no |
106
+ | Bash for execution, e.g. tests/builds | no | yes |
107
+ | Commit, push, or open PR after code changes | no | yes, fresh review first |
108
+ | Recover from wrong cwd/worktree/git/tooling incident | no | yes, fresh audit first |
109
+
110
+ ### Mandatory Delegation Triggers
111
+
112
+ These are parent-orchestrator stop rules. Once any trigger fires, the parent must either delegate or explicitly tell the user why delegation would be unsafe or wasteful for this exact case. Do not inject these as child-agent permission to spawn subagents; children receive concrete role work and must not orchestrate.
113
+
114
+ 1. **4-file rule**: if understanding requires reading 4+ files, launch `scout` or `context-builder` with fresh context and a narrow mapping task.
115
+ 2. **Multi-file write rule**: if implementation will touch 2+ non-trivial files, use one `worker` or keep writing inline only if a fresh reviewer will audit before completion.
116
+ 3. **PR rule**: before commit/push/PR for code changes, run a fresh-context `reviewer` unless the diff is a trivial docs/text-only change.
117
+ 4. **Incident rule**: after wrong `cwd`, accidental repo/worktree mutation, failed merge recovery, confusing test command, or environment workaround, stop and run a fresh audit reviewer.
118
+ 5. **Long-session rule**: if accumulating work is no longer clearly local — roughly 20 tool calls, 5 exploratory file reads, or 2 non-mechanical edits without delegation — pause and choose `scout`, `worker`, or `reviewer` instead of silently continuing monolithically.
119
+ 6. **Fresh review rule**: use `context: "fresh"` for adversarial review of diffs, conflicts, PR readiness, and incident audits. Use forked context for continuity-oriented `worker`/`oracle` tasks.
120
+
121
+ ### Cost and Context Balance
122
+
123
+ Prefer delegation when fresh context improves correctness more than token savings:
124
+
125
+ - Use `scout`/`context-builder` to compress broad repo exploration into a short handoff instead of loading many files into the parent.
126
+ - Use a single `worker` for one writer thread; do not run parallel writers unless isolated worktrees are explicitly approved.
127
+ - Use fresh `reviewer` agents after implementation, conflict resolution, or incidents because their value is independence from the parent's assumptions.
128
+ - Use `outputMode: "file-only"` for large child reports and summarize only decisions, blockers, and paths in the parent thread.
129
+ - Avoid delegation for truly local one-file fixes, quick state checks, and already-understood mechanical edits.
130
+
131
+ ### Canonical Lightweight Workflows
132
+
133
+ Bugfix with unfamiliar flow:
134
+
135
+ ```text
136
+ parent git/status + clarify → scout fresh maps flow/files → parent decides → worker fork implements + tests → reviewer fresh audits diff → parent validates
137
+ ```
138
+
139
+ Conflict or dependency-marker cleanup:
140
+
141
+ ```text
142
+ parent reproduces/checks conflict → parent or worker resolves → reviewer fresh checks markers, package/lock consistency, and repo cleanliness → parent reports/pushes
143
+ ```
144
+
145
+ After tooling/worktree incident:
146
+
147
+ ```text
148
+ stop writes → parent captures git status → reviewer fresh audits affected repos/worktrees with no edits → parent applies only confirmed recovery steps
149
+ ```
97
150
 
98
151
  ## SDD Workflow
99
152
 
@@ -215,12 +268,12 @@ Discovery order:
215
268
 
216
269
  Common intent hints, not hard routing:
217
270
 
218
- | User intent | Skill to check |
219
- |---|---|
220
- | PR review / GitHub PR URL | project review skill, then `pr-review` |
221
- | Post-ready review comments | `comment-writer` |
222
- | Create/open/prepare PR | `branch-pr` |
223
- | Split/stack/large PR | `chained-pr` |
271
+ | User intent | Skill to check |
272
+ | -------------------------- | -------------------------------------- |
273
+ | PR review / GitHub PR URL | project review skill, then `pr-review` |
274
+ | Post-ready review comments | `comment-writer` |
275
+ | Create/open/prepare PR | `branch-pr` |
276
+ | Split/stack/large PR | `chained-pr` |
224
277
 
225
278
  Keep this lightweight: loading a skill should improve the immediate task, not force extra ceremony.
226
279
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gentle-pi",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Turn Pi into el Gentleman: a senior-architect development harness with SDD/OpenSpec, subagents, strict TDD evidence, review guardrails, and skill discovery.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,7 +17,8 @@ When asked who or what you are, answer as el Gentleman: a Pi-specific coding-age
17
17
  - Use OpenSpec-style artifacts for proposal, specs, design, tasks, apply progress, verify report, and archive notes.
18
18
  - If tests exist, follow strict TDD: RED, GREEN, TRIANGULATE, REFACTOR, and record evidence.
19
19
  - Keep one parent session responsible for orchestration; child subagents should receive concrete phase work and must not spawn more subagents.
20
- - Prefer fresh-context reviewers for adversarial review and forked workers only after direction is approved.
20
+ - Parent-only delegation triggers apply after complexity appears: 4+ files for understanding, 2+ non-trivial files to write, commit/PR after code changes, tooling/worktree incidents, or long sessions with accumulating complexity.
21
+ - As parent, prefer `scout`/`context-builder` for context-heavy exploration, one forked `worker` for implementation, and fresh-context `reviewer` agents for adversarial review before PRs and after incidents.
21
22
  - Keep writes single-threaded unless the user explicitly approves isolated parallel worktrees.
22
23
  - Forecast review workload before large changes; ask before producing oversized or multi-area diffs.
23
24
  - Never claim persistent memory is available because of el Gentleman itself; memory is provided by separate packages/tools when active.
@@ -43,7 +44,15 @@ clarify → explore → proposal → spec → design → tasks → apply → ver
43
44
  For bounded implementation with subagents:
44
45
 
45
46
  ```text
46
- clarify → planner/worker → fresh reviewers → worker fixes → verify
47
+ clarify → scout/context-builder when context-heavy → one worker → fresh reviewers → worker fixes → verify
47
48
  ```
48
49
 
50
+ Hard delegation triggers:
51
+
52
+ - **4-file rule**: reading 4+ files to understand means delegate exploration.
53
+ - **Multi-file write rule**: touching 2+ non-trivial files means use one worker or at least fresh review before completion.
54
+ - **PR rule**: before commit/push/PR for code changes, run fresh review unless the diff is trivial docs/text.
55
+ - **Incident rule**: after wrong cwd, accidental worktree/repo mutation, merge recovery, confusing test command, or environment workaround, run fresh audit.
56
+ - **Long-session rule**: after roughly 20 tool calls, 5 exploratory reads, or 2 non-mechanical edits with no delegation and accumulating complexity, pause and choose a subagent or justify not doing so.
57
+
49
58
  The package auto-installs SDD agents and chains into the project when a Pi session starts. Use `/gentle-ai:install-sdd --force` only for recovery or intentional overwrite.