1. Starting Point: The Gap Between Anthropic’s Vision and Reality
Anthropic’s core idea is: don’t start every AI conversation from scratch—let the AI see the project’s “memory” from the beginning. This “memory” includes:- Project tech stack and architecture specifications
- Code style conventions
- Previously discussed design decisions
- Solutions to common problems
- What about multiple developers working simultaneously? If everyone’s progress is recorded in a single file, conflicts are inevitable.
- What if specification documents are too long? Our frontend spec has over 1600 lines, backend specs have hundreds more. Feeding everything to AI would blow the token limit, and most content isn’t relevant to the current task anyway.
- How do we ensure code quality? AI-written code can’t go directly to the main branch—someone needs to review and test it.
- How do we track AI’s work? If something goes wrong, how do we trace what the AI actually did?
2. Implementation: Four Core Design Decisions
1. Multi-Person Collaboration: Each Developer Gets an Independent Progress Folder
Anthropic’s article barely mentions multi-person collaboration, but this is unavoidable in real projects. Our approach: create an independent folder for each developer (including AI) underworkflow/agent-progress/.
For example:
index.md that records what this developer is currently working on, how far they’ve progressed, and what problems they’ve encountered. AI reads this file before starting work to understand context; after work, it updates this file to record new progress.
This way multiple developers can work simultaneously without interfering with each other.
2. Solving Information Overload: Two-Layer Index System
As mentioned, our spec documents are long (frontend 1600+ lines, backend hundreds of lines). In practice, we found that feeding complete documents to AI causes several problems: Why do we need a structured system?- Information overload: When AI needs to implement a “keyboard shortcut feature,” if it reads all 1600 lines of frontend specs, it gets distracted by irrelevant content—like “API calling conventions,” “state management specs,” etc. These are important but unhelpful for the current task, reducing AI’s focus.
- Token economics: In long conversations, if we read complete documents every time, token consumption accumulates rapidly. With 20 rounds of interaction, repeatedly reading documents wastes significant cost.
- Knowledge navigation: Developers (and AI) need to quickly answer “I’m implementing feature X—which part of the spec should I read?” Without a clear navigation system, they can only rely on full-text search or reading chapter by chapter, which is very inefficient.
Our Solution: Two-Layer Structure
We designed anindex.md + doc.md two-layer knowledge system:
index.md is a lightweight navigation table that lists all spec chapters with explicit line number ranges. More importantly, it’s organized by development task type, not document structure.
For example:
- Instant Knowledge Access: AI only needs to read ~100 lines of index.md to locate “implementing keyboard shortcuts requires reading lines 876-1425” within seconds. This is much faster than full-text search or browsing chapter by chapter.
-
On-Demand Loading: AI reads only relevant sections of
doc.mdbased on the current task (e.g., 500 lines instead of 1600). This saves tokens while avoiding information overload. - Standardized Workflow: This two-layer structure becomes a team standard—everyone (including AI and newly joined human developers) knows “read index first, then doc.” This reduces cognitive load and improves collaboration efficiency.
-
AI reads
index.mdto understand the overall spec structure - Based on the current task (e.g., “implement keyboard shortcut”), AI finds “Writing Command Palette → L876-1425” in the navigation table
-
AI precisely reads lines 876-1425 of
doc.mdfor detailed implementation guidance - AI writes code following the spec, avoiding “not knowing where to start” or “missing key details”
Fundamental Difference from Claude Skills
You might ask: Didn’t Anthropic release Claude Skills? Why not just use Skills instead of building this structure ourselves? This is because they solve different problems:- Claude Skills are ecosystem-driven general capability packages, designed for cross-project reuse. Things like “git operations,” “Python testing,” “filesystem operations”—these capabilities apply to any project. Skills pursue breadth and reusability.
- Our structure is a project-specific deep customization system that indexes and stores Mosi project’s specific architecture, tech stack, state management patterns, API calling conventions, etc. This knowledge is unique to the project and cannot be reused across projects. Our system pursues depth and precision.
- Skills can teach AI: “How to write a React component” (general knowledge)
- Our doc.md teaches AI: “In the Mosi project, how to write components following our specific architecture (Monorepo + Turborepo), state management patterns (Zustand + URL state sync), API calling conventions (tRPC + SSE + Tool Calls)” (project-specific knowledge)
3. Encapsulating Best Practices: Short Command System
To standardize the development process, we defined a series of “short commands,” each corresponding to a specific operation. Short commands are stored in the.cursor/commands/ directory, each command as a .md file.
Currently common short commands include:
-
/init-agent: Initialize AI session, having AI read the current developer’s progress and relevant specs -
/check-frontend: Have AI check if frontend code follows specifications -
/check-backend: Have AI check if backend code follows specifications -
/record-agent-flow: Record this AI session’s work content to the progress file
.md file contains a complete AI instruction.
For example, check-frontend.md might contain:
/check-frontend and hits enter:
-
Cursor automatically reads the content of
.cursor/commands/check-frontend.md - Injects this content as a prompt into the current conversation
- AI performs the corresponding check operations based on this prompt
/check-frontend, which is equivalent to sending a carefully designed complete prompt, ensuring instruction consistency and completeness.
Plus, short commands can be shared across the team, so new members can immediately benefit from accumulated team experience.
Think of short commands as a kind of prompt SDK—using a short command is like calling a specialized SDK our team built for a specific scenario
4. Quality Gate: Human Developer Review Mechanism
Although AI can write code, we don’t let AI commit directly. All code requires human developer review and testing before it can be committed. The typical flow is:- AI writes code
- Developer runs locally to check if functionality works
- Developer reviews code for obvious issues
- If there are problems, have AI fix them; if not, developer commits manually
3. Practice: A Complete Development Flow
The design concepts above might still be abstract. Below is a real example showing the complete development flow. Background: I need to implement a keyboard shortcut feature on the frontend—pressingCmd+K to open the search box. I’ve already created a Git branch feat/keyboard-navigation locally.
Step 1: Initialize AI Session
init-agent.md into the conversation. This template defines the initialization steps AI needs to perform:
AI executes according to short command guidance:
-
Read
workflow/agent-progress/taosu/index.mdto understand my current progress and context -
Read
workflow/frontend-structure/index.mdto understand the overall frontend spec structure -
If needed, read further into relevant chapters of
doc.md
Step 2: Describe Requirements
-
Based on the “keyboard shortcut” keyword, read the “Keyboard System” chapter in
workflow/frontend-structure/doc.md -
Learn that the project already has a
useKeyboardShortcuthook ready to use - Write code: call this hook in the appropriate place to bind Cmd+K shortcut
Step 3: Local Testing
I run the project locally, pressCmd+K, search box opens successfully. Feature works.
Step 4: Code Self-Check
check-frontend.md (a detailed code check list) into the conversation.
AI executes check according to short command template:
Following check items defined in the template, reviews the code just written:
- Check if component naming follows conventions
- Check if React hooks dependency arrays are complete
- Check if type definitions are strict
-
Check for potential performance issues
…
Step 5: Commit Code
Step 6: Record Flow
record-agent-flow.md into the conversation—this template guides AI on how to record the workflow.
AI executes according to template guidance:
- Summarize this session’s work content (requirements, implementation approach, problems encountered, solutions, etc.)
-
Format and append this information to
workflow/agent-progress/taosu/index.md
4. Pitfalls and Solutions
Problem 1: Learning Curve for Short Commands
New team members need to learn which short commands exist and what each does. We provide an/onboard-developer short command to guide newcomers. New members just run this command, and AI follows the preset guidance flow to introduce the entire workflow system, common short commands, and how to start the first task.
Problem 2: AI “Forgets” Specs in Long Conversations
Even if AI reads all specs via/init-agent at session start, as conversation turns increase and context lengthens, AI may gradually “forget” the initially read development spec details. This causes AI to drift from spec requirements when writing code.
Our solution: use short commands at key points to force AI to re-consult specs.
For example, the /check-frontend short command template explicitly requires AI to:
-
First use
git statusto see which code was just modified -
Based on the change type (e.g., “added a new Hook”), find the corresponding chapter in
index.md -
Re-read the relevant part of
doc.md(e.g., “Hook dev spec L179-265”) - Check code against specs item by item
5. Summary and Future Plans
Anthropic’s “AI long-term memory” concept is valuable, but truly implementing it in real multi-person collaborative projects requires solving many engineering problems. Our practice in the Mosi project did these core things:- Multi-person collaboration support: Each developer has an independent progress folder
- Spec index system: index.md + doc.md structure lets AI efficiently find specs
- Short command system: Encapsulates common operations, improves development efficiency
- Human in the loop: AI writes code, humans review and commit, ensuring quality
- Automate more processes: e.g., let AI automatically create branches, automatically write commit messages
- Smarter spec indexing: Currently AI manually judges which chapters to read; in the future, AI could automatically match relevant chapters based on task descriptions
- Team knowledge base: Organize design decisions discussed by the team and pitfalls encountered into documentation, so AI can learn from this experience
Resources
- Anthropic’s original article: Building effective agents