devflow-kit 0.9.0 → 1.0.0
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/CHANGELOG.md +167 -29
- package/LICENSE +1 -1
- package/README.md +179 -310
- package/dist/cli.js +3 -1
- package/dist/commands/init.d.ts +21 -0
- package/dist/commands/init.js +311 -576
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/list.js +20 -0
- package/dist/commands/uninstall.d.ts +10 -0
- package/dist/commands/uninstall.js +351 -78
- package/dist/plugins.d.ts +46 -0
- package/dist/plugins.js +162 -0
- package/dist/utils/cli.d.ts +5 -0
- package/dist/utils/cli.js +14 -0
- package/dist/utils/installer.d.ts +41 -0
- package/dist/utils/installer.js +177 -0
- package/dist/utils/paths.d.ts +10 -0
- package/dist/utils/paths.js +23 -3
- package/dist/utils/post-install.d.ts +68 -0
- package/dist/utils/post-install.js +427 -0
- package/dist/utils/safe-delete-install.d.ts +22 -0
- package/dist/utils/safe-delete-install.js +156 -0
- package/dist/utils/safe-delete.d.ts +12 -0
- package/dist/utils/safe-delete.js +83 -0
- package/package.json +18 -8
- package/plugins/devflow-audit-claude/.claude-plugin/plugin.json +7 -0
- package/plugins/devflow-audit-claude/README.md +46 -0
- package/plugins/devflow-audit-claude/agents/claude-md-auditor.md +134 -0
- package/plugins/devflow-audit-claude/commands/audit-claude.md +85 -0
- package/plugins/devflow-code-review/.claude-plugin/plugin.json +31 -0
- package/plugins/devflow-code-review/README.md +73 -0
- package/plugins/devflow-code-review/agents/git.md +272 -0
- package/plugins/devflow-code-review/agents/reviewer.md +119 -0
- package/plugins/devflow-code-review/agents/synthesizer.md +204 -0
- package/plugins/devflow-code-review/commands/code-review-teams.md +262 -0
- package/plugins/devflow-code-review/commands/code-review.md +141 -0
- package/plugins/devflow-code-review/skills/accessibility/SKILL.md +229 -0
- package/plugins/devflow-code-review/skills/accessibility/references/detection.md +171 -0
- package/plugins/devflow-code-review/skills/accessibility/references/patterns.md +670 -0
- package/plugins/devflow-code-review/skills/accessibility/references/violations.md +419 -0
- package/plugins/devflow-code-review/skills/agent-teams/SKILL.md +124 -0
- package/plugins/devflow-code-review/skills/agent-teams/references/cleanup.md +104 -0
- package/plugins/devflow-code-review/skills/agent-teams/references/communication.md +122 -0
- package/plugins/devflow-code-review/skills/agent-teams/references/team-patterns.md +217 -0
- package/plugins/devflow-code-review/skills/architecture-patterns/SKILL.md +153 -0
- package/plugins/devflow-code-review/skills/architecture-patterns/references/detection.md +337 -0
- package/plugins/devflow-code-review/skills/architecture-patterns/references/patterns.md +873 -0
- package/plugins/devflow-code-review/skills/architecture-patterns/references/violations.md +575 -0
- package/plugins/devflow-code-review/skills/complexity-patterns/SKILL.md +143 -0
- package/plugins/devflow-code-review/skills/complexity-patterns/references/detection.md +264 -0
- package/plugins/devflow-code-review/skills/complexity-patterns/references/patterns.md +487 -0
- package/plugins/devflow-code-review/skills/complexity-patterns/references/violations.md +361 -0
- package/plugins/devflow-code-review/skills/consistency-patterns/SKILL.md +140 -0
- package/plugins/devflow-code-review/skills/consistency-patterns/references/detection.md +207 -0
- package/plugins/devflow-code-review/skills/consistency-patterns/references/patterns.md +202 -0
- package/plugins/devflow-code-review/skills/consistency-patterns/references/violations.md +213 -0
- package/plugins/devflow-code-review/skills/database-patterns/SKILL.md +134 -0
- package/plugins/devflow-code-review/skills/database-patterns/references/detection.md +208 -0
- package/plugins/devflow-code-review/skills/database-patterns/references/patterns.md +394 -0
- package/plugins/devflow-code-review/skills/database-patterns/references/violations.md +332 -0
- package/plugins/devflow-code-review/skills/dependencies-patterns/SKILL.md +141 -0
- package/plugins/devflow-code-review/skills/dependencies-patterns/references/detection.md +181 -0
- package/plugins/devflow-code-review/skills/dependencies-patterns/references/patterns.md +225 -0
- package/plugins/devflow-code-review/skills/dependencies-patterns/references/violations.md +247 -0
- package/plugins/devflow-code-review/skills/documentation-patterns/SKILL.md +125 -0
- package/plugins/devflow-code-review/skills/documentation-patterns/references/detection.md +190 -0
- package/plugins/devflow-code-review/skills/documentation-patterns/references/patterns.md +189 -0
- package/plugins/devflow-code-review/skills/documentation-patterns/references/violations.md +163 -0
- package/plugins/devflow-code-review/skills/frontend-design/SKILL.md +254 -0
- package/plugins/devflow-code-review/skills/frontend-design/references/detection.md +184 -0
- package/plugins/devflow-code-review/skills/frontend-design/references/patterns.md +511 -0
- package/plugins/devflow-code-review/skills/frontend-design/references/violations.md +453 -0
- package/plugins/devflow-code-review/skills/performance-patterns/SKILL.md +154 -0
- package/plugins/devflow-code-review/skills/performance-patterns/references/detection.md +351 -0
- package/plugins/devflow-code-review/skills/performance-patterns/references/patterns.md +503 -0
- package/plugins/devflow-code-review/skills/performance-patterns/references/violations.md +354 -0
- package/plugins/devflow-code-review/skills/react/SKILL.md +276 -0
- package/plugins/devflow-code-review/skills/react/references/patterns.md +1331 -0
- package/plugins/devflow-code-review/skills/react/references/violations.md +565 -0
- package/plugins/devflow-code-review/skills/regression-patterns/SKILL.md +146 -0
- package/plugins/devflow-code-review/skills/regression-patterns/references/detection.md +237 -0
- package/plugins/devflow-code-review/skills/regression-patterns/references/patterns.md +226 -0
- package/plugins/devflow-code-review/skills/regression-patterns/references/violations.md +225 -0
- package/plugins/devflow-code-review/skills/review-methodology/SKILL.md +119 -0
- package/plugins/devflow-code-review/skills/review-methodology/references/patterns.md +186 -0
- package/plugins/devflow-code-review/skills/review-methodology/references/report-template.md +142 -0
- package/plugins/devflow-code-review/skills/review-methodology/references/violations.md +125 -0
- package/plugins/devflow-code-review/skills/security-patterns/SKILL.md +156 -0
- package/plugins/devflow-code-review/skills/security-patterns/references/detection.md +287 -0
- package/plugins/devflow-code-review/skills/security-patterns/references/patterns.md +507 -0
- package/plugins/devflow-code-review/skills/security-patterns/references/violations.md +237 -0
- package/plugins/devflow-code-review/skills/test-patterns/SKILL.md +183 -0
- package/plugins/devflow-code-review/skills/test-patterns/references/detection.md +149 -0
- package/plugins/devflow-code-review/skills/test-patterns/references/patterns.md +220 -0
- package/plugins/devflow-code-review/skills/test-patterns/references/report-template.md +108 -0
- package/plugins/devflow-code-review/skills/test-patterns/references/violations.md +221 -0
- package/plugins/devflow-core-skills/.claude-plugin/plugin.json +27 -0
- package/plugins/devflow-core-skills/README.md +50 -0
- package/plugins/devflow-core-skills/skills/accessibility/SKILL.md +229 -0
- package/plugins/devflow-core-skills/skills/accessibility/references/detection.md +171 -0
- package/plugins/devflow-core-skills/skills/accessibility/references/patterns.md +670 -0
- package/plugins/devflow-core-skills/skills/accessibility/references/violations.md +419 -0
- package/plugins/devflow-core-skills/skills/core-patterns/SKILL.md +162 -0
- package/plugins/devflow-core-skills/skills/core-patterns/references/checklist.md +276 -0
- package/plugins/devflow-core-skills/skills/core-patterns/references/code-smell-violations.md +144 -0
- package/plugins/devflow-core-skills/skills/core-patterns/references/detection.md +303 -0
- package/plugins/devflow-core-skills/skills/core-patterns/references/patterns.md +576 -0
- package/plugins/devflow-core-skills/skills/core-patterns/references/violations.md +369 -0
- package/plugins/devflow-core-skills/skills/docs-framework/SKILL.md +134 -0
- package/plugins/devflow-core-skills/skills/docs-framework/references/patterns.md +346 -0
- package/plugins/devflow-core-skills/skills/docs-framework/references/violations.md +221 -0
- package/plugins/devflow-core-skills/skills/frontend-design/SKILL.md +254 -0
- package/plugins/devflow-core-skills/skills/frontend-design/references/detection.md +184 -0
- package/plugins/devflow-core-skills/skills/frontend-design/references/patterns.md +511 -0
- package/plugins/devflow-core-skills/skills/frontend-design/references/violations.md +453 -0
- package/plugins/devflow-core-skills/skills/git-safety/SKILL.md +122 -0
- package/plugins/devflow-core-skills/skills/git-safety/references/detection.md +290 -0
- package/plugins/devflow-core-skills/skills/git-safety/references/patterns.md +289 -0
- package/plugins/devflow-core-skills/skills/git-safety/references/violations.md +18 -0
- package/plugins/devflow-core-skills/skills/git-workflow/SKILL.md +158 -0
- package/plugins/devflow-core-skills/skills/git-workflow/references/commit-patterns.md +115 -0
- package/plugins/devflow-core-skills/skills/git-workflow/references/commit-violations.md +77 -0
- package/plugins/devflow-core-skills/skills/git-workflow/references/pr-patterns.md +127 -0
- package/plugins/devflow-core-skills/skills/git-workflow/references/pr-violations.md +96 -0
- package/plugins/devflow-core-skills/skills/github-patterns/SKILL.md +153 -0
- package/plugins/devflow-core-skills/skills/github-patterns/references/patterns.md +572 -0
- package/plugins/devflow-core-skills/skills/github-patterns/references/violations.md +298 -0
- package/plugins/devflow-core-skills/skills/input-validation/SKILL.md +148 -0
- package/plugins/devflow-core-skills/skills/input-validation/references/detection.md +283 -0
- package/plugins/devflow-core-skills/skills/input-validation/references/patterns.md +361 -0
- package/plugins/devflow-core-skills/skills/input-validation/references/violations.md +224 -0
- package/plugins/devflow-core-skills/skills/react/SKILL.md +276 -0
- package/plugins/devflow-core-skills/skills/react/references/patterns.md +1331 -0
- package/plugins/devflow-core-skills/skills/react/references/violations.md +565 -0
- package/plugins/devflow-core-skills/skills/test-patterns/SKILL.md +183 -0
- package/plugins/devflow-core-skills/skills/test-patterns/references/detection.md +149 -0
- package/plugins/devflow-core-skills/skills/test-patterns/references/patterns.md +220 -0
- package/plugins/devflow-core-skills/skills/test-patterns/references/report-template.md +108 -0
- package/plugins/devflow-core-skills/skills/test-patterns/references/violations.md +221 -0
- package/plugins/devflow-core-skills/skills/typescript/SKILL.md +176 -0
- package/plugins/devflow-core-skills/skills/typescript/references/patterns.md +1105 -0
- package/plugins/devflow-core-skills/skills/typescript/references/violations.md +433 -0
- package/plugins/devflow-debug/.claude-plugin/plugin.json +18 -0
- package/plugins/devflow-debug/README.md +65 -0
- package/plugins/devflow-debug/agents/git.md +272 -0
- package/plugins/devflow-debug/commands/debug-teams.md +231 -0
- package/plugins/devflow-debug/commands/debug.md +160 -0
- package/plugins/devflow-debug/skills/agent-teams/SKILL.md +124 -0
- package/plugins/devflow-debug/skills/agent-teams/references/cleanup.md +104 -0
- package/plugins/devflow-debug/skills/agent-teams/references/communication.md +122 -0
- package/plugins/devflow-debug/skills/agent-teams/references/team-patterns.md +217 -0
- package/plugins/devflow-debug/skills/git-safety/SKILL.md +122 -0
- package/plugins/devflow-debug/skills/git-safety/references/detection.md +290 -0
- package/plugins/devflow-debug/skills/git-safety/references/patterns.md +289 -0
- package/plugins/devflow-debug/skills/git-safety/references/violations.md +18 -0
- package/plugins/devflow-implement/.claude-plugin/plugin.json +21 -0
- package/plugins/devflow-implement/README.md +71 -0
- package/plugins/devflow-implement/agents/coder.md +122 -0
- package/plugins/devflow-implement/agents/git.md +272 -0
- package/plugins/devflow-implement/agents/scrutinizer.md +80 -0
- package/plugins/devflow-implement/agents/shepherd.md +94 -0
- package/plugins/devflow-implement/agents/simplifier.md +62 -0
- package/plugins/devflow-implement/agents/skimmer.md +88 -0
- package/plugins/devflow-implement/agents/synthesizer.md +204 -0
- package/plugins/devflow-implement/agents/validator.md +86 -0
- package/plugins/devflow-implement/commands/implement-teams.md +608 -0
- package/plugins/devflow-implement/commands/implement.md +426 -0
- package/plugins/devflow-implement/skills/accessibility/SKILL.md +229 -0
- package/plugins/devflow-implement/skills/accessibility/references/detection.md +171 -0
- package/plugins/devflow-implement/skills/accessibility/references/patterns.md +670 -0
- package/plugins/devflow-implement/skills/accessibility/references/violations.md +419 -0
- package/plugins/devflow-implement/skills/agent-teams/SKILL.md +124 -0
- package/plugins/devflow-implement/skills/agent-teams/references/cleanup.md +104 -0
- package/plugins/devflow-implement/skills/agent-teams/references/communication.md +122 -0
- package/plugins/devflow-implement/skills/agent-teams/references/team-patterns.md +217 -0
- package/plugins/devflow-implement/skills/frontend-design/SKILL.md +254 -0
- package/plugins/devflow-implement/skills/frontend-design/references/detection.md +184 -0
- package/plugins/devflow-implement/skills/frontend-design/references/patterns.md +511 -0
- package/plugins/devflow-implement/skills/frontend-design/references/violations.md +453 -0
- package/plugins/devflow-implement/skills/implementation-patterns/SKILL.md +162 -0
- package/plugins/devflow-implement/skills/implementation-patterns/references/patterns.md +1063 -0
- package/plugins/devflow-implement/skills/implementation-patterns/references/violations.md +483 -0
- package/plugins/devflow-implement/skills/self-review/SKILL.md +149 -0
- package/plugins/devflow-implement/skills/self-review/references/patterns.md +405 -0
- package/plugins/devflow-implement/skills/self-review/references/report-template.md +253 -0
- package/plugins/devflow-implement/skills/self-review/references/violations.md +308 -0
- package/plugins/devflow-resolve/.claude-plugin/plugin.json +19 -0
- package/plugins/devflow-resolve/README.md +65 -0
- package/plugins/devflow-resolve/agents/git.md +272 -0
- package/plugins/devflow-resolve/agents/resolver.md +131 -0
- package/plugins/devflow-resolve/agents/simplifier.md +62 -0
- package/plugins/devflow-resolve/commands/resolve-teams.md +298 -0
- package/plugins/devflow-resolve/commands/resolve.md +237 -0
- package/plugins/devflow-resolve/skills/agent-teams/SKILL.md +124 -0
- package/plugins/devflow-resolve/skills/agent-teams/references/cleanup.md +104 -0
- package/plugins/devflow-resolve/skills/agent-teams/references/communication.md +122 -0
- package/plugins/devflow-resolve/skills/agent-teams/references/team-patterns.md +217 -0
- package/plugins/devflow-resolve/skills/implementation-patterns/SKILL.md +162 -0
- package/plugins/devflow-resolve/skills/implementation-patterns/references/patterns.md +1063 -0
- package/plugins/devflow-resolve/skills/implementation-patterns/references/violations.md +483 -0
- package/plugins/devflow-resolve/skills/security-patterns/SKILL.md +156 -0
- package/plugins/devflow-resolve/skills/security-patterns/references/detection.md +287 -0
- package/plugins/devflow-resolve/skills/security-patterns/references/patterns.md +507 -0
- package/plugins/devflow-resolve/skills/security-patterns/references/violations.md +237 -0
- package/plugins/devflow-self-review/.claude-plugin/plugin.json +7 -0
- package/plugins/devflow-self-review/README.md +38 -0
- package/plugins/devflow-self-review/agents/scrutinizer.md +80 -0
- package/plugins/devflow-self-review/agents/simplifier.md +62 -0
- package/plugins/devflow-self-review/agents/validator.md +86 -0
- package/plugins/devflow-self-review/commands/self-review.md +126 -0
- package/plugins/devflow-self-review/skills/core-patterns/SKILL.md +162 -0
- package/plugins/devflow-self-review/skills/core-patterns/references/checklist.md +276 -0
- package/plugins/devflow-self-review/skills/core-patterns/references/code-smell-violations.md +144 -0
- package/plugins/devflow-self-review/skills/core-patterns/references/detection.md +303 -0
- package/plugins/devflow-self-review/skills/core-patterns/references/patterns.md +576 -0
- package/plugins/devflow-self-review/skills/core-patterns/references/violations.md +369 -0
- package/plugins/devflow-self-review/skills/self-review/SKILL.md +149 -0
- package/plugins/devflow-self-review/skills/self-review/references/patterns.md +405 -0
- package/plugins/devflow-self-review/skills/self-review/references/report-template.md +253 -0
- package/plugins/devflow-self-review/skills/self-review/references/violations.md +308 -0
- package/plugins/devflow-specify/.claude-plugin/plugin.json +15 -0
- package/plugins/devflow-specify/README.md +46 -0
- package/plugins/devflow-specify/agents/skimmer.md +88 -0
- package/plugins/devflow-specify/agents/synthesizer.md +204 -0
- package/plugins/devflow-specify/commands/specify-teams.md +314 -0
- package/plugins/devflow-specify/commands/specify.md +179 -0
- package/plugins/devflow-specify/skills/agent-teams/SKILL.md +124 -0
- package/plugins/devflow-specify/skills/agent-teams/references/cleanup.md +104 -0
- package/plugins/devflow-specify/skills/agent-teams/references/communication.md +122 -0
- package/plugins/devflow-specify/skills/agent-teams/references/team-patterns.md +217 -0
- package/scripts/hooks/background-memory-update.sh +167 -0
- package/scripts/hooks/pre-compact-memory.sh +81 -0
- package/scripts/hooks/session-start-memory.sh +84 -0
- package/scripts/hooks/stop-update-memory.sh +81 -0
- package/shared/agents/coder.md +122 -0
- package/shared/agents/git.md +272 -0
- package/shared/agents/resolver.md +131 -0
- package/shared/agents/reviewer.md +119 -0
- package/shared/agents/scrutinizer.md +80 -0
- package/shared/agents/shepherd.md +94 -0
- package/shared/agents/simplifier.md +62 -0
- package/shared/agents/skimmer.md +88 -0
- package/shared/agents/synthesizer.md +204 -0
- package/shared/agents/validator.md +86 -0
- package/shared/skills/accessibility/SKILL.md +229 -0
- package/shared/skills/accessibility/references/detection.md +171 -0
- package/shared/skills/accessibility/references/patterns.md +670 -0
- package/shared/skills/accessibility/references/violations.md +419 -0
- package/shared/skills/agent-teams/SKILL.md +124 -0
- package/shared/skills/agent-teams/references/cleanup.md +104 -0
- package/shared/skills/agent-teams/references/communication.md +122 -0
- package/shared/skills/agent-teams/references/team-patterns.md +217 -0
- package/shared/skills/architecture-patterns/SKILL.md +153 -0
- package/shared/skills/architecture-patterns/references/detection.md +337 -0
- package/shared/skills/architecture-patterns/references/patterns.md +873 -0
- package/shared/skills/architecture-patterns/references/violations.md +575 -0
- package/shared/skills/complexity-patterns/SKILL.md +143 -0
- package/shared/skills/complexity-patterns/references/detection.md +264 -0
- package/shared/skills/complexity-patterns/references/patterns.md +487 -0
- package/shared/skills/complexity-patterns/references/violations.md +361 -0
- package/shared/skills/consistency-patterns/SKILL.md +140 -0
- package/shared/skills/consistency-patterns/references/detection.md +207 -0
- package/shared/skills/consistency-patterns/references/patterns.md +202 -0
- package/shared/skills/consistency-patterns/references/violations.md +213 -0
- package/shared/skills/core-patterns/SKILL.md +162 -0
- package/shared/skills/core-patterns/references/checklist.md +276 -0
- package/shared/skills/core-patterns/references/code-smell-violations.md +144 -0
- package/shared/skills/core-patterns/references/detection.md +303 -0
- package/shared/skills/core-patterns/references/patterns.md +576 -0
- package/shared/skills/core-patterns/references/violations.md +369 -0
- package/shared/skills/database-patterns/SKILL.md +134 -0
- package/shared/skills/database-patterns/references/detection.md +208 -0
- package/shared/skills/database-patterns/references/patterns.md +394 -0
- package/shared/skills/database-patterns/references/violations.md +332 -0
- package/shared/skills/dependencies-patterns/SKILL.md +141 -0
- package/shared/skills/dependencies-patterns/references/detection.md +181 -0
- package/shared/skills/dependencies-patterns/references/patterns.md +225 -0
- package/shared/skills/dependencies-patterns/references/violations.md +247 -0
- package/shared/skills/docs-framework/SKILL.md +134 -0
- package/shared/skills/docs-framework/references/patterns.md +346 -0
- package/shared/skills/docs-framework/references/violations.md +221 -0
- package/shared/skills/documentation-patterns/SKILL.md +125 -0
- package/shared/skills/documentation-patterns/references/detection.md +190 -0
- package/shared/skills/documentation-patterns/references/patterns.md +189 -0
- package/shared/skills/documentation-patterns/references/violations.md +163 -0
- package/shared/skills/frontend-design/SKILL.md +254 -0
- package/shared/skills/frontend-design/references/detection.md +184 -0
- package/shared/skills/frontend-design/references/patterns.md +511 -0
- package/shared/skills/frontend-design/references/violations.md +453 -0
- package/shared/skills/git-safety/SKILL.md +122 -0
- package/shared/skills/git-safety/references/detection.md +290 -0
- package/shared/skills/git-safety/references/patterns.md +289 -0
- package/shared/skills/git-safety/references/violations.md +18 -0
- package/shared/skills/git-workflow/SKILL.md +158 -0
- package/shared/skills/git-workflow/references/commit-patterns.md +115 -0
- package/shared/skills/git-workflow/references/commit-violations.md +77 -0
- package/shared/skills/git-workflow/references/pr-patterns.md +127 -0
- package/shared/skills/git-workflow/references/pr-violations.md +96 -0
- package/shared/skills/github-patterns/SKILL.md +153 -0
- package/shared/skills/github-patterns/references/patterns.md +572 -0
- package/shared/skills/github-patterns/references/violations.md +298 -0
- package/shared/skills/implementation-patterns/SKILL.md +162 -0
- package/shared/skills/implementation-patterns/references/patterns.md +1063 -0
- package/shared/skills/implementation-patterns/references/violations.md +483 -0
- package/shared/skills/input-validation/SKILL.md +148 -0
- package/shared/skills/input-validation/references/detection.md +283 -0
- package/shared/skills/input-validation/references/patterns.md +361 -0
- package/shared/skills/input-validation/references/violations.md +224 -0
- package/shared/skills/performance-patterns/SKILL.md +154 -0
- package/shared/skills/performance-patterns/references/detection.md +351 -0
- package/shared/skills/performance-patterns/references/patterns.md +503 -0
- package/shared/skills/performance-patterns/references/violations.md +354 -0
- package/shared/skills/react/SKILL.md +276 -0
- package/shared/skills/react/references/patterns.md +1331 -0
- package/shared/skills/react/references/violations.md +565 -0
- package/shared/skills/regression-patterns/SKILL.md +146 -0
- package/shared/skills/regression-patterns/references/detection.md +237 -0
- package/shared/skills/regression-patterns/references/patterns.md +226 -0
- package/shared/skills/regression-patterns/references/violations.md +225 -0
- package/shared/skills/review-methodology/SKILL.md +119 -0
- package/shared/skills/review-methodology/references/patterns.md +186 -0
- package/shared/skills/review-methodology/references/report-template.md +142 -0
- package/shared/skills/review-methodology/references/violations.md +125 -0
- package/shared/skills/security-patterns/SKILL.md +156 -0
- package/shared/skills/security-patterns/references/detection.md +287 -0
- package/shared/skills/security-patterns/references/patterns.md +507 -0
- package/shared/skills/security-patterns/references/violations.md +237 -0
- package/shared/skills/self-review/SKILL.md +149 -0
- package/shared/skills/self-review/references/patterns.md +405 -0
- package/shared/skills/self-review/references/report-template.md +253 -0
- package/shared/skills/self-review/references/violations.md +308 -0
- package/shared/skills/test-patterns/SKILL.md +183 -0
- package/shared/skills/test-patterns/references/detection.md +149 -0
- package/shared/skills/test-patterns/references/patterns.md +220 -0
- package/shared/skills/test-patterns/references/report-template.md +108 -0
- package/shared/skills/test-patterns/references/violations.md +221 -0
- package/shared/skills/typescript/SKILL.md +176 -0
- package/shared/skills/typescript/references/patterns.md +1105 -0
- package/shared/skills/typescript/references/violations.md +433 -0
- package/src/templates/claudeignore.template +188 -0
- package/src/templates/managed-settings.json +146 -0
- package/src/templates/settings.json +59 -0
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/uninstall.d.ts.map +0 -1
- package/dist/commands/uninstall.js.map +0 -1
- package/dist/utils/git.d.ts.map +0 -1
- package/dist/utils/git.js.map +0 -1
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js.map +0 -1
- package/src/claude/CLAUDE.md +0 -400
- package/src/claude/agents/devflow/audit-architecture.md +0 -132
- package/src/claude/agents/devflow/audit-complexity.md +0 -132
- package/src/claude/agents/devflow/audit-database.md +0 -132
- package/src/claude/agents/devflow/audit-dependencies.md +0 -132
- package/src/claude/agents/devflow/audit-documentation.md +0 -132
- package/src/claude/agents/devflow/audit-performance.md +0 -256
- package/src/claude/agents/devflow/audit-security.md +0 -259
- package/src/claude/agents/devflow/audit-tests.md +0 -132
- package/src/claude/agents/devflow/audit-typescript.md +0 -132
- package/src/claude/agents/devflow/brainstorm.md +0 -279
- package/src/claude/agents/devflow/catch-up.md +0 -345
- package/src/claude/agents/devflow/code-review.md +0 -307
- package/src/claude/agents/devflow/commit.md +0 -380
- package/src/claude/agents/devflow/debug.md +0 -476
- package/src/claude/agents/devflow/design.md +0 -491
- package/src/claude/agents/devflow/get-issue.md +0 -286
- package/src/claude/agents/devflow/pr-comments.md +0 -285
- package/src/claude/agents/devflow/project-state.md +0 -419
- package/src/claude/agents/devflow/pull-request.md +0 -493
- package/src/claude/agents/devflow/release.md +0 -1137
- package/src/claude/agents/devflow/tech-debt.md +0 -338
- package/src/claude/commands/devflow/brainstorm.md +0 -68
- package/src/claude/commands/devflow/breakdown.md +0 -125
- package/src/claude/commands/devflow/catch-up.md +0 -29
- package/src/claude/commands/devflow/code-review.md +0 -237
- package/src/claude/commands/devflow/commit.md +0 -17
- package/src/claude/commands/devflow/debug.md +0 -56
- package/src/claude/commands/devflow/design.md +0 -82
- package/src/claude/commands/devflow/devlog.md +0 -408
- package/src/claude/commands/devflow/get-issue.md +0 -16
- package/src/claude/commands/devflow/implement.md +0 -100
- package/src/claude/commands/devflow/plan.md +0 -223
- package/src/claude/commands/devflow/pull-request.md +0 -20
- package/src/claude/commands/devflow/release.md +0 -251
- package/src/claude/commands/devflow/resolve-comments.md +0 -583
- package/src/claude/scripts/statusline.sh +0 -47
- package/src/claude/settings.json +0 -6
- package/src/claude/skills/devflow/code-smell/SKILL.md +0 -428
- package/src/claude/skills/devflow/debug/SKILL.md +0 -119
- package/src/claude/skills/devflow/error-handling/SKILL.md +0 -597
- package/src/claude/skills/devflow/input-validation/SKILL.md +0 -514
- package/src/claude/skills/devflow/pattern-check/SKILL.md +0 -238
- package/src/claude/skills/devflow/research/SKILL.md +0 -138
- package/src/claude/skills/devflow/test-design/SKILL.md +0 -384
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: github-patterns
|
|
3
|
+
description: This skill should be used when the user asks to "comment on a PR", "create a release", "manage issues", "use gh CLI", "check PR status", or performs GitHub API operations. Provides patterns for PR comments, issue management, release workflows, rate limiting, and gh CLI usage for safe GitHub automation.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
allowed-tools: Bash, Read, Grep, Glob
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# GitHub Patterns
|
|
9
|
+
|
|
10
|
+
Foundation skill for GitHub API interactions. Provides patterns for rate limiting, PR comments, issue management, and releases.
|
|
11
|
+
|
|
12
|
+
## Iron Law
|
|
13
|
+
|
|
14
|
+
> **RESPECT RATE LIMITS OR FAIL GRACEFULLY**
|
|
15
|
+
>
|
|
16
|
+
> GitHub API rate limits are not suggestions. When remaining < 10, wait 60 seconds. Between each API call, wait 1-2 seconds. Batch operations where possible. Never spam the API.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Rate Limiting
|
|
21
|
+
|
|
22
|
+
### Standard Throttling
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Between each API call
|
|
26
|
+
sleep 1
|
|
27
|
+
|
|
28
|
+
# For batch operations (>20 calls)
|
|
29
|
+
sleep 2
|
|
30
|
+
|
|
31
|
+
# Check remaining rate limit
|
|
32
|
+
REMAINING=$(gh api rate_limit --jq '.resources.core.remaining')
|
|
33
|
+
|
|
34
|
+
# If low, wait before continuing
|
|
35
|
+
if [ "$REMAINING" -lt 10 ]; then
|
|
36
|
+
echo "Rate limit low ($REMAINING remaining), waiting 60s..."
|
|
37
|
+
sleep 60
|
|
38
|
+
fi
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Error Handling
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
make_api_call() {
|
|
45
|
+
local response
|
|
46
|
+
response=$(gh api "$@" 2>&1) || {
|
|
47
|
+
echo "API call failed: $response" >&2
|
|
48
|
+
return 1
|
|
49
|
+
}
|
|
50
|
+
echo "$response"
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## PR Comments
|
|
57
|
+
|
|
58
|
+
**Key constraints:**
|
|
59
|
+
- Only lines in the PR diff can receive inline comments
|
|
60
|
+
- Deduplicate before posting (same file + line + issue = keep one)
|
|
61
|
+
- Always include suggested fix
|
|
62
|
+
- Add Claude Code attribution footer
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Verify file is in PR diff
|
|
66
|
+
gh pr diff $PR_NUMBER --name-only | grep -q "^$FILE_PATH$"
|
|
67
|
+
|
|
68
|
+
# Create inline comment
|
|
69
|
+
gh api -X POST "repos/${OWNER}/${REPO}/pulls/${PR_NUMBER}/comments" \
|
|
70
|
+
-f body="$COMMENT_BODY" \
|
|
71
|
+
-f commit_id="$HEAD_SHA" \
|
|
72
|
+
-f path="$FILE_PATH" \
|
|
73
|
+
-F line=$LINE_NUMBER \
|
|
74
|
+
-f side="RIGHT"
|
|
75
|
+
|
|
76
|
+
sleep 1 # Rate limiting
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Issue Management
|
|
82
|
+
|
|
83
|
+
### Fetching Issues
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Full details
|
|
87
|
+
gh issue view "$ISSUE_NUMBER" --json number,title,body,state,labels,assignees
|
|
88
|
+
|
|
89
|
+
# Search
|
|
90
|
+
gh issue list --search "$SEARCH_TERM" --state open --limit 5
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Branch Name from Issue
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Type from labels
|
|
97
|
+
BRANCH_TYPE="feature" # default (or fix, docs, refactor, chore)
|
|
98
|
+
|
|
99
|
+
# Slug from title
|
|
100
|
+
SLUG=$(echo "$TITLE" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed 's/[^a-z0-9-]//g' | cut -c1-40)
|
|
101
|
+
|
|
102
|
+
# Result
|
|
103
|
+
BRANCH_NAME="${BRANCH_TYPE}/${ISSUE_NUMBER}-${SLUG}"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Releases
|
|
109
|
+
|
|
110
|
+
### Create Release
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Validate semver
|
|
114
|
+
[[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit 1
|
|
115
|
+
|
|
116
|
+
# Create tag
|
|
117
|
+
git tag -a "v${VERSION}" -m "Version ${VERSION}"
|
|
118
|
+
git push origin "v${VERSION}"
|
|
119
|
+
|
|
120
|
+
# Create GitHub release
|
|
121
|
+
gh release create "v${VERSION}" \
|
|
122
|
+
--title "v${VERSION} - ${RELEASE_TITLE}" \
|
|
123
|
+
--notes "${RELEASE_NOTES}"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Key Principles
|
|
129
|
+
|
|
130
|
+
1. **Rate limit awareness** - Check remaining calls, throttle appropriately
|
|
131
|
+
2. **Fail gracefully** - Handle API errors, don't crash on failures
|
|
132
|
+
3. **Deduplicate first** - Never spam duplicate comments or issues
|
|
133
|
+
4. **One summary** - Consolidate multiple issues into single comments
|
|
134
|
+
5. **Actionable** - Every comment includes a suggested fix
|
|
135
|
+
6. **Clear attribution** - Always include Claude Code footer
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Extended References
|
|
140
|
+
|
|
141
|
+
For extended patterns and examples, see:
|
|
142
|
+
|
|
143
|
+
- **[references/commands.md](references/commands.md)** - Extended gh CLI command examples
|
|
144
|
+
- PR creation and queries
|
|
145
|
+
- Issue operations (create, update, close)
|
|
146
|
+
- Release workflows
|
|
147
|
+
- GraphQL examples
|
|
148
|
+
|
|
149
|
+
- **[references/api.md](references/api.md)** - API patterns
|
|
150
|
+
- Tech debt management (size limits, archiving, deduplication)
|
|
151
|
+
- Issue parsing patterns
|
|
152
|
+
- Error handling with retry/backoff
|
|
153
|
+
- Webhook and Actions integration
|
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
# GitHub Patterns Correct Examples
|
|
2
|
+
|
|
3
|
+
Extended correct patterns for GitHub API and CLI operations. Reference from main SKILL.md.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## API Usage Patterns
|
|
8
|
+
|
|
9
|
+
### Rate Limit Handling
|
|
10
|
+
|
|
11
|
+
**Check Before Batch Operations**
|
|
12
|
+
```bash
|
|
13
|
+
# CORRECT: Check rate limit before operations
|
|
14
|
+
check_rate_limit() {
|
|
15
|
+
local remaining
|
|
16
|
+
remaining=$(gh api rate_limit --jq '.resources.core.remaining' 2>/dev/null || echo "100")
|
|
17
|
+
|
|
18
|
+
if [ "$remaining" -lt 10 ]; then
|
|
19
|
+
local reset_time
|
|
20
|
+
reset_time=$(gh api rate_limit --jq '.resources.core.reset')
|
|
21
|
+
echo "Rate limit low ($remaining remaining), waiting..."
|
|
22
|
+
sleep 60
|
|
23
|
+
fi
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
# Use before batch operations
|
|
27
|
+
check_rate_limit
|
|
28
|
+
for issue in $(seq 1 100); do
|
|
29
|
+
gh api repos/{owner}/{repo}/issues/${issue}
|
|
30
|
+
sleep 1 # Throttle between calls
|
|
31
|
+
done
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Retry with Exponential Backoff**
|
|
35
|
+
```bash
|
|
36
|
+
# CORRECT: Retry with backoff on failure
|
|
37
|
+
retry_api_call() {
|
|
38
|
+
local max_attempts=3
|
|
39
|
+
local attempt=1
|
|
40
|
+
local delay=2
|
|
41
|
+
|
|
42
|
+
while [ $attempt -le $max_attempts ]; do
|
|
43
|
+
if result=$(gh api "$@" 2>&1); then
|
|
44
|
+
echo "$result"
|
|
45
|
+
return 0
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
echo "Attempt $attempt failed, retrying in ${delay}s..." >&2
|
|
49
|
+
sleep $delay
|
|
50
|
+
attempt=$((attempt + 1))
|
|
51
|
+
delay=$((delay * 2))
|
|
52
|
+
done
|
|
53
|
+
|
|
54
|
+
echo "All $max_attempts attempts failed" >&2
|
|
55
|
+
return 1
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Error Handling
|
|
60
|
+
|
|
61
|
+
**Wrapped API Calls**
|
|
62
|
+
```bash
|
|
63
|
+
# CORRECT: Always handle errors
|
|
64
|
+
make_api_call() {
|
|
65
|
+
local response
|
|
66
|
+
response=$(gh api "$@" 2>&1) || {
|
|
67
|
+
echo "API call failed: $response" >&2
|
|
68
|
+
return 1
|
|
69
|
+
}
|
|
70
|
+
echo "$response"
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Validate Responses**
|
|
75
|
+
```bash
|
|
76
|
+
# CORRECT: Check response before using
|
|
77
|
+
BODY=$(gh issue view $ISSUE --json body -q '.body' 2>/dev/null)
|
|
78
|
+
if [ -z "$BODY" ]; then
|
|
79
|
+
echo "Issue body empty or not found"
|
|
80
|
+
exit 1
|
|
81
|
+
fi
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Check Command Results**
|
|
85
|
+
```bash
|
|
86
|
+
# CORRECT: Verify each operation
|
|
87
|
+
if ! gh pr create --title "..." --body "..." --json number -q '.number' > pr_number.txt; then
|
|
88
|
+
echo "PR creation failed"
|
|
89
|
+
exit 1
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
PR_NUMBER=$(cat pr_number.txt)
|
|
93
|
+
if [ -z "$PR_NUMBER" ]; then
|
|
94
|
+
echo "Failed to get PR number"
|
|
95
|
+
exit 1
|
|
96
|
+
fi
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Pagination
|
|
100
|
+
|
|
101
|
+
**Use --paginate Flag**
|
|
102
|
+
```bash
|
|
103
|
+
# CORRECT: Get all pages automatically
|
|
104
|
+
gh api repos/{owner}/{repo}/issues --paginate --jq '.[].number'
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**GraphQL Pagination with Cursor**
|
|
108
|
+
```bash
|
|
109
|
+
# CORRECT: Paginate through all results
|
|
110
|
+
fetch_all_issues() {
|
|
111
|
+
local cursor=""
|
|
112
|
+
local has_next="true"
|
|
113
|
+
|
|
114
|
+
while [ "$has_next" = "true" ]; do
|
|
115
|
+
local query
|
|
116
|
+
if [ -z "$cursor" ]; then
|
|
117
|
+
query='query { repository(owner: "owner", name: "repo") { issues(first: 100) { nodes { number title } pageInfo { hasNextPage endCursor } } } }'
|
|
118
|
+
else
|
|
119
|
+
query="query { repository(owner: \"owner\", name: \"repo\") { issues(first: 100, after: \"$cursor\") { nodes { number title } pageInfo { hasNextPage endCursor } } } }"
|
|
120
|
+
fi
|
|
121
|
+
|
|
122
|
+
result=$(gh api graphql -f query="$query")
|
|
123
|
+
echo "$result" | jq -r '.data.repository.issues.nodes[] | [.number, .title] | @tsv'
|
|
124
|
+
|
|
125
|
+
has_next=$(echo "$result" | jq -r '.data.repository.issues.pageInfo.hasNextPage')
|
|
126
|
+
cursor=$(echo "$result" | jq -r '.data.repository.issues.pageInfo.endCursor')
|
|
127
|
+
done
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Efficient Queries
|
|
132
|
+
|
|
133
|
+
**Batch Field Selection**
|
|
134
|
+
```bash
|
|
135
|
+
# CORRECT: Get all needed fields in one query
|
|
136
|
+
gh pr view $PR --json title,body,state,author,reviews,commits
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**GraphQL for Complex Queries**
|
|
140
|
+
```bash
|
|
141
|
+
# CORRECT: Single query for related data
|
|
142
|
+
gh api graphql -f query='
|
|
143
|
+
query($owner: String!, $repo: String!, $pr: Int!) {
|
|
144
|
+
repository(owner: $owner, name: $repo) {
|
|
145
|
+
pullRequest(number: $pr) {
|
|
146
|
+
title
|
|
147
|
+
body
|
|
148
|
+
state
|
|
149
|
+
reviews(first: 10) {
|
|
150
|
+
nodes {
|
|
151
|
+
state
|
|
152
|
+
author { login }
|
|
153
|
+
body
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
comments(first: 20) {
|
|
157
|
+
nodes {
|
|
158
|
+
author { login }
|
|
159
|
+
body
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
' -f owner="$OWNER" -f repo="$REPO" -F pr="$PR_NUMBER"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## CLI Command Patterns
|
|
171
|
+
|
|
172
|
+
### PR Comments
|
|
173
|
+
|
|
174
|
+
**Inline Comment with Commit SHA**
|
|
175
|
+
```bash
|
|
176
|
+
# CORRECT: Full comment with all required fields
|
|
177
|
+
OWNER=$(echo $REPO_INFO | cut -d'/' -f1)
|
|
178
|
+
REPO=$(echo $REPO_INFO | cut -d'/' -f2)
|
|
179
|
+
HEAD_SHA=$(gh pr view $PR_NUMBER --json headRefOid -q '.headRefOid')
|
|
180
|
+
|
|
181
|
+
gh api \
|
|
182
|
+
-X POST \
|
|
183
|
+
"repos/${OWNER}/${REPO}/pulls/${PR_NUMBER}/comments" \
|
|
184
|
+
-f body="$COMMENT_BODY" \
|
|
185
|
+
-f commit_id="$HEAD_SHA" \
|
|
186
|
+
-f path="$FILE_PATH" \
|
|
187
|
+
-F line=$LINE_NUMBER \
|
|
188
|
+
-f side="RIGHT"
|
|
189
|
+
|
|
190
|
+
sleep 1 # Rate limiting between comments
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**Validate Line is in Diff**
|
|
194
|
+
```bash
|
|
195
|
+
# CORRECT: Check file and line are in PR before commenting
|
|
196
|
+
is_line_in_diff() {
|
|
197
|
+
local file="$1"
|
|
198
|
+
local line="$2"
|
|
199
|
+
|
|
200
|
+
# Check file is in PR
|
|
201
|
+
if ! gh pr diff $PR_NUMBER --name-only | grep -q "^${file}$"; then
|
|
202
|
+
return 1
|
|
203
|
+
fi
|
|
204
|
+
|
|
205
|
+
# Check line is added/modified (has + prefix in diff)
|
|
206
|
+
gh pr diff $PR_NUMBER -- "$file" | grep -n "^+" | cut -d: -f1 | grep -q "^${line}$"
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if is_line_in_diff "$FILE" "$LINE"; then
|
|
210
|
+
# Safe to create inline comment
|
|
211
|
+
create_inline_comment "$FILE" "$LINE" "$COMMENT"
|
|
212
|
+
fi
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Comment Format Template**
|
|
216
|
+
```markdown
|
|
217
|
+
**[SEVERITY] {Review Type}: {Issue Title}**
|
|
218
|
+
|
|
219
|
+
{Brief description}
|
|
220
|
+
|
|
221
|
+
**Suggested fix:**
|
|
222
|
+
```{language}
|
|
223
|
+
{code fix}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
<sub>Severity: {CRITICAL|HIGH|MEDIUM} | [Claude Code](https://claude.com/code) `/code-review`</sub>
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Issue Operations
|
|
231
|
+
|
|
232
|
+
**Fetch Issue with All Details**
|
|
233
|
+
```bash
|
|
234
|
+
# CORRECT: Get all relevant fields
|
|
235
|
+
gh issue view "$ISSUE_NUMBER" \
|
|
236
|
+
--json number,title,body,state,labels,assignees,milestone,author,createdAt,comments
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Create Issue with Labels and Assignees**
|
|
240
|
+
```bash
|
|
241
|
+
# CORRECT: Full issue creation
|
|
242
|
+
gh issue create \
|
|
243
|
+
--title "Bug: Login fails for SSO users" \
|
|
244
|
+
--label "bug,priority-high" \
|
|
245
|
+
--assignee "username" \
|
|
246
|
+
--body "$(cat <<'EOF'
|
|
247
|
+
## Description
|
|
248
|
+
Login fails when using SSO authentication.
|
|
249
|
+
|
|
250
|
+
## Steps to Reproduce
|
|
251
|
+
1. Click "Login with SSO"
|
|
252
|
+
2. Enter credentials
|
|
253
|
+
3. Observe error
|
|
254
|
+
|
|
255
|
+
## Expected Behavior
|
|
256
|
+
User should be logged in successfully.
|
|
257
|
+
|
|
258
|
+
## Actual Behavior
|
|
259
|
+
Error message: "Authentication failed"
|
|
260
|
+
EOF
|
|
261
|
+
)"
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Tech Debt Issue Management**
|
|
265
|
+
```bash
|
|
266
|
+
# CORRECT: Check size before appending, archive if needed
|
|
267
|
+
MAX_SIZE=60000
|
|
268
|
+
|
|
269
|
+
add_tech_debt_item() {
|
|
270
|
+
local new_item="$1"
|
|
271
|
+
|
|
272
|
+
# Get current body
|
|
273
|
+
local current_body
|
|
274
|
+
current_body=$(gh issue view $TECH_DEBT_ISSUE --json body -q '.body')
|
|
275
|
+
local body_length=${#current_body}
|
|
276
|
+
|
|
277
|
+
# Check if approaching limit
|
|
278
|
+
if [ $body_length -gt $MAX_SIZE ]; then
|
|
279
|
+
echo "Tech debt issue approaching size limit, archiving..."
|
|
280
|
+
archive_tech_debt_issue
|
|
281
|
+
fi
|
|
282
|
+
|
|
283
|
+
# Append new item
|
|
284
|
+
gh issue comment $TECH_DEBT_ISSUE --body "$new_item"
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
archive_tech_debt_issue() {
|
|
288
|
+
local old_issue=$TECH_DEBT_ISSUE
|
|
289
|
+
|
|
290
|
+
# Close current issue
|
|
291
|
+
gh issue close $old_issue --comment "## Archived
|
|
292
|
+
This issue reached the size limit.
|
|
293
|
+
**Continued in:** (see linked issue)"
|
|
294
|
+
|
|
295
|
+
# Create new issue with reference
|
|
296
|
+
TECH_DEBT_ISSUE=$(gh issue create \
|
|
297
|
+
--title "Tech Debt Backlog" \
|
|
298
|
+
--label "tech-debt" \
|
|
299
|
+
--body "Continued from #${old_issue}
|
|
300
|
+
|
|
301
|
+
## Items
|
|
302
|
+
" \
|
|
303
|
+
--json number -q '.number')
|
|
304
|
+
|
|
305
|
+
# Link back
|
|
306
|
+
gh issue comment $old_issue --body "**Continued in:** #${TECH_DEBT_ISSUE}"
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
**Extract Issue Data**
|
|
311
|
+
```bash
|
|
312
|
+
# CORRECT: Parse structured sections from issue body
|
|
313
|
+
BODY=$(gh issue view $ISSUE --json body -q '.body')
|
|
314
|
+
|
|
315
|
+
# Extract acceptance criteria
|
|
316
|
+
CRITERIA=$(echo "$BODY" | sed -n '/## Acceptance Criteria/,/^##/p' | grep -E '^\s*-\s*\[' || true)
|
|
317
|
+
|
|
318
|
+
# Extract dependencies
|
|
319
|
+
DEPENDS_ON=$(echo "$BODY" | grep -oE '(depends on|blocked by) #[0-9]+' | grep -oE '#[0-9]+' || true)
|
|
320
|
+
|
|
321
|
+
# Extract blocks
|
|
322
|
+
BLOCKS=$(echo "$BODY" | grep -oE 'blocks #[0-9]+' | grep -oE '#[0-9]+' || true)
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Release Operations
|
|
326
|
+
|
|
327
|
+
**Version Validation**
|
|
328
|
+
```bash
|
|
329
|
+
# CORRECT: Validate semver format
|
|
330
|
+
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
331
|
+
echo "ERROR: Invalid version format. Use semver (e.g., 1.2.3)"
|
|
332
|
+
exit 1
|
|
333
|
+
fi
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
**Complete Release Flow**
|
|
337
|
+
```bash
|
|
338
|
+
# CORRECT: Tag first, then create release
|
|
339
|
+
create_release() {
|
|
340
|
+
local version="$1"
|
|
341
|
+
local changelog="$2"
|
|
342
|
+
|
|
343
|
+
# Validate version
|
|
344
|
+
if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
345
|
+
echo "Invalid version format"
|
|
346
|
+
return 1
|
|
347
|
+
fi
|
|
348
|
+
|
|
349
|
+
# Create and push tag
|
|
350
|
+
git tag -a "v${version}" -m "Version ${version}
|
|
351
|
+
|
|
352
|
+
${changelog}"
|
|
353
|
+
git push origin "v${version}"
|
|
354
|
+
|
|
355
|
+
# Create GitHub release
|
|
356
|
+
gh release create "v${version}" \
|
|
357
|
+
--title "v${version}" \
|
|
358
|
+
--notes "$changelog"
|
|
359
|
+
}
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
**Release with Assets**
|
|
363
|
+
```bash
|
|
364
|
+
# CORRECT: Release with build artifacts
|
|
365
|
+
gh release create "v${VERSION}" \
|
|
366
|
+
--title "v${VERSION} - ${RELEASE_TITLE}" \
|
|
367
|
+
--notes-file CHANGELOG.md \
|
|
368
|
+
./dist/*.tar.gz ./dist/*.zip
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
**Release Notes from Commits**
|
|
372
|
+
```bash
|
|
373
|
+
# CORRECT: Generate notes from git history
|
|
374
|
+
generate_release_notes() {
|
|
375
|
+
local last_tag
|
|
376
|
+
last_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
|
377
|
+
|
|
378
|
+
echo "## Changes"
|
|
379
|
+
echo ""
|
|
380
|
+
|
|
381
|
+
if [ -n "$last_tag" ]; then
|
|
382
|
+
git log ${last_tag}..HEAD --pretty=format:"- %s" --no-merges
|
|
383
|
+
else
|
|
384
|
+
git log --pretty=format:"- %s" --no-merges -20
|
|
385
|
+
fi
|
|
386
|
+
}
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### Branch Name from Issue
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
# CORRECT: Generate clean branch name from issue
|
|
393
|
+
generate_branch_name() {
|
|
394
|
+
local issue_number="$1"
|
|
395
|
+
local title="$2"
|
|
396
|
+
local labels="$3"
|
|
397
|
+
|
|
398
|
+
# Determine type from labels
|
|
399
|
+
local branch_type="feature"
|
|
400
|
+
case "$labels" in
|
|
401
|
+
*bug*|*fix*) branch_type="fix" ;;
|
|
402
|
+
*documentation*|*docs*) branch_type="docs" ;;
|
|
403
|
+
*refactor*) branch_type="refactor" ;;
|
|
404
|
+
*chore*|*maintenance*) branch_type="chore" ;;
|
|
405
|
+
esac
|
|
406
|
+
|
|
407
|
+
# Clean title for slug
|
|
408
|
+
local slug
|
|
409
|
+
slug=$(echo "$title" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed 's/[^a-z0-9-]//g' | cut -c1-40)
|
|
410
|
+
|
|
411
|
+
echo "${branch_type}/${issue_number}-${slug}"
|
|
412
|
+
}
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### PR Operations
|
|
416
|
+
|
|
417
|
+
**PR with HEREDOC Body**
|
|
418
|
+
```bash
|
|
419
|
+
# CORRECT: Clean formatting with HEREDOC
|
|
420
|
+
gh pr create --title "Add user authentication" --body "$(cat <<'EOF'
|
|
421
|
+
## Summary
|
|
422
|
+
- Implement JWT-based authentication
|
|
423
|
+
- Add login/logout endpoints
|
|
424
|
+
- Add middleware for protected routes
|
|
425
|
+
|
|
426
|
+
## Test plan
|
|
427
|
+
- [ ] Test login with valid credentials
|
|
428
|
+
- [ ] Test login with invalid credentials
|
|
429
|
+
- [ ] Test protected route access
|
|
430
|
+
- [ ] Test token expiration
|
|
431
|
+
EOF
|
|
432
|
+
)"
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
**Draft PR for WIP**
|
|
436
|
+
```bash
|
|
437
|
+
# CORRECT: Use draft for work in progress
|
|
438
|
+
gh pr create --draft --title "WIP: Feature X" --body "Work in progress, not ready for review"
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
**PR Review**
|
|
442
|
+
```bash
|
|
443
|
+
# CORRECT: Review with body
|
|
444
|
+
gh pr review $PR_NUMBER --approve --body "LGTM! Tested locally and all checks pass."
|
|
445
|
+
|
|
446
|
+
gh pr review $PR_NUMBER --request-changes --body "$(cat <<'EOF'
|
|
447
|
+
## Requested Changes
|
|
448
|
+
|
|
449
|
+
1. **Security**: Input validation missing in `handleLogin`
|
|
450
|
+
2. **Performance**: N+1 query in user list endpoint
|
|
451
|
+
|
|
452
|
+
Please address these before merging.
|
|
453
|
+
EOF
|
|
454
|
+
)"
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
---
|
|
458
|
+
|
|
459
|
+
## Workflow Integration Patterns
|
|
460
|
+
|
|
461
|
+
### Triggering Workflows
|
|
462
|
+
|
|
463
|
+
```bash
|
|
464
|
+
# CORRECT: Trigger with validated inputs
|
|
465
|
+
gh workflow run "deploy.yml" \
|
|
466
|
+
--ref main \
|
|
467
|
+
-f environment="production" \
|
|
468
|
+
-f version="${VERSION}"
|
|
469
|
+
|
|
470
|
+
# Wait for completion
|
|
471
|
+
sleep 5
|
|
472
|
+
RUN_ID=$(gh run list --workflow "deploy.yml" --limit 1 --json databaseId -q '.[0].databaseId')
|
|
473
|
+
gh run watch $RUN_ID
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
### Check Run Status
|
|
477
|
+
|
|
478
|
+
```bash
|
|
479
|
+
# CORRECT: Wait for checks to complete
|
|
480
|
+
wait_for_checks() {
|
|
481
|
+
local sha="$1"
|
|
482
|
+
local max_wait=300
|
|
483
|
+
local waited=0
|
|
484
|
+
|
|
485
|
+
while [ $waited -lt $max_wait ]; do
|
|
486
|
+
local status
|
|
487
|
+
status=$(gh api repos/{owner}/{repo}/commits/${sha}/check-runs \
|
|
488
|
+
--jq '.check_runs | map(select(.status != "completed")) | length')
|
|
489
|
+
|
|
490
|
+
if [ "$status" = "0" ]; then
|
|
491
|
+
echo "All checks completed"
|
|
492
|
+
return 0
|
|
493
|
+
fi
|
|
494
|
+
|
|
495
|
+
echo "Waiting for checks... ($status pending)"
|
|
496
|
+
sleep 10
|
|
497
|
+
waited=$((waited + 10))
|
|
498
|
+
done
|
|
499
|
+
|
|
500
|
+
echo "Timeout waiting for checks"
|
|
501
|
+
return 1
|
|
502
|
+
}
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
---
|
|
506
|
+
|
|
507
|
+
## GraphQL Patterns
|
|
508
|
+
|
|
509
|
+
### Efficient Queries
|
|
510
|
+
|
|
511
|
+
```bash
|
|
512
|
+
# CORRECT: Request only needed fields
|
|
513
|
+
gh api graphql -f query='
|
|
514
|
+
query($owner: String!, $repo: String!, $pr: Int!) {
|
|
515
|
+
repository(owner: $owner, name: $repo) {
|
|
516
|
+
pullRequest(number: $pr) {
|
|
517
|
+
title
|
|
518
|
+
state
|
|
519
|
+
mergeable
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
' -f owner="$OWNER" -f repo="$REPO" -F pr="$PR_NUMBER"
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
### Mutations
|
|
527
|
+
|
|
528
|
+
```bash
|
|
529
|
+
# CORRECT: Add reaction to issue
|
|
530
|
+
gh api graphql -f query='
|
|
531
|
+
mutation($subjectId: ID!, $content: ReactionContent!) {
|
|
532
|
+
addReaction(input: {subjectId: $subjectId, content: $content}) {
|
|
533
|
+
reaction {
|
|
534
|
+
content
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
' -f subjectId="$ISSUE_NODE_ID" -f content="THUMBS_UP"
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
---
|
|
542
|
+
|
|
543
|
+
## Rate Limit Aware Batch Processing
|
|
544
|
+
|
|
545
|
+
```bash
|
|
546
|
+
# CORRECT: Batch with rate limit awareness
|
|
547
|
+
batch_api_calls() {
|
|
548
|
+
local calls=("$@")
|
|
549
|
+
local results=()
|
|
550
|
+
|
|
551
|
+
for call in "${calls[@]}"; do
|
|
552
|
+
# Check rate limit
|
|
553
|
+
REMAINING=$(gh api rate_limit --jq '.resources.core.remaining' 2>/dev/null || echo "100")
|
|
554
|
+
|
|
555
|
+
if [ "$REMAINING" -lt 10 ]; then
|
|
556
|
+
echo "Rate limit low, waiting 60s..." >&2
|
|
557
|
+
sleep 60
|
|
558
|
+
fi
|
|
559
|
+
|
|
560
|
+
# Execute call
|
|
561
|
+
result=$(eval "$call" 2>&1) || {
|
|
562
|
+
echo "Failed: $call" >&2
|
|
563
|
+
continue
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
results+=("$result")
|
|
567
|
+
sleep 1 # Throttle between calls
|
|
568
|
+
done
|
|
569
|
+
|
|
570
|
+
printf '%s\n' "${results[@]}"
|
|
571
|
+
}
|
|
572
|
+
```
|