<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Matteo Turri</title>
    <description>The latest articles on DEV Community by Matteo Turri (@matteoturri).</description>
    <link>https://dev.to/matteoturri</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3993270%2F139942b5-d2fc-4377-a562-b9d69f03e0c7.png</url>
      <title>DEV Community: Matteo Turri</title>
      <link>https://dev.to/matteoturri</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/matteoturri"/>
    <language>en</language>
    <item>
      <title>Stop Wasting Tokens: I Built a File-Mapping Standard for AI-Assisted Development</title>
      <dc:creator>Matteo Turri</dc:creator>
      <pubDate>Fri, 19 Jun 2026 21:49:29 +0000</pubDate>
      <link>https://dev.to/matteoturri/stop-wasting-tokens-i-built-a-file-mapping-standard-for-ai-assisted-development-o25</link>
      <guid>https://dev.to/matteoturri/stop-wasting-tokens-i-built-a-file-mapping-standard-for-ai-assisted-development-o25</guid>
      <description>&lt;p&gt;Every time I started a new AI chat session, it read my entire codebase.&lt;/p&gt;

&lt;p&gt;50 files. Thousands of tokens. On every single message. Whether I was asking about authentication, database schema, or a single UI component — the AI read everything.&lt;/p&gt;

&lt;p&gt;I'm 16 and building AI-powered products. Token costs add up fast. Context windows fill up. The AI loses track of older files. Responses slow down.&lt;/p&gt;

&lt;p&gt;So I built something to fix it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;When you work with AI on large projects, you face a choice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Give the AI too much context → burns tokens, hits context limits, slower responses&lt;/li&gt;
&lt;li&gt;Give it too little → AI misses important files, makes wrong assumptions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There's no middle ground — or at least there wasn't.&lt;/p&gt;




&lt;h2&gt;
  
  
  Introducing FolioDux
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;FolioDux&lt;/strong&gt; is a lightweight, open-source file-mapping standard for AI-assisted development.&lt;/p&gt;

&lt;p&gt;The idea is simple: instead of giving your AI every file, you give it a compact index that tells it &lt;em&gt;where everything is&lt;/em&gt; and &lt;em&gt;what it does&lt;/em&gt;. The AI reads the index first, identifies the relevant files, and reads only those.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One file. Two rules. Any AI.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It works with Claude, ChatGPT, Gemini, Cursor, Copilot — any tool that accepts a system prompt.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;You add one file — &lt;code&gt;FOLIODUX.md&lt;/code&gt; — to your project root.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# FOLIODUX · TaskFlow · v1.0 · 2026-06-18 · 17 files&lt;/span&gt;

STACK: React19+TypeScript+Vite · Express+SQLite · JWT
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gu"&gt;## TASKS&lt;/span&gt;
auth/login/register   → AuthView.tsx, authService.ts, server.ts
create/edit task      → TaskForm.tsx, taskService.ts, server.ts, types.ts
list/filter tasks     → TaskList.tsx, taskService.ts
database              → db.ts, server.ts
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gu"&gt;## INDEX&lt;/span&gt;
App.tsx           | fe  | root: routing, auth state, layout wrapper
AuthView.tsx      | fe  | login + register forms, error display
taskService.ts    | svc | CRUD tasks, local cache, optimistic updates
server.ts         | be  | Express: all routes — auth, tasks, projects, user
db.ts             | be  | SQLite setup, schema creation, migrations on boot
types.ts          | typ | Task, Project, User, Status(todo|in-progress|done)
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gu"&gt;## GROUPS&lt;/span&gt;
Frontend:  App.tsx · AuthView.tsx · TaskList.tsx · TaskForm.tsx
Services:  authService.ts · taskService.ts
Backend:   server.ts · db.ts
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gu"&gt;## NOTES&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; All routes except /api/auth/&lt;span class="err"&gt;*&lt;/span&gt; require Authorization: Bearer {JWT}
&lt;span class="p"&gt;-&lt;/span&gt; Task status values: todo | in-progress | done only
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you add two rules to your AI system prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;RULE 1 — NAVIGATE BEFORE RESPONDING
At the start of every response, before reading any other file:
&lt;span class="p"&gt;1.&lt;/span&gt; Read FOLIODUX.md in full.
&lt;span class="p"&gt;2.&lt;/span&gt; Check TASKS — if the request matches a keyword, read ONLY those files.
&lt;span class="p"&gt;3.&lt;/span&gt; If no match in TASKS, scan INDEX keywords to identify relevant files.
&lt;span class="p"&gt;4.&lt;/span&gt; Read ONLY the identified files. Never read the full codebase unless asked.

RULE 2 — UPDATE AFTER CREATING
After creating any new file, add one line to FOLIODUX.md INDEX:
{filename} | {type} | {keywords — no articles, no filler verbs, max 8 words}
Update TASKS and GROUPS if needed.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Your AI now navigates the project like a developer who already knows the codebase.&lt;/p&gt;




&lt;h2&gt;
  
  
  Before vs After
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Without FolioDux:&lt;/strong&gt;&lt;br&gt;
You ask "fix the login bug". Your AI reads all 50 files. Uses 4,000 tokens before even starting to think about your question. Maybe hits the context limit halfway through.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;With FolioDux:&lt;/strong&gt;&lt;br&gt;
Your AI reads &lt;code&gt;FOLIODUX.md&lt;/code&gt;, finds &lt;code&gt;auth/login → AuthView.tsx, authService.ts, server.ts&lt;/code&gt;, reads 3 files. Uses ~300 tokens. Answers faster and more accurately.&lt;/p&gt;


&lt;h2&gt;
  
  
  Quick Start
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Step 1 — Generate your FOLIODUX.md automatically
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-O&lt;/span&gt; https://raw.githubusercontent.com/matteo-turri/foliodux/main/foliodux-init.mjs
node foliodux-init.mjs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The CLI script scans your project, detects the tech stack from &lt;code&gt;package.json&lt;/code&gt;, classifies every file by type, extracts descriptions from comments and exports, and generates &lt;code&gt;FOLIODUX.md&lt;/code&gt; in seconds.&lt;/p&gt;

&lt;p&gt;Zero external dependencies. Node.js 18+ only.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 2 — Complete the TASKS section
&lt;/h3&gt;

&lt;p&gt;The only part the script can't fill automatically. Open &lt;code&gt;FOLIODUX.md&lt;/code&gt; and map your most common requests to the files they need:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## TASKS&lt;/span&gt;
auth/login/register   → AuthView.tsx, authService.ts, server.ts
create/edit product   → ProductForm.tsx, productService.ts, server.ts, types.ts
payment/checkout      → CheckoutView.tsx, paymentService.ts, server.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3 — Add the protocol to your AI tool
&lt;/h3&gt;

&lt;p&gt;Copy the two rules above into your AI tool's system prompt. Templates for Claude Projects, ChatGPT, Cursor, and generic tools are available in the repo.&lt;/p&gt;




&lt;h2&gt;
  
  
  The File Format
&lt;/h2&gt;

&lt;p&gt;FolioDux uses a compressed keyword syntax designed to be readable by both humans and AI while using as few tokens as possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description rules:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No articles (the, a, an)&lt;/li&gt;
&lt;li&gt;No filler verbs (handles, manages, is responsible for)&lt;/li&gt;
&lt;li&gt;Max 8 keywords per file&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;+&lt;/code&gt; for "and", &lt;code&gt;|&lt;/code&gt; for "or", &lt;code&gt;→&lt;/code&gt; for "calls"&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;❌ Verbose&lt;/th&gt;
&lt;th&gt;✅ FolioDux&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;This is the main server file that handles all the API routes&lt;/td&gt;
&lt;td&gt;Express: all routes — auth, tasks, projects, user&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A service that manages authentication and user sessions&lt;/td&gt;
&lt;td&gt;login, register, logout, JWT session storage&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Type codes:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Code&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;fe&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Frontend component&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;be&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Backend / API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;svc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Service / logic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cfg&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Config / build&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;typ&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Types / interfaces&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;doc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Documentation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tst&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Test&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dpl&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Deploy / infra&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Design Principles
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;One file.&lt;/strong&gt; No config, no database, no server. Just a Markdown file in your project root.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tool-agnostic.&lt;/strong&gt; Works with any AI that accepts a system prompt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token-first.&lt;/strong&gt; Every design decision optimizes for token efficiency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Self-updating.&lt;/strong&gt; Rule 2 makes the AI maintain the index automatically as the project grows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Human-readable.&lt;/strong&gt; Valid Markdown. Open, edit, and version-control it like any other file.&lt;/p&gt;




&lt;h2&gt;
  
  
  Get Started
&lt;/h2&gt;

&lt;p&gt;The full project — including the CLI script, prompt templates for Claude/ChatGPT/Cursor, and a complete example — is on GitHub:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;→ &lt;a href="https://github.com/matteo-turri/foliodux" rel="noopener noreferrer"&gt;github.com/matteo-turri/foliodux&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open source. MIT license. Stars and feedback welcome.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built this to solve my own problem while working on my projects. I'm 16 and based in Milan — if you try FolioDux, let me know what you think in the comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>tooling</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
