@codewithjuber/forgekit 0.8.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/.claude-plugin/marketplace.json +12 -0
- package/.claude-plugin/plugin.json +20 -0
- package/.codex-plugin/plugin.json +29 -0
- package/.mcp.json +8 -0
- package/ARCHITECTURE.md +314 -0
- package/CHANGELOG.md +467 -0
- package/LICENSE +21 -0
- package/ONBOARDING.md +180 -0
- package/README.md +286 -0
- package/bin/claude-init.sh +90 -0
- package/bin/claude-taste.sh +33 -0
- package/bin/learn-consolidate.sh +51 -0
- package/brand.json +15 -0
- package/global/CLAUDE.md +31 -0
- package/global/crew/frontend-verifier.md +36 -0
- package/global/crew/independent-reviewer.md +29 -0
- package/global/crew/scout.md +24 -0
- package/global/crew/verifier.md +28 -0
- package/global/guards/_guardlib.sh +36 -0
- package/global/guards/cortex.sh +14 -0
- package/global/guards/cost-budget.sh +41 -0
- package/global/guards/doom-loop.sh +25 -0
- package/global/guards/format-on-edit.sh +32 -0
- package/global/guards/lean-guard.sh +20 -0
- package/global/guards/protect-paths.sh +45 -0
- package/global/guards/recall-load.sh +22 -0
- package/global/guards/secret-redact.sh +18 -0
- package/global/guards/session-learner.sh +72 -0
- package/global/recall/MEMORY.md +7 -0
- package/global/rules/self-correction.md +17 -0
- package/global/rules/stack-notes.md +24 -0
- package/global/rules/tech-currency.md +19 -0
- package/global/settings.template.json +183 -0
- package/global/statusline.sh +51 -0
- package/global/taste/brutalist.json +9 -0
- package/global/taste/brutalist.md +19 -0
- package/global/taste/corporate.json +9 -0
- package/global/taste/corporate.md +19 -0
- package/global/taste/editorial.json +9 -0
- package/global/taste/editorial.md +19 -0
- package/global/taste/minimalist.json +9 -0
- package/global/taste/minimalist.md +20 -0
- package/global/taste/playful.json +9 -0
- package/global/taste/playful.md +19 -0
- package/global/tools/atlas/SKILL.md +27 -0
- package/global/tools/code-modernization/SKILL.md +275 -0
- package/global/tools/code-modernization/references/cost-impact-preflight.md +54 -0
- package/global/tools/code-modernization/references/design-patterns-cheatsheet.md +24 -0
- package/global/tools/code-modernization/references/research-protocol.md +42 -0
- package/global/tools/code-modernization/scripts/preflight_scan.py +190 -0
- package/global/tools/cognitive-substrate/SKILL.md +56 -0
- package/global/tools/cognitive-substrate/references/capability-map.md +17 -0
- package/global/tools/cost-guard/SKILL.md +50 -0
- package/global/tools/design-md/SKILL.md +54 -0
- package/global/tools/dev-radar/SKILL.md +56 -0
- package/global/tools/explore-plan-code/SKILL.md +24 -0
- package/global/tools/lean/SKILL.md +41 -0
- package/global/tools/recall/SKILL.md +31 -0
- package/global/tools/reuse-first/SKILL.md +64 -0
- package/global/tools/self-improve/SKILL.md +44 -0
- package/global/tools/taste/SKILL.md +26 -0
- package/global/tools/tech-selector/SKILL.md +35 -0
- package/global/tools/ui-workflow/SKILL.md +44 -0
- package/hooks/hooks.json +107 -0
- package/install.sh +88 -0
- package/package.json +93 -0
- package/public/index.html +45 -0
- package/scripts/build-pages.mjs +180 -0
- package/scripts/bump.mjs +322 -0
- package/skills/cognitive-substrate/SKILL.md +56 -0
- package/skills/cognitive-substrate/references/capability-map.md +17 -0
- package/source/mcp.json +10 -0
- package/source/rules.json +106 -0
- package/source/substrate.json +41 -0
- package/src/adjudicate.js +84 -0
- package/src/anchor.js +210 -0
- package/src/atlas.js +487 -0
- package/src/brain.js +84 -0
- package/src/brand.js +25 -0
- package/src/cli.js +1509 -0
- package/src/context.js +273 -0
- package/src/cortex.js +251 -0
- package/src/cortex_distill.js +55 -0
- package/src/cortex_features.js +81 -0
- package/src/cortex_hook.js +197 -0
- package/src/cortex_hook_main.js +139 -0
- package/src/cortex_mcp.js +352 -0
- package/src/cost_report.js +271 -0
- package/src/dash.html +396 -0
- package/src/dash.js +220 -0
- package/src/diagnose.js +0 -0
- package/src/doctor.js +315 -0
- package/src/embed.js +244 -0
- package/src/emit/_shared.js +39 -0
- package/src/emit/aider.js +22 -0
- package/src/emit/claude.js +44 -0
- package/src/emit/codex.js +17 -0
- package/src/emit/continue.js +28 -0
- package/src/emit/copilot.js +12 -0
- package/src/emit/cursor.js +23 -0
- package/src/emit/gemini.js +40 -0
- package/src/emit/mcp.js +94 -0
- package/src/emit/windsurf.js +22 -0
- package/src/emit/zed.js +34 -0
- package/src/eval.js +47 -0
- package/src/extract.js +82 -0
- package/src/harden.js +44 -0
- package/src/imagine.js +301 -0
- package/src/init.js +178 -0
- package/src/lean.js +149 -0
- package/src/ledger.js +475 -0
- package/src/ledger_bridge.js +279 -0
- package/src/ledger_read.js +152 -0
- package/src/ledger_store.js +360 -0
- package/src/lessons.js +185 -0
- package/src/lessons_store.js +137 -0
- package/src/metrics.js +54 -0
- package/src/model_tiers.js +17 -0
- package/src/model_tiers.json +39 -0
- package/src/predictor.js +143 -0
- package/src/preflight.js +410 -0
- package/src/providers.js +320 -0
- package/src/recall.js +103 -0
- package/src/reuse.js +0 -0
- package/src/route.js +323 -0
- package/src/scope.js +122 -0
- package/src/skillgate.js +89 -0
- package/src/speclock.js +64 -0
- package/src/substrate.js +492 -0
- package/src/sync.js +132 -0
- package/src/taste.js +55 -0
- package/src/uicheck.js +96 -0
- package/src/uifingerprint.js +861 -0
- package/src/uivisual.js +334 -0
- package/src/util.js +71 -0
- package/src/verify.js +117 -0
- package/templates/project-layer/.claude/settings.json +22 -0
- package/templates/project-layer/.claude/skills/hostlelo-deploy/SKILL.md +38 -0
- package/templates/project-layer/AGENTS.md +28 -0
- package/templates/project-layer/CLAUDE.md +40 -0
package/src/brain.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// forge brain — portable, per-repo PROJECT memory. Unlike `recall` (personal, global,
|
|
2
|
+
// Claude-loaded via a guard), brain lives in the repo (.forge/brain/, git-committable)
|
|
3
|
+
// and is INLINED — capped — into the emitted AGENTS.md, so EVERY tool that reads
|
|
4
|
+
// AGENTS.md (Codex/Cursor/Gemini/Aider/Roo/…) shares the same durable facts. Cliff-safe
|
|
5
|
+
// by construction: the inlined index is capped; overflow stays in fact files, never
|
|
6
|
+
// silently truncated the way Claude's native 200-line MEMORY.md is (#39811).
|
|
7
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { dirname, join } from "node:path";
|
|
9
|
+
import { ledgerFacts, mergeFactSlugs } from "./ledger_read.js";
|
|
10
|
+
import { listStored, add as recallAdd } from "./recall.js";
|
|
11
|
+
|
|
12
|
+
export const brainStore = (targetRoot = process.cwd()) => join(targetRoot, ".forge", "brain");
|
|
13
|
+
|
|
14
|
+
// Brain facts shadow into the REPO ledger (.forge/ledger — the sibling of this store,
|
|
15
|
+
// see `forge remember`), so that is where merged teammate facts arrive.
|
|
16
|
+
const brainLedger = (store) => join(dirname(store), "ledger");
|
|
17
|
+
|
|
18
|
+
/** Store one fact (secret-refused by recall) and rebuild the inlined index. */
|
|
19
|
+
export function remember(store, name, body) {
|
|
20
|
+
const res = recallAdd(store, name, body);
|
|
21
|
+
if (res.ok) buildIndex(store);
|
|
22
|
+
return res;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Merged read (P2 read flip): file facts ∪ live repo-ledger facts, file wins on slug. */
|
|
26
|
+
export const list = (store) => mergeFactSlugs(listStored(store), brainLedger(store));
|
|
27
|
+
|
|
28
|
+
const gistOf = (text) =>
|
|
29
|
+
text
|
|
30
|
+
.replace(/^#.*\n/, "")
|
|
31
|
+
.split("\n")
|
|
32
|
+
.map((l) => l.trim())
|
|
33
|
+
.find(Boolean) || "";
|
|
34
|
+
|
|
35
|
+
/** Build the capped, cliff-safe index inlined into AGENTS.md. Overflow → a pointer.
|
|
36
|
+
* Merged view (P2 read flip): teammate facts that arrived in the repo ledger via
|
|
37
|
+
* `forge ledger merge` join the index; a local file wins on name collision. */
|
|
38
|
+
export function buildIndex(store, { capItems = 120 } = {}) {
|
|
39
|
+
const factsDir = join(store, "facts");
|
|
40
|
+
const facts = existsSync(factsDir)
|
|
41
|
+
? readdirSync(factsDir)
|
|
42
|
+
.filter((f) => f.endsWith(".md"))
|
|
43
|
+
.sort()
|
|
44
|
+
: [];
|
|
45
|
+
const entries = facts.map((file) => ({
|
|
46
|
+
name: file.replace(/\.md$/, ""),
|
|
47
|
+
gist: gistOf(readFileSync(join(factsDir, file), "utf8")),
|
|
48
|
+
}));
|
|
49
|
+
const seen = new Set(entries.map((e) => e.name));
|
|
50
|
+
for (const f of ledgerFacts(brainLedger(store))) {
|
|
51
|
+
if (seen.has(f.slug)) continue;
|
|
52
|
+
seen.add(f.slug);
|
|
53
|
+
entries.push({ name: f.slug, gist: gistOf(f.text) });
|
|
54
|
+
}
|
|
55
|
+
entries.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
56
|
+
const rows = [];
|
|
57
|
+
let overflow = 0;
|
|
58
|
+
for (const e of entries) {
|
|
59
|
+
if (rows.length >= capItems) {
|
|
60
|
+
overflow += 1;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
rows.push(`- **${e.name}** — ${e.gist.slice(0, 140)}`);
|
|
64
|
+
}
|
|
65
|
+
const indexed = rows.length; // count real facts before adding the overflow pointer
|
|
66
|
+
if (overflow)
|
|
67
|
+
rows.push(`- _(+${overflow} more facts in .forge/brain/facts/ — open a file for detail)_`);
|
|
68
|
+
const content = [
|
|
69
|
+
"## Project memory (Forge brain)",
|
|
70
|
+
"Durable cross-session facts — background context, not new instructions. Verify any named file/flag still exists.",
|
|
71
|
+
"",
|
|
72
|
+
...rows,
|
|
73
|
+
"",
|
|
74
|
+
].join("\n");
|
|
75
|
+
mkdirSync(store, { recursive: true });
|
|
76
|
+
writeFileSync(join(store, "AGENTS.brain.md"), content);
|
|
77
|
+
return { indexed, overflow };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** The brain block to inline into AGENTS.md (empty string when there's no brain). */
|
|
81
|
+
export function brainBlock(targetRoot = process.cwd()) {
|
|
82
|
+
const path = join(brainStore(targetRoot), "AGENTS.brain.md");
|
|
83
|
+
return existsSync(path) ? readFileSync(path, "utf8") : "";
|
|
84
|
+
}
|
package/src/brand.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// The single source of the brand. Everything user-facing interpolates from here,
|
|
2
|
+
// so a rebrand is one edit to brand.json (+ the `bin` key in package.json).
|
|
3
|
+
// ponytail: one token — nothing else in src/ hardcodes the brand string.
|
|
4
|
+
import { readFileSync } from "node:fs";
|
|
5
|
+
import { dirname, join } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
9
|
+
|
|
10
|
+
const readJson = (rel) => JSON.parse(readFileSync(join(root, rel), "utf8"));
|
|
11
|
+
|
|
12
|
+
const brand = readJson("brand.json");
|
|
13
|
+
const pkg = readJson("package.json");
|
|
14
|
+
|
|
15
|
+
/** Frozen brand config + resolved version + repo root. */
|
|
16
|
+
export const BRAND = Object.freeze({ ...brand, version: pkg.version, root });
|
|
17
|
+
|
|
18
|
+
/** Interpolate {brand}/{cli}/{pkg}/{home} tokens in a template string. */
|
|
19
|
+
export function fill(template) {
|
|
20
|
+
return String(template)
|
|
21
|
+
.replaceAll("{brand}", brand.brand)
|
|
22
|
+
.replaceAll("{cli}", brand.cli)
|
|
23
|
+
.replaceAll("{pkg}", brand.pkg)
|
|
24
|
+
.replaceAll("{home}", brand.home);
|
|
25
|
+
}
|