forgehive 0.6.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.
Files changed (53) hide show
  1. package/README.md +631 -0
  2. package/dist/cli.d.ts +2 -0
  3. package/dist/cli.js +6265 -0
  4. package/dist/confirm.d.ts +1 -0
  5. package/dist/confirm.js +15 -0
  6. package/dist/fulfillment-catalog.d.ts +10 -0
  7. package/dist/fulfillment-catalog.js +119 -0
  8. package/dist/lookup-table.d.ts +16 -0
  9. package/dist/lookup-table.js +128 -0
  10. package/dist/rollback.d.ts +1 -0
  11. package/dist/rollback.js +9 -0
  12. package/dist/scanner.d.ts +2 -0
  13. package/dist/scanner.js +87 -0
  14. package/dist/types.d.ts +13 -0
  15. package/dist/types.js +1 -0
  16. package/dist/update.d.ts +7 -0
  17. package/dist/update.js +42 -0
  18. package/dist/writer.d.ts +3 -0
  19. package/dist/writer.js +63 -0
  20. package/forgehive/agents/eli.yaml +8 -0
  21. package/forgehive/agents/kai.yaml +8 -0
  22. package/forgehive/agents/nora.yaml +8 -0
  23. package/forgehive/agents/remy.yaml +8 -0
  24. package/forgehive/agents/sam.yaml +8 -0
  25. package/forgehive/agents/suki.yaml +8 -0
  26. package/forgehive/agents/vera.yaml +24 -0
  27. package/forgehive/agents/viktor.yaml +8 -0
  28. package/forgehive/commands/fh-hotfix.md +16 -0
  29. package/forgehive/commands/fh-review.md +16 -0
  30. package/forgehive/commands/fh-ship.md +18 -0
  31. package/forgehive/commands/fh-start-task.md +13 -0
  32. package/forgehive/hooks/guardrails.sh +17 -0
  33. package/forgehive/party/defaults.yaml +21 -0
  34. package/forgehive/skills/INDEX.yaml +64 -0
  35. package/forgehive/skills/expert/.gitkeep +0 -0
  36. package/forgehive/skills/expert/api-design.md +77 -0
  37. package/forgehive/skills/expert/auth-security.md +80 -0
  38. package/forgehive/skills/expert/clean-architecture.md +83 -0
  39. package/forgehive/skills/expert/code-review.md +81 -0
  40. package/forgehive/skills/expert/database-patterns.md +81 -0
  41. package/forgehive/skills/expert/error-handling.md +90 -0
  42. package/forgehive/skills/expert/gdpr-compliance.md +64 -0
  43. package/forgehive/skills/expert/git-conventions.md +84 -0
  44. package/forgehive/skills/expert/monorepo-patterns.md +91 -0
  45. package/forgehive/skills/expert/observability.md +98 -0
  46. package/forgehive/skills/expert/owasp-top10.md +153 -0
  47. package/forgehive/skills/expert/performance-patterns.md +79 -0
  48. package/forgehive/skills/expert/security-checklist.md +70 -0
  49. package/forgehive/skills/expert/testing-strategies.md +74 -0
  50. package/forgehive/skills/expert/typescript-patterns.md +62 -0
  51. package/forgehive/skills/templates/.gitkeep +0 -0
  52. package/forgehive/templates/claude-md.block.md +62 -0
  53. package/package.json +30 -0
