Nativa PHP Core

Article

OpenSpec for kids ... part 5: OpenSpec + AI Factory ... human and AI collaboration (series finale)

Article cover illustration: OpenSpec, openspec, php, workflow

This is part 5 ... the finale of the OpenSpec for kids series. In part 1 we got to know the change, in part 2 its five files, in part 3 the whole life cycle and in part 4 the four layers of evidence. Today we show who drives the whole workflow ... AI Factory ... and what human + AI collaboration looks like. And everything on the real artifacts that lie right in this repo.

The series said "we" ... who actually is "we"?

The whole series talked in the first person plural: "we changed", "we decided", "we moved". But maybe you've been asking all along: who actually is "we"? A human? An AI? Both?

The answer is: a team. This project uses AI Factory ... a set of skills that drive exactly the OpenSpec workflow the whole series is about. Skills are plain files in the repo:

.agents/skills/
├── aif-plan/        # turns a request into a plan (in our case an OpenSpec change)
├── aif-implement/   # executes tasks from tasks.md
├── aif-verify/      # checks that everything is really done
├── aif-done/        # finalizes: QA evidence + archiving
├── aif-archive/     # moves to the archive
├── aif-commit/      # conventional commit
└── … and another twenty

Each skill is a document with instructions ... like a manual for an AI assistant. And with them belongs the .ai-factory/ folder, where the artifacts we've been opening all series live: config.yaml, qa/, state/, rules/, evolutions/.

Config ... the rules of the game, once in one place

Everything we showed in the series is written in .ai-factory/config.yaml ... the single file that says how this project works:

aifhub:
  artifactProtocol: openspec   # changes live in openspec/changes/
  openspec:
    validateOnVerify: true     # verification also runs openspec validate
    archiveOnDone: true        # a done change archives itself
    requireSpecCoverageForDone: true  # done requires 100% coverage

workflow:
  plan_first: true             # plan first, then code
  conventional_commits: true   # commits in conventional format
  review_gates: [phpstan, cs-fix-dry, rector-dry, test]  # exactly those from part 3

quality:
  phpstan_level: 9             # level 9, no discounts

Notice that these aren't just rules for the AI ... they are **rules for the project**. The AI reads and follows them, but they apply equally to anyone who touches the repo. Config is the bridge between human and AI:
both read the same manual.

Aif-verify ... evidence, not a promise

In part 4 we opened verify.md from the change 2026-08-08-mobile-nav-menu ... the document generated by aif-verify.
Now we see the whole story:

.aif-factory/qa/2026-08-08-mobile-nav-menu/
├── verify.md              # final report: 11/11 tasks, all gates PASS
├── coverage.json          # matrix: every requirement → files + tests
├── rules.md               # rules gate pass
├── done-readiness.json    # machine-readable verdict
└── done.md                # finalization: archived, canonical spec +3

And in .ai-factory/state/2026-08-08-mobile-nav-menu/final-summary.md is the final summary ... what was implemented, what evidence exists, what commits were made and what comes next:

# Final Summary: 2026-08-08-mobile-nav-menu
**Status:** done · **Archived:** yes · **Verified:** PASS (11/11 tasks)

## Verification evidence
- verify.md ... PASS, 11/11
- coverage.json ... 3/3 covered
- PHPUnit 160 tests, Codeception 13 tests, PHPStan 0, CS-Fixer 0, Rector 0

## Commits
- 4daf2c6 feat(nav): add CSS-only mobile nav menu ...

This isn't "the AI wrote that it works". It's an evidence trail ... a chain of evidence anyone can check. AI Factory doesn't say "trust me"; it says "look at these files".

Aif-evolve ... an AI that learns from its own mistakes

And now the most interesting part. In .ai-factory/evolutions/ lies the file 2026-08-09-11.35.md ... an evolution from this morning.
It's a record of what AI Factory learned from previous mistakes:

## Recurring patterns
- series growth broke cross-links (2×)     ← while writing parts 1-4 the
                                               cross-links broke twice
- curly-quote edit failures (2×)           ← editing quotes failed twice

## Improvements Applied
- Series cross-linking rule: when a series grows, update EVERY previous part
  + verify bidirectional nav by grepping blog/ links
- Ground every part in real project code (verified via grep before writing)
- Series verification checklist (HTTP 200 per part, tables/code blocks,
  cross-links, index card count + BlogIndexTest)

And here's the meta-layer that ends the whole series: **this article is proof of this evolution.** It was created exactly according to the rules AI Factory wrote down this morning: it's grounded in real files (config.yaml, verify.md, final-summary.md ... I read all of them before writing), the cross-links to parts 1–4 are updated and tested through BlogIndexTest. AI learns ... and that learning is also part of the repo, not a secret in someone's head.

Who decides? The human, not the AI

But the most important thing at the end of the series: **the AI doesn't make decisions ... the AI prepares and documents them.** All along we've seen how it works:

StepThe AI doesThe human decides
IdeaFormulates the request into a changeWhat we're solving at all
DesignPrepares a proposal + facts from codeWhich approach we take (email vs. id…)
Non-goalsProposes what we DON'T doWhat's in scope
ReviewFinds problems (F0/F1/F2…)Which ones we fix and how
VerdictGenerates evidence and a verdictWhether to approve and archive

In this series it was visible live: when the review found three problems, the assistant didn't say "I'll fix everything" ... it asked.
And the answers were selective: some fixes yes, some "only critical", some "nothing, just a record". AI Factory delivers **options and consequences**; the choice is human.

Human + AI = a team that remembers

Let's summarize the whole series in three sentences:

  1. OpenSpec turns decisions into history ... five files per change,

the archive as the project's memory.

  1. Four layers turn claims into evidence ... spec, code, tests and QA

check each other; nothing is accepted on "well, it probably works".

  1. AI Factory turns the workflow into a team ... AI prepares,

documents and verifies; the human decides; and both read the same manual and the same archive.

And maybe the nicest thing of all is that **this series itself is a product of this system** ... it came to be through the same workflow it talks about, and its lessons returned to the evolutions to help others.
That's a closed circle that moves one step forward with every change.
Thank you for reading this far. And if you want to see how it all looks in practice ... open openspec/changes/archive/ and read a few changes.
Each one is a story.

Sources

Comments (0)

No comments yet — be the first to react.

Reader questions (0)

No questions yet — be the first to ask.

Stuck on something in this article? Ask below. Your name is shown publicly; your email is never stored. A question appears here once a moderator approves it.