When AI Surpasses Expectations

2 minute read

As I continue developing the Higher Level Dev Kit, I am constantly amazed by how Claude Sonnet 3.5 not only executes my ideas but often improves upon them in ways I hadn’t anticipated. Let me share a recent experience that truly highlights the transformative power of AI in software development.

Capturing the Essence of Each Commit

I recently added a feature to my toolkit that captures the essence of each commit in a JSON file. This file is stored in the target repository under a .hldk/specs directory, effectively creating a history or story of the repository’s development. The idea was to have a structured way to document changes, making it easier to track progress and understand the evolution of the codebase.

Tracking Test Lines Changed

Building on that, I wanted to differentiate between changes made to production code and test code. Specifically, I aimed to track testLinesChanged — the number of lines changed in test files as opposed to production files. Adding this metric will allow us to track the relative cost of changes to test code as opposed to production code

The Git Update That Surprised Me

I instructed Claude to implement this feature with the following mini-spec:

update mutation entity to add testLinesChanged similar to linesChanged but 
is only populated if the filePath contains the string "test" (any case) 
otherwise it's set to 0. Update the service and repo as necessary to set 
testLinesChanged and also add methods for getTestLinesChangedForSession|Request. 
Also add the flyway migration.

And here’s the result—the contents of the generated JSON file that was included in the commit:

{
  "spec": "update mutation entity to add testLinesChanged similar to linesChanged but is only populated if the filePath contains the string \"test\" (any case) otherwise it's set to 0. Update the service and repo as necessary to set testLinesChanged and also add methods for getTestLinesChangedForSession|Request. Also add the flyway migration.",
  "commitMessage": "Add testLinesChanged feature to mutations",
  "stats": {
    "processingMillis": 65294,
    "inputTokens": 100931,
    "outputTokens": 4587,
    "totalTokens": 105518,
    "cost": 0.2786985,
    "linesChanged": 71,
    "currency": "gbp"
  }
}

Beyond Expectations

What surprised me was that Claude not only implemented the feature flawlessly, adding 71 lines of code in just over 1 minute at a cost of 28p, but also added an update line to the Flyway migration script to backfill the testLinesChanged data in the existing database—a step I hadn’t even considered.

Here’s the Flyway migration that it generated:

ALTER TABLE mutations ADD COLUMN testLinesChanged INTEGER DEFAULT 0;

UPDATE mutations SET testLinesChanged = linesChanged WHERE LOWER(filePath) LIKE '%test%';

CREATE INDEX idx_mutations_test_lines_changed ON mutations (testLinesChanged);

By adding this extra line, Claude ensured that all historical data was consistent with the new feature, allowing for accurate analytics from the moment of implementation.

The Power of AI-Augmented Development

This experience reinforces the incredible potential of AI-augmented development:

  • Speed: Tasks that would typically take hours are completed in minutes.
  • Insight: The AI doesn’t just follow instructions—it understands the context and identifies improvements.
  • Efficiency: With AI handling the heavy lifting, developers can focus on higher-level problem-solving.

Embracing the New Paradigm

This is not just a one-off occurrence. I’ve been consistently experiencing similar enhancements while using the Higher Level Dev Kit with Claude Sonnet 3.5. The AI agent:

  • Understands the codebase layout and adapts accordingly.
  • Replicates coding styles and best practices, ensuring consistency.
  • Identifies potential improvements that may not be immediately obvious.

By embracing AI-augmented development, we unlock unprecedented productivity and insight, allowing us to focus on more innovative and creative tasks.

Higher Level Software Ltd

Higher Level Software Ltd

We provide a custom agentic AI toolkit, coaching & bespoke consultancy services to supercharge your software development processes & deliver more value in less time so you can more than meet your targets.

Drop by HigherLevelDev.com to learn more.