Prompt file imported from rmaldonado2000/PSSR_APP (
.github/prompts/pssr-architecture-alignment.prompt.md). Copyright stays with the author.
PSSR Architecture Alignment Prompt
Use this prompt in GitHub Copilot Agent/Edit mode only for intentional architecture assessment, architecture modernization, folder-structure alignment, service/data-layer cleanup, UI pattern consolidation, or Code App architecture alignment work for the PSSR Power Platform Code App.
Do not use this prompt for normal bug fixes, small enhancements, or regular new feature implementation.
Architecture Alignment means intentionally analyzing and potentially changing how the repo is organized or how core patterns are structured.
Before starting
Open and read the repo documentation set relevant to this architecture alignment request, including:
/docs/copilot-context.mdREADME.mdif present/docs/pssr-lifecycle-behavior.mdif lifecycle/status/permission architecture is affected/docs/pssr-lifecycle-schema.mdif Dataverse lifecycle schema, status, phase, choices, mappings, or generated files are affected/docs/ui-gallery-card-anatomy.mdif card/gallery UI architecture is affected/docs/ui-pill-standard.mdif pill/badge/status UI architecture is affected- Any relevant
/docs/*-process.md
Inspect the current codebase before recommending or editing anything.
Treat the current source code and repo documentation set as authoritative project context.
Do not paste, quote, duplicate, or summarize the full content of any repo documentation file.
Existing architecture rule
The current PSSR source code is the implementation truth.
Do not assume a generic Microsoft starter template is automatically the correct target for PSSR.
The goal is not to blindly match a template.
The goal is to align PSSR to a sustainable Code App architecture while preserving current behavior, Suncor governance expectations, Dataverse safety, lifecycle safety, UI consistency, documentation accuracy, and maintainability.
If source code and documentation conflict:
- Treat current source code as implementation truth.
- Treat documentation as intended guidance.
- Flag the inconsistency.
- Recommend whether code or documentation should be updated.
- Do not silently choose one without calling out the mismatch.
Objective
Assess the current PSSR repo architecture against approved Code App architecture principles and produce a phased alignment plan.
Architecture alignment objective:
TBC (not provided)
Required intake
Before planning or implementing, confirm or infer from the request:
- Architecture concern or alignment objective
- Scope of alignment
- Whether this is assessment-only or implementation
- Areas allowed to change
- Areas that must not change
- Risk tolerance
- Acceptance criteria
- Documentation update expectations
- Validation expectations
If required information is missing, ask only one question at a time.
Do not ask the user to fill a template.
If a detail cannot be confirmed from the request, repo docs, or source code, write:
TBC (not confirmed from current codebase)
Assessment areas
Assess the current repo across these areas:
- Repo/folder structure
- Route/page/screen organization
- Component organization and reuse
- Hooks/utilities organization
- Services/repository/data access boundaries
- Dataverse generated files and custom mapping separation
- Dataverse choice/status/phase handling
- Lifecycle/status/permission utilities
- UI components, cards, pills, badges, dialogs, forms, and styling patterns
- Fluent UI usage, provider, theme, tokens, wrappers, and version consistency
- Validation/error/loading/empty/disabled/read-only state patterns
- TypeScript configuration
- Vite configuration
- Power Platform SDK / PAC / npm Code App command usage
- Package scripts and validation readiness
- Documentation accuracy and ownership
- Test/lint/build readiness
- ALM/governance impact
Target architecture principles
The target PSSR architecture must prioritize:
- Current behavior preservation
- Minimal safe migration
- Clear separation of concerns
- Service/repository boundaries for Dataverse and connector calls
- Generated file protection
- Reusable mapping helpers
- Reusable lifecycle/status/permission utilities
- Defense-in-depth for restricted lifecycle operations
- Consistent PSSR UI patterns
- Controlled Fluent UI usage
- Concise and accurate repo documentation
- Build/type/lint/test validation
- Incremental migration with rollback options
Do not propose a broad rewrite.
Do not propose replacing working architecture with a generic template unless there is a clear, validated benefit and explicit approval.
Gap classification
Classify each architecture gap as one of:
- Must fix now
- Should fix during related work
- Backlog modernization
- Do not change
Use this guidance:
Must fix now: Current architecture creates active defects, security/lifecycle bypass, Dataverse risk, build risk, or blocks required work.Should fix during related work: The gap should be corrected when touching the same area.Backlog modernization: Useful improvement but not required for current delivery.Do not change: Current repo pattern is acceptable or changing it creates more risk than value.
Architecture alignment planning rules
Before recommending any architecture change:
- Confirm the current pattern from source code.
- Confirm relevant documentation.
- Identify the risk of changing it.
- Identify the risk of leaving it as-is.
- Identify validation needed.
- Identify documentation updates needed.
- Identify rollback considerations.
- Prefer the smallest migration phase possible.
Implementation rules
Do not implement architecture changes unless the user explicitly asks for implementation after reviewing the plan.
If implementation is approved:
- Implement only one small phase at a time.
- Preserve behavior.
- Avoid unrelated cleanup.
- Avoid broad file moves.
- Avoid dependency changes unless explicitly approved.
- Do not modify generated Dataverse files unless strictly required and consistent with existing workflow.
- Update documentation only where required.
- Validate after each phase.
Dataverse architecture rules
If architecture alignment affects Dataverse or data access:
- Follow
.github/instructions/pssr-dataverse.instructions.md. - Keep Dataverse calls in the existing service/repository/data access layer or migrate toward that boundary only through approved phases.
- Protect generated Dataverse files.
- Do not invent schema, fields, choices, relationships, or option values.
- Do not hardcode choice/status/phase values unless already established.
- Preserve mapping behavior.
- Validate both read and write paths.
- Validate data reload behavior.
- Update Dataverse documentation only if behavior, mappings, fields, choices, or constraints change.
Lifecycle architecture rules
If architecture alignment affects lifecycle/status/permission behavior:
- Follow
.github/instructions/pssr-lifecycle.instructions.md. - Preserve defense in depth.
- UI gating and write-path enforcement must remain aligned.
- Do not create duplicate lifecycle/status utilities.
- Do not broaden permissions.
- Validate allowed and restricted states.
- Update lifecycle documentation only if behavior changes.
UI architecture rules
If architecture alignment affects UI:
- Follow
.github/instructions/pssr-ui.instructions.md. - Preserve existing PSSR UI standards.
- Reuse existing components and styling patterns.
- Do not introduce new design systems or UI libraries unless explicitly approved.
- Do not add, upgrade, or migrate Fluent UI unless explicitly approved.
- Do not replace existing PSSR UI components with Fluent UI during architecture alignment unless the approved scope explicitly requires it.
- Validate desktop and mobile behavior.
- Update UI documentation only if standards or behavior change.
Documentation architecture rules
Follow .github/instructions/pssr-documentation.instructions.md.
Architecture alignment documentation must:
- Document current state.
- Document target state only after approval.
- Document phased migration plan.
- Document validation approach.
- Document rollback considerations when relevant.
- Update
/docs/copilot-context.mdonly for high-level architecture context. - Update specialized docs only for their owned topics.
- Avoid duplicating content across docs.
Do not update README unless setup, run, build, validation, deployment, or developer onboarding changes.
Validation rules
Follow .github/instructions/pssr-validation.instructions.md.
Use only validation commands confirmed from:
README.mdpackage.json- Existing repo scripts
- Existing CI/developer docs
Do not invent commands.
Architecture alignment validation must include:
- TypeScript/build validation if available.
- Lint/tests if configured and relevant.
- Manual regression checks for touched workflows.
- Dataverse read/write/reload validation if data access changed.
- Lifecycle allowed/restricted validation if lifecycle changed.
- Desktop/mobile validation if UI changed.
- Documentation validation if docs changed.
- Import/path validation if files moved or renamed.
- Rollback consideration for each phase.
Constraints and anti-patterns to avoid
Do not:
- Treat generic starter templates as mandatory target architecture.
- Perform broad rewrites.
- Move files or rename folders without an approved phase.
- Add new architectural layers without approval.
- Add dependencies without approval.
- Introduce new design systems.
- Add, upgrade, or migrate Fluent UI without approval.
- Modify generated Dataverse files casually.
- Create duplicate services, repositories, components, lifecycle utilities, mapping helpers, or styling patterns.
- Add direct Dataverse calls inside screens/pages/components.
- Implement lifecycle restrictions only in the UI.
- Rewrite unrelated documentation.
- Claim validation passed unless it was actually run or verified.
- Proceed silently when documentation and code conflict.
Required output format for assessment/planning
If the request is assessment or planning, respond using exactly these headings:
1. Request classification
Architecture Alignment
State whether this is:
- Assessment only
- Plan only
- Implementation requested
2. Documentation inspected
List repo documentation inspected.
If relevant documentation was missing, state:
Relevant but not found in repo.
Do not paste documentation content.
3. Current architecture summary
Summarize the confirmed current architecture.
4. Target architecture principles
Describe the target PSSR architecture principles.
Do not blindly copy a generic template.
5. Alignment gap analysis
For each gap, include:
- Area
- Current state
- Target state
- Risk of changing
- Risk of not changing
- Priority
- Migration complexity
6. What should not change
List patterns, files, boundaries, or behaviors that should be preserved.
7. Proposed phased migration plan
For each phase, include:
- Scope
- Files/areas affected
- Risk
- Validation
- Documentation update
- Rollback consideration
8. First safe phase recommendation
Recommend the first low-risk phase only.
9. Dataverse/data impact
State one of:
- No Dataverse impact identified.
- Dataverse impact identified.
- TBC (not confirmed from current codebase).
10. Lifecycle/status/permission impact
State one of:
- No lifecycle/status/permission impact identified.
- Lifecycle/status/permission impact identified.
- TBC (not confirmed from current codebase).
11. UI/UX impact
Summarize UI, responsive, card/gallery, pill/badge, Fluent UI, validation/error/disabled-state impact if applicable.
12. Documentation update plan
List docs that should be updated and why.
13. Validation plan
List confirmed commands and required manual checks.
Do not invent commands.
14. Risks and open questions
List risks and only the open questions that block safe planning or implementation.
Required output format for approved implementation
If implementation is explicitly approved, respond using exactly these headings:
1. Request classification
Architecture Alignment
2. Documentation inspected
List repo documentation inspected.
If relevant documentation was missing, state:
Relevant but not found in repo.
Do not paste documentation content.
3. Approved phase implemented
State the approved phase.
4. Files changed/added/moved
List files changed, added, moved, or renamed.
5. Summary of implementation
Summarize the implemented architecture alignment in concise bullets.
6. Behavior preservation
Summarize how existing behavior was preserved.
7. Dataverse/data impact
State one of:
- No Dataverse impact.
- Dataverse impact implemented.
- TBC (not confirmed from current codebase).
8. Lifecycle/status/permission impact
State one of:
- No lifecycle/status/permission impact.
- Lifecycle/status/permission impact implemented.
- TBC (not confirmed from current codebase).
9. UI/UX impact
Summarize UI, responsive, card/gallery, pill/badge, Fluent UI, validation/error/disabled-state impact if applicable.
10. Documentation updated
State one of:
- Documentation update not required.
- Documentation updated.
- Documentation update required but not completed.
List updated docs if applicable.
11. Validation completed
List commands run and results.
Do not claim validation passed unless it was actually run or verified.
12. Validation not run
List commands/checks not run and why.
13. Manual checks required
List specific manual checks aligned to the approved phase.
14. Rollback considerations
List how to revert or reduce risk if the phase causes issues.
15. Risks or follow-ups
List remaining risks or follow-ups.
If none, write:
None identified.