Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cursor-init.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Template preferences - choose your preferred style for each document type
templates:
# ADR (Architecture Decision Record) templates
adr: "nygard_style" # Options: nygard_style, full, lightweight
adr: "nygard_style" # Options: nygard_style, full, lightweight, madr

# Architecture documentation templates
architecture: "google_style" # Options: google_style, enterprise, arc42
Expand Down
43 changes: 23 additions & 20 deletions .cursor/rules/cursor-init/documentation/adr.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,35 @@ globs:
alwaysApply: true
---
@if(user_message.starts_with("/adr")) {
"Okay, I will create a new Architecture Decision Record based on your input.
"I will create a new Architecture Decision Record based on your input.

1. **Extracting and Sanitizing the Title:** I will extract the text after `/adr`. If no text is provided, I will use `untitled-adr` as the default title. I will then sanitize this title to be lowercase and kebab-case for the filename, and also refine it for clarity and conciseness for the document's main title.
2. **Determining the Next ADR Number:** I will use the `list_dir` tool to list the contents of the `docs/adr/` directory. From the filenames, I will identify the highest existing ADR number and increment it by one. If no ADRs are found, I will start with `0001`.
3. **Gathering Context:** I will use the `codebase_search` tool with the extracted ADR title to find relevant information from the project's codebase. This context will be used to pre-fill the **Context**, **Decision**, and **Consequences** sections of the ADR. I will prioritize using the `codebase_search` tool for this.
4. **Generating the ADR Content:** I will populate the new file with the following ADR template. I will replace `[ADR Number]` with the determined sequential number, `[Refined Title]` with the refined title, and insert relevant context from the `codebase_search` results into the **Context** section.
1. **Extracting and Sanitizing the Title:** I will extract the text after `/adr`. If no text is provided, I will use `untitled-adr` as the default title. I will then sanitize this title to be lowercase and kebab-case for the filename, and also refine it for clarity and conciseness for the document's main title.

```
### [ADR Number]-[Refined Title]
2. **Determining the Next ADR Number:** I will use the `list_dir` tool to list the contents of the `docs/adr/` directory. From the filenames, I will identify the highest existing ADR number and increment it by one. If no ADRs are found, I will start with `0001`.

**Status:** Proposed
3. **Template Selection:** I will check for a `.cursor-init.yaml` configuration file to determine which ADR template variant to use. Available options are:
- `nygard_style` (default) - Classic Nygard template with Context, Decision, Consequences
- `full` - Comprehensive template with Problem Statement, Assumptions, Options Analysis, Implementation Plan
- `lightweight` - Minimal template for simple decisions
- `madr` - MADR-style template with Decision Drivers and structured options analysis

**Context:**
[Describe the forces at play, including technological, political, social, and project local.]
4. **Gathering Context:** I will use the `codebase_search` tool with the extracted ADR title to find relevant information from the project's codebase. This context will be used to pre-fill the appropriate sections of the selected template.

// Relevant codebase context from search results will be inserted here, for example:
// - filepath/to/code: relevant code snippet
5. **Reading Template:** I will read the selected template file from `.cursor/templates/adr/adr_template_[variant].md` and populate it with:
- `{{ADR_NUMBER}}` - The determined sequential number
- `{{ADR_TITLE}}` - The refined title
- `{{CONTEXT}}` - Relevant codebase context from search results
- `{{DATE}}` - Current date
- Other template-specific placeholders based on the selected variant

**Decision:**
[Describe the decision being made, and why it was chosen over alternatives.]
6. **Creating the ADR File:** Finally, I will create the new ADR file in the `docs/adr/` directory using the populated template content. The filename will be constructed using the determined ADR number and the sanitized title (e.g., `docs/adr/000X-sanitized-title.md`).

**Consequences:**
[Describe the results of the decision, good or bad.]
```
5. **Creating the File:** Finally, I will create the new ADR file in the `docs/adr/` directory using the `edit_file` tool. The filename will be constructed using the determined ADR number and the sanitized title (e.g., `docs/adr/000X-sanitized-title.md`).
**Template Configuration:**
To customize the ADR template used, create a `.cursor-init.yaml` file in your project root with:
```yaml
templates:
adr: \"nygard_style\" # Options: nygard_style, full, lightweight, madr
```

Please provide a brief title for the ADR after `/adr`. If you provide no title, I will use `untitled-adr` as a default.
"
Please provide a brief title for the ADR after `/adr`. If you provide no title, I will use `untitled-adr` as a default."
}
134 changes: 134 additions & 0 deletions .cursor/templates/adr/adr_template_full.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
### {{ADR_NUMBER}}-{{ADR_TITLE}}

**Status:** Proposed

**Date:** {{DATE}}

**Authors:** {{AUTHORS}}

**Stakeholders:** {{STAKEHOLDERS}}

## Problem Statement

{{PROBLEM_STATEMENT}}
[What problem are we trying to solve? What is the current situation that needs to change?]

## Context

{{CONTEXT}}
[Describe the forces at play, including technological, political, social, and project local. What are the business requirements and constraints?]

## Assumptions

{{ASSUMPTIONS}}
[List any assumptions being made that could affect this decision]

## Options Considered

### Option 1: {{OPTION_1_NAME}}

**Description:** [Brief description of the option]
**Pros:**

- [List advantages]

**Cons:**

- [List disadvantages]

**Implementation Effort:** [High/Medium/Low]

### Option 2: {{OPTION_2_NAME}}

**Description:** [Brief description of the option]
**Pros:**

- [List advantages]

**Cons:**

- [List disadvantages]

**Implementation Effort:** [High/Medium/Low]

### Option 3: {{OPTION_3_NAME}}

**Description:** [Brief description of the option]
**Pros:**

