feat(writing-plans): add hierarchical plan mode for complex plans#1978
Open
Birdjyy wants to merge 1 commit into
Open
feat(writing-plans): add hierarchical plan mode for complex plans#1978Birdjyy wants to merge 1 commit into
Birdjyy wants to merge 1 commit into
Conversation
When estimated task count reaches 8+, writing-plans now switches to a folder-based layout: one README index + one file per task. This prevents two failure modes—oversized Write call payloads and context exhaustion mid-generation—while making large plans easier to navigate and execute. Includes trigger condition, folder layout spec, README contents rule, per-task file format, write order, Write failure fallback, and execution handoff wording for hierarchical mode.
Author
|
related #1947 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When estimated task count reaches 8+, writing-plans now switches to a
folder-based layout: one README index + one file per task. This prevents
two failure modes — oversized Write call payloads and context exhaustion
mid-generation — while making large plans easier to navigate and execute.
Who is submitting this PR? (required)
What problem are you trying to solve?
When writing large implementation plans (8+ tasks), a single-file plan
causes two concrete failure modes in practice:
Writetool call fails with a parameter error because thecontentpayload exceeds the tool's size limit.truncated or incomplete plan file.
Both failures are silent — the agent believes the plan was written, but
the file is missing tasks. The user only discovers the problem when
execution begins.
What does this PR change?
Adds a "Hierarchical Plan Mode" section to
skills/writing-plans/SKILL.md.When 8 or more tasks are identified, the skill instructs the agent to write
one README index file plus one file per task, instead of a single large
file. Includes trigger condition, folder layout spec, README contents rule,
per-task file format, write order, Write failure fallback, and execution
handoff wording.
Is this change appropriate for the core library?
Yes. The failure modes (Write payload limits, context exhaustion mid-write)
are tool constraints that affect all users on all projects. The threshold
(8 tasks) and folder layout are project-agnostic. Any agent using
writing-planson a sufficiently complex feature will hit this problem.What alternatives did you consider?
real features genuinely require more than 8 independent deliverables.
Artificial merging of tasks reduces reviewability and increases
per-task risk.
Write payload failure but does not solve context exhaustion, and
produces a single large file that's hard to navigate during execution.
after the fact, but doesn't prevent the agent from attempting a
doomed Write in the first place.
Does this PR contain multiple unrelated changes?
No. All changes are in a single section of a single file, addressing one
specific failure mode.
Existing PRs
Environment tested
Evaluation
Rigor
superpowers:writing-skillsandcompleted adversarial pressure testing (paste results below)
rationalizations, "human partner" language) without extensive evals
showing the change is an improvement
Pressure test results:
Scenario 1 — Boundary ambiguity (7 tasks, user requests folder):
Agent chose to follow user preference (Option B), correctly identifying
the 8-task threshold as a minimum trigger condition, not a prohibition on
using hierarchical mode below that count. Cited: "the skill says 'if you
can identify 8 or more distinct tasks' — this is the trigger condition,
not a prohibition."
Scenario 2 — Sunk cost + time pressure (halfway through 10-task single file):
Agent chose to stop and restart in hierarchical mode (Option A). Cited
both Write payload failure and context exhaustion risks from the skill.
Correctly identified sunk cost as irrelevant: "completing a plan that will
likely fail on Write wastes more of the user's time, not less."
Scenario 3 — Authority pressure (user explicitly requests single file, 9 tasks):
Agent followed user instruction with a single upfront risk disclosure.
Judged acceptable: hierarchical mode is a mitigation strategy, not a
mandatory safety guardrail. User was informed and chose to proceed.
Human review