Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
0214821
docs: propose Rstack context engine RFC
ScriptedAlchemy Aug 12, 2026
f62903d
docs: improve RFC architecture diagrams
ScriptedAlchemy Aug 12, 2026
70c4a90
feat(rstack): scaffold context evidence store
ScriptedAlchemy Aug 12, 2026
0dfc187
docs: design passive build context phase
ScriptedAlchemy Aug 12, 2026
c9ec9da
docs: plan passive build context phase
ScriptedAlchemy Aug 12, 2026
5e78b46
feat(rstack): add context activation and status
ScriptedAlchemy Aug 12, 2026
bb1fc03
feat(rstack): collect passive build metadata
ScriptedAlchemy Aug 12, 2026
13dc5a0
fix(rstack): harden passive build capture
ScriptedAlchemy Aug 12, 2026
c0a9e86
feat(rstack): inject build context observers
ScriptedAlchemy Aug 12, 2026
9a44ea4
fix(rstack): use approved build context plugin name
ScriptedAlchemy Aug 12, 2026
2f27b98
feat(rstack): expose build context over MCP
ScriptedAlchemy Aug 12, 2026
17f694d
docs: clarify MCP configuration behavior
ScriptedAlchemy Aug 12, 2026
9b03ae4
docs: plan Rsdoctor context phases
ScriptedAlchemy Aug 12, 2026
5eae5bf
feat(rstack): add bounded Rsdoctor analysis
ScriptedAlchemy Aug 12, 2026
69156c0
fix(rstack): sanitize Rsdoctor analysis output
ScriptedAlchemy Aug 12, 2026
49f8496
fix(rstack): harden Rsdoctor output redaction
ScriptedAlchemy Aug 12, 2026
d807eb3
fix(rstack): tokenize Rsdoctor output keys
ScriptedAlchemy Aug 12, 2026
4596485
fix(rstack): validate Rsdoctor metadata values
ScriptedAlchemy Aug 12, 2026
d40487c
feat(rstack): expose Rsdoctor context tools
ScriptedAlchemy Aug 12, 2026
16adb05
fix(rstack): make Rsdoctor fallback executable
ScriptedAlchemy Aug 12, 2026
077abaa
fix(rstack): return portable Rsdoctor next action
ScriptedAlchemy Aug 12, 2026
099d284
feat(rstack): add bounded context retention
ScriptedAlchemy Aug 12, 2026
4578eaf
fix(rstack): harden context retention
ScriptedAlchemy Aug 12, 2026
b7b52b0
docs: plan lean context hardening
ScriptedAlchemy Aug 12, 2026
63ea0a6
refactor(rstack): defer destructive context retention
ScriptedAlchemy Aug 12, 2026
c0f3e13
docs: remove context security scope
ScriptedAlchemy Aug 12, 2026
bc27932
docs: defer context retention in passive design
ScriptedAlchemy Aug 12, 2026
9313fe5
docs: incorporate pragmatic review fixes
ScriptedAlchemy Aug 12, 2026
3e0084e
refactor(rstack): share context record validation
ScriptedAlchemy Aug 12, 2026
7bd0a0f
fix(rstack): order context generations numerically
ScriptedAlchemy Aug 12, 2026
791e9e0
perf(rstack): bound passive build extraction
ScriptedAlchemy Aug 12, 2026
d28a528
test(rstack): remove obsolete context security fixtures
ScriptedAlchemy Aug 12, 2026
6ca71ea
refactor(rstack): simplify Rsdoctor analysis
ScriptedAlchemy Aug 12, 2026
cf132fd
test(rstack): fix context store spelling
ScriptedAlchemy Aug 12, 2026
3f60585
docs: align the lean context foundation
ScriptedAlchemy Aug 12, 2026
0787f23
fix(rstack): defer Rsdoctor adapter loading
ScriptedAlchemy Aug 12, 2026
a2f7ebd
feat: add Rstack agent plugin bundles
ScriptedAlchemy Aug 12, 2026
e1828d5
fix: validate Codex plugin bundle
ScriptedAlchemy Aug 12, 2026
a99e9d7
feat(rstack): normalize Rsdoctor product graphs
ScriptedAlchemy Aug 12, 2026
f0b5cb3
feat(rstack): add context snapshot freshness
ScriptedAlchemy Aug 12, 2026
e72e950
fix(rstack): normalize root context package paths
ScriptedAlchemy Aug 12, 2026
29688e5
fix(rstack): read Rsdoctor dependency edges
ScriptedAlchemy Aug 12, 2026
db65aaa
feat(rstack): query module reachability
ScriptedAlchemy Aug 12, 2026
d3f8806
feat(rstack): capture Rstest snapshots
ScriptedAlchemy Aug 12, 2026
50e57b3
feat(rstack): capture Rslint snapshots
ScriptedAlchemy Aug 12, 2026
54c2b6e
feat(rstack): expose module analysis over MCP
ScriptedAlchemy Aug 12, 2026
89f3efc
fix(rstack): bound rootless reachability claims
ScriptedAlchemy Aug 12, 2026
4a3b9ac
fix(rstack): defer Rslint runtime loading
ScriptedAlchemy Aug 12, 2026
56b2bd8
feat(rstack): diff context snapshots
ScriptedAlchemy Aug 12, 2026
bf32466
fix(rstack): order snapshot diff reasons
ScriptedAlchemy Aug 12, 2026
8ecf7c2
feat(rstack): expose lint and test context over MCP
ScriptedAlchemy Aug 12, 2026
0264db0
docs(rstack): describe project status contexts
ScriptedAlchemy Aug 12, 2026
1ada8d9
docs: align context engine RFC
ScriptedAlchemy Aug 12, 2026
ae47162
fix(plugin): launch workspace-local rstack MCP
ScriptedAlchemy Aug 12, 2026
0ad537f
feat(context): capture monorepo package targets
ScriptedAlchemy Aug 12, 2026
f12e381
test(context): exercise package configs end to end
ScriptedAlchemy Aug 12, 2026
b600d00
fix(rstack): keep context queries truthful
ScriptedAlchemy Aug 12, 2026
31ead1e
fix(rstack): keep complete chunk metadata
ScriptedAlchemy Aug 12, 2026
51bc79c
fix(rstack): refine plugin skill workflows
ScriptedAlchemy Aug 12, 2026
017f5ed
feat(rstack): define plugin SPI
ScriptedAlchemy Aug 12, 2026
a7b901e
feat(rstack): support plugin commands
ScriptedAlchemy Aug 12, 2026
5a92e27
fix(rstack): improve real Rsdoctor analysis
ScriptedAlchemy Aug 12, 2026
884d2af
feat(rstack): apply plugin config modifiers
ScriptedAlchemy Aug 12, 2026
4563930
fix(rstack): harden plugin runtime
ScriptedAlchemy Aug 12, 2026
623c4cb
docs: document Rstack plugins
ScriptedAlchemy Aug 12, 2026
9d1c857
fix(context): persist thrown rstest attempts
ScriptedAlchemy Aug 12, 2026
91a1992
fix(plugin): fall back to PATH for MCP launcher
ScriptedAlchemy Aug 12, 2026
ae2b524
feat(context): distinguish build variants and freshness
ScriptedAlchemy Aug 12, 2026
e333b4d
refactor(rstack): reuse loaded plugin runtime
ScriptedAlchemy Aug 13, 2026
b9ca627
fix(context): mark rejected rstest evidence partial
ScriptedAlchemy Aug 13, 2026
7089054
fix(context): report current MCP status
ScriptedAlchemy Aug 13, 2026
3825894
fix(rstack): initialize plugins before config factories
ScriptedAlchemy Aug 13, 2026
87386ce
fix(context): bind Rsdoctor artifacts to builds
ScriptedAlchemy Aug 13, 2026
051e69b
test(context): type artifact build fixture
ScriptedAlchemy Aug 13, 2026
8ab7c60
refactor(rstack): simplify plugin lifecycle code
ScriptedAlchemy Aug 13, 2026
0f7c0cc
fix(context): match enriched Rsdoctor targets
ScriptedAlchemy Aug 13, 2026
949e3e1
refactor(rstack): clarify automatic test config resolution
ScriptedAlchemy Aug 13, 2026
c8aae78
fix(context): improve dogfood evidence UX
ScriptedAlchemy Aug 13, 2026
29413b2
feat(context): capture aggregate test execution
ScriptedAlchemy Aug 13, 2026
3cc052d
feat(context): compose code evidence
ScriptedAlchemy Aug 13, 2026
b8ba3dc
fix(context): refine artifact dogfood UX
ScriptedAlchemy Aug 13, 2026
8a45c60
refactor(context): extract context runtime package
ScriptedAlchemy Aug 13, 2026
a1821e3
docs(context): use official Rstack agent plugin
ScriptedAlchemy Aug 13, 2026
79246ff
Merge remote-tracking branch 'origin/main' into codex/rstack-mcp-obse…
ScriptedAlchemy Aug 13, 2026
da4a56e
fix(context): keep MCP protocol output clean
ScriptedAlchemy Aug 13, 2026
9be63c2
test(context): canonicalize temporary roots
ScriptedAlchemy Aug 13, 2026
8e20d9d
test: support context checks on Windows
ScriptedAlchemy Aug 13, 2026
fd9e1ba
test: allow Windows coverage fixture time
ScriptedAlchemy Aug 13, 2026
a52a7c2
fix(context): compare complete snapshot evidence
ScriptedAlchemy Aug 13, 2026
82cfda3
fix(context): qualify lint snapshot freshness
ScriptedAlchemy Aug 13, 2026
b3e92b6
Merge remote-tracking branch 'origin/main' into codex/rstack-mcp-obse…
ScriptedAlchemy Aug 13, 2026
afde873
chore: merge main into plugin SPI
ScriptedAlchemy Aug 13, 2026
2f61aa7
fix(context): normalize Rsdoctor module relations
ScriptedAlchemy Aug 14, 2026
59daddc
feat(context): capture related Rstest evidence
ScriptedAlchemy Aug 14, 2026
c020a7d
test(context): accept Windows CLI paths
ScriptedAlchemy Aug 14, 2026
9ce648e
fix(rstack): isolate related-test JSON output
ScriptedAlchemy Aug 14, 2026
b09d234
docs: design context repository extraction
ScriptedAlchemy Aug 14, 2026
9b184cc
docs: plan context repository extraction
ScriptedAlchemy Aug 14, 2026
28160bb
refactor(context): move runtime to standalone repository
ScriptedAlchemy Aug 14, 2026
13f2607
docs: follow heading case convention
ScriptedAlchemy Aug 14, 2026
84ec81d
fix(rstack): skip unconfigured Rstest captures
ScriptedAlchemy Aug 14, 2026
5b8d0b4
test(rstack): use spell-safe MCP fixture name
ScriptedAlchemy Aug 14, 2026
22e234f
docs: define context plugin boundary
ScriptedAlchemy Aug 14, 2026
24c3534
docs: plan context plugin boundary implementation
ScriptedAlchemy Aug 14, 2026
ed2e1d7
docs: correct context entry point task order
ScriptedAlchemy Aug 14, 2026
3651672
build: update context preview
ScriptedAlchemy Aug 14, 2026
5e6ba94
chore: stack context on plugin SPI
ScriptedAlchemy Aug 14, 2026
aac6147
feat(rstack): pass tool context to plugin modifiers
ScriptedAlchemy Aug 14, 2026
eb80e53
refactor(rstack): integrate context through plugin SPI
ScriptedAlchemy Aug 14, 2026
adf9ab2
docs: explain context plugin integration
ScriptedAlchemy Aug 14, 2026
96b0de5
chore: merge main into plugin SPI
ScriptedAlchemy Aug 14, 2026
8f71148
chore: refresh stacked plugin SPI
ScriptedAlchemy Aug 14, 2026
e9eaa3c
build: update context dogfood preview
ScriptedAlchemy Aug 14, 2026
d656cd9
build: update context error preview
ScriptedAlchemy Aug 14, 2026
dbbbc3d
build: update context preview
ScriptedAlchemy Aug 14, 2026
18f4b55
build: update context evidence preview
ScriptedAlchemy Aug 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .agents/skills/debug-dev-cycle/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: debug-dev-cycle
description: Diagnose current Rstack lint or test failures from stored evidence, with an optional user-approved one-shot capture. Use this skill when debugging one current Rslint or Rstest result; use review-context-change to compare two snapshots.
---

