paqad-ai 0.1.9 → 0.2.0

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.
package/README.md CHANGED
@@ -7,9 +7,9 @@
7
7
  ╚═╝ ╚═╝ ╚═╝ ╚══▀▀═╝ ╚═╝ ╚═╝╚═════╝
8
8
  ```
9
9
 
10
- **AI agents that think before they type.** paqad-ai reads your codebase, detects your stack, and generates everything your AI coding agents need to actually understand your project — docs, rules, security checks, MCP configs, and structured workflows. One command. No configuration.
10
+ **AI agents that think before they type.** paqad-ai reads your codebase, detects your stack, builds optional hybrid RAG context, and generates the docs, rules, MCP configs, security checks, and workflows your coding agents need to operate with real project context.
11
11
 
12
- [![npm version](https://img.shields.io/npm/v/paqad-ai)](https://npmjs.com/package/paqad-ai) [![license](https://img.shields.io/npm/l/paqad-ai)](./LICENSE) [![website](https://img.shields.io/badge/website-paqad.ai-0A7A5C)](https://paqad.ai)
12
+ [![npm version](https://img.shields.io/npm/v/paqad-ai)](https://npmjs.com/package/paqad-ai) [![license](https://img.shields.io/npm/l/paqad-ai)](./LICENSE) [![website](https://img.shields.io/badge/website-paqad.ai-0A7A5C)](https://paqad.ai) [![docs](https://img.shields.io/badge/docs-paqad.ai-1f6feb)](https://paqad.ai)
13
13
 
14
14
  ---
15
15
 
@@ -17,9 +17,11 @@
17
17
 
18
18
  You install an AI coding agent. You ask it to help with your Laravel + React project. It doesn't know your folder structure, conventions, test runner, or which version of anything you're running.
19
19
 
20
- So you spend an hour writing `CLAUDE.md` by hand. Then you do it again for Cursor. And again for Copilot. And again when your stack changes.
20
+ Then the context problem gets worse: the agent still cannot retrieve the right files when the repo is large, ambiguous, or spread across app code, docs, workflows, and generated artifacts. It guesses. It misses the right modules. It burns tokens on the wrong files.
21
21
 
22
- **paqad-ai does all of this automatically for 10 agents at once.**
22
+ So you spend an hour writing `CLAUDE.md` by hand. Then you do it again for Cursor. And again for Copilot. And again when your stack changes. Then you still have to solve retrieval, documentation drift, and workflow consistency yourself.
23
+
24
+ **paqad-ai solves both setup and retrieval: shared instructions for multiple external agent platforms, plus a built-in multi-agent runtime and optional hybrid RAG for real project context.**
23
25
 
24
26
  ---
25
27
 
@@ -37,9 +39,9 @@ paqad-ai reads your lockfiles, detects your stack, asks you to confirm, and gene
37
39
  ✓ Detected: laravel + react (inertia, tailwind, pest, docker)
38
40
  ✓ Generated: CLAUDE.md, AGENTS.md, ANTIGRAVITY.md, GEMINI.md, .cursor/rules/paqad.mdc
39
41
  ✓ Generated: .github/copilot-instructions.md, .windsurfrules
40
- ✓ Generated: docs/instructions/stack/* (6 files)
41
- Generated: docs/instructions/rules/*
42
- ✓ Configured: MCP servers (figma, laravel-boost, tailwind-mcp)
42
+ ✓ Generated: docs/instructions/rules/* and stack-specific tool guides
43
+ Wrote: .paqad/project-profile.yaml, onboarding-manifest.json, detection-report.json
44
+ ✓ Configured: adapter entry files and MCP settings for selected platforms
43
45
 
44
46
  Ready. Your AI agents now understand your project.
45
47
  ```
@@ -52,11 +54,27 @@ npx paqad-ai onboard
52
54
 
53
55
  ---
54
56
 
55
- ## 10 supported agents
57
+ ## Core features
58
+
59
+ | Area | What you get |
60
+ | ------------------------ | ------------------------------------------------------------------------------------ |
61
+ | **Agent onboarding** | Shared instructions and MCP config for supported external agent platforms |
62
+ | **Stack detection** | Lockfile-driven framework, trait, and archetype detection across 9 ecosystems |
63
+ | **Documentation** | Stack, architecture, design-system, registry, and module documentation flows |
64
+ | **Hybrid RAG** | Optional vector indexing, hybrid retrieval, reranking, evals, and benchmarks |
65
+ | **Security** | OWASP-mapped pentest workflow with incremental retests |
66
+ | **Built-in agent roles** | 20 internal specialist roles for routing, review, design, verification, and security |
67
+ | **Context controls** | Chunking, scoring, dedup, summarization, and budget enforcement |
68
+ | **Pack system** | Built-in and custom stack packs for framework-specific behavior |
69
+ | **Operations** | `doctor`, `refresh`, `update`, `patterns`, and capability toggles |
70
+
71
+ ---
72
+
73
+ ## Supported adapters
56
74
 
