← 返回 Skills 市场
charlie-morrison

ADR Generator

作者 charlie-morrison · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
53
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install adr-generator
功能描述
Architecture Decision Record generator — analyze codebases and document technical decisions with context, alternatives, and consequences. Use when asked to d...
使用说明 (SKILL.md)

Architecture Decision Record Generator

Analyze a codebase or conversation to produce Architecture Decision Records (ADRs) — structured documents that capture the WHY behind technical choices so future developers understand the reasoning.

Use when: "document this decision", "create an ADR", "why did we choose X", "record our architecture decision", or when a significant technical choice is being made.

What is an ADR?

A short document capturing one significant architectural decision: the context, the decision itself, the alternatives considered, and the consequences. ADRs form a decision log that prevents the same debates from recurring and helps new team members understand the codebase.

When to Create an ADR

  • Choosing a framework, database, or major library
  • Defining API contracts or data schemas
  • Setting team conventions (testing strategy, branching model, deployment process)
  • Making a trade-off (performance vs maintainability, monolith vs microservices)
  • Adopting or dropping a tool
  • Any decision someone might later ask "why did we do it this way?"

Analysis Steps

1. Identify the Decision

From conversation or code review, extract:

  • What was decided
  • When (date or PR/commit reference)
  • Who was involved (if known)

2. Reconstruct Context

# Check git history for related changes
git log --oneline --all --grep="\x3Ckeyword>" | head -20

# Find when a dependency was added
git log --all --diff-filter=A -- package.json | head -5
git log -p --all -S '\x3Cpackage-name>' -- package.json | head -40

# Look for prior discussion in docs
grep -ri "decision\|chose\|alternative\|trade-off\|migrate" docs/ README.md CONTRIBUTING.md 2>/dev/null

# Check for existing ADRs
find . -type f -name "*.md" -path "*/adr/*" -o -name "*decision*" 2>/dev/null
ls docs/adr/ docs/decisions/ doc/architecture/ 2>/dev/null

3. Analyze Alternatives

For framework/library decisions:

# What else was evaluated? Check for traces
grep -ri "considered\|vs\|compared\|evaluated\|alternative" docs/ 2>/dev/null
git log --all --oneline | grep -i "try\|experiment\|spike\|poc\|prototype" | head -10

# Check if multiple solutions were tried
git log --all --oneline --diff-filter=D -- '**/package.json' | head -10

4. Assess Consequences

Read the current implementation to understand what the decision enabled or constrained:

# How deeply is the choice embedded?
grep -rc "\x3Cframework-import>" --include="*.{ts,js,py,go}" . 2>/dev/null | sort -t: -k2 -rn | head -10

# Are there workarounds that suggest regret?
grep -ri "hack\|workaround\|todo\|fixme\|technical debt" --include="*.{ts,js,py,go}" . 2>/dev/null | head -20

ADR Template

Use the Michael Nygard format (industry standard):

# ADR-{NNN}: {Title — short, noun-phrase}

**Date:** YYYY-MM-DD
**Status:** Proposed | Accepted | Deprecated | Superseded by ADR-XXX
**Deciders:** [names or roles]

## Context

What is the issue that we're seeing that is motivating this decision or change?
Describe the forces at play: technical constraints, business requirements, team capabilities, timeline pressure.

## Decision

State the decision clearly in full sentences.
"We will use PostgreSQL as our primary database."
"We will adopt a monorepo structure using Turborepo."

## Alternatives Considered

### Alternative A: [name]
- **Pros:** ...
- **Cons:** ...
- **Why not:** ...

### Alternative B: [name]
- **Pros:** ...
- **Cons:** ...
- **Why not:** ...

## Consequences

### Positive
- What becomes easier or possible because of this decision

### Negative
- What becomes harder, more expensive, or is now ruled out
- What technical debt does this introduce

### Risks
- What could go wrong
- Under what conditions would we reconsider this decision

## References

- Links to relevant PRs, issues, benchmarks, or external resources

File Organization

Standard locations (create if none exist):

docs/adr/
  0001-use-postgresql.md
  0002-adopt-monorepo.md
  0003-api-versioning-strategy.md
  README.md          # index of all ADRs with one-line summaries

Index format for README.md:

# Architecture Decision Records

| # | Decision | Status | Date |
|---|----------|--------|------|
| 1 | [Use PostgreSQL](0001-use-postgresql.md) | Accepted | 2026-01-15 |
| 2 | [Adopt monorepo](0002-adopt-monorepo.md) | Accepted | 2026-02-01 |

Tips

  • Keep ADRs short — 1-2 pages max. If it's longer, the decision is too big (split it).
  • Write ADRs at decision time, not after. Retrospective ADRs lose the "alternatives considered" context.
  • ADRs are immutable once accepted. If a decision changes, create a new ADR that supersedes the old one.
  • Number them sequentially. Never reuse numbers.
  • Store them in the repo, next to the code they govern.
  • Review ADRs in PRs — they deserve the same scrutiny as code.
安全使用建议
This skill is instruction-only and appears coherent: it tells the agent to inspect repo history and files to write ADRs. Before installing or invoking it, ensure the agent environment you run it in should be allowed to read the target repository (it will run git/grep/find commands). Because the skill's source is unknown, prefer using it in user-invoked mode on repos you control (not on systems containing secrets) and review the SKILL.md yourself — there are no hidden installs or credential requests, but the agent will see whatever files you let it read.
功能分析
Type: OpenClaw Skill Name: adr-generator Version: 1.0.0 The adr-generator skill is a well-documented tool designed to help an AI agent create Architecture Decision Records by analyzing a codebase. The SKILL.md file provides standard, low-risk shell commands (git, grep, find) to search repository history and documentation for technical context. There are no indicators of data exfiltration, malicious execution, or prompt injection.
能力评估
Purpose & Capability
Name/description match the behavior: the SKILL.md instructs the agent to inspect a repository (git history, files, docs) to produce Architecture Decision Records. There are no unrelated credentials, binaries, or install steps requested.
Instruction Scope
Runtime instructions explicitly tell the agent to read repository files and run typical repository inspection commands (git log, grep, find, ls). Those actions are necessary and proportionate for analyzing a codebase to produce ADRs and do not ask the agent to access unrelated system config or external endpoints.
Install Mechanism
No install spec and no code files — instruction-only. No downloads or package installs are specified, so nothing will be written to disk by an installer.
Credentials
The skill declares no environment variables, credentials, or config paths. The SKILL.md does not request secrets or system credentials beyond reading repository files, which is appropriate for its purpose.
Persistence & Privilege
always is false and the skill does not request persistent system changes or modify other skills. It is user-invocable and can run autonomously per platform defaults, which is expected for such a helper.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install adr-generator
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /adr-generator 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Architecture Decision Record generator with analysis workflow and Nygard template
元数据
Slug adr-generator
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

ADR Generator 是什么?

Architecture Decision Record generator — analyze codebases and document technical decisions with context, alternatives, and consequences. Use when asked to d... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 53 次。

如何安装 ADR Generator?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install adr-generator」即可一键安装,无需额外配置。

ADR Generator 是免费的吗?

是的,ADR Generator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

ADR Generator 支持哪些平台?

ADR Generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 ADR Generator?

由 charlie-morrison(@charlie-morrison)开发并维护,当前版本 v1.0.0。

💬 留言讨论