# Debug an Rstack development cycle

1. Call `project_status` first. Treat freshness separately for each producer; a fresh build does
not make lint or test evidence fresh.
2. Match the requested package and producer to `project_status.context.packageRoot` and keep its
`contextId`. Deduplicate repeated runs by `contextId`; ask the user to choose only when multiple
distinct lint or test contexts match. If none exists, report that there is no stored evidence
and continue to the capture choice in step 5.
3. Prefer existing evidence. When a context exists, use `snapshot_list` with that `contextId` to
select a completed `rslint` or `rstest` snapshot, then query `diagnostics_list` or `test_results`.
4. Report freshness as `fresh`, `stale`, `partial`, or `unknown`, including changed paths when
reported. Report completeness separately as `complete` or `partial`, including any reported
coverage bounds.
5. Ask before running `lint_snapshot` or `test_snapshot`. These are explicit executions, not
passive queries. For a monorepo package, pass its checkout-relative `packageRoot`; pass
`configPath` only to select a nonstandard checkout-relative Rstack config. Without
`packageRoot`, capture defaults to the checkout root, and without `configPath`, it uses the
ordinary `rstack.config.ts|js|mts|mjs` in the selected package. Never start watch mode.
6. Surface the first actionable failure with its project, path, test name or rule, and recorded
message. Then summarize remaining failures briefly.
7. When aggregate execution or cross-producer diagnostics would help explain one file, call
`code_evidence` with its exact checkout-relative path and the selected `testSnapshotId` or
`lintSnapshotId`. Treat each returned axis and its freshness or completeness independently.
Check `diagnostics.truncated`; when true, report the returned and total counts before the first
actionable items.
8. When the user asks to select related tests, recommend
`rs test list --related <files> --json`; related selection is not an MCP tool.

