-
Notifications
You must be signed in to change notification settings - Fork 0
feat(core): progressive disclosure for system prompt by user-prompt keywords #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| "@open-codesign/core": patch | ||
| --- | ||
|
|
||
| Word-boundary the progressive-disclosure keyword regexes so substring tokens | ||
| no longer false-trigger sections. Previously `metric` matched `biometric`, | ||
| `graph` matched `paragraph`, and `logo` matched `logout`. English tokens are | ||
| now anchored with `\b...\b` (with optional `s?` for plurals); CJK alternations | ||
| remain un-anchored. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| '@open-codesign/core': minor | ||
| --- | ||
|
|
||
| System prompt now does progressive disclosure based on user-prompt keywords. The full create-mode prompt was ~41 KB / ~10k tokens — enough to crush small-context models (e.g. minimax-m2.5:free at 8k ctx) and dilute the instructions strong models actually follow. | ||
|
|
||
| `composeSystemPrompt()` now accepts an optional `userPrompt` field. When provided in `create` mode, it assembles: | ||
|
|
||
| - **Layer 1 (always, ~12 KB):** identity, workflow, output-rules, design-methodology, pre-flight, editmode-protocol, safety, plus a new condensed `antiSlopDigest` section. | ||
| - **Layer 2 (keyword-matched):** chart-rendering + dashboard ambient signals for dashboard cues; iOS starter template for mobile cues; single-page / big-numbers / customer-quotes craft subsections for marketing cues; logos subsection for brand cues. No keyword match → fall back to the full craft directives. | ||
|
|
||
| Measured size for sample prompts: dashboard 22.6 KB (55%), mobile 21.7 KB (53%), marketing 19.8 KB (48%), no-keyword fallback 24.5 KB (59%). | ||
|
|
||
| When `userPrompt` is omitted, or mode is `tweak` / `revise`, the prompt is byte-identical to before — full back-compat. |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Anti-slop digest (forbidden patterns) | ||
|
|
||
| Do not produce these. Each one is the tell of an unconsidered, generated-feeling artifact: | ||
|
|
||
| - A "minimal dark" page that is `#0E0E10` end-to-end with a single purple accent and four sparse stat cards. | ||
| - A hero section with a gradient blob background, bold sans headline, and a generic screenshot mockup. | ||
| - A features section with six 1:1 cards, each with a 24px icon, a two-word title, and a sentence of filler text. | ||
| - A testimonials section with circular avatars, a name, a title, and a five-star rating. | ||
| - A footer with three columns of nav links and a social media icon row. | ||
| - A "case study" that is four metric cards plus a single quote — missing hero, before/after, customer profile, and closing. | ||
| - A logo placeholder rendered as a soft-rounded square with a single random letter centered inside. Use a constructed monogram, a wordmark, or an explicit hatched "YOUR LOGO HERE" rectangle instead. | ||
| - Decorative emoji used as section icons unless the brief explicitly asks for emoji. | ||
| - Default Tailwind blue (`#3b82f6`) or default Tailwind grays as the entire neutral scale. | ||
| - Lorem ipsum, "John Doe", "Acme Corp", "100%" / "1,234" round-number filler. | ||
| - Fonts in the overused-default set: Inter, Roboto, Arial, Helvetica, Playfair Display (unless explicitly requested). | ||
| - Hotlinked photos from any external host (`placeholder.com`, `unsplash.com`, `picsum.photos`, `randomuser.me`, etc.). | ||
| - Center-aligned body paragraphs. | ||
| - Pure black (`#000`) for text — use near-black with a slight hue cast. | ||
|
|
||
| These patterns are forbidden when combined without a distinctive visual angle that makes them feel intentional rather than assembled from a component kit. |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a negative routing test for substring collisions to prevent regressions (e.g.,
paragraph/asymmetricshould not trigger dashboard routing):