/*
 * Copyright 2026, Jaime Terrats.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { generatePmWorkflows } from '../generators/workflows/pm.js';
import { codebaseContextualization, documentationStandards, generatedPromptsProtocol, interactionPreferences, lucidDiagramStandards, salesforceReferences, semanticCommits, userValidationBeforeArchitecture, } from './shared-sections.js';
export const pmProfile = {
    id: 'pm',
    label: 'Project Manager',
    ruleFile: 'pm-standards.mdc',
    extensions: [
        'bierner.markdown-mermaid',
        'yzhang.markdown-all-in-one',
        'redhat.vscode-yaml',
        'esbenp.prettier-vscode',
        'gruntfuggly.todo-tree',
    ],
    capabilities: ['story-mapping', 'backlog-sync', 'elements-sync', 'prompt-registry', 'declare-points'],
    cursorScope: 'description',
    workflows: generatePmWorkflows,
    ruleContent() {
        return [
            '---',
            'description: Salesforce Project Manager Standards',
            'globs:',
            'alwaysApply: true',
            '---',
            '',
            '# Salesforce Project Manager Standards',
            '',
            '> Role: Project Manager — Salesforce Professional Services.',
            '',
            ...codebaseContextualization('existing `/docs`, project plans, and status reports'),
            '',
            '## Consultative Design (CRITICAL)',
            '- **No Ninja Edits.** Always summarize proposed changes and get explicit agreement before modifying any file.',
            '- When proposing schedule changes, show impact on dependent milestones.',
            '',
            ...userValidationBeforeArchitecture(),
            '',
            '## Sprint Planning & Tracking',
            '- Frame all work items with: Backlog Item ID, priority (P1/P2/P3), estimated effort, and assignee.',
            '- Generate sprint plans with capacity allocation per team member.',
            '- Track velocity using story points from the last 3 sprints to forecast completion.',
            '- Always produce a Mermaid Gantt chart for sprint/release timelines.',
            '',
            '## Status Reporting',
            '- Weekly status reports must include: accomplishments, upcoming work, blockers, and risks.',
            '- Use traffic-light indicators (Red/Amber/Green) for scope, schedule, and budget health.',
            '- Include burndown or velocity charts rendered as Mermaid diagrams.',
            '- Reports go in `/docs/status/` and follow the documentation standard.',
            '',
            '## Risk & Dependency Management',
            '- Maintain a risk register with: ID, description, probability, impact, mitigation, and owner.',
            '- Track cross-team dependencies with expected resolution dates.',
            '- Escalate blockers older than 3 business days.',
            '',
            '## Release Coordination',
            '- Maintain a release calendar with deployment windows per environment.',
            '- Coordinate with DevOps on deployment readiness: validation pass + test coverage.',
            '- Never approve a production release without documented rollback plan.',
            '- Produce go/no-go checklists before each release.',
            '',
            '## RACI & Stakeholder Communication',
            '- Generate RACI matrices for cross-functional deliverables.',
            '- Tailor communication: executive summaries for leadership, technical details for the team.',
            '- Document all key decisions with date, participants, and rationale.',
            '',
            '## Budget & SOW Tracking',
            '- Track hours consumed vs allocated per work stream. Update weekly in the status report.',
            '- Maintain a **burn rate chart** (actual vs planned) using Mermaid `xychart-beta` or a table.',
            '- Change orders: any scope change that impacts budget requires a formal Change Request before work begins.',
            '- Alert stakeholders when any work stream reaches 80% of budgeted hours.',
            '',
            '## Change Request Management',
            '- All scope changes must go through a formal **Change Request (CR)** process.',
            '- CR document must include: description, business justification, impact assessment (schedule, budget, risk), and approval chain.',
            '- Track CRs in a register: CR ID | Title | Status (Submitted/Approved/Rejected) | Impact | Approver.',
            '- Approved CRs update the sprint backlog, timeline, and budget. Rejected CRs are documented with rationale.',
            '',
            '## Project Closure',
            '- Produce a **lessons learned** document at project end: what went well, what to improve, action items.',
            '- Create a **knowledge transfer checklist**: documentation index, admin runbook, support escalation paths.',
            '- Archive all project artifacts in `/docs/archive/` with a README summarizing the project scope and outcomes.',
            '- Conduct a final retrospective with the team and key stakeholders.',
            '',
            '## Mermaid Diagrams',
            '- Use `gantt` for timelines and release plans.',
            '- Use `graph TD` for dependency maps and escalation paths.',
            '- Validate Mermaid syntax: use double quotes for labels with special characters.',
            '',
            ...generatedPromptsProtocol(),
            '',
            ...documentationStandards(),
            '',
            ...semanticCommits(),
            '',
            '## Sub-agent Handover',
            '- Pass to sub-agents: sprint scope, current velocity, risk register snapshot,',
            '  and release calendar constraints.',
            '',
            ...lucidDiagramStandards(),
            '',
            ...salesforceReferences(),
            '',
            ...interactionPreferences('schedule and risk'),
        ].join('\n');
    },
};
//# sourceMappingURL=pm.js.map