|
| 1 | +--- |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + title: |
| 6 | + description: "ADR title (e.g., 'Use PostgreSQL for data storage')" |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + context: |
| 10 | + description: "Brief context or problem statement (optional)" |
| 11 | + required: false |
| 12 | + type: string |
| 13 | + |
| 14 | +description: "Create a new Architecture Decision Record (ADR) with AI assistance" |
| 15 | + |
| 16 | +engine: copilot |
| 17 | + |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + |
| 21 | +tools: |
| 22 | + github: |
| 23 | + toolsets: [repos, pull_requests] |
| 24 | + |
| 25 | +safe-outputs: |
| 26 | + create-pull-request: |
| 27 | + |
| 28 | +network: |
| 29 | + allowed: |
| 30 | + - defaults |
| 31 | + |
| 32 | +timeout-minutes: 10 |
| 33 | +--- |
| 34 | + |
| 35 | +# Create Architecture Decision Record (ADR) |
| 36 | + |
| 37 | +You are tasked with creating a new Architecture Decision Record (ADR) for the Rhiza project. |
| 38 | + |
| 39 | +## Input Parameters |
| 40 | + |
| 41 | +- **Title**: {{ inputs.title }} |
| 42 | +- **Context** (if provided): {{ inputs.context }} |
| 43 | + |
| 44 | +## Project Context |
| 45 | + |
| 46 | +This is a Rhiza-based Python project that maintains ADRs in `docs/adr/`. The ADR system follows these conventions: |
| 47 | + |
| 48 | +- **Location**: `docs/adr/` directory |
| 49 | +- **Naming**: Files use 4-digit sequential numbering: `XXXX-title-with-hyphens.md` (e.g., `0002-use-postgresql.md`) |
| 50 | +- **Template**: `docs/adr/0000-adr-template.md` defines the standard format |
| 51 | +- **Index**: `docs/adr/README.md` maintains a table of all ADRs |
| 52 | + |
| 53 | +### ADR Format |
| 54 | + |
| 55 | +Each ADR must include: |
| 56 | + |
| 57 | +1. **Title**: `# [NUMBER]. [TITLE]` (e.g., `# 2. Use PostgreSQL for Data Storage`) |
| 58 | +2. **Date**: Current date in `YYYY-MM-DD` format |
| 59 | +3. **Status**: `Proposed` (default for new ADRs) |
| 60 | +4. **Context**: Why is this decision needed? What problem are we solving? |
| 61 | +5. **Decision**: What approach are we taking? |
| 62 | +6. **Consequences**: What becomes easier or harder? (Positive, Neutral, Negative) |
| 63 | + |
| 64 | +## Instructions |
| 65 | + |
| 66 | +### Step 1: Determine ADR Number |
| 67 | + |
| 68 | +1. Read `docs/adr/README.md` to find the current ADR index table |
| 69 | +2. Identify the highest numbered ADR |
| 70 | +3. Use the next sequential 4-digit number (e.g., if latest is 0001, use 0002) |
| 71 | + |
| 72 | +### Step 2: Create Filename Slug |
| 73 | + |
| 74 | +Convert the title to a filename-friendly slug: |
| 75 | +- Convert to lowercase |
| 76 | +- Replace spaces with hyphens |
| 77 | +- Remove special characters |
| 78 | +- Example: "Use PostgreSQL for Data Storage" → "use-postgresql-for-data-storage" |
| 79 | + |
| 80 | +### Step 3: Generate ADR Content |
| 81 | + |
| 82 | +Create a comprehensive ADR with the following: |
| 83 | + |
| 84 | +**Context Section**: |
| 85 | +- If context was provided in inputs, use it as a starting point |
| 86 | +- Expand with research about: |
| 87 | + - Why this decision is needed for Rhiza |
| 88 | + - What problem or requirement motivates it |
| 89 | + - Current state and limitations (if applicable) |
| 90 | +- Be specific and thorough (3-5 paragraphs) |
| 91 | + |
| 92 | +**Decision Section**: |
| 93 | +- Clearly state what is being decided |
| 94 | +- Explain the approach or solution |
| 95 | +- Include key technical details |
| 96 | +- List alternatives considered (if applicable) |
| 97 | +- Be concrete and actionable |
| 98 | + |
| 99 | +**Consequences Section**: |
| 100 | +Analyze and document: |
| 101 | +- **Positive**: Benefits, improvements, what becomes easier |
| 102 | +- **Neutral**: Trade-offs, things that change but aren't clearly better/worse |
| 103 | +- **Negative**: Costs, limitations, what becomes harder |
| 104 | + |
| 105 | +Each section should have 2-4 bullet points with substantive detail. |
| 106 | + |
| 107 | +### Step 4: Create the ADR File |
| 108 | + |
| 109 | +1. Copy the template: `docs/adr/0000-adr-template.md` → `docs/adr/XXXX-slug.md` |
| 110 | +2. Replace all template placeholders with actual content: |
| 111 | + - `[NUMBER]` → actual number |
| 112 | + - `[TITLE]` → actual title |
| 113 | + - `[YYYY-MM-DD]` → current date |
| 114 | + - `[Proposed | ...]` → `Proposed` |
| 115 | + - Fill in Context, Decision, and Consequences sections |
| 116 | +3. Ensure all sections are complete and well-written |
| 117 | + |
| 118 | +### Step 5: Update the Index |
| 119 | + |
| 120 | +Edit `docs/adr/README.md`: |
| 121 | +1. Add a new row to the ADR Index table: |
| 122 | + ``` |
| 123 | + | [XXXX](XXXX-slug.md) | Title | Proposed | YYYY-MM-DD | |
| 124 | + ``` |
| 125 | +2. Insert it in numerical order (usually at the end) |
| 126 | +3. Keep table formatting aligned |
| 127 | + |
| 128 | +### Step 6: Create Pull Request |
| 129 | + |
| 130 | +1. Create a new branch: `adr/XXXX-slug` |
| 131 | +2. Commit both files with message: `Add ADR-XXXX: [Title]` |
| 132 | +3. Create a pull request with: |
| 133 | + - **Title**: `ADR: [Title]` |
| 134 | + - **Description**: Brief summary of the ADR and request for review |
| 135 | + - **Labels**: `documentation`, `adr` |
| 136 | + |
| 137 | +## Guidelines |
| 138 | + |
| 139 | +- **Be thorough**: ADRs are permanent records. Make them comprehensive. |
| 140 | +- **Research context**: If the input context is brief, research the topic to provide fuller context. |
| 141 | +- **Consider alternatives**: Mention other approaches that were or could be considered. |
| 142 | +- **Be honest about trade-offs**: Document both benefits and costs. |
| 143 | +- **Use professional tone**: Clear, factual, objective writing. |
| 144 | +- **Follow template exactly**: Don't add or remove sections from the standard format. |
| 145 | + |
| 146 | +## Example ADR Structure |
| 147 | + |
| 148 | +```markdown |
| 149 | +# 2. Use PostgreSQL for Data Storage |
| 150 | + |
| 151 | +Date: 2026-02-21 |
| 152 | + |
| 153 | +## Status |
| 154 | + |
| 155 | +Proposed |
| 156 | + |
| 157 | +## Context |
| 158 | + |
| 159 | +Rhiza currently stores all configuration data in YAML files. As the system grows... |
| 160 | +[3-5 paragraphs explaining the problem and motivation] |
| 161 | + |
| 162 | +## Decision |
| 163 | + |
| 164 | +We will adopt PostgreSQL as the primary data store for Rhiza configuration data... |
| 165 | +[2-4 paragraphs detailing the decision and approach] |
| 166 | + |
| 167 | +## Consequences |
| 168 | + |
| 169 | +### Positive |
| 170 | + |
| 171 | +- **Improved query capabilities**: PostgreSQL enables complex queries... |
| 172 | +- **Better concurrency**: ACID transactions prevent data corruption... |
| 173 | +- **Scalability**: Can handle larger datasets... |
| 174 | + |
| 175 | +### Neutral |
| 176 | + |
| 177 | +- **Operational complexity**: Requires PostgreSQL installation... |
| 178 | +- **Learning curve**: Team needs to learn SQL... |
| 179 | + |
| 180 | +### Negative |
| 181 | + |
| 182 | +- **Migration effort**: Existing YAML data must be migrated... |
| 183 | +- **Infrastructure dependency**: Requires database server... |
| 184 | +``` |
| 185 | + |
| 186 | +## Success Criteria |
| 187 | + |
| 188 | +- ADR file created with next sequential number |
| 189 | +- All template sections filled with substantial, thoughtful content |
| 190 | +- Index updated with new ADR entry |
| 191 | +- Pull request created for review |
| 192 | +- Files follow naming conventions exactly |
0 commit comments