aia 2.0.0.0.pre.beta2 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +152 -223
  3. data/README.md +41 -18
  4. data/bin/aia +8 -3
  5. data/lib/aia/aia_completion.bash +2 -3
  6. data/lib/aia/aia_completion.fish +6 -5
  7. data/lib/aia/aia_completion.zsh +2 -3
  8. data/lib/aia/chat_loop.rb +16 -14
  9. data/lib/aia/config/cli_parser.rb +123 -91
  10. data/lib/aia/config/defaults.yml +18 -40
  11. data/lib/aia/config/mcp_parser.rb +30 -36
  12. data/lib/aia/config/model_spec.rb +8 -14
  13. data/lib/aia/config/validator.rb +102 -103
  14. data/lib/aia/config/value_caster.rb +76 -0
  15. data/lib/aia/config.rb +70 -53
  16. data/lib/aia/crew.rb +29 -19
  17. data/lib/aia/debate_handler.rb +27 -10
  18. data/lib/aia/directives/configuration_directives.rb +55 -14
  19. data/lib/aia/directives/context_directives.rb +24 -12
  20. data/lib/aia/directives/execution_directives.rb +18 -23
  21. data/lib/aia/directives/model_directives.rb +41 -104
  22. data/lib/aia/directives/utility_directives.rb +16 -17
  23. data/lib/aia/directives/web_and_file_directives.rb +21 -14
  24. data/lib/aia/fact_asserter.rb +3 -3
  25. data/lib/aia/history_transfer.rb +64 -24
  26. data/lib/aia/logger.rb +14 -46
  27. data/lib/aia/mcp_config_normalizer.rb +27 -14
  28. data/lib/aia/mcp_connection_manager.rb +181 -184
  29. data/lib/aia/mcp_discovery.rb +43 -15
  30. data/lib/aia/mcp_grouper.rb +2 -1
  31. data/lib/aia/mcp_server_config.rb +20 -2
  32. data/lib/aia/mcp_utility.rb +24 -19
  33. data/lib/aia/mention_router.rb +15 -2
  34. data/lib/aia/modality_query.rb +36 -0
  35. data/lib/aia/model_alias_registry.rb +11 -11
  36. data/lib/aia/model_registry.rb +75 -0
  37. data/lib/aia/network_builder.rb +8 -7
  38. data/lib/aia/patches/mcp_stdio_stderr.rb +102 -0
  39. data/lib/aia/patches/ruby_llm_streaming_error.rb +21 -4
  40. data/lib/aia/patches/ruby_llm_tool_param_compat.rb +18 -0
  41. data/lib/aia/pipeline_orchestrator.rb +71 -38
  42. data/lib/aia/prompt_decomposer.rb +1 -1
  43. data/lib/aia/prompt_handler.rb +56 -29
  44. data/lib/aia/provider_registry.rb +105 -0
  45. data/lib/aia/robot_builder.rb +1 -1
  46. data/lib/aia/robot_factory.rb +67 -63
  47. data/lib/aia/robot_sync.rb +79 -0
  48. data/lib/aia/role_catalog.rb +89 -0
  49. data/lib/aia/session.rb +25 -11
  50. data/lib/aia/skill_utils.rb +60 -19
  51. data/lib/aia/spawn_handler.rb +16 -4
  52. data/lib/aia/spawn_spec_parser.rb +6 -7
  53. data/lib/aia/special_mode_handler.rb +28 -25
  54. data/lib/aia/speech.rb +70 -34
  55. data/lib/aia/startup_coordinator.rb +17 -92
  56. data/lib/aia/streaming_runner.rb +10 -2
  57. data/lib/aia/system_prompt_assembler.rb +12 -11
  58. data/lib/aia/task_board.rb +60 -0
  59. data/lib/aia/tool_approver.rb +205 -0
  60. data/lib/aia/tool_filter.rb +1 -10
  61. data/lib/aia/tool_filter_strategy.rb +12 -1
  62. data/lib/aia/tool_introspection.rb +9 -1
  63. data/lib/aia/tool_loader.rb +67 -33
  64. data/lib/aia/tool_utility.rb +6 -5
  65. data/lib/aia/tools/delegate_to_foreman_tool.rb +6 -4
  66. data/lib/aia/tools/recruit_robot_tool.rb +12 -12
  67. data/lib/aia/tools/reskill_robot_tool.rb +7 -7
  68. data/lib/aia/tools/task_board_tool.rb +16 -16
  69. data/lib/aia/trakflow_bridge.rb +14 -8
  70. data/lib/aia/turn_state.rb +31 -8
  71. data/lib/aia/ui_presenter.rb +16 -0
  72. data/lib/aia/utility.rb +6 -24
  73. data/lib/aia/variable_input_collector.rb +0 -3
  74. data/lib/aia/verification_network.rb +9 -10
  75. data/lib/aia/version.rb +1 -9
  76. data/lib/aia.rb +34 -8
  77. metadata +20 -161
  78. data/.better-commits.json +0 -150
  79. data/.config/tocer/configuration.yml +0 -6
  80. data/.envrc +0 -19
  81. data/.loki +0 -11
  82. data/.reek.yml +0 -160
  83. data/.rubocop.yml +0 -116
  84. data/.rubocop_strict.yml +0 -15
  85. data/.version +0 -1
  86. data/COMMITS.md +0 -196
  87. data/IMPLEMENTATION_PLAN.md +0 -506
  88. data/Rakefile +0 -47
  89. data/_typos.toml +0 -10
  90. data/aia.gemspec +0 -92
  91. data/architecture_review.md +0 -314
  92. data/config/aia.yml +0 -13
  93. data/docs/AGENTS.md +0 -40
  94. data/docs/advanced-prompting.md +0 -814
  95. data/docs/assets/images/aia.png +0 -0
  96. data/docs/cli-reference.md +0 -1241
  97. data/docs/configuration.md +0 -747
  98. data/docs/contributing.md +0 -386
  99. data/docs/directives-reference.md +0 -1145
  100. data/docs/examples/index.md +0 -277
  101. data/docs/examples/mcp/index.md +0 -475
  102. data/docs/examples/prompts/analysis/index.md +0 -78
  103. data/docs/examples/prompts/automation/index.md +0 -109
  104. data/docs/examples/prompts/development/index.md +0 -125
  105. data/docs/examples/prompts/index.md +0 -333
  106. data/docs/examples/prompts/learning/index.md +0 -127
  107. data/docs/examples/prompts/writing/index.md +0 -62
  108. data/docs/examples/tools/index.md +0 -282
  109. data/docs/faq.md +0 -578
  110. data/docs/guides/available-models.md +0 -366
  111. data/docs/guides/basic-usage.md +0 -478
  112. data/docs/guides/chat.md +0 -680
  113. data/docs/guides/crew.md +0 -239
  114. data/docs/guides/executable-prompts.md +0 -331
  115. data/docs/guides/first-prompt.md +0 -454
  116. data/docs/guides/getting-started.md +0 -455
  117. data/docs/guides/image-generation.md +0 -507
  118. data/docs/guides/index.md +0 -48
  119. data/docs/guides/local-models.md +0 -306
  120. data/docs/guides/migrate-prompts.md +0 -335
  121. data/docs/guides/models.md +0 -1017
  122. data/docs/guides/shared-tools.md +0 -254
  123. data/docs/guides/tools.md +0 -831
  124. data/docs/index.md +0 -259
  125. data/docs/installation.md +0 -274
  126. data/docs/mcp-integration.md +0 -603
  127. data/docs/prompt_management.md +0 -665
  128. data/docs/security.md +0 -674
  129. data/docs/special_projects_guide.md +0 -386
  130. data/docs/tools-and-mcp-examples.md +0 -1211
  131. data/docs/workflows-and-pipelines.md +0 -636
  132. data/examples/.gitignore +0 -2
  133. data/examples/00_setup_aia.sh +0 -111
  134. data/examples/01_basic_usage.sh +0 -23
  135. data/examples/02_frontmatter.sh +0 -33
  136. data/examples/03_shell_integration.sh +0 -55
  137. data/examples/04_erb_templating.sh +0 -56
  138. data/examples/05_shell_then_erb.sh +0 -38
  139. data/examples/06_prompt_chaining.sh +0 -59
  140. data/examples/07_pipeline.sh +0 -46
  141. data/examples/08_context_files.sh +0 -43
  142. data/examples/09_roles.sh +0 -67
  143. data/examples/10_stdin_piping.sh +0 -49
  144. data/examples/11_multi_model.sh +0 -65
  145. data/examples/12_token_usage.sh +0 -52
  146. data/examples/13_cost_tracking.sh +0 -68
  147. data/examples/14_output_file.sh +0 -91
  148. data/examples/15_parameters.sh +0 -68
  149. data/examples/16_directives.sh +0 -113
  150. data/examples/17_require_and_conditionals.sh +0 -68
  151. data/examples/18_tools.sh +0 -61
  152. data/examples/19_local_tools.sh +0 -34
  153. data/examples/20_mcp_servers.sh +0 -102
  154. data/examples/21_executable_prompts.sh +0 -78
  155. data/examples/22_chat_mode.sh +0 -217
  156. data/examples/23_verify.sh +0 -139
  157. data/examples/24_decompose.sh +0 -139
  158. data/examples/25_spawn.sh +0 -139
  159. data/examples/26_debate.sh +0 -97
  160. data/examples/27_mention_routing.sh +0 -157
  161. data/examples/28_model_switching.sh +0 -106
  162. data/examples/29_agent_harness.sh +0 -177
  163. data/examples/README.md +0 -321
  164. data/examples/advanced_multi_robot_capabilities_without_examples.md +0 -106
  165. data/examples/aia_config.yml +0 -22
  166. data/examples/aia_config_orchestrator.yml +0 -45
  167. data/examples/aia_config_with_mcp.yml +0 -21
  168. data/examples/common.sh +0 -39
  169. data/examples/context/project_goals.md +0 -6
  170. data/examples/context/tech_stack.md +0 -7
  171. data/examples/directives/timestamp_directive.rb +0 -22
  172. data/examples/mcp/filesystem.json +0 -9
  173. data/examples/prompts_dir/analyze.md +0 -2
  174. data/examples/prompts_dir/brainstorm.md +0 -2
  175. data/examples/prompts_dir/conditional.md +0 -17
  176. data/examples/prompts_dir/creative.md +0 -4
  177. data/examples/prompts_dir/erbinfo.md +0 -5
  178. data/examples/prompts_dir/erbinfo_raw.md +0 -8
  179. data/examples/prompts_dir/evaluate.md +0 -2
  180. data/examples/prompts_dir/explain_joke.md +0 -1
  181. data/examples/prompts_dir/explain_recursion.md +0 -1
  182. data/examples/prompts_dir/fun_fact +0 -3
  183. data/examples/prompts_dir/greeting.md +0 -8
  184. data/examples/prompts_dir/greeting_required.md +0 -7
  185. data/examples/prompts_dir/hello.md +0 -1
  186. data/examples/prompts_dir/includes/ruby_facts.md +0 -4
  187. data/examples/prompts_dir/limerick.md +0 -1
  188. data/examples/prompts_dir/list_with_mcp.md +0 -3
  189. data/examples/prompts_dir/pick_best.md +0 -2
  190. data/examples/prompts_dir/project_summary +0 -12
  191. data/examples/prompts_dir/quiz_with_include.md +0 -6
  192. data/examples/prompts_dir/require_demo.md +0 -5
  193. data/examples/prompts_dir/roles/formal.md +0 -3
  194. data/examples/prompts_dir/roles/orchestrator.md +0 -21
  195. data/examples/prompts_dir/roles/pirate.md +0 -3
  196. data/examples/prompts_dir/shell_then_erb.md +0 -6
  197. data/examples/prompts_dir/sort_compare.md +0 -2
  198. data/examples/prompts_dir/summarize_context.md +0 -2
  199. data/examples/prompts_dir/sysinfo.md +0 -5
  200. data/examples/prompts_dir/sysinfo_raw.md +0 -8
  201. data/examples/prompts_dir/tagline.md +0 -1
  202. data/examples/prompts_dir/tell_joke.md +0 -1
  203. data/examples/prompts_dir/tell_joke_with_next.md +0 -4
  204. data/examples/prompts_dir/use_local_tool.md +0 -8
  205. data/examples/prompts_dir/use_tools.md +0 -8
  206. data/examples/prompts_dir/weather.md +0 -2
  207. data/examples/prompts_dir/whats_new.md +0 -2
  208. data/examples/prompts_dir/with_timestamp.md +0 -5
  209. data/examples/requirements/sinatra_taskflow_app.md +0 -139
  210. data/examples/rules/01_classify_ruby.rb +0 -16
  211. data/examples/rules/02_prefer_claude_for_code.rb +0 -19
  212. data/examples/rules/03_gate_prompt_length.rb +0 -19
  213. data/examples/rules/04_tool_selection.rb +0 -41
  214. data/examples/rules/README.md +0 -30
  215. data/examples/run_all.sh +0 -294
  216. data/examples/tools/word_count_tool.rb +0 -30
  217. data/lib/AGENTS.md +0 -57
  218. data/lib/aia/model_switch_handler.rb +0 -100
  219. data/mcp_servers/README.md +0 -110
  220. data/mcp_servers/apple-mcp.json +0 -8
  221. data/mcp_servers/filesystem.json +0 -9
  222. data/mcp_servers/mcp_server_chart.json +0 -11
  223. data/mcp_servers/playwright_one.json +0 -8
  224. data/mcp_servers/playwright_server_definition.json +0 -9
  225. data/mcp_servers/playwright_two.json +0 -8
  226. data/mcp_servers/tavily_mcp_server.json +0 -8
  227. data/mkdocs.yml +0 -169