Use `lint_fix_preview` only when the lint snapshot recorded a preview. Do not apply it. Recommend
an explicit `rs lint --fix <path>` only when the user wants to make that change.
9 changes: 5 additions & 4 deletions .agents/skills/release-rstack/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: release-rstack
description: Create a coordinated release pull request for the `rstack` and `create-rstack` npm packages. Use when asked to prepare, create, or open an rstack package release PR.
description: Create a coordinated release pull request for the `rstack`, `@rstackjs/context`, and `create-rstack` npm packages. Use when asked to prepare, create, or open an rstack package release PR.
---

# Release Rstack
Expand All @@ -13,7 +13,8 @@ If the version is missing, ask for it before making changes.

## Version rules

- Read both package versions before editing. Require the rstack target to be a valid, increasing SemVer version.
- Read all three package versions before editing. Require the rstack target to be a valid, increasing SemVer version.
- Keep `@rstackjs/context` on exactly the same version as `rstack`.
- Keep the package version lines independent. Apply the rstack bump type to the current `create-rstack` version:
- Patch: increment the patch version.
- Minor: increment the minor version and reset patch to `0`.
Expand All @@ -29,13 +30,13 @@ If the version is missing, ask for it before making changes.

3. Create and switch to `release/v<version>` from the clean default-branch HEAD.

