Arckit story

From tractorjuice/arckit-codex · View interactive version

Arckit story is an AI agent skill from the GitHub repository tractorjuice/arckit-codex. Generate comprehensive project story with timeline analysis, traceability, and governance achievements (project)

How to use this skill

Skill file

You are helping an enterprise architect generate a comprehensive project story that documents the journey of an ArcKit-managed project from inception to completion, with heavy emphasis on timeline analysis and governance achievements.

This command creates a ARC-{PROJECT_ID}-STORY-v{VERSION}.md document that serves as:

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.

Step 0: Read existing artifacts from the project context

MANDATORY (warn if missing):

RECOMMENDED (read if available, note if missing):

Minimum artifact check: A meaningful project story requires at least 3-5 artifacts. If the project has fewer than 3, warn:

⚠️  Warning: This project only has [N] artifacts.

A comprehensive story typically requires at least:
- Architecture principles (global)
- Stakeholder analysis
- Requirements or Risk Register

Consider running more ArcKit commands before generating the story, or proceed
with a limited story based on available artifacts.

Step 0b: Read external documents and policies

Step 1: 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

Step 2: Comprehensive Project Artifact Scan

Scan the project directory to find ALL artifacts:

# Find all .md files in the project directory
find "$PROJECT_DIR" -type f -name "*.md" | sort

Expected Artifacts (categorize by type):

Foundation Artifacts:

Business Case Artifacts:

Requirements Artifacts:

Strategic Planning Artifacts:

Procurement Artifacts:

Design Review Artifacts:

Delivery Artifacts:

Compliance Artifacts:

Governance Artifacts:

For each artifact found, note:

Step 3: Extract Comprehensive Timeline

Preferred Method: Git Log Analysis

If the project is under git version control, extract the timeline from git history:

cd "$PROJECT_DIR"

# Get detailed git log with timestamps for all project files
git log --follow --format="%ai | %s" --name-only -- . | grep -E "(\.md|^[0-9]{4})"

This will show:

Parse this data to create timeline events:

Fallback Method: File Modification Dates

If git log is not available or sparse, use file modification times:

# Get file modification times
stat -c "%y %n" "$PROJECT_DIR"/*.md | sort
stat -c "%y %n" "$PROJECT_DIR"/vendors/*/*.md | sort
stat -c "%y %n" "$PROJECT_DIR"/diagrams/ARC-*-DIAG-*.md | sort
stat -c "%y %n" "$PROJECT_DIR"/wardley-maps/ARC-*-WARD-*.md | sort

Extract Timeline Metrics:

Timeline Data Structure:

Create an internal data structure like:

Timeline Events:
[
  {
    date: "2024-01-15",
    days_from_start: 0,
    event_type: "Foundation",
    command: "$arckit-principles",
    artifact: "ARC-000-PRIN-v1.0.md",
    description: "Established enterprise architecture principles"
  },
  {
    date: "2024-01-18",
    days_from_start: 3,
    event_type: "Foundation",
    command: "$arckit-stakeholders",
    artifact: "ARC-{PROJECT_ID}-STKE-v1.0.md",
    description: "Analyzed 8 stakeholders, 12 goals, 15 outcomes"
  },
  ...
]

Step 4: Analyze Each Artifact

For each artifact found, read the file and extract key information:

Stakeholder Analysis (ARC-*-STKE-*.md):

Risk Register (ARC-*-RISK-*.md):

SOBC (ARC-*-SOBC-*.md):

Requirements (ARC-*-REQ-*.md):

Data Model (ARC-*-DATA-*.md):

Research Findings (ARC-*-RSCH-*.md):

wardley-maps/ARC--WARD-.md:

diagrams/ARC--DIAG-.md:

ARC--SOW-.md:

ARC--EVAL-.md & vendors/*/scoring.md:

vendors//reviews/ARC--HLDR-*.md:

vendors//reviews/ARC--DLDR-*.md:

ARC--BKLG-.md:

ARC--SNOW-.md:

Compliance artifacts (ARC--TCOP-.md, ARC--SVCASS-.md, ARC--SECD-.md, etc.):

Traceability Matrix (ARC-*-TRAC-*.md):

ARC--ANAL-.md:

Step 5: Build Traceability Chains

Using the data extracted from artifacts, map the traceability chains:

Chain 1: Stakeholder → Requirements

Chain 2: Requirements → Design

Chain 3: Requirements → Vendor

Chain 4: Requirements → Delivery

Chain 5: Data Flow

Chain 6: Compliance Flow

Step 5b: Load Mermaid Syntax References

Read .arckit/skills/mermaid-syntax/references/gantt.md, .arckit/skills/mermaid-syntax/references/flowchart.md, .arckit/skills/mermaid-syntax/references/pie.md, .arckit/skills/mermaid-syntax/references/timeline.md, and .arckit/skills/mermaid-syntax/references/mindmap.md for official Mermaid syntax — date formats, task statuses, node shapes, edge labels, pie chart syntax, timeline formatting, mindmap indentation, and styling options.

Step 6: Generate Timeline Visualizations

Create 4 types of timeline visualizations using the timeline data extracted:

Visualization 1: Gantt Chart

Use Mermaid gantt syntax to create a visual timeline by phase:

gantt
    title [PROJECT_NAME] Project Timeline
    dateFormat YYYY-MM-DD

    section Foundation
    Architecture Principles         :done, principles, [START_DATE], [DURATION]
    Stakeholder Analysis           :done, stakeholders, after principles, [DURATION]
    Risk Assessment                :done, risk, after stakeholders, [DURATION]

    section Business Case
    Strategic Outline Business Case :done, sobc, [DATE], [DURATION]
    Data Model                     :done, data, after sobc, [DURATION]

    section Requirements
    Requirements Definition        :done, req, [DATE], [DURATION]
    Wardley Mapping               :done, wardley, after req, [DURATION]
    Technology Research           :done, research, after req, [DURATION]

    section Procurement
    Statement of Work             :done, sow, [DATE], [DURATION]
    Vendor Evaluation            :done, eval, after sow, [DURATION]

    section Design
    Architecture Diagrams        :done, diagrams, [DATE], [DURATION]
    High-Level Design Review     :done, hld, after diagrams, [DURATION]
    Detailed Design Review       :done, dld, after hld, [DURATION]

    section Delivery
    Product Backlog             :done, backlog, [DATE], [DURATION]
    ServiceNow Design           :done, snow, after backlog, [DURATION]

    section Compliance
    Service Assessment          :done, assessment, [DATE], [DURATION]
    Secure by Design           :done, secure, after assessment, [DURATION]

    section Governance
    Traceability Matrix        :done, trace, [DATE], [DURATION]
    Quality Analysis           :done, analyze, after trace, [DURATION]

Important: Use actual dates from timeline data. Calculate durations between events. Only include phases/commands that actually exist in the project.

Visualization 2: Linear Command Flow Timeline

Use Mermaid flowchart with dates on each command node:

flowchart TD
    Start([Project Initiated<br/>[START_DATE]]) --> Principles

    Principles["arckit.principles<br/>[DATE]<br/>Architecture Principles"] --> Stakeholders
    Stakeholders["arckit.stakeholders<br/>[DATE]<br/>Stakeholder Analysis"] --> Risk
    Risk["arckit.risk<br/>[DATE]<br/>Risk Register"] --> SOBC

    [... continue for all commands actually executed ...]

    Trace["arckit.traceability<br/>[DATE]<br/>Traceability Matrix"] --> Analyze
    Analyze["arckit.analyze<br/>[DATE]<br/>Quality Analysis"] --> End

    End([Project Complete<br/>[END_DATE]])

    style Start fill:#e1f5e1
    style End fill:#e1f5e1

Visualization 3: Timeline Table

Create a detailed table with all events:

| # | Date | Days from Start | Event Type | Command | Artifact | Description |

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

| 1 | [DATE] | 0 | Foundation | $arckit-principles | ARC-000-PRIN-v1.0.md | Established enterprise architecture principles |

| 2 | [DATE] | [DAYS] | Foundation | $arckit-stakeholders | ARC-{PROJECT_ID}-STKE-v1.0.md | Analyzed [N] stakeholders, [M] goals, [P] outcomes |

| ... | ... | ... | ... | ... | ... | ... |

Visualization 4: Phase Duration Pie Chart

Calculate percentage of time spent in each phase:

pie title Project Phase Time Distribution
    "Foundation (Principles, Stakeholders, Risk)" : [PERCENTAGE]
    "Business Case & Requirements" : [PERCENTAGE]
    "Research & Strategic Planning" : [PERCENTAGE]
    "Procurement & Vendor Selection" : [PERCENTAGE]
    "Design & Review" : [PERCENTAGE]
    "Delivery Planning" : [PERCENTAGE]
    "Compliance & Security" : [PERCENTAGE]
    "Governance & Traceability" : [PERCENTAGE]

Step 7: Generate Additional Mermaid Diagrams

Timeline Milestone Chart:

timeline
    title [PROJECT_NAME] Key Milestones
    [START_DATE] : Project Initiated
                  : Architecture Principles Established
    [DATE] : Stakeholder Analysis Complete
           : [N] Stakeholders, [M] Goals
    [DATE] : Business Case Approved
           : SOBC (5-case model)
    [... key milestones with dates ...]
    [END_DATE] : Project Governance Complete
              : Traceability Matrix Verified

Traceability Chain Flowchart:

flowchart TD
    subgraph Foundation
        Principles[Architecture<br/>Principles<br/>[N] principles]
        Stakeholders[Stakeholder<br/>Analysis<br/>[M] stakeholders]
        Risk[Risk<br/>Register<br/>[Q] risks]
    end

    subgraph Requirements
        BR[Business<br/>Requirements<br/>[BR_COUNT] BR]
        FR[Functional<br/>Requirements<br/>[FR_COUNT] FR]
        NFR[Non-Functional<br/>Requirements<br/>[NFR_COUNT] NFR]
    end

    [... show full traceability flow ...]

    style Principles fill:#fff4e6
    style Requirements fill:#e1f5e1

Governance Achievements Mind Map:

mindmap
  root((Project<br/>Achievements))
    Foundation
      Architecture Principles Established
      [N] Stakeholders Engaged
      [M] Risks Managed
    Business Case
      SOBC Approved
      [NPV] NPV
      Data Model GDPR Compliant
    [... continue for all phases ...]

Step 8: Write Design & Delivery Review Chapters

For the 2 key chapters in the template, write a comprehensive narrative using the data extracted:

Chapter 6: Design Review - Validating the Solution

Chapter 7: Delivery Planning - From Requirements to Sprints

Step 9: Calculate Timeline Metrics

Create a comprehensive metrics table:

| Metric | Value | Analysis |

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

| Project Duration | [TOTAL_DAYS] days ([TOTAL_WEEKS] weeks) | [Analysis: faster/slower than typical] |

| Average Phase Duration | [AVG_DAYS] days | [Comparison] |

| Longest Phase | [PHASE_NAME] ([DAYS] days) | [Why this took longest] |

| Shortest Phase | [PHASE_NAME] ([DAYS] days) | [Why this was fastest] |

| Commands per Week | [VELOCITY] | [Velocity analysis] |

| Artifacts per Week | [VELOCITY] | [Output rate] |

| Time to First Artifact | [DAYS] days | From start to ARC-000-PRIN-v1.0.md |

| Time to Requirements | [DAYS] days | Critical milestone |

| Time to Vendor Selection | [DAYS] days | Critical milestone |

| Time to Design Review | [DAYS] days | Critical milestone |

| Compliance Time | [DAYS] days ([PERCENTAGE]% of total) | Time on compliance |

Step 10: Write Timeline Insights & Analysis

Write comprehensive analysis sections:

Pacing Analysis:

Critical Path:

Timeline Deviations:

Velocity Metrics:

Lessons Learned:

Step 11: Detect Version

Follow .arckit/references/version-detection.md for ARC-{PROJECT_ID}-STORY-v*.md in the project directory. For a project story:

Step 12: Construct Document Control Metadata

Construct document control fields:

Document control fields:

Step 13: Read Template and Populate

Read the story template:

Read the template (with user override support):

Tip: Users can customize templates with $arckit-customize story

Populate ALL placeholders in the template with real data:

Square bracket placeholders (manual placeholders in template):

Curly brace placeholders (document control):

CRITICAL:

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

Step 14: Write ARC-{PROJECT_ID}-STORY-v${VERSION}.md Using Write Tool

CRITICAL: Use the Write tool to create the document. Do NOT output the full content in your response.

Write tool:
- file_path: projects/[PROJECT_ID]-[PROJECT_NAME]/ARC-{PROJECT_ID}-STORY-v{VERSION}.md
- content: [Full populated template with all placeholders replaced]

The document will be 2000-3000 lines with:

Step 15: Show Concise Summary to User

After writing the file, show the user a concise summary (NOT the full document):

✅ Project story generated: projects/001-cabinet-office-genai/ARC-001-STORY-v1.0.md

📊 **Project Timeline Summary**
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

**Project**: Cabinet Office GenAI Chatbot Platform
**Duration**: 79 days (11 weeks) from 2024-01-15 to 2024-04-03
**Artifacts Created**: 23 artifacts
**Commands Executed**: 22 ArcKit commands
**Velocity**: 2.0 commands/week

📅 **Timeline Breakdown**
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Phase                           Duration    % of Project
────────────────────────────────────────────────────────
Foundation                      8 days      10%
Business Case & Requirements    12 days     15%
Research & Strategic Planning   15 days     19%
Procurement & Vendor Selection  14 days     18%
Design & Review                 10 days     13%
Delivery Planning              8 days      10%
Compliance & Security          8 days      10%
Governance & Traceability      4 days      5%

🎯 **Key Achievements**
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✅ Architecture Principles Established
✅ 8 Stakeholders Analyzed → 12 Goals → 15 Outcomes
✅ 35 Risks Identified (8 high, 15 medium, 12 low)
✅ Business Case: NPV £2.4M, ROI 187%, BCR 2.87
✅ 142 Requirements Defined (23 BR, 45 FR, 52 NFR, 12 INT, 10 DR)
✅ Data Model: 12 entities, GDPR compliant
✅ Build vs Buy: BUY decision (Azure OpenAI + GOV.UK services)
✅ Vendor Selected: Microsoft (92/100 score) via G-Cloud
✅ HLD + DLD Approved
✅ 67 User Stories → 12 Sprints (24 weeks delivery)
✅ TCoP: 13/13 points ✓
✅ Service Standard: 14/14 points (Ready for Beta)
✅ NCSC CAF: 14/14 principles ✓
✅ Traceability: 98% coverage ✓

📈 **Timeline Insights**
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

• Research phase (19% of project) was critical for build vs buy decision
• Wardley mapping enabled rapid vendor selection
• Parallel compliance work accelerated governance validation
• Peak velocity: Week 4 (requirements + data model + research)
• Critical path: Principles → Stakeholders → Requirements → Research → Vendor → Design Reviews

📄 **Document Contents**
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The 2,400-line ARC-{PROJECT_ID}-STORY-v{VERSION}.md includes:

✓ Executive summary with timeline snapshot
✓ 4 timeline visualizations (Gantt, flowchart, table, pie chart)
✓ Timeline metrics analysis
✓ Milestone timeline
✓ 2 detailed narrative chapters (Design Review & Delivery Planning)
✓ Timeline insights & lessons learned
✓ Complete traceability chain with Mermaid diagrams
✓ Governance achievements mind map
✓ 5 comprehensive appendices (artifact register, activity log, DSM, command reference, glossary)

🔗 **Traceability Verified**
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Stakeholders (8) → Goals (12) → Outcomes (15)
Goals → Business Reqs (23) → Functional Reqs (45)
Requirements (142) → User Stories (67) → Sprints (12)
Data Model (12 entities) → Data Reqs (10) → CMDB CIs (28)
Requirements → Architecture Components → Tests

Coverage: 98% ✓

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The story demonstrates systematic architecture governance from stakeholder needs through to delivery plans, with full timeline visibility and end-to-end traceability.

Adapt the summary based on actual project data. Show real numbers, real dates, real achievements.

Important Notes

  1. Prerequisites first: Always check that architecture principles exist before generating a story. The principles command ($arckit-principles) is the foundation of the ArcKit governance framework and should be the FIRST command run in any project.
  1. Use Write tool: The ARC-{PROJECT_ID}-STORY-v{VERSION}.md will be 2000-3000 lines. You MUST use the Write tool to avoid exceeding token limits.
  1. Real data only: Replace ALL placeholders with real data extracted from artifacts. No "[PLACEHOLDER]" should remain in the final document.
  1. Timeline emphasis: The story is primarily about the timeline. Every chapter should have timeline context (dates, durations, pacing analysis).
  1. Git log preferred: If available, use git log for most accurate timeline. Fall back to file modification dates if needed.
  1. Comprehensive analysis: Don't just list what happened - analyze why, how it compares to typical projects, what lessons can be learned.
  1. Mermaid diagrams: Generate at least 7-10 Mermaid diagrams (Gantt, flowchart, table, pie, timeline, traceability, mind map, DSM).
  1. Traceability: Show complete end-to-end traceability chains with actual counts.
  1. Metrics: Calculate real metrics (velocity, phase durations, percentages).
  1. Narrative: Write engaging narrative chapters that tell the story of how the project evolved, not just a dry list of facts.
  1. Quality: This is a showcase document. Make it comprehensive, accurate, and professionally written.

Example Usage

# Generate story for a specific project
$arckit-story Cabinet Office GenAI

# Generate story for project by number
$arckit-story 009

# Let user choose from list
$arckit-story

# Generate story for current directory
cd projects/009-cabinet-office-genai
$arckit-story .

Success Criteria

This command creates a comprehensive historical record and demonstration of the ArcKit governance framework in action, with timeline as a first-class feature throughout.

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.