57
- One onboarding. Every major AI coding agent. Thin entry files that all point to the same shared instruction bundles:
75
+ One onboarding. Thin entry files that all point to the same shared instruction bundles:
58
76
 
59
- | Agent | What it generates |
77
+ | Platform | What it generates |
60
78
  | ---------------------- | ------------------------------------------------------ |
61
79
  | **Claude Code** | `CLAUDE.md` + MCP config |
62
80
  | **Codex CLI** | `AGENTS.md` + MCP config |
@@ -69,13 +87,25 @@ One onboarding. Every major AI coding agent. Thin entry files that all point to
69
87
  | **Continue** | `.continue/rules/paqad.md` + MCP, prompts |
70
88
  | **Aider** | `CONVENTIONS.md` (config-only) |
71
89
 
72
- Pick one or pick all `paqad-ai onboard` lets you multi-select. If no `--providers` flag is passed, onboarding defaults to `claude-code`.
90
+ Pick one or pick all. `paqad-ai onboard` lets you multi-select. If no `--providers` flag is passed, onboarding defaults to `claude-code`.
91
+
92
+ ## 20 built-in specialist agents
93
+
94
+ Beyond adapter targets, paqad-ai also ships internal agent roles used by the framework's runtime content, reviews, workflows, and specialized guidance.
95
+
96
+ | Group | Count | Examples |
97
+ | ------------------------ | ----- | ---------------------------------------------------------------------------- |
98
+ | **Base workflow agents** | 11 | `router`, `verifier`, `story-designer`, `test-planner`, `product-owner` |
99
+ | **Coding specialists** | 8 | `solution-architect`, `database-expert`, `devops-engineer`, `doc-maintainer` |
100
+ | **Security specialists** | 1 | `security-auditor` |
101
+
102
+ That is **20 built-in agent roles** in the shipped runtime, in addition to the supported external adapters above.
73
103
 
74
104
  ---
75
105
 
76
106
  ## 17 built-in Stack Packs
77
107
 
78
- paqad-ai parses **26 manifest and lockfile formats** across 9 ecosystems. It doesn't ask what stack you use — it reads your lockfiles to figure it out.
108
+ paqad-ai parses manifests and lockfiles across 9 ecosystems. It doesn't ask what stack you use — it reads your repo to figure it out.
79
109
 
80
110
  **14 framework packs:**
81
111
 
@@ -85,7 +115,7 @@ paqad-ai parses **26 manifest and lockfile formats** across 9 ecosystems. It doe
85
115
 
86
116
  `node-cli` · `node-library` · `node-service`
87
117
 
88
- Each pack is a declarative `pack.yaml` that drives detection, documentation, MCP configuration, security mappings, and more. Don't see your framework? [Author your own pack](./docs/framework/authoring-stack-packs.md).
118
+ Each pack is a declarative `pack.yaml` that drives detection, documentation, MCP configuration, security mappings, and more. Don't see your framework? [Author your own pack](./docs/modules/packs/features/authoring/technical.md).
89
119
 
90
120
  **What it reads:**
91
121
 
@@ -129,6 +159,17 @@ Laravel also detects `pest`, `phpunit`, `sail`, `docker`, and `compose` automati
129
159
 
130
160
  paqad-ai isn't just a setup tool. Here's the full feature set:
131
161
 
162
+ ### Stack intelligence and pack resolution
163
+
164
+ Detection is lockfile-first and feeds the rest of the framework. Onboarding, refresh, docs, MCP config, and security workflows all consume the same resolved stack profile and effective pack set.
165
+
166
+ | System | What it does |
167
+ | ----------------------- | -------------------------------------------------------------------------------- |
168
+ | **Framework detection** | Detects frameworks, traits, and archetypes from manifests, lockfiles, and config |
169
+ | **Pack resolution** | Merges built-in, global, and project pack overrides by precedence |
170
+ | **Capability routing** | Activates `content`, `coding`, and `security` based on the effective stack |
171
+ | **Drift tracking** | Stores stack snapshots and reports when the live repo diverges from onboarding |
172
+
132
173
  ### Documentation as a first-class output
