Example: Image Annotation Tool¶
examples/image-annotation-tool/
is a small theoretical project, written to test the plugin. People draw labelled bounding boxes on images, a
reviewer approves or rejects every task, and approved annotations are exported as COCO JSON. It has a React web app
behind nginx, a FastAPI service, an RQ worker, PostgreSQL, Redis and MinIO, all in Docker Compose. It is not meant
to be run.
The plugin was run on it with /c4-model-agentic-plugin:explain-project, and the brief, the deck and the explorer
below are its output. The explorer's model was later extended to show newer features: use cases, wireframes and a flow colour, a data
layer, icons. Its history is a simulation, labelled DEMO DATA: make-demo-history.mjs replays the project's growth one
basic function at a time, by fictional authors, in ten versions (its deployment diagram grows with them), and the
published explorer embeds it (see
History and diffs). The wireframes are drawn from the page components' code and labelled illustrative: the
project was never run, so there are no screenshots of it. The user stories page came last, written from the same
brief, the explorer's model and the code; it shows those wireframes and three more drawn the same way. For the data
layer the project gained a schemas/ folder
(a JSON Schema of its COCO export file, a small OWL vocabulary of its domain and a JSON-LD context for its task JSON)
next to its SQL migration. No service loads them; they give the Data view a JSON Schema, an ontology and a JSON-LD
context to draw.
-

Open boxes from the system context down to code, step through four scenarios, paint them on the map, draw one inside a container, follow the task lifecycle, browse the data model, look at the wireframes, edit the model, compare its versions, download it as RDF.
-

A reveal.js deck for a new developer: what the tool is for, its containers, the upload, annotate, review and export flows, and the code that implements them.
-

Six stories for the admin, the annotator and the reviewer, each with its journey, acceptance criteria checked against the code and the screens the person sees. Draw and talk over the screens, and download a story to send to a colleague. (The screenshot shows demonstration feedback, DEMO DATA.)
-
The intermediate step: actors, containers, components, relationships, the task state machine and four flows, each with the file it came from.
-
The example code (with
db/migrations/andschemas/for the data), and itscommunications/folder holding the generated files:model.jsandimg/for the explorer,src/for the deck,stories.jsandimg/for the user stories,architecture-history/for the model's versions.
Things to try in the explorer¶
- Press 2 for the containers, then double-click API service to open it.
- In the open box, click ⇅ sequence: the upload scenario is drawn inside the container, with its components as lifelines. Press ▶ play, or click a message to see the code behind it.
- Open Task lifecycle inside the API service to see the statuses a task moves through, drawn as a state machine.
- Press D for the Dynamic tab, then ☰ all scenarios to pick one of the four flows with a description of each. Annotate + submit and Export approved tasks also show their use case.
- Press W on the map and tick two flows: their steps are painted on the arrows, each in its colour.
- Press 3 and open the picture badge on AnnotatePage in the web app: an illustrative wireframe in the viewer.
- Press A for the Data view: seven schemas, from the PostgreSQL tables to the COCO export file and the domain ontology. Click the table images and scroll its panel to Used in; click the row storage_key to follow the object key into MinIO; press W and tick a flow to see what its steps read and write.
- Use the history bar along the bottom: ▴ History (H) lists the ten versions of the simulated history
(sign in and upload, then tasks, annotating, review, the lifecycle, rework, thumbnails, the export and the data
documentation at v1.0, plus an open pull request), ▶ play steps through them so the map grows function by
function, and ⇄ compare (C) draws what changed between two of them (in the Data view, the tables arriving one
by one and
export_jobsrenamedexports). - Press ✎ edit, drag a type from the tool rail onto the map, type its name, then undo it.
- Use export to download the diagram on screen, or the architecture as JSON-LD, Turtle or a
.retegraph, in the terms of the ontology. - Press G on the map for the Mermaid panel: the view on screen as Mermaid text with a live preview. Rename a box in the text, then Apply to the model….
Things to try in the user stories page¶
- Open Reject a task with a comment: the reviewer's part of the review scenario (steps 1 to 12), its acceptance criteria, the review queue wireframe and the lines of code behind each criterion. open it in the explorer ↗ shows the same steps as a sequence diagram.
- On the screen, press ✎ Add feedback. Draw with the pen (P), mark something with a box (B), and add a numbered pin with a note (N). Write a comment and Save feedback. The note stays in your browser.
- Open it again with Edit, press Record and talk while you draw. Play the note in the feedback panel: the strokes come back in step with your voice.
- Download ▾ → This story saves the story with your feedback as one HTML file. Open it from disk: it is the same page, with only that story. Add a note there, download it again, and drop the file on the example page to import it.
- Download ▾ → Feedback as JSON gives every note as data, the input of
extract-feedback.mjs.
Regenerate it¶
cd examples/image-annotation-tool
claude --plugin-dir ../..
> /c4-model-agentic-plugin:explain-project all
The documentation copies the generated index.html files when it is built, so a regenerated example shows up here
on the next publish.