fcontext 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,379 @@
1
+ Metadata-Version: 2.4
2
+ Name: fcontext
3
+ Version: 1.0.0
4
+ Summary: Context continuity across AI agents & sessions. Team knowledge collaboration. Industrial-grade AI delivery.
5
+ License: Apache-2.0
6
+ Requires-Python: >=3.9
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: markitdown
9
+ Provides-Extra: test
10
+ Requires-Dist: pytest>=7.0; extra == "test"
11
+
12
+ # fcontext
13
+
14
+ **Context continuity across AI agents & sessions. Team knowledge collaboration. Industrial-grade AI delivery.**
15
+
16
+ [![PyPI version](https://img.shields.io/pypi/v/fcontext?style=for-the-badge)](https://pypi.org/project/fcontext/)
17
+ [![Python](https://img.shields.io/pypi/pyversions/fcontext?style=for-the-badge)](https://pypi.org/project/fcontext/)
18
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=for-the-badge)](LICENSE)
19
+ [![Agents](https://img.shields.io/badge/agents-6%20supported-green?style=for-the-badge)](#supported-agents)
20
+
21
+ ---
22
+
23
+ ## The Problem
24
+
25
+ AI coding agents are powerful, but they forget everything between sessions, lose all context when you switch agents, and have no way to share knowledge across a team. Every conversation starts from zero.
26
+
27
+ ```
28
+ WITHOUT fcontext
29
+
30
+ Session 1 (Copilot): "Build the auth module"
31
+ Session 2 (Claude): "What auth module? I don't see any context."
32
+ Session 3 (Cursor): "Can you explain the project first?"
33
+ Teammate's Agent: "I have no idea what your team has decided."
34
+
35
+ Result: Repeated explanations. Inconsistent output. Wasted tokens.
36
+ ```
37
+
38
+ ```
39
+ WITH fcontext
40
+
41
+ Session 1 (Copilot): "Build the auth module" -> saves context
42
+ Session 2 (Claude): Reads _README.md + _topics/ -> picks up work
43
+ Session 3 (Cursor): Knows the full project, requirements, history
44
+ Teammate's Agent: Imports experience pack -> instant onboarding
45
+
46
+ Result: Continuous context. Consistent quality. Industrial output.
47
+ ```
48
+
49
+ ---
50
+
51
+ ## Why fcontext
52
+
53
+ ### For Individuals
54
+
55
+ > AI delivers results, but **you** deliver process and experience.
56
+
57
+ Your expertise — how you approach problems, what patterns you've learned, what pitfalls to avoid — is lost every time a session ends. fcontext captures and persists that experience, so your AI gets smarter with every interaction.
58
+
59
+ - **Cross-session memory** — Topics and conclusions survive between conversations
60
+ - **Cross-agent portability** — Switch from Copilot to Claude to Cursor without losing context
61
+ - **Experience visualization** — Your accumulated knowledge becomes a structured, reusable asset
62
+
63
+ ### For Teams & Enterprises
64
+
65
+ > No single agent has all the context to do the job. Real work is distributed.
66
+
67
+ In production environments, context is fragmented: requirements live in documents, domain knowledge lives in people's heads, architecture decisions live in past conversations. fcontext solves distributed context.
68
+
69
+ - **Team knowledge sync** — Export/import experience packs so every team member's agent shares the same domain understanding
70
+ - **Requirements traceability** — Track stories, tasks, bugs with full evolution history — from document to delivery
71
+ - **Compliance-ready** — All data stored locally in `.fcontext/`, no cloud dependency, fully offline capable
72
+ - **Industrial-grade delivery** — Structured context + requirements tracking + document indexing = consistent, auditable AI output
73
+
74
+ ---
75
+
76
+ ## Features
77
+
78
+ | Capability | Description | Data Location |
79
+ |------------|-------------|---------------|
80
+ | **Multi-Agent Support** | Works with all mainstream AI coding agents | Agent-native config files |
81
+ | **Document Indexing** | PDF, DOCX, XLSX, PPTX, Keynote, EPUB to Markdown | `.fcontext/_cache/` |
82
+ | **Dynamic Context Building** | AI accumulates knowledge topics across sessions | `.fcontext/_topics/` |
83
+ | **Experience Packs** | Import/export domain knowledge across projects and teams | `.fcontext/_experiences/` |
84
+ | **Requirements Management** | Stories, tasks, bugs with evolution tracking | `.fcontext/_requirements/` |
85
+ | **Workspace Map** | Auto-generated project structure overview | `.fcontext/_workspace.map` |
86
+ | **Living Project Summary** | AI-maintained `_README.md`, first thing every session reads | `.fcontext/_README.md` |
87
+ | **Offline & Secure** | All data local. No cloud. No API keys. No telemetry. | `.fcontext/` |
88
+
89
+ ### Supported Agents
90
+
91
+ | Agent | Command | Config Format |
92
+ |-------|---------|---------------|
93
+ | GitHub Copilot | `fcontext enable copilot` | `.github/instructions/*.instructions.md` |
94
+ | Claude Code | `fcontext enable claude` | `.claude/rules/*.md` |
95
+ | Cursor | `fcontext enable cursor` | `.cursor/rules/*.md` |
96
+ | Trae | `fcontext enable trae` | `.trae/rules/*.md` |
97
+ | OpenCode | `fcontext enable opencode` | Uses Claude format |
98
+ | OpenClaw | `fcontext enable openclaw` | `skills/` only |
99
+
100
+ ---
101
+
102
+ ## Installation
103
+
104
+ ### Prerequisites
105
+
106
+ - Python 3.9+
107
+ - pip
108
+
109
+ ### Install from PyPI
110
+
111
+ ```bash
112
+ pip install fcontext
113
+ ```
114
+
115
+ ### Verify
116
+
117
+ ```bash
118
+ fcontext --version
119
+ # fcontext 1.0.0
120
+ ```
121
+
122
+ ---
123
+
124
+ ## Quick Start
125
+
126
+ ```bash
127
+ # 1. Initialize in any project
128
+ cd your-project
129
+ fcontext init
130
+
131
+ # 2. Activate your AI agent
132
+ fcontext enable copilot # or: claude, cursor, trae, opencode, openclaw
133
+
134
+ # 3. Index your documents
135
+ fcontext index docs/
136
+
137
+ # 4. Check status
138
+ fcontext status
139
+ ```
140
+
141
+ That's it. Your AI agent now reads project context automatically on every session.
142
+
143
+ ---
144
+
145
+ ## Use Cases
146
+
147
+ ### Scenario 1: Picking Up Where You Left Off
148
+
149
+ **Problem:** You had a deep debugging session yesterday. Today, a new session knows nothing.
150
+
151
+ ```bash
152
+ # fcontext automatically persists session knowledge to _topics/
153
+ # Next session reads _topics/ and _README.md first
154
+
155
+ # To see what was saved:
156
+ fcontext topic list
157
+ fcontext topic show debugging-auth-flow
158
+ ```
159
+
160
+ The new session starts with full context of yesterday's findings.
161
+
162
+ ### Scenario 2: Switching Between Agents
163
+
164
+ **Problem:** You used Cursor for frontend work but need Claude for backend refactoring. Claude has no idea what Cursor did.
165
+
166
+ ```bash
167
+ # Enable both agents — they share the same .fcontext/ data
168
+ fcontext enable cursor
169
+ fcontext enable claude
170
+
171
+ # Both agents read the same _README.md, _topics/, _requirements/
172
+ # Context is agent-agnostic
173
+ ```
174
+
175
+ ### Scenario 3: Onboarding a New Team Member
176
+
177
+ **Problem:** A new developer joins. Their AI has zero project knowledge.
178
+
179
+ ```bash
180
+ # Team lead exports accumulated knowledge
181
+ fcontext export team-knowledge.zip
182
+
183
+ # New member imports it
184
+ fcontext experience import team-knowledge.zip
185
+
186
+ # Their AI instantly knows: architecture, domain concepts, conventions, pitfalls
187
+ fcontext experience list
188
+ ```
189
+
190
+ ### Scenario 4: Working with Binary Documents
191
+
192
+ **Problem:** Product specs are in PDF/DOCX. AI cannot read them.
193
+
194
+ ```bash
195
+ # Convert to Markdown so any agent can read them
196
+ fcontext index specs/product-requirements.pdf
197
+ fcontext index contracts/
198
+
199
+ # AI now references the content directly from _cache/
200
+ fcontext status
201
+ ```
202
+
203
+ ### Scenario 5: Requirements-Driven Development
204
+
205
+ **Problem:** Requirements are scattered across documents, Slack, and meetings. AI builds the wrong thing.
206
+
207
+ ```bash
208
+ # Structure requirements in fcontext
209
+ fcontext req add "User authentication via OAuth" -t story
210
+ fcontext req add "Support Google and GitHub providers" -t task --parent STORY-001
211
+ fcontext req set TASK-001 status in-progress
212
+
213
+ # AI reads _requirements/ and builds against tracked specs
214
+ fcontext req board # Kanban view
215
+ fcontext req tree # Hierarchy view
216
+ ```
217
+
218
+ ### Scenario 6: Sharing Domain Expertise Across Projects
219
+
220
+ **Problem:** You've built deep domain knowledge in Project A. Project B needs the same expertise.
221
+
222
+ ```bash
223
+ # In Project A: export to a git repo
224
+ fcontext export git@github.com:team/domain-knowledge.git
225
+
226
+ # In Project B: import as experience pack
227
+ fcontext experience import git@github.com:team/domain-knowledge.git
228
+
229
+ # Keep it updated
230
+ fcontext experience update
231
+ ```
232
+
233
+ ---
234
+
235
+ ## Commands Reference
236
+
237
+ ### Core
238
+
239
+ | Command | Description |
240
+ |---------|-------------|
241
+ | `fcontext init` | Initialize `.fcontext/` in workspace |
242
+ | `fcontext enable <agent>` | Activate an AI agent |
243
+ | `fcontext enable list` | Show all supported agents and status |
244
+ | `fcontext status` | Show index statistics |
245
+ | `fcontext clean` | Clear cached files |
246
+ | `fcontext reset` | Delete all `.fcontext/` data |
247
+
248
+ ### File Indexing
249
+
250
+ | Command | Description |
251
+ |---------|-------------|
252
+ | `fcontext index` | Scan and convert all files in workspace |
253
+ | `fcontext index <file>` | Convert a specific file |
254
+ | `fcontext index <dir>` | Convert all files in a directory |
255
+ | `fcontext index -f` | Force re-convert even if up-to-date |
256
+
257
+ ### Requirements
258
+
259
+ | Command | Description |
260
+ |---------|-------------|
261
+ | `fcontext req add "title" -t TYPE` | Add item (roadmap/epic/story/task/bug) |
262
+ | `fcontext req list` | List all items (supports `--type`, `--status` filters) |
263
+ | `fcontext req tree` | Hierarchy view |
264
+ | `fcontext req board` | Kanban board by status |
265
+ | `fcontext req show ID` | Item details + changelog |
266
+ | `fcontext req set ID field value` | Update a field |
267
+ | `fcontext req link ID TYPE TARGET` | Link items (supersedes/evolves/relates/blocks) |
268
+ | `fcontext req trace ID` | Follow evolution chain |
269
+ | `fcontext req comment ID "msg"` | Add a comment |
270
+
271
+ ### Topics
272
+
273
+ | Command | Description |
274
+ |---------|-------------|
275
+ | `fcontext topic list` | List accumulated knowledge topics |
276
+ | `fcontext topic show <name>` | Show topic content |
277
+ | `fcontext topic clean` | Remove empty topic files |
278
+
279
+ ### Experience Packs
280
+
281
+ | Command | Description |
282
+ |---------|-------------|
283
+ | `fcontext experience list` | Show imported packs |
284
+ | `fcontext experience import <source>` | Import from zip, git URL, or download URL |
285
+ | `fcontext experience remove <name>` | Remove a pack |
286
+ | `fcontext experience update [name]` | Update from original source |
287
+ | `fcontext export <output>` | Export knowledge to zip or git remote |
288
+
289
+ ---
290
+
291
+ ## How It Works
292
+
293
+ ```
294
+ your-project/
295
+ .fcontext/ # All context data (git-tracked)
296
+ _README.md # AI-maintained project summary
297
+ _workspace.map # Auto-generated structure
298
+ _index.json # File index registry
299
+ _cache/ # Converted documents (Markdown)
300
+ _topics/ # Session knowledge & conclusions
301
+ _requirements/ # Stories, tasks, bugs
302
+ items.csv # Structured data
303
+ _backlog.md # Auto-generated summary
304
+ docs/ # Per-item details
305
+ _experiences/ # Imported domain knowledge (read-only)
306
+ <pack-name>/
307
+ _README.md
308
+ _cache/
309
+ _topics/
310
+
311
+ .github/instructions/ # Copilot (auto-generated by fcontext enable)
312
+ .claude/rules/ # Claude (auto-generated)
313
+ .cursor/rules/ # Cursor (auto-generated)
314
+ .trae/rules/ # Trae (auto-generated)
315
+ ```
316
+
317
+ Each AI agent gets instructions in **its native format**. The instructions teach the agent to:
318
+
319
+ 1. **Read** `.fcontext/_README.md` first to understand the project
320
+ 2. **Check** `_cache/` before trying to read binary files
321
+ 3. **Use** `fcontext req` commands for requirements (never parse CSV manually)
322
+ 4. **Save** important conclusions to `_topics/` for future sessions
323
+ 5. **Read** `_experiences/` for imported domain knowledge
324
+
325
+ ---
326
+
327
+ ## For Contributors
328
+
329
+ We welcome contributions! Here's how to get started:
330
+
331
+ ```bash
332
+ # 1. Fork and clone the repository
333
+ git clone https://github.com/<your-fork>/fcontext.git
334
+ cd fcontext
335
+
336
+ # 2. Install in development mode
337
+ pip install -e ".[test]"
338
+
339
+ # 3. Run the test suite
340
+ pytest tests/
341
+ # 213 tests should pass
342
+
343
+ # 4. Understand the structure
344
+ # fcontext/
345
+ # cli.py # CLI entry point & argument parsing
346
+ # init.py # Workspace initialization & agent configs
347
+ # indexer.py # File scanning, conversion, text copy
348
+ # experience.py # Experience pack import/export/update
349
+ # requirements.py # Requirements CRUD & reporting
350
+ # topics.py # Topic management
351
+ # workspace_map.py # Project structure generation
352
+
353
+ # 5. Make your changes, add tests, verify
354
+ pytest tests/ --tb=short
355
+
356
+ # 6. Create a PR (never push directly to main)
357
+ git checkout -b feat/your-feature
358
+ git commit -m "feat: description"
359
+ git push -u origin feat/your-feature
360
+ ```
361
+
362
+ ### Guidelines
363
+
364
+ - Every new feature needs tests
365
+ - Keep `from __future__ import annotations` in all modules (Python 3.9 compat)
366
+ - CLI commands should give clear error messages when `.fcontext/` is not initialized
367
+ - Experience packs under `_experiences/` are always read-only
368
+
369
+ ---
370
+
371
+ ## Star History
372
+
373
+ [![Star History Chart](https://api.star-history.com/svg?repos=anthropic/fcontext&type=Date)](https://star-history.com/#anthropic/fcontext&Date)
374
+
375
+ ---
376
+
377
+ ## License
378
+
379
+ This project is licensed under the [Apache License 2.0](LICENSE).