forgetrail 0.5.3 → 0.5.5
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/CONTINUATION_PROMPT.md +3 -3
- package/INITIAL_PROMPT.md +7 -7
- package/README.md +2 -2
- package/WORKFLOW.md +12 -12
- package/content/AGENT_INTEGRATION_claude.md +1 -1
- package/content/AGENT_INTEGRATION_cursor.md +2 -2
- package/content/AGENT_INTEGRATION_generic.md +3 -3
- package/content/AGENT_INTEGRATION_grok.md +6 -6
- package/content/COMPANION_TOOLS.md +2 -2
- package/content/FORGETRAIL_LITE.md +12 -13
- package/content/FORGETRAIL_PROGRESS.md +1 -1
- package/content/GENESIS_SPEC_PROMPT.md +1 -1
- package/content/GENESIS_STUB.md +1 -1
- package/content/GREENFIELD_INTAKE.md +2 -2
- package/content/KICKOFF_WITHOUT_MCP.md +1 -1
- package/content/NEW_PROJECT_BOOTSTRAP.md +10 -10
- package/content/PLAN_MODE_PATTERNS.md +2 -2
- package/content/POCKETBASE_SCHEMA_SCRIPT.md +1 -1
- package/content/POST_BOOTSTRAP_USER_MESSAGE.md +2 -2
- package/content/SESSION_RESUME_MCP.md +1 -1
- package/content/companion-tools.json +3 -3
- package/content/cursor-rules/forgetrail-phase-status.mdc +3 -3
- package/content/cursor-rules/forgetrail-updates-log.mdc +1 -1
- package/content/examples/two-session-continuity.md +2 -2
- package/content/hooks/README.md +1 -1
- package/content/hooks/guard-shell.mjs +1 -1
- package/content/hooks/session-start.mjs +0 -1
- package/content/hooks/session-stop.mjs +76 -4
- package/content/scripts/forgetrail-dev-launcher.mjs +1 -1
- package/content/skills/forgetrail/SKILL.md +5 -6
- package/content/skills/forgetrail/SKILL_FACTS.md +1 -1
- package/docs/NPM.md +4 -4
- package/docs/PHASE_1_BRIEF.md +2 -2
- package/docs/SPEC_FEATURE_TEMPLATE.md +1 -1
- package/package.json +1 -1
- package/scripts/forgetrail-cli.mjs +8 -0
- package/scripts/install.mjs +1 -1
- package/scripts/tracking-cutover.test.mjs +67 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ForgeTrail — New project bootstrap (MCP-first)
|
|
2
2
|
|
|
3
|
-
Use this when **ForgeTrail is available via the MCP server** (recommended). The customer repo should **not** contain a copied `_forgetrail/` methodology tree — templates, audits, phase playbooks, and lessons are retrieved through MCP tools from the open-source ForgeTrail install. Project state lives in **`appledger/`**.
|
|
3
|
+
Use this when **ForgeTrail is available via the MCP server** (recommended). The customer repo should **not** contain a copied `_forgetrail/` methodology tree — templates, audits, phase playbooks, and lessons are retrieved through MCP tools from the open-source ForgeTrail install. Project state lives in **`appledger/`**. `.forgetrail/` is hooks and host rules.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ Use this when **ForgeTrail is available via the MCP server** (recommended). The
|
|
|
8
8
|
|
|
9
9
|
1. Follow the **7-phase lifecycle** (Plan → Build → Stabilize → Iterate → Refine → Align → Harden).
|
|
10
10
|
2. **Pause at phase transitions** for explicit user approval before advancing.
|
|
11
|
-
3. **Persist ForgeTrail state in `appledger/`** — manifest, `profiles/forgetrail.yaml`, and records.
|
|
11
|
+
3. **Persist ForgeTrail state in `appledger/`** — manifest, `profiles/forgetrail.yaml`, and records. Add **`.forgetrail/AGENTS.md`**, **`.forgetrail/CLAUDE.md`**, and **`.forgetrail/cursor/rules/`** (symlink `.mdc` files into **`.cursor/rules/`**) for host rules. Product docs (**`docs/`**, **`CONTEXT_PROMPT.md`**, **`README.md`**, **`TODO.md`**) stay at repo root. **Optionally gitignore `.forgetrail/`** if you want a cleaner public history or use MCP-only without a vendored Lite file (see **`FORGETRAIL_LITE.md` §1.5**). Commit **`appledger/`**. For **Cursor**, add **`.cursor/rules/forgetrail-phase-status.mdc`** from **`getNewProjectKickoff`** (bundled) or **`getForgeTrailCursorPhaseRule`** — it reads **`appledger/profiles/forgetrail.yaml`**. Also add **`forgetrail-lessons-gate.mdc`** and **`forgetrail-lessons-mcp.mdc`** from the same bundle or **`getForgeTrailCursorLessonsRules`** so agents call **`getAntiPatterns`** + **`searchLessons`** before substantial feature work.
|
|
12
12
|
4. **Pull methodology on demand** via ForgeTrail MCP tools (below). Do not ask the user to paste entire ForgeTrail files.
|
|
13
13
|
5. **User-facing replies:** After bootstrap files exist, **`getPostBootstrapUserMessage`** defines the **first** reply—plain language only: what you did, what happens next, and a **concrete “reply with”** (problem, audience, hero workflow, constraints, v1 scope). **No** MCP/tool names, methodology jargon, ForgeTrail footers, file inventories, or “reference only” tracking dumps unless the user asks for internals.
|
|
14
14
|
6. **Lists and choices:** When offering several next steps or options, follow **`USER_REPLY_FORMAT.md`** (ForgeTrail): **numbers** for ordered pipelines, **bullets** for parallel items, **letters** for pick-one / “which first—A/B/C?”—never hide multiple paths in one long sentence.
|
|
@@ -21,7 +21,7 @@ On a **new project folder**, commands like `git status`, `git log`, or `git rev-
|
|
|
21
21
|
|
|
22
22
|
**You** initialize git after bootstrap files exist (unless the user chose **no-git mode** — see **`FORGETRAIL_LITE.md` §4.1**):
|
|
23
23
|
|
|
24
|
-
1. Write kickoff artifacts first: **`appledger/`**, guardrails, optional Cursor rules.
|
|
24
|
+
1. Write kickoff artifacts first: **`appledger/`**, guardrails, optional Cursor rules.
|
|
25
25
|
2. Check with `git rev-parse --is-inside-work-tree`. If it returns false or errors, run **`git init -b main`** at the repo root (or `git init` + `git branch -m main` on older Git). **Never** re-init an existing repo.
|
|
26
26
|
3. Write a **minimal** `.gitignore` now — at least `node_modules/`, `.env`, `.DS_Store`. Add `.forgetrail/` **only** if you chose the gitignore branch in **`FORGETRAIL_LITE.md` §1.5** (default MCP greenfield: **commit `.forgetrail/`**).
|
|
27
27
|
4. Make a **first commit** when steps 1–3 are done so the user has a clean baseline (plain `-m` or `-F`). Skip if the repo already had history; skip entirely in no-git mode.
|
|
@@ -34,7 +34,7 @@ Do **not** treat an early missing-repo git error as blocking. Prefer **`git rev-
|
|
|
34
34
|
|
|
35
35
|
- **Phase 1:** Create and lock **`docs/PHASE_1_BRIEF.md`** (`getTemplate({ name: "PHASE_1_BRIEF" })`). Log major commitments as **decision records in `appledger/`**. If the host supports **native plan mode**, use **`getPlanModePatterns`** and WORKFLOW §1c — plan first, export to the brief on approval (no app code during planning).
|
|
36
36
|
- **App/code:** Phase 2 still means the **full runnable spine** in one pass: init, deps, data path, routes, components, hero flow **end-to-end**. Do **not** defer that spine.
|
|
37
|
-
- **Project archetype (Phase 1):** classify the project as **`product`** (default), **`internal-tool`**, or **`one-shot`** (gift / event / demo) — often inferable from the problem statement; confirm rather than interrogate. Record it in **`PHASE_1_BRIEF.md`**, as a decision record, and as **`archetype`** on **`appledger/profiles/forgetrail.yaml`**. Prune non-applicable criteria on that profile (internal tools: Phase 6 optional, no payments/business-plan rows; one-shots: phases 5–7 collapse into one polish-and-ship gate). Log the pruning as a decision.
|
|
37
|
+
- **Project archetype (Phase 1):** classify the project as **`product`** (default), **`internal-tool`**, or **`one-shot`** (gift / event / demo) — often inferable from the problem statement; confirm rather than interrogate. Record it in **`PHASE_1_BRIEF.md`**, as a decision record, and as **`archetype`** on **`appledger/profiles/forgetrail.yaml`**. Prune non-applicable criteria on that profile (internal tools: Phase 6 optional, no payments/business-plan rows; one-shots: phases 5–7 collapse into one polish-and-ship gate). Log the pruning as a decision. See **WORKFLOW §1d** and **`GREENFIELD_INTAKE.md`** §0.
|
|
38
38
|
- **Web-app sub-question (Phase 1, when app type = web app):** before locking PocketBase + auth, ask *"Does any state need to outlive the browser — accounts, cross-device sync, shared data — or is every user's state private and fine in `localStorage`?"* If local-only → **drop PocketBase and auth**, `adapter-static` becomes viable, no deploy-time secrets; persist via `localStorage` / `IndexedDB`. If persistent → the full Default-A stack applies. Record the choice as a decision record and in **`PHASE_1_BRIEF.md` §4 (`State persistence:` row)**. See **`FORGETRAIL_LITE.md` §7** (A-local vs A-persistent) and **`GREENFIELD_INTAKE.md`** §7.
|
|
39
39
|
- **Initial data (optional):** The user may create **JSON files** for seed, fixtures, or imports by using **any** LLM chat (including **local Ollama**) with the copy-paste prompt in **`FORGETRAIL_LITE.md` §4.3** (structured JSON only; save to `data/` or `fixtures/`). The agent **validates** shape before import; the user can repeat for multiple datasets. Not a replacement for the Phase 1 brief — only for bulk structured content.
|
|
40
40
|
- **Web search (optional):** If v1 needs **live internet search**, the user can sign up for **[Tavily](https://tavily.com/)** and/or the **[Brave Search API](https://api-dashboard.search.brave.com/)** (free or entry-level credits per vendor terms), add keys to **`.env`**, and the agent wires **server-side** clients. See **`FORGETRAIL_LITE.md` §4.4** and **`GREENFIELD_INTAKE.md`** §6.
|
|
@@ -57,7 +57,7 @@ Call **`getProgressiveDocSchedule`** for the canonical phase → doc matrix (WOR
|
|
|
57
57
|
- If **`docs/GENESIS.md`** already exists (Try path / human brought a what-not-how spec), call **`ingestPlanArtifact`** with that file’s contents as `planContent`, review the draft brief, then continue intake for gaps only (`getGreenfieldIntakePrompt`). Do **not** re-run a full blank Genesis prompt unless the user asks.
|
|
58
58
|
- If the user only has an **idea** (no file yet), especially one that wraps an existing app’s data/file format, offer **`getGenesisSpecPrompt`**: they paste it into an **external** LLM chat, save the result as **`docs/GENESIS.md`**, then you ingest as above. Humans without MCP can follow repo-root **`TRY_FORGETRAIL.md`** instead.
|
|
59
59
|
- Skip this step if the user wants straight Lite/MCP intake questions with no Genesis file.
|
|
60
|
-
1. Call **`getNewProjectKickoff`** (`includeCursorRule: false` if not using **Cursor**). It bundles this document, **`appledger/`** initialization, post-bootstrap user-message guidance, and optionally the Cursor rules (phase status + lessons gate + lessons MCP detail)—**or** call **`getNewProjectBootstrap`**, **`getInitialWorkflowTracking`**, **`getPostBootstrapUserMessage`**, **`getForgeTrailCursorPhaseRule`**, and **`getForgeTrailCursorLessonsRules`** separately if you need only one piece. **`getInitialWorkflowTracking` does not return a JSON file.** Write **`appledger/`**.
|
|
60
|
+
1. Call **`getNewProjectKickoff`** (`includeCursorRule: false` if not using **Cursor**). It bundles this document, **`appledger/`** initialization, post-bootstrap user-message guidance, and optionally the Cursor rules (phase status + lessons gate + lessons MCP detail)—**or** call **`getNewProjectBootstrap`**, **`getInitialWorkflowTracking`**, **`getPostBootstrapUserMessage`**, **`getForgeTrailCursorPhaseRule`**, and **`getForgeTrailCursorLessonsRules`** separately if you need only one piece. **`getInitialWorkflowTracking` does not return a JSON file.** Write **`appledger/`**. The **next message to the user** follows **`getPostBootstrapUserMessage`** (product-facing, no methodology leak).
|
|
61
61
|
2. **Initialize git if needed** (see **Greenfield git** above): after bootstrap files exist, `git init -b main` when `git rev-parse --is-inside-work-tree` fails; minimal `.gitignore`; optional first commit. Do not ask the user to run `git init`.
|
|
62
62
|
3. Call **`getProgressiveDocSchedule`** and keep it in mind for every phase transition.
|
|
63
63
|
4. Call **`getChecklist`** with section `before-session-1` — complete those items with the user (problem statement, stack, assets, hero flow).
|
|
@@ -106,7 +106,7 @@ Call **`getProgressiveDocSchedule`** for the canonical phase → doc matrix (WOR
|
|
|
106
106
|
|
|
107
107
|
**Immediately (greenfield):**
|
|
108
108
|
|
|
109
|
-
- **`appledger/`** — if the `appledger` command is installed, run **`appledger init`** and pass **`--name`** when the name is known. Init writes the manifest, profile, application record, and session record, and does not overwrite them. If the command is not installed, write those four files by hand.
|
|
109
|
+
- **`appledger/`** — if the `appledger` command is installed, run **`appledger init`** and pass **`--name`** when the name is known. Init writes the manifest, profile, application record, and session record, and does not overwrite them. If the command is not installed, write those four files by hand. Commit **`appledger/`**.
|
|
110
110
|
- **`docs/GENESIS.md`** (optional but preferred on the Try path) — what-not-how product spec from **`getGenesisSpecPrompt`** / **`TRY_FORGETRAIL.md`**. If present at kickoff, ingest with **`ingestPlanArtifact`** before locking the brief.
|
|
111
111
|
- **Git repo** — if `git rev-parse --is-inside-work-tree` fails, **`git init -b main`** after bootstrap files exist (see **Greenfield git**). A failed early `git status` on an empty folder is **not** an error. Add minimal **`.gitignore`** and an optional first commit before Phase 1 intake.
|
|
112
112
|
- **Cursor users:** `.cursor/rules/forgetrail-phase-status.mdc` — from **`getForgeTrailCursorPhaseRule`**. **`forgetrail-lessons-gate.mdc`** + **`forgetrail-lessons-mcp.mdc`** — from **`getForgeTrailCursorLessonsRules`** or **`getNewProjectKickoff`** (lessons workflow before substantial changes).
|
|
@@ -140,9 +140,9 @@ Call **`getProgressiveDocSchedule`** for the canonical phase → doc matrix (WOR
|
|
|
140
140
|
|
|
141
141
|
- At **each session start**, read **`appledger/profiles/forgetrail.yaml`**, the latest session record, and `CONTEXT_PROMPT.md` (if present). Use **`getPhaseGuidance`** for the current phase.
|
|
142
142
|
- When exit criteria for a phase appear satisfied, **state that explicitly** and **wait for user confirmation** before treating the next phase as active; change `current_phase_instance` only after approval.
|
|
143
|
-
- After substantive work, update **`appledger/`** (criteria, decision records, lessons, the session).
|
|
143
|
+
- After substantive work, update **`appledger/`** (criteria, decision records, lessons, the session). If a legacy `.forgetrail/workflow_tracking.json` exists and is not a pointer, **`validateTracking`** reports the conflict.
|
|
144
144
|
- If a problem does not converge after **~5 turns**, propose a **different approach**, not more patches.
|
|
145
|
-
- **When the project ends** (shipped, delivered, shelved), run the **wrap protocol** (WORKFLOW §1e): sweep lesson and decision records for generalizable lessons, run the propagation prompt in **Harvest mode**, set **`project_status`** to **`wrapped`** on the profile, and add a final session record with end state and handoff pointers.
|
|
145
|
+
- **When the project ends** (shipped, delivered, shelved), run the **wrap protocol** (WORKFLOW §1e): sweep lesson and decision records for generalizable lessons, run the propagation prompt in **Harvest mode**, set **`project_status`** to **`wrapped`** on the profile, and add a final session record with end state and handoff pointers.
|
|
146
146
|
- **Git commits:** `git commit -F <file>` or plain `-m` at natural stopping points with concise summaries. Run verification checks prior to commit.
|
|
147
147
|
|
|
148
148
|
---
|
|
@@ -157,7 +157,7 @@ ForgeTrail’s reference implementation used **SvelteKit (Svelte 5), TypeScript,
|
|
|
157
157
|
|
|
158
158
|
If the user has [gstack](https://github.com/garrytan/gstack) installed (Claude Code slash-command skills), ForgeTrail and gstack are **complementary** — ForgeTrail provides the lifecycle methodology, project memory, and business/brand layer; gstack provides sprint execution, browser-based QA, and deploy automation. Use both:
|
|
159
159
|
|
|
160
|
-
**ForgeTrail owns the lifecycle.** Phase transitions, exit criteria, `appledger/`, progressive docs, lessons, and audits all come from ForgeTrail MCP.
|
|
160
|
+
**ForgeTrail owns the lifecycle.** Phase transitions, exit criteria, `appledger/`, progressive docs, lessons, and audits all come from ForgeTrail MCP.
|
|
161
161
|
|
|
162
162
|
**gstack owns the sprint inner loop.** Within a ForgeTrail phase, use gstack skills for the build → review → test → ship cycle:
|
|
163
163
|
|
|
@@ -171,7 +171,7 @@ If the user has [gstack](https://github.com/garrytan/gstack) installed (Claude C
|
|
|
171
171
|
| **Phase 6** (Align) | `/design-consultation` for design system, `/plan-ceo-review` for scope check | Create **`BRAND_AND_PRODUCT.md`** and restructure **`TODO.md`** via ForgeTrail templates — gstack doesn't have brand/strategy tooling. |
|
|
172
172
|
| **Phase 7** (Harden) | `/cso` for security audit, `/qa` for full regression, `/ship` + `/land-and-deploy` + `/canary` for production | ForgeTrail's `runAudit("black-hat")` and gstack's `/cso` are complementary — run both. ForgeTrail produces **`BLACK_HAT_REPORT.md`** and **`CODE_QUALITY.md`** as persistent docs; gstack's `/cso` catches runtime exploits. Use `/land-and-deploy` → `/canary` for the actual deploy pipeline, then fill ForgeTrail's **`DEPLOYMENT.md`** to document the process. |
|
|
173
173
|
|
|
174
|
-
**Key rule:** After every gstack sprint that completes meaningful work, **update `appledger/`** (criteria when evidence exists, decision records, lessons or questions, the session).
|
|
174
|
+
**Key rule:** After every gstack sprint that completes meaningful work, **update `appledger/`** (criteria when evidence exists, decision records, lessons or questions, the session). gstack persists some sprint artifacts (design docs from `/office-hours` in `~/.gstack/projects/`, retro snapshots in `.context/retros/`, review overrides, skill analytics), but it has **no lifecycle state, no decision rationale log, and no architecture context document**. ForgeTrail's `appledger/` plus `CONTEXT_PROMPT.md` are the system of record for the phase, the decisions, the lessons, and the architecture — none of which gstack tracks.
|
|
175
175
|
|
|
176
176
|
---
|
|
177
177
|
|
|
@@ -14,7 +14,7 @@ When your host agent supports a first-class plan mode (Grok Build `/plan` + ente
|
|
|
14
14
|
3. On user approval (the agent's `exit_plan_mode` or equivalent):
|
|
15
15
|
- Immediately call `getTemplate({ name: "PHASE_1_BRIEF", mode: "full" })`.
|
|
16
16
|
- Map/synthesize the approved plan content into the brief template (especially sections on architecture, data model, state persistence, content generation, and v1 scope).
|
|
17
|
-
- Write each major decision as a decision record in `appledger/`.
|
|
17
|
+
- Write each major decision as a decision record in `appledger/`.
|
|
18
18
|
- Optionally call `ingestPlanArtifact` with the full approved plan text to produce a `PHASE_1_BRIEF.md` draft and decision records (review and lock before Phase 2).
|
|
19
19
|
|
|
20
20
|
4. The approved `docs/PHASE_1_BRIEF.md` and those decision records become the handoff so Phase 2 can begin "cold" without replaying the entire planning conversation.
|
|
@@ -35,7 +35,7 @@ When your host agent supports a first-class plan mode (Grok Build `/plan` + ente
|
|
|
35
35
|
## Artifacts That Must Result from Phase 1 (Plan or Not)
|
|
36
36
|
|
|
37
37
|
- `docs/PHASE_1_BRIEF.md` (locked)
|
|
38
|
-
- `appledger/` with the `plan` phase in progress and those decision records.
|
|
38
|
+
- `appledger/` with the `plan` phase in progress and those decision records.
|
|
39
39
|
- (Later) `CONTEXT_PROMPT.md` will merge the brief in Phase 2
|
|
40
40
|
|
|
41
41
|
Never proceed to scaffolding until the user confirms the plan/brief is locked.
|
|
@@ -18,7 +18,7 @@ Manual admin-UI collection setup (click-through wizards) does not scale across m
|
|
|
18
18
|
4. **Schema (agent or one terminal):** `pnpm run pocketbase:schema` after PocketBase is up — idempotent; replaces manual Admin UI collection wizards.
|
|
19
19
|
5. **PocketBase broken?** double-click **`test-pocketbase.bat`** / **`pnpm run test:pocketbase`** — isolated health check (**`SYSTEM_HEALTH_CHECKS.md`**).
|
|
20
20
|
6. **Check progress:** double-click **`status.bat`** / **`status.sh`** or open **`docs/FORGETRAIL_PROGRESS.md`**.
|
|
21
|
-
7. Walk the hero flow;
|
|
21
|
+
7. Walk the hero flow; mark Phase 2 criteria met in `appledger/profiles/forgetrail.yaml`, with evidence, when dev runs, data appears, CRUD works, and the full journey passes.
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Post-bootstrap: first reply to the user
|
|
2
2
|
|
|
3
|
-
**When:** Right after `appledger/` exists (and, for Cursor, the phase rule file if you use it).
|
|
3
|
+
**When:** Right after `appledger/` exists (and, for Cursor, the phase rule file if you use it).
|
|
4
4
|
|
|
5
5
|
**Purpose:** Confirm what happened in **plain language** and give **one clear ask**—what the human should do or answer next. This is not an implementation report.
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ Assume the reader is a **product owner**, not a methodology engineer. They shoul
|
|
|
12
12
|
|
|
13
13
|
- MCP or ForgeTrail server/tool names (`getChecklist`, `getGreenfieldIntakePrompt`, “bundle”, “methodology stays on the MCP side”, etc.)
|
|
14
14
|
- Paths like `.cursor/rules/…` unless they need to edit something themselves
|
|
15
|
-
- Field-by-field descriptions of `
|
|
15
|
+
- Field-by-field descriptions of `appledger/` files or other “for your reference only” inventories
|
|
16
16
|
- ForgeTrail **footers** (phase · exit criteria · “Next: …”)—those are for **agent** orientation in later turns, not for this first message
|
|
17
17
|
|
|
18
18
|
Agents keep planning steps **internal** until they turn user answers into `docs/PHASE_1_BRIEF.md`.
|
|
@@ -19,7 +19,7 @@ Do **not** require `_forgetrail/WORKFLOW.md` or `_forgetrail/TRACKING_SCHEMA.md`
|
|
|
19
19
|
## Rules for this session
|
|
20
20
|
|
|
21
21
|
- When exit criteria for the current phase appear met, say so explicitly and **wait for user confirmation** before changing `current_phase_instance`.
|
|
22
|
-
- After work, update the **session record** and any new **decision records** in **`appledger/`**.
|
|
22
|
+
- After work, update the **session record** and any new **decision records** in **`appledger/`**.
|
|
23
23
|
- Keep **`CONTEXT_PROMPT.md`** the source of truth for architecture; edit it when decisions change.
|
|
24
24
|
- If stuck after **~5 turns** on one issue, propose a **fundamentally different approach**.
|
|
25
25
|
- If the repo has **gstack** installed, use its skills for sprint execution (build/review/qa/ship) within ForgeTrail phases — see **WORKFLOW.md §1b** or call **`getPhaseGuidance`** for phase-specific gstack integration. After each gstack sprint, update the **appledger** session.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"Companions are optional. Decline is success. Never block a phase on an install.",
|
|
5
5
|
"Suggest at the moment of need. Do not dump the shelf at kickoff or in the first user-facing message.",
|
|
6
6
|
"Do not install, enroll, or publish unless the user asked.",
|
|
7
|
-
"After a companion run that matters, persist the outcome on the appledger session as data.companion_outcomes and in the matching progressive doc.
|
|
7
|
+
"After a companion run that matters, persist the outcome on the appledger session as data.companion_outcomes and in the matching progressive doc.",
|
|
8
8
|
"Do not mention the mapping file, spec paths, or MCP tool names in human-facing offers.",
|
|
9
9
|
"When wiring LocalSlip, follow that tool's how. Do not write ensure-lease.mjs. Do not add the localslip package just to read a port."
|
|
10
10
|
],
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
{
|
|
191
191
|
"name": "Gap Last",
|
|
192
192
|
"homepage": "https://gaplast.dev",
|
|
193
|
-
"offer": "Gap Last separates observations, constraints, and remaining questions, then proposes hypotheses. A hypothesis is not the established cause.
|
|
193
|
+
"offer": "Gap Last separates observations, constraints, and remaining questions, then proposes hypotheses. A hypothesis is not the established cause. Record leftovers as open question records in appledger/."
|
|
194
194
|
}
|
|
195
195
|
]
|
|
196
196
|
},
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
{
|
|
204
204
|
"name": "xFacts",
|
|
205
205
|
"homepage": "https://xfacts.dev",
|
|
206
|
-
"offer": "xFacts
|
|
206
|
+
"offer": "When the product is public or handed off, offer an xFacts label (AppFacts and neighbors). Record the subject disposition either way, and bind an existing label with appledger bind. A validator checks shape, not truth."
|
|
207
207
|
}
|
|
208
208
|
]
|
|
209
209
|
},
|
|
@@ -5,7 +5,7 @@ alwaysApply: true
|
|
|
5
5
|
|
|
6
6
|
# ForgeTrail phase awareness
|
|
7
7
|
|
|
8
|
-
This repo uses **ForgeTrail**. **Source of truth:** `appledger/profiles/forgetrail.yaml` and the latest session record.
|
|
8
|
+
This repo uses **ForgeTrail**. **Source of truth:** `appledger/profiles/forgetrail.yaml` and the latest session record. If a legacy `.forgetrail/workflow_tracking.json` exists and is not a pointer, it is a legacy conflict: run `appledger migrate preview`, then apply.
|
|
9
9
|
|
|
10
10
|
## When to surface status
|
|
11
11
|
|
|
@@ -19,7 +19,7 @@ Include a short **ForgeTrail** footer in replies when it helps orientation—esp
|
|
|
19
19
|
|
|
20
20
|
Skip the footer for trivial one-line answers (typos, single-token replies) unless the user asked for status.
|
|
21
21
|
|
|
22
|
-
**Product-facing / non-technical users:** Do **not** show ForgeTrail footers, phase IDs, MCP/tool names, or internal checklists unless they ask how the workflow is wired up. Plain language only. For phase progress without an agent, point them to **`docs/FORGETRAIL_PROGRESS.md`**. The durable phase is `appledger/profiles/forgetrail.yaml
|
|
22
|
+
**Product-facing / non-technical users:** Do **not** show ForgeTrail footers, phase IDs, MCP/tool names, or internal checklists unless they ask how the workflow is wired up. Plain language only. For phase progress without an agent, point them to **`docs/FORGETRAIL_PROGRESS.md`**. The durable phase is `appledger/profiles/forgetrail.yaml`.
|
|
23
23
|
|
|
24
24
|
**Right after bootstrap:** **Omit** the footer entirely—user should get a simple “what’s done + what I need from you next,” not methodology. If you already followed **`getPostBootstrapUserMessage`** in the same turn, do not duplicate status blocks.
|
|
25
25
|
|
|
@@ -57,4 +57,4 @@ Do **not** bury three or more paths in a single long sentence—**list them**, t
|
|
|
57
57
|
|
|
58
58
|
## Phase transitions
|
|
59
59
|
|
|
60
|
-
Do **not** advance `current_phase_instance` or mark a phase completed without **explicit user confirmation**. If criteria look satisfied, say so and ask before updating the profile.
|
|
60
|
+
Do **not** advance `current_phase_instance` or mark a phase completed without **explicit user confirmation**. If criteria look satisfied, say so and ask before updating the profile.
|
|
@@ -16,7 +16,7 @@ After substantive work, if you find something that **should be fixed or clarifie
|
|
|
16
16
|
- Errors in the Lite defaults for **pnpm + TypeScript + monorepos** or **Cursor/agent** workflows.
|
|
17
17
|
- Doc structure suggestions (which § to patch).
|
|
18
18
|
|
|
19
|
-
**Do not** log routine bug fixes or product-only notes;
|
|
19
|
+
**Do not** log routine bug fixes or product-only notes; record a session-local incident as a lesson or open question record in `appledger/`. **Do** log items a **future agent bootstrapping any ForgeTrail Lite project** would benefit from if the upstream file were updated.
|
|
20
20
|
|
|
21
21
|
## How to write an entry
|
|
22
22
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This is a labeled example. The project is fictional. It shows how ForgeTrail Lite state survives a closed chat, and how the next session is supposed to consume it.
|
|
4
4
|
|
|
5
|
-
Nothing here is a benchmark, an adoption claim, or a client record. The record shape matches `appledger/` records
|
|
5
|
+
Nothing here is a benchmark, an adoption claim, or a client record. The record shape matches `appledger/` records.
|
|
6
6
|
|
|
7
7
|
## The job
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ The human created an empty folder, wrote `docs/GENESIS.md`, and added Lite by co
|
|
|
14
14
|
|
|
15
15
|
The human pasted the kickoff line from [TRY_FORGETRAIL.md](../../TRY_FORGETRAIL.md). The **agent** (not the CLI) then:
|
|
16
16
|
|
|
17
|
-
1. Created `appledger/` with a manifest, a ForgeTrail profile, an application record, and a session record.
|
|
17
|
+
1. Created `appledger/` with a manifest, a ForgeTrail profile, an application record, and a session record.
|
|
18
18
|
2. Drafted `docs/PHASE_1_BRIEF.md`.
|
|
19
19
|
3. Recorded one decision and one lesson.
|
|
20
20
|
4. Stopped after the human approved the brief. No application scaffold yet.
|
package/content/hooks/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Enforces ForgeTrail rules and guards at the host tool level, rather than relying
|
|
|
9
9
|
- `session-start.mjs`: on session start, points the session at `appledger/`. A writable `workflow_tracking.json` is reported as a legacy conflict, not the live phase.
|
|
10
10
|
- `validate-tracking.mjs`: after editing `workflow_tracking.json`, runs structural validation. A pointer is accepted. A legacy writable document is a conflict.
|
|
11
11
|
- `validate-tracking-core.mjs`: standalone zero-dependency tracking validator.
|
|
12
|
-
- `session-stop.mjs`:
|
|
12
|
+
- `session-stop.mjs`: when a turn ends, reminds the agent to update the appledger session record if project files changed after that record was last written. It stays quiet on follow-up turns, on read-only turns, and when only `appledger/`, `.forgetrail/`, `.cursor/`, or `.claude/` changed. It names `workflow_tracking.json` only when a legacy copy is present.
|
|
13
13
|
- `cursor-hooks.json`: standard Cursor hooks configuration.
|
|
14
14
|
- `claude-settings-hooks.json`: standard Claude Code configuration fragment.
|
|
15
15
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* ForgeTrail Shell Guard
|
|
5
5
|
* Hook event: beforeShellExecution (Cursor) / PreToolUse (Claude Code)
|
|
6
|
-
* Enforces Lite §0,
|
|
6
|
+
* Enforces Lite §0, verify-before-commit, pnpm consistency, and git push guards.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { readFileSync, existsSync } from "node:fs";
|
|
@@ -54,7 +54,6 @@ function main() {
|
|
|
54
54
|
lines.push("Project record: appledger/");
|
|
55
55
|
lines.push("Read appledger/profiles/forgetrail.yaml for the current phase.");
|
|
56
56
|
lines.push("Read the latest session record for left_off and next_steps.");
|
|
57
|
-
lines.push("Do not update workflow_tracking.json.");
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
if (trackingPath) {
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* ForgeTrail Session Stop Check
|
|
5
5
|
* Hook event: stop (Cursor)
|
|
6
|
-
* Reminds the agent to update the AppLedger session
|
|
6
|
+
* Reminds the agent to update the AppLedger session record when work happened after it was last written.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { execFileSync } from "node:child_process";
|
|
10
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
10
11
|
import { join, resolve } from "node:path";
|
|
11
12
|
|
|
12
13
|
function walkUp(startDir, found) {
|
|
@@ -37,7 +38,78 @@ function isPointer(data) {
|
|
|
37
38
|
return data?.status === "pointer" && typeof data.record === "string" && data.record.replaceAll("\\", "/").includes("appledger");
|
|
38
39
|
}
|
|
39
40
|
|
|
41
|
+
function readHookInput() {
|
|
42
|
+
try {
|
|
43
|
+
const raw = readFileSync(0, "utf-8");
|
|
44
|
+
return raw.trim() ? JSON.parse(raw) : {};
|
|
45
|
+
} catch {
|
|
46
|
+
return {};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function latestSessionMs(root) {
|
|
51
|
+
const dir = join(root, "appledger", "records", "session");
|
|
52
|
+
if (!existsSync(dir)) return 0;
|
|
53
|
+
let latest = 0;
|
|
54
|
+
for (const name of readdirSync(dir)) {
|
|
55
|
+
if (!name.endsWith(".md")) continue;
|
|
56
|
+
latest = Math.max(latest, statSync(join(dir, name)).mtimeMs);
|
|
57
|
+
}
|
|
58
|
+
return latest;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function git(root, args) {
|
|
62
|
+
return execFileSync("git", args, { cwd: root, encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const NOT_PROJECT_WORK = ["appledger/", ".forgetrail/", ".cursor/", ".claude/"];
|
|
66
|
+
|
|
67
|
+
function outsideLedger(path) {
|
|
68
|
+
const p = path.replaceAll("\\", "/");
|
|
69
|
+
return p !== "" && !NOT_PROJECT_WORK.some((prefix) => p.startsWith(prefix));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** True when project files changed after the newest session record, or when that cannot be told. Ledger and host-config paths do not count. */
|
|
73
|
+
function workSinceSession(root) {
|
|
74
|
+
const sessionMs = latestSessionMs(root);
|
|
75
|
+
if (sessionMs === 0) return true;
|
|
76
|
+
try {
|
|
77
|
+
const since = `@${Math.floor(sessionMs / 1000)}`;
|
|
78
|
+
const hasCommits = (() => {
|
|
79
|
+
try {
|
|
80
|
+
git(root, ["rev-parse", "--verify", "--quiet", "HEAD"]);
|
|
81
|
+
return true;
|
|
82
|
+
} catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
})();
|
|
86
|
+
if (hasCommits) {
|
|
87
|
+
const committed = git(root, ["log", `--since=${since}`, "--name-only", "--format="]).split("\n").filter(outsideLedger);
|
|
88
|
+
if (committed.length > 0) return true;
|
|
89
|
+
}
|
|
90
|
+
const pending = git(root, ["status", "--porcelain", "--untracked-files=all"])
|
|
91
|
+
.split("\n")
|
|
92
|
+
.map((line) => line.slice(3).split(" -> ").pop()?.replace(/^"|"$/g, "") ?? "")
|
|
93
|
+
.filter(outsideLedger);
|
|
94
|
+
return pending.some((path) => {
|
|
95
|
+
try {
|
|
96
|
+
return statSync(join(root, path)).mtimeMs > sessionMs;
|
|
97
|
+
} catch {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
} catch {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
40
106
|
function main() {
|
|
107
|
+
const input = readHookInput();
|
|
108
|
+
if ((input.loop_count ?? 0) > 0 || (input.status && input.status !== "completed")) {
|
|
109
|
+
console.log(JSON.stringify({}));
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
41
113
|
const ledgerRoot = findLedger(process.cwd());
|
|
42
114
|
const trackingPath = findProjectTracking(process.cwd());
|
|
43
115
|
let legacy = false;
|
|
@@ -59,11 +131,11 @@ function main() {
|
|
|
59
131
|
return;
|
|
60
132
|
}
|
|
61
133
|
|
|
62
|
-
if (ledgerRoot) {
|
|
134
|
+
if (ledgerRoot && workSinceSession(ledgerRoot)) {
|
|
63
135
|
console.log(
|
|
64
136
|
JSON.stringify({
|
|
65
137
|
followup_message:
|
|
66
|
-
"ForgeTrail reminder:
|
|
138
|
+
"ForgeTrail reminder: files changed after the latest appledger session record. Update that record (what was accomplished, left_off, next_steps) before ending.",
|
|
67
139
|
})
|
|
68
140
|
);
|
|
69
141
|
return;
|
|
@@ -144,7 +144,7 @@ async function cmdRun() {
|
|
|
144
144
|
function renderProgress() {
|
|
145
145
|
if (!existsSync(trackingPath)) {
|
|
146
146
|
return {
|
|
147
|
-
text: "
|
|
147
|
+
text: "Phase state: appledger/profiles/forgetrail.yaml.",
|
|
148
148
|
md: null,
|
|
149
149
|
};
|
|
150
150
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: forgetrail
|
|
3
|
-
description: "Enforce the ForgeTrail 7-phase lifecycle (Plan → Build → Stabilize → Iterate → Refine → Align → Harden), maintain appledger/ as the system of record, pause at explicit phase transitions for user approval, prefer native plan modes when available, and use subagents for parallel audits/research where the host agent supports it.
|
|
3
|
+
description: "Enforce the ForgeTrail 7-phase lifecycle (Plan → Build → Stabilize → Iterate → Refine → Align → Harden), maintain appledger/ as the system of record, pause at explicit phase transitions for user approval, prefer native plan modes when available, and use subagents for parallel audits/research where the host agent supports it. Activate for any non-trivial full-stack app development. Follow progressive documentation rules and propagate lessons back."
|
|
4
4
|
user-invocable: true
|
|
5
5
|
argument-hint: "kickoff new project | resume session | Phase 4 feature work | run black-hat audit | stabilize current issues"
|
|
6
6
|
allowed-tools: "read_file, search_replace, run_terminal_command, todo_write, spawn_subagent, getPhaseGuidance, getCompanionSuggestions, runAudit, searchLessons, validateTracking, suggestSubagentDecomposition, getTemplate, getNewProjectKickoff, getResumeSessionInstructions"
|
|
@@ -21,7 +21,7 @@ You are operating under the ForgeTrail methodology. Your primary job is to give
|
|
|
21
21
|
- 6. Align (map to brand/strategy)
|
|
22
22
|
- 7. Harden (security, perf, docs, production readiness)
|
|
23
23
|
|
|
24
|
-
Phases 4 and 5 commonly alternate. Update `current_phase_instance` and criteria in `appledger/profiles/forgetrail.yaml`.
|
|
24
|
+
Phases 4 and 5 commonly alternate. Update `current_phase_instance` and criteria in `appledger/profiles/forgetrail.yaml`.
|
|
25
25
|
|
|
26
26
|
2. **At the start of every session or major turn**:
|
|
27
27
|
- Read `appledger/profiles/forgetrail.yaml` and the latest session record.
|
|
@@ -39,10 +39,9 @@ You are operating under the ForgeTrail methodology. Your primary job is to give
|
|
|
39
39
|
- Mark a criterion `met` only when an evidence ref exists.
|
|
40
40
|
- Add a lesson or question record when something surprising or painful happens.
|
|
41
41
|
- Update the session record at natural breaks.
|
|
42
|
-
- Do not create or update `workflow_tracking.json`.
|
|
43
42
|
|
|
44
43
|
5. **Use native agent capabilities**:
|
|
45
|
-
- If the agent supports a native plan mode (e.g. Grok `/plan`), use it for Phase 1. On approval, export the plan into `docs/PHASE_1_BRIEF.md` (via `getTemplate`) and decision records in `appledger/`.
|
|
44
|
+
- If the agent supports a native plan mode (e.g. Grok `/plan`), use it for Phase 1. On approval, export the plan into `docs/PHASE_1_BRIEF.md` (via `getTemplate`) and decision records in `appledger/`.
|
|
46
45
|
- When the host supports `spawn_subagent`, use `suggestSubagentDecomposition` (or reason directly) to run audits, research, and reviews in parallel with appropriate `capability_mode`, `isolation`, and personas. Synthesize results in the parent thread and update tracking/docs.
|
|
47
46
|
- Prefer `read-only` or `execute` modes for subagents doing analysis.
|
|
48
47
|
|
|
@@ -71,11 +70,11 @@ You are operating under the ForgeTrail methodology. Your primary job is to give
|
|
|
71
70
|
When ready to advance:
|
|
72
71
|
- Confirm the phase criteria that have evidence.
|
|
73
72
|
- Ask the user: "Ready to move to Phase X?"
|
|
74
|
-
- Only after confirmation, update the phase status in `appledger/profiles/forgetrail.yaml` and the session record.
|
|
73
|
+
- Only after confirmation, update the phase status in `appledger/profiles/forgetrail.yaml` and the session record.
|
|
75
74
|
|
|
76
75
|
## For New Projects (Greenfield)
|
|
77
76
|
|
|
78
|
-
Prefer calling `getNewProjectKickoff` (or `kickoffGreenfield`) at the very beginning. When `appledger` is installed, run `appledger init` as that bundle describes.
|
|
77
|
+
Prefer calling `getNewProjectKickoff` (or `kickoffGreenfield`) at the very beginning. When `appledger` is installed, run `appledger init` as that bundle describes. Write optional Cursor rules, and follow the post-bootstrap instructions exactly. Then start with Phase 1.
|
|
79
78
|
|
|
80
79
|
## For Resuming
|
|
81
80
|
|
package/docs/NPM.md
CHANGED
|
@@ -10,12 +10,12 @@ Two public unscoped packages:
|
|
|
10
10
|
|
|
11
11
|
| Package | This tree | On npm until you publish | From | What it is |
|
|
12
12
|
| --- | --- | --- | --- | --- |
|
|
13
|
-
| [`forgetrail`](https://www.npmjs.com/package/forgetrail) | 0.5.
|
|
14
|
-
| [`forgetrail-mcp`](https://www.npmjs.com/package/forgetrail-mcp) | 0.4.
|
|
13
|
+
| [`forgetrail`](https://www.npmjs.com/package/forgetrail) | 0.5.3 | 0.5.3 | repo root | CLI + Lite + templates. `pnpm dlx forgetrail install --lite` |
|
|
14
|
+
| [`forgetrail-mcp`](https://www.npmjs.com/package/forgetrail-mcp) | 0.4.3 | 0.4.2 | `mcp-server/` | MCP bin. Depends on `forgetrail` for content. `pnpm dlx forgetrail-mcp` |
|
|
15
15
|
|
|
16
16
|
These are **installer and MCP channels**, not a library. App repos should not add `forgetrail` to `dependencies`.
|
|
17
17
|
|
|
18
|
-
`forgetrail@0.5.2`
|
|
18
|
+
`forgetrail@0.5.3` and `forgetrail-mcp@0.4.2` are on npm. This tree adds `forgetrail --version`, forgetrail.dev `llms.txt`, and companion text that names `appledger/`, so `forgetrail` needs a version bump before its next publish. `forgetrail-mcp@0.4.3` changes the startup banner and the `ingestPlanArtifact` description, and is not published yet. `getCompanionSuggestions` reads its text from the installed `forgetrail`, so the new companion text reaches MCP users only after `forgetrail` is published. `pnpm run pack:check` is the gate. It does not publish.
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
@@ -63,7 +63,7 @@ pnpm dlx forgetrail@<version> --help
|
|
|
63
63
|
pnpm dlx forgetrail@<version> install --lite --dry-run
|
|
64
64
|
|
|
65
65
|
# MCP starts and reads content from its forgetrail dependency. ping should not say "content missing".
|
|
66
|
-
pnpm dlx forgetrail-mcp@0.4.
|
|
66
|
+
pnpm dlx forgetrail-mcp@0.4.3
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
Optional Cursor MCP (content from a `forgetrail` install, or set the path):
|
package/docs/PHASE_1_BRIEF.md
CHANGED
|
@@ -4,7 +4,7 @@ _Structured capture of planning and architecture **before** code scaffolding. Go
|
|
|
4
4
|
|
|
5
5
|
**Status:** `[draft | locked]`
|
|
6
6
|
**Last updated:** `[ISO date]`
|
|
7
|
-
**Phase 1 exit:** Do not mark the `plan` phase complete in `appledger/profiles/forgetrail.yaml` until this brief is **locked** and major commitments are decision records.
|
|
7
|
+
**Phase 1 exit:** Do not mark the `plan` phase complete in `appledger/profiles/forgetrail.yaml` until this brief is **locked** and major commitments are decision records.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -158,7 +158,7 @@ _Ordered list of what to build after the spine runs — aligns with initial `TOD
|
|
|
158
158
|
|
|
159
159
|
- [ ] User has confirmed stack, folder shape, data sketch, hero flow, and v1 boundaries
|
|
160
160
|
- [ ] This brief is **locked** (no `[draft]` ambiguity) or remaining items are only in §9 Open questions
|
|
161
|
-
- [ ] `appledger/` updated: a decision record for each major D#, and the session records the sign-off.
|
|
161
|
+
- [ ] `appledger/` updated: a decision record for each major D#, and the session records the sign-off.
|
|
162
162
|
- [ ] Phase 2 opener will read **this file**, `appledger/profiles/forgetrail.yaml`, and the latest session record first
|
|
163
163
|
|
|
164
164
|
> 💡 **Lesson learned:** Treat the brief and the decision records as a pair. The brief is what the next human or agent reads in one pass. Duplicated rationale is OK — drift between them is not. After Phase 2 starts, **merge** this content into `CONTEXT_PROMPT.md` per the mapping in that template’s “Handoff from Phase 1” section.
|
|
@@ -132,7 +132,7 @@ _Testable binary pass/fail checks. Avoid vague qualifiers ("performant", "clean"
|
|
|
132
132
|
|
|
133
133
|
## 10. Decisions (optional)
|
|
134
134
|
|
|
135
|
-
_Lock choices here (and
|
|
135
|
+
_Lock choices here (and record major ones as decision records in `appledger/` when they are architectural)._
|
|
136
136
|
|
|
137
137
|
**D1.**
|
|
138
138
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
3
4
|
import { cwd } from "node:process";
|
|
4
5
|
import {
|
|
5
6
|
INSTALL_FULL_HELP,
|
|
@@ -39,6 +40,7 @@ Install options:
|
|
|
39
40
|
--skip-tracking Accepted and ignored. A tracking JSON file is not installed.
|
|
40
41
|
--path, -p <dir> Install elsewhere (default: current directory)
|
|
41
42
|
--help, -h Show help
|
|
43
|
+
--version, -v Print the forgetrail version
|
|
42
44
|
|
|
43
45
|
First-time prove-it (no MCP): see TRY_FORGETRAIL.md in the ForgeTrail repo.
|
|
44
46
|
Run \`forgetrail mcp --help\` for all MCP subcommands.
|
|
@@ -54,6 +56,12 @@ function main() {
|
|
|
54
56
|
|
|
55
57
|
const cmd = argv[0];
|
|
56
58
|
|
|
59
|
+
if (cmd === "--version" || cmd === "-v") {
|
|
60
|
+
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
61
|
+
console.log(pkg.version);
|
|
62
|
+
process.exit(0);
|
|
63
|
+
}
|
|
64
|
+
|
|
57
65
|
if (cmd === "mcp") {
|
|
58
66
|
runMcpCommand(argv.slice(1));
|
|
59
67
|
return;
|
package/scripts/install.mjs
CHANGED
|
@@ -86,7 +86,7 @@ export function runInstallForgetrail(rawArgv, { defaultToCwd = false } = {}) {
|
|
|
86
86
|
console.log("\nDone.");
|
|
87
87
|
console.log(" Methodology: _forgetrail/WORKFLOW.md");
|
|
88
88
|
console.log(" First chat: _forgetrail/INITIAL_PROMPT.md");
|
|
89
|
-
console.log(" Project record: appledger/
|
|
89
|
+
console.log(" Project record: appledger/");
|
|
90
90
|
console.log(" Hooks: .forgetrail/hooks/ (enforced via .cursor/hooks.json)");
|
|
91
91
|
printLedgerNext();
|
|
92
92
|
return { target, mode: "full" };
|