Skip to content

by-carlos/daikenja / skills/tensei

tensei

Verified

Installs, updates, or removes Tensei, the Daikenja way of working (~/.claude/daikenja/tensei.md): how answers are shaped, how designs are recommended, and how the work behind them is done. Shows what changes, asks once to adopt it, adds the CLAUDE.md import line, and backs up anything it would overwrite.

Tensei

Install or reconcile Tensei -- the way-of-working document at ~/.claude/daikenja/tensei.md (answer shape, markers and register, how a design is recommended, and working practice), imported by a @~/.claude/daikenja/tensei.md line at the end of ~/.claude/CLAUDE.md -- on the machine this session is running on.

Slash-only, on purpose. This skill writes a file outside the project, in the user's home directory, and can append a line to the CLAUDE.md that governs every session on the machine. Nothing about "set up my persona" or "install tensei" should make it fire by itself -- the user runs /daikenja:tensei when they mean to. disable-model-invocation: true is what enforces that.

Not part of daikenja.yaml, and no dependency on setup-user. Tensei governs conversation and how the session works, not deliverables -- it is a different contract from voice.md and unrelated to the profile: block, personas.md, or writing_style. A user can run this skill with no Daikenja configuration on disk at all, so it carries its own environment gate (Step 0) rather than assuming setup-user already ran.

Not a blank template, unlike personas.md and writing-style.md. Those two are copied once, on absence, and never inspected again -- the user owns everything written into them from that point on. templates/tensei.md is maintained content this plugin ships and revises; an installed copy the user has not hand-edited can be updated to a newer shipped version. Step 2's five-state model is what makes that safe: it never overwrites a copy the user changed without saying so first.

One companion file: plan-review-lenses.md. Tensei's Recommending a design section runs the plan-review lenses from ~/.claude/daikenja/plan-review-lenses.md, a byte-identical copy of the planning plugin's lens spec that this plugin ships as templates/plan-review-lenses.md. Tensei is imported as plain context and cannot read ${CLAUDE_PLUGIN_ROOT}, so the copy has to sit next to it. It is a reference copy, not a file the user edits: it gets no state of its own and no manifest field. It is current when it matches the shipped file and missing otherwise (absent or different). Any adopt option in Step 3 writes a missing lens file -- also when a local-edit tensei.md is left in place -- and Step 5 removes it with tensei.md.

Step 0: the environment gate

Try to list ~/.claude/ (the real OS home directory, not the project working tree) and confirm it looks like a live Claude Code install -- at least one of ~/.claude/settings.json, ~/.claude/CLAUDE.md or ~/.claude/plugins/ exists there.

  • It resolves and at least one marker exists. Proceed.

  • It does not resolve, is empty, or none of the markers exist. Stop and say:

    This session has no persistent home directory with a Claude Code install in
    it, which this skill needs to read and write ~/.claude/daikenja/. Nothing
    was written.
    

Step 1: read what already exists

Before asking anything:

  • ~/.claude/daikenja/tensei.md -- read it if present.
  • ~/.claude/daikenja/plan-review-lenses.md -- note whether it is present.
  • ~/.claude/daikenja/.tensei-manifest.json -- read it if present. Malformed JSON: stop, name the file, say the user should fix or remove it. Never rewrite a file that could not be read.
  • ~/.claude/CLAUDE.md -- read it if present, and check whether a line reading exactly @~/.claude/daikenja/tensei.md already exists (compare after stripping the line ending and surrounding whitespace, and anywhere in the file, not only at the end -- another installer may have placed it inside a slot of its own).

Step 2: state and report

Hash the shipped payload (${CLAUDE_PLUGIN_ROOT}/templates/tensei.md) and, if present, the installed file, with a short inline command rather than eyeballing a diff -- python -c "import hashlib,sys;print(hashlib.sha256(open(sys.argv[1],'rb').read()).hexdigest())" <path> works on every platform this plugin supports.

InstalledManifest installed_hashCompareState
absent----new
presentabsentinstalled == shippedunchanged (untracked -- see the adoption note below)
presentabsentinstalled != shippedconflict (no record to tell a local edit from an independently-placed file)
presentpresentinstalled == shippedunchanged
presentpresentinstalled == manifest hash, shipped != manifest hashupdate
presentpresentinstalled != manifest hash, shipped == manifest hashlocal-edit
presentpresentinstalled != manifest hash, shipped != manifest hashconflict

One report before asking anything:

StateSay
newNot installed here -- show the adoption summary below, then propose adopting it.
unchangedNothing to do for the file.
updateInstalled copy is untouched since last install and the payload moved -- show the adoption summary for what changed, then propose a clean update; the full diff (diff <installed> <shipped> or equivalent) on request.
local-editThe user edited the installed copy by hand and the payload did not move -- propose leaving it, report it once. Never install over it silently.
conflictBoth moved, or there is no manifest to tell the two apart -- show the diff, offer to overwrite or leave it, never install silently.

A local-edit or conflict an install would discard is named plainly -- the backup in Step 4 is the only place the discarded version survives.

The adoption summary. Adopting Tensei changes how every session on the machine behaves, so the user sees what they are agreeing to before the gate. Read the shipped templates/tensei.md and write five to eight plain lines, one per section, each saying what the agent will do differently -- "leads with the finding and stops, pushing back first when the premise is wrong", not "applies the discipline section". For an update, summarize only the sections whose text changed. Build it from the shipped file every time, never from memory or a stored copy, so the summary cannot drift from what is installed. Close with one line: the user's own CLAUDE.md still wins wherever the two differ.

Report the import line's presence in the same pass: missing -- propose adding it alongside a file install. A bare import line with no file behind it is never useful, so never propose it alone.

Hash the lens file against ${CLAUDE_PLUGIN_ROOT}/templates/plan-review-lenses.md the same way and report it in the same pass. A missing one is proposed alongside whatever else the run writes, or on its own when nothing else moved -- a clean Adopt that writes only the lens file. One that is present but differs is reported as differing from the shipped copy, not as a hand edit -- after a plugin update that is the usual cause -- and the report says writing replaces it (backed up first).

A plan reporting unchanged with the import line already present and the lens file current is one line: "Already installed and current -- nothing to change." No gate follows.

Adoption. unchanged with no manifest is the one exception: the file matches the payload but nothing records that, so the next update would read a later hand edit as a conflict instead of a local-edit. Say so in one line and offer to record the manifest -- a new file, no other write, no backup needed. Its import_line_added_by_skill is false: this run did not add the line. Declining is fine and leaves everything as it was.

Step 3: the gate

One closed question, and installing is the acknowledgement: there is no separate consent step. The question is "Adopt this way of working?" for a new install and "Adopt the updated way of working?" for an update; it also says whether the import line will be added. Step 2 already delivered the summary in its own turn.

Options -- on a clean new or update only the first and last appear:

  • Adopt (Recommended) -- writes the file (new/update), the import line if missing, and a missing lens file. Never touches a local-edit or conflict tensei.md. When the lens file is the only thing to write, the question is "Install the design-review lenses Tensei reads?".
  • Adopt and overwrite my local edit -- offered only when the state is local-edit or conflict; say plainly that the local version is backed up, not discarded outright.
  • Record the manifest only -- offered only in the adoption case above; writes .tensei-manifest.json and nothing else.
  • Not now -- stop, write nothing.

Never write without an explicit yes. The manifest Step 4 writes -- which version was installed (installed_hash) and when (installed_at) -- is the record of what the user adopted. It stays on this machine; nothing is reported anywhere else.

Step 4: apply

  1. Back up whatever is about to be replaced, before writing anything: copy the current ~/.claude/daikenja/tensei.md (if it exists) to ~/.claude/backups/tensei-<UTC timestamp>/tensei.md, a lens file about to be replaced to plan-review-lenses.md in the same folder, and, only if the import line is about to be added and ~/.claude/CLAUDE.md already exists, copy it to ~/.claude/backups/tensei-<UTC timestamp>/CLAUDE.md first.

  2. Write ~/.claude/daikenja/tensei.md verbatim from ${CLAUDE_PLUGIN_ROOT}/templates/tensei.md, if the gate approved a file write, and ~/.claude/daikenja/plan-review-lenses.md verbatim from ${CLAUDE_PLUGIN_ROOT}/templates/plan-review-lenses.md when it is missing.

  3. Append the import line (@~/.claude/daikenja/tensei.md, on its own line, at the end of the file) if the gate approved it and it is not already present. Keep the file's existing line ending (CRLF stays CRLF), make sure the previous last line is terminated before appending, and end the file with one newline. Create ~/.claude/CLAUDE.md with just that line if the file does not exist yet.

  4. Write the manifest at ~/.claude/daikenja/.tensei-manifest.json:

    {
      "installed_hash": "<sha256 of the file just written>",
      "installed_at": "<UTC ISO-8601 timestamp>",
      "import_line_added_by_skill": true
    }
    

    Write it only when this run wrote tensei.md, added the import line, or took the manifest-only option -- a run that writes only the lens file leaves the manifest as it was. installed_hash is always the hash of tensei.md, never of the lens file, and it changes only when this run wrote tensei.md or recorded the manifest; otherwise carry it forward, so a hand-edited copy is never recorded as installed.

    Set import_line_added_by_skill only if this run is the one that added it; otherwise carry forward whatever the existing manifest already had for that field. Merge onto the existing manifest rather than replacing it wholesale, so a manifest that later gains fields is never clobbered here.