- [List advantages]

**Cons:**

- [List disadvantages]

**Implementation Effort:** [High/Medium/Low]

## Decision

{{DECISION}}
[Describe the chosen solution and explain why it was selected over the alternatives. Include the rationale behind the decision.]

## Rationale

{{RATIONALE}}
[Provide detailed reasoning for why this decision was made, including trade-offs considered]

## Consequences

### Positive Consequences

{{POSITIVE_CONSEQUENCES}}

- [List expected benefits and improvements]

### Negative Consequences

{{NEGATIVE_CONSEQUENCES}}

- [List potential drawbacks or challenges]

### Neutral Consequences

{{NEUTRAL_CONSEQUENCES}}

- [List other impacts that are neither clearly positive nor negative]

## Implementation Plan

{{IMPLEMENTATION_PLAN}}
[High-level steps needed to implement this decision]

1. [Step 1]
2. [Step 2]
3. [Step 3]

## Success Metrics

{{SUCCESS_METRICS}}
[How will we measure the success of this decision?]

## Dependencies

{{DEPENDENCIES}}
[List any dependencies on other ADRs, systems, or external factors]

## Risks and Mitigation

{{RISKS_AND_MITIGATION}}
[Identify potential risks and how they will be mitigated]

## Future Considerations

{{FUTURE_CONSIDERATIONS}}
[What might we need to revisit in the future? What could change our decision?]

## Related ADRs

{{RELATED_ADRS}}
[List any related or superseded ADRs]

## References

{{REFERENCES}}
[Include links to relevant documentation, research, or external resources]
30 changes: 30 additions & 0 deletions .cursor/templates/adr/adr_template_lightweight.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
### {{ADR_NUMBER}}-{{ADR_TITLE}}

**Status:** Proposed

**Date:** {{DATE}}

## Problem

{{PROBLEM}}
[What problem are we trying to solve?]

## Decision

{{DECISION}}
[What solution did we choose and why?]

## Alternatives Considered

{{ALTERNATIVES}}
[What other options were considered? Why were they rejected?]

## Consequences

{{CONSEQUENCES}}
[What are the positive and negative outcomes of this decision?]

## Notes

{{NOTES}}
[Any additional context, implementation details, or future considerations]
97 changes: 97 additions & 0 deletions .cursor/templates/adr/adr_template_madr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
### {{ADR_NUMBER}}-{{ADR_TITLE}}

- **Status:** Proposed
- **Date:** {{DATE}}
- **Deciders:** {{DECIDERS}}
- **Technical Story:** {{TECHNICAL_STORY}}
Comment on lines +3 to +6
Copy link

Copilot AI Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The top-level metadata lines here use bullet markers, but other ADR templates use inline metadata (no leading dash). For consistency, consider removing the - prefix so all templates format metadata the same way.

Suggested change
- **Status:** Proposed
- **Date:** {{DATE}}
- **Deciders:** {{DECIDERS}}
- **Technical Story:** {{TECHNICAL_STORY}}
**Status:** Proposed
**Date:** {{DATE}}
**Deciders:** {{DECIDERS}}
**Technical Story:** {{TECHNICAL_STORY}}

Copilot uses AI. Check for mistakes.

## Context and Problem Statement

{{CONTEXT_AND_PROBLEM_STATEMENT}}

[Describe the context and problem statement, e.g., in free form using two to three sentences. You may want to articulate the problem in form of a question.]

## Decision Drivers

{{DECISION_DRIVERS}}

[List the factors that influence the decision]

- [driver 1, e.g., a force, facing concern, ...]
- [driver 2, e.g., a force, facing concern, ...]
- [driver 3, e.g., a force, facing concern, ...]

## Considered Options

{{CONSIDERED_OPTIONS}}

[List the options that were considered]

- [option 1]
- [option 2]
- [option 3]

## Decision Outcome

**Chosen option:** {{CHOSEN_OPTION}}

[Justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force | ... | comes out best (see below).]

### Positive Consequences

{{POSITIVE_CONSEQUENCES}}

- [e.g., improvement of quality attribute satisfaction, follow-up decisions required, ...]
- ...

### Negative Consequences

{{NEGATIVE_CONSEQUENCES}}

- [e.g., compromising quality attribute, follow-up decisions required, ...]
- ...

## Pros and Cons of the Options

### {{OPTION_1_NAME}}

{{OPTION_1_DESCRIPTION}}

[example | description | pointer to more information | ...]

- Good, because [argument a]
- Good, because [argument b]
- Bad, because [argument c]
- ...

### {{OPTION_2_NAME}}

{{OPTION_2_DESCRIPTION}}

[example | description | pointer to more information | ...]

- Good, because [argument a]
- Good, because [argument b]
- Bad, because [argument c]
- ...

### {{OPTION_3_NAME}}

{{OPTION_3_DESCRIPTION}}

[example | description | pointer to more information | ...]

- Good, because [argument a]
- Good, because [argument b]
- Bad, because [argument c]
- ...

## Links

{{LINKS}}

[Link type] [Link to ADR] <!-- example: Refined by [ADR-0005](0005-example.md) -->
[Link type] [Link to ADR] <!-- example: Superseded by [ADR-0010](0010-example.md) -->

- [Link type] [Link to documentation]
- [Link type] [Link to external resource]
2 changes: 1 addition & 1 deletion cli/cursor_init/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _load_config(self) -> Dict[str, Any]:
def _get_default_config(self) -> Dict[str, Any]:
return {
'templates': {
'adr': 'nygard_style',
'adr': 'nygard_style', # Options: nygard_style, full, lightweight, madr
'architecture': 'google_style',
'onboarding': 'general'
},
Expand Down
Loading
Loading