133
174
 
134
175
  Docs aren't an afterthought — they're a primary framework output. There's no standalone `document` command. Instead, ask any connected agent to `create documentation` and the workflow:
@@ -183,6 +224,24 @@ Your AI agent has a limited context window. paqad-ai makes every token count:
183
224
  | **Turn summarizer** | Old turns → structured extracts (decisions, files, blockers, next steps). No LLM, pure regex |
184
225
  | **Stream truncator** | Per-tier output limits (fast: 2K, medium: 5K, reasoning: 15K) with sentence-boundary cuts |
185
226
 
227
+ ### Optional hybrid RAG retrieval
228
+
229
+ RAG is optional, but when enabled it plugs directly into the semantic loader instead of living off to the side as a separate experiment.
230
+
231
+ | Feature | What it does |
232
+ | ----------------------- | ------------------------------------------------------------------------------------------- |
233
+ | **Vector index** | Builds an AST-aware code/document index under `.paqad/vectors/` from the chunk index |
234
+ | **Embedding providers** | Supports `local` (default), `openai`, and `voyageai` with provider-specific default models |
235
+ | **Hybrid scoring** | Fuses vector similarity, keyword overlap, symbol hits, and file-path proximity |
236
+ | **Adaptive depth** | Routes retrieval as `none`, `standard`, or `deep` based on task complexity, risk, and scope |
237
+ | **Metadata filtering** | Narrows candidates by extension, module path, framework, and recency with safe fallbacks |
238
+ | **Reranking** | Supports `passthrough`, local cross-encoder reranking, or Cohere reranking |
239
+ | **Pattern vectors** | Extends retrieval with vectorized cross-project patterns from `~/.paqad/patterns/` |
240
+ | **Audit + fallbacks** | Logs build/fallback/provider mismatch events to `.paqad/audit.log` |
241
+ | **Eval gates** | Benchmarks hit@5, task success, correction turns, and prompt-token deltas |
242
+
243
+ RAG configuration lives in `.paqad/project-profile.yaml`. Project-specific corpus exclusions can be tuned with `.paqad/rag.ignore.yaml`, and remote provider keys are stored in `.paqad/secrets.env`.
244
+
186
245
  ### Smart session handoff
187
246
 
188
247
  Structured v2 handoff captures active task, decisions, files, blockers, and next steps. **70–85% smaller** than raw dumps. Both JSON and Markdown.
