rubyn-code 0.5.0 → 0.5.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.
- checksums.yaml +4 -4
- data/README.md +62 -8
- data/lib/rubyn_code/cli/app.rb +2 -2
- data/lib/rubyn_code/cli/commands/megaplan.rb +50 -0
- data/lib/rubyn_code/cli/repl_commands.rb +2 -1
- data/lib/rubyn_code/cli/setup.rb +13 -0
- data/lib/rubyn_code/ide/handlers/plan_interview_answer_handler.rb +65 -0
- data/lib/rubyn_code/ide/handlers/plan_interview_cancel_handler.rb +22 -0
- data/lib/rubyn_code/ide/handlers/plan_interview_start_handler.rb +53 -0
- data/lib/rubyn_code/ide/handlers/plan_propose_handler.rb +41 -0
- data/lib/rubyn_code/ide/handlers/recover_ci_handler.rb +132 -0
- data/lib/rubyn_code/ide/handlers.rb +17 -2
- data/lib/rubyn_code/ide/protocol.rb +15 -0
- data/lib/rubyn_code/ide/server.rb +39 -1
- data/lib/rubyn_code/megaplan/ci_recovery.rb +104 -0
- data/lib/rubyn_code/megaplan/interview_session.rb +245 -0
- data/lib/rubyn_code/megaplan/plan_proposer.rb +153 -0
- data/lib/rubyn_code/version.rb +1 -1
- data/lib/rubyn_code.rb +8 -0
- data/skills/megaplan/megaplan.md +156 -0
- metadata +13 -4
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: megaplan
|
|
3
|
+
description: Phased project planning. Interview the user one question at a time, then scaffold numbered phase folders (requirements/design/tasks). Trigger phrases include "megaplan", "mega plan", "plan phases", "phase this out", or any feature spanning 3+ PRs.
|
|
4
|
+
tags:
|
|
5
|
+
- planning
|
|
6
|
+
- process
|
|
7
|
+
- phases
|
|
8
|
+
- megaplan
|
|
9
|
+
triggers:
|
|
10
|
+
- megaplan
|
|
11
|
+
- mega plan
|
|
12
|
+
- plan phases
|
|
13
|
+
- phase this out
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Megaplan — Phased Project Planning
|
|
17
|
+
|
|
18
|
+
Ship in vertical slices. Each phase merges cleanly and leaves the trunk working.
|
|
19
|
+
|
|
20
|
+
## Don't use for
|
|
21
|
+
|
|
22
|
+
- Single-PR features — just do them
|
|
23
|
+
- Pure research / exploration — nothing shippable
|
|
24
|
+
- Work where the *shape* (not just the details) will change weekly — plan something smaller first
|
|
25
|
+
|
|
26
|
+
## Design principles to apply throughout
|
|
27
|
+
|
|
28
|
+
Hold the work to these when proposing phases and reviewing each `design.md`:
|
|
29
|
+
|
|
30
|
+
- **Vertical slices, not horizontal.** A phase touches every layer it needs to be end-to-end testable. The classic anti-pattern this skill exists to prevent: "Phase 1: all models. Phase 2: all controllers. Phase 3: all views." Trunk is unshippable until Phase 3 and Phase 2 has nothing to test. Instead: "Phase 1: one feature, full-stack, behind a flag."
|
|
31
|
+
- **SOLID, applied lightly.** Single Responsibility and Dependency Inversion are the two that actually bite at the phase-design level. The others usually take care of themselves if those two are clean.
|
|
32
|
+
- **KISS.** Skip the abstraction until you have two concrete callers. Three similar lines beat a premature framework. Inline before you extract.
|
|
33
|
+
- **Justify abstractions.** Every new module/service/class in `design.md` needs a one-sentence reason it exists separately. If you can't write it, inline the code.
|
|
34
|
+
|
|
35
|
+
## The workflow
|
|
36
|
+
|
|
37
|
+
### 1. Interview first
|
|
38
|
+
|
|
39
|
+
Don't propose phases until you understand the shape. Walk through the agenda below **one question per turn** — never dump the full list in a single message. The point is to let the operator steer at every step.
|
|
40
|
+
|
|
41
|
+
**How to ask:**
|
|
42
|
+
|
|
43
|
+
- **One topic per turn.** Pick the next unanswered item from the agenda. Ask only about that.
|
|
44
|
+
- **Number the options.** Whenever the question has 2+ plausible answers, present them as a numbered list so the operator can reply with just the number. Include a **recommended** pick (the one you'd default to given what you know so far) and say *why* it's the recommendation in one short line.
|
|
45
|
+
- **Restate locked-in answers at the top of each follow-up.** A running "Decisions so far:" block of one-line bullets, so the operator can spot drift and you can spot contradictions.
|
|
46
|
+
- **Open-ended questions are fine** when no obvious option set exists (e.g. "What's the end-state in user-facing terms?"). Still ask one at a time.
|
|
47
|
+
- **Stop when you're 95% sure of the shape.** Don't run the whole agenda for its own sake — skip topics that are already obvious from context. The agenda is a checklist *for you*, not a script to read aloud.
|
|
48
|
+
|
|
49
|
+
**Agenda (interviewer's checklist, not a dump):**
|
|
50
|
+
|
|
51
|
+
- **Goal** — end state in user-facing terms
|
|
52
|
+
- **Constraints** — deadlines, infra limits, things you can't break
|
|
53
|
+
- **Existing assets** — what's there to build on or rip out
|
|
54
|
+
- **Natural ordering** — dependency sequence (data → API → UI)?
|
|
55
|
+
- **External dependencies** — other teams, third-party APIs, infra access, design review. These reorder phases more than technical concerns do.
|
|
56
|
+
- **Destructive operations** — schema drops, data deletes, deprecations. These need their own phase with an explicit rollback note.
|
|
57
|
+
- **Test strategy** — what coverage is needed?
|
|
58
|
+
- **Done-per-phase** — minimum manual test that proves each phase shipped?
|
|
59
|
+
|
|
60
|
+
### 2. Propose phases, get agreement
|
|
61
|
+
|
|
62
|
+
A good phase:
|
|
63
|
+
- Is a vertical slice — testable end-to-end at merge time
|
|
64
|
+
- Ships independently — trunk works at every boundary
|
|
65
|
+
- Has a clear definition of done
|
|
66
|
+
- Is roughly 1–3 days of focused work
|
|
67
|
+
- Has a name that survives the PR title. If it adds *and* removes, capture both (e.g. "TX-Only Checkout + Geofencing Removal").
|
|
68
|
+
|
|
69
|
+
A good phase list:
|
|
70
|
+
- 3–8 phases for most projects
|
|
71
|
+
- Ordered by dependency, not priority
|
|
72
|
+
- Destructive operations isolated to their own phase
|
|
73
|
+
- Ends with a phase that visibly delivers the goal
|
|
74
|
+
|
|
75
|
+
Propose as a numbered outline. Let the user reorder, merge, or split before any files exist.
|
|
76
|
+
|
|
77
|
+
### 3. Scaffold the structure
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
docs/
|
|
81
|
+
README.md # roadmap tracker
|
|
82
|
+
NN-slug/
|
|
83
|
+
requirements.md # user stories + acceptance criteria
|
|
84
|
+
design.md # architecture + interfaces + test strategy
|
|
85
|
+
tasks.md # numbered checklist
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Numbering: zero-padded (`01-`, `02-`). Slugs: kebab-case, ≤4 words.
|
|
89
|
+
|
|
90
|
+
Default: fully scaffold the *current* phase; future phases stay as one-liners in `README.md` until you start them. Later phases mutate based on what's learned early — don't pre-write what you'll have to rewrite.
|
|
91
|
+
|
|
92
|
+
### 4. Implement phase-by-phase
|
|
93
|
+
|
|
94
|
+
For each phase:
|
|
95
|
+
1. **Read the running architecture doc first** (`CLAUDE.md` or equivalent). That's how you don't repeat decisions or miss constraints from earlier phases.
|
|
96
|
+
2. Branch off main: `git checkout -b phase-NN-slug`
|
|
97
|
+
3. Work `tasks.md` top-to-bottom, checking subtasks as you go
|
|
98
|
+
4. Commit at section boundaries: `Phase N (M/X): description` — where `M` is the current section number and `X` is the total number of sections in `tasks.md`
|
|
99
|
+
5. Run full test suite + lint + format at each commit boundary
|
|
100
|
+
6. When `tasks.md` is fully checked, push and open a PR (see PR description shape below)
|
|
101
|
+
7. After merge: check the box in `docs/README.md`, update the running architecture doc if anything moved
|
|
102
|
+
|
|
103
|
+
## File templates
|
|
104
|
+
|
|
105
|
+
### requirements.md
|
|
106
|
+
|
|
107
|
+
Use RFC 2119 SHALL/SHOULD/MAY language for acceptance criteria. They're contracts — write them as something a QA tester could check.
|
|
108
|
+
|
|
109
|
+
Sections: Overview, Glossary, Requirements (per requirement: user story + numbered SHALL criteria), Out of scope.
|
|
110
|
+
|
|
111
|
+
### design.md
|
|
112
|
+
|
|
113
|
+
Sections: Overview, Architecture (each component gets Responsibility, Collaborators, "Why not inline?"), Data model changes, Test strategy, Migration / rollout, Future enhancements.
|
|
114
|
+
|
|
115
|
+
Every new abstraction needs a justification line. If you can't answer "why not inline this", inline it.
|
|
116
|
+
|
|
117
|
+
### tasks.md
|
|
118
|
+
|
|
119
|
+
Sections (`## [ ] N. <name>`) and tasks (`- [ ] N.M ...`) both get checkboxes. A section ticks only when every task under it ticks. Reference requirements by ID (`refs Req 1.1`) so coverage gaps are visible. Always end with a Validation section that includes the manual smoke flow.
|
|
120
|
+
|
|
121
|
+
## PR description shape
|
|
122
|
+
|
|
123
|
+
Three bullets. Don't pad them.
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
## What shipped
|
|
127
|
+
- <user-facing capability or removal>
|
|
128
|
+
|
|
129
|
+
## What proves it
|
|
130
|
+
- <new tests, smoke flow, manual check>
|
|
131
|
+
|
|
132
|
+
## What's deferred
|
|
133
|
+
- <link to later phase, or "none">
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Patterns and pitfalls
|
|
137
|
+
|
|
138
|
+
**Patterns to keep:**
|
|
139
|
+
- **Branch per phase:** `phase-NN-slug` — disposable, one PR per branch
|
|
140
|
+
- **Squash-merge:** one phase = one commit on main, full PR description preserved
|
|
141
|
+
- **Plan before code:** `requirements.md` is finalized and `design.md` is sketched before any task in `tasks.md` gets implemented.
|
|
142
|
+
- **Semantic test anchors** so later phases don't break earlier tests
|
|
143
|
+
- **One running architecture doc** kept current — read it before each phase, update it after
|
|
144
|
+
|
|
145
|
+
**When to break the rules:**
|
|
146
|
+
- **Phase grew mid-stream?** Split it. Add `NN-a-slug` / `NN-b-slug` or renumber.
|
|
147
|
+
- **Later phase invalidates an earlier requirement?** Update the earlier doc with a "Superseded by Phase N" note.
|
|
148
|
+
- **Phase ships nothing user-visible** (e.g. refactor prep)? Still its own PR — but say so in the description.
|
|
149
|
+
|
|
150
|
+
**Pitfalls to avoid:**
|
|
151
|
+
- **Horizontal-slice phases** (all models / all controllers / all views). Trunk is unshippable until the last phase merges.
|
|
152
|
+
- **Scaffolding all phases upfront in full detail** — later phases get invalidated by what you learn early.
|
|
153
|
+
- **Phases longer than ~3 days** — the phase should split. Long phases hide scope creep.
|
|
154
|
+
- **Requirements without acceptance criteria** — "Make X work" isn't a requirement; "When <condition>, the system SHALL <observable behavior>" is.
|
|
155
|
+
- **Tasks that don't reference requirements** — if you can't cite which requirement a task serves, the task probably isn't load-bearing.
|
|
156
|
+
- **Destructive operations mixed with feature work** — schema drops, deletes, deprecations belong in their own phase with a rollback note.
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubyn-code
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- fadedmaturity
|
|
@@ -229,6 +229,7 @@ files:
|
|
|
229
229
|
- lib/rubyn_code/cli/commands/install_skills.rb
|
|
230
230
|
- lib/rubyn_code/cli/commands/list_skills.rb
|
|
231
231
|
- lib/rubyn_code/cli/commands/mcp.rb
|
|
232
|
+
- lib/rubyn_code/cli/commands/megaplan.rb
|
|
232
233
|
- lib/rubyn_code/cli/commands/model.rb
|
|
233
234
|
- lib/rubyn_code/cli/commands/new_session.rb
|
|
234
235
|
- lib/rubyn_code/cli/commands/plan.rb
|
|
@@ -294,7 +295,12 @@ files:
|
|
|
294
295
|
- lib/rubyn_code/ide/handlers/config_set_handler.rb
|
|
295
296
|
- lib/rubyn_code/ide/handlers/initialize_handler.rb
|
|
296
297
|
- lib/rubyn_code/ide/handlers/models_list_handler.rb
|
|
298
|
+
- lib/rubyn_code/ide/handlers/plan_interview_answer_handler.rb
|
|
299
|
+
- lib/rubyn_code/ide/handlers/plan_interview_cancel_handler.rb
|
|
300
|
+
- lib/rubyn_code/ide/handlers/plan_interview_start_handler.rb
|
|
301
|
+
- lib/rubyn_code/ide/handlers/plan_propose_handler.rb
|
|
297
302
|
- lib/rubyn_code/ide/handlers/prompt_handler.rb
|
|
303
|
+
- lib/rubyn_code/ide/handlers/recover_ci_handler.rb
|
|
298
304
|
- lib/rubyn_code/ide/handlers/review_handler.rb
|
|
299
305
|
- lib/rubyn_code/ide/handlers/session_fork_handler.rb
|
|
300
306
|
- lib/rubyn_code/ide/handlers/session_list_handler.rb
|
|
@@ -330,6 +336,9 @@ files:
|
|
|
330
336
|
- lib/rubyn_code/mcp/sse_transport.rb
|
|
331
337
|
- lib/rubyn_code/mcp/stdio_transport.rb
|
|
332
338
|
- lib/rubyn_code/mcp/tool_bridge.rb
|
|
339
|
+
- lib/rubyn_code/megaplan/ci_recovery.rb
|
|
340
|
+
- lib/rubyn_code/megaplan/interview_session.rb
|
|
341
|
+
- lib/rubyn_code/megaplan/plan_proposer.rb
|
|
333
342
|
- lib/rubyn_code/memory/RUBYN.md
|
|
334
343
|
- lib/rubyn_code/memory/models.rb
|
|
335
344
|
- lib/rubyn_code/memory/search.rb
|
|
@@ -452,6 +461,7 @@ files:
|
|
|
452
461
|
- skills/gems/rubocop.md
|
|
453
462
|
- skills/gems/sidekiq.md
|
|
454
463
|
- skills/gems/stripe.md
|
|
464
|
+
- skills/megaplan/megaplan.md
|
|
455
465
|
- skills/minitest/assertions.md
|
|
456
466
|
- skills/minitest/fixtures.md
|
|
457
467
|
- skills/minitest/integration_tests.md
|
|
@@ -542,8 +552,7 @@ post_install_message: |
|
|
|
542
552
|
Rubyn Code installed! Run `rubyn-code --setup` to pin it to this Ruby
|
|
543
553
|
so it works in any project regardless of .ruby-version.
|
|
544
554
|
|
|
545
|
-
Tip:
|
|
546
|
-
RBENV_VERSION=4.0.2 gem install rubyn-code && rubyn-code --setup
|
|
555
|
+
Tip: install under your latest Ruby for best performance.
|
|
547
556
|
rdoc_options: []
|
|
548
557
|
require_paths:
|
|
549
558
|
- lib
|
|
@@ -551,7 +560,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
551
560
|
requirements:
|
|
552
561
|
- - ">="
|
|
553
562
|
- !ruby/object:Gem::Version
|
|
554
|
-
version:
|
|
563
|
+
version: 4.0.2
|
|
555
564
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
556
565
|
requirements:
|
|
557
566
|
- - ">="
|