way_of_working 2.0.1 → 2.2.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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +41 -1
  3. data/CLAUDE.md +48 -0
  4. data/CODE_OF_CONDUCT.md +55 -104
  5. data/CONTRIBUTING.md +62 -0
  6. data/README.md +240 -23
  7. data/exe/way_of_working +6 -1
  8. data/lib/way_of_working/audit/github/auditor.rb +47 -0
  9. data/lib/way_of_working/audit/github/generators/exec.rb +214 -0
  10. data/lib/way_of_working/audit/github/rules/base.rb +116 -0
  11. data/lib/way_of_working/audit/github/rules/registry.rb +44 -0
  12. data/lib/way_of_working/audit/github/rules/unknown.rb +19 -0
  13. data/lib/way_of_working/audit/github.rb +25 -0
  14. data/lib/way_of_working/changelog/keepachangelog/generators/init.rb +118 -0
  15. data/lib/way_of_working/changelog/keepachangelog/github_audit_rule.rb +32 -0
  16. data/lib/way_of_working/changelog/keepachangelog/templates/docs/way_of_working/changelog.md +73 -0
  17. data/lib/way_of_working/changelog/keepachangelog.rb +31 -0
  18. data/lib/way_of_working/cli.rb +13 -0
  19. data/lib/way_of_working/code_of_conduct/contributor_covenant/generators/init.rb +69 -0
  20. data/lib/way_of_working/code_of_conduct/contributor_covenant/github_audit_rule.rb +33 -0
  21. data/lib/way_of_working/code_of_conduct/contributor_covenant/templates/CODE_OF_CONDUCT.md.tt +83 -0
  22. data/lib/way_of_working/code_of_conduct/contributor_covenant/templates/docs/way_of_working/code-of-conduct.md +79 -0
  23. data/lib/way_of_working/code_of_conduct/contributor_covenant.rb +32 -0
  24. data/lib/way_of_working/completion.rb +60 -0
  25. data/lib/way_of_working/config.rb +45 -0
  26. data/lib/way_of_working/decision_record/madr/generators/init.rb +41 -0
  27. data/lib/way_of_working/decision_record/madr/generators/new.rb +69 -0
  28. data/lib/way_of_working/decision_record/madr/github_audit_rule.rb +37 -0
  29. data/lib/way_of_working/decision_record/madr/templates/.github/ISSUE_TEMPLATE/decision-record.md +26 -0
  30. data/lib/way_of_working/decision_record/madr/templates/docs/decisions/0000-use-markdown-any-decision-records.md +30 -0
  31. data/lib/way_of_working/decision_record/madr/templates/docs/decisions/README.md +7 -0
  32. data/lib/way_of_working/decision_record/madr/templates/docs/decisions/adr-template.md.tt +82 -0
  33. data/lib/way_of_working/decision_record/madr/templates/docs/decisions/index.md +48 -0
  34. data/lib/way_of_working/decision_record/madr/templates/docs/way_of_working/decision-records.md +195 -0
  35. data/lib/way_of_working/decision_record/madr.rb +49 -0
  36. data/lib/way_of_working/git/repo_reader.rb +2 -2
  37. data/lib/way_of_working/inclusive_language/alex/generators/exec.rb +51 -0
  38. data/lib/way_of_working/inclusive_language/alex/generators/init.rb +59 -0
  39. data/lib/way_of_working/inclusive_language/alex/github_audit_rule.rb +42 -0
  40. data/lib/way_of_working/inclusive_language/alex/templates/.alexignore +2 -0
  41. data/lib/way_of_working/inclusive_language/alex/templates/.alexrc +3 -0
  42. data/lib/way_of_working/inclusive_language/alex/templates/.github/workflows/inclusive-language.yml +16 -0
  43. data/lib/way_of_working/inclusive_language/alex/templates/docs/way_of_working/inclusive-language.md +28 -0
  44. data/lib/way_of_working/inclusive_language/alex.rb +46 -0
  45. data/lib/way_of_working/pull_request_template/hdi/generators/init.rb +26 -0
  46. data/lib/way_of_working/pull_request_template/hdi/github_audit_rule.rb +32 -0
  47. data/lib/way_of_working/pull_request_template/hdi/templates/.github/pull_request_template.md +51 -0
  48. data/lib/way_of_working/pull_request_template/hdi/templates/docs/way_of_working/pull-request-template-and-guidelines.md +50 -0
  49. data/lib/way_of_working/pull_request_template/hdi.rb +31 -0
  50. data/lib/way_of_working/readme_badge/generators/init.rb +11 -1
  51. data/lib/way_of_working/readme_badge/paths.rb +5 -2
  52. data/lib/way_of_working/readme_badge.rb +2 -6
  53. data/lib/way_of_working/sub_commands/base.rb +12 -0
  54. data/lib/way_of_working/sub_commands/config.rb +25 -0
  55. data/lib/way_of_working/sub_commands/init.rb +1 -1
  56. data/lib/way_of_working/version.rb +1 -1
  57. data/lib/way_of_working/versioning/semver/generators/init.rb +20 -0
  58. data/lib/way_of_working/versioning/semver/github_audit_rule.rb +38 -0
  59. data/lib/way_of_working/versioning/semver/templates/docs/way_of_working/versioning.md +71 -0
  60. data/lib/way_of_working/versioning/semver.rb +31 -0
  61. data/lib/way_of_working.rb +22 -0
  62. data/way_of_working.gemspec +5 -1
  63. metadata +108 -9
