← ClaudeAtlas

webnovel-learnlisted

Extract successful writing patterns from current session and write to project_memory.json
nntrivi2001/wordsmith · ★ 2 · Data & Documents · score 73
Install: claude install-skill nntrivi2001/wordsmith
# /webnovel-learn ## Project Root Guard (must verify first) - Must execute in project root directory (requires `.webnovel/state.json` to exist) - Use unified entry point to parse project root, avoid writing to wrong directory: ```bash export WORKSPACE_ROOT="${CLAUDE_PROJECT_DIR:-$PWD}" export SCRIPTS_DIR="${CLAUDE_PLUGIN_ROOT:?}/scripts" export PROJECT_ROOT="$(python -X utf8 "${SCRIPTS_DIR}/webnovel.py" --project-root "${WORKSPACE_ROOT}" where)" ``` ## Goal Extract reusable writing patterns (hooks/pacing/dialogue/payoffs etc.), append to `.webnovel/project_memory.json`. ## Execution Flow 1. Read `progress.current_chapter` from `"$PROJECT_ROOT/.webnovel/state.json"` as current chapter number; if missing use `source_chapter: null`, do not block. 2. Parse user input (experience text after `/webnovel-learn`; if empty take approved writing approach from this conversation), classify `pattern_type` (hook/pacing/dialogue/payoff/emotion/format/other, use `other` if cannot classify). 3. Call `project-memory add-pattern` to write, must not hand-write or concatenate JSON: ```bash python -X utf8 "${SCRIPTS_DIR}/webnovel.py" --project-root "${PROJECT_ROOT}" project-memory add-pattern \ --pattern-type "{pattern_type}" \ --description "{full description from user input or extracted}" \ --category "{classification, optional}" \ --importance "{high|medium|low}" ``` ## Constraints - Do not delete old records, only append. - Before appending scan existing `patterns`; if `patter