microsoft / microsoft/viva-insights-sample-code
Frontier Analytics: fix content drift between prompt cards and site pages (not just detect it)
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 15
- Forks
- 3
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 10
Description
Context
Frontier Analytics prompt cards live under frontier-analytics/prompts/**/*.md. The website separately shows the same content on pages under _pages/frontier-analytics-prompt-*.md. frontier-analytics/ is excluded from the Jekyll build (see the exclude: list in _config.yml), so those site pages are not generated from the prompt cards. They are a second, manually maintained copy of the same content.
This has caused repeated, real bugs (all found and fixed in PR #4):
- Two prompt cards existed only on the website, with no corresponding source file in the repo.
- A "Quick prompt (short version)" section was added to all 8 prompt cards but missed on all 8 site-page mirrors.
- A fix to the Copilot licensing classification rule was applied to a prompt card but not to its site-page mirror.
PR #4 also added a CI check (.github/scripts/check_prompt_drift.py, run by .github/workflows/prompt-drift-check.yml) that catches the most common forms of this drift going forward. That helps, but it does not remove the underlying cause: there are still two authored copies of the same content that a person (or agent) has to remember to update together.
The question
Pick one of the following as the long-term fix, or propose an alternative:
Option A: Generate the site pages from the prompt cards at build time
Add a small custom Jekyll generator (this repo's build already runs unrestricted via bundle exec jekyll build in .github/workflows/jekyll.yml, not GitHub Pages' restricted safe-mode build, and _config.yml already defines a collections: block, so there is precedent for this). The generator would read frontier-analytics/prompts/**/*.md directly and emit the corresponding site page through one shared layout. Site-only metadata (badges, last_validated) would live as front matter in the prompt card file itself, so there is exactly one authored copy per card. _pages/frontier-analytics-prompt-*.md and the drift-check workflow would both go away.
Trade-off: requires writing and maintaining a Ruby generator plugin. Removes the duplication entirely rather than detecting it.
Option B: Stop duplicating the full prompt text on the site
Keep the badges and short summary (Purpose, Audience, Recommended output) on the site page, since that is genuinely site-specific presentation. Replace the long "Quick prompt" and detailed "Prompt" bodies with a link to the file on GitHub, since the actual use case (copy this text into a coding agent) works fine from GitHub's own render.
Trade-off: simplest change, no new tooling or language. Loses the current polished single-page experience and adds an extra click for anyone using the site.
Do nothing further
Keep the CI check from PR #4 as the only safeguard, and continue maintaining two copies by hand.
Trade-off: no further engineering effort, but every future prompt card change still requires a human (or agent) to remember to update both copies, and the CI check only catches what it has been taught to check for.
Ask
Weigh in on which of these (A, B, or neither) is the right direction, so a follow-up PR can implement it.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the prompt cards under frontier-analytics/prompts/**/.md, the mirrored files under _pages/frontier-analytics-prompt-.md, _config.yml, and the existing drift-check files .github/scripts/check_prompt_drift.py and .github/workflows/prompt-drift-check.yml. Compare options A and B against the current build and site experience; done means a direction is chosen and a follow-up implementation can remove or reduce the duplicate authored content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, markdown, python, ruby
- Domain
- build-system, ci-cd, content, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100