Arckit adr

From tractorjuice/arckit-codex · View interactive version

Arckit adr is an AI agent skill from the GitHub repository tractorjuice/arckit-codex. Document architectural decisions with options analysis and traceability

How to use this skill

Skill file

You are helping an enterprise architect create an Architecture Decision Record (ADR) following MADR v4.0 format enhanced with UK Government requirements.

User Input

$ARGUMENTS

Instructions

Note: Before generating, scan projects/ for existing project directories. For each project, list all ARC-*.md artifacts, check external/ for reference documents, and check 000-global/ for cross-project policies. If no external docs exist but they would improve output, ask the user.

1. **Read existing artifacts from the project context:**

MANDATORY (warn if missing):

RECOMMENDED (read if available, note if missing):

OPTIONAL (read if available, skip silently if missing):

1b. **Read external documents and policies**

1c. **Interactive Configuration**

Before creating the ADR, ask the user for key decision parameters. Skip any question where the user has already provided a clear answer in their arguments.

Gathering rules — the one-message interview in .arckit/references/interview-pattern.md:

Question 1 — header: Escalation, multiSelect: false

"What escalation level does this architectural decision require?"

Question 2 — header: Options, multiSelect: false

"How many options should be evaluated (plus a 'Do Nothing' baseline)?"

Apply the user's selections: the escalation level determines the governance forum and stakeholder RACI in the ADR. The option count determines how many alternatives to analyze in the "Considered Options" section (always include "Do Nothing" as baseline).

2. **Identify the target project**

1. Use Glob to list projects/*/ directories and find the highest NNN-* number (or start at 001 if none exist)

2. Calculate the next number (zero-padded to 3 digits, e.g., 002)

3. Slugify the project name (lowercase, replace non-alphanumeric with hyphens, trim)

4. Use the Write tool to create projects/{NNN}-{slug}/README.md with the project name, ID, and date — the Write tool will create all parent directories automatically

5. Also create projects/{NNN}-{slug}/external/README.md with a note to place external reference documents here

6. Set PROJECT_ID = the 3-digit number, PROJECT_PATH = the new directory path

3. **Create decisions directory and determine ADR number**

4. **Read the template** (with user override support)

> Tip: Users can customize templates with $arckit-customize adr

5. **Gather decision information from user**

6. **Generate comprehensive ADR** following MADR v4.0 + UK Gov framework

Document Control (see "Auto-Populate Document Control Fields" section below for full details):

Stakeholders:

Context and Problem Statement:

Decision Drivers (Forces):

Considered Options (MINIMUM 2-3 options, always include "Do Nothing"):

For each option:

Option: Do Nothing (Baseline):

Decision Outcome:

> In the context of [use case],

> facing [concern],

> we decided for [option],

> to achieve [quality/benefit],

> accepting [downside/trade-off].

Consequences:

Validation & Compliance:

Links to Supporting Documents:

Implementation Plan:

Review and Updates:

Related Decisions:

Appendices (optional):

7. **Ensure comprehensive traceability**

8. **Create file naming**

Before writing the file, read .arckit/references/quality-checklist.md and verify all Common Checks plus the ADR per-type checks pass. Fix any failures before proceeding.

9. **Use Write tool to create the ADR file**

CRITICAL - Auto-Populate Document Control Fields:

Before completing the document, populate ALL document control fields in the header:

Step 0: Detect Version

Before generating the document ID, check if a previous version exists:

ADRs are multi-instance documents. Version detection depends on whether you are creating a new ADR or updating an existing one:

Creating a new ADR (default): Use VERSION="1.0" — the ADR number is auto-incremented by --next-num.

Updating an existing ADR (user explicitly references an existing ADR number, e.g., "update ADR-001", "revise ADR-003"):

  1. Look for existing ARC-{PROJECT_ID}-ADR-{NUM}-v*.md files in projects/{project-dir}/decisions/
  2. If no existing file: Use VERSION="1.0"
  3. If existing file found:
  1. Use the determined version for document ID, filename, Document Control, and Revision History
  2. For v1.1+/v2.0+: Add a Revision History entry describing what changed from the previous version

Step 1: Construct Document ID

Step 2: Populate Required Fields

Auto-populated fields (populate these automatically):

User-provided fields (extract from project metadata or user input):

Calculated fields:

Pending fields (leave as [PENDING] until manually updated):

Step 3: Populate Revision History

| 1.0 | {DATE} | ArcKit AI | Initial creation from `$arckit-adr` command | [PENDING] | [PENDING] |

Step 4: Populate Generation Metadata Footer

The footer should be populated with:

**Generated by**: ArcKit `$arckit-adr` command
**Generated on**: {DATE} {TIME} GMT
**ArcKit Version**: {ARCKIT_VERSION}
**Project**: {PROJECT_NAME} (Project {PROJECT_ID})
**AI Model**: [Use actual model name, e.g., "Claude Sonnet 5 (session default)"]
**Generation Context**: [Brief note about source documents used]

Example Rendered Header and Revision History

## Document Control

<!-- DOC-CONTROL-HEADER -->
<!-- Resolved at command-execution time per _partials/RENDERING.md. -->

## Revision History

| Version | Date | Author | Changes | Approved By | Approval Date |
|---------|------|--------|---------|-------------|---------------|
| 1.0 | 2025-10-29 | ArcKit AI | Initial creation from `$arckit-adr` command | [PENDING] | [PENDING] |

10. **Show summary to user** (NOT full document)

```markdown

## Architecture Decision Record Created

ADR Number: ADR-{NUM}

Title: {Decision title}

Status: {Proposed/Accepted/etc}

File: projects/{PROJECT_ID}-{project-name}/decisions/ARC-{PROJECT_ID}-ADR-{NUM}-v${VERSION}.md

### Chosen Option

{Option name}

### Y-Statement

> In the context of {use case},

> facing {concern},

> we decided for {option},

> to achieve {quality},

> accepting {downside}.

### Options Considered

### Key Consequences

Positive:

Negative (accepted trade-offs):

### Decision Drivers

### Requirements Addressed

### Traceability Links

### Next Steps

### UK Government Compliance

Escalation Level: {Level}

Governance Forum: {Forum}

GDS Service Standard: Points {X, Y, Z} addressed

Technology Code of Practice: Points {A, B, C} addressed

```

11. **Provide guidance on ADR lifecycle**

Important Notes

Example Decision Titles

UK Government Escalation Guidance

| Level | Decision Makers | Example Decisions | Governance Forum |

|-------|----------------|-------------------|------------------|

| Team | Tech Lead, Senior Developers | Framework choice, testing strategy, code patterns | Team standup, Sprint review |

| Cross-team | Technical Architects, Lead Engineers | Integration patterns, API standards, shared libraries | Architecture Forum, Technical Design Review |

| Department | Enterprise Architects, CTO, Architecture Board | Cloud provider, security framework, technology standards | Architecture Review Board, Enterprise Architecture Board |

| Cross-government | Technical Design Authority, GDS | National infrastructure, cross-department APIs, GOV.UK standards | Technical Design Council, GDS Architecture Community |

Suggested Next Steps

After completing this command, consider running:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.