Skip to content

Commit c4f6b4a

Browse files
prosdevclaude
andcommitted
docs: sweep stale references for Phase 2 cleanup
- Update MCP tool count from 9 to 6 everywhere (removed dev_history, dev_plan, dev_gh) - Remove references to deleted CLI commands (dev init, update, stats, dashboard, git, github, plan) - Replace LanceDB/@xenova/transformers references with Antfly/Termite - Rename vectors.lance to vectors in all doc examples - Remove dead tool documentation pages (dev-history.mdx, dev-plan.mdx, dev-github.mdx) - Update .claude/agents for current tool set - Clean examples/README.md of removed tool examples - Update config defaults from 9 to 6 adapters - Remove 3 prompts (analyze-issue, search-github, create-plan) and update tests - Update ARCHITECTURE.md, PLAN.md, vector/README.md for Antfly stack Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2357e88 commit c4f6b4a

57 files changed

Lines changed: 2106 additions & 1576 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/stale-docs-cleanup.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"@prosdevlab/dev-agent": patch
3+
---
4+
5+
### Docs Cleanup & Tool Refinements
6+
7+
**CLI:**
8+
- Removed `dev explore` — merged `--similar-to` flag into `dev search`
9+
- Search threshold default changed from 0.7 to 0 (RRF scores are much lower than cosine similarity)
10+
11+
**MCP Tools:**
12+
- Renamed `dev_inspect``dev_patterns` (focused on pattern analysis)
13+
- Removed `threshold` parameter from `dev_patterns`
14+
- Removed 3 prompts: `analyze-issue`, `search-github`, `create-plan`
15+
16+
**Scanner:**
17+
- Extended default exclusions: `.env*`, `*.min.js`, `*.d.ts`, `generated/`, `.terraform/`, `.claude/`, `*.wasm`, `public/`, `static/`

.claude/agents/bug-investigator.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ User Command → Commander.js → Core Service → Scanner/Vector/GitHub
3636

3737
**Indexing path:**
3838
```
39-
dev index . → Indexer → Scanner (ts-morph/tree-sitter) → Vector Storage (LanceDB)
40-
→ Embedding (@xenova/transformers) → Persisted Index
39+
dev index → Indexer → Scanner (ts-morph/tree-sitter) → Antfly (embed + store + hybrid search)
4140
```
4241

4342
### Phase 3: Identify Root Cause

.claude/agents/logic-reviewer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Every finding MUST include confidence: **HIGH** (verified from code), **MEDIUM**
5555

5656
### Tier 2 (Standard+ Effort)
5757
- [ ] Scanner handles malformed source files gracefully (ts-morph, tree-sitter)
58-
- [ ] Vector storage operations handle LanceDB connection failures
58+
- [ ] Vector storage operations handle Antfly connection failures
5959
- [ ] MCP adapter responses follow the expected schema
6060
- [ ] Event bus listeners cleaned up properly (no memory leaks)
6161
- [ ] Subagent coordinator handles agent failures without crashing

.claude/agents/quick-scout.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,11 @@ Do NOT guess at architectural reasoning or make recommendations.
3535
packages/
3636
core/src/
3737
scanner/ # ts-morph (TS/JS) and tree-sitter (Go) analysis
38-
vector/ # LanceDB vector storage + embeddings
39-
services/ # Coordinator, search, GitHub, health, metrics
38+
vector/ # Antfly vector storage + embeddings
39+
services/ # Coordinator, search, health
4040
events/ # Event bus system
4141
indexer/ # Repository indexing orchestration
4242
map/ # Codebase structure mapping
43-
git/ # Git history indexing
44-
metrics/ # Metrics store
4543
observability/ # Logger integration
4644
4745
cli/src/
@@ -50,7 +48,7 @@ packages/
5048
5149
mcp-server/src/
5250
server/ # MCP server setup
53-
adapters/ # Tool adapters (search, refs, map, history, etc.)
51+
adapters/ # Tool adapters (search, refs, map, inspect, status, health)
5452
formatters/ # Compact and verbose output formatters
5553
utils/ # Logger
5654

.claude/agents/security-reviewer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This agent **NEVER modifies code**. It reports issues for the developer to fix.
4141
### Data Exposure
4242
- [ ] Vector storage doesn't leak sensitive file contents in error messages
4343
- [ ] GitHub integration doesn't expose private repo data unintentionally
44-
- [ ] Embedding model doesn't send data externally (local-only with @xenova/transformers)
44+
- [ ] Embedding model doesn't send data externally (local-only with Antfly/Termite ONNX)
4545