@@ -0,0 +1,79 @@
1
+ ---
2
+ layout: page
3
+ status: REQUIRED
4
+ enforcement: manual
5
+ ---
6
+ # Code of Conduct
7
+
8
+ ## Purpose
9
+
10
+ We adopt the [Contributor Covenant v3][covenant] to establish clear behavioural expectations, create safe inclusive environments, prevent discrimination/harassment, and reduce conflicts.
11
+
12
+ {: .important }
13
+ Adoption requires more than adding `CODE_OF_CONDUCT.md`. Please read the [Addressing and Repairing Harm][enforcement] section and discuss with your team.
14
+
15
+ ## Scope
16
+
17
+ Applies to all project spaces and community interactions.
18
+
19
+ **Promotes:** Respectful communication, collaboration, inclusive language, professional conduct, repairing harm
20
+
21
+ **Prevents:** Harassment, character attacks, stereotyping/discrimination, sexualization, violating confidentiality, endangerment
22
+
23
+ ## Requirements
24
+
25
+ 1. Contact method for reports (email address)
26
+ 2. Community Moderators responsible for investigation and enforcement
27
+ 3. Enforcement ladder (consequences and repair)
28
+
29
+ {: .note }
30
+ Use HDI Code of Conduct email address as contact method.
31
+
32
+ ## Setup
33
+
34
+ ```bash
35
+ way_of_working init code_of_conduct --contact-method [CONTACT METHOD]
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ Command creates `CODE_OF_CONDUCT.md` in repository root.
41
+
42
+ **Post-setup:**
43
+
44
+ 1. Review the enforcement ladder with team (edit it if your community has its own established process)
45
+ 2. Assign Community Moderators
46
+ 3. Communicate adoption to contributors
47
+ 4. Link from README and CONTRIBUTING
48
+
49
+ **Enforcement process:**
50
+ Report → Investigate → Apply consequence → Repair → Document
51
+
52
+ ## Enforcement
53
+
54
+ **Enforcement ladder:**
55
+
56
+ - **Warning:** Single incident or series of incidents
57
+ - **Temporarily limited activities:** Repeated violation after a warning, or a more serious first violation
58
+ - **Temporary suspension:** Pattern of repeated violation, or a single serious violation
59
+ - **Permanent ban:** Violations other steps have failed to resolve, or too serious to keep the community safe
60
+
61
+ **Requirements:**
62
+
63
+ - Consistent enforcement by Community Moderators
64
+ - Confidential handling, 5-day response
65
+ - Document incidents, annual review
66
+
67
+ ## Examples
68
+
69
+ **Encouraged:** Respecting community purpose, engaging kindly and honestly, respecting different viewpoints, taking responsibility, constructive feedback, repairing harm
70
+
71
+ **Restricted:** Harassment, character attacks, stereotyping or discrimination, sexualization, violating confidentiality, endangerment, misleading identity, failing to credit sources
72
+
73
+ ## Resources
74
+
75
+ - [Contributor Covenant v3][covenant]
76
+ - [Addressing and Repairing Harm][enforcement]
77
+
78
+ [covenant]: https://www.contributor-covenant.org/version/3/0/code_of_conduct/
79
+ [enforcement]: https://www.contributor-covenant.org/version/3/0/code_of_conduct/#addressing-and-repairing-harm
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'contributor_covenant/generators/init'
4
+
5
+ # Register the GitHub audit rule (the registry is bundled with this gem)
6
+ require_relative 'contributor_covenant/github_audit_rule'
7
+
8
+ module WayOfWorking
9
+ module CodeOfConduct
10
+ module ContributorCovenant
11
+ class Error < StandardError; end
12
+ end
13
+ end
14
+
15
+ module SubCommands
16
+ # This reopens the "way_of_working init" sub command
17
+ class Init
18
+ register(CodeOfConduct::ContributorCovenant::Generators::Init, 'code_of_conduct',
19
+ 'code_of_conduct --contact-method [CONTACT METHOD]',
20
+ <<~LONGDESC)
21
+ Description:
22
+ This adds the Contributor Covenant v3 code of conduct to the project
23
+
24
+ Example:
25
+ way_of_working init code_of_conduct --contact-method "foo@bar.com"
26
+
27
+ This will create:
28
+ CODE_OF_CONDUCT.md
29
+ LONGDESC
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WayOfWorking
4
+ # Shell completion. The shell scripts are thin: on every Tab they call
5
+ # `way_of_working __complete <words>`, which walks the live Thor command tree,
6
+ # so commands from plugins and opt-in features always show up.
7
+ module Completion
8
+ SCRIPTS = {
9
+ 'bash' => <<~'BASH',
10
+ _way_of_working() {
11
+ local IFS=$'\n'
12
+ COMPREPLY=($(way_of_working __complete "${COMP_WORDS[@]:1:COMP_CWORD}" 2>/dev/null))
13
+ }
14
+ complete -F _way_of_working way_of_working
15
+ BASH
16
+ 'zsh' => <<~ZSH
17
+ _way_of_working() {
18
+ local -a candidates
19
+ candidates=(${(f)"$(way_of_working __complete "${(@)words[2,CURRENT]}" 2>/dev/null)"})
20
+ compadd -a candidates
21
+ }
22
+ compdef _way_of_working way_of_working
23
+ ZSH
24
+ }.freeze
25
+
26
+ def self.script(shell)
27
+ SCRIPTS.fetch(shell) { raise Thor::Error, "Unsupported shell #{shell.inspect}, use bash or zsh" }
28
+ end
29
+
30
+ # words: everything typed after `way_of_working`, the last being the word being completed.
31
+ # ponytail: completes command names and option switches only, not option values.
32
+ def self.candidates(words)
33
+ *typed, current = words
34
+ klass, command = resolve(typed)
35
+ return [] unless klass
36
+
37
+ names = if command
38
+ command.options.values.flat_map { |option| [option.switch_name, *option.aliases] }
39
+ else
40
+ klass.all_commands.reject { |_name, cmd| cmd.hidden? }.keys
41
+ end
42
+ names.select { |name| name.start_with?(current.to_s) }.sort
43
+ end
44
+
45
+ # Walks the typed words down the Thor tree to the innermost class and, once one
46
+ # is typed, its command. Returns nil for an unknown word.
47
+ def self.resolve(typed)
48
+ klass = Cli
49
+ typed.reject { |word| word.start_with?('-') }.each do |word|
50
+ unless klass.subcommand_classes.key?(word)
51
+ command = klass.all_commands[word]
52
+ return command && [klass, command]
53
+ end
54
+
55
+ klass = klass.subcommand_classes[word]
56
+ end
57
+ [klass, nil]
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'yaml'
4
+ require 'pathname'
5
+
6
+ module WayOfWorking
7
+ # Reads and writes ~/.config/way_of_working/config.yaml (or
8
+ # $XDG_CONFIG_HOME/way_of_working/config.yaml), so values like a code of
9
+ # conduct contact method can be set once and reused across CLI invocations
10
+ # instead of being passed as an option every time. Keys are dotted paths
11
+ # namespaced by feature (e.g. "code_of_conduct.contact_method") so future
12
+ # features (e.g. a security contact) can coexist.
13
+ module Config
14
+ class << self
15
+ def path
16
+ Pathname.new(ENV.fetch('XDG_CONFIG_HOME', File.join(Dir.home, '.config'))).
17
+ join('way_of_working', 'config.yaml')
18
+ end
19
+
20
+ def get(dotted_key)
21
+ dotted_key.to_s.split('.').reduce(load_file) { |node, key| node.is_a?(Hash) ? node[key] : nil }
22
+ end
23
+
24
+ def set(dotted_key, value)
25
+ keys = dotted_key.to_s.split('.')
26
+ data = load_file
27
+ keys[0..-2].reduce(data) { |node, key| node[key] ||= {} }[keys[-1]] = value
28
+ save_file(data)
29
+ end
30
+
31
+ private
32
+
33
+ def load_file
34
+ return {} unless path.exist?
35
+
36
+ YAML.safe_load_file(path) || {}
37
+ end
38
+
39
+ def save_file(data)
40
+ path.dirname.mkpath
41
+ path.write(YAML.dump(data))
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WayOfWorking
4
+ module DecisionRecord
5
+ module Madr
6
+ module Generators
7
+ # This generator add the MADR files to the doc/decisions folder
8
+ class Init < Thor::Group
9
+ include Thor::Actions
10
+
11
+ source_root WayOfWorking.root.join('lib', 'way_of_working', 'decision_record', 'madr', 'templates')
12
+
13
+ def copy_decision_record_issue_template
14
+ copy_file '.github/ISSUE_TEMPLATE/decision-record.md'
15
+ end
16
+
17
+ # Templates are from https://github.com/adr/madr/tree/3.0.0/template
18
+ def create_decision_record_files
19
+ copy_file 'docs/decisions/README.md'
20
+
21
+ # from https://raw.githubusercontent.com/adr/madr/3.0.0/template/adr-template.md
22
+ @decision_date = '{YYYY-MM-DD when the decision was last updated}'
23
+ @index = '{index}'
24
+ @title = '{short title of solved problem and solution}'
25
+ template 'docs/decisions/adr-template.md'
26
+
27
+ copy_file 'docs/decisions/0000-use-markdown-any-decision-records.md'
28
+ end
29
+
30
+ def copy_index_file
31
+ copy_file 'docs/decisions/index.md'
32
+ end
33
+
34
+ def copy_way_of_working_file
35
+ copy_file 'docs/way_of_working/decision-records.md'
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'date'
4
+
5
+ module WayOfWorking
6
+ module DecisionRecord
7
+ module Madr
8
+ module Generators
9
+ # This generator add a new MADR decision record to the doc/decisions folder
10
+ class New < Thor::Group
11
+ argument :name, type: :string, required: true, desc: 'The title of the decision record'
12
+
13
+ include Thor::Actions
14
+
15
+ source_root WayOfWorking.root.join('lib', 'way_of_working', 'decision_record', 'madr', 'templates')
16
+
17
+ def create_decision_record_file
18
+ case behavior
19
+ when :invoke
20
+ invoke_decision_record_file
21
+ when :revoke
22
+ revoke_decision_record_file
23
+ end
24
+ end
25
+
26
+ private
27
+
28
+ def invoke_decision_record_file
29
+ @decision_date = Date.today.strftime('%Y-%m-%d')
30
+ @index = next_decision_number.to_i
31
+ @title = name
32
+
33
+ # from https://raw.githubusercontent.com/adr/madr/3.0.0/template/adr-template.md
34
+ template 'docs/decisions/adr-template.md',
35
+ "docs/decisions/#{next_decision_number}-#{dashed_name}.md"
36
+ end
37
+
38
+ def revoke_decision_record_file
39
+ matching_files = Dir.glob("[0-9][0-9][0-9][0-9]-#{dashed_name}.md",
40
+ base: File.join(destination_root, 'docs/decisions'))
41
+ raise "No matching decision record for '#{dashed_name}'" if matching_files.empty?
42
+
43
+ # based on Thor's remove_file
44
+ path = File.expand_path("docs/decisions/#{matching_files.first}", destination_root)
45
+
46
+ say_status :remove, relative_to_original_destination_root(path)
47
+ return unless !options[:pretend] && (File.exist?(path) || File.symlink?(path))
48
+
49
+ require 'fileutils'
50
+ ::FileUtils.rm_rf(path)
51
+ end
52
+
53
+ def next_decision_number
54
+ existing_decisions = Dir.glob('[0-9][0-9][0-9][0-9]-*.md',
55
+ base: File.join(destination_root, 'docs/decisions'))
56
+ last_number = existing_decisions.map do |filename|
57
+ filename.match(/\A(\d{4})-/)[1].to_i
58
+ end.max || -1
59
+ format('%04d', last_number + 1)
60
+ end
61
+
62
+ def dashed_name
63
+ name.downcase.gsub(/[\s_()]/, '-').gsub(/-+/, '-')
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'way_of_working/audit/github/rules/base'
4
+
5
+ module WayOfWorking
6
+ module DecisionRecord
7
+ # The namespace for plugin
8
+ module Madr
9
+ # This rule checks for the MADR Decision Record template.
10
+ class GithubAuditRule < ::WayOfWorking::Audit::Github::Rules::Base
11
+ ADR_TEMPLATE_PATH = 'docs/decisions/adr-template.md'
12
+ DECISION_ZERO_PATH = 'docs/decisions/0000-use-markdown-any-decision-records.md'
13
+ WOW_DOCUMENTATION_PATH = 'docs/way_of_working/decision-records.md'
14
+
15
+ source_root WayOfWorking.root.join('lib', 'way_of_working', 'decision_record', 'madr', 'templates')
16
+
17
+ def validate
18
+ @errors << 'No MADR Decision Record template found' unless repo_file_contains?(
19
+ ADR_TEMPLATE_PATH, '## Context and Problem Statement'
20
+ )
21
+
22
+ unless repo_file_contains_source_file?(WOW_DOCUMENTATION_PATH)
23
+ @errors << 'Stale or missing documentation for using MADR Decision Records'
24
+ end
25
+
26
+ return if repo_file_contains_source_file?(DECISION_ZERO_PATH)
27
+
28
+ @errors << 'No 0000-use-markdown-any-decision-records.md Decision Record found'
29
+ end
30
+ end
31
+
32
+ ::WayOfWorking::Audit::Github::Rules::Registry.register(
33
+ GithubAuditRule, 'MADR Decision Records'
34
+ )
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: Decision Record
3
+ about: Create a ticket to discuss or propose a new decision record
4
+ title: ''
5
+ labels: decision record
6
+ assignees: ''
7
+
8
+ ---
9
+ ## Context and Problem Statement
10
+
11
+ {Describe the context and problem statement, e.g., in free form using two to three sentences or in the form of an illustrative story.
12
+ You may want to articulate the problem in form of a question and add links to collaboration boards or issue management systems.}
13
+
14
+ <!-- This is an optional element. Feel free to remove. -->
15
+ ## Decision Drivers
16
+
17
+ * {decision driver 1, e.g., a force, facing concern, …}
18
+ * {decision driver 2, e.g., a force, facing concern, …}
19
+ * … <!-- numbers of drivers can vary -->
20
+
21
+ ## Considered Options
22
+
23
+ * {title of option 1}
24
+ * {title of option 2}
25
+ * {title of option 3}
26
+ * … <!-- numbers of options can vary -->
@@ -0,0 +1,30 @@
1
+ ---
2
+ nav_order: 0
3
+ parent: Decision Records
4
+ ---
5
+ # Use Markdown Any Decision Records
6
+
7
+ ## Context and Problem Statement
8
+
9
+ We want to record any decisions made in this project independent whether decisions concern the architecture ("architectural decision record"), the code, or other fields.
10
+ Which format and structure should these records follow?
11
+
12
+ ## Considered Options
13
+
14
+ * [MADR](https://adr.github.io/madr/) 3.0.0 – The Markdown Any Decision Records
15
+ * [Michael Nygard's template](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions) – The first incarnation of the term "ADR"
16
+ * [Sustainable Architectural Decisions](https://www.infoq.com/articles/sustainable-architectural-design-decisions) – The Y-Statements
17
+ * Other templates listed at <https://github.com/joelparkerhenderson/architecture_decision_record>
18
+ * Formless – No conventions for file format and structure
19
+
20
+ ## Decision Outcome
21
+
22
+ Chosen option: "MADR 3.0.0", because
23
+
24
+ * Implicit assumptions should be made explicit.
25
+ Design documentation is important to enable people understanding the decisions later on.
26
+ See also [A rational design process: How and why to fake it](https://doi.org/10.1109/TSE.1986.6312940).
27
+ * MADR allows for structured capturing of any decision.
28
+ * The MADR format is lean and fits our development style.
29
+ * The MADR structure is comprehensible and facilitates usage & maintenance.
30
+ * The MADR project is vivid.
@@ -0,0 +1,7 @@
1
+ # Decisions
2
+
3
+ This directory contains decision records for the project.
4
+
5
+ For new ADRs, please use [adr-template.md](adr-template.md) as basis.
6
+ More information on MADR is available at <https://adr.github.io/madr/>.
7
+ General information about architectural decision records is available at <https://adr.github.io/>.
@@ -0,0 +1,82 @@
1
+ ---
2
+ nav_order: <%= @index %>
3
+ parent: Decision Records
4
+
5
+ # These are optional elements. Feel free to remove any of them.
6
+ status: {proposed | rejected | accepted | deprecated | … | superseded by ADR-0005 <0005-example.md>}
7
+ date: <%= @decision_date %>
8
+ deciders: {list everyone involved in the decision}
9
+ consulted: {list everyone whose opinions are sought (typically subject-matter experts); and with whom there is a two-way communication}
10
+ informed: {list everyone who is kept up-to-date on progress; and with whom there is a one-way communication}
11
+ ---
12
+ # <%= @title %>
13
+
14
+ ## Context and Problem Statement
15
+
16
+ {Describe the context and problem statement, e.g., in free form using two to three sentences or in the form of an illustrative story.
17
+ You may want to articulate the problem in form of a question and add links to collaboration boards or issue management systems.}
18
+
19
+ <!-- This is an optional element. Feel free to remove. -->
20
+ ## Decision Drivers
21
+
22
+ * {decision driver 1, e.g., a force, facing concern, …}
23
+ * {decision driver 2, e.g., a force, facing concern, …}
24
+ * … <!-- numbers of drivers can vary -->
25
+
26
+ ## Considered Options
27
+
28
+ * {title of option 1}
29
+ * {title of option 2}
30
+ * {title of option 3}
31
+ * … <!-- numbers of options can vary -->
32
+
33
+ ## Decision Outcome
34
+
35
+ Chosen option: "{title of option 1}", because
36
+ {justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force {force} | … | comes out best (see below)}.
37
+
38
+ <!-- This is an optional element. Feel free to remove. -->
39
+ ### Consequences
40
+
41
+ * Good, because {positive consequence, e.g., improvement of one or more desired qualities, …}
42
+ * Bad, because {negative consequence, e.g., compromising one or more desired qualities, …}
43
+ * … <!-- numbers of consequences can vary -->
44
+
45
+ <!-- This is an optional element. Feel free to remove. -->
46
+ ## Validation
47
+
48
+ {describe how the implementation of/compliance with the ADR is validated. E.g., by a review or an ArchUnit test}
49
+
50
+ <!-- This is an optional element. Feel free to remove. -->
51
+ ## Pros and Cons of the Options
52
+
53
+ ### {title of option 1}
54
+
55
+ <!-- This is an optional element. Feel free to remove. -->
56
+ {example | description | pointer to more information | …}
57
+
58
+ * Good, because {argument a}
59
+ * Good, because {argument b}
60
+ <!-- use "neutral" if the given argument weights neither for good nor bad -->
61
+ * Neutral, because {argument c}
62
+ * Bad, because {argument d}
63
+ * … <!-- numbers of pros and cons can vary -->
64
+
65
+ ### {title of other option}
66
+
67
+ {example | description | pointer to more information | …}
68
+
69
+ * Good, because {argument a}
70
+ * Good, because {argument b}
71
+ * Neutral, because {argument c}
72
+ * Bad, because {argument d}
73
+ * …
74
+
75
+ <!-- This is an optional element. Feel free to remove. -->
76
+ ## More Information
77
+
78
+ {You might want to provide additional evidence/confidence for the decision outcome here and/or
79
+ document the team agreement on the decision and/or
80
+ define when and how this decision should be realized and if/when it should be re-visited and/or
81
+ how the decision is validated.
82
+ Links to other decisions and resources might appear here as well.}
@@ -0,0 +1,48 @@
1
+ ---
2
+ has_children: true
3
+ ---
4
+ # Decision Records
5
+
6
+ We use [Markdown Any Decision Records (MADR)](https://adr.github.io/madr/) version 3.0.0.
7
+
8
+ In general, projects will follow the organisation's way of working and so decisions captured within individual projects will generally cover decisions that:
9
+
10
+ - are not already covered in the Way of Working
11
+ - are covered in the Way of Working, but have specific implementation details which need to be captured
12
+ - diverge from the guidance in the Way of Working
13
+
14
+ ## Create a new decision record
15
+
16
+ ### Manual approach
17
+
18
+ 1. Copy `docs/decisions/adr-template.md` to `docs/decisions/NNNN-title-with-dashes.md`, where `NNNN` indicates the next number in sequence.
19
+ 2. Edit `NNNN-title-with-dashes.md`.
20
+
21
+ Note you can also use [other patterns for the directory format](https://github.com/joelparkerhenderson/architecture_decision_record#adr-file-name-conventions).
22
+ As a consequence, some existing tooling might not be applicable.
23
+
24
+ The filenames are following the pattern `NNNN-title-with-dashes.md`, where
25
+
26
+ - `NNNN` is a consecutive number and we assume that there won't be more than 9,999 ADRs in one repository.
27
+ - the title is stored using dashes and lowercase, because [adr-tools] also does that.
28
+ - the suffix is `.md`, because it is a [Markdown](https://github.github.com/gfm/) file.
29
+
30
+ Decisions are placed in the subfolder `decisions/` to keep them close to the documentation but also separate the decisions from other documentation.
31
+
32
+ ### Automatic approach
33
+
34
+ To create a new decision record, run:
35
+
36
+ ```bash
37
+ way_of_working new decision_record [NAME]
38
+ ```
39
+
40
+ Where `[NAME]` is the title of your decision record, for example:
41
+
42
+ ```bash
43
+ way_of_working new decision_record "Use Markdown Any Decision Records"
44
+ ```
45
+
46
+ ## Project decision records
47
+
48
+ Decision records for this project are listed below.