@@ -217,6 +276,18 @@ Conditional steps, parallel execution, failure handling (`abort` / `skip` / `ret
217
276
 
218
277
  Verified solutions stored globally at `~/.paqad/patterns/`. Scored by framework overlap + keyword match, staleness penalty after 180 days.
219
278
 
279
+ ### Health, refresh, and update workflows
280
+
281
+ The operational side matters too: paqad-ai keeps generated artifacts and project state from quietly drifting.
282
+
283
+ | Workflow | What it does |
284
+ | ---------------- | ----------------------------------------------------------------------------------- |
285
+ | **Doctor** | Validates framework artifacts, copied instructions, MCP config, docs, and RAG state |
286
+ | **Refresh** | Re-detects stack and regenerates stack or design-system outputs |
287
+ | **Update** | Rewrites framework-managed artifacts against the current package version |
288
+ | **Capabilities** | Toggles active capability layers with dependency rules |
289
+ | **Patterns** | Lists, prunes, and exports the global pattern library |
290
+
220
291
  ---
221
292
 
222
293
  ## The capability model
@@ -338,68 +409,103 @@ paqad-ai packs validate <path> # Validate a pack before installing
338
409
  paqad-ai packs create <name> # Scaffold a new pack
339
410
  ```
340
411
 
341
- ### Security workflows
412
+ ### `paqad-ai rag`
413
+
414
+ Optional RAG management, indexing, and benchmark tooling.
342
415
 
343
416
  ```bash
344
- paqad-ai pentest # Full scan
345
- paqad-ai pentest --incremental # Only changed files
346
- paqad-ai pentest-retest --source <report> # Re-check prior findings
417
+ paqad-ai rag init # Enable RAG and build the initial vector index
418
+ paqad-ai rag init --provider local # Local embeddings via Xenova/all-MiniLM-L6-v2
419
+ paqad-ai rag init --provider openai # Remote embeddings via text-embedding-3-small
420
+ paqad-ai rag init --provider voyageai # Remote embeddings via voyage-code-3
421
+ paqad-ai rag rebuild # Force a full rebuild
422
+ paqad-ai rag status # Show provider, model, validity, size, chunk count
423
+ paqad-ai rag clear --yes # Delete the vector index and disable RAG
424
+ paqad-ai rag eval # Run deterministic evals on the current index
425
+ paqad-ai rag eval --mode lexical-vs-rag
426
+ paqad-ai rag eval --baseline ./baseline.json --mode rag-vs-candidate
427
+ paqad-ai rag eval --model-graded # Also run the optional model-graded lane
347
428
  ```
348
429
 
430
+ **What `rag init` configures:**
431
+
432
+ - Builds a vector index from the existing chunk index and enables `intelligence.rag_enabled`
433
+ - Persists provider/model selection in `.paqad/project-profile.yaml`
434
+ - Uses a free local model by default, or prompts for `OPENAI_API_KEY` / `VOYAGE_API_KEY` when needed
435
+ - Reuses cached local models under `~/.paqad/models` to avoid repeat downloads
436
+
437
+ **What `rag eval` measures:**
438
+
439
+ - `hit_at_5`
440
+ - `task_success_rate`
441
+ - `correction_turns`
442
+ - `prompt_tokens_sent`
443
+
444
+ Benchmark comparisons support `lexical-vs-rag`, `rag-vs-candidate`, and `feature-off-vs-on`.
445
+
446
+ ### Security workflows
447
+
448
+ Security and retest flows are part of the framework runtime and agent workflows in this package version. They are not exposed as standalone top-level CLI commands in `paqad-ai` today.
449
+
349
450
  ### Pattern library
350
451
 
351
452
  ```bash
352
- paqad-ai patterns list [--domain <d>] [--framework <f>] [--category <c>]
453
+ paqad-ai patterns list [--domain <d>] [--frameworks <f1,f2>] [--category <c>]
353
454
  paqad-ai patterns prune [--older-than <days>]
354
455
  paqad-ai patterns export <output> [--format json|markdown]
355
456
  ```
356
457
 
357
458
  ---
358
459
 
359
- ## What it generates
460
+ ## What paqad-ai manages
360
461
 
361
- ```
462
+ ```text
362
463
  your-project/
363
- ├── CLAUDE.md # docs/instructions/
364
- ├── AGENTS.md # docs/instructions/
365
- ├── ANTIGRAVITY.md # docs/instructions/
366
- ├── GEMINI.md # docs/instructions/
367
- ├── CONVENTIONS.md # Aider
368
- ├── .junie/AGENTS.md # docs/instructions/
369
- ├── .cursor/rules/paqad.mdc # + MCP, skills, agents
370
- ├── .github/copilot-instructions.md # + .vscode/mcp.json
371
- ├── .windsurfrules # + MCP, skills, agents
372
- ├── .continue/rules/paqad.md # + MCP, prompts
464
+ ├── CLAUDE.md # onboarding, if Claude Code is selected
465
+ ├── AGENTS.md # onboarding, if Codex CLI is selected
466
+ ├── ANTIGRAVITY.md # onboarding, if Antigravity is selected
467
+ ├── GEMINI.md # onboarding, if Gemini CLI is selected
468
+ ├── CONVENTIONS.md # onboarding, if Aider is selected
469
+ ├── .junie/AGENTS.md # onboarding, if Junie is selected
470
+ ├── .cursor/rules/paqad.mdc # onboarding, if Cursor is selected
471
+ ├── .github/copilot-instructions.md # onboarding, if GitHub Copilot is selected
472
+ ├── .windsurfrules # onboarding, if Windsurf is selected
473
+ ├── .continue/rules/paqad.md # onboarding, if Continue is selected
373
474
 
374
475
  ├── docs/
375
476
  │ ├── instructions/
376
- │ │ ├── stack/ # Auto-generated stack docs
477
+ │ │ ├── stack/ # generated later by refresh/documentation workflows
377
478
  │ │ │ ├── overview.md
378
479
  │ │ │ ├── frameworks.md
379
480
  │ │ │ ├── dependencies.md
380
481
  │ │ │ ├── tooling.md
381
482
  │ │ │ ├── version-rules.md
483
+ │ │ │ ├── sources.md
382
484
  │ │ │ └── drift-report.md
383
- │ │ ├── rules/ # Conventions, writing style
384
- │ │ ├── tools/ # Stack-specific tool guides
385
- │ │ └── workflows/ # Your custom YAML templates
386
- │ ├── modules/ # Per-feature business + technical docs
387
- │ └── pentest/ # Security reports + retests
485
+ │ │ ├── rules/ # onboarding-generated conventions and writing rules
486
+ │ │ ├── tools/ # onboarding-generated stack tool guides
487
+ │ │ └── workflows/ # user-authored workflow templates
488
+ │ ├── modules/ # generated later by documentation workflows
489
+ │ └── pentest/ # generated later by security workflows
388
490
 
389
491
  └── .paqad/ # Framework metadata (machine-managed)
390
492
  ├── project-profile.yaml
391
493
  ├── stack-snapshot.json
392
494
  ├── stack-drift.json
393
495
  ├── onboarding-manifest.json
496
+ ├── rag.ignore.yaml # Optional RAG corpus include/exclude rules
497
+ ├── secrets.env # Optional API keys for remote RAG providers
498
+ ├── audit.log # Build, fallback, and provider mismatch events
394
499
  ├── doc-progress.json
395
- ├── pentest/runs/
500
+ ├── pentest/runs/ # generated when pentest workflows run
396
501
  ├── session/ # Handoff, budget, dedup stats
397
502
  ├── context/ # Chunk index, load stats
503
+ ├── vectors/ # Optional RAG vector index + metadata
398
504
  ├── cache/ # Transition log, metrics
399
505
  └── workflows/ # Custom workflow run state
400
506
  ```
401
507
 
402
- Entry files stay thin. Knowledge lives in shared instruction bundles that all 10 agents read.
508
+ Entry files stay thin. Knowledge lives in shared instruction bundles that external platforms and built-in runtime roles consume consistently.
403
509
 
404
510
  ---
405
511
 
@@ -411,11 +517,13 @@ Entry files stay thin. Knowledge lives in shared instruction bundles that all 10
411
517
  | **Health check** | `paqad-ai doctor` | Validate artifacts, config, docs |
412
518
  | **Refresh** | `paqad-ai refresh` | Re-detect stack, update derived docs |
413
519
  | **Update** | `paqad-ai update` | Regenerate framework files after version bump |
520
+ | **RAG** | `paqad-ai rag ...` | Build, inspect, clear, and benchmark hybrid retrieval |
414
521
  | **Documentation** | Ask agent: _"create documentation"_ | Stack → architecture → design system → modules |
415
522
  | **Pentest** | Ask agent: _"run pentest"_ | 5-step scan → findings → report |
416
523
  | **Retest** | Ask agent: _"retest pentest"_ | Replay findings → fixed / still-open / needs-verification |
417
524
  | **Capabilities** | `paqad-ai capabilities add/remove` | Toggle content / coding / security |
418
525
  | **Pack management** | `paqad-ai packs install/remove` | Install, validate, scaffold stack packs |
526
+ | **Pattern library** | `paqad-ai patterns ...` | Query, prune, and export reusable solutions |
419
527
  | **Custom workflows** | YAML at `docs/instructions/workflows/` | Your own resumable skill sequences |
420
528
 
421
529
  ---
@@ -433,16 +541,20 @@ Entry files stay thin. Knowledge lives in shared instruction bundles that all 10
433
541
 
434
542
  ```bash
435
543
  pnpm install
436
- pnpm run ci # typecheck lint → format → test (80%+ coverage) → build
544
+ npm run format # required before completion
545
+ npm run ci # required before completion
437
546
  ```
438
547
 
439
548
  ```bash
440
549
  pnpm run test # Tests only
550
+ pnpm run test:coverage # Coverage gate summary
441
551
  pnpm run typecheck # TypeScript checks
442
552
  pnpm run lint # ESLint
443
553
  pnpm run build # Production build
444
554
  ```
445
555
 
556
+ Every completed change in this repo is expected to keep 100% lines, 100% statements, 100% functions, and 100% branches coverage, add positive and negative E2E coverage for changed user flows, and update the owning `docs/modules/**` plus `website/` surfaces when their contract changes.
557
+
446
558
  ---
447
559
 
448
560
  ## Contributing
@@ -451,4 +563,4 @@ Coming soon
451
563
 
452
564
  ---
453
565
 
454
- MIT License · [npm](https://npmjs.com/package/paqad-ai) · [Docs](./docs/framework/specifications.md)
566
+ MIT License · [npm](https://npmjs.com/package/paqad-ai) · [Docs](https://paqad.ai) · [Maintainer Overview](./docs/maintainers/project-overview.md) · [Modules](./docs/modules/README.md)