specguard-ci 0.1.0__tar.gz

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.
Files changed (200) hide show
  1. specguard_ci-0.1.0/.claude/skills/clean-code/SKILL.md +136 -0
  2. specguard_ci-0.1.0/.claude/skills/git/SKILL.md +134 -0
  3. specguard_ci-0.1.0/.claude/skills/speckit-agent-context-update/SKILL.md +31 -0
  4. specguard_ci-0.1.0/.claude/skills/speckit-analyze/SKILL.md +260 -0
  5. specguard_ci-0.1.0/.claude/skills/speckit-checklist/SKILL.md +374 -0
  6. specguard_ci-0.1.0/.claude/skills/speckit-clarify/SKILL.md +286 -0
  7. specguard_ci-0.1.0/.claude/skills/speckit-constitution/SKILL.md +157 -0
  8. specguard_ci-0.1.0/.claude/skills/speckit-implement/SKILL.md +224 -0
  9. specguard_ci-0.1.0/.claude/skills/speckit-plan/SKILL.md +171 -0
  10. specguard_ci-0.1.0/.claude/skills/speckit-specify/SKILL.md +346 -0
  11. specguard_ci-0.1.0/.claude/skills/speckit-tasks/SKILL.md +215 -0
  12. specguard_ci-0.1.0/.claude/skills/speckit-taskstoissues/SKILL.md +107 -0
  13. specguard_ci-0.1.0/.github/workflows/specguard.yml +60 -0
  14. specguard_ci-0.1.0/.github/workflows/tests.yml +28 -0
  15. specguard_ci-0.1.0/.gitignore +14 -0
  16. specguard_ci-0.1.0/.playwright-mcp/console-2026-06-12T03-18-39-905Z.log +15 -0
  17. specguard_ci-0.1.0/.playwright-mcp/page-2026-06-12T03-18-42-296Z.yml +236 -0
  18. specguard_ci-0.1.0/.playwright-mcp/page-2026-06-12T03-19-07-349Z.yml +288 -0
  19. specguard_ci-0.1.0/.specguard/config.yml +10 -0
  20. specguard_ci-0.1.0/.specguard/lock.json +21 -0
  21. specguard_ci-0.1.0/.specify/extensions/.registry +19 -0
  22. specguard_ci-0.1.0/.specify/extensions/agent-context/README.md +57 -0
  23. specguard_ci-0.1.0/.specify/extensions/agent-context/agent-context-config.yml +4 -0
  24. specguard_ci-0.1.0/.specify/extensions/agent-context/commands/speckit.agent-context.update.md +26 -0
  25. specguard_ci-0.1.0/.specify/extensions/agent-context/extension.yml +34 -0
  26. specguard_ci-0.1.0/.specify/extensions/agent-context/scripts/bash/update-agent-context.sh +200 -0
  27. specguard_ci-0.1.0/.specify/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +237 -0
  28. specguard_ci-0.1.0/.specify/extensions.yml +23 -0
  29. specguard_ci-0.1.0/.specify/feature.json +3 -0
  30. specguard_ci-0.1.0/.specify/init-options.json +9 -0
  31. specguard_ci-0.1.0/.specify/integration.json +15 -0
  32. specguard_ci-0.1.0/.specify/integrations/claude.manifest.json +16 -0
  33. specguard_ci-0.1.0/.specify/integrations/speckit.manifest.json +17 -0
  34. specguard_ci-0.1.0/.specify/memory/constitution.md +109 -0
  35. specguard_ci-0.1.0/.specify/scripts/bash/check-prerequisites.sh +189 -0
  36. specguard_ci-0.1.0/.specify/scripts/bash/common.sh +582 -0
  37. specguard_ci-0.1.0/.specify/scripts/bash/create-new-feature.sh +299 -0
  38. specguard_ci-0.1.0/.specify/scripts/bash/setup-plan.sh +84 -0
  39. specguard_ci-0.1.0/.specify/scripts/bash/setup-tasks.sh +91 -0
  40. specguard_ci-0.1.0/.specify/templates/checklist-template.md +40 -0
  41. specguard_ci-0.1.0/.specify/templates/constitution-template.md +50 -0
  42. specguard_ci-0.1.0/.specify/templates/plan-template.md +113 -0
  43. specguard_ci-0.1.0/.specify/templates/spec-template.md +131 -0
  44. specguard_ci-0.1.0/.specify/templates/tasks-template.md +252 -0
  45. specguard_ci-0.1.0/.specify/workflows/speckit/workflow.yml +77 -0
  46. specguard_ci-0.1.0/.specify/workflows/workflow-registry.json +13 -0
  47. specguard_ci-0.1.0/CLAUDE.md +8 -0
  48. specguard_ci-0.1.0/LICENSE +21 -0
  49. specguard_ci-0.1.0/PKG-INFO +183 -0
  50. specguard_ci-0.1.0/README.md +162 -0
  51. specguard_ci-0.1.0/SPECGUARD_PRODUCT_SPEC.md +336 -0
  52. specguard_ci-0.1.0/SpecGuard_Presentation.pptx +0 -0
  53. specguard_ci-0.1.0/action.yml +37 -0
  54. specguard_ci-0.1.0/assets/logo.svg +87 -0
  55. specguard_ci-0.1.0/blocked-pr-files.png +0 -0
  56. specguard_ci-0.1.0/blocked-pr-full.png +0 -0
  57. specguard_ci-0.1.0/docs/quickstart.md +72 -0
  58. specguard_ci-0.1.0/pyproject.toml +51 -0
  59. specguard_ci-0.1.0/specs/001-pr-spec-gate/checklists/requirements.md +39 -0
  60. specguard_ci-0.1.0/specs/001-pr-spec-gate/contracts/action-interface.md +101 -0
  61. specguard_ci-0.1.0/specs/001-pr-spec-gate/contracts/classifier.md +74 -0
  62. specguard_ci-0.1.0/specs/001-pr-spec-gate/data-model.md +111 -0
  63. specguard_ci-0.1.0/specs/001-pr-spec-gate/plan.md +195 -0
  64. specguard_ci-0.1.0/specs/001-pr-spec-gate/quickstart.md +81 -0
  65. specguard_ci-0.1.0/specs/001-pr-spec-gate/research.md +186 -0
  66. specguard_ci-0.1.0/specs/001-pr-spec-gate/spec.md +223 -0
  67. specguard_ci-0.1.0/specs/001-pr-spec-gate/tasks.md +241 -0
  68. specguard_ci-0.1.0/src/specguard/__init__.py +7 -0
  69. specguard_ci-0.1.0/src/specguard/approvals.py +80 -0
  70. specguard_ci-0.1.0/src/specguard/ci.py +135 -0
  71. specguard_ci-0.1.0/src/specguard/classifier.py +212 -0
  72. specguard_ci-0.1.0/src/specguard/config.py +162 -0
  73. specguard_ci-0.1.0/src/specguard/engine.py +168 -0
  74. specguard_ci-0.1.0/src/specguard/gitdiff.py +119 -0
  75. specguard_ci-0.1.0/src/specguard/models.py +133 -0
  76. specguard_ci-0.1.0/src/specguard/report.py +155 -0
  77. specguard_ci-0.1.0/src/specguard/roles.py +66 -0
  78. specguard_ci-0.1.0/tests/conftest.py +283 -0
  79. specguard_ci-0.1.0/tests/eval/run_eval.py +162 -0
  80. specguard_ci-0.1.0/tests/fixtures/corpus/01_typo_fix/expected.json +4 -0
  81. specguard_ci-0.1.0/tests/fixtures/corpus/01_typo_fix/new.md +26 -0
  82. specguard_ci-0.1.0/tests/fixtures/corpus/01_typo_fix/old.md +26 -0
  83. specguard_ci-0.1.0/tests/fixtures/corpus/01_typo_fix/scope.json +18 -0
  84. specguard_ci-0.1.0/tests/fixtures/corpus/02_wording_clarification/expected.json +4 -0
  85. specguard_ci-0.1.0/tests/fixtures/corpus/02_wording_clarification/new.md +26 -0
  86. specguard_ci-0.1.0/tests/fixtures/corpus/02_wording_clarification/old.md +26 -0
  87. specguard_ci-0.1.0/tests/fixtures/corpus/02_wording_clarification/scope.json +18 -0
  88. specguard_ci-0.1.0/tests/fixtures/corpus/03_formatting_only/expected.json +4 -0
  89. specguard_ci-0.1.0/tests/fixtures/corpus/03_formatting_only/new.md +28 -0
  90. specguard_ci-0.1.0/tests/fixtures/corpus/03_formatting_only/old.md +26 -0
  91. specguard_ci-0.1.0/tests/fixtures/corpus/03_formatting_only/scope.json +18 -0
  92. specguard_ci-0.1.0/tests/fixtures/corpus/04_in_scope_detail/expected.json +4 -0
  93. specguard_ci-0.1.0/tests/fixtures/corpus/04_in_scope_detail/new.md +27 -0
  94. specguard_ci-0.1.0/tests/fixtures/corpus/04_in_scope_detail/old.md +26 -0
  95. specguard_ci-0.1.0/tests/fixtures/corpus/04_in_scope_detail/scope.json +18 -0
  96. specguard_ci-0.1.0/tests/fixtures/corpus/05_adversarial_exclusion_mention/expected.json +4 -0
  97. specguard_ci-0.1.0/tests/fixtures/corpus/05_adversarial_exclusion_mention/new.md +28 -0
  98. specguard_ci-0.1.0/tests/fixtures/corpus/05_adversarial_exclusion_mention/old.md +26 -0
  99. specguard_ci-0.1.0/tests/fixtures/corpus/05_adversarial_exclusion_mention/scope.json +18 -0
  100. specguard_ci-0.1.0/tests/fixtures/corpus/06_typo_multiple/expected.json +4 -0
  101. specguard_ci-0.1.0/tests/fixtures/corpus/06_typo_multiple/new.md +25 -0
  102. specguard_ci-0.1.0/tests/fixtures/corpus/06_typo_multiple/old.md +25 -0
  103. specguard_ci-0.1.0/tests/fixtures/corpus/06_typo_multiple/scope.json +17 -0
  104. specguard_ci-0.1.0/tests/fixtures/corpus/07_clarify_oauth_flow/expected.json +4 -0
  105. specguard_ci-0.1.0/tests/fixtures/corpus/07_clarify_oauth_flow/new.md +25 -0
  106. specguard_ci-0.1.0/tests/fixtures/corpus/07_clarify_oauth_flow/old.md +25 -0
  107. specguard_ci-0.1.0/tests/fixtures/corpus/07_clarify_oauth_flow/scope.json +17 -0
  108. specguard_ci-0.1.0/tests/fixtures/corpus/08_add_example_in_scope/expected.json +4 -0
  109. specguard_ci-0.1.0/tests/fixtures/corpus/08_add_example_in_scope/new.md +25 -0
  110. specguard_ci-0.1.0/tests/fixtures/corpus/08_add_example_in_scope/old.md +25 -0
  111. specguard_ci-0.1.0/tests/fixtures/corpus/08_add_example_in_scope/scope.json +17 -0
  112. specguard_ci-0.1.0/tests/fixtures/corpus/09_reorder_sections/expected.json +4 -0
  113. specguard_ci-0.1.0/tests/fixtures/corpus/09_reorder_sections/new.md +28 -0
  114. specguard_ci-0.1.0/tests/fixtures/corpus/09_reorder_sections/old.md +28 -0
  115. specguard_ci-0.1.0/tests/fixtures/corpus/09_reorder_sections/scope.json +17 -0
  116. specguard_ci-0.1.0/tests/fixtures/corpus/10_grammar_fix/expected.json +4 -0
  117. specguard_ci-0.1.0/tests/fixtures/corpus/10_grammar_fix/new.md +28 -0
  118. specguard_ci-0.1.0/tests/fixtures/corpus/10_grammar_fix/old.md +28 -0
  119. specguard_ci-0.1.0/tests/fixtures/corpus/10_grammar_fix/scope.json +17 -0
  120. specguard_ci-0.1.0/tests/fixtures/corpus/11_expand_quality_checks/expected.json +4 -0
  121. specguard_ci-0.1.0/tests/fixtures/corpus/11_expand_quality_checks/new.md +29 -0
  122. specguard_ci-0.1.0/tests/fixtures/corpus/11_expand_quality_checks/old.md +28 -0
  123. specguard_ci-0.1.0/tests/fixtures/corpus/11_expand_quality_checks/scope.json +17 -0
  124. specguard_ci-0.1.0/tests/fixtures/corpus/12_add_faq_excluding_topic/expected.json +4 -0
  125. specguard_ci-0.1.0/tests/fixtures/corpus/12_add_faq_excluding_topic/new.md +29 -0
  126. specguard_ci-0.1.0/tests/fixtures/corpus/12_add_faq_excluding_topic/old.md +25 -0
  127. specguard_ci-0.1.0/tests/fixtures/corpus/12_add_faq_excluding_topic/scope.json +17 -0
  128. specguard_ci-0.1.0/tests/fixtures/corpus/13_fix_broken_link/expected.json +4 -0
  129. specguard_ci-0.1.0/tests/fixtures/corpus/13_fix_broken_link/new.md +26 -0
  130. specguard_ci-0.1.0/tests/fixtures/corpus/13_fix_broken_link/old.md +26 -0
  131. specguard_ci-0.1.0/tests/fixtures/corpus/13_fix_broken_link/scope.json +18 -0
  132. specguard_ci-0.1.0/tests/fixtures/corpus/14_add_install_instructions/expected.json +4 -0
  133. specguard_ci-0.1.0/tests/fixtures/corpus/14_add_install_instructions/new.md +30 -0
  134. specguard_ci-0.1.0/tests/fixtures/corpus/14_add_install_instructions/old.md +26 -0
  135. specguard_ci-0.1.0/tests/fixtures/corpus/14_add_install_instructions/scope.json +18 -0
  136. specguard_ci-0.1.0/tests/fixtures/corpus/15_tighten_goal_wording/expected.json +4 -0
  137. specguard_ci-0.1.0/tests/fixtures/corpus/15_tighten_goal_wording/new.md +28 -0
  138. specguard_ci-0.1.0/tests/fixtures/corpus/15_tighten_goal_wording/old.md +28 -0
  139. specguard_ci-0.1.0/tests/fixtures/corpus/15_tighten_goal_wording/scope.json +17 -0
  140. specguard_ci-0.1.0/tests/fixtures/corpus/16_saas_pricing_section/expected.json +4 -0
  141. specguard_ci-0.1.0/tests/fixtures/corpus/16_saas_pricing_section/new.md +30 -0
  142. specguard_ci-0.1.0/tests/fixtures/corpus/16_saas_pricing_section/old.md +26 -0
  143. specguard_ci-0.1.0/tests/fixtures/corpus/16_saas_pricing_section/scope.json +18 -0
  144. specguard_ci-0.1.0/tests/fixtures/corpus/17_cloud_sync_feature/expected.json +4 -0
  145. specguard_ci-0.1.0/tests/fixtures/corpus/17_cloud_sync_feature/new.md +27 -0
  146. specguard_ci-0.1.0/tests/fixtures/corpus/17_cloud_sync_feature/old.md +26 -0
  147. specguard_ci-0.1.0/tests/fixtures/corpus/17_cloud_sync_feature/scope.json +18 -0
  148. specguard_ci-0.1.0/tests/fixtures/corpus/18_goal_rewrite_webapp/expected.json +4 -0
  149. specguard_ci-0.1.0/tests/fixtures/corpus/18_goal_rewrite_webapp/new.md +26 -0
  150. specguard_ci-0.1.0/tests/fixtures/corpus/18_goal_rewrite_webapp/old.md +26 -0
  151. specguard_ci-0.1.0/tests/fixtures/corpus/18_goal_rewrite_webapp/scope.json +18 -0
  152. specguard_ci-0.1.0/tests/fixtures/corpus/19_add_2fa_plan/expected.json +4 -0
  153. specguard_ci-0.1.0/tests/fixtures/corpus/19_add_2fa_plan/new.md +29 -0
  154. specguard_ci-0.1.0/tests/fixtures/corpus/19_add_2fa_plan/old.md +25 -0
  155. specguard_ci-0.1.0/tests/fixtures/corpus/19_add_2fa_plan/scope.json +17 -0
  156. specguard_ci-0.1.0/tests/fixtures/corpus/20_sso_active_directory/expected.json +4 -0
  157. specguard_ci-0.1.0/tests/fixtures/corpus/20_sso_active_directory/new.md +25 -0
  158. specguard_ci-0.1.0/tests/fixtures/corpus/20_sso_active_directory/old.md +25 -0
  159. specguard_ci-0.1.0/tests/fixtures/corpus/20_sso_active_directory/scope.json +17 -0
  160. specguard_ci-0.1.0/tests/fixtures/corpus/21_novel_topic_crypto_wallet/expected.json +4 -0
  161. specguard_ci-0.1.0/tests/fixtures/corpus/21_novel_topic_crypto_wallet/new.md +29 -0
  162. specguard_ci-0.1.0/tests/fixtures/corpus/21_novel_topic_crypto_wallet/old.md +25 -0
  163. specguard_ci-0.1.0/tests/fixtures/corpus/21_novel_topic_crypto_wallet/scope.json +17 -0
  164. specguard_ci-0.1.0/tests/fixtures/corpus/22_domain_shift_analytics/expected.json +4 -0
  165. specguard_ci-0.1.0/tests/fixtures/corpus/22_domain_shift_analytics/new.md +28 -0
  166. specguard_ci-0.1.0/tests/fixtures/corpus/22_domain_shift_analytics/old.md +28 -0
  167. specguard_ci-0.1.0/tests/fixtures/corpus/22_domain_shift_analytics/scope.json +17 -0
  168. specguard_ci-0.1.0/tests/fixtures/corpus/23_ml_forecasting/expected.json +4 -0
  169. specguard_ci-0.1.0/tests/fixtures/corpus/23_ml_forecasting/new.md +32 -0
  170. specguard_ci-0.1.0/tests/fixtures/corpus/23_ml_forecasting/old.md +28 -0
  171. specguard_ci-0.1.0/tests/fixtures/corpus/23_ml_forecasting/scope.json +17 -0
  172. specguard_ci-0.1.0/tests/fixtures/corpus/24_mixed_typo_plus_scope/expected.json +4 -0
  173. specguard_ci-0.1.0/tests/fixtures/corpus/24_mixed_typo_plus_scope/new.md +30 -0
  174. specguard_ci-0.1.0/tests/fixtures/corpus/24_mixed_typo_plus_scope/old.md +26 -0
  175. specguard_ci-0.1.0/tests/fixtures/corpus/24_mixed_typo_plus_scope/scope.json +18 -0
  176. specguard_ci-0.1.0/tests/fixtures/corpus/25_streaming_ingestion/expected.json +4 -0
  177. specguard_ci-0.1.0/tests/fixtures/corpus/25_streaming_ingestion/new.md +28 -0
  178. specguard_ci-0.1.0/tests/fixtures/corpus/25_streaming_ingestion/old.md +28 -0
  179. specguard_ci-0.1.0/tests/fixtures/corpus/25_streaming_ingestion/scope.json +17 -0
  180. specguard_ci-0.1.0/tests/fixtures/corpus/26_mobile_app_section/expected.json +4 -0
  181. specguard_ci-0.1.0/tests/fixtures/corpus/26_mobile_app_section/new.md +30 -0
  182. specguard_ci-0.1.0/tests/fixtures/corpus/26_mobile_app_section/old.md +26 -0
  183. specguard_ci-0.1.0/tests/fixtures/corpus/26_mobile_app_section/scope.json +18 -0
  184. specguard_ci-0.1.0/tests/fixtures/corpus/27_billing_integration/expected.json +4 -0
  185. specguard_ci-0.1.0/tests/fixtures/corpus/27_billing_integration/new.md +29 -0
  186. specguard_ci-0.1.0/tests/fixtures/corpus/27_billing_integration/old.md +25 -0
  187. specguard_ci-0.1.0/tests/fixtures/corpus/27_billing_integration/scope.json +17 -0
  188. specguard_ci-0.1.0/tests/fixtures/events/.gitkeep +0 -0
  189. specguard_ci-0.1.0/tests/fixtures/events/pr_fork.json +8 -0
  190. specguard_ci-0.1.0/tests/fixtures/events/pr_scope_change.json +8 -0
  191. specguard_ci-0.1.0/tests/fixtures/events/pr_scope_change_review.json +10 -0
  192. specguard_ci-0.1.0/tests/fixtures/events/pr_typo_fix.json +8 -0
  193. specguard_ci-0.1.0/tests/fixtures/events/pr_typo_fix_review.json +10 -0
  194. specguard_ci-0.1.0/tests/test_approvals.py +96 -0
  195. specguard_ci-0.1.0/tests/test_ci.py +214 -0
  196. specguard_ci-0.1.0/tests/test_classifier.py +130 -0
  197. specguard_ci-0.1.0/tests/test_config.py +163 -0
  198. specguard_ci-0.1.0/tests/test_engine.py +318 -0
  199. specguard_ci-0.1.0/tests/test_gitdiff.py +75 -0
  200. specguard_ci-0.1.0/tests/test_roles.py +135 -0
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: "clean-code"
3
+ description: "Clean code review and refactoring skill — naming, structure, complexity, duplication, and readability for Python projects."
4
+ argument-hint: "Optional: file path or specific concern (e.g. 'review engine.py', 'naming', 'complexity')"
5
+ compatibility: "Python 3.12+ projects; principles apply to any language"
6
+ metadata:
7
+ author: "specguard"
8
+ source: ".claude/skills/clean-code/SKILL.md"
9
+ user-invocable: true
10
+ disable-model-invocation: false
11
+ ---
12
+
13
+ ## User Input
14
+
15
+ ```text
16
+ $ARGUMENTS
17
+ ```
18
+
19
+ If a file path is provided, read and review that file. If no argument is given, review the most recently edited file or ask which file to review.
20
+
21
+ ## Review Checklist
22
+
23
+ Work through each category. Flag issues with severity: **must fix** / **should fix** / **consider**.
24
+
25
+ ---
26
+
27
+ ### 1. Naming
28
+
29
+ - [ ] Functions named as verbs: `classify_diff`, not `classifier` or `do_it`
30
+ - [ ] Variables named for what they hold, not their type: `watched_files`, not `file_list`
31
+ - [ ] Booleans prefixed with `is_`, `has_`, `can_`: `is_fork`, `has_qualified_approval`
32
+ - [ ] No single-letter variables outside list comprehensions and loop indices
33
+ - [ ] No abbreviations that require domain knowledge to decode
34
+ - [ ] Class names are nouns: `Verdict`, `ScopeLock`, not `VerdictHandler`
35
+
36
+ ---
37
+
38
+ ### 2. Functions
39
+
40
+ - [ ] Each function does one thing — if you need "and" to describe it, split it
41
+ - [ ] Length: flag functions over ~30 lines for review
42
+ - [ ] Parameters: flag functions with more than 4 parameters — consider a dataclass
43
+ - [ ] No boolean flag parameters that change behaviour: split into two functions instead
44
+ - [ ] Early returns over nested conditionals
45
+ - [ ] No side effects in functions whose name implies a query (e.g. `get_`, `find_`, `is_`)
46
+
47
+ ---
48
+
49
+ ### 3. Comments
50
+
51
+ - [ ] No comments that restate what the code does — the code says that
52
+ - [ ] Comments only for: hidden constraints, non-obvious invariants, workarounds for external bugs
53
+ - [ ] No commented-out code — delete it (git has history)
54
+ - [ ] No TODO comments without a linked issue or task ID
55
+
56
+ ---
57
+
58
+ ### 4. Complexity
59
+
60
+ - [ ] Cyclomatic complexity: flag any function with more than 4 branches
61
+ - [ ] Nesting: flag more than 3 levels of indentation
62
+ - [ ] Long chains: extract intermediate variables with meaningful names
63
+ - [ ] Magic numbers/strings: extract to named constants at module level
64
+
65
+ ---
66
+
67
+ ### 5. Duplication
68
+
69
+ - [ ] Identical logic in two places → extract a function
70
+ - [ ] Similar logic with slight variation → consider a parameter or a shared helper
71
+ - [ ] Copy-pasted error messages or annotation strings → extract to constants
72
+
73
+ ---
74
+
75
+ ### 6. Error handling
76
+
77
+ - [ ] Catch specific exceptions, never bare `except:` or `except Exception:` without re-raise
78
+ - [ ] Error messages name the file/field that caused the problem
79
+ - [ ] Custom exceptions (`ConfigError`, `ClassifierError`) used at system boundaries — not `ValueError` from deep inside a module
80
+ - [ ] No swallowed exceptions — at minimum `logger.warning` before continuing
81
+
82
+ ---
83
+
84
+ ### 7. Types (Python-specific)
85
+
86
+ - [ ] All public functions have type annotations
87
+ - [ ] `Optional[X]` written as `X | None` (Python 3.10+ style)
88
+ - [ ] Pydantic models used for external data boundaries (API responses, config files)
89
+ - [ ] No `Any` without a comment explaining why it cannot be narrowed
90
+ - [ ] Return types explicit — no implicit `None` on functions that sometimes return a value
91
+
92
+ ---
93
+
94
+ ### 8. Module structure
95
+
96
+ - [ ] Imports: stdlib → third-party → local, each group separated by a blank line
97
+ - [ ] No circular imports — dependency order: `models` → `config`/`gitdiff` → `classifier`/`roles`/`approvals` → `engine` → `report`/`ci`
98
+ - [ ] Module-level code limited to constants and `__all__` — no logic at import time
99
+ - [ ] No `from module import *`
100
+
101
+ ---
102
+
103
+ ### 9. Tests (when reviewing test files)
104
+
105
+ - [ ] Test names describe the scenario: `test_scope_change_below_threshold_warns_not_blocks`
106
+ - [ ] One assertion concept per test (multiple `assert` lines fine if testing one thing)
107
+ - [ ] No logic in tests (no loops, no conditionals) — if you need a loop, use `@pytest.mark.parametrize`
108
+ - [ ] Fixtures in `conftest.py`, not repeated across test files
109
+ - [ ] No real API calls in unit tests — `FakeAnthropicClient` only
110
+
111
+ ---
112
+
113
+ ## Output Format
114
+
115
+ For each issue found:
116
+
117
+ ```
118
+ [SEVERITY] Category — Description
119
+ File: path/to/file.py, line N
120
+ Issue: what is wrong
121
+ Fix: what to change it to (or a concrete suggestion)
122
+ ```
123
+
124
+ After listing all issues, provide a **Refactoring Plan** — ordered by impact, highest first — with estimated effort (S/M/L) for each item.
125
+
126
+ If no issues are found in a category, note it as ✅ and move on.
127
+
128
+ ---
129
+
130
+ ## Rules
131
+
132
+ - Do not refactor beyond what was requested — flag issues, do not silently rewrite
133
+ - Do not add abstractions that are not needed by existing code
134
+ - Do not add error handling for scenarios that cannot occur
135
+ - When suggesting a rename, show the before and after in context — not just the new name
136
+ - Constitution IV applies: clean code must not introduce friction on the additive path
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: "git"
3
+ description: "Git workflow skill — branch management, commits, PRs, rebasing, and conflict resolution following project conventions."
4
+ argument-hint: "Optional: specific git operation (e.g. 'new branch', 'pr', 'cleanup', 'undo')"
5
+ compatibility: "Requires a git repository"
6
+ metadata:
7
+ author: "specguard"
8
+ source: ".claude/skills/git/SKILL.md"
9
+ user-invocable: true
10
+ disable-model-invocation: false
11
+ ---
12
+
13
+ ## User Input
14
+
15
+ ```text
16
+ $ARGUMENTS
17
+ ```
18
+
19
+ Consider the user input before selecting which operation to perform.
20
+
21
+ ## Operations
22
+
23
+ ### Branch
24
+
25
+ **Create a feature branch** (when user says "new branch", "start feature", or similar):
26
+ - Name format: `NNN-short-description` (e.g. `002-classifier-core`)
27
+ - Always branch from the latest `main`: `git checkout main && git pull && git checkout -b <name>`
28
+ - Report the branch name created
29
+
30
+ **Switch branch**: `git checkout <branch>` — list available branches first if name is ambiguous
31
+
32
+ **Delete merged branch**: confirm the branch is merged into main before deleting
33
+
34
+ ---
35
+
36
+ ### Commit
37
+
38
+ Follow this sequence every time:
39
+ 1. `git status` — review what changed
40
+ 2. `git diff` — understand the changes
41
+ 3. Stage specific files by name — never `git add .` or `git add -A`
42
+ 4. Write the commit message using the Conventional Commits format:
43
+
44
+ ```
45
+ <type>(<scope>): <short summary>
46
+
47
+ <optional body — the WHY, not the what>
48
+
49
+ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
50
+ ```
51
+
52
+ Types: `feat` `fix` `docs` `refactor` `test` `chore` `perf`
53
+
54
+ 5. Always pass the message via heredoc:
55
+ ```bash
56
+ git commit -m "$(cat <<'EOF'
57
+ feat(classifier): add prompt caching with ephemeral cache_control
58
+ EOF
59
+ )"
60
+ ```
61
+
62
+ **Never**:
63
+ - Skip hooks (`--no-verify`)
64
+ - Amend published commits
65
+ - Commit `.env`, credentials, or binary blobs not already tracked
66
+
67
+ ---
68
+
69
+ ### Pull Request
70
+
71
+ 1. `git log main..HEAD --oneline` — summarize what's on the branch
72
+ 2. `git diff main...HEAD` — review all changes
73
+ 3. Push branch: `git push -u origin <branch>`
74
+ 4. Create PR via `gh pr create`:
75
+
76
+ ```bash
77
+ gh pr create --title "<type>: <summary under 70 chars>" --body "$(cat <<'EOF'
78
+ ## Summary
79
+ - <bullet 1>
80
+ - <bullet 2>
81
+
82
+ ## Test plan
83
+ - [ ] <validation step>
84
+
85
+ 🤖 Generated with [Claude Code](https://claude.ai/claude-code)
86
+ EOF
87
+ )"
88
+ ```
89
+
90
+ 5. Return the PR URL
91
+
92
+ ---
93
+
94
+ ### Rebase & Sync
95
+
96
+ **Sync feature branch with main**:
97
+ ```bash
98
+ git fetch origin
99
+ git rebase origin/main
100
+ ```
101
+
102
+ Resolve conflicts file by file — never discard changes without showing the user what would be lost.
103
+
104
+ **Interactive rebase** — not supported (requires interactive terminal). Use fixup commits and `git rebase origin/main` instead.
105
+
106
+ ---
107
+
108
+ ### Undo
109
+
110
+ | Situation | Safe command |
111
+ |---|---|
112
+ | Unstage a file | `git restore --staged <file>` |
113
+ | Discard uncommitted changes to a file | `git restore <file>` (destructive — confirm first) |
114
+ | Undo last commit, keep changes staged | `git reset --soft HEAD~1` |
115
+ | Find a lost commit | `git reflog` |
116
+
117
+ **Never** `git reset --hard` or `git push --force` on `main` without explicit user instruction.
118
+
119
+ ---
120
+
121
+ ### Cleanup
122
+
123
+ - Delete local branches already merged to main: `git branch --merged main | grep -v main | xargs git branch -d`
124
+ - Show branches: `git branch -vv`
125
+ - Show log: `git log --oneline --graph --decorate -20`
126
+
127
+ ---
128
+
129
+ ## Rules
130
+
131
+ - Confirm before any destructive operation (reset --hard, force push, branch delete)
132
+ - Prefer creating new commits over amending
133
+ - Never push directly to `main` unless the user explicitly says so
134
+ - Always verify the remote URL before pushing to a new remote
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: speckit-agent-context-update
3
+ description: Refresh the managed Spec Kit section in the coding agent context file
4
+ compatibility: Requires spec-kit project structure with .specify/ directory
5
+ metadata:
6
+ author: github-spec-kit
7
+ source: agent-context:commands/speckit.agent-context.update.md
8
+ ---
9
+
10
+ # Update Coding Agent Context
11
+
12
+ Refresh the managed Spec Kit section inside the active coding agent's context/instruction file (e.g. `CLAUDE.md`, `.github/copilot-instructions.md`, `AGENTS.md`).
13
+
14
+ ## Behavior
15
+
16
+ The script reads the agent-context extension config at
17
+ `.specify/extensions/agent-context/agent-context-config.yml` to discover:
18
+
19
+ - `context_file` — the path of the coding agent context file to manage.
20
+ - `context_markers.start` / `.end` — the delimiters surrounding the managed section. Defaults to `<!-- SPECKIT START -->` and `<!-- SPECKIT END -->` when the field is missing.
21
+
22
+ It then creates, replaces, or appends the managed block so that the section points at the most recent plan path when one can be discovered (`specs/<feature>/plan.md`).
23
+
24
+ If `context_file` is empty or the file cannot be located, the command reports nothing to do and exits successfully.
25
+
26
+ ## Execution
27
+
28
+ - **Bash**: `.specify/extensions/agent-context/scripts/bash/update-agent-context.sh [plan_path]`
29
+ - **PowerShell**: `.specify/extensions/agent-context/scripts/powershell/update-agent-context.ps1 [plan_path]`
30
+
31
+ When `plan_path` is omitted, the script auto-detects the most recently modified `specs/*/plan.md`.
@@ -0,0 +1,260 @@
1
+ ---
2
+ name: "speckit-analyze"
3
+ description: "Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation."
4
+ argument-hint: "Optional focus areas for analysis"
5
+ compatibility: "Requires spec-kit project structure with .specify/ directory"
6
+ metadata:
7
+ author: "github-spec-kit"
8
+ source: "templates/commands/analyze.md"
9
+ user-invocable: true
10
+ disable-model-invocation: false
11
+ ---
12
+
13
+
14
+ ## User Input
15
+
16
+ ```text
17
+ $ARGUMENTS
18
+ ```
19
+
20
+ You **MUST** consider the user input before proceeding (if not empty).
21
+
22
+ ## Pre-Execution Checks
23
+
24
+ **Check for extension hooks (before analysis)**:
25
+ - Check if `.specify/extensions.yml` exists in the project root.
26
+ - If it exists, read it and look for entries under the `hooks.before_analyze` key
27
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
28
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
29
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
30
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
31
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
32
+ - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `speckit.git.commit` → `/speckit-git-commit`.
33
+ - For each executable hook, output the following based on its `optional` flag:
34
+ - **Optional hook** (`optional: true`):
35
+ ```
36
+ ## Extension Hooks
37
+
38
+ **Optional Pre-Hook**: {extension}
39
+ Command: `/{command}`
40
+ Description: {description}
41
+
42
+ Prompt: {prompt}
43
+ To execute: `/{command}`
44
+ ```
45
+ - **Mandatory hook** (`optional: false`):
46
+ ```
47
+ ## Extension Hooks
48
+
49
+ **Automatic Pre-Hook**: {extension}
50
+ Executing: `/{command}`
51
+ EXECUTE_COMMAND: {command}
52
+
53
+ Wait for the result of the hook command before proceeding to the Goal.
54
+ ```
55
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
56
+
57
+ ## Goal
58
+
59
+ Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/speckit-tasks` has successfully produced a complete `tasks.md`.
60
+
61
+ ## Operating Constraints
62
+
63
+ **STRICTLY READ-ONLY**: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).
64
+
65
+ **Constitution Authority**: The project constitution (`.specify/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/speckit-analyze`.
66
+
67
+ ## Execution Steps
68
+
69
+ ### 1. Initialize Analysis Context
70
+
71
+ Run `.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:
72
+
73
+ - SPEC = FEATURE_DIR/spec.md
74
+ - PLAN = FEATURE_DIR/plan.md
75
+ - TASKS = FEATURE_DIR/tasks.md
76
+
77
+ Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).
78
+ For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
79
+
80
+ ### 2. Load Artifacts (Progressive Disclosure)
81
+
82
+ Load only the minimal necessary context from each artifact:
83
+
84
+ **From spec.md:**
85
+
86
+ - Overview/Context
87
+ - Functional Requirements
88
+ - Success Criteria (measurable outcomes — e.g., performance, security, availability, user success, business impact)
89
+ - User Stories
90
+ - Edge Cases (if present)
91
+
92
+ **From plan.md:**
93
+
94
+ - Architecture/stack choices
95
+ - Data Model references
96
+ - Phases
97
+ - Technical constraints
98
+
99
+ **From tasks.md:**
100
+
101
+ - Task IDs
102
+ - Descriptions
103
+ - Phase grouping
104
+ - Parallel markers [P]
105
+ - Referenced file paths
106
+
107
+ **From constitution:**
108
+
109
+ - Load `.specify/memory/constitution.md` for principle validation
110
+
111
+ ### 3. Build Semantic Models
112
+
113
+ Create internal representations (do not include raw artifacts in output):
114
+
115
+ - **Requirements inventory**: For each Functional Requirement (FR-###) and Success Criterion (SC-###), record a stable key. Use the explicit FR-/SC- identifier as the primary key when present, and optionally also derive an imperative-phrase slug for readability (e.g., "User can upload file" → `user-can-upload-file`). Include only Success Criteria items that require buildable work (e.g., load-testing infrastructure, security audit tooling), and exclude post-launch outcome metrics and business KPIs (e.g., "Reduce support tickets by 50%").
116
+ - **User story/action inventory**: Discrete user actions with acceptance criteria
117
+ - **Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases)
118
+ - **Constitution rule set**: Extract principle names and MUST/SHOULD normative statements
119
+
120
+ ### 4. Detection Passes (Token-Efficient Analysis)
121
+
122
+ Focus on high-signal findings. Limit to 50 findings total; aggregate remainder in overflow summary.
123
+
124
+ #### A. Duplication Detection
125
+
126
+ - Identify near-duplicate requirements
127
+ - Mark lower-quality phrasing for consolidation
128
+
129
+ #### B. Ambiguity Detection
130
+
131
+ - Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria
132
+ - Flag unresolved placeholders (TODO, TKTK, ???, `<placeholder>`, etc.)
133
+
134
+ #### C. Underspecification
135
+
136
+ - Requirements with verbs but missing object or measurable outcome
137
+ - User stories missing acceptance criteria alignment
138
+ - Tasks referencing files or components not defined in spec/plan
139
+
140
+ #### D. Constitution Alignment
141
+
142
+ - Any requirement or plan element conflicting with a MUST principle
143
+ - Missing mandated sections or quality gates from constitution
144
+
145
+ #### E. Coverage Gaps
146
+
147
+ - Requirements with zero associated tasks
148
+ - Tasks with no mapped requirement/story
149
+ - Success Criteria requiring buildable work (performance, security, availability) not reflected in tasks
150
+
151
+ #### F. Inconsistency
152
+
153
+ - Terminology drift (same concept named differently across files)
154
+ - Data entities referenced in plan but absent in spec (or vice versa)
155
+ - Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note)
156
+ - Conflicting requirements (e.g., one requires Next.js while other specifies Vue)
157
+
158
+ ### 5. Severity Assignment
159
+
160
+ Use this heuristic to prioritize findings:
161
+
162
+ - **CRITICAL**: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality
163
+ - **HIGH**: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion
164
+ - **MEDIUM**: Terminology drift, missing non-functional task coverage, underspecified edge case
165
+ - **LOW**: Style/wording improvements, minor redundancy not affecting execution order
166
+
167
+ ### 6. Produce Compact Analysis Report
168
+
169
+ Output a Markdown report (no file writes) with the following structure:
170
+
171
+ ## Specification Analysis Report
172
+
173
+ | ID | Category | Severity | Location(s) | Summary | Recommendation |
174
+ |----|----------|----------|-------------|---------|----------------|
175
+ | A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |
176
+
177
+ (Add one row per finding; generate stable IDs prefixed by category initial.)
178
+
179
+ **Coverage Summary Table:**
180
+
181
+ | Requirement Key | Has Task? | Task IDs | Notes |
182
+ |-----------------|-----------|----------|-------|
183
+
184
+ **Constitution Alignment Issues:** (if any)
185
+
186
+ **Unmapped Tasks:** (if any)
187
+
188
+ **Metrics:**
189
+
190
+ - Total Requirements
191
+ - Total Tasks
192
+ - Coverage % (requirements with >=1 task)
193
+ - Ambiguity Count
194
+ - Duplication Count
195
+ - Critical Issues Count
196
+
197
+ ### 7. Provide Next Actions
198
+
199
+ At end of report, output a concise Next Actions block:
200
+
201
+ - If CRITICAL issues exist: Recommend resolving before `/speckit-implement`
202
+ - If only LOW/MEDIUM: User may proceed, but provide improvement suggestions
203
+ - Provide explicit command suggestions: e.g., "Run /speckit-specify with refinement", "Run /speckit-plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'"
204
+
205
+ ### 8. Offer Remediation
206
+
207
+ Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
208
+
209
+ ### 9. Check for extension hooks
210
+
211
+ After reporting, check if `.specify/extensions.yml` exists in the project root.
212
+ - If it exists, read it and look for entries under the `hooks.after_analyze` key
213
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
214
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
215
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
216
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
217
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
218
+ - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `speckit.git.commit` → `/speckit-git-commit`.
219
+ - For each executable hook, output the following based on its `optional` flag:
220
+ - **Optional hook** (`optional: true`):
221
+ ```
222
+ ## Extension Hooks
223
+
224
+ **Optional Hook**: {extension}
225
+ Command: `/{command}`
226
+ Description: {description}
227
+
228
+ Prompt: {prompt}
229
+ To execute: `/{command}`
230
+ ```
231
+ - **Mandatory hook** (`optional: false`):
232
+ ```
233
+ ## Extension Hooks
234
+
235
+ **Automatic Hook**: {extension}
236
+ Executing: `/{command}`
237
+ EXECUTE_COMMAND: {command}
238
+ ```
239
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
240
+
241
+ ## Operating Principles
242
+
243
+ ### Context Efficiency
244
+
245
+ - **Minimal high-signal tokens**: Focus on actionable findings, not exhaustive documentation
246
+ - **Progressive disclosure**: Load artifacts incrementally; don't dump all content into analysis
247
+ - **Token-efficient output**: Limit findings table to 50 rows; summarize overflow
248
+ - **Deterministic results**: Rerunning without changes should produce consistent IDs and counts
249
+
250
+ ### Analysis Guidelines
251
+
252
+ - **NEVER modify files** (this is read-only analysis)
253
+ - **NEVER hallucinate missing sections** (if absent, report them accurately)
254
+ - **Prioritize constitution violations** (these are always CRITICAL)
255
+ - **Use examples over exhaustive rules** (cite specific instances, not generic patterns)
256
+ - **Report zero issues gracefully** (emit success report with coverage statistics)
257
+
258
+ ## Context
259
+
260
+ $ARGUMENTS