forgetrail 0.5.4 → 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/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 +1 -1
- 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 +1 -1
- package/content/cursor-rules/forgetrail-phase-status.mdc +3 -3
- package/content/examples/two-session-continuity.md +2 -2
- package/content/hooks/README.md +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/docs/PHASE_1_BRIEF.md +2 -2
- package/docs/SPEC_FEATURE_TEMPLATE.md +1 -1
- package/package.json +1 -1
- package/scripts/install.mjs +1 -1
- package/scripts/tracking-cutover.test.mjs +67 -5
package/CONTINUATION_PROMPT.md
CHANGED
|
@@ -11,7 +11,7 @@ I'm continuing work on [APP NAME]. You are following ForgeTrail, a structured ph
|
|
|
11
11
|
|
|
12
12
|
1. Call ForgeTrail MCP **`getResumeSessionInstructions`** and follow it.
|
|
13
13
|
2. Read **`appledger/profiles/forgetrail.yaml`** and the latest session record. If the phase is **plan**, read **`docs/PHASE_1_BRIEF.md`**. Otherwise read **`CONTEXT_PROMPT.md`** (if a later phase is current but CONTEXT is missing and the brief exists, **merge the brief into CONTEXT** first per the CONTEXT_PROMPT template).
|
|
14
|
-
3. Use **`getPhaseGuidance`** for the current phase.
|
|
14
|
+
3. Use **`getPhaseGuidance`** for the current phase. If a legacy `.forgetrail/workflow_tracking.json` exists and is not a pointer, run **`appledger migrate preview`** and then apply.
|
|
15
15
|
|
|
16
16
|
### Local `_forgetrail/` folder
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ I'm continuing work on [APP NAME]. You are following ForgeTrail, a structured ph
|
|
|
19
19
|
|
|
20
20
|
**Before doing anything else:**
|
|
21
21
|
|
|
22
|
-
1. Read **`appledger/profiles/forgetrail.yaml`** and the latest session record to see where we left off.
|
|
22
|
+
1. Read **`appledger/profiles/forgetrail.yaml`** and the latest session record to see where we left off.
|
|
23
23
|
2. Read `_forgetrail/WORKFLOW.md` for the full phase map, playbooks, and patterns.
|
|
24
24
|
3. Read `_forgetrail/TRACKING_SCHEMA.md` for where project state lives. The legacy JSON shape in that file is for migration only.
|
|
25
25
|
4. Read `CONTEXT_PROMPT.md` for the current architecture and project state — or **`docs/PHASE_1_BRIEF.md`** if still in Phase 1; if Phase 2+ and CONTEXT is empty but the brief exists, merge brief → CONTEXT first.
|
|
@@ -27,7 +27,7 @@ I'm continuing work on [APP NAME]. You are following ForgeTrail, a structured ph
|
|
|
27
27
|
**Rules for this session:**
|
|
28
28
|
|
|
29
29
|
- When you believe a phase's exit criteria are met, tell me explicitly: "I think we've completed [Phase X]. The exit criteria are met because [reasons]. Ready to move to [Phase Y]?" Wait for my confirmation.
|
|
30
|
-
- After completing work, update **`appledger/`**: move satisfied criteria only when evidence exists, add decision records (with rationale), log lessons or questions, and update the session record.
|
|
30
|
+
- After completing work, update **`appledger/`**: move satisfied criteria only when evidence exists, add decision records (with rationale), log lessons or questions, and update the session record.
|
|
31
31
|
- Keep `CONTEXT_PROMPT.md` updated as the source of truth for project architecture.
|
|
32
32
|
- If something isn't working after 5 turns, propose a fundamentally different approach rather than continuing to patch.
|
|
33
33
|
|
package/INITIAL_PROMPT.md
CHANGED
|
@@ -9,12 +9,12 @@ You are helping me build a full-stack web application. I use ForgeTrail, a struc
|
|
|
9
9
|
|
|
10
10
|
### MCP-first (recommended — no `_forgetrail/` copy in this repo)
|
|
11
11
|
|
|
12
|
-
If **ForgeTrail is connected as an MCP server**, do **not** require a local `_forgetrail/` folder. Methodology, templates, and audits stay in the MCP server (open-source ForgeTrail install). Persist project state in **`appledger/`**.
|
|
12
|
+
If **ForgeTrail is connected as an MCP server**, do **not** require a local `_forgetrail/` folder. Methodology, templates, and audits stay in the MCP server (open-source ForgeTrail install). Persist project state in **`appledger/`**. Optional Cursor rules may live in this repo.
|
|
13
13
|
|
|
14
14
|
**Before doing anything else:**
|
|
15
15
|
|
|
16
16
|
0. If **`docs/GENESIS.md`** exists, call **`ingestPlanArtifact`** with its contents and review the draft brief before scaffolding. If the user only has an idea, offer **`getGenesisSpecPrompt`** (they save as `docs/GENESIS.md`) or point them at **TRY_FORGETRAIL.md** when MCP is not the entry path.
|
|
17
|
-
1. Call the ForgeTrail MCP tool **`getNewProjectKickoff`** (set **`includeCursorRule`** to **false** if not using Cursor). When `appledger` is installed, run **`appledger init`** as that bundle describes.
|
|
17
|
+
1. Call the ForgeTrail MCP tool **`getNewProjectKickoff`** (set **`includeCursorRule`** to **false** if not using Cursor). When `appledger` is installed, run **`appledger init`** as that bundle describes. Write the Cursor rule when included. Keep the **first reply to the user** short per the bundle’s post-bootstrap section (no MCP tool list or raw JSON dump). **Alternatively:** call **`getNewProjectBootstrap`**, **`getInitialWorkflowTracking`**, **`getPostBootstrapUserMessage`**, and **`getForgeTrailCursorPhaseRule`** separately. `getInitialWorkflowTracking` does not return a JSON file to save.
|
|
18
18
|
2. In Phase 1, call **`getGreenfieldIntakePrompt`** alongside **`getChecklist`** (`before-session-1`) so exports (PDF / DOCX / PPTX, etc.), tenancy (e.g. consultants × clients), hybrid vs full spec, compliance tier, and hero flow are captured early in **`PHASE_1_BRIEF.md`** and as decision records (skip questions already answered in Genesis).
|
|
19
19
|
3. Use **`getProgressiveDocSchedule`**, **`getPhaseGuidance`**, **`getChecklist`**, **`getTemplate`** (include **`PHASE_1_BRIEF`** in Phase 1; use `mode: "shell"` or `full` as needed), **`getTrackingSchema`**, **`runAudit`**, **`searchLessons`**, and **`getAntiPatterns`** as that bootstrap describes.
|
|
20
20
|
4. We're starting with Phase 1 (Architecture + Planning).
|
|
@@ -27,7 +27,7 @@ If **ForgeTrail is connected as an MCP server**, do **not** require a local `_fo
|
|
|
27
27
|
|
|
28
28
|
**Optional — web search (live data):** If the app needs **up-to-date web 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 — see vendor pricing), add the key to **`.env`**, and ask you to wire **server-side** calls only. **`FORGETRAIL_LITE.md` §4.4** has the full note; log the provider choice as a decision record.
|
|
29
29
|
|
|
30
|
-
**Phase 1 — project archetype:** classify the project as **`product`** (default — full 7-phase lifecycle), **`internal-tool`** (Phase 6 optional; Phase 7 drops payments/business-plan/marketing criteria), or **`one-shot`** (gift / event / demo — phases 5–7 collapse into one polish-and-ship gate). Infer from my description and confirm rather than interrogate. Record it in **`PHASE_1_BRIEF.md`**, as a decision record, and as **`archetype`** on **`appledger/profiles/forgetrail.yaml`**. Prune the non-applicable criteria on that profile and log the pruning as a decision.
|
|
30
|
+
**Phase 1 — project archetype:** classify the project as **`product`** (default — full 7-phase lifecycle), **`internal-tool`** (Phase 6 optional; Phase 7 drops payments/business-plan/marketing criteria), or **`one-shot`** (gift / event / demo — phases 5–7 collapse into one polish-and-ship gate). Infer from my description and confirm rather than interrogate. Record it in **`PHASE_1_BRIEF.md`**, as a decision record, and as **`archetype`** on **`appledger/profiles/forgetrail.yaml`**. Prune the non-applicable criteria on that profile and log the pruning as a decision. See **WORKFLOW.md §1d**. When the project **ends**, run the **wrap protocol** (WORKFLOW.md §1e): harvest lesson and decision records, propagate the generalizable ones, and set **`project_status`** to **`wrapped`** on the profile.
|
|
31
31
|
|
|
32
32
|
**Phase 1 — state persistence (web apps):** before locking PocketBase + auth, ask me *"Does any state need to outlive this browser — accounts, cross-device sync, shared data — or is per-user state fine in `localStorage`?"* If **local-only**: drop PocketBase + auth, target `adapter-static`, no deploy-time secrets. If **persistent**: full Default-A stack. Record the answer in **`PHASE_1_BRIEF.md` §4 (`State persistence:`)** and as a decision record. See **`FORGETRAIL_LITE.md` §7** (A-local vs A-persistent).
|
|
33
33
|
|
|
@@ -55,7 +55,7 @@ Skip the **“copy-paste paths”** section below unless we are using a **local*
|
|
|
55
55
|
|
|
56
56
|
1. Read `_forgetrail/WORKFLOW.md` to understand the full phase map, playbooks, and patterns.
|
|
57
57
|
2. Read `_forgetrail/TRACKING_SCHEMA.md` for where project state lives. The legacy JSON shape in that file is for migration only.
|
|
58
|
-
3. Read **`appledger/profiles/forgetrail.yaml`** and the latest session record.
|
|
58
|
+
3. Read **`appledger/profiles/forgetrail.yaml`** and the latest session record.
|
|
59
59
|
4. If using **Cursor**, copy **`_forgetrail/content/cursor-rules/forgetrail-phase-status.mdc`** to **`.cursor/rules/forgetrail-phase-status.mdc`** (create folders if needed) so agents surface phase / next actions from `appledger/profiles/forgetrail.yaml`.
|
|
60
60
|
5. We're starting with Phase 1 (Architecture + Planning).
|
|
61
61
|
|
|
@@ -63,7 +63,7 @@ Skip the **“copy-paste paths”** section below unless we are using a **local*
|
|
|
63
63
|
|
|
64
64
|
- At the start of each session, read `appledger/profiles/forgetrail.yaml`, the latest session record, and `CONTEXT_PROMPT.md` (if it exists).
|
|
65
65
|
- When you believe a phase's exit criteria are met, tell me explicitly: "I think we've completed [Phase X]. The exit criteria are met because [reasons]. Ready to move to [Phase Y]?" Wait for my confirmation.
|
|
66
|
-
- After completing work, update **`appledger/`**: move satisfied criteria only when evidence exists, add decision records (with rationale), log lessons or questions, and update the session record.
|
|
66
|
+
- After completing work, update **`appledger/`**: move satisfied criteria only when evidence exists, add decision records (with rationale), log lessons or questions, and update the session record.
|
|
67
67
|
- During Phase 1, create and lock **`docs/PHASE_1_BRIEF.md`**; mirror major decisions as decision records.
|
|
68
68
|
- When we create `CONTEXT_PROMPT.md` (Phase 2), **merge `PHASE_1_BRIEF.md` into it** first (see template), then keep it updated as the source of truth.
|
|
69
69
|
- If something isn't working after 5 turns, propose a fundamentally different approach rather than continuing to patch.
|
|
@@ -174,12 +174,12 @@ Phase 1 (Architecture + Planning):
|
|
|
174
174
|
- Recommend what to skip for v1.
|
|
175
175
|
- Wait for my confirmation on every architectural decision.
|
|
176
176
|
- Create **`docs/PHASE_1_BRIEF.md`** from the ForgeTrail template (`_forgetrail/docs/` or MCP **`getTemplate("PHASE_1_BRIEF")`**). Fill and **lock** it before we exit Phase 1.
|
|
177
|
-
- Record major commitments as **decision records in `appledger/`** so the next session does not depend on chat history.
|
|
177
|
+
- Record major commitments as **decision records in `appledger/`** so the next session does not depend on chat history.
|
|
178
178
|
|
|
179
179
|
Phase 2 (Scaffolding + Core Build):
|
|
180
180
|
|
|
181
181
|
- Only after I've confirmed the architecture and the brief is locked.
|
|
182
|
-
- Read **`PHASE_1_BRIEF.md`**, **`appledger/profiles/forgetrail.yaml`**, and the latest session record first.
|
|
182
|
+
- Read **`PHASE_1_BRIEF.md`**, **`appledger/profiles/forgetrail.yaml`**, and the latest session record first.
|
|
183
183
|
- Build the **entire app skeleton in one pass**: project init, dependencies, services, routes, components — **do not defer the runnable spine or hero flow**.
|
|
184
184
|
- Include an import script if there's existing data.
|
|
185
185
|
- Wire up the hero flow end to end.
|
package/WORKFLOW.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
A persistent development system for building software with AI agents. A structured 7-phase workflow for solo developers building non-trivial full-stack apps with coding agents. Derived from 7 sessions and ~78,000 lines of real-world app development.
|
|
6
6
|
|
|
7
|
-
**System of record:** Phase, decisions, lessons, and sessions live in `appledger/` (`profiles/forgetrail.yaml` and records).
|
|
7
|
+
**System of record:** Phase, decisions, lessons, and sessions live in `appledger/` (`profiles/forgetrail.yaml` and records). If a legacy `.forgetrail/workflow_tracking.json` exists and is not a pointer, run `appledger migrate preview` and then apply. Do not keep a second decision log. `.forgetrail/` is hooks and host integration.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -104,7 +104,7 @@ These phases emerged from the actual build sequence across all sessions. They're
|
|
|
104
104
|
|
|
105
105
|
**Principle:** **Phase 2** still means the **full app spine** in one pass — project init, dependencies, data path, routes, components, import/migration if needed, **hero flow end-to-end**. That spine should not be deferred.
|
|
106
106
|
|
|
107
|
-
**ForgeTrail workspace:** Protocol, rules, and hooks live in **`.forgetrail/`** at the repo root — **`.forgetrail/IDEAS.md`**, platform rules (`AGENTS.md`, `CLAUDE.md`, optional `FORGETRAIL_LITE.md`). Project state lives in **`appledger/`**.
|
|
107
|
+
**ForgeTrail workspace:** Protocol, rules, and hooks live in **`.forgetrail/`** at the repo root — **`.forgetrail/IDEAS.md`**, platform rules (`AGENTS.md`, `CLAUDE.md`, optional `FORGETRAIL_LITE.md`). Project state lives in **`appledger/`**. Product docs (`docs/PHASE_1_BRIEF.md`, `CONTEXT_PROMPT.md`, `README.md`, `TODO.md`, **`docs/FORGETRAIL_PROGRESS.md`**) stay outside `.forgetrail/`. Optionally gitignore `.forgetrail/` for a cleaner public repo or MCP-only boots (no vendored Lite). Commit `appledger/` with the app. See **`FORGETRAIL_LITE.md` §1.5** and **`NEW_PROJECT_BOOTSTRAP.md`**.
|
|
108
108
|
|
|
109
109
|
**Non-technical operators:** Phase 2 should add **setup/run/status** launchers (**`ONE_CLICK_DEV_SETUP.md`**) and **test-*** launchers per dependency (**`SYSTEM_HEALTH_CHECKS.md`**). Avoid hardcoded PocketBase versions (**§4.2.2**). Local Ollama: Granite 4.1 / Gemma 3 defaults, not thinking models unless required (**§4.8**).
|
|
110
110
|
|
|
@@ -160,7 +160,7 @@ Run **both** ForgeTrail's `runAudit("black-hat")` and gstack's `/cso` — they'r
|
|
|
160
160
|
|
|
161
161
|
### Key rule
|
|
162
162
|
|
|
163
|
-
After every gstack sprint that completes meaningful work, **update `appledger/`** (criteria that have evidence, decision records, lessons, and the session record).
|
|
163
|
+
After every gstack sprint that completes meaningful work, **update `appledger/`** (criteria that have evidence, decision records, lessons, and the session record). gstack does persist some sprint-level artifacts — design docs from `/office-hours` live in `~/.gstack/projects/`, retro snapshots in `.context/retros/`, review gate overrides per branch, and skill usage analytics. But gstack has **no lifecycle state** (what phase are we in?), **no decision rationale log** (why did we choose PocketBase over Supabase?), **no lesson capture** (what burned us and how did we fix it?), and **no architecture context document** (what does the file tree look like, what patterns do we use?). ForgeTrail's `appledger/` + `CONTEXT_PROMPT.md` fill exactly this gap — they are the system of record that lets the next session pick up where this one left off without replaying context from chat history.
|
|
164
164
|
|
|
165
165
|
---
|
|
166
166
|
|
|
@@ -220,7 +220,7 @@ Hosts differ in spawn syntax — call **`getAgentIntegrationGuide`** (`grok`, `c
|
|
|
220
220
|
|
|
221
221
|
### Key rule
|
|
222
222
|
|
|
223
|
-
After subagent results return, the **parent must** update `appledger/` (criteria that have evidence, decision records, lessons, and the session record) and relevant progressive docs.
|
|
223
|
+
After subagent results return, the **parent must** update `appledger/` (criteria that have evidence, decision records, lessons, and the session record) and relevant progressive docs. Subagents fix or explore in isolation but **do not** replace ForgeTrail as the system of record for lifecycle state, decision rationale, or lesson capture.
|
|
224
224
|
|
|
225
225
|
---
|
|
226
226
|
|
|
@@ -256,7 +256,7 @@ The ledger collects lessons and decisions all project long — but nothing consu
|
|
|
256
256
|
|
|
257
257
|
1. **Sweep the ledger.** Read every lesson and decision record plus `CONTEXT_PROMPT.md`'s lesson and pattern sections. For each, ask: *is this generalizable beyond this app?* Framework traps, CLI behavior changes, and integration surprises usually are; app-specific content decisions usually are not.
|
|
258
258
|
2. **Run the propagation prompt** (`prompts/propagate-to-forgetrail.md`) with the harvest list as input — see its **Harvest mode** section, designed for exactly this sweep. Small projects without a product journal or full doc set use `appledger/` as the primary discovery source.
|
|
259
|
-
3. **Close the ledger.** Set `project_status` to `wrapped` on `appledger/profiles/forgetrail.yaml`, add a final session record summarizing end state and where things live (deploy URL, handoff notes), and make a final commit. Optionally tag the repo (`v1.0`, `shipped`).
|
|
259
|
+
3. **Close the ledger.** Set `project_status` to `wrapped` on `appledger/profiles/forgetrail.yaml`, add a final session record summarizing end state and where things live (deploy URL, handoff notes), and make a final commit. Optionally tag the repo (`v1.0`, `shipped`).
|
|
260
260
|
4. **Log the propagation** in ForgeTrail's `update-log.md` as usual. A wrap with zero propagable lessons is legitimate — note "wrapped, nothing to propagate" in the final session record and skip steps 2 and 4.
|
|
261
261
|
|
|
262
262
|
**Why this is a protocol and not a suggestion:** the compounding loop (README) only compounds if lessons actually flow back. One flagship project propagating regularly plus a dozen small projects propagating never is a leak — the small projects are often where the freshest scaffolding and framework gotchas surface, because they exercise the newest tool versions.
|
|
@@ -270,7 +270,7 @@ Catalyst Forge siblings (and Cloudflare as a default DNS/hosting suggestion) are
|
|
|
270
270
|
- **ForgeTrail** = lifecycle + project memory.
|
|
271
271
|
- **Companions** = one bounded job (publish Markdown, named ports, editorial review, quality score, labels, backup, voice journal).
|
|
272
272
|
|
|
273
|
-
They are **never required**. Decline is success. Do not dump the shelf at kickoff. Suggest when a trigger is true; persist the outcome on the appledger session as `data.companion_outcomes`.
|
|
273
|
+
They are **never required**. Decline is success. Do not dump the shelf at kickoff. Suggest when a trigger is true; persist the outcome on the appledger session as `data.companion_outcomes`.
|
|
274
274
|
|
|
275
275
|
**Subjects:** When an applicable subject exists — an application, a tool server, a skill package, an agent configuration, or a model variant — record a disposition with `appledger subjects`. A family with no subject is `not_applicable`, not a missing label. Do not generate or rewrite a label. A published xFacts label remains an offer when the product goes public or changes hands, and only if the user asks.
|
|
276
276
|
|
|
@@ -303,8 +303,8 @@ ForgeTrail includes deterministic host hooks (`.forgetrail/hooks/` with `.cursor
|
|
|
303
303
|
|
|
304
304
|
- **Shell guards:** Runs pre-commit verification (`pnpm run verify`), prevents package manager divergence (e.g. `npm`/`yarn` when `pnpm-lock.yaml` is present), gates `git push` on explicit user approval, and flags destructive operations (`git reset --hard`, `rm -rf`).
|
|
305
305
|
- **Edit guards:** Requires user confirmation before mutating environment secrets (`.env*`) or canonical/completed specs (`specs/completed/**`).
|
|
306
|
-
- **Session start injection:** Points the session at `appledger/` (profile phase and the latest session). It
|
|
307
|
-
- **Tracking validation:** A pointer to `appledger/` is accepted. A writable `workflow_tracking.json` is a conflict and is not the system of record.
|
|
306
|
+
- **Session start injection:** Points the session at `appledger/` (profile phase and the latest session). It reports a legacy `.forgetrail/workflow_tracking.json` as a conflict, not the live phase.
|
|
307
|
+
- **Tracking validation:** A pointer to `appledger/` is accepted. A legacy writable `workflow_tracking.json` is a conflict and is not the system of record.
|
|
308
308
|
|
|
309
309
|
Where the host supports hooks, tool-level denial and injection take the load off agent context budgets.
|
|
310
310
|
|
|
@@ -342,7 +342,7 @@ Where the host supports hooks, tool-level denial and injection take the load off
|
|
|
342
342
|
**Artifacts to create:**
|
|
343
343
|
|
|
344
344
|
- **`PHASE_1_BRIEF.md`** in `docs/` (from `_forgetrail/docs/PHASE_1_BRIEF.md` template or ForgeTrail MCP `getTemplate({ name: "PHASE_1_BRIEF" })`). Fill every section; mark **locked** when accurate.
|
|
345
|
-
- **`appledger/`**: a decision record for each major architectural commitment (with rationale); the session record carries the sign-off summary.
|
|
345
|
+
- **`appledger/`**: a decision record for each major architectural commitment (with rationale); the session record carries the sign-off summary.
|
|
346
346
|
|
|
347
347
|
**Verify before moving on:**
|
|
348
348
|
|
|
@@ -410,7 +410,7 @@ Where the host supports hooks, tool-level denial and injection take the load off
|
|
|
410
410
|
- No **new** doc files. However:
|
|
411
411
|
- Update **`CONTEXT_PROMPT.md`** with any patterns, env quirks, or workarounds discovered during stabilization.
|
|
412
412
|
- Update **`README.md`** if setup steps changed (new env vars, revised install, required services).
|
|
413
|
-
- Record a lesson in **`appledger/`** for every surprise (env, path, auth, integration) so the same mistake is never repeated.
|
|
413
|
+
- Record a lesson in **`appledger/`** for every surprise (env, path, auth, integration) so the same mistake is never repeated.
|
|
414
414
|
|
|
415
415
|
**Verify before moving on:**
|
|
416
416
|
|
|
@@ -869,7 +869,7 @@ Print this and work through it sequentially for each new project.
|
|
|
869
869
|
- [ ] Use "paste the error" for debugging
|
|
870
870
|
- [ ] Update CONTEXT_PROMPT.md before ending (especially decisions and their WHY)
|
|
871
871
|
- [ ] Mark completed TODOs, add new ones
|
|
872
|
-
- [ ] Update the appledger session, decisions, and lessons.
|
|
872
|
+
- [ ] Update the appledger session, decisions, and lessons.
|
|
873
873
|
|
|
874
874
|
---
|
|
875
875
|
|
|
@@ -902,7 +902,7 @@ Full templates for each document live in `_forgetrail/docs/` (or ForgeTrail MCP
|
|
|
902
902
|
|
|
903
903
|
### Document Lifecycle
|
|
904
904
|
|
|
905
|
-
**Phase 1 (Architecture):** Complete and lock **`PHASE_1_BRIEF.md`**; mirror commitments as decision records in **`appledger/`**.
|
|
905
|
+
**Phase 1 (Architecture):** Complete and lock **`PHASE_1_BRIEF.md`**; mirror commitments as decision records in **`appledger/`**.
|
|
906
906
|
|
|
907
907
|
**Phase 2 (Scaffold):** Full **app spine** in one pass. **Docs:** Merge brief → **`CONTEXT_PROMPT.md`**, then **`TODO.md`**, **`README.md`**, **`.forgetrail/IDEAS.md`** only (§1a). Minimal extra prose at first beyond the merge.
|
|
908
908
|
|
|
@@ -17,7 +17,7 @@ Claude-based coding agents integrate with ForgeTrail through MCP, extended plann
|
|
|
17
17
|
|
|
18
18
|
**New project:**
|
|
19
19
|
```
|
|
20
|
-
Call ForgeTrail getNewProjectKickoff, write appledger/, getGreenfieldIntakePrompt, getPhaseGuidance("1").
|
|
20
|
+
Call ForgeTrail getNewProjectKickoff, write appledger/, getGreenfieldIntakePrompt, getPhaseGuidance("1").
|
|
21
21
|
No app code until PHASE_1_BRIEF.md is locked.
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -23,7 +23,7 @@ Use plan mode for Phase 1 if available. Lock PHASE_1_BRIEF.md before scaffolding
|
|
|
23
23
|
|
|
24
24
|
**Resume:**
|
|
25
25
|
```
|
|
26
|
-
Call getResumeSessionInstructions. Read appledger/profiles/forgetrail.yaml, the latest session record, and CONTEXT_PROMPT.md.
|
|
26
|
+
Call getResumeSessionInstructions. Read appledger/profiles/forgetrail.yaml, the latest session record, and CONTEXT_PROMPT.md.
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## Subagent patterns
|
|
@@ -41,7 +41,7 @@ Use `run_in_background` for long subagents when appropriate.
|
|
|
41
41
|
## Tracking sync
|
|
42
42
|
|
|
43
43
|
After subagent or feature work:
|
|
44
|
-
- Update `appledger/` (criteria, decision records, lessons, the session).
|
|
44
|
+
- Update `appledger/` (criteria, decision records, lessons, the session).
|
|
45
45
|
- Run **`validateTracking`** only when a legacy tracking file is present. A missing file is expected.
|
|
46
46
|
- Update `CONTEXT_PROMPT.md` when architecture or patterns change.
|
|
47
47
|
|
|
@@ -15,14 +15,14 @@ ForgeTrail owns **what** and **when**. The host agent owns **execution**.
|
|
|
15
15
|
|
|
16
16
|
**New project:**
|
|
17
17
|
```
|
|
18
|
-
Call ForgeTrail getNewProjectKickoff, write appledger/, then getPhaseGuidance("1").
|
|
18
|
+
Call ForgeTrail getNewProjectKickoff, write appledger/, then getPhaseGuidance("1").
|
|
19
19
|
Lock architecture in docs/PHASE_1_BRIEF.md before any app code.
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
**Resume:**
|
|
23
23
|
```
|
|
24
24
|
Call getResumeSessionInstructions. Read appledger/profiles/forgetrail.yaml, the latest session record, and CONTEXT_PROMPT.md.
|
|
25
|
-
Continue from the current phase.
|
|
25
|
+
Continue from the current phase.
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
## When the host supports subagents
|
|
@@ -35,7 +35,7 @@ Prefer **read-only** subagents for analysis; parent or a single write-capable wo
|
|
|
35
35
|
|
|
36
36
|
## When the host supports plan mode
|
|
37
37
|
|
|
38
|
-
Use native plan mode for **Phase 1** only. On approval, export to `PHASE_1_BRIEF.md` and decision records in `appledger/`.
|
|
38
|
+
Use native plan mode for **Phase 1** only. On approval, export to `PHASE_1_BRIEF.md` and decision records in `appledger/`. See **`getPlanModePatterns`**.
|
|
39
39
|
|
|
40
40
|
## Persistent discipline
|
|
41
41
|
|
|
@@ -6,25 +6,25 @@ Grok Build (the agentic TUI/CLI from xAI) has excellent native primitives that m
|
|
|
6
6
|
|
|
7
7
|
| Grok Primitive | ForgeTrail Phase(s) | How to Use |
|
|
8
8
|
|-----------------------------|----------------------------|------------|
|
|
9
|
-
| `/plan` + enter/exit_plan_mode + plan.md | Phase 1 (Architecture) | Use native plan mode for all Phase 1 work. On approval, export to `PHASE_1_BRIEF.md` and decision records in `appledger/`.
|
|
9
|
+
| `/plan` + enter/exit_plan_mode + plan.md | Phase 1 (Architecture) | Use native plan mode for all Phase 1 work. On approval, export to `PHASE_1_BRIEF.md` and decision records in `appledger/`. See `PLAN_MODE_PATTERNS.md`. |
|
|
10
10
|
| `spawn_subagent` (explore/plan/general, capability_mode, isolation: worktree, background, resume_from, personas) | All phases, especially 4, 5, 7 | Use for parallel audits (black-hat, UX, code quality), research, stabilize debugging, and exploratory spikes. Call `suggestSubagentDecomposition` first. Prefer read-only for analysis subagents. |
|
|
11
|
-
| `todo_write` + TODO panel | All phases | Mirror open criteria and next actions from `appledger/profiles/forgetrail.yaml`. The ledger is the durable record.
|
|
11
|
+
| `todo_write` + TODO panel | All phases | Mirror open criteria and next actions from `appledger/profiles/forgetrail.yaml`. The ledger is the durable record. |
|
|
12
12
|
| Skills (`/create-skill`, SKILL.md) | All sessions | Install the `forgetrail` skill (see `SKILL.md` in content/skills/forgetrail). It keeps phase discipline, tracking rules, and subagent patterns always active. |
|
|
13
13
|
| Native MCP (search_tool + use_tool) | Methodology delivery | Register the ForgeTrail MCP server. Tools appear as `forgetrail__*`. Use `getNewProjectKickoff`, `getPhaseGuidance`, `getCompanionSuggestions`, `runAudit`, `searchLessons`, `validateTracking`, etc. |
|
|
14
14
|
| Headless (`grok -p ... --output-format json`) | Automation / CI | Call kickoff/resume tools and have the agent produce structured phase state. Add exit-criteria validation in pipelines. |
|
|
15
15
|
| `docx` / `pptx` / `xlsx` skills + image/video gen | Phase 1 intake, Phase 6/7 deliverables | Use for exports (PDF/DOCX/PPTX), landing pages, brand assets, and marketing materials called out in greenfield intake. |
|
|
16
|
-
| Sessions + memory + AGENTS.md | Cross-session continuity | `appledger/` plus `CONTEXT_PROMPT.md` are the ForgeTrail equivalents. Update the session record at session end.
|
|
16
|
+
| Sessions + memory + AGENTS.md | Cross-session continuity | `appledger/` plus `CONTEXT_PROMPT.md` are the ForgeTrail equivalents. Update the session record at session end. |
|
|
17
17
|
|
|
18
18
|
## Recommended Session Openers in Grok
|
|
19
19
|
|
|
20
20
|
For a new project:
|
|
21
21
|
```
|
|
22
|
-
Call ForgeTrail getNewProjectKickoff (includeCursorRule false), write appledger/, then start Phase 1 using native /plan mode. Read the generated plan on approval and produce PHASE_1_BRIEF.md plus decision records.
|
|
22
|
+
Call ForgeTrail getNewProjectKickoff (includeCursorRule false), write appledger/, then start Phase 1 using native /plan mode. Read the generated plan on approval and produce PHASE_1_BRIEF.md plus decision records.
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
For resuming:
|
|
26
26
|
```
|
|
27
|
-
Call ForgeTrail getResumeSessionInstructions. Read appledger/profiles/forgetrail.yaml, the latest session record, and CONTEXT_PROMPT.md. Continue from the current phase.
|
|
27
|
+
Call ForgeTrail getResumeSessionInstructions. Read appledger/profiles/forgetrail.yaml, the latest session record, and CONTEXT_PROMPT.md. Continue from the current phase.
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
## Subagent Patterns (Grok-specific)
|
|
@@ -45,7 +45,7 @@ Use `background: true` for long-running subagents and retrieve with `get_command
|
|
|
45
45
|
## Ledger sync
|
|
46
46
|
|
|
47
47
|
After meaningful work (especially subagent results or feature completion):
|
|
48
|
-
- Update `appledger/` (criteria, decision records, lessons, the session).
|
|
48
|
+
- Update `appledger/` (criteria, decision records, lessons, the session).
|
|
49
49
|
- Use `todo_write` to surface the next 3–5 open items from the profile.
|
|
50
50
|
- Update `CONTEXT_PROMPT.md` when patterns or architecture change.
|
|
51
51
|
|
|
@@ -4,7 +4,7 @@ ForgeTrail owns phases, tracking, and progressive docs. **Companions** do one bo
|
|
|
4
4
|
|
|
5
5
|
Public shelf (current versions and install): [catalystforge.com/tools](https://catalystforge.com/tools/).
|
|
6
6
|
|
|
7
|
-
**Agents:** call **`getCompanionSuggestions`** with a `phase` (`1`–`7`) or a `situation` id when a trigger below is true. `getPhaseGuidance` also appends a short optional-companions footer. Offer one sentence plus the homepage. Do **not** install unless the user asked. Do **not** name this file, MCP tools, or spec paths in the human-facing offer. After a run that matters, persist the outcome on the appledger session as `data.companion_outcomes` and in the matching progressive doc.
|
|
7
|
+
**Agents:** call **`getCompanionSuggestions`** with a `phase` (`1`–`7`) or a `situation` id when a trigger below is true. `getPhaseGuidance` also appends a short optional-companions footer. Offer one sentence plus the homepage. Do **not** install unless the user asked. Do **not** name this file, MCP tools, or spec paths in the human-facing offer. After a run that matters, persist the outcome on the appledger session as `data.companion_outcomes` and in the matching progressive doc.
|
|
8
8
|
|
|
9
9
|
**Humans:** skip this file unless you already want a neighbor for a specific job.
|
|
10
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ForgeTrail Lite — portable kickoff for any agentic chat
|
|
2
2
|
|
|
3
|
-
> **ForgeTrail Lite v2.2.
|
|
3
|
+
> **ForgeTrail Lite v2.2.2**
|
|
4
4
|
> © Catalyst Forge, LLC — [www.catalystforge.com](https://www.catalystforge.com)
|
|
5
5
|
> Part of the **ForgeTrail** open-source methodology ([Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) in the upstream ForgeTrail repo).
|
|
6
6
|
>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
A single self-contained file for starting a new project in **any** agent: Cursor, Claude Code, Claude Cowork, OpenAI Codex, Cline, Aider, Continue, Windsurf, etc. **No MCP server, no vendored methodology tree, no external fetches.** Drop this file into the repo (or paste it into chat), and the agent has enough structure to run a real project end to end.
|
|
10
10
|
|
|
11
|
-
**System of record:** Phase, decisions, lessons, and sessions live in `appledger/` (`profiles/forgetrail.yaml` and records).
|
|
11
|
+
**System of record:** Phase, decisions, lessons, and sessions live in `appledger/` (`profiles/forgetrail.yaml` and records). §11 is the legacy shape for `appledger migrate` only. If a legacy `.forgetrail/workflow_tracking.json` exists and is not a pointer, run `appledger migrate preview` and then apply. Do not keep a second decision log. `.forgetrail/` is the protocol, rules, and hooks.
|
|
12
12
|
|
|
13
13
|
> **Maintainers:** Optional onboarding blocks in **§4.3**, **§4.4**, and **§7.1** are intentionally duplicated in root **`README.md`** and **`WORKFLOW.md`**. When you edit one, sync the others (see **`update-log.md`** — FORGETRAIL_LITE release checklist, item 3).
|
|
14
14
|
|
|
@@ -107,7 +107,7 @@ When a boot surfaces a gap in **ForgeTrail Lite itself** (not a one-off app bug)
|
|
|
107
107
|
|
|
108
108
|
### Who creates what
|
|
109
109
|
|
|
110
|
-
The **human** only needs to do two things: copy ForgeTrail Lite into **`.forgetrail/`** (or paste this doc into chat), and tell the agent to follow it. **Everything else is created by the agent** as it works through the phases. You should never be asked to hand-write `appledger/`, `.forgetrail/AGENTS.md`, the brief, `CONTEXT_PROMPT.md`, or the Phase 2 baseline files — the agent writes them and shows them to you for review.
|
|
110
|
+
The **human** only needs to do two things: copy ForgeTrail Lite into **`.forgetrail/`** (or paste this doc into chat), and tell the agent to follow it. **Everything else is created by the agent** as it works through the phases. You should never be asked to hand-write `appledger/`, `.forgetrail/AGENTS.md`, the brief, `CONTEXT_PROMPT.md`, or the Phase 2 baseline files — the agent writes them and shows them to you for review.
|
|
111
111
|
|
|
112
112
|
| File / folder | Who creates it | When |
|
|
113
113
|
|---|---|---|
|
|
@@ -307,7 +307,7 @@ Record anything non-obvious as a lesson in **`appledger/`** (for example, Playwr
|
|
|
307
307
|
|
|
308
308
|
### 4.2 Ordered first actions
|
|
309
309
|
|
|
310
|
-
1. **Read** `.forgetrail/FORGETRAIL_LITE.md` top to bottom. Also read `appledger/profiles/forgetrail.yaml`, the latest session record, `.forgetrail/AGENTS.md`, and `CONTEXT_PROMPT.md` if they already exist.
|
|
310
|
+
1. **Read** `.forgetrail/FORGETRAIL_LITE.md` top to bottom. Also read `appledger/profiles/forgetrail.yaml`, the latest session record, `.forgetrail/AGENTS.md`, and `CONTEXT_PROMPT.md` if they already exist.
|
|
311
311
|
2. **Ensure the folder is a git repo.** *(Skip this step if the user opted into no-git mode in §4.1.)* Check with `git rev-parse --is-inside-work-tree`. If it returns false or errors, run `git init -b main` (or `git init` + `git branch -m main` on older git) at the repo root. Never re-init an existing repo. **Apply §1.5 git policy** (default: **commit `.forgetrail/`** for Lite). Write a minimal `.gitignore` containing at least:
|
|
312
312
|
```
|
|
313
313
|
node_modules/
|
|
@@ -320,7 +320,7 @@ Record anything non-obvious as a lesson in **`appledger/`** (for example, Playwr
|
|
|
320
320
|
2. **`.forgetrail/cursor/rules/forgetrail-updates-log.mdc`** — use the §12.5 snippet verbatim. **Symlink or copy** into `.cursor/rules/` so Cursor reminds agents when to update `FORGETRAIL_LITE_UPDATES.md` (§1.6). Optional: copy the upstream **`FORGETRAIL_LITE_UPDATES.md`** starter into `.forgetrail/` when you expect protocol feedback during the project.
|
|
321
321
|
3. **`.forgetrail/hooks/` and `.cursor/hooks.json`** — install host safety hooks (`content/hooks/`) into `.forgetrail/hooks/` and copy `cursor-hooks.json` to `.cursor/hooks.json`. On Cursor, this runs pre-commit verification, enforces pnpm lock consistency, gates git push at the tool level, and injects live phase context at session start. For Claude Code, add `claude-settings-hooks.json` into `.claude/settings.json`.
|
|
322
322
|
If any of these already exists and its content conflicts with the Lite defaults, **do not overwrite** — flag the conflict to the user and ask how to reconcile. Record the reconciliation as a decision in `appledger/`.
|
|
323
|
-
4. **Create `appledger/`** if it does not exist. Run `pnpm dlx appledger init --name "<application name>"` (or `appledger init` when it is installed globally), then `pnpm dlx appledger check`. Init writes `manifest.yaml`, `profiles/forgetrail.yaml` with the `plan` phase `in_progress`, an application record, and a session record. It does not overwrite existing files. Init leaves the purpose as "Not supplied." Write the one-line purpose into the application record from what the user has already said, then run `check` again.
|
|
323
|
+
4. **Create `appledger/`** if it does not exist. Run `pnpm dlx appledger init --name "<application name>"` (or `appledger init` when it is installed globally), then `pnpm dlx appledger check`. Init writes `manifest.yaml`, `profiles/forgetrail.yaml` with the `plan` phase `in_progress`, an application record, and a session record. It does not overwrite existing files. Init leaves the purpose as "Not supplied." Write the one-line purpose into the application record from what the user has already said, then run `check` again. Criteria stay `pending` until evidence exists. **Without Node:** write the same four files by hand in the shape of the [minimal example ledger](https://github.com/Catalyst-Forge-LLC/appledger/tree/main/examples/minimal/appledger), and run `appledger check` once Node is available. A hand-written ledger is not checked until then.
|
|
324
324
|
5. **If git was initialized in step 2**, make the first commit now so the user has a clean baseline. **What lands in the commit depends on §1.5:** if **committing `.forgetrail/`**, steps 3–4 artifacts are included; if **gitignoring `.forgetrail/`**, only `.gitignore` (and any `.cursor/rules/` copies) — the workspace stays local-only and that is expected, not a mistake. Example: `git add -A && git commit -m "chore: ForgeTrail Lite bootstrap"`. Skip this step if the repo already had history — do not squash or amend what's there. Skip entirely if the user is in no-git mode (§4.1).
|
|
325
325
|
6. **Ask the §5 intake questions.** Do not write any project code yet. For the first user-facing reply, follow §9 (plain product language, one clear "reply with," no methodology jargon).
|
|
326
326
|
7. **Create `docs/`** (if missing) and **draft `docs/PHASE_1_BRIEF.md`** from the §6 template using the user's answers. Show it to the user, iterate, then **lock it**: mark the brief criteria met in `appledger/profiles/forgetrail.yaml` only when the user has approved them, and record major commitments as decision records.
|
|
@@ -461,7 +461,7 @@ Output requirements
|
|
|
461
461
|
|
|
462
462
|
### 4.6 ForgeTrail phase progress (human-readable)
|
|
463
463
|
|
|
464
|
-
**Source of truth:** **`appledger/profiles/forgetrail.yaml`** and the latest session record (agents update every session).
|
|
464
|
+
**Source of truth:** **`appledger/profiles/forgetrail.yaml`** and the latest session record (agents update every session).
|
|
465
465
|
|
|
466
466
|
**For humans who are not in Cursor:**
|
|
467
467
|
|
|
@@ -839,7 +839,7 @@ Full ForgeTrail expands this under **`docs/TECHNICAL_REFERENCE.md`** (*URL impor
|
|
|
839
839
|
- **Letters** (A/B/C) = pick-one / "which first?" — avoids collision with numbered steps.
|
|
840
840
|
6. **No interactive CLIs** in scripted commands. Pass non-interactive flags. Examples: `npm create vite@latest -- --template ...`, `gh repo create --confirm`. For SvelteKit in Lite, **prefer the manual scaffold** (§4.2 step 10 A.1) over `sv create` — by the time Phase 2 runs, the repo root is never empty and `sv create .` will hit an un-skippable **`Directory not empty. Continue?`** prompt and hang. If you do use `sv create` as a shortcut, target a **new empty subfolder** (`sv create app`), never `.`. A hanging prompt in an agent terminal is a dead session.
|
|
841
841
|
7. **Five-turn rule.** If a bug or design problem has not converged in ~5 turns, **stop patching** and propose a different approach (different library, different data model, different scope cut). Announce the pivot explicitly.
|
|
842
|
-
8. **Update the ledger after substantive work.** Move criteria that have evidence, and update the session record. A stale `appledger/` after a busy session is a bug.
|
|
842
|
+
8. **Update the ledger after substantive work.** Move criteria that have evidence, and update the session record. A stale `appledger/` after a busy session is a bug.
|
|
843
843
|
9. **Git commits — clean messages and natural stopping points.** See **§8.9** for guidelines. Commit with phase-prefixed or descriptive messages (`git commit -m "phase-2: wire hero flow"` or `git commit -F path/to/msg.txt`). Always verify that types and checks pass cleanly before committing. Never leave uncommitted broken states across session boundaries.
|
|
844
844
|
|
|
845
845
|
10. **Install/bootstrap scripts must branch on `process.platform` before shelling out to archive, network, or text tools.** Treat `tar`, `unzip`, `curl`, `sed`, `awk`, `openssl`, and similar as **platform-dependent on Windows** — never a drop-in from a Unix-only recipe. On `win32`, prefer PowerShell (`Expand-Archive`, `Invoke-WebRequest`) or call `C:\Windows\System32\tar.exe` by absolute path to bypass PATH shadowing; keep `tar` / `unzip` / `curl` for macOS/Linux branches. Layer fallbacks and end with a clear error that points the user at manual steps (e.g. “Extract All”) if automation cannot run. Full failure modes: §13 (Engineering).
|
|
@@ -862,7 +862,7 @@ Ensure that automated checks pass (`pnpm run verify` or project test suite) befo
|
|
|
862
862
|
|
|
863
863
|
## 9. First user-facing reply after bootstrap
|
|
864
864
|
|
|
865
|
-
After you create `.forgetrail/AGENTS.md`, `appledger/`, and the git baseline, your **first message to the human** should be **short, plain-English, and ask only the opening round** of §5. Do
|
|
865
|
+
After you create `.forgetrail/AGENTS.md`, `appledger/`, and the git baseline, your **first message to the human** should be **short, plain-English, and ask only the opening round** of §5. Do **not** dump the full intake checklist. Do **not** list MCP tools, internal file paths, ForgeTrail terms ("hero workflow," "architecture," "spine," "exit criteria," "brief," "phase"), or file inventories. Target **~80 words or fewer** — this is a conversation starter, not a form.
|
|
866
866
|
|
|
867
867
|
**The anchor round is always Round 1:** three small, numbered questions — project name, what it is, who it's for. Nothing else. Stagger the rest of §5 across follow-up messages once they answer.
|
|
868
868
|
|
|
@@ -1003,7 +1003,7 @@ Save this as `.forgetrail/AGENTS.md` so agents that auto-load it (Codex, Cursor,
|
|
|
1003
1003
|
|
|
1004
1004
|
```markdown
|
|
1005
1005
|
<!--
|
|
1006
|
-
Agent protocol based on ForgeTrail Lite v2.2.
|
|
1006
|
+
Agent protocol based on ForgeTrail Lite v2.2.2.
|
|
1007
1007
|
© Catalyst Forge, LLC — www.catalystforge.com
|
|
1008
1008
|
Licensed under Apache License 2.0 (upstream ForgeTrail repo).
|
|
1009
1009
|
-->
|
|
@@ -1034,7 +1034,7 @@ This repository uses **ForgeTrail Lite** as its project kickoff and operating pr
|
|
|
1034
1034
|
Initial `git init`, `pnpm init` / scaffolder, `pnpm install`, and the initial commit are all done by the agent per `.forgetrail/FORGETRAIL_LITE.md` §4. Do not ask the user to run setup commands by hand. If `git`, **Node.js**, **npm**, or **pnpm** are missing, follow §4.1 preflight (concrete install path; no-git mode for git only — never silently skip).
|
|
1035
1035
|
|
|
1036
1036
|
## Session start
|
|
1037
|
-
1. Read `appledger/profiles/forgetrail.yaml` and `CONTEXT_PROMPT.md` (if present).
|
|
1037
|
+
1. Read `appledger/profiles/forgetrail.yaml` and `CONTEXT_PROMPT.md` (if present).
|
|
1038
1038
|
2. Check the current profile phase and the latest session record.
|
|
1039
1039
|
3. Verify `.git/` and `package.json` exist if the phase calls for them; if missing, re-read `.forgetrail/FORGETRAIL_LITE.md` §4 (preflight + ordered actions) and catch up before proceeding. If a decision records that source control is deferred, respect no-git mode and remind the user git is still pending.
|
|
1040
1040
|
4. If the previous session left exit criteria unmet, resume there — do not jump ahead.
|
|
@@ -1056,7 +1056,7 @@ These are the failures ForgeTrail sees most often. The agent should re-read this
|
|
|
1056
1056
|
- **Skipping the Phase 1 brief.** Rewrites compound. If the user says "just start coding," offer to write a 10-line brief in 2 minutes first — it still pays off.
|
|
1057
1057
|
- **Half-built spine.** Scaffolding a UI with mock data, or wiring a DB with no UI, and calling it Phase 2. The spine is end-to-end or it is not a spine.
|
|
1058
1058
|
- **Silent stack swap.** Choosing a framework, DB, or language the user did not confirm. Always name the stack and get a "yes" before Phase 2.
|
|
1059
|
-
- **Ledger rot.** Creating `appledger/` once and never updating it. Update the session record at the end of every substantive turn.
|
|
1059
|
+
- **Ledger rot.** Creating `appledger/` once and never updating it. Update the session record at the end of every substantive turn.
|
|
1060
1060
|
- **Turning the first reply into a methodology dump.** Users want a product answer, not a tour of decision records and exit criteria.
|
|
1061
1061
|
|
|
1062
1062
|
**Engineering**
|
|
@@ -1119,7 +1119,6 @@ During Phase 2, create these once the spine is running. Keep them short and hone
|
|
|
1119
1119
|
# CLAUDE.md
|
|
1120
1120
|
# IDEAS.md
|
|
1121
1121
|
# .cursor/rules/forgetrail-updates-log.mdc
|
|
1122
|
-
# Do not symlink or recreate .forgetrail/workflow_tracking.json.
|
|
1123
1122
|
# Project state is appledger/ and is committed with the app.
|
|
1124
1123
|
|
|
1125
1124
|
# Deps
|
|
@@ -1179,4 +1178,4 @@ ForgeTrail Lite covers the shape of a project. The full **ForgeTrail MCP server*
|
|
|
1179
1178
|
|
|
1180
1179
|
---
|
|
1181
1180
|
|
|
1182
|
-
**ForgeTrail Lite v2.2.
|
|
1181
|
+
**ForgeTrail Lite v2.2.2** · © Catalyst Forge, LLC · [www.catalystforge.com](https://www.catalystforge.com) · [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ForgeTrail progress
|
|
2
2
|
|
|
3
|
-
_Human-readable snapshot for non-technical operators. **Source of truth:** `appledger/profiles/forgetrail.yaml` and the latest session record. The agent updates those.
|
|
3
|
+
_Human-readable snapshot for non-technical operators. **Source of truth:** `appledger/profiles/forgetrail.yaml` and the latest session record. The agent updates those. This page is a snapshot, not the record._
|
|
4
4
|
|
|
5
5
|
## Current phase
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ Use this **before** Phase 1, in **any** LLM chat — ChatGPT, Claude, Grok, a lo
|
|
|
14
14
|
|
|
15
15
|
1. Save it in the project repo as **`docs/GENESIS.md`** (canonical path).
|
|
16
16
|
2. Follow the human recipe in **`TRY_FORGETRAIL.md`** (ForgeTrail repo root), or feed the spec into ForgeTrail Phase 1:
|
|
17
|
-
- **Automatic draft:** call **`ingestPlanArtifact`** with the full `GENESIS.md` text as `planContent`. It maps headings like *Problem statement*, *Goals and non-goals*, *Required background on the data/file format*, *Core domain concepts*, *Edge cases*, *Milestones*, and *Open questions* into `docs/PHASE_1_BRIEF.md` sections, and extracts any `D1.`/`D2.`-style decisions into decision records for `appledger/`.
|
|
17
|
+
- **Automatic draft:** call **`ingestPlanArtifact`** with the full `GENESIS.md` text as `planContent`. It maps headings like *Problem statement*, *Goals and non-goals*, *Required background on the data/file format*, *Core domain concepts*, *Edge cases*, *Milestones*, and *Open questions* into `docs/PHASE_1_BRIEF.md` sections, and extracts any `D1.`/`D2.`-style decisions into decision records for `appledger/`. Sections without a clean home (e.g. **Acceptance criteria** — the brief has no dedicated section for it) land in a "Plan sections not auto-mapped" footer — fold that into **§12 Handoff checklist** or its own appendix by hand.
|
|
18
18
|
- **Manual walkthrough:** read `docs/GENESIS.md` together with the agent as context, then run **`getGreenfieldIntakePrompt`** + `getChecklist(before-session-1)` to confirm delivery details the spec might not cover (tenancy, compliance, live search, content-generation pattern).
|
|
19
19
|
3. Either way, **lock `docs/PHASE_1_BRIEF.md`** before Phase 2 scaffolding, per the normal Phase 1 exit criteria.
|
|
20
20
|
|
package/content/GENESIS_STUB.md
CHANGED
|
@@ -13,6 +13,6 @@ Replace this file with your **what, not how** build spec.
|
|
|
13
13
|
|
|
14
14
|
See **TRY_FORGETRAIL.md** in the ForgeTrail repo for the full recipe. Short version:
|
|
15
15
|
|
|
16
|
-
> Follow `.forgetrail/FORGETRAIL_LITE.md` as the project protocol. Treat `docs/GENESIS.md` as the product spec (what, not how). If `appledger` is installed, run `appledger init`. Otherwise create `appledger/` (manifest, profile, application record, session record). Draft `docs/PHASE_1_BRIEF.md` from the Genesis file, asking me only about gaps. Do not
|
|
16
|
+
> Follow `.forgetrail/FORGETRAIL_LITE.md` as the project protocol. Treat `docs/GENESIS.md` as the product spec (what, not how). If `appledger` is installed, run `appledger init`. Otherwise create `appledger/` (manifest, profile, application record, session record). Draft `docs/PHASE_1_BRIEF.md` from the Genesis file, asking me only about gaps. Do not scaffold application code until I explicitly approve the Phase 1 brief.
|
|
17
17
|
|
|
18
18
|
Keep this file at **`docs/GENESIS.md`** (this path). Do not move it to the repo root.
|
|
@@ -4,7 +4,7 @@ Use alongside **`getChecklist`** section `before-session-1`. That checklist cove
|
|
|
4
4
|
|
|
5
5
|
**Already have a written spec (e.g. `docs/GENESIS.md`)?** Feed it into **`ingestPlanArtifact`** first, then use this document only to fill gaps (delivery, tenancy, compliance, live search) it may not cover. If the user has only an idea, **`getGenesisSpecPrompt`** (or human recipe **`TRY_FORGETRAIL.md`**) produces a portable spec via an external LLM chat before you run through these questions.
|
|
6
6
|
|
|
7
|
-
**Agent:** Walk through these with the user (or infer from context and confirm). Record answers in **`docs/PHASE_1_BRIEF.md`** (§1–3, §6–8 as needed) and as **decision records in `appledger/`**.
|
|
7
|
+
**Agent:** Walk through these with the user (or infer from context and confirm). Record answers in **`docs/PHASE_1_BRIEF.md`** (§1–3, §6–8 as needed) and as **decision records in `appledger/`**.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -19,7 +19,7 @@ Use alongside **`getChecklist`** section `before-session-1`. That checklist cove
|
|
|
19
19
|
|
|
20
20
|
- **Is this a product, an internal tool, or a one-shot?** (product: others will use it, possibly pay; internal-tool: real recurring users, no market; one-shot: gift, event page, demo: one occasion, then done). Often obvious from the problem statement; confirm rather than interrogate.
|
|
21
21
|
- The archetype **prunes the lifecycle**: internal tools make Phase 6 optional and drop payments/business-plan criteria from Phase 7; one-shots collapse phases 5–7 into a single polish-and-ship gate. See **WORKFLOW.md §1d**.
|
|
22
|
-
- 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.
|
|
22
|
+
- 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.
|
|
23
23
|
|
|
24
24
|
## 1. Outputs and formats
|
|
25
25
|
|
|
@@ -7,7 +7,7 @@ Some Cursor sessions **do not expose MCP tools** to the agent (or only a subset)
|
|
|
7
7
|
**If you must replicate the kickoff bundle from this repo** (same sources as `buildNewProjectKickoff` in `mcp-server/src/index.ts`), read and apply in order:
|
|
8
8
|
|
|
9
9
|
1. `content/NEW_PROJECT_BOOTSTRAP.md` — methodology and next steps
|
|
10
|
-
2. If `appledger` is installed, run **`appledger init`** in the customer repo (pass **`--name`** when the name is known). Otherwise create the manifest, `profiles/forgetrail.yaml`, an application record, and a session record by hand.
|
|
10
|
+
2. If `appledger` is installed, run **`appledger init`** in the customer repo (pass **`--name`** when the name is known). Otherwise create the manifest, `profiles/forgetrail.yaml`, an application record, and a session record by hand.
|
|
11
11
|
3. `content/POST_BOOTSTRAP_USER_MESSAGE.md` — how the first user-facing reply should read
|
|
12
12
|
4. `content/cursor-rules/forgetrail-phase-status.mdc` — write to `.cursor/rules/forgetrail-phase-status.mdc` in the customer repo (Cursor only)
|
|
13
13
|
5. `content/cursor-rules/forgetrail-lessons-gate.mdc` and `forgetrail-lessons-mcp.mdc` — write to `.cursor/rules/` (lessons + anti-patterns gate before large work)
|
|
@@ -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
|
],
|
|
@@ -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.
|
|
@@ -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
|
|
|
@@ -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/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
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" };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
|
-
import { mkdtempSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
2
|
+
import { mkdtempSync, readFileSync, writeFileSync, mkdirSync, utimesSync } from "node:fs";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
@@ -101,10 +101,10 @@ test("Lite and workflow instructions name the ledger", () => {
|
|
|
101
101
|
assert.ok(legacyAt > 0 && resumeAt > legacyAt);
|
|
102
102
|
const instructional = `${lite.slice(0, legacyAt)}\n${lite.slice(resumeAt)}`;
|
|
103
103
|
assert.match(lite.slice(legacyAt, resumeAt), /"schemaVersion": "lite-1"/);
|
|
104
|
-
assert.match(instructional, /ForgeTrail Lite v2\.2\.
|
|
104
|
+
assert.match(instructional, /ForgeTrail Lite v2\.2\.2/);
|
|
105
105
|
for (const line of instructional.split("\n")) {
|
|
106
106
|
if (!line.includes("workflow_tracking.json")) continue;
|
|
107
|
-
assert.match(line, /
|
|
107
|
+
assert.match(line, /legacy/, line);
|
|
108
108
|
}
|
|
109
109
|
const workflow = readFileSync(join(root, "WORKFLOW.md"), "utf8");
|
|
110
110
|
assert.match(workflow, /not_applicable/);
|
|
@@ -112,10 +112,72 @@ test("Lite and workflow instructions name the ledger", () => {
|
|
|
112
112
|
assert.doesNotMatch(workflow, /Where this file names that JSON/);
|
|
113
113
|
for (const line of workflow.split("\n")) {
|
|
114
114
|
if (!line.includes("workflow_tracking.json")) continue;
|
|
115
|
-
assert.match(line, /
|
|
115
|
+
assert.match(line, /legacy/, line);
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
|
|
119
|
+
test("fresh-project instructions do not name the tracking file", () => {
|
|
120
|
+
const files = [
|
|
121
|
+
"INITIAL_PROMPT.md",
|
|
122
|
+
"CONTINUATION_PROMPT.md",
|
|
123
|
+
"content/AGENT_INTEGRATION_claude.md",
|
|
124
|
+
"content/AGENT_INTEGRATION_cursor.md",
|
|
125
|
+
"content/AGENT_INTEGRATION_generic.md",
|
|
126
|
+
"content/AGENT_INTEGRATION_grok.md",
|
|
127
|
+
"content/COMPANION_TOOLS.md",
|
|
128
|
+
"content/FORGETRAIL_PROGRESS.md",
|
|
129
|
+
"content/GENESIS_SPEC_PROMPT.md",
|
|
130
|
+
"content/GENESIS_STUB.md",
|
|
131
|
+
"content/GREENFIELD_INTAKE.md",
|
|
132
|
+
"content/KICKOFF_WITHOUT_MCP.md",
|
|
133
|
+
"content/NEW_PROJECT_BOOTSTRAP.md",
|
|
134
|
+
"content/PLAN_MODE_PATTERNS.md",
|
|
135
|
+
"content/POCKETBASE_SCHEMA_SCRIPT.md",
|
|
136
|
+
"content/POST_BOOTSTRAP_USER_MESSAGE.md",
|
|
137
|
+
"content/SESSION_RESUME_MCP.md",
|
|
138
|
+
"content/companion-tools.json",
|
|
139
|
+
"content/cursor-rules/forgetrail-phase-status.mdc",
|
|
140
|
+
"content/skills/forgetrail/SKILL.md",
|
|
141
|
+
"docs/PHASE_1_BRIEF.md",
|
|
142
|
+
"docs/SPEC_FEATURE_TEMPLATE.md",
|
|
143
|
+
];
|
|
144
|
+
for (const file of files) {
|
|
145
|
+
for (const line of readFileSync(join(root, file), "utf8").split("\n")) {
|
|
146
|
+
if (!line.includes("workflow_tracking.json")) continue;
|
|
147
|
+
assert.match(line, /legacy|exists|validateTracking/, `${file}: ${line}`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
function stopHook(dir, input) {
|
|
153
|
+
const result = spawnSync(process.execPath, [join(root, "content", "hooks", "session-stop.mjs")], {
|
|
154
|
+
cwd: dir,
|
|
155
|
+
input: JSON.stringify(input),
|
|
156
|
+
encoding: "utf8",
|
|
157
|
+
});
|
|
158
|
+
assert.equal(result.status, 0, result.stderr);
|
|
159
|
+
return JSON.parse(result.stdout);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
test("session stop reminds only after work newer than the session record", () => {
|
|
163
|
+
const dir = mkdtempSync(join(tmpdir(), "ft-stop-"));
|
|
164
|
+
mkdirSync(join(dir, "appledger", "records", "session"), { recursive: true });
|
|
165
|
+
writeFileSync(join(dir, "appledger", "manifest.yaml"), "format: appledger\n");
|
|
166
|
+
const session = join(dir, "appledger", "records", "session", "session-1.md");
|
|
167
|
+
writeFileSync(session, "session\n");
|
|
168
|
+
spawnSync("git", ["init", "-q"], { cwd: dir });
|
|
169
|
+
const old = new Date(Date.now() - 60_000);
|
|
170
|
+
utimesSync(session, old, old);
|
|
171
|
+
assert.deepEqual(stopHook(dir, { status: "completed", loop_count: 0 }), {});
|
|
172
|
+
writeFileSync(join(dir, "app.ts"), "export {};\n");
|
|
173
|
+
const reminder = stopHook(dir, { status: "completed", loop_count: 0 });
|
|
174
|
+
assert.match(reminder.followup_message, /session record/);
|
|
175
|
+
assert.doesNotMatch(reminder.followup_message, /workflow_tracking/);
|
|
176
|
+
assert.deepEqual(stopHook(dir, { status: "completed", loop_count: 1 }), {});
|
|
177
|
+
writeFileSync(session, "session updated\n");
|
|
178
|
+
assert.deepEqual(stopHook(dir, { status: "completed", loop_count: 0 }), {});
|
|
179
|
+
});
|
|
180
|
+
|
|
119
181
|
test("kickoff names appledger init and does not require the tracking file", () => {
|
|
120
182
|
const kickoff = readFileSync(join(root, "mcp-server", "src", "index.ts"), "utf8");
|
|
121
183
|
assert.match(kickoff, /appledger init/);
|
|
@@ -123,7 +185,7 @@ test("kickoff names appledger init and does not require the tracking file", () =
|
|
|
123
185
|
const plan = readFileSync(join(root, "content", "PLAN_MODE_PATTERNS.md"), "utf8");
|
|
124
186
|
assert.match(plan, /decision record/);
|
|
125
187
|
assert.doesNotMatch(plan, /decisions\[\]/);
|
|
126
|
-
assert.
|
|
188
|
+
assert.doesNotMatch(plan, /workflow_tracking/);
|
|
127
189
|
const genesis = readFileSync(join(root, "content", "GENESIS_STUB.md"), "utf8");
|
|
128
190
|
assert.match(genesis, /appledger init/);
|
|
129
191
|
assert.doesNotMatch(genesis, /Create `\.forgetrail\/workflow_tracking\.json`/);
|