AlexandrAI AGENTS.md
agents-md

Thinklogi Create Flow Local Storage Agent Guide

Agent guide for the local create flow, saved posts, and mine results screen.

AGENTS.md

Guidance for coding agents working on Thinklogi Create Flow Local Storage in the thinklogi project.

Project overview

This guide covers the create and mine screens in public/app.js. The app stores user-created posts and votes in localStorage, merges saved posts with seed posts, lets users submit a two-choice dilemma, and renders local result cards under the mine tab.

Primary source files

  • public/app.js owns POSTS_KEY, VOTES_KEY, loadPosts, persist, renderCreate, submitPost, renderMine, and mineCard.
  • public/decisionLogic.mjs owns createDecisionPost and vote helpers.
  • public/index.html and public/styles.css provide the static shell and mobile layout.

Setup commands

npm run harness:init npm run harness:tick npm run harness:run npm test npm run build npm run dev

Change rules

  • Persist only user-created posts under the posts key.
  • Keep seed posts available without duplicating saved ids.
  • Require title and both choice labels before creating a post.
  • Keep saved votes and posts JSON-serializable.
  • Escape all user-visible text when rendering into HTML.

Testing

Cover saved post merge, invalid JSON fallback, required create fields, user-created post ordering, mine tab empty state, mine card vote counts, and HTML escaping.

PR checklist

  • localStorage keys remain stable.
  • create flow does not accept an empty A or B choice.
  • npm test and npm run build pass.