Accelerating Feature Development with AI-Driven Context

Accelerating Feature Development with AI-Driven Context

Accelerating Feature Development with AI-Driven Context

Background

As our organization integrates AI into the Software Development Life Cycle (SDLC), our team has narrowed our focus toward one primary objective: AI-assisted coding at the Implementation stage.

Currently, we are developing and scaling MFPB*, a high-demand financial platform. Run by a dedicated team of 12 members, the service is already live in production and is actively evolving with new features.

Operating in a live, compliance-heavy banking ecosystem means there is zero room for logic gaps or structural mismatches. However, using AI is not as easy as it looks. This post shares our journey, the bottlenecks we faced, and how we redefined AI collaboration by introducing a smarter context injection framework. Our implementation phase is now deeply integrated with AI technology.

Below is a natural way we using AI:

* MFPB is a project code 

The Challenges

Team Scope:

  • Diverse Tech Stacks & Repo Structures: Each team manages multiple separate source repos (Backend, Frontend, Mobile, .etc).
  • Scattered Knowledge: Knowledge naturally lives at different levels, some belong to the whole system, some to specific services, and some to unique programming languages.

AI Scope:

When we started using AI daily, we used to run into three big challenges:

  • AI only sees the code you give it, so it does not know how the entire system fits together.
  • While AI generates code with impressive speed, a lack of project-specific context often leads to disorganized results, fast code becomes messy code. This creates a direct path toward accumulating significant technical debt.
  • And we all know Fixing sometimes takes longer than Writing.

REAL SCENARIO: I planned and asked AI to update a complicated UI using CSS in JS 

OUTCOME: The AI generates a functioning snippet in 10 seconds. However, I have to spend a lot of time modifying the prompt to make sure it works properly. The screenshot below is the final result I need, but I have to change prompt at least 3 times above to let AI know and reach the expectation

THE LESSON:

The way we used AI is FAST, but it LACKS

The Solution with a "Context SpecKit"

Addressing this challenge requires providing the AI with superior Input (Context). Consequently, we developed the “Context SpecKit”, a streamlined new framework. Inspired by the GitHub SpecKit concept, this is a specialized version customized specifically for Money Forward.

Instead of forcing developers to manually train the AI or set up redundant rules for every single repository, “Context SpecKit” solves the biggest pain points that devs face when working with AI:

  • Code Matches the Actual Codebase: The tool automatically adapts to the existing code style, architecture, and conventions of each repo. No more generic or mismatched code suggestions.
  • Zero-Effort Rule Management: You don't need to manually set up rules for every individual repo. The framework smartly understands different scopes (system-wide vs. per-language) and applies the right context automatically.
  • Correct Logic, No Hallucinations: By providing the AI with pinpoint, relevant context rather than a massive dump of data, the agent follows the correct business logic flow and stops hallucinating.

With “Context SpecKit”, the AI agent truly understands the project's big picture and specific details, allowing it to code just like an actual team member.

THE CONCEPT

To seamlessly integrate AI-assisted coding into an existing, complex financial project like MFPB, we designed a structured, multi-phase pipeline. Instead of just passing raw prompts, the framework systematically extracts context, builds project-specific intelligence, and guides the AI through an automated execution flow.

Here is the deep dive into how the framework actually operates:

Phase 1: Context Extraction & Codebase Learning

Before writing a single line of code, the framework must understand the environment it is operating in.

  • Step 1 - Environment Initialization (ait init): 
    • Sets up the underlying orchestration layer and generates core configuration profiles directly within the developer's IDE workspace.
  • Step 2 - Static Codebase Analysis (ait.analyze): 
    • Scans the target repository to build an abstract dependency graph. It outputs an isolated "analysis" metadata folder containing everything the AI needs to know about the project's current state, framework versioning, and directory structure.
  • Step 3 - Execution Model Learning (ait.learn): 
    • Goes beyond syntax to extract the Project Execution Model (PEM). It analyzes how data flows across the service, learning design patterns, naming conventions, and architectural boundaries. This is saved into a "learned" knowledge base so the AI can mimic a human team member's coding style.

Phase 2: Agent Customization (The Brain)

Generic AI models do not understand specific business rules. This phase bridges that gap.

  • Step 4: Custom Agent Constitution (ait.constitution)
    • Based on the analysis and learned data from Phase 1, the framework dynamically instantiates custom, single-purpose AI agents tailored to the project. It generates localized rules and execution logic, ensuring that the automation workflow respects services.

Phase 3: Spec-Driven Execution & Implementation

Once the AI has the full context, it starts the development loop using specifications (specs) and tests.

  • Step 5: Specification Ingestion (ait.specify):
    • Merges the new feature requirements (the functional specs) with the extracted PEM context. This ensures that the requirements are interpreted through the lens of the existing system architecture, preventing disconnected code generation.
  • Step 6: Alignment & Verification (ait.clarify & ait.plan): 
    • The custom agents actively flag ambiguities in the requirements, asking precision questions to resolve conflict. Once aligned, the framework forces the AI to output a step-by-step architectural plan before touches any source file.
  • Step 7: Automated TDD Test Implementation (ait.implement): 
    • The AI agent executes the finalized plan using Test-Driven Development (TDD). It generates tests based on the spec, writes the production code to satisfy those tests, and leverages the custom agents to self-verify the output before human review.

“AFTER” OUTCOME:

By shifting the focus from "writing better prompts" to "giving clear context" via “Context SpecKit”, the AI is now empowered to:

  1. The AI stops guessing and stops making mistakes about our system, it learns our code ways better.
  2. We are now confident to build Automated workflow from Analyze -> Code -> Test -> Verify without reviewing the result many times as before.
  3. The tool forces the AI to follow Spec-Driven Development and Test-Driven Development concepts.

Conclusion

When we give the AI better context, the code it writes is much closer to what we actually want. By investing in better context, we can turn AI from a fast but messy assistant into a reliable digital teammate.

Better Context  >>  Fewer Fixes Later

More like this

Implementing Domain Driven Design
Nov 15, 2023

Implementing Domain Driven Design

Playwright tips and tricks
Feb 02, 2024

Playwright tips and tricks

The database problem we solved with replica technique
May 03, 2024

The database problem we solved with replica technique