Skip to content

Proposal: add jcode-harness embedded skills and LLM wiki memory loop#151

Open
chapzin wants to merge 136 commits into
1jehuang:masterfrom
chapzin:feature/embedded-skills-harness
Open

Proposal: add jcode-harness embedded skills and LLM wiki memory loop#151
chapzin wants to merge 136 commits into
1jehuang:masterfrom
chapzin:feature/embedded-skills-harness

Conversation

@chapzin
Copy link
Copy Markdown

@chapzin chapzin commented May 6, 2026

Summary

This PR is a proposal/reference implementation for a jcode-harness product direction on top of jcode internals. It focuses on making agent work more auditable and reproducible by combining:

  • offline embedded skills;
  • deterministic skill routing;
  • local LLM wiki memory guidance;
  • project /init scaffolding and swarm-analysis artifacts;
  • scriptable harness/quality-gate documentation;
  • a README that explains the fork architecture and engineering loop.

The intent is not to force a direct merge of a large generated branch. Per the repository contribution policy, this PR is meant to make the design direction, tests, tradeoffs, and evidence reviewable so the maintainer can reuse, adapt, or rewrite the parts that fit upstream.

Problem / motivation

Long-running agent work can fail quietly when:

  • previous decisions are lost in chat history;
  • skill/prompt behavior is implicit rather than versioned;
  • project bootstrap produces no durable artifacts;
  • completion is claimed without repeatable evidence;
  • automation-facing output is not validated as a contract.

This branch explores a local-first harness layer that keeps those concerns explicit in repo files, docs, tests, and CLI contracts.

Main changes

Embedded skills and routing

  • Adds built-in llmwiki-memory skill for safe use of local LLM wiki memory, provenance, transcript sync, and secret boundaries.
  • Keeps karpathy-guidelines, optimization, and clean-code-guardian as offline built-ins.
  • Embeds built-ins through src/skill_pack.rs with include_str!.
  • Extends src/skill_router.rs so wiki/project-memory/prior-decision/provenance tasks select llmwiki-memory.
  • Fixes a router false positive by replacing the broad "pr" trigger with "pull request", avoiding matches inside words like prior or project.

/init and project-local harness artifacts

  • Adds deterministic .jcode/ init artifacts for project status, init questions, skills/MCP plans, and swarm-analysis plan/report files.
  • Documents the expected /init swarm flow: architecture, QA, documentation/onboarding, and tooling/security discovery roles with synthesis blocked on a report barrier.
  • Updates generated skills plan output so llmwiki-memory is part of the bootstrap guidance.

Docs and README

  • Rewrites the README around the jcode-harness fork thesis.
  • Adds docs/assets/jcode-harness-loop.svg, a visual engineering-loop diagram inspired by the style of chapzin/codex-harness-mcp.
  • Adds an “At a glance” layer table and a “How the engineering is put together” section.
  • Updates docs/CODEX_BOOTSTRAP.md, docs/SKILLS_HARNESS.md, docs/SKILLS_HARNESS_STATUS.md, and release gates to reflect the Jcode + local LLM wiki + Karpathy-skills scope.
  • Refreshes generated onboarding context and .jcode/side_panel/status.md.

Tests / cleanup

  • Adds/updates unit and e2e coverage for built-in skill parsing, skill routing, JSON skill output, and harness CLI skill exposure.
  • Suppresses the deprecated Claude subprocess enum warning only in the legacy compatibility assertion test with a local #[allow(deprecated)].

Validation run

Commands run successfully during this branch:

cargo fmt --check
cargo check -p jcode
cargo test -p jcode project_init --lib -- --nocapture
cargo test -p jcode test_init_command --lib -- --nocapture
cargo test -p jcode skill_router --lib
cargo test -p jcode skill::tests --lib
cargo test -p jcode clean_code --lib
cargo test --test e2e harness_cli -- --nocapture
cargo run -q -p jcode --bin jcode-harness -- skills list --json | python3 -m json.tool >/dev/null
cargo run -q -p jcode --bin jcode-harness -- skills show llmwiki-memory --json | python3 -m json.tool >/dev/null
cargo run -q -p jcode --bin jcode-harness -- skills doctor --json | python3 -m json.tool >/dev/null

Also run successfully:

selfdev build target=auto

Note: selfdev reload was attempted after a successful build, but the reload tool returned Could not find jcode repository directory. selfdev status still showed the new build channel/recent build.

README-specific validation:

python3 - <<'PY'
from pathlib import Path
s = Path('README.md').read_text()
assert '## How the engineering is put together' in s
assert s.count('![jcode-harness engineering loop]') == 1
assert s.count('```') % 2 == 0
PY
git diff --check

Tradeoffs and review notes

  • This is a large product-direction branch, so it may be more useful as a reference/proposal than a direct merge.
  • The README intentionally changes the repo presentation from generic upstream jcode to jcode-harness; that may be too fork-specific for upstream without a different landing-page strategy.
  • LLM wiki integration is currently a safe embedded skill and routing layer, not a hard runtime dependency. This avoids adding mandatory MCP/network behavior.
  • MCP remains review-first. No remote MCP servers are installed or enabled by this branch.
  • llmwiki-memory treats wiki memory as provenance/context, not source-code truth. Code claims still need repository/test evidence.
  • The generated .jcode/ artifacts are project-local harness state and may need upstream discussion about whether they belong in-tree or only in initialized projects.

Security / safety boundaries

  • Built-in skills load locally/offline.
  • No credentials, provider tokens, .env values, deployment secrets, database credentials, cookies, or private keys should be synced into LLM wiki memory.
  • No live-provider smoke test is added; JSON/NDJSON contracts are validated with a deterministic mock provider path.
  • No MCP server is auto-installed or auto-enabled.

Suggested maintainer review path

If this is too broad to merge directly, the most reusable slices are likely:

  1. the conservative skill-router tests and "pr" false-positive fix;
  2. the built-in llmwiki-memory skill as an optional/local memory guidance layer;
  3. the JSON/e2e skill exposure tests;
  4. the /init swarm-analysis design and docs as a reference for future bootstrap UX;
  5. the README/product narrative as fork documentation rather than upstream homepage content.

View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants