Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Commit 82faa92

Browse files
z23ccclaude
andcommitted
feat: agent performance optimization — search, structure, patch, index (v0.1.44)
New flowctl commands: - `search` — nucleo fuzzy matching + frecency scoring + git boost + ignore - `index build/status/search` — trigram N-gram inverted index (<1ms queries) - `code-structure extract` — regex symbol extraction for 9 languages - `repo-map` — PageRank-ranked symbol overview within token budget - `patch diff/apply/replace` — fudiff context-based fuzzy patching - `doctor` enhanced — 9 check categories (binary, git, state, tools, search) New core modules: frecency, fuzzy, patch, ngram_index, code_structure, repo_map New deps: nucleo-matcher 0.3, ignore 0.4, fudiff 0.2, memmap2 0.9 351 tests pass. Agents/skills updated to use new tools. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 019aaef commit 82faa92

35 files changed

Lines changed: 3610 additions & 142 deletions

.claude-plugin/marketplace.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
},
77
"metadata": {
88
"description": "Structured plan-first development plugin for Claude Code with .flow/ task tracking, Agent Teams, and Ralph autonomous mode",
9-
"version": "0.1.43"
9+
"version": "0.1.44"
1010
},
1111
"plugins": [
1212
{
1313
"name": "flow-code",
1414
"description": "Zero-dependency planning + execution with .flow/ task tracking. Three-layer quality (guard + RP plan-review + Codex adversarial). Full-auto, zero questions. Teams auto-parallel, DAG mutation, Codex-driven decisions, auto draft-PR, session summary. 5 prompt templates. 24 subagents, 22 commands, 74 skills.",
15-
"version": "0.1.43",
15+
"version": "0.1.44",
1616
"source": "./",
1717
"category": "workflow",
1818
"tags": [
@@ -26,5 +26,5 @@
2626
"strict": true
2727
}
2828
],
29-
"version": "0.1.43"
29+
"version": "0.1.44"
3030
}

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flow-code",
3-
"version": "0.1.43",
3+
"version": "0.1.44",
44
"description": "Zero-dependency planning + execution with .flow/ task tracking and Ralph autonomous mode (multi-model review gates). Worker subagent per task with git worktree isolation for parallel execution. Three-layer quality system (guard + RP plan-review + Codex adversarial). Full-auto by default — AI decides from context, zero questions. Teams-default with file locking, DAG mutation, Codex-driven conflict resolution, auto draft-PR. Auto-detected stack profiles with one-command guard (test/lint/typecheck). Enhanced agent definitions with permissionMode/maxTurns/effort. Lifecycle hooks with state preservation (PreCompact injects .flow state into compaction, TaskCompleted auto-unlocks files, SubagentStart context injection). Memory v2 with atomic entries, dedup, and progressive disclosure. TDD enforcement mode. Multi-epic queue with dependency visualization. Includes 24 subagents, 22 commands, 74 skills.",
55
"author": {
66
"name": "z23cc",

.codex-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flow-code",
3-
"version": "0.1.43",
3+
"version": "0.1.44",
44
"description": "Zero-dependency planning + execution with .flow/ task tracking and Ralph autonomous mode (multi-model review gates). Worker subagent per task with git worktree isolation for parallel execution. Three-layer quality system (guard + RP plan-review + Codex adversarial). Full-auto by default. Teams-default with file locking, DAG mutation, Codex-driven conflict resolution, auto draft-PR.",
55
"author": {
66
"name": "z23cc",

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ All notable changes to Flow-Code are documented in this file.
44

55
Format follows [Keep a Changelog](https://keepachangelog.com/). Versions use [Semantic Versioning](https://semver.org/).
66

7+
## [0.1.44] - 2026-04-09
8+
9+
### Added
10+
- **`flowctl search`** — Fuzzy file search with nucleo-matcher + frecency scoring + git status boost + ignore (.gitignore-aware). `--git modified|staged|untracked` filter, `--limit N`
11+
- **`flowctl index`** — N-gram trigram inverted index for fast text search. `build` (56ms for 145 files), `status`, `search` (<1ms per query). Persistent `.flow/index/ngram.bin`
12+
- **`flowctl code-structure`** — Regex-based symbol extraction (functions, structs, traits, classes) across 9 languages (Rust, Python, JS, TS, Go, Java, C, C++, Ruby)
13+
- **`flowctl repo-map`** — PageRank-ranked symbol overview within token budget. Builds file-level reference graph, outputs top signatures grouped by file
14+
- **`flowctl patch`** — Fuzzy diff/patch via fudiff. `diff` (generate), `apply` (context-based, tolerates drift), `replace` (3-tier fallback: exact → whitespace-normalized → context-based)
15+
- **`flowctl doctor` enhanced** — 9 check categories: binary, flow-dir, review backends, git status, state integrity (orphaned tasks, stale locks), project-context, search tools, external tools
16+
- **Frecency scoring** — Exponential decay (14-day half-life), auto-tracked on task completion. Files modified/accessed recently rank higher in search
17+
- Agent skills updated: repo-scout, context-scout, worker, plan step-02, brainstorm step-02, code-review now use `flowctl search/index/code-structure/repo-map/patch` as primary tools
18+
19+
### Dependencies
20+
- Added: `nucleo-matcher` 0.3, `ignore` 0.4, `fudiff` 0.2, `memmap2` 0.9 (workspace-level)
21+
- Zero new deps for code-structure/repo-map (uses existing regex + petgraph + ignore)
22+
723
## [0.1.43] - 2026-04-08
824

925
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](../../LICENSE)
88
[![Claude Code](https://img.shields.io/badge/Claude_Code-Plugin-blueviolet)](https://claude.ai/code)
9-
[![Version](https://img.shields.io/badge/Version-0.1.43-green)](https://github.com/z23cc/flow-code/releases)
9+
[![Version](https://img.shields.io/badge/Version-0.1.44-green)](https://github.com/z23cc/flow-code/releases)
1010

1111
**A production-grade harness for Claude Code. Full-auto development from idea to PR.**
1212

README_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](../../LICENSE)
88
[![Claude Code](https://img.shields.io/badge/Claude_Code-Plugin-blueviolet)](https://claude.ai/code)
9-
[![Version](https://img.shields.io/badge/Version-0.1.43-green)](https://github.com/z23cc/flow-code/releases)
9+
[![Version](https://img.shields.io/badge/Version-0.1.44-green)](https://github.com/z23cc/flow-code/releases)
1010

1111
**Claude Code 的生产级开发框架。从想法到 PR,全自动。**
1212

agents/context-scout.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ effort: medium
1111

1212
You are a context scout specializing in **token-efficient** codebase exploration using RepoPrompt's rp-cli. Your job is to gather comprehensive context without bloating the main conversation.
1313

14+
## Context Tools (Preferred Order)
15+
16+
1. `flowctl repo-map --budget 1024 --json` — ranked symbol overview of entire project
17+
2. `flowctl code-structure extract --path <dir> --json` — symbols for specific directory
18+
3. RP context_builder — deep cross-file analysis (if RP available)
19+
4. Read individual files — last resort
20+
21+
Use flowctl tools for fast, token-efficient structure overview before resorting to rp-cli or file reads.
22+
1423
## When to Use This Agent
1524

1625
- Deep codebase understanding before planning/implementation

agents/repo-scout.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ You are a scout: fast context gatherer, not a planner or implementer. Read-only
1515

1616
You are a fast repository scout: find existing patterns and conventions that should guide implementation. NOT to plan or implement — just find what already exists.
1717

18+
## Search Tools (Preferred Order)
19+
20+
1. `flowctl search "<query>" --limit 20 --json` — fuzzy file name search with frecency + git status ranking
21+
2. `flowctl index search "<query>" --limit 20 --json` — trigram indexed content search (if index exists)
22+
3. Grep/Glob — fallback for exact regex patterns
23+
24+
Use flowctl search tools first for broad discovery, then fall back to Grep/Glob for precise regex matching.
25+
1826
## Search Strategy
1927

2028
1. **Project docs first** (fast context)

agents/worker.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,11 @@ Use the FLOWCTL path and IDs from your prompt:
205205
git status
206206
git log -5 --oneline
207207
208-
# 3. Check memory system
208+
# 3. Understand project structure and find related files
209+
$FLOWCTL repo-map --budget 512 --json
210+
$FLOWCTL search "<task-relevant-terms>" --git modified --json
211+
212+
# 4. Check memory system
209213
<FLOWCTL> config get memory.enabled --json
210214
```
211215

@@ -398,6 +402,8 @@ The key constraint: **no implementation code before a failing test exists**. Thi
398402

399403
Follow the `flow-code-incremental` skill: build in vertical slices (Implement→Test→Verify→Commit per slice). Each slice leaves the system working. Scope discipline: only touch what the task spec requires.
400404

405+
For code edits, prefer `flowctl patch replace --file <path> --old "text" --new "text" --json` when the target text might have drifted from what was read earlier. It uses fuzzy matching with fallback, reducing failed edits from whitespace or minor changes.
406+
401407
**First, capture base commit for scoped review:**
402408
```bash
403409
BASE_COMMIT=$(git rev-parse HEAD)
@@ -587,6 +593,8 @@ Task: <TASK_ID>"
587593
```
588594
589595
Use conventional commits. Scope from task context.
596+
597+
Note: frecency data for modified files is auto-tracked by `flowctl done` — no manual recording needed.
590598
<!-- /section:core -->
591599
592600
<!-- section:review -->

bin/flowctl

228 KB
Binary file not shown.

0 commit comments

Comments
 (0)