4. Update the `version` field in `packages/rstack/package.json` to `<version>` and the `version` field in `packages/create-rstack/package.json` to the derived `create-rstack` version.
4. Update the `version` fields in `packages/rstack/package.json` and `packages/context/package.json` to `<version>`. Update the `version` field in `packages/create-rstack/package.json` to the derived `create-rstack` version.

5. In every `packages/create-rstack/template-*/package.json`, set the `rstack` dependency to `^<version>`. Update only that dependency entry and verify every template package manifest uses the same target version.

6. Run `pnpm --filter rstack build:native` to regenerate `packages/rstack/binding.cjs` and `packages/rstack/binding.d.cts` for the new version. Do not edit generated binding files manually.

7. Review the diff and confirm it contains only both package version changes, the template `rstack` dependency updates, and the regenerated binding files above. Verify the two package version changes use the intended matching bump type and no template retains an older rstack version.
7. Review the diff and confirm it contains only the three package version changes, the template `rstack` dependency updates, and the regenerated binding files above. Verify `rstack` and `@rstackjs/context` have the same target version, `create-rstack` uses the intended matching bump type, and no template retains an older rstack version.

8. Create a commit with this exact message: `release: v<version>`.

Expand Down
36 changes: 36 additions & 0 deletions .agents/skills/review-context-change/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: review-context-change
description: Review changes between two compatible Rstack lint or test snapshots, including freshness and stored lint fix previews. Use this skill when comparing before-and-after diagnostics or tests; use debug-dev-cycle for one current result.
---

