- AI
- A
How I Became 5 Times More Efficient at Coding with Claude Using AI Factory
Previously, setting up a project to work with an AI agent took 30-60 minutes - searching for skills, connecting MCP, explaining project structure. I often take on new projects and got tired of wasting time on preparation, which led to AI Factory - now preparation takes just a few minutes! Automated specification drafting and setup, skill selection/generation for sub-agents and MCP tailored to your stack, built-in self-learning system through patches. I'll share how I transitioned from manual hassle to automation!
I will tell you about the tool I created to speed up project setup for effective work with an AI agent (in my case, Claude Code). I worked with SpecKit for a long time - a cool project (I even wrote an article about it). It helped me a lot in my work and gave me an understanding of working with LLM. However, over time, I started to notice shortcomings that began to bother me more and more.
Problem
Before starting work with the AI agent on the project, my standard scenario looks like this:
1. Organizing Work
Researching the topic
Planning (I worked with SpecKit): explaining the project structure to the agent, describing the tech stack and rules of operation, creating plans and verifying them
2. Setting up skills
Searching for suitable skills on skills.sh
Copying to
.claude/skills/If the needed skill is not available - writing it from scratch (or generating it, to be more precise)
3. Configuring MCP servers
Opening
.claude/settings.local.jsonand specifying MCP serversAdding environment variables
Result: 30-60 minutes of setup before starting real work (in terms of vibe-coding). Gradually, I began to automate processes, and this eventually grew into the AI factory project.
What AI Factory Solves
Automation of Setup:
ai-factory init→ interactively sets everything up in 2-3 minutesScans the existing project (package.json, composer.json, requirements.txt)
Determines the stack and downloads suitable skills from skills.sh
Generates missing skills for your project
Configures MCP servers of your choice Result: from 30-60 minutes of setup to 5-10 minutes.
Unified Context:
.ai-factory/DESCRIPTION.md- always up-to-date project specification for context for the agent - no need to repeat explanations about what we are working on in every chat
Structured Workflow:
Clear commands:
/taskfor quick tasks,/featurefor larger features,/fixfor bugsAutomatic plans and checkpoints
Conventional commits out of the box
Learning System:
Each fix creates a patch with a description of the problem
Subsequent tasks take past mistakes into account
/evolveimproves skills based on project experience
AI Factory
The idea is simple: minimal setup, the advantage of using specifications for the LLM context, and code quality with MCP + sub-agents with skills. And the comfort of work - everything you need is already at hand!
What prompted the creation? Experience with SpecKit and OpenSpec. Both tools are good, but in my opinion, they have shortcomings.
Experience with SpecKit and OpenSpec
I actively used both tools and encountered specific problems:
SpecKit (from GitHub):
Excessive documentation: generates hundreds of lines of specifications, plans, and checklists. For small tasks, this is overhead
Rigid workflow: difficult to skip steps like testing, even when it's not needed
Context issues: a lot of tokens are spent on work
Refactoring difficulty: when a bug needs to be fixed quickly, you have to go through the entire cycle
/specify→/plan→/tasks→/implement
OpenSpec (simpler):
Validation bugs: often shows validation errors, even when everything is correct.
openspec validateandopenspec showreturn contradictory resultsControl issues: AI sometimes ignores the workflow and starts implementation without the command
/openspec:applyComplexity for large projects: unclear how to apply it for existing large codebases
The common problem of both:
Require manual configuration for each project
Require preliminary research on the topic
Insufficient automation of skill generation and MCP connection
AI Factory takes these points into account and addresses them.
Video overview of AI Factory
For those who prefer video content, I recorded an overview:
Getting Started
npm install -g ai-factory
ai-factory init
When initializing:
Interactive questions about the project and agent
Automatic setup of MCP servers
Creation of the config
.ai-factory.json
For a new project - it will ask about the stack. For an existing one - it will analyze the code itself and select the necessary.
Main Commands
Command | Usage | Branch? | Plan? |
|---|---|---|---|
| Quick tasks | No |
|
| Large features | Yes |
|
| Bugs and errors | No | No |
| Executing the plan | - | - |
| Improving skills | - | - |
Workflow
For small tasks:
/ai-factory.task → plan → /ai-factory.implement → done
For features:
/ai-factory.feature → branch + plan → /ai-factory.implement → commits → done
For bugs:
/ai-factory.fix → fix + logging + patch → done
Key Features
1. /ai-factory - context setup
Analyzes the project, determines the stack, selects skills from skills.sh or generates new ones, configures necessary MCP.
2. Feature and Task planning
/ai-factory.feature - for large tasks with a branch and complete plan.
/ai-factory.task - for quick changes without a branch.
Both analyze requirements, study the codebase, create tasks with dependencies.
3. /ai-factory.implement - executing the created plan
/ai-factory.implement 5 # work on task #5 if we want to do something specific
Before starting, the agent will read all patches from .ai-factory/patches/ - it learns from past mistakes.
4. /ai-factory.fix - quick fixes
We do this if it's clear that the problem is minor. The agent studies the issue, applies the fix with logging, and creates a patch for self-learning. No plans - just immediate resolution and learning.
5. /ai-factory.evolve - self-learning of skills
/ai-factory.evolve # All skills
/ai-factory.evolve fix # Specific skill
Analyzes all patches, finds patterns of errors, improves skills with your approval.
6. /ai-factory.skill-generator
Training mode - provide a URL to generate skills from the documentation:
/ai-factory.skill-generator https://fastapi.tiangolo.com/tutorial/
Studies sources, enriches through search, generates full custom skills.
Self-learning system
Each fix creates a patch - a document that helps avoid similar errors in the future.
Learning cycle:
/fix → bug → fix → patch →
next /fix or /implement → reads patches → better code
Patch structure:
Problem and cause
Applied solution
Prevention recommendations
Tags for search
Periodically run /ai-factory.evolve - the tool will analyze the accumulated patches and improve skills for your project.
Project Structure
project/
├── .claude/skills/ # Skills
├── .ai-factory/
│ ├── DESCRIPTION.md # Specification
│ ├── PLAN.md # Current plan
│ ├── features/ # Feature plans
│ ├── patches/ # Patches for learning
│ └── evolutions/ # Improvement logs
└── .ai-factory.json # Config
MCP servers
Supported GitHub, Postgres, Filesystem. Configuration in .claude/settings.local.json.
Best Practices
Logging: levels DEBUG/INFO/WARN/ERROR, control through
LOG_LEVELCommits: checkpoints every 3-5 tasks, conventional commits format
Tests: always asked before the plan, not added without consent
Tool development
After active use over several days, made two releases (v1.1 and v1.2):
v1.1: improved Skill Generator, training mode
v1.2: patch system, /ai-factory.evolve, feature organization
v1.3. Safety first!
Critical update - a protection system against prompt-injection. By downloading skills from skills.sh, we trust external sources with access to your project. Now every skill undergoes mandatory scanning for 10 categories of threats - from injections and data leaks to social engineering. A two-level check (regex + LLM intent analysis) filters out malicious code. /skill-generator scan allows you to manually check any file.
A new skill /ai-factory.improve has also been added for refining already created plans - when you realize that the plan is good, but something is missing.
Of course, I used AI factory for developing the AI factory).
Summary
AI Factory addresses specific problems in AI development:
✅ Automatic adaptation to the project
✅ Spec-driven approach with control
✅ Self-learning from mistakes
✅ Simple workflow
Perfect if you
Are tired of settings before each project
Want a structured approach when working with AI
Are working on real projects
Have experience with Claude Code or similar
About the future
Now I have a team of assistants - experts in different fields. I am taking on projects that I wouldn't have tackled before due to lack of knowledge of the stack.
This is a tool. The experience of the developer is important - often it is necessary to adjust the proposed solutions. AI is an assistant for specialists, not a replacement for developers.
Links
The library is free. Contributions and feedback are welcome.
Do you have experience with the spec-driven approach? Share in the comments.
Write comment