[PF-10] Plan mode URL pre-fetch flow and unified context file with plan slug - #29
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Purpose
/porplanforge planis run with website/Notion links in the goal by pre-fetching URL content before running the sandbox and injecting it into context.HHMM-<slug>.md/HHMM-<slug>.plan.md) using a shared slug and the new--slugoption.Description
1. p skill (Plan URL pre-fetch and context format)
notion-fetch(serveruser-Notion), other web URLs viamcp_web_fetch. Combine successful results into markdown and keep for step 1..cursor/contexts/YYYY-MM-DD/HHMM-<slug>.mdcontaining:User : {Q1},Agent : {A1}, … and the line "Use this conversation to understand the user's intent and as reference when creating the plan."planforge plan "<goal>" --slug <slug>so the plan file is created asHHMM-<slug>.plan.md, matching the context filename.2. plan command
--slugoption (cli-js / cli-py)--slug <slug>to theplancommand; passed torunPlan.PlanCliOpts.slug; when set, normalize and validate slug and use it for the plan output filename (HHMM-<slug>.plan.md) instead of parsing from plan body or slugifying the goal.--slugto theplancommand; passed torun_plan.opts.get("slug")is present, use it for the plan output filename (with same validation / hyphen limit).3. CLI URL pre-fetch (terminal users, optional)
extractUrlsFromGoal(goal),fetchUrlContent(url, timeoutMs),fetchUrlsContext(goal). Skips Notion URLs; fetches other http(s) URLs with 10s timeout and returns a "Fetched URLs" markdown block.loadMergedContext, callfetchUrlsContext(goal)and prepend result tocontextwhen present.urllib.request, 10s timeout, max body cap).load_merged_context, callfetch_urls_context(goal)and prepend tocontextwhen present.Files changed (summary)
.cursor/skills/p/SKILL.md,templates/cursor/skills/p/SKILL.mdsrc/index.ts,src/commands/plan.ts,src/utils/url-fetch.ts(new)planforge/cli.py,planforge/commands/plan.py,planforge/utils/url_fetch.py(new)run_plan.ps1/run_plan.shalready forward arguments, so--slugis passed through without change.How to test
p skill and context file
/pwith a goal that includes a web URL (e.g.https://example.com) or a Notion URL (if MCP is configured). Confirm that the agent pre-fetches URLs, writes one context file under.cursor/contexts/YYYY-MM-DD/HHMM-<slug>.mdwith Cursor Chat History format and optional URL section, and runsplanforge plan "<goal>" --slug <slug>..cursor/plans/YYYY-MM-DD/HHMM-<slug>.plan.mdwith the same<slug>as the context file.--slugoptionplanforge plan "some goal" --slug my-slug(cli-js or cli-py). Confirm the created plan file isHHMM-my-slug.plan.md.CLI URL fetch (terminal)
planforge plan "check this page https://example.com"from the terminal (no Cursor). Confirm that the planner receives context that includes fetched content for the URL (e.g. "Fetched URLs" section). Notion URLs in the goal should be skipped by the CLI.Review Requirement
--slugand URL pre-fetch (url-fetch.ts vs url_fetch.py), including Notion skip and timeout/body limits.--slug; goal with no URLs; failed URL fetches (skip and continue).Additional Info