# Review an Rstack context change

1. Call `project_status` first. Match the requested package to `project_status.context.packageRoot`,
deduplicating repeated runs by `contextId` and asking the user to choose only when multiple distinct contexts match. Use
`snapshot_list` with that `contextId` and require two compatible completed snapshots for the same
producer, context, package root, selected Rstack config, and capture selection. The list is
newest-first: pass the older snapshot as `leftSnapshotId` and the newer snapshot as
`rightSnapshotId`.
2. When no compatible pair exists, state which explicit capture supplies each missing snapshot:
`lint_snapshot` for an Rslint comparison or `test_snapshot` for an Rstest comparison. Include the
checkout-relative `packageRoot` and any nonstandard `configPath`. Ask before running each capture.
3. Call `snapshot_diff` with `diagnostics` for Rslint or `tests` for Rstest. If it reports
incompatibility, explain the listed reasons and stop the comparison.
4. Report the independent freshness of both snapshots before interpreting the delta. Never imply
that partial or unknown evidence covers unobserved source files.
5. Summarize added, removed, and changed items. Lead with new failures or errors, then resolved
items, then lower-severity or timing-only changes.
6. When aggregate execution or exact-path diagnostics would clarify one changed file, call
`code_evidence` with its exact checkout-relative path and the relevant explicit snapshot ID.
Keep that point-in-time evidence separate from the snapshot delta.
Check `diagnostics.truncated`; when true, report the returned and total counts instead of treating
the diagnostic items as exhaustive.
7. For a changed lint file, call `lint_fix_preview` only when the preview would materially help the
review. If the snapshot did not capture one, report that it is unavailable. Treat returned text
as review material and never apply it.
8. Recommend explicit verification appropriate to the change, such as `rs lint <path>`,
`rs test <file>`, or `rs test list --related <files> --json`.

Do not run a capture unless the user asks for fresh execution. When they do, reuse the
checkout-relative `packageRoot` and optional `configPath` for the context under review. Never
start watch mode.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Task 3 Report

Status: DONE

## Changes

- Stopped workspace discovery after processing the nearest `.git` root.
- Canonicalized an existing loaded Rsbuild or Rslib config path once before observer creation.
- Removed unused stats timings and replaced unbounded metadata intermediates with one-pass bounded
asset, chunk, and chunk-file collectors while preserving `BuildMetadataFacet` output.
- Added high-cardinality valid/invalid metadata, ancestor-workspace, and symlinked-config fixtures.

## TDD evidence

