Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/prompts/portfolio-project-sync.prompt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ messages:
- Mark needs_review when the update is too vague, promotional, or missing enough project details.
- For new projects, use empty string for image so the workflow can capture the live/demo site thumbnail.
- For existing project updates, preserve or reuse the existing image only when it still clearly fits.
- Use featured false for newly added projects unless the update explicitly says it should be featured.
- Use featured true for newly added projects so they appear at the top by default.
- Use featurePolicy "explicit_unfeatured" only when the update clearly says the project should not be featured or should not appear at the top.
- role: user
content: |-
Current portfolio projects JSON:
Expand Down Expand Up @@ -82,12 +83,17 @@ jsonSchema: |-
},
"required": ["title", "subtitle", "image", "description", "impact", "tags", "featured", "links"]
},
"featurePolicy": {
"type": "string",
"enum": ["default_featured", "explicit_featured", "explicit_unfeatured"],
"description": "For add_project, default to default_featured unless the update explicitly controls whether the project should appear at the top."
},
"reviewNotes": {
"type": "array",
"items": { "type": "string" },
"maxItems": 6
}
},
"required": ["intent", "risk", "matchTitle", "reason", "project", "reviewNotes"]
"required": ["intent", "risk", "matchTitle", "reason", "project", "featurePolicy", "reviewNotes"]
}
}
1 change: 1 addition & 0 deletions portfolio-v2/docs/portfolio-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ The workflow:
- Converts the update into structured project data.
- Prepares a project thumbnail by reusing an existing local image, downloading `card_image_url`, or capturing a screenshot from the live/demo URL.
- Applies an add/update to the project list.
- Places newly added projects in the featured/top project row by default unless the update explicitly says not to feature them.
- Runs the Vite build.
- Opens a pull request with a summary when the update is safe enough for review.
- Dispatches `Portfolio V2 CI` for the generated PR branch so required checks run for bot-created PRs.
Expand Down
8 changes: 7 additions & 1 deletion portfolio-v2/scripts/applyPortfolioProjectUpdate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if (!Array.isArray(currentProjects)) {
const normalizedIntent = normalizeIntent(change.intent);
const risk = normalizeRisk(change.risk);
const project = normalizeProject(change.project);
const featurePolicy = normalizeFeaturePolicy(change.featurePolicy);
const reviewNotes = Array.isArray(change.reviewNotes) ? change.reviewNotes.filter(Boolean) : [];
let action = "none";
let changed = false;
Expand Down Expand Up @@ -54,7 +55,7 @@ if (normalizedIntent === "add_project" || normalizedIntent === "update_project")
{
...project,
image: project.image || defaultProjectImage,
featured: Boolean(project.featured),
featured: featurePolicy !== "explicit_unfeatured",
},
...currentProjects,
];
Expand Down Expand Up @@ -114,6 +115,11 @@ function normalizeRisk(risk) {
return allowed.has(risk) ? risk : "high";
}

function normalizeFeaturePolicy(featurePolicy) {
const allowed = new Set(["default_featured", "explicit_featured", "explicit_unfeatured"]);
return allowed.has(featurePolicy) ? featurePolicy : "default_featured";
}

function normalizeProject(project = {}) {
const title = clean(project.title);

Expand Down
Loading