4646
## Output Format
4747

.claude/da-plans/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Implementation deviations are logged at the bottom of each plan file.
1111
|-------|-------------|--------|
1212
| [Core](core/) | Scanner, vector storage, services, indexer | Phase 1: Merged, Phase 2: Draft (indexing rethink) |
1313
| [CLI](cli/) | Command-line interface | Not started |
14-
| [MCP Server](mcp-server/) | Model Context Protocol server + adapters | Phase 1: Draft (blocked on core/phase-1) |
14+
| [MCP Server](mcp/) | Model Context Protocol server + adapters | Phase 1: Draft (tools improvement) |
1515
| [Subagents](subagents/) | Coordinator, explorer, planner, GitHub agents | Not started |
1616
| [Integrations](integrations/) | Claude Code, VS Code, Cursor | Not started |
1717
| [Logger](logger/) | @prosdevlab/kero centralized logging | Not started |
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# Part 1.1: Extract Pure Pattern Analyzers
2+
3+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task.
4+
5+
**Goal:** Extract the pattern analysis logic from private methods into exported pure functions that are testable without file I/O.
6+
7+
**User stories:** US-1, US-3
8+
9+
**Files:**
10+
- Modify: `packages/core/src/services/pattern-analysis-service.ts`
11+
- Modify: `packages/core/src/services/__tests__/pattern-analysis-service.test.ts`
12+
13+
---
14+
15+
## Task 1: Write tests for pure extraction functions
16+
17+
- [ ] **Step 1: Add test block for extractImportStyleFromContent**
18+
19+
```typescript
20+
// In pattern-analysis-service.test.ts, add:
21+
import {
22+
extractImportStyleFromContent,
23+
extractErrorHandlingFromContent,
24+
extractTypeCoverageFromSignatures,
25+
} from '../pattern-analysis-service';
26+
27+
describe('Pure Pattern Extractors', () => {
28+
describe('extractImportStyleFromContent', () => {
29+
it('should detect ESM imports', () => {
30+
const content = 'import { foo } from "./bar";\nimport * as baz from "baz";';
31+
const result = extractImportStyleFromContent(content);
32+
expect(result).toEqual({ style: 'esm', importCount: 2 });
33+
});
34+
35+
it('should detect CJS requires', () => {
36+
const content = 'const foo = require("bar");\nconst baz = require("baz");';
37+
const result = extractImportStyleFromContent(content);
38+
expect(result).toEqual({ style: 'cjs', importCount: 2 });
39+
});
40+
41+
it('should detect mixed imports', () => {
42+
const content = 'import { foo } from "./bar";\nconst baz = require("baz");';
43+
const result = extractImportStyleFromContent(content);
44+
expect(result).toEqual({ style: 'mixed', importCount: 2 });
45+
});
46+
47+
it('should return unknown for no imports', () => {
48+
const content = 'const x = 1;';
49+
const result = extractImportStyleFromContent(content);
50+
expect(result).toEqual({ style: 'unknown', importCount: 0 });
51+
});
52+
});
53+
54+
describe('extractErrorHandlingFromContent', () => {
55+
it('should detect throw style', () => {
56+
const content = 'throw new Error("oops");\nthrow new TypeError("bad");';
57+
const result = extractErrorHandlingFromContent(content);
58+
expect(result.style).toBe('throw');
59+
});
60+
61+
it('should return unknown for no error handling', () => {
62+
const content = 'const x = 1;';
63+
const result = extractErrorHandlingFromContent(content);
64+
expect(result.style).toBe('unknown');
65+
});
66+
});
67+
68+
describe('extractTypeCoverageFromSignatures', () => {
69+
it('should detect full coverage', () => {
70+
const signatures = [
71+
'function foo(x: string): number',
72+
'function bar(y: boolean): void',
73+
];
74+
const result = extractTypeCoverageFromSignatures(signatures);
75+
expect(result.coverage).toBe('full');
76+
expect(result.annotatedCount).toBe(2);
77+
expect(result.totalCount).toBe(2);
78+
});
79+
80+
it('should detect partial coverage', () => {
81+
const signatures = [
82+
'function foo(x: string): number',
83+
'function bar(y)',
84+
];
85+
const result = extractTypeCoverageFromSignatures(signatures);
86+
expect(result.coverage).toBe('partial');
87+
});
88+
89+
it('should return none for empty', () => {
90+
const result = extractTypeCoverageFromSignatures([]);
91+
expect(result.coverage).toBe('none');
92+
});
93+
});
94+
});
95+
```
96+
97+
- [ ] **Step 2: Run tests to verify they fail**
98+
99+
Run: `pnpm test -- packages/core/src/services/__tests__/pattern-analysis-service.test.ts`
100+
Expected: FAIL — functions not exported
101+
102+
---
103+
104+
## Task 2: Implement and export pure functions
105+
106+
- [ ] **Step 1: Add exported pure functions to pattern-analysis-service.ts**
107+
108+
Add before the class definition:
109+
110+
```typescript
111+
/**
112+
* Extract import style from raw file content. Pure function — no I/O.
113+
*/
114+
export function extractImportStyleFromContent(content: string): ImportStylePattern {
115+
const esmImports = content.match(/^import\s/gm) || [];
116+
const cjsImports = content.match(/require\s*\(/g) || [];
117+
const hasESM = esmImports.length > 0;
118+
const hasCJS = cjsImports.length > 0;
119+
120+
if (!hasESM && !hasCJS) return { style: 'unknown', importCount: 0 };
121+
122+
const importCount = esmImports.length + cjsImports.length;
123+
const style: ImportStylePattern['style'] =
124+
hasESM && hasCJS ? 'mixed' : hasESM ? 'esm' : 'cjs';
125+
return { style, importCount };
126+
}
127+
128+
/**
129+
* Extract error handling pattern from raw file content. Pure function — no I/O.
130+
*/
131+
export function extractErrorHandlingFromContent(content: string): ErrorHandlingPattern {
132+
const counts = {
133+
throw: [...content.matchAll(/throw\s+new\s+\w*Error/g)].length,
134+
result: [...content.matchAll(/Result<|{\s*ok:\s*(true|false)/g)].length,
135+
errorReturn: [...content.matchAll(/\)\s*:\s*\([^)]*,\s*error\)/g)].length,
136+
};
137+
const total = counts.throw + counts.result + counts.errorReturn;
138+
if (total === 0) return { style: 'unknown', examples: [] };
139+
140+
const max = Math.max(counts.throw, counts.result, counts.errorReturn);
141+
const hasMultiple = Object.values(counts).filter((c) => c > 0).length > 1;
142+
let style: ErrorHandlingPattern['style'] = 'unknown';
143+
if (hasMultiple) style = 'mixed';
144+
else if (counts.throw === max) style = 'throw';
145+
else if (counts.result === max) style = 'result';
146+
else if (counts.errorReturn === max) style = 'error-return';
147+
return { style, examples: [] };
148+
}
149+
150+
/**
151+
* Extract type coverage from function/method signatures. Pure function — no I/O.
152+
*/
153+
export function extractTypeCoverageFromSignatures(signatures: string[]): TypeAnnotationPattern {
154+
if (signatures.length === 0) return { coverage: 'none', annotatedCount: 0, totalCount: 0 };
155+
156+
const annotated = signatures.filter((sig) => /(\)|=>)\s*:\s*\w+/.test(sig));
157+
const ratio = annotated.length / signatures.length;
158+
let coverage: TypeAnnotationPattern['coverage'];
159+
if (ratio >= 0.9) coverage = 'full';
160+
else if (ratio >= 0.5) coverage = 'partial';
161+
else if (ratio > 0) coverage = 'minimal';
162+
else coverage = 'none';
163+
return { coverage, annotatedCount: annotated.length, totalCount: signatures.length };
164+
}
165+
```
166+
167+
- [ ] **Step 2: Run tests to verify they pass**
168+
169+
Run: `pnpm test -- packages/core/src/services/__tests__/pattern-analysis-service.test.ts`
170+
Expected: ALL PASS (new + existing)
171+
172+
- [ ] **Step 3: Commit**
173+
174+
```bash
175+
git add packages/core/src/services/pattern-analysis-service.ts packages/core/src/services/__tests__/pattern-analysis-service.test.ts
176+
git commit -m "refactor(core): extract pure pattern analyzers for testability"
177+
```

0 commit comments

Comments
 (0)