@danmoisan/drm-copilot-mcp 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +50 -0
- package/out/mcp-server.js +17323 -0
- package/package.json +36 -0
- package/resources/claude-customizations/.claude/agent-memory/orchestrator/MEMORY.md +3 -0
- package/resources/claude-customizations/.claude/agent-memory/orchestrator/feedback_repo_root_is_source_of_truth.md +11 -0
- package/resources/claude-customizations/.claude/agent-memory/orchestrator/feedback_vsce_verify_package_location.md +19 -0
- package/resources/claude-customizations/.claude/agent-memory/orchestrator/project_extension_location.md +11 -0
- package/resources/claude-customizations/.claude/agent-memory/prd-feature/MEMORY.md +1 -0
- package/resources/claude-customizations/.claude/agent-memory/prd-feature/project_push_down_pattern.md +13 -0
- package/resources/claude-customizations/.claude/agent-memory/task-researcher/MEMORY.md +3 -0
- package/resources/claude-customizations/.claude/agent-memory/task-researcher/project_push_down_claude_dir.md +11 -0
- package/resources/claude-customizations/.claude/agents/atomic-executor.md +135 -0
- package/resources/claude-customizations/.claude/agents/atomic-planner.md +71 -0
- package/resources/claude-customizations/.claude/agents/csharp-typed-engineer.md +69 -0
- package/resources/claude-customizations/.claude/agents/epic-review.md +40 -0
- package/resources/claude-customizations/.claude/agents/feature-review.md +136 -0
- package/resources/claude-customizations/.claude/agents/orchestrator.md +83 -0
- package/resources/claude-customizations/.claude/agents/powershell-typed-engineer.md +80 -0
- package/resources/claude-customizations/.claude/agents/prd-feature.md +42 -0
- package/resources/claude-customizations/.claude/agents/python-typed-engineer.md +72 -0
- package/resources/claude-customizations/.claude/agents/staged-review.md +41 -0
- package/resources/claude-customizations/.claude/agents/status-updater.md +41 -0
- package/resources/claude-customizations/.claude/agents/task-researcher.md +81 -0
- package/resources/claude-customizations/.claude/agents/typescript-engineer.md +24 -0
- package/resources/claude-customizations/.claude/hooks/check-powershell-test-purity.ps1 +111 -0
- package/resources/claude-customizations/.claude/hooks/check-python-test-purity.ps1 +146 -0
- package/resources/claude-customizations/.claude/hooks/enforce-evidence-locations.ps1 +150 -0
- package/resources/claude-customizations/.claude/hooks/enforce-powershell-batch-budget.ps1 +238 -0
- package/resources/claude-customizations/.claude/hooks/enforce-promotion-mcp-only.ps1 +147 -0
- package/resources/claude-customizations/.claude/hooks/enforce-python-batch-budget.ps1 +235 -0
- package/resources/claude-customizations/.claude/hooks/validate-bash.ps1 +69 -0
- package/resources/claude-customizations/.claude/hooks/validate-executor-output.ps1 +296 -0
- package/resources/claude-customizations/.claude/hooks/validate-feature-review-coverage.ps1 +389 -0
- package/resources/claude-customizations/.claude/hooks/validate-orchestrator-output.ps1 +141 -0
- package/resources/claude-customizations/.claude/hooks/validate-planner-output.ps1 +288 -0
- package/resources/claude-customizations/.claude/hooks/validate-required-artifact-output.ps1 +171 -0
- package/resources/claude-customizations/.claude/hooks/validate-task-researcher-output.ps1 +142 -0
- package/resources/claude-customizations/.claude/rules/csharp.md +62 -0
- package/resources/claude-customizations/.claude/rules/general-code-change.md +71 -0
- package/resources/claude-customizations/.claude/rules/general-unit-test.md +60 -0
- package/resources/claude-customizations/.claude/rules/powershell.md +97 -0
- package/resources/claude-customizations/.claude/rules/python-suppressions.md +143 -0
- package/resources/claude-customizations/.claude/rules/python.md +99 -0
- package/resources/claude-customizations/.claude/rules/self-explanatory-code-commenting.md +97 -0
- package/resources/claude-customizations/.claude/rules/tonality.md +80 -0
- package/resources/claude-customizations/.claude/rules/typescript-suppressions.md +66 -0
- package/resources/claude-customizations/.claude/rules/typescript.md +45 -0
- package/resources/claude-customizations/.claude/settings.json +144 -0
- package/resources/claude-customizations/.claude/skills/acceptance-criteria-tracking/SKILL.md +102 -0
- package/resources/claude-customizations/.claude/skills/atomic-plan-contract/SKILL.md +189 -0
- package/resources/claude-customizations/.claude/skills/commit-message/SKILL.md +65 -0
- package/resources/claude-customizations/.claude/skills/csharp-change-budget-router/SKILL.md +90 -0
- package/resources/claude-customizations/.claude/skills/csharp-orchestration-state-machine/SKILL.md +58 -0
- package/resources/claude-customizations/.claude/skills/csharp-qa-gate/SKILL.md +77 -0
- package/resources/claude-customizations/.claude/skills/evidence-and-timestamp-conventions/SKILL.md +164 -0
- package/resources/claude-customizations/.claude/skills/execute-hard-lock/SKILL.md +82 -0
- package/resources/claude-customizations/.claude/skills/feature-promotion-lifecycle/SKILL.md +115 -0
- package/resources/claude-customizations/.claude/skills/feature-review-workflow/SKILL.md +167 -0
- package/resources/claude-customizations/.claude/skills/fill-feature-docs/SKILL.md +22 -0
- package/resources/claude-customizations/.claude/skills/invoke-csharp-engineer/SKILL.md +64 -0
- package/resources/claude-customizations/.claude/skills/invoke-powershell-engineer/SKILL.md +65 -0
- package/resources/claude-customizations/.claude/skills/invoke-python-engineer/SKILL.md +64 -0
- package/resources/claude-customizations/.claude/skills/make-skill-template/SKILL.md +147 -0
- package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +132 -0
- package/resources/claude-customizations/.claude/skills/policy-audit-template-usage/SKILL.md +49 -0
- package/resources/claude-customizations/.claude/skills/policy-compliance-order/SKILL.md +40 -0
- package/resources/claude-customizations/.claude/skills/powershell-change-budget-router/SKILL.md +49 -0
- package/resources/claude-customizations/.claude/skills/powershell-orchestration-state-machine/SKILL.md +58 -0
- package/resources/claude-customizations/.claude/skills/powershell-qa-gate/SKILL.md +77 -0
- package/resources/claude-customizations/.claude/skills/pr-author/SKILL.md +50 -0
- package/resources/claude-customizations/.claude/skills/pr-base-branch-merge-base/SKILL.md +56 -0
- package/resources/claude-customizations/.claude/skills/pr-context-artifacts/SKILL.md +30 -0
- package/resources/claude-customizations/.claude/skills/python-change-budget-router/SKILL.md +79 -0
- package/resources/claude-customizations/.claude/skills/python-qa-gate/SKILL.md +77 -0
- package/resources/claude-customizations/.claude/skills/remediation-handoff-atomic-planner/SKILL.md +40 -0
- package/resources/claude-customizations/.claude/skills/research-issue/SKILL.md +67 -0
- package/resources/claude-customizations/.claude/skills/review-epic/SKILL.md +21 -0
- package/resources/claude-customizations/.claude/skills/review-feature/SKILL.md +25 -0
- package/resources/claude-customizations/.claude/skills/review-staged/SKILL.md +21 -0
- package/resources/claude-customizations/.claude/skills/skill-canonical-location-audit/SKILL.md +49 -0
- package/resources/claude-customizations/.claude/skills/translate-copilot-to-claude/SKILL.md +295 -0
- package/resources/claude-customizations/.claude/skills/update-status/SKILL.md +21 -0
- package/resources/claude-dir-customizations/.mcp.json +8 -0
- package/resources/codex-and-agents-customizations/.agents/README.md +86 -0
- package/resources/codex-and-agents-customizations/.agents/skills/README.md +49 -0
- package/resources/codex-and-agents-customizations/.agents/skills/acceptance-criteria-tracking/SKILL.md +107 -0
- package/resources/codex-and-agents-customizations/.agents/skills/atomic-executor/SKILL.md +73 -0
- package/resources/codex-and-agents-customizations/.agents/skills/atomic-plan-contract/SKILL.md +194 -0
- package/resources/codex-and-agents-customizations/.agents/skills/atomic-planner/SKILL.md +87 -0
- package/resources/codex-and-agents-customizations/.agents/skills/commit-message/SKILL.md +70 -0
- package/resources/codex-and-agents-customizations/.agents/skills/commit-message-conventions/SKILL.md +95 -0
- package/resources/codex-and-agents-customizations/.agents/skills/csharp/SKILL.md +67 -0
- package/resources/codex-and-agents-customizations/.agents/skills/csharp-change-budget-router/SKILL.md +94 -0
- package/resources/codex-and-agents-customizations/.agents/skills/csharp-orchestration-state-machine/SKILL.md +64 -0
- package/resources/codex-and-agents-customizations/.agents/skills/csharp-qa-gate/SKILL.md +82 -0
- package/resources/codex-and-agents-customizations/.agents/skills/evidence-and-timestamp-conventions/SKILL.md +168 -0
- package/resources/codex-and-agents-customizations/.agents/skills/execute-hard-lock/SKILL.md +88 -0
- package/resources/codex-and-agents-customizations/.agents/skills/feature-promotion-lifecycle/SKILL.md +129 -0
- package/resources/codex-and-agents-customizations/.agents/skills/feature-review/SKILL.md +106 -0
- package/resources/codex-and-agents-customizations/.agents/skills/feature-review-workflow/SKILL.md +181 -0
- package/resources/codex-and-agents-customizations/.agents/skills/fill-feature-docs/SKILL.md +27 -0
- package/resources/codex-and-agents-customizations/.agents/skills/invoke-csharp-engineer/SKILL.md +73 -0
- package/resources/codex-and-agents-customizations/.agents/skills/invoke-powershell-engineer/SKILL.md +74 -0
- package/resources/codex-and-agents-customizations/.agents/skills/invoke-python-engineer/SKILL.md +73 -0
- package/resources/codex-and-agents-customizations/.agents/skills/make-skill-template/SKILL.md +152 -0
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrate/SKILL.md +143 -0
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-workflow/SKILL.md +317 -0
- package/resources/codex-and-agents-customizations/.agents/skills/policy-audit-template-usage/SKILL.md +53 -0
- package/resources/codex-and-agents-customizations/.agents/skills/policy-compliance-order/SKILL.md +49 -0
- package/resources/codex-and-agents-customizations/.agents/skills/powershell/SKILL.md +102 -0
- package/resources/codex-and-agents-customizations/.agents/skills/powershell-change-budget-router/SKILL.md +53 -0
- package/resources/codex-and-agents-customizations/.agents/skills/powershell-orchestration-state-machine/SKILL.md +64 -0
- package/resources/codex-and-agents-customizations/.agents/skills/powershell-qa-gate/SKILL.md +83 -0
- package/resources/codex-and-agents-customizations/.agents/skills/pr-author/SKILL.md +55 -0
- package/resources/codex-and-agents-customizations/.agents/skills/pr-authoring/SKILL.md +124 -0
- package/resources/codex-and-agents-customizations/.agents/skills/pr-base-branch-merge-base/SKILL.md +60 -0
- package/resources/codex-and-agents-customizations/.agents/skills/pr-context-artifacts/SKILL.md +34 -0
- package/resources/codex-and-agents-customizations/.agents/skills/python/SKILL.md +104 -0
- package/resources/codex-and-agents-customizations/.agents/skills/python-change-budget-router/SKILL.md +84 -0
- package/resources/codex-and-agents-customizations/.agents/skills/python-qa-gate/SKILL.md +82 -0
- package/resources/codex-and-agents-customizations/.agents/skills/python-suppressions/SKILL.md +148 -0
- package/resources/codex-and-agents-customizations/.agents/skills/remediation-handoff-atomic-planner/SKILL.md +49 -0
- package/resources/codex-and-agents-customizations/.agents/skills/repo-automation-adapter/SKILL.md +142 -0
- package/resources/codex-and-agents-customizations/.agents/skills/repo-automation-adapter/agents/openai.yaml +5 -0
- package/resources/codex-and-agents-customizations/.agents/skills/research-issue/SKILL.md +72 -0
- package/resources/codex-and-agents-customizations/.agents/skills/review-epic/SKILL.md +26 -0
- package/resources/codex-and-agents-customizations/.agents/skills/review-feature/SKILL.md +30 -0
- package/resources/codex-and-agents-customizations/.agents/skills/review-staged/SKILL.md +26 -0
- package/resources/codex-and-agents-customizations/.agents/skills/self-explanatory-code-commenting/SKILL.md +102 -0
- package/resources/codex-and-agents-customizations/.agents/skills/skill-canonical-location-audit/SKILL.md +52 -0
- package/resources/codex-and-agents-customizations/.agents/skills/translate-copilot-to-claude/SKILL.md +317 -0
- package/resources/codex-and-agents-customizations/.agents/skills/typescript/SKILL.md +50 -0
- package/resources/codex-and-agents-customizations/.agents/skills/typescript-suppressions/SKILL.md +71 -0
- package/resources/codex-and-agents-customizations/.agents/skills/update-status/SKILL.md +26 -0
- package/resources/codex-and-agents-customizations/.codex/agents/5.1-beast-adjusted.toml +23 -0
- package/resources/codex-and-agents-customizations/.codex/agents/5.1-thinking-beast-mode-adjusted.toml +23 -0
- package/resources/codex-and-agents-customizations/.codex/agents/api-architect.toml +23 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor.toml +151 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner.toml +93 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planning.toml +24 -0
- package/resources/codex-and-agents-customizations/.codex/agents/commentary-remediation.toml +23 -0
- package/resources/codex-and-agents-customizations/.codex/agents/commit-steward.toml +20 -0
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-atomic-executor.toml +24 -0
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-atomic-planning.toml +25 -0
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-orchestrator.toml +56 -0
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer.toml +97 -0
- package/resources/codex-and-agents-customizations/.codex/agents/epic-review.toml +52 -0
- package/resources/codex-and-agents-customizations/.codex/agents/expert-nextjs-developer.toml +23 -0
- package/resources/codex-and-agents-customizations/.codex/agents/expert-react-frontend-engineer.toml +23 -0
- package/resources/codex-and-agents-customizations/.codex/agents/feature-review.toml +149 -0
- package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer.toml +60 -0
- package/resources/codex-and-agents-customizations/.codex/agents/gpt-5-beast-mode.toml +23 -0
- package/resources/codex-and-agents-customizations/.codex/agents/hlbpa.toml +23 -0
- package/resources/codex-and-agents-customizations/.codex/agents/mentor.toml +23 -0
- package/resources/codex-and-agents-customizations/.codex/agents/orchestrator.toml +121 -0
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-atomic-executor.toml +24 -0
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-atomic-planning.toml +25 -0
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-di-unit-test-engineer.toml +24 -0
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-orchestrator.toml +56 -0
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer.toml +108 -0
- package/resources/codex-and-agents-customizations/.codex/agents/pr-author.toml +26 -0
- package/resources/codex-and-agents-customizations/.codex/agents/prd-feature.toml +53 -0
- package/resources/codex-and-agents-customizations/.codex/agents/prd.toml +23 -0
- package/resources/codex-and-agents-customizations/.codex/agents/pytest-unit-test-coding.toml +24 -0
- package/resources/codex-and-agents-customizations/.codex/agents/python-atomic-executor.toml +24 -0
- package/resources/codex-and-agents-customizations/.codex/agents/python-atomic-planning.toml +25 -0
- package/resources/codex-and-agents-customizations/.codex/agents/python-execution-only-typed.toml +24 -0
- package/resources/codex-and-agents-customizations/.codex/agents/python-orchestrator.toml +54 -0
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer.toml +100 -0
- package/resources/codex-and-agents-customizations/.codex/agents/staged-review.toml +53 -0
- package/resources/codex-and-agents-customizations/.codex/agents/status-updater.toml +53 -0
- package/resources/codex-and-agents-customizations/.codex/agents/task-researcher.toml +103 -0
- package/resources/codex-and-agents-customizations/.codex/agents/tdd-green.toml +23 -0
- package/resources/codex-and-agents-customizations/.codex/agents/tdd-red.toml +23 -0
- package/resources/codex-and-agents-customizations/.codex/agents/tdd-refactor.toml +23 -0
- package/resources/codex-and-agents-customizations/.codex/agents/typescript-engineer.toml +48 -0
- package/resources/codex-and-agents-customizations/.codex/agents/voidbeast-gpt41enhanced.toml +23 -0
- package/resources/codex-and-agents-customizations/.codex/codex-web-setup.plan.md +26 -0
- package/resources/codex-and-agents-customizations/.codex/codex-web-setup.sh +384 -0
- package/resources/codex-and-agents-customizations/.codex/config.toml +137 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/check-powershell-test-purity.ps1 +113 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/check-python-test-purity.ps1 +149 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-evidence-locations.ps1 +153 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-powershell-batch-budget.ps1 +241 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-promotion-mcp-only.ps1 +150 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-python-batch-budget.ps1 +238 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/validate-bash.ps1 +72 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/validate-feature-review-coverage.ps1 +265 -0
- package/resources/codex-and-agents-customizations/.codex/prompts/feature-review-remediate.md +10 -0
- package/resources/codex-and-agents-customizations/.codex/prompts/generate-commit-message-repo.md +11 -0
- package/resources/codex-and-agents-customizations/.codex/prompts/generate-pr.md +15 -0
- package/resources/codex-and-agents-customizations/.codex/prompts/orchestrate-work.md +22 -0
- package/resources/codex-and-agents-customizations/AGENTS.md +317 -0
- package/resources/customizations/.github/agents/5.1-Beast-adjusted.agent.md +181 -0
- package/resources/customizations/.github/agents/5.1-Thinking-Beast-Mode-adjusted.agent.md +361 -0
- package/resources/customizations/.github/agents/Powershell DI Unit Test Engineer.agent.md +192 -0
- package/resources/customizations/.github/agents/api-architect.agent.md +40 -0
- package/resources/customizations/.github/agents/atomic_executor.agent.md +251 -0
- package/resources/customizations/.github/agents/atomic_planning.agent.md +658 -0
- package/resources/customizations/.github/agents/commentary-remediation.agent.md +35 -0
- package/resources/customizations/.github/agents/commit-steward.agent.md +200 -0
- package/resources/customizations/.github/agents/csharp-atomic-executor.agent.md +288 -0
- package/resources/customizations/.github/agents/csharp-atomic-planning.agent.md +354 -0
- package/resources/customizations/.github/agents/csharp-orchestrator.agent.md +375 -0
- package/resources/customizations/.github/agents/csharp-typed-engineer.agent.md +285 -0
- package/resources/customizations/.github/agents/epic-review.agent.md +374 -0
- package/resources/customizations/.github/agents/expert-nextjs-developer.agent.md +477 -0
- package/resources/customizations/.github/agents/expert-react-frontend-engineer.agent.md +739 -0
- package/resources/customizations/.github/agents/feature-review.agent.md +49 -0
- package/resources/customizations/.github/agents/gpt-5-beast-mode.agent.md +116 -0
- package/resources/customizations/.github/agents/hlbpa.agent.md +219 -0
- package/resources/customizations/.github/agents/mentor.agent.md +32 -0
- package/resources/customizations/.github/agents/orchestrator.agent.md +449 -0
- package/resources/customizations/.github/agents/powershell-atomic-executor.agent.md +287 -0
- package/resources/customizations/.github/agents/powershell-atomic-planning.agent.md +647 -0
- package/resources/customizations/.github/agents/powershell-orchestrator.agent.md +382 -0
- package/resources/customizations/.github/agents/powershell-typed-engineer.agent.md +293 -0
- package/resources/customizations/.github/agents/pr-author.agent.md +138 -0
- package/resources/customizations/.github/agents/prd-feature.agent.md +52 -0
- package/resources/customizations/.github/agents/prd.agent.md +202 -0
- package/resources/customizations/.github/agents/pytest-unit-test-coding.agent.md +202 -0
- package/resources/customizations/.github/agents/python-atomic-executor.agent.md +289 -0
- package/resources/customizations/.github/agents/python-atomic-planning.agent.md +429 -0
- package/resources/customizations/.github/agents/python-execution-only-typed.agent.md +217 -0
- package/resources/customizations/.github/agents/python-orchestrator.agent.md +380 -0
- package/resources/customizations/.github/agents/python-typed-engineer.agent.md +271 -0
- package/resources/customizations/.github/agents/staged-review.agent.md +246 -0
- package/resources/customizations/.github/agents/status_updater.agent.md +279 -0
- package/resources/customizations/.github/agents/task-researcher.agent.md +298 -0
- package/resources/customizations/.github/agents/tdd-green.agent.md +60 -0
- package/resources/customizations/.github/agents/tdd-red.agent.md +66 -0
- package/resources/customizations/.github/agents/tdd-refactor.agent.md +94 -0
- package/resources/customizations/.github/agents/typescript-engineer.agent.md +167 -0
- package/resources/customizations/.github/agents/voidbeast-gpt41enhanced.agent.md +230 -0
- package/resources/customizations/.github/codex/execute-hard-lock.prompt.md +105 -0
- package/resources/customizations/.github/codex/resume-hard-lock.prompt.md +92 -0
- package/resources/customizations/.github/copilot-instructions.md +7 -0
- package/resources/customizations/.github/instructions/csharp-code-change.instructions.md +184 -0
- package/resources/customizations/.github/instructions/csharp-unit-test.instructions.md +52 -0
- package/resources/customizations/.github/instructions/general-code-change.instructions.md +290 -0
- package/resources/customizations/.github/instructions/general-unit-test.instructions.md +106 -0
- package/resources/customizations/.github/instructions/github-actions-ci-cd-best-practices.instructions.md +607 -0
- package/resources/customizations/.github/instructions/github-actions.instructions.md +23 -0
- package/resources/customizations/.github/instructions/powershell-code-change.instructions.md +81 -0
- package/resources/customizations/.github/instructions/powershell-unit-test.instructions.md +69 -0
- package/resources/customizations/.github/instructions/python-code-change.instructions.md +232 -0
- package/resources/customizations/.github/instructions/python-suppressions.instructions.md +609 -0
- package/resources/customizations/.github/instructions/python-unit-test.instructions.md +71 -0
- package/resources/customizations/.github/instructions/self-explanatory-code-commenting.instructions.md +238 -0
- package/resources/customizations/.github/instructions/tonality.instructions.md +133 -0
- package/resources/customizations/.github/instructions/typescript-code-change.instructions.md +203 -0
- package/resources/customizations/.github/instructions/typescript-suppressions.instructions.md +157 -0
- package/resources/customizations/.github/instructions/typescript-unit-test.instructions.md +112 -0
- package/resources/customizations/.github/prompts/add-educational-comments.prompt.md +129 -0
- package/resources/customizations/.github/prompts/breakdown-bug-prd.prompt.md +29 -0
- package/resources/customizations/.github/prompts/breakdown-epic-arch.prompt.md +66 -0
- package/resources/customizations/.github/prompts/breakdown-epic-pm.prompt.md +58 -0
- package/resources/customizations/.github/prompts/breakdown-feature-implementation.prompt.md +128 -0
- package/resources/customizations/.github/prompts/breakdown-feature-prd.prompt.md +61 -0
- package/resources/customizations/.github/prompts/code-exemplars-blueprint-generator.prompt.md +126 -0
- package/resources/customizations/.github/prompts/drafts/create-github-issues-feature-from-implementation-plan.prompt.md +28 -0
- package/resources/customizations/.github/prompts/drafts/create-implementation-plan.prompt.md +158 -0
- package/resources/customizations/.github/prompts/drafts/create-technical-spike.prompt.md +231 -0
- package/resources/customizations/.github/prompts/drafts/potential-feature-prd.prompt.md +19 -0
- package/resources/customizations/.github/prompts/drafts/update-implementation-plan.prompt.md +158 -0
- package/resources/customizations/.github/prompts/execute-plan-template.md +21 -0
- package/resources/customizations/.github/prompts/export-chat.prompt.md +7 -0
- package/resources/customizations/.github/prompts/fillout-prd-feature.prompt.md +46 -0
- package/resources/customizations/.github/prompts/generate-atomic-plan.prompt.md +96 -0
- package/resources/customizations/.github/prompts/generate-commit-message-repo.prompt.md +108 -0
- package/resources/customizations/.github/prompts/generate-pr.prompt.md +151 -0
- package/resources/customizations/.github/prompts/javascript-typescript-jest.prompt.md +44 -0
- package/resources/customizations/.github/prompts/orchestrate-csharp-work.prompt.md +66 -0
- package/resources/customizations/.github/prompts/orchestrate-powershell-work.prompt.md +50 -0
- package/resources/customizations/.github/prompts/orchestrate-python-work.prompt.md +50 -0
- package/resources/customizations/.github/prompts/orchestrate-work.prompt.md +66 -0
- package/resources/customizations/.github/prompts/remediate-comments.prompt.md +53 -0
- package/resources/customizations/.github/prompts/research-issue.prompt.md +125 -0
- package/resources/customizations/.github/prompts/review-epic.prompt.md +94 -0
- package/resources/customizations/.github/prompts/review-feature.prompt.md +130 -0
- package/resources/customizations/.github/prompts/review-staged.prompt.md +43 -0
- package/resources/customizations/.github/prompts/update_status.prompt.md +68 -0
- package/resources/customizations/.github/skills/README.md +26 -0
- package/resources/customizations/.github/skills/acceptance-criteria-tracking/SKILL.md +102 -0
- package/resources/customizations/.github/skills/atomic-plan-contract/SKILL.md +174 -0
- package/resources/customizations/.github/skills/csharp-change-budget-router/SKILL.md +48 -0
- package/resources/customizations/.github/skills/csharp-orchestration-state-machine/SKILL.md +57 -0
- package/resources/customizations/.github/skills/evidence-and-timestamp-conventions/SKILL.md +135 -0
- package/resources/customizations/.github/skills/feature-promotion-lifecycle/SKILL.md +121 -0
- package/resources/customizations/.github/skills/feature-review-workflow/SKILL.md +153 -0
- package/resources/customizations/.github/skills/make-skill-template/SKILL.md +147 -0
- package/resources/customizations/.github/skills/policy-audit-template-usage/SKILL.md +48 -0
- package/resources/customizations/.github/skills/policy-compliance-order/SKILL.md +37 -0
- package/resources/customizations/.github/skills/powershell-change-budget-router/SKILL.md +48 -0
- package/resources/customizations/.github/skills/powershell-orchestration-state-machine/SKILL.md +57 -0
- package/resources/customizations/.github/skills/pr-base-branch-merge-base/SKILL.md +55 -0
- package/resources/customizations/.github/skills/pr-context-artifacts/SKILL.md +29 -0
- package/resources/customizations/.github/skills/remediation-handoff-atomic-planner/SKILL.md +39 -0
- package/resources/customizations/.github/skills/skill-canonical-location-audit/SKILL.md +48 -0
- package/resources/feature-templates/bug/plan.yyyy-MM-ddTHH-mm.md +44 -0
- package/resources/feature-templates/bug/potential_bug.md +59 -0
- package/resources/feature-templates/bug/spec.md +99 -0
- package/resources/feature-templates/epic/initiative.md +43 -0
- package/resources/feature-templates/feature/plan.yyyy-MM-ddTHH-mm.md +53 -0
- package/resources/feature-templates/feature/spec.md +66 -0
- package/resources/feature-templates/feature/user-story.md +42 -0
- package/resources/feature-templates/potential/template.md +33 -0
- package/resources/feature-templates/refactor/plan.yyyy-MM-ddTHH-mm.md +52 -0
- package/resources/feature-templates/refactor/spec.md +69 -0
- package/resources/powershell/PoshQC/PoshQC.Analyzer.psm1 +254 -0
- package/resources/powershell/PoshQC/PoshQC.FileDiscovery.psm1 +138 -0
- package/resources/powershell/PoshQC/PoshQC.Testing.psm1 +409 -0
- package/resources/powershell/PoshQC/PoshQC.psd1 +31 -0
- package/resources/powershell/PoshQC/PoshQC.psm1 +101 -0
- package/resources/powershell/PoshQC/README.md +80 -0
- package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +59 -0
- package/resources/powershell/PoshQC/settings/pssa.settings.psd1 +55 -0
- package/resources/scripts/dev_tools/__init__.py +0 -0
- package/resources/scripts/dev_tools/agentic_sync.py +819 -0
- package/resources/scripts/dev_tools/codex_native_converter/__init__.py +11 -0
- package/resources/scripts/dev_tools/codex_native_converter/__main__.py +6 -0
- package/resources/scripts/dev_tools/codex_native_converter/cli.py +11 -0
- package/resources/scripts/dev_tools/new_active_feature_folder.py +79 -0
- package/resources/scripts/dev_tools/new_active_feature_folder_docs.py +268 -0
- package/resources/scripts/dev_tools/new_active_feature_folder_flow.py +366 -0
- package/resources/scripts/dev_tools/new_active_feature_folder_io.py +306 -0
- package/resources/scripts/dev_tools/new_active_feature_folder_markdown.py +252 -0
- package/resources/scripts/dev_tools/new_active_feature_folder_models.py +136 -0
- package/resources/scripts/dev_tools/new_potential_bug_entry.py +465 -0
- package/resources/scripts/dev_tools/potential_to_issue.py +421 -0
- package/resources/scripts/dev_tools/potential_to_issue_content.py +212 -0
- package/resources/scripts/dev_tools/pr_context/__init__.py +0 -0
- package/resources/scripts/dev_tools/pr_context/collector.py +619 -0
- package/resources/scripts/dev_tools/pr_context/feature_docs.py +349 -0
- package/resources/scripts/dev_tools/pr_context/git.py +153 -0
- package/resources/scripts/dev_tools/pr_context/github.py +549 -0
- package/resources/scripts/dev_tools/pr_context/models.py +198 -0
- package/resources/scripts/dev_tools/pr_context/render.py +342 -0
- package/resources/scripts/dev_tools/pr_context/render_feature_excerpts.py +256 -0
- package/resources/scripts/dev_tools/pr_context/render_pr_helpers.py +291 -0
- package/resources/scripts/dev_tools/pr_context/summary_helpers.py +386 -0
- package/resources/scripts/dev_tools/pr_context/verification_evidence.py +171 -0
- package/resources/scripts/dev_tools/prompt_mode_contract.py +152 -0
- package/resources/scripts/dev_tools/push_down_claude_customizations.py +188 -0
- package/resources/scripts/dev_tools/push_down_codex_and_agents_customizations.py +139 -0
- package/resources/scripts/dev_tools/push_down_copilot_customizations.py +504 -0
- package/resources/scripts/dev_tools/push_down_copilot_customizations_filesystem.py +217 -0
- package/resources/scripts/dev_tools/push_down_copilot_customizations_rewrites.py +293 -0
- package/resources/scripts/dev_tools/resolve_file_prompt.py +457 -0
- package/resources/scripts/dev_tools/resolve_hard_lock_prompt.py +444 -0
- package/resources/scripts/dev_tools/validate_orchestration_artifacts.py +554 -0
- package/resources/templates/codex_native_converter.py +35 -0
- package/resources/templates/collect_commit_context.py +212 -0
- package/resources/templates/collect_pr_context.py +74 -0
- package/resources/templates/hello_pwsh.ps1 +3 -0
- package/resources/templates/hello_python.py +11 -0
- package/resources/templates/link-parent-child.ps1 +480 -0
- package/resources/templates/new-claude-worktree-session.ps1 +232 -0
- package/resources/templates/new-potential-entry.ps1 +187 -0
- package/resources/templates/new_active_feature_folder.py +67 -0
- package/resources/templates/new_potential_bug_entry.py +54 -0
- package/resources/templates/policy_audit/AGENTS.md +117 -0
- package/resources/templates/policy_audit/code-review.yyyy-MM-ddTHH-mm.md +165 -0
- package/resources/templates/policy_audit/feature-audit.yyyy-MM-ddTHH-mm.md +124 -0
- package/resources/templates/policy_audit/policy-audit.yyyy-MM-ddTHH-mm.md +649 -0
- package/resources/templates/potential_to_issue.py +55 -0
- package/resources/templates/push_down_claude_customizations.py +188 -0
- package/resources/templates/push_down_codex_and_agents_customizations.py +95 -0
- package/resources/templates/push_down_copilot_customizations.py +124 -0
- package/resources/templates/resolve_atomic_plan_prompt.py +75 -0
- package/resources/templates/resolve_hard_lock_prompt.py +65 -0
- package/resources/templates/run-poshqc-analyze-autofix.ps1 +16 -0
- package/resources/templates/run-poshqc-analyze.ps1 +26 -0
- package/resources/templates/run-poshqc-format.ps1 +26 -0
- package/resources/templates/run-poshqc-suite.ps1 +24 -0
- package/resources/templates/run-poshqc-test.ps1 +32 -0
- package/resources/templates/sync-agents-from-instructions.ps1 +400 -0
- package/resources/templates/validate_orchestration_artifacts.py +55 -0
- package/resources/templates/vscode-cli.helpers.ps1 +63 -0
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
---
|
|
2
|
+
applyTo: "**/*.py"
|
|
3
|
+
name: python-suppressions-policy
|
|
4
|
+
description: "Pre-authorized patterns for # noqa and # type: ignore suppressions in Python code"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Pre-Authorized Suppression Patterns
|
|
8
|
+
|
|
9
|
+
This policy defines the **only** patterns of `# noqa` and `# type: ignore` suppressions that are pre-authorized for use in Python code without explicit user approval.
|
|
10
|
+
|
|
11
|
+
**Authorization requirement:**
|
|
12
|
+
- All `# noqa` and `# type: ignore` suppressions must either:
|
|
13
|
+
1. **Match a pre-authorized pattern** defined in this file, OR
|
|
14
|
+
2. **Have explicit user approval** for that specific suppression
|
|
15
|
+
|
|
16
|
+
**If you encounter an error that seems to require a suppression not matching a pre-authorized pattern:**
|
|
17
|
+
1. First, attempt to resolve it without a suppression (refactor, restructure, use approved patterns)
|
|
18
|
+
2. If that fails, try at least five more distinct approaches
|
|
19
|
+
3. Continue iterating until you solve the problem or demonstrate why each approach fails
|
|
20
|
+
4. Only after multiple documented failed attempts may you request user approval, providing:
|
|
21
|
+
- The specific rule/error and diagnostic code
|
|
22
|
+
- Each approach you tried and why it failed
|
|
23
|
+
- Why a suppression is the only remaining option
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Ruff Suppressions
|
|
28
|
+
|
|
29
|
+
### S603: subprocess call - check for execution of untrusted input
|
|
30
|
+
|
|
31
|
+
**When pre-authorized:**
|
|
32
|
+
Subprocess calls where the executable is validated via `shutil.which()` before use.
|
|
33
|
+
|
|
34
|
+
**Required pattern:**
|
|
35
|
+
```python
|
|
36
|
+
# Validate executable exists and resolve full path
|
|
37
|
+
exe = shutil.which("tool_name")
|
|
38
|
+
if not exe:
|
|
39
|
+
raise FileNotFoundError("Required executable not found on PATH: tool_name")
|
|
40
|
+
|
|
41
|
+
# Use validated executable in subprocess call
|
|
42
|
+
subprocess.run([exe, ...]) # noqa: S603 - static analysis can't verify runtime validation
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Required comment format:**
|
|
46
|
+
`# noqa: S603 - static analysis can't verify runtime validation`
|
|
47
|
+
|
|
48
|
+
**Justification:**
|
|
49
|
+
Cross-platform compatibility requires runtime PATH resolution via `shutil.which()`. Static analysis cannot trace the runtime validation, but the code is safe because:
|
|
50
|
+
1. The executable path is resolved from PATH (not user input)
|
|
51
|
+
2. We verify it exists before use
|
|
52
|
+
3. Hardcoding platform-specific paths like `/usr/bin/git` or `C:\\Program Files\\Git\\bin\\git.exe` would break portability
|
|
53
|
+
|
|
54
|
+
**Examples:**
|
|
55
|
+
- Git operations: `git_exe = shutil.which("git")`
|
|
56
|
+
- Clipboard commands: `clip_exe = shutil.which("pbcopy")`
|
|
57
|
+
- Any system tool resolved from PATH
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Pyright Suppressions
|
|
62
|
+
|
|
63
|
+
### import-untyped: Cannot access member for module with unknown type
|
|
64
|
+
|
|
65
|
+
**When pre-authorized:**
|
|
66
|
+
Optional third-party dependencies that lack type stubs or `py.typed` marker.
|
|
67
|
+
|
|
68
|
+
**Required pattern:**
|
|
69
|
+
```python
|
|
70
|
+
try:
|
|
71
|
+
import untyped_library # type: ignore[import-untyped]
|
|
72
|
+
# Use library...
|
|
73
|
+
except ImportError:
|
|
74
|
+
# Graceful fallback when library not installed
|
|
75
|
+
pass
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Required context:**
|
|
79
|
+
- Import must be in a try/except ImportError block
|
|
80
|
+
- Library must be optional (not in core dependencies)
|
|
81
|
+
- No type stubs available (checked via typeshed or types-* packages)
|
|
82
|
+
- Library lacks `py.typed` marker (required by PEP 561)
|
|
83
|
+
|
|
84
|
+
**Justification:**
|
|
85
|
+
Optional dependencies may not have type stubs or proper PEP 561 type markers. Rather than exclude entire files from type checking, we use targeted suppressions on the import line while wrapping usage in properly typed adapter functions.
|
|
86
|
+
|
|
87
|
+
**Examples:**
|
|
88
|
+
- `pyperclip` (has inline type hints but lacks `py.typed` marker)
|
|
89
|
+
- `tkinter` (stdlib but excluded from type checking, no stubs)
|
|
90
|
+
- Platform-specific optional libraries
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### ARG002: Unused method argument
|
|
95
|
+
|
|
96
|
+
**When pre-authorized:**
|
|
97
|
+
Test mock/stub implementations that must match interface signatures but don't use all parameters.
|
|
98
|
+
|
|
99
|
+
**Required pattern:**
|
|
100
|
+
```python
|
|
101
|
+
class MockPath:
|
|
102
|
+
def mkdir(self, parents: bool, exist_ok: bool) -> None: # noqa: ARG002 - mock API signature
|
|
103
|
+
"""Mock mkdir that doesn't need arguments."""
|
|
104
|
+
self._created = True
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Required context:**
|
|
108
|
+
- Must be in test code (tests/ directory)
|
|
109
|
+
- Must be implementing a known interface (Path, Tkinter widgets, etc.)
|
|
110
|
+
- Cannot use the parameters without defeating the purpose of the mock
|
|
111
|
+
|
|
112
|
+
**Required comment format:**
|
|
113
|
+
`# noqa: ARG002 - mock API signature` or `# noqa: ARG002 - match [InterfaceName] API`
|
|
114
|
+
|
|
115
|
+
**Justification:**
|
|
116
|
+
Test mocks must match real API signatures for type safety and IDE support, but stub implementations often don't need all parameters. Alternatives (removing parameters, using *args/**kwargs) break type safety.
|
|
117
|
+
|
|
118
|
+
**Examples:**
|
|
119
|
+
- Mock Path.mkdir(parents, exist_ok)
|
|
120
|
+
- Mock Tkinter widget constructors
|
|
121
|
+
- Protocol method stubs in tests
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### B008: Function call in default argument
|
|
126
|
+
|
|
127
|
+
**When pre-authorized:**
|
|
128
|
+
Typer CLI option declarations where Option() must be evaluated at import time.
|
|
129
|
+
|
|
130
|
+
**Required pattern:**
|
|
131
|
+
```python
|
|
132
|
+
def cli_command(
|
|
133
|
+
input_file: Path = typer.Option(..., exists=True), # noqa: B008 - Typer framework pattern
|
|
134
|
+
verbose: bool = typer.Option(False, help="Enable verbose output"), # noqa: B008 - Typer framework pattern
|
|
135
|
+
) -> None:
|
|
136
|
+
"""CLI command using Typer options."""
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Required context:**
|
|
140
|
+
- Must be Typer option declaration in CLI function signature
|
|
141
|
+
- Typer framework requires evaluation at import time for CLI metadata
|
|
142
|
+
- No alternative within Typer's declarative pattern
|
|
143
|
+
|
|
144
|
+
**Required comment format:**
|
|
145
|
+
`# noqa: B008 - Typer framework pattern`
|
|
146
|
+
|
|
147
|
+
**Justification:**
|
|
148
|
+
Typer's declarative CLI pattern evaluates Option() at import time to build CLI metadata. This is framework design, not a code smell. Alternative (procedural approach) would require rewriting entire CLI layer.
|
|
149
|
+
|
|
150
|
+
**Examples:**
|
|
151
|
+
- typer.Option() in function signatures
|
|
152
|
+
- typer.Argument() in function signatures
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
### TCH002/TCH003: Type checking block violations
|
|
157
|
+
|
|
158
|
+
**When pre-authorized:**
|
|
159
|
+
Modules used for both runtime and type hints (pytest fixtures, Typer type hints, etc.).
|
|
160
|
+
|
|
161
|
+
**Required pattern:**
|
|
162
|
+
```python
|
|
163
|
+
import pytest # noqa: TCH002 - pytest required at runtime for fixtures
|
|
164
|
+
|
|
165
|
+
from pathlib import Path # noqa: TCH003 - Path required at runtime for Typer and IO
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Required context:**
|
|
169
|
+
- Module must be used at runtime (fixtures, Typer CLI, runtime isinstance checks)
|
|
170
|
+
- Cannot move to TYPE_CHECKING block without breaking functionality
|
|
171
|
+
- Not just for type hints
|
|
172
|
+
|
|
173
|
+
**Required comment format:**
|
|
174
|
+
`# noqa: TCH002 - [module] required at runtime for [reason]`
|
|
175
|
+
`# noqa: TCH003 - [module] required at runtime for [reason]`
|
|
176
|
+
|
|
177
|
+
**Justification:**
|
|
178
|
+
Some modules serve dual roles: type hints AND runtime functionality. Moving to TYPE_CHECKING block breaks runtime behavior. Duplicating imports violates DRY.
|
|
179
|
+
|
|
180
|
+
**Examples:**
|
|
181
|
+
- pytest (fixtures, marks, decorators)
|
|
182
|
+
- Path (Typer CLI types + file operations)
|
|
183
|
+
- collections.abc (runtime Protocol checks + type hints)
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
### S310: Audit URL open with urllib
|
|
188
|
+
|
|
189
|
+
**When pre-authorized:**
|
|
190
|
+
Accessing documented, trusted HTTPS API endpoints with timeout.
|
|
191
|
+
|
|
192
|
+
**Required pattern:**
|
|
193
|
+
```python
|
|
194
|
+
req = urllib.request.Request( # noqa: S310 - trusted HTTPS endpoint: archive.org
|
|
195
|
+
"https://archive.org/metadata/identifier"
|
|
196
|
+
)
|
|
197
|
+
with urllib.request.urlopen(req, timeout=30) as resp: # noqa: S310 - trusted HTTPS endpoint: archive.org
|
|
198
|
+
data = resp.read()
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Required context:**
|
|
202
|
+
- URL must be validated HTTPS endpoint
|
|
203
|
+
- Domain must be documented trusted source (archive.org, pypi.org, etc.)
|
|
204
|
+
- Timeout must be set
|
|
205
|
+
- Not user-provided URLs
|
|
206
|
+
|
|
207
|
+
**Required comment format:**
|
|
208
|
+
`# noqa: S310 - trusted HTTPS endpoint: [domain]`
|
|
209
|
+
|
|
210
|
+
**Justification:**
|
|
211
|
+
S310 flags ALL urllib calls indiscriminately. When accessing well-known, documented HTTPS APIs with timeouts, the security risk is minimal. Using requests library adds heavy dependency for simple GETs.
|
|
212
|
+
|
|
213
|
+
**Examples:**
|
|
214
|
+
- Internet Archive API
|
|
215
|
+
- PyPI JSON API
|
|
216
|
+
- GitHub API with known endpoints
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
### S314: XML parsing with ElementTree
|
|
221
|
+
|
|
222
|
+
**When pre-authorized:**
|
|
223
|
+
Parsing user's own files or known-safe data sources (not untrusted network data).
|
|
224
|
+
|
|
225
|
+
**Required pattern:**
|
|
226
|
+
```python
|
|
227
|
+
import xml.etree.ElementTree as ET # noqa: S314 - parsing trusted user EPUB files
|
|
228
|
+
|
|
229
|
+
root = ET.fromstring(container_xml) # noqa: S314 - parsing trusted user EPUB files
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Required context:**
|
|
233
|
+
- Parsing user's own local files (EPUB, configuration)
|
|
234
|
+
- Parsing known-safe sources (Wikipedia dumps, curated datasets)
|
|
235
|
+
- NOT parsing untrusted network data
|
|
236
|
+
- EPUB spec requires standard ElementTree for compatibility
|
|
237
|
+
|
|
238
|
+
**Required comment format:**
|
|
239
|
+
`# noqa: S314 - parsing trusted [source type]`
|
|
240
|
+
|
|
241
|
+
**Justification:**
|
|
242
|
+
S314 warns about XML entity expansion attacks from untrusted sources. User's own files and curated datasets are trusted. EPUB spec requires standard ElementTree. defusedxml incompatible with EPUB parsing requirements.
|
|
243
|
+
|
|
244
|
+
**Examples:**
|
|
245
|
+
- EPUB file parsing (user's own books)
|
|
246
|
+
- Wikipedia XML dump processing
|
|
247
|
+
- Configuration file parsing
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
### BLE001: Blind except (CLI entry points ONLY)
|
|
252
|
+
|
|
253
|
+
**When pre-authorized:**
|
|
254
|
+
Top-level CLI exception handlers for user-friendly error messages and clean exits.
|
|
255
|
+
|
|
256
|
+
**Required pattern:**
|
|
257
|
+
```python
|
|
258
|
+
def main() -> None:
|
|
259
|
+
"""CLI entry point."""
|
|
260
|
+
try:
|
|
261
|
+
# CLI logic here
|
|
262
|
+
run_pipeline()
|
|
263
|
+
except Exception as exc: # noqa: BLE001 - CLI top-level error handling
|
|
264
|
+
console.print(f"[red]Error: {exc}[/red]")
|
|
265
|
+
logger.exception("Pipeline failed")
|
|
266
|
+
raise typer.Exit(1)
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**Required context:**
|
|
270
|
+
- Must be at CLI entry point (main, CLI command function)
|
|
271
|
+
- Must log or display error with context
|
|
272
|
+
- Must exit cleanly (not re-raise without handling)
|
|
273
|
+
- NOT allowed in library/internal code
|
|
274
|
+
|
|
275
|
+
**Required comment format:**
|
|
276
|
+
`# noqa: BLE001 - CLI top-level error handling`
|
|
277
|
+
|
|
278
|
+
**Justification:**
|
|
279
|
+
CLI tools must provide user-friendly error messages instead of stack traces. Cannot predict all possible exception types. This is ONLY for user-facing CLI, NOT library code.
|
|
280
|
+
|
|
281
|
+
**Restriction:**
|
|
282
|
+
- **ONLY at CLI entry points**
|
|
283
|
+
- NOT in internal/library functions
|
|
284
|
+
- NOT in test code
|
|
285
|
+
- Must include error logging/display
|
|
286
|
+
|
|
287
|
+
**Examples:**
|
|
288
|
+
- Typer command entry points
|
|
289
|
+
- Script main() functions
|
|
290
|
+
- CLI error wrapper functions
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
### S301: Pickle deserialization (restricted)
|
|
295
|
+
|
|
296
|
+
**When pre-authorized:**
|
|
297
|
+
Loading known model artifacts from hardcoded trusted local paths.
|
|
298
|
+
|
|
299
|
+
**Required pattern:**
|
|
300
|
+
```python
|
|
301
|
+
# Model path is hardcoded, not from user input
|
|
302
|
+
MODEL_PATH = Path(__file__).parent / "artifacts" / "lexile_model.pkl"
|
|
303
|
+
|
|
304
|
+
def load_model() -> Model:
|
|
305
|
+
"""Load pre-trained model from trusted artifact."""
|
|
306
|
+
with open(MODEL_PATH, "rb") as fh:
|
|
307
|
+
return pickle.load(fh) # noqa: S301 - trusted model artifact from hardcoded path
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
**Required context:**
|
|
311
|
+
- Path must be hardcoded or validated (not from user input/CLI args)
|
|
312
|
+
- Loading known model artifacts from trusted local paths
|
|
313
|
+
- Not deserializing user-provided pickle files
|
|
314
|
+
|
|
315
|
+
**Required comment format:**
|
|
316
|
+
`# noqa: S301 - trusted model artifact from hardcoded path`
|
|
317
|
+
|
|
318
|
+
**Justification:**
|
|
319
|
+
ML models contain NumPy arrays not serializable to JSON. HDF5 would require retraining all models. Pickle format doesn't support pre-validation. Safe when loading from known paths.
|
|
320
|
+
|
|
321
|
+
**Restriction:**
|
|
322
|
+
- Path MUST be hardcoded or validated before use
|
|
323
|
+
- NOT from user input/command-line arguments
|
|
324
|
+
- Only for ML model/artifact loading
|
|
325
|
+
|
|
326
|
+
**Examples:**
|
|
327
|
+
- Loading pre-trained ML models
|
|
328
|
+
- Loading tokenizer artifacts
|
|
329
|
+
- Loading vocabulary caches
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
### S108/S105: Hardcoded paths/passwords (tests ONLY)
|
|
334
|
+
|
|
335
|
+
**When pre-authorized:**
|
|
336
|
+
Test fixtures with example paths and test data literals.
|
|
337
|
+
|
|
338
|
+
**Required pattern:**
|
|
339
|
+
```python
|
|
340
|
+
def test_path_handling():
|
|
341
|
+
"""Test with concrete example path."""
|
|
342
|
+
result = process_path("/tmp/test_repo") # noqa: S108 - test fixture path
|
|
343
|
+
assert result.exists()
|
|
344
|
+
|
|
345
|
+
def test_token_parsing():
|
|
346
|
+
"""Test with literal test data."""
|
|
347
|
+
token = "sample_token_string" # noqa: S105 - test fixture data
|
|
348
|
+
assert parse_token(token) == expected
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
**Required context:**
|
|
352
|
+
- Must be in test code only
|
|
353
|
+
- Literal paths/strings for test clarity
|
|
354
|
+
- Not actual secrets or production paths
|
|
355
|
+
|
|
356
|
+
**Required comment format:**
|
|
357
|
+
`# noqa: S108 - test fixture path`
|
|
358
|
+
`# noqa: S105 - test fixture data`
|
|
359
|
+
|
|
360
|
+
**Justification:**
|
|
361
|
+
Test code needs concrete examples for readability. Using temp directories or variables adds complexity without benefit. These are not real paths or secrets.
|
|
362
|
+
|
|
363
|
+
**Restriction:**
|
|
364
|
+
- **ONLY in test files** (tests/ directory)
|
|
365
|
+
- Not in production code
|
|
366
|
+
|
|
367
|
+
**Examples:**
|
|
368
|
+
- Example paths in test assertions
|
|
369
|
+
- Test token/string literals
|
|
370
|
+
- Mock credential strings in tests
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
## Non-authorized Patterns (Explicitly Prohibited - with Workarounds)
|
|
375
|
+
|
|
376
|
+
Beyond the S110 pattern documented earlier, the following patterns are **NOT** pre-authorized. Use the documented workarounds instead.
|
|
377
|
+
|
|
378
|
+
### TID252: Relative imports beyond top-level package - NOT AUTHORIZED
|
|
379
|
+
|
|
380
|
+
**Why NOT authorized:**
|
|
381
|
+
Parent-relative imports (`from ..module import`) reduce code clarity and create coupling.
|
|
382
|
+
|
|
383
|
+
**Recommended alternative pattern:**
|
|
384
|
+
```python
|
|
385
|
+
# Instead of:
|
|
386
|
+
from ..gutenberg_query_core import QueryGroupModel # noqa: TID252
|
|
387
|
+
|
|
388
|
+
# Use absolute imports:
|
|
389
|
+
from lexile_corpus_tuner.lexile_scoring_model.pipeline_scripts.gutenberg_query_core import (
|
|
390
|
+
QueryGroupModel,
|
|
391
|
+
)
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
**Why this is better:**
|
|
395
|
+
- Explicit full path shows exact module location
|
|
396
|
+
- Works regardless of execution context
|
|
397
|
+
- Better IDE support and refactoring tools
|
|
398
|
+
- Clearer for code readers
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
### S607: Starting process with partial executable path - NOT AUTHORIZED
|
|
403
|
+
|
|
404
|
+
**Why NOT authorized:**
|
|
405
|
+
Using partial paths like `"git"` instead of full paths creates security risks.
|
|
406
|
+
|
|
407
|
+
**Recommended alternative pattern:**
|
|
408
|
+
```python
|
|
409
|
+
import shutil
|
|
410
|
+
import subprocess
|
|
411
|
+
|
|
412
|
+
# Validate executable exists and get full path
|
|
413
|
+
git_exe = shutil.which("git")
|
|
414
|
+
if not git_exe:
|
|
415
|
+
raise FileNotFoundError("git not found on PATH")
|
|
416
|
+
|
|
417
|
+
# Use validated full path
|
|
418
|
+
result = subprocess.run(
|
|
419
|
+
[git_exe, "status"], # noqa: S603 - static analysis can't verify runtime validation
|
|
420
|
+
capture_output=True,
|
|
421
|
+
text=True,
|
|
422
|
+
check=True,
|
|
423
|
+
)
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
**Why this is better:**
|
|
427
|
+
- Validates executable exists before use
|
|
428
|
+
- Uses full path from PATH resolution
|
|
429
|
+
- Clear error if executable not found
|
|
430
|
+
- Follows S603 pre-authorized pattern
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
### D401: First line should be in imperative mood - NOT AUTHORIZED
|
|
435
|
+
|
|
436
|
+
**Why NOT authorized:**
|
|
437
|
+
Docstring style rules are not technical limitations, just formatting preferences.
|
|
438
|
+
|
|
439
|
+
**Recommended alternative pattern:**
|
|
440
|
+
```python
|
|
441
|
+
# Instead of:
|
|
442
|
+
def copy(self, text: str) -> None: # noqa: D401
|
|
443
|
+
"""Mock clipboard copy."""
|
|
444
|
+
|
|
445
|
+
# Use imperative mood:
|
|
446
|
+
def copy(self, text: str) -> None:
|
|
447
|
+
"""Copy text to mock clipboard."""
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
**Why this is better:**
|
|
451
|
+
- Follows PEP 257 docstring conventions
|
|
452
|
+
- More readable and consistent
|
|
453
|
+
- No technical reason for suppression
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
### F401: Unused import - NOT AUTHORIZED
|
|
458
|
+
|
|
459
|
+
**Why NOT authorized:**
|
|
460
|
+
Unused imports should be removed or used, not suppressed.
|
|
461
|
+
|
|
462
|
+
**Recommended alternative pattern:**
|
|
463
|
+
```python
|
|
464
|
+
# Instead of:
|
|
465
|
+
from typing import Optional # noqa: F401
|
|
466
|
+
|
|
467
|
+
# Either use it:
|
|
468
|
+
def func() -> Optional[str]:
|
|
469
|
+
return None
|
|
470
|
+
|
|
471
|
+
# Or remove it:
|
|
472
|
+
# (deleted)
|
|
473
|
+
|
|
474
|
+
# For re-exports, use __all__:
|
|
475
|
+
from .module import Symbol # Used for re-export
|
|
476
|
+
__all__ = ["Symbol"]
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
**Why this is better:**
|
|
480
|
+
- Cleaner code
|
|
481
|
+
- Faster import times
|
|
482
|
+
- Clear signal of what's actually used
|
|
483
|
+
|
|
484
|
+
---
|
|
485
|
+
|
|
486
|
+
### UP017: Datetime without timezone - NOT AUTHORIZED
|
|
487
|
+
|
|
488
|
+
**Why NOT authorized:**
|
|
489
|
+
Modern Python supports timezone-aware datetime; naive datetime causes bugs.
|
|
490
|
+
|
|
491
|
+
**Recommended alternative pattern:**
|
|
492
|
+
```python
|
|
493
|
+
from datetime import datetime, timezone
|
|
494
|
+
|
|
495
|
+
# Instead of:
|
|
496
|
+
now = datetime.now() # noqa: UP017
|
|
497
|
+
|
|
498
|
+
# Use timezone-aware datetime:
|
|
499
|
+
now = datetime.now(timezone.utc)
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
**Why this is better:**
|
|
503
|
+
- Avoids timezone-related bugs
|
|
504
|
+
- Explicit about timezone handling
|
|
505
|
+
- Modern Python best practice
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
## Policy Enforcement
|
|
510
|
+
|
|
511
|
+
### Pre-authorized pattern checklist:
|
|
512
|
+
|
|
513
|
+
Before using a suppression, verify:
|
|
514
|
+
- [ ] Pattern **exactly** matches a pre-authorized pattern above
|
|
515
|
+
- [ ] Required comment format is used verbatim
|
|
516
|
+
- [ ] All contextual requirements are met (validation, fallback chain, try/except, etc.)
|
|
517
|
+
- [ ] Code structure matches the documented safe pattern
|
|
518
|
+
|
|
519
|
+
### Requesting new pre-authorized patterns:
|
|
520
|
+
|
|
521
|
+
If you encounter a recurring pattern that should be pre-authorized:
|
|
522
|
+
1. Document the pattern with full justification
|
|
523
|
+
2. Show why it's deterministic and can be codified
|
|
524
|
+
3. Propose the required comment format
|
|
525
|
+
4. Request user approval to add to this file
|
|
526
|
+
|
|
527
|
+
### Audit checklist:
|
|
528
|
+
|
|
529
|
+
When reviewing code:
|
|
530
|
+
- [ ] All suppressions either match pre-authorized patterns OR have documented user approval
|
|
531
|
+
- [ ] Comment format matches required format exactly
|
|
532
|
+
- [ ] No suppressions are broader than necessary (file-level vs. line-level)
|
|
533
|
+
- [ ] Justifications are clear and reference this policy
|
|
534
|
+
|
|
535
|
+
---
|
|
536
|
+
|
|
537
|
+
## Non-authorized Patterns (Explicitly Prohibited)
|
|
538
|
+
|
|
539
|
+
The following are **NOT** pre-authorized and require case-by-case approval:
|
|
540
|
+
- File-level suppressions (e.g., adding paths to `pyproject.toml` ignores)
|
|
541
|
+
- Broad exception catching without validation (`subprocess.run([user_input, ...]) # noqa: S603`)
|
|
542
|
+
- Disabling security rules for convenience without justification
|
|
543
|
+
- Using `# noqa` or `# type: ignore` as a shortcut to avoid fixing legitimate issues
|
|
544
|
+
|
|
545
|
+
### S110: try-except-pass fallback chains - NOT AUTHORIZED
|
|
546
|
+
|
|
547
|
+
**Why NOT authorized:**
|
|
548
|
+
Try-except-pass fallback chains often hide lazy design. If you know the correct method at design time (platform detection, environment variables, shutil.which() validation), you should implement explicit detection instead of relying on exception-based control flow.
|
|
549
|
+
|
|
550
|
+
**Recommended alternative pattern:**
|
|
551
|
+
```python
|
|
552
|
+
import shutil
|
|
553
|
+
import sys
|
|
554
|
+
from functools import lru_cache
|
|
555
|
+
|
|
556
|
+
@lru_cache(maxsize=1)
|
|
557
|
+
def get_clipboard_command() -> str | None:
|
|
558
|
+
"""
|
|
559
|
+
Detect the correct clipboard command for the current platform.
|
|
560
|
+
|
|
561
|
+
Returns:
|
|
562
|
+
Command name if available, None if no clipboard support detected.
|
|
563
|
+
|
|
564
|
+
Side Effects:
|
|
565
|
+
Caches result after first call for performance.
|
|
566
|
+
"""
|
|
567
|
+
# Detect platform
|
|
568
|
+
if sys.platform == "win32":
|
|
569
|
+
candidates = ["clip"]
|
|
570
|
+
elif sys.platform == "darwin":
|
|
571
|
+
candidates = ["pbcopy"]
|
|
572
|
+
else: # Linux/Unix
|
|
573
|
+
# Check for WSL (reports linux but needs Windows clipboard)
|
|
574
|
+
try:
|
|
575
|
+
with open("/proc/version", "r") as f:
|
|
576
|
+
if "microsoft" in f.read().lower():
|
|
577
|
+
candidates = ["clip.exe", "pbcopy", "xclip", "wl-copy"]
|
|
578
|
+
else:
|
|
579
|
+
candidates = ["xclip", "wl-copy"]
|
|
580
|
+
except FileNotFoundError:
|
|
581
|
+
candidates = ["xclip", "wl-copy"]
|
|
582
|
+
|
|
583
|
+
# Validate candidates exist on PATH
|
|
584
|
+
for cmd in candidates:
|
|
585
|
+
if shutil.which(cmd):
|
|
586
|
+
return cmd
|
|
587
|
+
|
|
588
|
+
return None
|
|
589
|
+
|
|
590
|
+
# Usage
|
|
591
|
+
clip_cmd = get_clipboard_command()
|
|
592
|
+
if clip_cmd:
|
|
593
|
+
subprocess.run([clip_cmd], input=text, ...) # noqa: S603 - validated above
|
|
594
|
+
else:
|
|
595
|
+
raise RuntimeError("No clipboard command available")
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
**Why this is better:**
|
|
599
|
+
- Explicit platform detection makes behavior predictable
|
|
600
|
+
- shutil.which() validates availability before use
|
|
601
|
+
- Caching avoids repeated detection overhead
|
|
602
|
+
- Clear failure mode (exception) instead of silent fallback
|
|
603
|
+
- No try-except-pass control flow
|
|
604
|
+
|
|
605
|
+
**When exception-based fallback IS acceptable:**
|
|
606
|
+
- Optional library imports where the library truly may or may not be installed
|
|
607
|
+
- Cases where explicit detection is genuinely impossible (not just inconvenient)
|
|
608
|
+
|
|
609
|
+
**These cases still require explicit user approval with justification.**
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
applyTo: "**/*.py"
|
|
3
|
+
name: python-unit-test-policy
|
|
4
|
+
description: "Python-specific unit test rules, layered on top of the general unit test policy"
|
|
5
|
+
---
|
|
6
|
+
# Python Unit Test Policy
|
|
7
|
+
|
|
8
|
+
This policy **extends** `general-unit-test.instructions.md` and applies to all Python unit tests in this repo.
|
|
9
|
+
|
|
10
|
+
You must follow **both**:
|
|
11
|
+
|
|
12
|
+
- The general unit test policy, and
|
|
13
|
+
- The Python-specific rules below.
|
|
14
|
+
|
|
15
|
+
If there is any conflict between these documents, halt and notify the user.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 1. Framework and Scope
|
|
20
|
+
|
|
21
|
+
- **Testing framework**
|
|
22
|
+
- All Python unit tests must use **Pytest** as the test runner and framework.
|
|
23
|
+
- **Coverage expectation**
|
|
24
|
+
- All new Python logic must be covered by Pytest tests that follow the general unit test policy.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 2. Test Style and Structure (Python)
|
|
29
|
+
|
|
30
|
+
- **Focused unit tests**
|
|
31
|
+
|
|
32
|
+
- Write focused tests that exercise a single function, method, or behavior.
|
|
33
|
+
- Prefer testing behavior directly over testing implementation details.
|
|
34
|
+
- **Mocking**
|
|
35
|
+
|
|
36
|
+
- Use mocking sparingly. Prefer real code paths and pure functions where possible.
|
|
37
|
+
- Only introduce mocks/stubs when needed to satisfy isolation and “avoid external dependencies” requirements (e.g., external services, heavy resources).
|
|
38
|
+
- **Organization**
|
|
39
|
+
|
|
40
|
+
- Organize tests into modules and classes in a way that mirrors the code under test where practical (e.g., `tests/test_module_name.py` for `module_name.py`).
|
|
41
|
+
- Use Pytest fixtures for common setup where it improves clarity and reduces duplication, while keeping fixture scope as narrow as possible.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 3. Naming and Readability (Python)
|
|
46
|
+
|
|
47
|
+
- **Naming conventions**
|
|
48
|
+
|
|
49
|
+
- Use descriptive `test_...` function names that clearly express the scenario and expected outcome.
|
|
50
|
+
- Group related tests logically within the same file or test class.
|
|
51
|
+
- **Docstrings and comments**
|
|
52
|
+
|
|
53
|
+
- Where the intent is not obvious from the name alone, include a short docstring or comment summarizing:
|
|
54
|
+
- The scenario being tested.
|
|
55
|
+
- The expected outcome.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 4. Respecting the Toolchain Loop
|
|
60
|
+
|
|
61
|
+
- When running the “After Making Changes” toolchain loop from the general code change policy on Python work, your **testing step** must be performed with **Pytest**.
|
|
62
|
+
- Approved command: `poetry run pytest --cov=src/lexile_corpus_tuner --cov=scripts/dev_tools --cov-report=term-missing`
|
|
63
|
+
- Do **not** substitute other test runners or frameworks for Python code unless explicitly instructed to do so.
|
|
64
|
+
|
|
65
|
+
This file defines **how** Python tests are written and structured; the general code change policy defines **when** the toolchain (including tests) must be run and how strictly that loop must be followed.
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|