- RED: `pnpm --filter rstack test run tests/context/build.test.ts` failed because `toJson`
received `timings: true` in the existing lifecycle and new high-cardinality tests.
- RED: `pnpm --filter rstack test run tests/context/workspace.test.ts` failed because discovery
returned the unrelated ancestor workspace instead of the nearest checkout root.
- RED: `pnpm --filter rstack test run tests/context/injection.test.ts -t 'canonicalizes a
symlinked loaded config path'` failed for both app and lib because no context run was captured.
- GREEN: full build, workspace, and injection test files passed (24 passed).

## Verification

- `pnpm check`: passed with 0 lint errors, 0 type errors, 0 warnings, and no formatting issues.
- Full assigned-file run: 24 of 24 tests passed after removing the obsolete path/identifier-defense
and snapshot-size-cap fixtures from the branch's deleted security scope.

## Commit

`perf(rstack): bound passive build extraction`

## Concerns

None.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
### Task 5: simplify report lookup and align documentation

**Files:**

- Modify: `packages/rstack/src/context/rsdoctor.ts`
- Modify: `packages/rstack/src/context/report.ts`
- Modify: `packages/rstack/tests/context/report.test.ts`
- Modify: `website/docs/en/guide/cli/mcp.mdx`
- Modify: `website/docs/zh/guide/cli/mcp.mdx`
- Modify: `docs/rfcs/0001-rstack-context-engine.md`
- Modify: `docs/superpowers/plans/2026-08-12-rsdoctor-context.md`
- Modify: `docs/superpowers/plans/2026-08-12-context-branch-simplification.md`

**Interfaces:**

- Report lookup returns a discriminated `missing | file` result instead of requiring callers to
inspect exception messages.
- Report links use ordinary resolved file URIs; no server or command is started.

- [x] **Step 1: write typed-outcome report tests and verify RED**

Cover missing conventional report, one valid sibling, ambiguous siblings, and manifest fallback.
Assert no control flow depends on an exception message.

- [x] **Step 2: implement the typed boundary**

Use ordinary resolved paths and `stat` to return discriminated outcomes. The report resolver owns
file lookup directly and consumes typed outcomes.

- [x] **Step 3: align English, Chinese, and RFC status**

Document the exact three-tool Phase 1 surface, direct Rsdoctor JSON contract, optional GUI links, and
deferred retention. Update both branch planning documents to match the implemented functional
contract, rewriting only the minimum surrounding sentences needed to keep them readable as
implementation history.

- [x] **Step 4: run full verification and commit**

Run `pnpm check`, `pnpm check:spell`, `pnpm build`,
`pnpm --filter rstack build:native`, and `pnpm test`; commit as
`docs: align the lean context foundation`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Task 5 report

## Result

- Report-file lookup now returns a typed `missing | file` outcome from ordinary resolved paths and
`stat`, so report selection no longer branches on exception text.
- Rsdoctor artifact validation now returns the normalized data-file path directly; the previous
closure-bearing report helper is gone.
- Report selection still prefers the conventional sibling HTML report, then one unambiguous sibling
HTML file, then the workspace manifest, and otherwise returns the structured analysis next action.
- English, Chinese, the RFC, and both implementation plans now describe the exact three-tool Phase 1
surface, direct Rsdoctor JSON results, optional GUI links, and deferred destructive retention.

## TDD evidence

- RED: `pnpm --filter rstack test -- tests/context/report.test.ts` failed at the new typed-missing
assertion because `resolveReportFile` did not exist.
- GREEN: the same focused command passed after the typed lookup was implemented: 313 passed and 1
skipped across 314 Rstack tests.

## Verification

Repository-required sequence:

- `pnpm check` — passed with 0 lint errors, 0 type errors, and 0 warnings.
- `pnpm check:spell` — passed with 0 spelling issues and no heading-case issues.
- `pnpm build` — passed for `rstack` and `create-rstack`.
- `pnpm --filter rstack build:native` — passed.
- `pnpm test` — passed: Rstack 313 passed and 1 skipped; create-rstack 28 passed.
Loading