Close with one report, per ${CLAUDE_PLUGIN_ROOT}/docs/response-format.md -- the result leads: what was written, what was backed up and where. Say plainly that the new CLAUDE.md import takes effect on the next session -- this one already loaded the old file.

Step 5: uninstalling

On an explicit ask to remove or revert the persona (not the default flow):

  1. One closed gate first (Uninstall?), same mechanics as Step 3.
  2. Back up the current file and CLAUDE.md exactly as in Step 4 before removing anything.
  3. Remove ~/.claude/daikenja/tensei.md and ~/.claude/daikenja/plan-review-lenses.md (backed up with it) if the user chose to.
  4. Remove the import line only if ~/.claude/daikenja/.tensei-manifest.json records "import_line_added_by_skill": true. A line the user wrote in by hand independently is never touched -- if the manifest doesn't say this skill added it, leave CLAUDE.md alone and say why in one line.
  5. Delete the manifest.

Report what was removed and where the backup landed.

Re-running this skill

Safe at any time. A re-run with nothing to do is one line and writes nothing, including no manifest rewrite. It never touches a local-edit file without the explicit overwrite option in Step 3, and never resolves a conflict on its own.

Coexisting with other installers of CLAUDE.md

Other tooling may own and regenerate ~/.claude/CLAUDE.md from a skeleton (the carlos plugin's setup-wow does, and keeps a slot for exactly this import line). The contract that keeps the two from fighting:

  • This skill only ever appends one plain line or removes that exact line; it never restructures the file, and it never reads anything under ~/.claude/reference/ or any other installer's manifest.
  • After this skill appends the line, an installer that hashes CLAUDE.md will see it as changed on its next run. That is correct: it should surface the line and carry it forward, not silently drop it. If it does drop it, a re-run of this skill reports the line as missing and re-adds it.
  • If another installer later moves the line into its own slot, import_line_added_by_skill stays whatever this skill recorded -- the line is still the one this skill added, wherever it now sits, so uninstall still removes it.
  • ~/.claude/daikenja/tensei.md, plan-review-lenses.md and .tensei-manifest.json are this skill's alone. Nothing else should write them, and this skill writes nothing else.

Failure cases

SituationWhat to do
No persistent ~/.claude (Step 0)Stop. Nothing written. Never write into the project tree instead.
${CLAUDE_PLUGIN_ROOT}/templates/tensei.md or templates/plan-review-lenses.md cannot be readStop. Name the path. Never reconstruct the payload from memory.
.tensei-manifest.json will not parseStop. Name the file, say the user should fix or remove it. Never rewrite a file that could not be read.
No manifest, and the installed file differs from shippedCorrect behaviour, not an error: reads as conflict. Show the diff and ask.
No manifest, and the installed file matches shippedunchanged, untracked. Offer to record the manifest (Step 2, Adoption); never treat it as an error.
CLAUDE.md contains the import line more than onceReport it; on an install leave the file alone (the import is already active), on an uninstall remove every copy only if the manifest says this skill added it, otherwise none.
State is local-editLeave it by default. Report it once. Only the explicit overwrite option in Step 3 installs over it.
~/.claude/CLAUDE.md does not exist yetThe import line is absent by definition; adding it creates the file with just that line. Not a failure.
The user declines the gateWrite nothing, say so in one line, close. Not a failure.
Uninstall asked for a line the manifest didn't record as added by this skillLeave CLAUDE.md untouched, remove the file only if that step was chosen, say in one line why the line was left.
~/.claude/CLAUDE.md will not parse as UTF-8 text (binary or corrupt)Stop. Report the problem; never guess at where to insert or remove the import line.
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall