Skip to main content

Learn kapi › The content engine

A project remembers

Set up a project, give it memory and terms, and hold a draft to them.

Ad hoc, nothing is kept between runs. A project keeps a content memory, a terms store and a record. This lab sets one up around KapiMart with kapi init, reads its context in, approved French pairs and the vocabulary, holds a returned draft to the terms, catches brand words in a new page, and runs the loop.

  1. Set up a projectkapi init --name kapimart --target-locale fr --target-locale de --target-locale ja --agents none --no-rules-fileskapi init writes a recipe for the content it recognises. It found the Markdown; the catalog it leaves to you, because a JSON file could be anything.
  2. Claim the catalogkapi add src/en.json --target 'src/{lang}.json'kapi add claims the catalog and says where its translations go. The template names the locale, so fr.json, de.json and ja.json are its targets.
  3. Standing, derived from the fileskapi statuskapi status derives each language's standing from what is on disk: French complete, German two thirds, Japanese one third. No gate is declared yet, so nothing is withheld.
  4. Read the context inkapi store import ./contextThe context arrives as files under context/, in two kinds. The terms carry the product and payment names kept as written in every language, the shop words with their renderings, and the brand's forbidden words beside the word to use instead. The content memory carries approved French pairs from earlier work, in the memory's own form. One import reads both into the project's store.
  5. What the memory holdskapi memory search cartApproved pairs, source beside target. The recycle step reads these before any provider is asked, so a string the shop has already translated is never drafted again.
  6. What a writer reads firstkapi context src/en.json | head -10The brief for the catalog, from the terms just imported.
  7. Hold a draft to the termskapi exec term-check src/en.json --target src/fr-draft.json --target-lang frA French draft someone sent back. The terminology check holds it to the terms: chariot where the terms say panier, and two payment brands that went missing.
  8. And to its placeholderskapi exec placeholder-check src/en.json --target src/fr-draft.json --target-lang frThe draft also flattened a select. The placeholder check finds that.
  9. Prose is held to the same wordskapi checkA new promo page uses three words the brand does not. The project's check fails on each and names the replacement.
  10. Correct the pageksed -i 's/Leverage our seamless checkout and the KapiMart Copilot/Use the KapiMart checkout and the AI assistant/' src/promo.mdOne edit takes the house words.
  11. The check passeskapi checkThe page passes the project's checks. Exit 0 is what a build sees.
  12. Run the loopkapi upkapi up drafts the missing German and Japanese with the demo stub, after recycling what the catalogs and the memory already hold. Japanese waits for review on a failing check, for a person to look at.
  13. Every language caught upkapi statusThree languages at 100%, one of them waiting for a person.