data/.reek.yml DELETED
@@ -1,160 +0,0 @@
1
- ---
2
- detectors:
3
-
4
- # Disabled: conflicts with project no-comment coding style.
5
- IrresponsibleModule:
6
- enabled: false
7
-
8
- # Disabled: private helpers that don't reference self are fine where they are.
9
- UtilityFunction:
10
- enabled: false
11
-
12
- # Disabled: respond_to? duck-typing is intentional in this codebase.
13
- ManualDispatch:
14
- enabled: false
15
-
16
- # Disabled: attr_accessor is standard Ruby; public attributes are a design choice.
17
- Attribute:
18
- enabled: false
19
-
20
- # Disabled: bang methods without non-bang counterparts are common in internal APIs.
21
- MissingSafeMethod:
22
- enabled: false
23
-
24
- # Disabled: explicit nil checks are idiomatic Ruby (nil? / unless nil, etc.).
25
- NilCheck:
26
- enabled: false
27
-
28
- # Disabled: handler/directive protocol methods must accept the full interface
29
- # signature even when individual implementations don't use every parameter.
30
- UnusedParameters:
31
- enabled: false
32
-
33
- # Disabled: same trade-off as UtilityFunction above — private formatting and
34
- # extraction helpers deliberately operate on a passed-in value (result, tool,
35
- # robot_result, raw metrics hash) next to their single caller; most of those
36
- # values are Hashes or third-party objects we can't (and shouldn't) add
37
- # methods to.
38
- FeatureEnvy:
39
- enabled: false
40
-
41
- # Disabled: the detector fires on the codebase's configuration-cascade style —
42
- # `arg || default` dependency-injection fallbacks in constructors and CLI
43
- # override-precedence checks (e.g. LoggerManager#effective_log_file). Those
44
- # conditionals ARE the method's purpose, not hidden polymorphism.
45
- ControlParameter:
46
- enabled: false
47
-
48
- # Disabled: guard-clause style (see disabled IfUnlessModifier in rubocop) —
49
- # cheap predicates like `available?`, `tracking`, `show_cost` guard each
50
- # public method independently. Extracting a null-object/state machine for a
51
- # CLI would be over-engineering; every flagged condition was a guard.
52
- RepeatedConditional:
53
- enabled: false
54
-
55
- # Disabled: the detector doesn't follow initialize's delegation to reset
56
- # helpers (Session#initialize_components, TurnState#clear!,
57
- # ContextDirectives#reset!, Fzf#build_command) and flags `||=` memoization
58
- # and class-level singleton caches. All 21 flagged ivars were audited
59
- # (2026-09): every one is assigned before first read; zero nil-read risks.
60
- InstanceVariableAssumption:
61
- enabled: false
62
-
63
- # 2-deep iteration (rendering a collection of collections, grouped output)
64
- # is idiomatic Ruby; 30 of the 31 flagged sites were simple 2-deep
65
- # each/map display or grouping loops.
66
- NestedIterators:
67
- max_allowed_nesting: 2
68
-
69
- # Default is 1 — fires whenever a method is called even twice. Raise to 2.
70
- DuplicateMethodCall:
71
- max_calls: 2
72
-
73
- # Default is 5; was 8. Raised to 12 with data (2026-09): 84 of the 166
74
- # flagged methods sat at 9-12 statements — linear OptionParser registrations
75
- # (CLIParser#setup_*), sequential display/formatting output, and step-wise
76
- # orchestration with no added branching. Real complexity stays bounded by
77
- # flog (warn >=20 / fail >=50) and rubocop Metrics (MethodLength 35, AbcSize
78
- # 40). Methods above 12 are fixed or justified per site, not by threshold.
79
- TooManyStatements:
80
- max_statements: 12
81
-
82
- # Default is 3 — extreme for this codebase.
83
- LongParameterList:
84
- max_params: 5
85
- overrides:
86
- initialize:
87
- max_params: 7
88
-
89
- # Default is 15; several AIA coordinator/handler classes legitimately exceed this.
90
- TooManyMethods:
91
- max_methods: 20
92
-
93
- # Default is 4 — far too low for config and session classes with many fields.
94
- TooManyInstanceVariables:
95
- max_instance_variables: 8
96
-
97
- # Default is 5; some modules carry more constants by design.
98
- TooManyConstants:
99
- max_constants: 8
100
-
101
- # Raise min_clump_size so only truly repeated parameter groups are flagged.
102
- DataClump:
103
- max_copies: 2
104
- min_clump_size: 3
105
-
106
- # Accept standard Ruby short-name conventions for limited-scope variables.
107
- UncommunicativeVariableName:
108
- accept:
109
- - _ # intentionally ignored
110
- - a # array / argument
111
- - b # body / block
112
- - c # char / count / config
113
- - d # data / dir
114
- - e # rescue => e
115
- - f # file / format / flag
116
- - h # hash
117
- - i # index
118
- - k # key
119
- - l # line / list
120
- - m # match / message
121
- - n # number / name
122
- - p # path / param
123
- - q # query
124
- - r # result / response
125
- - s # string / source
126
- - t # time / token / type
127
- - v # value
128
- - w # word / width
129
-
130
- UncommunicativeParameterName:
131
- accept:
132
- - a # vector math pairs (cosine_similarity(a, b))
133
- - e
134
- - i
135
- - f
136
- - k
137
- - v
138
- - t
139
- - r
140
- - s
141
- - m
142
- - n
143
- - q
144
- - b
145
-
146
- directories:
147
- # plugins/ — standalone LLM tool wrappers; execute() keyword arg lists map
148
- # directly to LLM-visible parameters and are intentionally wide.
149
- "plugins":
150
- LongParameterList:
151
- max_params: 20
152
- TooManyMethods:
153
- max_methods: 25
154
-
155
- exclude_paths:
156
- - test
157
- - examples
158
- - docs
159
- - coverage
160
- - pkg
data/.rubocop.yml DELETED
@@ -1,116 +0,0 @@
1
- inherit_from:
2
- - .rubocop_todo.yml
3
- - ../.rubocop-base.yml
4
- - .rubocop_strict.yml
5
-
6
- inherit_mode:
7
- merge:
8
- - Exclude
9
-
10
- AllCops:
11
- Exclude:
12
- - 'examples/**/*'
13
- - 'site/**/*'
14
- - 'notes/**/*'
15
- - 'docs/**/*'
16
- - 'coverage/**/*'
17
- - 'pkg/**/*'
18
- - 'orchestrated_build_*/**/*'
19
- - 'rubyllm_with_schema_test.rb'
20
- - 'with_schema_test.rb'
21
-
22
- # ── Gemspec: dev deps in gemspec for publisher convenience ───────────────────
23
- Gemspec/DevelopmentDependencies:
24
- EnforcedStyle: gemspec
25
- Exclude:
26
- - 'Gemfile'
27
- - 'Gemfile.local'
28
-
29
- # ── Style: intentional lib patterns ─────────────────────────────────────────
30
- # extend self used in skill_utils.rb so methods are public when included
31
- Style/ModuleFunction:
32
- Exclude:
33
- - 'lib/aia/skill_utils.rb'
34
-
35
- # $DEBUG_ME is an intentional global for CLI debug toggle
36
- Style/GlobalVars:
37
- Exclude:
38
- - 'lib/aia.rb'
39
- - 'lib/aia/config/cli_parser.rb'
40
-
41
- # %{key} Ruby format tokens are intentional for LLM prompt template interpolation
42
- Style/FormatStringToken:
43
- Enabled: false
44
-
45
- # Safe navigation chains > 2 are intentional in this codebase
46
- Style/SafeNavigationChainLength:
47
- Enabled: false
48
-
49
- # Duplicate branch bodies are intentional in several dispatch patterns
50
- Lint/DuplicateBranch:
51
- Enabled: false
52
-
53
- # ── Test files: relax cops that fire on intentional test patterns ─────────────
54
- Style/OpenStructUse:
55
- Exclude:
56
- - 'test/**/*'
57
-
58
- Lint/MissingSuper:
59
- Exclude:
60
- - 'test/**/*'
61
-
62
- Lint/FloatComparison:
63
- Exclude:
64
- - 'test/**/*'
65
-
66
- Style/MixinUsage:
67
- Exclude:
68
- - 'test/test_helper.rb'
69
-
70
- Style/OptionalBooleanParameter:
71
- Exclude:
72
- - 'test/test_helper.rb'
73
-
74
- Naming/VariableNumber:
75
- Exclude:
76
- - 'test/**/*'
77
-
78
- Lint/ConstantDefinitionInBlock:
79
- Exclude:
80
- - 'Rakefile'
81
- - 'test/**/*'
82
-
83
- Metrics/AbcSize:
84
- Max: 40
85
- Exclude:
86
- - 'test/**/*'
87
-
88
- Metrics/MethodLength:
89
- Max: 35
90
- CountAsOne:
91
- - heredoc
92
- - array
93
- - hash
94
- Exclude:
95
- - 'test/**/*'
96
-
97
- Metrics/BlockLength:
98
- Exclude:
99
- - 'Rakefile'
100
- - '*.gemspec'
101
- - 'test/**/*'
102
-
103
- Metrics/CyclomaticComplexity:
104
- Max: 20
105
- Exclude:
106
- - 'test/**/*'
107
-
108
- Metrics/PerceivedComplexity:
109
- Max: 20
110
- Exclude:
111
- - 'test/**/*'
112
-
113
- Metrics/ModuleLength:
114
- Max: 200
115
- Exclude:
116
- - 'test/**/*'
data/.rubocop_strict.yml DELETED
@@ -1,15 +0,0 @@
1
- # Cops that must always fire, regardless of .rubocop_todo.yml or inline directives.
2
- # Listed LAST in inherit_from to override any Exclude entries from todo files.
3
-
4
- Lint/Debugger:
5
- Enabled: true
6
- Exclude: []
7
-
8
- Security/Eval:
9
- Enabled: true
10
- Exclude: []
11
-
12
- Lint/SuppressedException:
13
- Enabled: true
14
- Exclude: []
15
-
data/.version DELETED
@@ -1 +0,0 @@
1
- 2.0.0.0-beta2
data/COMMITS.md DELETED
@@ -1,196 +0,0 @@
1
- ---
2
- url: https://www.conventionalcommits.org/en/v1.0.0/
3
- title: Conventional Commits
4
- description: A specification for adding human and machine readable meaning to commit messages
5
- access_date: 2025-07-31T20:51:29.000Z
6
- current_date: 2025-07-31T20:51:29.601Z
7
- ---
8
-
9
- # Conventional Commits
10
-
11
- A specification for adding human and machine readable meaning to commit messages
12
-
13
- Quick Summary Full Specification Contribute
14
-
15
- # Conventional Commits 1.0.0
16
-
17
- ## Summary
18
-
19
- The Conventional Commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of. This convention dovetails with SemVer, by describing the features, fixes, and breaking changes made in commit messages.
20
-
21
- The commit message should be structured as follows:
22
-
23
- ---
24
-
25
- ```
26
- <type>[optional scope]: <description>
27
-
28
- [optional body]
29
-
30
- [optional footer(s)]
31
-
32
- ```
33
-
34
- ---
35
-
36
- The commit contains the following structural elements, to communicate intent to the consumers of your library:
37
-
38
- 1. **fix:** a commit of the _type_ `fix` patches a bug in your codebase (this correlates with `PATCH` in Semantic Versioning).
39
- 2. **feat:** a commit of the _type_ `feat` introduces a new feature to the codebase (this correlates with `MINOR` in Semantic Versioning).
40
- 3. **BREAKING CHANGE:** a commit that has a footer `BREAKING CHANGE:`, or appends a `!` after the type/scope, introduces a breaking API change (correlating with `MAJOR` in Semantic Versioning). A BREAKING CHANGE can be part of commits of any _type_.
41
- 4. _types_ other than `fix:` and `feat:` are allowed, for example @commitlint/config-conventional (based on the Angular convention) recommends `build:`, `chore:`,`ci:`, `docs:`, `style:`, `refactor:`, `perf:`, `test:`, and others.
42
- 5. _footers_ other than `BREAKING CHANGE: <description>` may be provided and follow a convention similar to git trailer format.
43
-
44
- Additional types are not mandated by the Conventional Commits specification, and have no implicit effect in Semantic Versioning (unless they include a BREAKING CHANGE). A scope may be provided to a commit’s type, to provide additional contextual information and is contained within parenthesis, e.g., `feat(parser): add ability to parse arrays`.
45
-
46
- ## Examples
47
-
48
- ### Commit message with description and breaking change footer
49
-
50
- ```
51
- feat: allow provided config object to extend other configs
52
-
53
- BREAKING CHANGE: `extends` key in config file is now used for extending other config files
54
-
55
- ```
56
-
57
- ### Commit message with `!` to draw attention to breaking change
58
-
59
- ```
60
- feat!: send an email to the customer when a product is shipped
61
-
62
- ```
63
-
64
- ### Commit message with scope and `!` to draw attention to breaking change
65
-
66
- ```
67
- feat(api)!: send an email to the customer when a product is shipped
68
-
69
- ```
70
-
71
- ### Commit message with both `!` and BREAKING CHANGE footer
72
-
73
- ```
74
- chore!: drop support for Node 6
75
-
76
- BREAKING CHANGE: use JavaScript features not available in Node 6.
77
-
78
- ```
79
-
80
- ### Commit message with no body
81
-
82
- ```
83
- docs: correct spelling of CHANGELOG
84
-
85
- ```
86
-
87
- ### Commit message with scope
88
-
89
- ```
90
- feat(lang): add Polish language
91
-
92
- ```
93
-
94
- ### Commit message with multi-paragraph body and multiple footers
95
-
96
- ```
97
- fix: prevent racing of requests
98
-
99
- Introduce a request id and a reference to latest request. Dismiss
100
- incoming responses other than from latest request.
101
-
102
- Remove timeouts which were used to mitigate the racing issue but are
103
- obsolete now.
104
-
105
- Reviewed-by: Z
106
- Refs: #123
107
-
108
- ```
109
-
110
- ## Specification
111
-
112
- The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
113
-
114
- 1. Commits MUST be prefixed with a type, which consists of a noun, `feat`, `fix`, etc., followed by the OPTIONAL scope, OPTIONAL `!`, and REQUIRED terminal colon and space.
115
- 2. The type `feat` MUST be used when a commit adds a new feature to your application or library.
116
- 3. The type `fix` MUST be used when a commit represents a bug fix for your application.
117
- 4. A scope MAY be provided after a type. A scope MUST consist of a noun describing a section of the codebase surrounded by parenthesis, e.g., `fix(parser):`
118
- 5. A description MUST immediately follow the colon and space after the type/scope prefix. The description is a short summary of the code changes, e.g., _fix: array parsing issue when multiple spaces were contained in string_.
119
- 6. A longer commit body MAY be provided after the short description, providing additional contextual information about the code changes. The body MUST begin one blank line after the description.
120
- 7. A commit body is free-form and MAY consist of any number of newline separated paragraphs.
121
- 8. One or more footers MAY be provided one blank line after the body. Each footer MUST consist of a word token, followed by either a `:<space>` or `<space>#` separator, followed by a string value (this is inspired by the git trailer convention).
122
- 9. A footer’s token MUST use `-` in place of whitespace characters, e.g., `Acked-by` (this helps differentiate the footer section from a multi-paragraph body). An exception is made for `BREAKING CHANGE`, which MAY also be used as a token.
123
- 10. A footer’s value MAY contain spaces and newlines, and parsing MUST terminate when the next valid footer token/separator pair is observed.
124
- 11. Breaking changes MUST be indicated in the type/scope prefix of a commit, or as an entry in the footer.
125
- 12. If included as a footer, a breaking change MUST consist of the uppercase text BREAKING CHANGE, followed by a colon, space, and description, e.g.,_BREAKING CHANGE: environment variables now take precedence over config files_.
126
- 13. If included in the type/scope prefix, breaking changes MUST be indicated by a`!` immediately before the `:`. If `!` is used, `BREAKING CHANGE:` MAY be omitted from the footer section, and the commit description SHALL be used to describe the breaking change.
127
- 14. Types other than `feat` and `fix` MAY be used in your commit messages, e.g., _docs: update ref docs._
128
- 15. The units of information that make up Conventional Commits MUST NOT be treated as case sensitive by implementors, with the exception of BREAKING CHANGE which MUST be uppercase.
129
- 16. BREAKING-CHANGE MUST be synonymous with BREAKING CHANGE, when used as a token in a footer.
130
-
131
- ## Why Use Conventional Commits
132
-
133
- * Automatically generating CHANGELOGs.
134
- * Automatically determining a semantic version bump (based on the types of commits landed).
135
- * Communicating the nature of changes to teammates, the public, and other stakeholders.
136
- * Triggering build and publish processes.
137
- * Making it easier for people to contribute to your projects, by allowing them to explore a more structured commit history.
138
-
139
- ## FAQ
140
-
141
- ### How should I deal with commit messages in the initial development phase?
142
-
143
- We recommend that you proceed as if you’ve already released the product. Typically _somebody_, even if it’s your fellow software developers, is using your software. They’ll want to know what’s fixed, what breaks etc.
144
-
145
- ### Are the types in the commit title uppercase or lowercase?
146
-
147
- Any casing may be used, but it’s best to be consistent.
148
-
149
- ### What do I do if the commit conforms to more than one of the commit types?
150
-
151
- Go back and make multiple commits whenever possible. Part of the benefit of Conventional Commits is its ability to drive us to make more organized commits and PRs.
152
-
153
- ### Doesn’t this discourage rapid development and fast iteration?
154
-
155
- It discourages moving fast in a disorganized way. It helps you be able to move fast long term across multiple projects with varied contributors.
156
-
157
- ### Might Conventional Commits lead developers to limit the type of commits they make because they’ll be thinking in the types provided?
158
-
159
- Conventional Commits encourages us to make more of certain types of commits such as fixes. Other than that, the flexibility of Conventional Commits allows your team to come up with their own types and change those types over time.
160
-
161
- ### How does this relate to SemVer?
162
-
163
- `fix` type commits should be translated to `PATCH` releases. `feat` type commits should be translated to `MINOR` releases. Commits with `BREAKING CHANGE` in the commits, regardless of type, should be translated to `MAJOR` releases.
164
-
165
- ### How should I version my extensions to the Conventional Commits Specification, e.g. `@jameswomack/conventional-commit-spec`?
166
-
167
- We recommend using SemVer to release your own extensions to this specification (and encourage you to make these extensions!)
168
-
169
- ### What do I do if I accidentally use the wrong commit type?
170
-
171
- #### When you used a type that’s of the spec but not the correct type, e.g. `fix` instead of `feat`
172
-
173
- Prior to merging or releasing the mistake, we recommend using `git rebase -i` to edit the commit history. After release, the cleanup will be different according to what tools and processes you use.
174
-
175
- #### When you used a type _not_ of the spec, e.g. `feet` instead of `feat`
176
-
177
- In a worst case scenario, it’s not the end of the world if a commit lands that does not meet the Conventional Commits specification. It simply means that commit will be missed by tools that are based on the spec.
178
-
179
- ### Do all my contributors need to use the Conventional Commits specification?
180
-
181
- No! If you use a squash based workflow on Git lead maintainers can clean up the commit messages as they’re merged—adding no workload to casual committers. A common workflow for this is to have your git system automatically squash commits from a pull request and present a form for the lead maintainer to enter the proper git commit message for the merge.
182
-
183
- ### How does Conventional Commits handle revert commits?
184
-
185
- Reverting code can be complicated: are you reverting multiple commits? if you revert a feature, should the next release instead be a patch?
186
-
187
- Conventional Commits does not make an explicit effort to define revert behavior. Instead we leave it to tooling authors to use the flexibility of _types_ and _footers_ to develop their logic for handling reverts.
188
-
189
- One recommendation is to use the `revert` type, and a footer that references the commit SHAs that are being reverted:
190
-
191
- ```
192
- revert: let us never again speak of the noodle incident
193
-
194
- Refs: 676104e, a215868
195
-
196
- ```