package/README.md ADDED
@@ -0,0 +1,631 @@
1
+ <p align="center">
2
+ <img src="logo/ForgeHiveAI_final_logo.png" width="160" alt="ForgeHiveAI Logo">
3
+ </p>
4
+
5
+ <h1 align="center">
6
+ <strong style="color:#f97316">Forge</strong><span>Hive</span><sup>AI</sup>
7
+ </h1>
8
+
9
+ <p align="center">
10
+ Context-aware AI development environment — one binary, your stack.<br>
11
+ <code>fh init</code> &nbsp;·&nbsp; <code>fh confirm</code> &nbsp;·&nbsp; Claude knows your codebase.
12
+ </p>
13
+
14
+ <p align="center">
15
+ <img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="Node.js ≥ 18">
16
+ <img src="https://img.shields.io/badge/typescript-5.8-blue" alt="TypeScript">
17
+ <img src="https://img.shields.io/badge/tests-217%20passing-success" alt="217 tests">
18
+ <img src="https://img.shields.io/badge/bundle-205KB-lightgrey" alt="205KB bundle">
19
+ <img src="https://img.shields.io/badge/license-MIT-green" alt="MIT">
20
+ </p>
21
+
22
+ ---
23
+
24
+ ## What is ForgeHiveAI?
25
+
26
+ **forgehive** (`fh`) is a CLI that permanently equips Claude Code with your codebase context — and actively checks generated code for security issues.
27
+
28
+ Claude loses all project knowledge between sessions. forgehive solves this by writing a `.forgehive/` directory into your target project that Claude reads automatically at every session start.
29
+
30
+ **Core capabilities:**
31
+
32
+ - **Stack Scanner** — detects tech stack, dependencies, and project structure automatically
33
+ - **Persistent Memory** — context and session notes survive every restart
34
+ - **Party Mode** — specialized agent sets, each agent in its own isolated git worktree
35
+ - **MCP Wiring** — preconfigured connectors for 10 services, API keys stored securely in `~/.forgehive/`
36
+ - **Security Suite** — SAST, secret scanner, CVE check, CISO reports (GDPR/SOC2/HIPAA)
37
+ - **AGENTS.md** — cross-tool standard (Cursor, Copilot, Gemini CLI, Codex, Windsurf)
38
+
39
+ **Design principle:** writes exclusively to `.forgehive/` in the target project. No globbing outside the project root. Never overwrites files it didn't create.
40
+
41
+ ---
42
+
43
+ ## Status: Early Alpha (v0.6)
44
+
45
+ This is an early release. The codebase is clean — TypeScript, 217 passing tests, single bundle — but several features have not yet been tested against a real project.
46
+
47
+ **Stable — use with confidence:**
48
+
49
+ | Feature | State |
50
+ |---|---|
51
+ | `fh init` — stack scan + `.forgehive/` setup | stable |
52
+ | `fh confirm` / `fh rollback` | stable |
53
+ | CLAUDE.md block merge (idempotent, 3 cases) | stable |
54
+ | `fh security scan` — secrets + SAST | stable |
55
+ | `fh security deps` — CVE check | stable |
56
+ | `fh security report` — compliance reports | stable |
57
+ | `fh memory` — show, clean, export, snapshot | stable |
58
+ | MCP credential store (`fh mcp auth`) | stable |
59
+
60
+ **Experimental — works in tests, not yet live-validated:**
61
+
62
+ | Feature | State |
63
+ |---|---|
64
+ | `fh party run` — multi-agent worktree sessions | experimental |
65
+ | `fh skills regen` — AI-assisted skill generation | experimental |
66
+ | `fh cost` — session cost parsing from `~/.claude/` | experimental |
67
+ | Guardrails bash hook in live Claude Code sessions | experimental |
68
+
69
+ If you run into issues, please open an issue on GitHub. The most valuable feedback right now is a real `fh init` run on your project — does Claude actually pick up the context?
70
+
71
+ ---
72
+
73
+ ## Prerequisites
74
+
75
+ - **Node.js ≥ 18** — check with `node --version`
76
+ - **Claude Code** installed and configured (`claude` CLI available)
77
+ - **git** — required for Party Mode worktrees and the guardrails hook
78
+
79
+ ---
80
+
81
+ ## Installation
82
+
83
+ ### From npm (recommended)
84
+
85
+ ```bash
86
+ npm install -g forgehive
87
+ ```
88
+
89
+ This makes both `fh` and `forgehive` available globally.
90
+
91
+ ### From source (for development)
92
+
93
+ ```bash
94
+ git clone https://github.com/matharnica/forgehive
95
+ cd forgehive
96
+ npm install
97
+ npm run build # compiles to dist/cli.js (~205 KB)
98
+ npm link # makes 'fh' available globally
99
+ ```
100
+
101
+ Verify the installation:
102
+
103
+ ```bash
104
+ fh --version # should print 0.6.0
105
+ fh --help # lists all available commands
106
+ ```
107
+
108
+ ---
109
+
110
+ ## Quick Start
111
+
112
+ ### Step 1: Initialize your project
113
+
114
+ Navigate to any project you want Claude to understand, then run:
115
+
116
+ ```bash
117
+ cd my-project
118
+ fh init
119
+ ```
120
+
121
+ `fh init` does the following in order:
122
+ 1. Scans your project — detects language, framework, dependencies, directory structure
123
+ 2. Creates `.forgehive/` with the full harness (capabilities, memory, skills, permissions)
124
+ 3. Merges a context block into `CLAUDE.md` (creates it if it doesn't exist, never overwrites existing content)
125
+ 4. Writes `AGENTS.md` to the project root (cross-tool agent standard)
126
+ 5. Installs 16 expert skill files into `.forgehive/skills/expert/`
127
+
128
+ ### Step 2: Confirm the detected stack
129
+
130
+ ```bash
131
+ fh confirm
132
+ ```
133
+
134
+ This changes `capabilities.yaml` from `status: draft` to `status: confirmed`. Claude won't use the context as authoritative until it's confirmed — this gives you a chance to review what was detected before committing to it.
135
+
136
+ After confirmation, open a new Claude Code session in the project. Claude will automatically read `.forgehive/` and know your stack, constraints, and memory.
137
+
138
+ ### Step 3: Run a security audit (recommended)
139
+
140
+ ```bash
141
+ fh security scan # finds secrets and SAST vulnerabilities
142
+ fh security deps # checks npm dependencies for known CVEs
143
+ fh security report gdpr # generates a CISO-ready compliance report
144
+ ```
145
+
146
+ ---
147
+
148
+ ## Commands Reference
149
+
150
+ ### Setup & Lifecycle
151
+
152
+ | Command | Description |
153
+ |---|---|
154
+ | `fh init` | Scan project, create `.forgehive/`, merge CLAUDE.md block, write AGENTS.md |
155
+ | `fh confirm` | Confirm `capabilities.yaml` — activates context for Claude |
156
+ | `fh rollback` | Remove `.forgehive/` and the CLAUDE.md block cleanly |
157
+ | `fh status` | Show current project status, drift warning if scan is outdated |
158
+
159
+ **When to use `fh rollback`:** If you want to remove forgehive from a project entirely. It removes exactly the block it inserted into CLAUDE.md (nothing else) and deletes `.forgehive/`.
160
+
161
+ ---
162
+
163
+ ### Scan
164
+
165
+ | Command | Description |
166
+ |---|---|
167
+ | `fh scan --update` | Re-scan the project (run after adding new dependencies) |
168
+ | `fh scan --check` | Hash check — is the snapshot still current? |
169
+
170
+ The scan stores a hash of the project state. `fh scan --check` compares the current state against the stored hash and warns if dependencies or structure have changed significantly since the last scan.
171
+
172
+ ---
173
+
174
+ ### Status & Cost Tracking
175
+
176
+ | Command | Description |
177
+ |---|---|
178
+ | `fh status` | Show status of `.forgehive/`, confirmation state, last scan date |
179
+ | `fh cost` | Show Claude session costs from `~/.claude/` (all time) |
180
+ | `fh cost today` | Costs for today only |
181
+ | `fh cost week` | Costs for the current week |
182
+ | `fh cost --limit 20` | Set a hard spend limit of $20 |
183
+ | `fh cost --alert 15` | Set an alert threshold at $15 |
184
+ | `fh cost --limit 20 --alert 15` | Set both at once |
185
+
186
+ **How spend limits work:** Once set, `fh cost` checks your current spend against the configured limits every time it runs. When the alert threshold is reached, it prints a warning. When the hard limit is reached, it exits with a non-zero code — you can use this in CI or hooks to stop work automatically.
187
+
188
+ ---
189
+
190
+ ### Security Suite
191
+
192
+ The security suite consists of five commands:
193
+
194
+ #### `fh security scan`
195
+
196
+ ```bash
197
+ fh security scan
198
+ ```
199
+
200
+ Runs two scanners in sequence:
201
+
202
+ 1. **Secret Scanner** — searches all source files for exposed credentials using 8 regex patterns:
203
+ - Anthropic API keys (`sk-ant-...`)
204
+ - OpenAI API keys (`sk-...` non-Anthropic)
205
+ - GitHub tokens (`ghp_...`)
206
+ - AWS Access Key IDs (`AKIA...`)
207
+ - Slack bot tokens (`xoxb-...`)
208
+ - PEM private keys (`-----BEGIN ... PRIVATE KEY`)
209
+ - Generic password assignments (`password = "..."`)
210
+ - Generic token assignments (`token = "..."`)
211
+
212
+ 2. **SAST Scanner** — static analysis for 6 vulnerability classes:
213
+ - SQL Injection (HIGH)
214
+ - XSS / unescaped output (HIGH)
215
+ - `eval()` usage (HIGH)
216
+ - Path traversal (`../` in file operations) (MEDIUM)
217
+ - Weak random numbers (`Math.random()` in security contexts) (LOW)
218
+ - Hardcoded credentials in source (CRITICAL)
219
+
220
+ **Exit codes:** exits 1 if CRITICAL or HIGH findings exist — safe to use in CI pipelines.
221
+
222
+ Secrets are **never** stored verbatim. Findings show only the first 6 characters followed by `***`.
223
+
224
+ #### `fh security deps`
225
+
226
+ ```bash
227
+ fh security deps
228
+ ```
229
+
230
+ Runs `npm audit` and formats the output. Shows vulnerable packages grouped by severity (critical, high, moderate, low) with CVE identifiers and fix recommendations.
231
+
232
+ #### `fh security report`
233
+
234
+ ```bash
235
+ fh security report # no compliance framework
236
+ fh security report gdpr # GDPR-specific checks and recommendations
237
+ fh security report soc2 # SOC 2 Type II relevant controls
238
+ fh security report hipaa # HIPAA technical safeguard checklist
239
+ ```
240
+
241
+ Generates a Markdown CISO report at `.forgehive/security-report.md`. The report includes:
242
+ - Overall risk score (CLEAN / LOW / MEDIUM / HIGH / CRITICAL)
243
+ - Secret scan results
244
+ - SAST findings with file paths and line numbers
245
+ - Dependency vulnerabilities
246
+ - Compliance-mode-specific recommendations and gaps
247
+ - Timestamp and project metadata
248
+
249
+ #### `fh security audit`
250
+
251
+ ```bash
252
+ fh security audit
253
+ ```
254
+
255
+ Displays the audit trail — every `fh security` command execution is logged in JSONL format to `.forgehive/audit.log`. Shows timestamp, command, user, and outcome. Useful for compliance documentation.
256
+
257
+ #### `fh security permissions`
258
+
259
+ ```bash
260
+ fh security permissions
261
+ ```
262
+
263
+ Shows `permissions.yaml` — the file access control list for each agent. Each agent (Nora, Eli, Remy, Suki, Viktor, Kai, Sam, Vera) has explicit `read`, `write`, and `deny` lists. This prevents agents from accidentally touching files outside their scope.
264
+
265
+ ---
266
+
267
+ ### Memory
268
+
269
+ Memory files live in `.forgehive/memory/` and are read by Claude at session start via the CLAUDE.md block.
270
+
271
+ | Command | Description |
272
+ |---|---|
273
+ | `fh memory` | Show all memory file contents |
274
+ | `fh memory show` | Same as above |
275
+ | `fh memory clean` | Delete state files older than 30 days |
276
+ | `fh memory export` | Export all memory to a single Markdown file (stdout) |
277
+ | `fh memory export ./backup.md` | Export to a specific path |
278
+ | `fh memory prune 60` | List memory files not updated in 60 days |
279
+ | `fh memory prune 60 --remove` | Same, but delete them |
280
+ | `fh memory snapshot export` | Export memory as a JSON bundle (for team sharing) |
281
+ | `fh memory snapshot export ./team-memory.json` | Export to path |
282
+ | `fh memory snapshot import ./team-memory.json` | Import bundle (skips existing files) |
283
+ | `fh memory adr list` | List all Architecture Decision Records |
284
+ | `fh memory adr "Use Postgres over MongoDB"` | Create a new ADR |
285
+
286
+ **Memory files created by `fh init`:**
287
+
288
+ | File | Purpose |
289
+ |---|---|
290
+ | `MEMORY.md` | Index file — lists all other memory files |
291
+ | `project.md` | Project context, open decisions, goals |
292
+ | `feedback.md` | Corrections and confirmed approaches from Claude sessions |
293
+ | `stack.md` | Stack details the scanner can't detect (auth patterns, deploy targets) |
294
+ | `adrs/` | Architecture Decision Records |
295
+
296
+ **Team snapshots:** `fh memory snapshot export` bundles all memory files into a single JSON file you can commit or share. `fh memory snapshot import` imports it idempotently — existing files are never overwritten, only new files are added.
297
+
298
+ ---
299
+
300
+ ### Party Mode
301
+
302
+ Party Mode runs specialized agent sets in parallel, each in an isolated git worktree.
303
+
304
+ ```bash
305
+ fh party # show current party configuration
306
+ fh party --set build # set default party to 'build'
307
+ fh party run # start the default party
308
+ fh party run security # start the security party specifically
309
+ fh party status # show active party session
310
+ fh party cleanup # remove finished worktrees
311
+ ```
312
+
313
+ **Available party sets:**
314
+
315
+ | Set | Agents | Claude Code trigger |
316
+ |---|---|---|
317
+ | `build` | Viktor + Kai + Sam | `/party` |
318
+ | `design` | Suki + Viktor | `/design-party` |
319
+ | `review` | Kai + Sam + Eli | `/review-party` |
320
+ | `security` | Vera + Sam | `/security-party` |
321
+ | `full` | All 8 agents | `/full-party` |
322
+
323
+ **Model mapping** — assign specific Claude models per agent:
324
+
325
+ ```bash
326
+ fh party --model-map "viktor:claude-opus-4-7,kai:claude-sonnet-4-6,sam:claude-haiku-4-5"
327
+ ```
328
+
329
+ **How isolation works:** `fh party run` creates one git worktree per agent under `.forgehive/worktrees/<agent-name>/`. Each agent works in its own branch and filesystem copy. Worktrees are cleaned up with `fh party cleanup` or automatically when the session ends cleanly.
330
+
331
+ ---
332
+
333
+ ### MCP (Model Context Protocol)
334
+
335
+ #### Quick wiring for common services
336
+
337
+ ```bash
338
+ fh wire linear # configure Linear MCP server in .mcp.json
339
+ fh wire slack # configure Slack MCP server
340
+ fh wire github # configure GitHub MCP server
341
+ ```
342
+
343
+ Supported services for `fh wire`: `linear`, `slack`, `github`, `sentry`, `notion`, `postgres`, `jira`, `pagerduty`, `datadog`, `figma`
344
+
345
+ This writes the correct MCP server configuration to `.mcp.json` in the project root. Claude Code picks up `.mcp.json` automatically.
346
+
347
+ #### Credential management
348
+
349
+ API keys are stored encrypted at `~/.forgehive/credentials.json` (chmod 600, user-only access):
350
+
351
+ ```bash
352
+ fh mcp auth add github GITHUB_TOKEN=ghp_yourtoken
353
+ fh mcp auth add linear LINEAR_API_KEY=lin_api_key
354
+ fh mcp auth add slack SLACK_BOT_TOKEN=xoxb-... SLACK_TEAM_ID=T123
355
+
356
+ fh mcp auth list # show which services have stored credentials
357
+ fh mcp auth remove github # delete credentials for a service
358
+ ```
359
+
360
+ #### Registry search and install
361
+
362
+ ```bash
363
+ fh mcp search "database" # search Smithery registry
364
+ fh mcp add @modelcontextprotocol/server-postgres
365
+ fh mcp add @smithery/some-server --env API_KEY SECRET_KEY
366
+ ```
367
+
368
+ **Trust Layer:** `fh mcp add` checks the npm scope before installing. Trusted scopes:
369
+ - `@modelcontextprotocol` — official MCP servers
370
+ - `@anthropic` — Anthropic packages
371
+ - `@smithery` — Smithery registry
372
+ - `@github` — GitHub packages
373
+ - `@microsoft` — Microsoft packages
374
+
375
+ Unscoped packages or unknown scopes trigger a warning before installation proceeds.
376
+
377
+ ---
378
+
379
+ ### Skills
380
+
381
+ Skills are Markdown instruction files that Claude reads when you reference them in a session.
382
+
383
+ ```bash
384
+ fh skills list # show all available skills
385
+ fh skills regen # regenerate skills from templates (AI-assisted)
386
+ fh skills pull <git-url> # pull expert skills from a team git repo
387
+ ```
388
+
389
+ **Pulling team skills:**
390
+
391
+ ```bash
392
+ fh skills pull https://github.com/my-team/ai-skills.git
393
+ ```
394
+
395
+ Clones the repo with `--depth=1`, copies all `.md` files from the `skills/expert/` subdirectory (or root if no `skills/expert/` exists) into `.forgehive/skills/expert/`. Existing files are not overwritten.
396
+
397
+ **Expert Skills installed by `fh init` (16 files):**
398
+
399
+ | Skill | Coverage |
400
+ |---|---|
401
+ | `typescript-patterns` | Type-safe patterns, generics, discriminated unions |
402
+ | `testing-strategies` | TDD, test design, coverage strategies |
403
+ | `api-design` | REST, versioning, error responses |
404
+ | `git-conventions` | Commit messages, branching, PR hygiene |
405
+ | `error-handling` | Error hierarchies, recovery patterns |
406
+ | `security-checklist` | Pre-deploy security review |
407
+ | `performance-patterns` | Profiling, caching, async patterns |
408
+ | `code-review` | Review checklist and feedback patterns |
409
+ | `clean-architecture` | Dependency rules, layering, boundaries |
410
+ | `database-patterns` | Query optimization, migrations, indexing |
411
+ | `monorepo-patterns` | Workspace setup, shared packages, tooling |
412
+ | `observability` | Logging, tracing, metrics |
413
+ | `owasp-top10` | A01–A10 with TypeScript examples |
414
+ | `auth-security` | bcrypt, JWT, session security, MFA |
415
+ | `gdpr-compliance` | PII classification, consent, right to erasure |
416
+ | `security-checklist` | SAST integration, secret management |
417
+
418
+ ---
419
+
420
+ ## What `fh init` Creates
421
+
422
+ ```
423
+ my-project/
424
+ .forgehive/
425
+ capabilities.yaml ← detected stack (status: draft → confirmed)
426
+ scan-result.yaml ← raw scanner output
427
+ .scan-hash ← checksum for fh scan --check
428
+ harness/
429
+ architecture.md ← codebase overview for Claude
430
+ constraints.yaml ← max_lines, require_tests, style rules
431
+ permissions.yaml ← per-agent file access control (read/write/deny)
432
+ memory/
433
+ MEMORY.md ← index of all memory files
434
+ project.md ← project context and open decisions
435
+ feedback.md ← corrections + confirmed approaches
436
+ stack.md ← stack details the scanner can't detect
437
+ adrs/ ← architecture decision records
438
+ skills/
439
+ generated/ ← AI-generated skills (fh skills regen)
440
+ expert/ ← 16 preinstalled expert skills
441
+ workflows/ ← MCP workflow skills
442
+ worktrees/ ← isolated git worktrees (fh party run)
443
+ audit.log ← JSONL audit trail (fh security commands)
444
+ cost-config.yaml ← spend limits (fh cost --limit/--alert)
445
+ AGENTS.md ← cross-tool agent standard
446
+ CLAUDE.md ← forgehive block inserted, rest preserved
447
+ ```
448
+
449
+ ---
450
+
451
+ ## CLAUDE.md Merge Behavior
452
+
453
+ `fh init` **never overwrites** CLAUDE.md. Three cases:
454
+
455
+ | State | Action |
456
+ |---|---|
457
+ | No CLAUDE.md exists | Create new file with forgehive block |
458
+ | CLAUDE.md exists, no forgehive block | Append block at the end |
459
+ | CLAUDE.md exists, block already present | Replace only the block |
460
+
461
+ The block is delimited by `<!-- forgehive:start -->` and `<!-- forgehive:end -->` markers. `fh rollback` removes exactly this block and nothing else.
462
+
463
+ ---
464
+
465
+ ## AGENTS.md — Cross-Tool Standard
466
+
467
+ `fh init` generates `AGENTS.md` in the project root following the Linux Foundation / AAIF standard. This file is read automatically by:
468
+
469
+ - **Cursor** — agent behavior configuration
470
+ - **GitHub Copilot** — workspace instructions
471
+ - **Gemini CLI** — project context
472
+ - **OpenAI Codex** — coding guidelines
473
+ - **Windsurf** — agent policies
474
+
475
+ You only maintain one file; all tools benefit.
476
+
477
+ ---
478
+
479
+ ## Agents
480
+
481
+ | Agent | Role | Party Sets |
482
+ |---|---|---|
483
+ | **Nora** | Senior Research Analyst | full |
484
+ | **Eli** | Technical Writer | review, full |
485
+ | **Remy** | Creative Strategist | full |
486
+ | **Suki** | UX Designer | design, full |
487
+ | **Viktor** | System Architect | build, design, full |
488
+ | **Kai** | Senior Engineer | build, review, full |
489
+ | **Sam** | QA & Test Architect | build, review, security, full |
490
+ | **Vera** | Security Analyst (OWASP, GDPR, Auth) | security, full |
491
+
492
+ ---
493
+
494
+ ## Guardrails
495
+
496
+ `fh init` installs a Bash hook at `.claude/settings.json` that blocks:
497
+
498
+ **Secrets in staged git files:**
499
+ - Anthropic API keys (`sk-ant-...`)
500
+ - GitHub tokens (`ghp_...`)
501
+ - AWS Access Key IDs (`AKIA...`)
502
+ - Slack bot tokens (`xoxb-...`)
503
+ - PEM private keys
504
+
505
+ **Dangerous commands:**
506
+ - `git push --force`
507
+ - `git reset --hard`
508
+ - `rm -rf /`
509
+ - `DROP TABLE`
510
+
511
+ The hook fires on every bash command execution in Claude Code and exits 1 if a match is found.
512
+
513
+ ---
514
+
515
+ ## Typical Workflows
516
+
517
+ ### New project setup
518
+
519
+ ```bash
520
+ cd my-project
521
+ fh init
522
+ fh confirm
523
+ # Open Claude Code → Claude now has full context
524
+ ```
525
+
526
+ ### After adding new dependencies
527
+
528
+ ```bash
529
+ npm install new-package
530
+ fh scan --update # re-scan to pick up new dependency
531
+ fh confirm # re-confirm the updated capabilities
532
+ ```
533
+
534
+ ### Weekly security check
535
+
536
+ ```bash
537
+ fh security scan # check for secrets and SAST issues
538
+ fh security deps # check for new CVEs in dependencies
539
+ fh security report gdpr # update compliance report
540
+ ```
541
+
542
+ ### Sharing context with the team
543
+
544
+ ```bash
545
+ fh memory snapshot export ./team-context.json
546
+ git add team-context.json
547
+ git commit -m "chore: update shared forgehive context"
548
+
549
+ # On another machine:
550
+ fh memory snapshot import ./team-context.json
551
+ ```
552
+
553
+ ### Starting a multi-agent build session
554
+
555
+ ```bash
556
+ fh party --set build
557
+ fh party run
558
+ # → Creates worktrees for Viktor (architect), Kai (engineer), Sam (QA)
559
+ # → Each Claude Code session opens in its own isolated worktree
560
+
561
+ fh party status # check what's running
562
+ fh party cleanup # clean up after the session
563
+ ```
564
+
565
+ ### Connecting Linear and GitHub
566
+
567
+ ```bash
568
+ fh wire linear
569
+ fh mcp auth add linear LINEAR_API_KEY=lin_api_...
570
+
571
+ fh wire github
572
+ fh mcp auth add github GITHUB_TOKEN=ghp_...
573
+
574
+ # Credentials stored at ~/.forgehive/credentials.json (chmod 600)
575
+ fh mcp auth list # verify both services are stored
576
+ ```
577
+
578
+ ---
579
+
580
+ ## Configuration Files
581
+
582
+ ### `.forgehive/capabilities.yaml`
583
+
584
+ Auto-generated by `fh init`, confirmed by `fh confirm`. Contains:
585
+ - `status`: `draft` | `confirmed`
586
+ - Detected language, framework, package manager
587
+ - Key directories and entry points
588
+ - Test configuration
589
+
590
+ Edit this file manually to correct anything the scanner got wrong, then run `fh confirm` again.
591
+
592
+ ### `.forgehive/harness/constraints.yaml`
593
+
594
+ Defines Claude's behavior rules for this project:
595
+ - `max_lines_per_file`: soft limit for file size
596
+ - `require_tests`: whether to require tests for new code
597
+ - `test_framework`: which test runner to use
598
+ - Style and formatting preferences
599
+
600
+ ### `.forgehive/harness/permissions.yaml`
601
+
602
+ Per-agent file access control. Default permissions are conservative — agents can only read/write files relevant to their role. Edit to expand or restrict access.
603
+
604
+ ### `~/.forgehive/credentials.json`
605
+
606
+ Global credential store (chmod 600). Managed exclusively via `fh mcp auth` commands — do not edit manually.
607
+
608
+ ---
609
+
610
+ ## Tech Stack
611
+
612
+ | | |
613
+ |---|---|
614
+ | Runtime | Node.js ≥ 18, ESM |
615
+ | Language | TypeScript |
616
+ | Build | esbuild → `dist/cli.js` (~205 KB, single bundle) |
617
+ | Type check | `tsc --noEmit` |
618
+ | Tests | `node:test` (native) + tsx ESM loader, 217 tests |
619
+ | Dependencies | `js-yaml` (sole runtime dependency) |
620
+
621
+ ```bash
622
+ npm run build # esbuild → dist/cli.js
623
+ npm run typecheck # tsc --noEmit
624
+ npm test # node --import tsx/esm --test test/*.test.ts
625
+ ```
626
+
627
+ ---
628
+
629
+ ## License
630
+
631
+ MIT
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};